code string | signature string | docstring string | loss_without_docstring float64 | loss_with_docstring float64 | factor float64 |
|---|---|---|---|---|---|
internal_assert(0 < len(tokens) <= 3, "invalid slice args", tokens)
args = []
for arg in tokens:
if not arg:
arg = "None"
args.append(arg)
if len(args) == 1:
return args[0]
else:
return "_coconut.slice(" + ", ".join(args) + ")" | def subscriptgroup_handle(tokens) | Process subscriptgroups. | 3.828043 | 3.894734 | 0.982877 |
internal_assert(len(tokens) == 2, "invalid implicit itemgetter args", tokens)
op, args = tokens
if op == "[":
return "_coconut.operator.itemgetter(" + args + ")"
elif op == "$[":
return "_coconut.functools.partial(_coconut_igetitem, index=" + args + ")"
else:
raise Cocon... | def itemgetter_handle(tokens) | Process implicit itemgetter partials. | 4.725186 | 4.372224 | 1.080728 |
if len(tokens) == 1:
return tokens[0]
elif len(tokens) == 2:
return tokens[0] + "\n" + tokens[0] + " = " + tokens[1]
else:
raise CoconutInternalException("invalid in-line nonlocal / global tokens", tokens) | def namelist_handle(tokens) | Process inline nonlocal and global statements. | 4.472023 | 3.38065 | 1.322829 |
if len(tokens) < 1:
raise CoconutInternalException("invalid function composition tokens", tokens)
elif len(tokens) == 1:
return tokens[0]
else:
return "_coconut_forward_compose(" + ", ".join(reversed(tokens)) + ")" | def compose_item_handle(tokens) | Process function composition. | 3.844811 | 3.643967 | 1.055117 |
internal_assert(len(tokens) == 2, "invalid tail-call-optimizable return statement tokens", tokens)
if tokens[1].startswith("()"):
return "return _coconut_tail_call(" + tokens[0] + ")" + tokens[1][2:] # tokens[1] contains \n
else:
return "return _coconut_tail_call(" + tokens[0] + ", " +... | def tco_return_handle(tokens) | Process tail-call-optimizable return statements. | 4.755258 | 3.87791 | 1.226242 |
internal_assert(len(tokens) == 2, "invalid function definition splitting tokens", tokens)
func_name = tokens[0]
func_args = []
func_params = []
for arg in tokens[1]:
if len(arg) > 1 and arg[0] in ("*", "**"):
func_args.append(arg[1])
elif arg[0] != "*":
f... | def split_func_name_args_params_handle(tokens) | Process splitting a function into name, params, and args. | 2.693502 | 2.646917 | 1.0176 |
if len(tokens) == 2:
(func, insert_after_docstring), body = tokens
docstring = None
elif len(tokens) == 3:
(func, insert_after_docstring), docstring, body = tokens
else:
raise CoconutInternalException("invalid docstring insertion tokens", tokens)
# insert_after_docst... | def join_match_funcdef(tokens) | Join the pieces of a pattern-matching function together. | 4.473371 | 4.54699 | 0.983809 |
internal_assert(len(tokens) == 2, "invalid where statement tokens", tokens)
base_stmt, assignment_stmts = tokens
stmts = list(assignment_stmts) + [base_stmt]
return "\n".join(stmts) + "\n" | def where_stmt_handle(tokens) | Process a where statement. | 5.524135 | 5.410114 | 1.021075 |
for varname, val in vars(Grammar).items():
if isinstance(val, ParserElement):
setattr(Grammar, varname, val.setName(varname)) | def set_grammar_names() | Set names of grammar elements to their variable names. | 4.23081 | 3.802062 | 1.112767 |
if isinstance(args, (str, bytes)):
args = args.split()
return CLI.cmd(args=args, interact=interact) | def cmd(args, interact=False) | Process command-line arguments. | 4.187116 | 4.078153 | 1.026719 |
if which in VERSIONS:
return VERSIONS[which]
else:
raise CoconutException(
"invalid version type " + ascii(which),
extra="valid versions are " + ", ".join(VERSIONS),
) | def version(which="num") | Get the Coconut version. | 6.272529 | 5.257157 | 1.193141 |
if CLI.comp is None:
setup()
if mode in PARSERS:
return PARSERS[mode](CLI.comp)(code)
else:
raise CoconutException(
"invalid parse mode " + ascii(mode),
extra="valid modes are " + ", ".join(PARSERS),
) | def parse(code="", mode="sys") | Compile Coconut code. | 8.148076 | 6.415809 | 1.27 |
if on:
if coconut_importer not in sys.meta_path:
sys.meta_path.insert(0, coconut_importer)
else:
try:
sys.meta_path.remove(coconut_importer)
except ValueError:
pass | def auto_compilation(on=True) | Turn automatic compilation of Coconut files on or off. | 2.385948 | 2.091916 | 1.140556 |
basepaths = [""] + list(sys.path)
if fullname.startswith("."):
if path is None:
# we can't do a relative import if there's no package path
return None
fullname = fullname[1:]
basepaths.insert(0, path)
fullpath = os.path... | def find_module(self, fullname, path=None) | Searches for a Coconut file of the given name and compiles it. | 3.280913 | 2.950655 | 1.111927 |
units = None
if hasattr(self, 'find_code_units'):
self.find_code_units(morfs)
else:
units = self.find_file_reporters(morfs)
if units is None:
if hasattr(self, 'code_units'):
units = self.code_units
else:
... | def report(self, morfs=None) | Generate a part of json report for coveralls
`morfs` is a list of modules or filenames.
`outfile` is a file object to write the json to. | 4.217847 | 4.080336 | 1.033701 |
if not analysis.has_arcs():
return None
branch_lines = analysis.branch_lines()
branches = []
for l1, l2 in analysis.arcs_executed():
if l1 in branch_lines:
branches.extend((l1, 0, abs(l2), 1))
for l1, l2 in analysis.arcs_missing... | def get_arcs(analysis) | Hit stats for each branch.
Returns a flat list where every four values represent a branch:
1. line-number
2. block-number (not used)
3. branch-number
4. hits (we only get 1/0 from coverage.py) | 3.573339 | 3.121219 | 1.144854 |
if hasattr(analysis, 'parser'):
filename = cu.file_locator.relative_filename(cu.filename)
source_lines = analysis.parser.lines
with cu.source_file() as source_file:
source = source_file.read()
try:
if sys.version_info < (3... | def parse_file(self, cu, analysis) | Generate data for single file | 3.823455 | 3.736774 | 1.023197 |
try:
branch = (os.environ.get('APPVEYOR_REPO_BRANCH')
or os.environ.get('BUILDKITE_BRANCH')
or os.environ.get('CI_BRANCH')
or os.environ.get('CIRCLE_BRANCH')
or os.environ.get('GIT_BRANCH')
or os.environ.get('TRAV... | def git_info() | A hash of Git data that can be used to display more information to users.
Example:
"git": {
"head": {
"id": "5e837ce92220be64821128a70f6093f836dd2c05",
"author_name": "Wil Gieseler",
"author_email": "wil@example.com",
"committer_na... | 2.252246 | 2.137823 | 1.053523 |
data = self.create_data()
try:
json_string = json.dumps(data)
except UnicodeDecodeError as e:
log.error('ERROR: While preparing JSON:', exc_info=e)
self.debug_bad_encoding(data)
raise
log_string = re.sub(r'"repo_token": "(.+?)"',
... | def create_report(self) | Generate json dumped report for coveralls api. | 4.831698 | 4.480587 | 1.078363 |
try:
report = self.create_report()
except coverage.CoverageException as e:
log.error('Failure to gather coverage:', exc_info=e)
else:
with open(file_path, 'w') as report_file:
report_file.write(report) | def save_report(self, file_path) | Write coveralls report to file. | 3.540019 | 3.11374 | 1.136903 |
r
if self._data:
return self._data
self._data = {'source_files': self.get_coverage()}
self._data.update(git_info())
self._data.update(self.config)
if extra:
if 'source_files' in extra:
self._data['source_files'].extend(extra['sourc... | def create_data(self, extra=None) | r"""
Generate object for api.
Example json:
{
"service_job_id": "1234567890",
"service_name": "travis-ci",
"source_files": [
{
"name": "example.py",
"source": "def four\n 4\n... | 5.076972 | 4.456977 | 1.139107 |
at_fault_files = set()
for source_file_data in data['source_files']:
for value in source_file_data.values():
try:
json.dumps(value)
except UnicodeDecodeError:
at_fault_files.add(source_file_data['name'])
... | def debug_bad_encoding(data) | Let's try to help user figure out what is at fault. | 4.418778 | 3.734873 | 1.183113 |
data = self.api_client.set_primary_account(self.id, **params)
self.update(data)
return data | def set_primary(self, **params) | https://developers.coinbase.com/api/v2#set-account-as-primary | 4.663577 | 3.476969 | 1.341276 |
data = self.api_client.update_account(self.id, **params)
self.update(data)
return data | def modify(self, **params) | https://developers.coinbase.com/api#modify-an-account | 5.170713 | 3.758654 | 1.375682 |
return self.api_client.get_address(self.id, address_id, **params) | def get_address(self, address_id, **params) | https://developers.coinbase.com/api/v2#show-addresss | 4.070246 | 3.96208 | 1.0273 |
return self.api_client.get_address_transactions(self.id, address_id, **params) | def get_address_transactions(self, address_id, **params) | https://developers.coinbase.com/api/v2#list-address39s-transactions | 4.174567 | 3.81734 | 1.09358 |
return self.api_client.get_transaction(self.id, transaction_id, **params) | def get_transaction(self, transaction_id, **params) | https://developers.coinbase.com/api/v2#show-a-transaction | 4.398554 | 4.15334 | 1.05904 |
return self.api_client.get_buy(self.id, buy_id, **params) | def get_buy(self, buy_id, **params) | https://developers.coinbase.com/api/v2#show-a-buy | 4.46903 | 3.940252 | 1.134199 |
return self.api_client.commit_buy(self.id, buy_id, **params) | def commit_buy(self, buy_id, **params) | https://developers.coinbase.com/api/v2#commit-a-buy | 4.723713 | 3.808186 | 1.24041 |
return self.api_client.get_sell(self.id, sell_id, **params) | def get_sell(self, sell_id, **params) | https://developers.coinbase.com/api/v2#show-a-sell | 4.162341 | 3.675597 | 1.132426 |
return self.api_client.commit_sell(self.id, sell_id, **params) | def commit_sell(self, sell_id, **params) | https://developers.coinbase.com/api/v2#commit-a-sell | 4.590466 | 3.611072 | 1.27122 |
return self.api_client.get_deposit(self.id, deposit_id, **params) | def get_deposit(self, deposit_id, **params) | https://developers.coinbase.com/api/v2#show-a-deposit | 4.438192 | 4.015794 | 1.105184 |
return self.api_client.commit_deposit(self.id, deposit_id, **params) | def commit_deposit(self, deposit_id, **params) | https://developers.coinbase.com/api/v2#commit-a-deposit | 5.278245 | 3.931676 | 1.342492 |
return self.api_client.get_withdrawal(self.id, withdrawal_id, **params) | def get_withdrawal(self, withdrawal_id, **params) | https://developers.coinbase.com/api/v2#show-a-withdrawal | 3.822782 | 3.469015 | 1.101979 |
return self.api_client.commit_withdrawal(self.id, withdrawal_id, **params) | def commit_withdrawal(self, withdrawal_id, **params) | https://developers.coinbase.com/api/v2#commit-a-withdrawal | 4.539541 | 3.362309 | 1.350126 |
response = self.api_client._post(self.resource_path, 'complete')
return self.api_client._make_api_object(response, APIObject) | def complete(self) | https://developers.coinbase.com/api/v2#complete-request-money | 7.405444 | 6.387019 | 1.159452 |
response = self.api_client._post(self.resource_path, 'resend')
return self.api_client._make_api_object(response, APIObject) | def resend(self) | https://developers.coinbase.com/api/v2#re-send-request-money | 7.012098 | 6.558415 | 1.069176 |
response = self.api_client._post(self.resource_path, 'cancel')
return self.api_client._make_api_object(response, APIObject) | def cancel(self) | https://developers.coinbase.com/api/v2#cancel-request-money | 7.588012 | 6.589903 | 1.15146 |
data = self.api_client.update_current_user(**params)
self.update(data)
return data | def modify(self, **params) | https://developers.coinbase.com/api/v2#update-current-user | 6.385703 | 3.803219 | 1.679026 |
cleaned = {}
for key, value in six.iteritems(params):
if drop_nones and value is None:
continue
if recursive and isinstance(value, dict):
value = clean_params(value, drop_nones, recursive)
cleaned[key] = value
return cleaned | def clean_params(params, drop_nones=True, recursive=True) | Clean up a dict of API parameters to be sent to the Coinbase API.
Some endpoints require boolean options to be represented as integers. By
default, will remove all keys whose value is None, so that they will not be
sent to the API endpoint at all. | 1.797099 | 2.081867 | 0.863215 |
cleaned = clean_params(params, **kwargs)
return json.dumps(cleaned) | def encode_params(params, **kwargs) | Clean and JSON-encode a dict of parameters. | 6.353356 | 4.116314 | 1.543458 |
if urlparse(uri).scheme != 'https':
warning_message = (
'WARNING: this client is sending a request to an insecure'
' API endpoint. Any API request you make may expose your API key and'
' secret to third parties. Consider using the default endpoint:\n\n'
'... | def check_uri_security(uri) | Warns if the URL is insecure. | 6.370853 | 5.674154 | 1.122785 |
try:
blob = blob or response.json()
except json.JSONDecodeError:
blob = {}
error_list = blob.get('errors', None)
error = (error_list[0] if error_list else {})
if error:
error_id = error.get('id', '')
error_message = error.get('message', '')
else:
# In... | def build_api_error(response, blob=None) | Helper method for creating errors and attaching HTTP response/request
details to them. | 2.954129 | 3.054003 | 0.967297 |
session = requests.session()
session.auth = auth_class(*args, **kwargs)
session.headers.update({'CB-VERSION': self.API_VERSION,
'Accept': 'application/json',
'Content-Type': 'application/json',
... | def _build_session(self, auth_class, *args, **kwargs) | Internal helper for creating a requests `session` with the correct
authentication handling. | 2.795497 | 2.711196 | 1.031093 |
return urljoin(self.BASE_API_URI, '/'.join(imap(quote, parts))) | def _create_api_uri(self, *parts) | Internal helper for creating fully qualified endpoint URIs. | 6.901066 | 6.159786 | 1.120342 |
uri = self._create_api_uri(*relative_path_parts)
data = kwargs.get('data', None)
if data and isinstance(data, dict):
kwargs['data'] = encode_params(data)
if self.VERIFY_SSL:
kwargs.setdefault('verify', COINBASE_CRT_PATH)
else:
kwargs.s... | def _request(self, method, *relative_path_parts, **kwargs) | Internal helper for creating HTTP requests to the Coinbase API.
Raises an APIError if the response is not 20X. Otherwise, returns the
response object. Not intended for direct use by API consumers. | 2.957565 | 2.726358 | 1.084804 |
if not str(response.status_code).startswith('2'):
raise build_api_error(response)
return response | def _handle_response(self, response) | Internal helper for handling API responses from the Coinbase server.
Raises the appropriate exceptions when necessary; otherwise, returns the
response. | 5.612052 | 6.432447 | 0.87246 |
prev_data = kwargs.pop('prev_data', [])
resp = self._request('get', *args, **kwargs)
resp_content = resp._content
if not resp_content:
# No content so its obviously not paginated
return resp
# if resp._content is a bytes object, decode it so we c... | def _get(self, *args, **kwargs) | Get requests can be paginated, ensure we iterate through all the pages. | 3.384864 | 3.167727 | 1.068546 |
response = self._get('v2', 'currencies', params=params)
return self._make_api_object(response, APIObject) | def get_currencies(self, **params) | https://developers.coinbase.com/api/v2#currencies | 7.336139 | 5.927888 | 1.237564 |
response = self._get('v2', 'exchange-rates', params=params)
return self._make_api_object(response, APIObject) | def get_exchange_rates(self, **params) | https://developers.coinbase.com/api/v2#exchange-rates | 6.147892 | 5.422771 | 1.133718 |
currency_pair = params.get('currency_pair', 'BTC-USD')
response = self._get('v2', 'prices', currency_pair, 'buy', params=params)
return self._make_api_object(response, APIObject) | def get_buy_price(self, **params) | https://developers.coinbase.com/api/v2#get-buy-price | 5.190133 | 4.030271 | 1.287788 |
if 'currency_pair' in params:
currency_pair = params['currency_pair']
else:
currency_pair = 'BTC-USD'
response = self._get('v2', 'prices', currency_pair, 'historic', params=params)
return self._make_api_object(response, APIObject) | def get_historic_prices(self, **params) | https://developers.coinbase.com/api/v2#get-historic-prices | 3.777956 | 3.217248 | 1.174282 |
response = self._get('v2', 'time', params=params)
return self._make_api_object(response, APIObject) | def get_time(self, **params) | https://developers.coinbase.com/api/v2#time | 6.900208 | 5.196284 | 1.327912 |
response = self._get('v2', 'users', user_id, params=params)
return self._make_api_object(response, User) | def get_user(self, user_id, **params) | https://developers.coinbase.com/api/v2#show-a-user | 4.634875 | 3.547003 | 1.306702 |
response = self._get('v2', 'user', params=params)
return self._make_api_object(response, CurrentUser) | def get_current_user(self, **params) | https://developers.coinbase.com/api/v2#show-current-user | 6.670294 | 4.711219 | 1.415832 |
response = self._get('v2', 'user', 'auth', params=params)
return self._make_api_object(response, APIObject) | def get_auth_info(self, **params) | https://developers.coinbase.com/api/v2#show-authorization-information | 7.244462 | 5.520818 | 1.312208 |
response = self._put('v2', 'user', data=params)
return self._make_api_object(response, CurrentUser) | def update_current_user(self, **params) | https://developers.coinbase.com/api/v2#update-current-user | 8.370107 | 5.674094 | 1.475144 |
response = self._get('v2', 'accounts', params=params)
return self._make_api_object(response, Account) | def get_accounts(self, **params) | https://developers.coinbase.com/api/v2#list-accounts | 5.699361 | 4.546814 | 1.253484 |
response = self._get('v2', 'accounts', account_id, params=params)
return self._make_api_object(response, Account) | def get_account(self, account_id, **params) | https://developers.coinbase.com/api/v2#show-an-account | 4.410998 | 3.792511 | 1.163081 |
response = self._post('v2', 'accounts', data=params)
return self._make_api_object(response, Account) | def create_account(self, **params) | https://developers.coinbase.com/api/v2#create-account | 5.621271 | 4.248655 | 1.323071 |
response = self._post('v2', 'accounts', account_id, 'primary', data=params)
return self._make_api_object(response, Account) | def set_primary_account(self, account_id, **params) | https://developers.coinbase.com/api/v2#set-account-as-primary | 5.417001 | 4.370837 | 1.239351 |
response = self._put('v2', 'accounts', account_id, data=params)
return self._make_api_object(response, Account) | def update_account(self, account_id, **params) | https://developers.coinbase.com/api/v2#update-account | 5.530183 | 4.41832 | 1.251649 |
response = self._get('v2', 'notifications', params=params)
return self._make_api_object(response, Notification) | def get_notifications(self, **params) | https://developers.coinbase.com/api/v2#list-notifications | 5.640851 | 4.28046 | 1.317814 |
response = self._get('v2', 'notifications', notification_id, params=params)
return self._make_api_object(response, Notification) | def get_notification(self, notification_id, **params) | https://developers.coinbase.com/api/v2#show-a-notification | 4.42099 | 3.489418 | 1.266971 |
response = self._get('v2', 'accounts', account_id, 'addresses', params=params)
return self._make_api_object(response, Address) | def get_addresses(self, account_id, **params) | https://developers.coinbase.com/api/v2#list-addresses | 4.366894 | 3.721932 | 1.173287 |
response = self._get('v2', 'accounts', account_id, 'addresses', address_id, params=params)
return self._make_api_object(response, Address) | def get_address(self, account_id, address_id, **params) | https://developers.coinbase.com/api/v2#show-addresss | 3.71603 | 3.094176 | 1.200975 |
response = self._get(
'v2',
'accounts',
account_id,
'addresses',
address_id,
'transactions',
params=params)
return self._make_api_object(response, Transaction) | def get_address_transactions(self, account_id, address_id, **params) | https://developers.coinbase.com/api/v2#list-address39s-transactions | 3.49111 | 3.031479 | 1.151619 |
response = self._post('v2', 'accounts', account_id, 'addresses', data=params)
return self._make_api_object(response, Address) | def create_address(self, account_id, **params) | https://developers.coinbase.com/api/v2#create-address | 4.875195 | 3.86775 | 1.260473 |
response = self._get('v2', 'accounts', account_id, 'transactions', params=params)
return self._make_api_object(response, Transaction) | def get_transactions(self, account_id, **params) | https://developers.coinbase.com/api/v2#list-transactions | 4.517772 | 3.929734 | 1.149638 |
response = self._get(
'v2', 'accounts', account_id, 'transactions', transaction_id, params=params)
return self._make_api_object(response, Transaction) | def get_transaction(self, account_id, transaction_id, **params) | https://developers.coinbase.com/api/v2#show-a-transaction | 3.82202 | 3.484323 | 1.096919 |
for required in ['to', 'amount', 'currency']:
if required not in params:
raise ValueError("Missing required parameter: %s" % required)
params['type'] = 'send'
response = self._post('v2', 'accounts', account_id, 'transactions', data=params)
return self... | def send_money(self, account_id, **params) | https://developers.coinbase.com/api/v2#send-money | 3.69761 | 3.120669 | 1.184877 |
response = self._post(
'v2', 'accounts', account_id, 'transactions', request_id,
'complete', data=params)
return self._make_api_object(response, APIObject) | def complete_request(self, account_id, request_id, **params) | https://developers.coinbase.com/api/v2#complete-request-money | 5.553604 | 5.09519 | 1.08997 |
response = self._get('v2', 'reports', data=params)
return self._make_api_object(response, Report) | def get_reports(self, **params) | https://developers.coinbase.com/api/v2#list-all-reports | 6.278182 | 4.829198 | 1.300047 |
response = self._get('v2', 'reports', report_id, data=params)
return self._make_api_object(response, Report) | def get_report(self, report_id, **params) | https://developers.coinbase.com/api/v2#show-a-report | 5.177064 | 3.974437 | 1.302591 |
if 'type' not in params and 'email' not in params:
raise ValueError("Missing required parameter: 'type' or 'email'")
response = self._post('v2', 'reports', data=params)
return self._make_api_object(response, Report) | def create_report(self, **params) | https://developers.coinbase.com/api/v2#generate-a-new-report | 4.272707 | 3.407768 | 1.253814 |
response = self._get('v2', 'accounts', account_id, 'buys', params=params)
return self._make_api_object(response, Buy) | def get_buys(self, account_id, **params) | https://developers.coinbase.com/api/v2#list-buys | 4.037088 | 3.439631 | 1.173698 |
response = self._get('v2', 'accounts', account_id, 'buys', buy_id, params=params)
return self._make_api_object(response, Buy) | def get_buy(self, account_id, buy_id, **params) | https://developers.coinbase.com/api/v2#show-a-buy | 3.356574 | 2.90082 | 1.157112 |
if 'amount' not in params and 'total' not in params:
raise ValueError("Missing required parameter: 'amount' or 'total'")
for required in ['currency', 'payment_method']:
if required not in params:
raise ValueError("Missing required parameter: %s" % require... | def buy(self, account_id, **params) | https://developers.coinbase.com/api/v2#buy-bitcoin | 3.053445 | 2.757029 | 1.107513 |
response = self._post(
'v2', 'accounts', account_id, 'buys', buy_id, 'commit', data=params)
return self._make_api_object(response, Buy) | def commit_buy(self, account_id, buy_id, **params) | https://developers.coinbase.com/api/v2#commit-a-buy | 4.298299 | 3.58147 | 1.20015 |
response = self._get('v2', 'accounts', account_id, 'sells', params=params)
return self._make_api_object(response, Sell) | def get_sells(self, account_id, **params) | https://developers.coinbase.com/api/v2#list-sells | 4.04911 | 3.401978 | 1.190222 |
response = self._get(
'v2', 'accounts', account_id, 'sells', sell_id, params=params)
return self._make_api_object(response, Sell) | def get_sell(self, account_id, sell_id, **params) | https://developers.coinbase.com/api/v2#show-a-sell | 3.681495 | 3.287501 | 1.119846 |
if 'amount' not in params and 'total' not in params:
raise ValueError("Missing required parameter: 'amount' or 'total'")
for required in ['currency']:
if required not in params:
raise ValueError("Missing required parameter: %s" % required)
respons... | def sell(self, account_id, **params) | https://developers.coinbase.com/api/v2#sell-bitcoin | 3.268554 | 2.935064 | 1.113623 |
response = self._post(
'v2', 'accounts', account_id, 'sells', sell_id, 'commit', data=params)
return self._make_api_object(response, Sell) | def commit_sell(self, account_id, sell_id, **params) | https://developers.coinbase.com/api/v2#commit-a-sell | 4.300475 | 3.675047 | 1.170182 |
response = self._get('v2', 'accounts', account_id, 'deposits', params=params)
return self._make_api_object(response, Deposit) | def get_deposits(self, account_id, **params) | https://developers.coinbase.com/api/v2#list-deposits | 3.90949 | 3.423967 | 1.141801 |
response = self._get(
'v2', 'accounts', account_id, 'deposits', deposit_id, params=params)
return self._make_api_object(response, Deposit) | def get_deposit(self, account_id, deposit_id, **params) | https://developers.coinbase.com/api/v2#show-a-deposit | 3.591351 | 3.222565 | 1.114439 |
for required in ['payment_method', 'amount', 'currency']:
if required not in params:
raise ValueError("Missing required parameter: %s" % required)
response = self._post('v2', 'accounts', account_id, 'deposits', data=params)
return self._make_api_object(respon... | def deposit(self, account_id, **params) | https://developers.coinbase.com/api/v2#deposit-funds | 3.752785 | 2.938787 | 1.276985 |
response = self._post(
'v2', 'accounts', account_id, 'deposits', deposit_id, 'commit',
data=params)
return self._make_api_object(response, Deposit) | def commit_deposit(self, account_id, deposit_id, **params) | https://developers.coinbase.com/api/v2#commit-a-deposit | 4.142699 | 3.591973 | 1.153321 |
response = self._get('v2', 'accounts', account_id, 'withdrawals', params=params)
return self._make_api_object(response, Withdrawal) | def get_withdrawals(self, account_id, **params) | https://developers.coinbase.com/api/v2#list-withdrawals | 3.950395 | 3.370131 | 1.172178 |
response = self._get(
'v2', 'accounts', account_id, 'withdrawals', withdrawal_id, params=params)
return self._make_api_object(response, Withdrawal) | def get_withdrawal(self, account_id, withdrawal_id, **params) | https://developers.coinbase.com/api/v2#show-a-withdrawal | 3.490876 | 3.092865 | 1.128687 |
for required in ['payment_method', 'amount', 'currency']:
if required not in params:
raise ValueError("Missing required parameter: %s" % required)
response = self._post('v2', 'accounts', account_id, 'withdrawals', data=params)
return self._make_api_object(res... | def withdraw(self, account_id, **params) | https://developers.coinbase.com/api/v2#withdraw-funds | 3.940702 | 3.123938 | 1.261453 |
response = self._post(
'v2', 'accounts', account_id, 'withdrawals', withdrawal_id, 'commit',
data=params)
return self._make_api_object(response, Withdrawal) | def commit_withdrawal(self, account_id, withdrawal_id, **params) | https://developers.coinbase.com/api/v2#commit-a-withdrawal | 4.029916 | 3.531093 | 1.141266 |
response = self._get('v2', 'payment-methods', params=params)
return self._make_api_object(response, PaymentMethod) | def get_payment_methods(self, **params) | https://developers.coinbase.com/api/v2#list-payment-methods | 5.599907 | 3.87578 | 1.444847 |
response = self._get('v2', 'payment-methods', payment_method_id, params=params)
return self._make_api_object(response, PaymentMethod) | def get_payment_method(self, payment_method_id, **params) | https://developers.coinbase.com/api/v2#show-a-payment-method | 4.323432 | 3.284354 | 1.316372 |
response = self._get('v2', 'merchants', merchant_id, params=params)
return self._make_api_object(response, Merchant) | def get_merchant(self, merchant_id, **params) | https://developers.coinbase.com/api/v2#show-a-merchant | 4.53681 | 3.426852 | 1.3239 |
response = self._get('v2', 'orders', params=params)
return self._make_api_object(response, Order) | def get_orders(self, **params) | https://developers.coinbase.com/api/v2#list-orders | 5.576984 | 4.598198 | 1.212863 |
response = self._get('v2', 'orders', order_id, params=params)
return self._make_api_object(response, Order) | def get_order(self, order_id, **params) | https://developers.coinbase.com/api/v2#show-an-order | 4.466415 | 3.686099 | 1.211692 |
for required in ['amount', 'currency', 'name']:
if required not in params:
raise ValueError("Missing required parameter: %s" % required)
response = self._post('v2', 'orders', data=params)
return self._make_api_object(response, Order) | def create_order(self, **params) | https://developers.coinbase.com/api/v2#create-an-order | 4.302654 | 3.403389 | 1.264226 |
for required in ['currency']:
if required not in params:
raise ValueError("Missing required parameter: %s" % required)
response = self._post('v2', 'orders', order_id, 'refund', data=params)
return self._make_api_object(response, Order) | def refund_order(self, order_id, **params) | https://developers.coinbase.com/api/v2#refund-an-order | 4.726118 | 3.562223 | 1.326733 |
response = self._get('v2', 'checkouts', params=params)
return self._make_api_object(response, Checkout) | def get_checkouts(self, **params) | https://developers.coinbase.com/api/v2#list-checkouts | 5.653742 | 4.044893 | 1.397748 |
response = self._get('v2', 'checkouts', checkout_id, params=params)
return self._make_api_object(response, Checkout) | def get_checkout(self, checkout_id, **params) | https://developers.coinbase.com/api/v2#show-a-checkout | 4.694341 | 3.447069 | 1.361835 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.