@staticmethod
    def login_to_salesforce(username, password):
        env_vars = (
            'SALESFORCE_CLIENT_ID',
            'SALESFORCE_CLIENT_SECRET',
            'SALESFORCE_REDIRECT_URI',
        )
        missing_env_vars = [e for e in env_vars if e not in os.environ]
        if missing_env_vars:
            raise RuntimeError(
                "You must set {0} to use username/pass login".format(
                    ', '.join(missing_env_vars)))

        try:
            import salesforce_oauth_request
        except ImportError:
            raise ImportError(
                "You must install salesforce-oauth-request to use username/password")

        packet = salesforce_oauth_request.login(
            username=username, password=password)
        return packet['access_token'], packet['instance_url']
dataset/ETHPy150Open heroku/salesforce-bulk/salesforce_bulk/salesforce_bulk.py/SalesforceBulk.login_to_salesforce/original