code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def _code_support(self, language, caller): """Helper callback.""" code = caller() # remove the leading whitespace so the whole block can be indented more easily with flow of page lines = code.splitlines() first_nonempty_line_index = 0 while not lines[first_nonempty_line...
def function[_code_support, parameter[self, language, caller]]: constant[Helper callback.] variable[code] assign[=] call[name[caller], parameter[]] variable[lines] assign[=] call[name[code].splitlines, parameter[]] variable[first_nonempty_line_index] assign[=] constant[0] while <...
keyword[def] identifier[_code_support] ( identifier[self] , identifier[language] , identifier[caller] ): literal[string] identifier[code] = identifier[caller] () identifier[lines] = identifier[code] . identifier[splitlines] () identifier[first_nonempty_line_index] = lit...
def _code_support(self, language, caller): """Helper callback.""" code = caller() # remove the leading whitespace so the whole block can be indented more easily with flow of page lines = code.splitlines() first_nonempty_line_index = 0 while not lines[first_nonempty_line_index]: first_non...
def random_2in4sat(num_variables, num_clauses, vartype=dimod.BINARY, satisfiable=True): """Random two-in-four (2-in-4) constraint satisfaction problem. Args: num_variables (integer): Number of variables (at least four). num_clauses (integer): Number of constraints that together constitute the ...
def function[random_2in4sat, parameter[num_variables, num_clauses, vartype, satisfiable]]: constant[Random two-in-four (2-in-4) constraint satisfaction problem. Args: num_variables (integer): Number of variables (at least four). num_clauses (integer): Number of constraints that together con...
keyword[def] identifier[random_2in4sat] ( identifier[num_variables] , identifier[num_clauses] , identifier[vartype] = identifier[dimod] . identifier[BINARY] , identifier[satisfiable] = keyword[True] ): literal[string] keyword[if] identifier[num_variables] < literal[int] : keyword[raise] identif...
def random_2in4sat(num_variables, num_clauses, vartype=dimod.BINARY, satisfiable=True): """Random two-in-four (2-in-4) constraint satisfaction problem. Args: num_variables (integer): Number of variables (at least four). num_clauses (integer): Number of constraints that together constitute the ...
def calculate_leapdays(init_date, final_date): """Currently unsupported, it only works for differences in years.""" leap_days = (final_date.year - 1) // 4 - (init_date.year - 1) // 4 leap_days -= (final_date.year - 1) // 100 - (init_date.year - 1) // 100 leap_days += (final_date.year - 1) // 400 - (ini...
def function[calculate_leapdays, parameter[init_date, final_date]]: constant[Currently unsupported, it only works for differences in years.] variable[leap_days] assign[=] binary_operation[binary_operation[binary_operation[name[final_date].year - constant[1]] <ast.FloorDiv object at 0x7da2590d6bc0> const...
keyword[def] identifier[calculate_leapdays] ( identifier[init_date] , identifier[final_date] ): literal[string] identifier[leap_days] =( identifier[final_date] . identifier[year] - literal[int] )// literal[int] -( identifier[init_date] . identifier[year] - literal[int] )// literal[int] identifier[le...
def calculate_leapdays(init_date, final_date): """Currently unsupported, it only works for differences in years.""" leap_days = (final_date.year - 1) // 4 - (init_date.year - 1) // 4 leap_days -= (final_date.year - 1) // 100 - (init_date.year - 1) // 100 leap_days += (final_date.year - 1) // 400 - (init...
def set_emergency_params( self, workers_step=None, idle_cycles_max=None, queue_size=None, queue_nonzero_delay=None): """Sets busyness algorithm emergency workers related params. Emergency workers could be spawned depending upon uWSGI backlog state. .. note:: These options are Linux...
def function[set_emergency_params, parameter[self, workers_step, idle_cycles_max, queue_size, queue_nonzero_delay]]: constant[Sets busyness algorithm emergency workers related params. Emergency workers could be spawned depending upon uWSGI backlog state. .. note:: These options are Linux only....
keyword[def] identifier[set_emergency_params] ( identifier[self] , identifier[workers_step] = keyword[None] , identifier[idle_cycles_max] = keyword[None] , identifier[queue_size] = keyword[None] , identifier[queue_nonzero_delay] = keyword[None] ): literal[string] identifier[self] . identifier[_set...
def set_emergency_params(self, workers_step=None, idle_cycles_max=None, queue_size=None, queue_nonzero_delay=None): """Sets busyness algorithm emergency workers related params. Emergency workers could be spawned depending upon uWSGI backlog state. .. note:: These options are Linux only. :...
def enable_gui(gui=None, app=None): """Switch amongst GUI input hooks by name. This is just a utility wrapper around the methods of the InputHookManager object. Parameters ---------- gui : optional, string or None If None (or 'none'), clears input hook, otherwise it must be one of ...
def function[enable_gui, parameter[gui, app]]: constant[Switch amongst GUI input hooks by name. This is just a utility wrapper around the methods of the InputHookManager object. Parameters ---------- gui : optional, string or None If None (or 'none'), clears input hook, otherwise it ...
keyword[def] identifier[enable_gui] ( identifier[gui] = keyword[None] , identifier[app] = keyword[None] ): literal[string] keyword[if] identifier[get_return_control_callback] () keyword[is] keyword[None] : keyword[raise] identifier[ValueError] ( literal[string] ) identifier[guis] ={ iden...
def enable_gui(gui=None, app=None): """Switch amongst GUI input hooks by name. This is just a utility wrapper around the methods of the InputHookManager object. Parameters ---------- gui : optional, string or None If None (or 'none'), clears input hook, otherwise it must be one of ...
def p_postfix_expr(self, p): """postfix_expr : left_hand_side_expr | left_hand_side_expr PLUSPLUS | left_hand_side_expr MINUSMINUS """ if len(p) == 2: p[0] = p[1] else: p[0] = ast.UnaryOp(op=p[2], value=p[1], postfix...
def function[p_postfix_expr, parameter[self, p]]: constant[postfix_expr : left_hand_side_expr | left_hand_side_expr PLUSPLUS | left_hand_side_expr MINUSMINUS ] if compare[call[name[len], parameter[name[p]]] equal[==] constant[2]] begin[:] ...
keyword[def] identifier[p_postfix_expr] ( identifier[self] , identifier[p] ): literal[string] keyword[if] identifier[len] ( identifier[p] )== literal[int] : identifier[p] [ literal[int] ]= identifier[p] [ literal[int] ] keyword[else] : identifier[p] [ literal[int...
def p_postfix_expr(self, p): """postfix_expr : left_hand_side_expr | left_hand_side_expr PLUSPLUS | left_hand_side_expr MINUSMINUS """ if len(p) == 2: p[0] = p[1] # depends on [control=['if'], data=[]] else: p[0] = ast.UnaryOp(op=p[2],...
def storage_uri_for_key(key): """Returns a StorageUri for the given key. :type key: :class:`boto.s3.key.Key` or subclass :param key: URI naming bucket + optional object. """ if not isinstance(key, boto.s3.key.Key): raise InvalidUriError('Requested key (%s) is not a subclass of ' ...
def function[storage_uri_for_key, parameter[key]]: constant[Returns a StorageUri for the given key. :type key: :class:`boto.s3.key.Key` or subclass :param key: URI naming bucket + optional object. ] if <ast.UnaryOp object at 0x7da1b2651fc0> begin[:] <ast.Raise object at 0x7da1b26530...
keyword[def] identifier[storage_uri_for_key] ( identifier[key] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[key] , identifier[boto] . identifier[s3] . identifier[key] . identifier[Key] ): keyword[raise] identifier[InvalidUriError] ( literal[string] l...
def storage_uri_for_key(key): """Returns a StorageUri for the given key. :type key: :class:`boto.s3.key.Key` or subclass :param key: URI naming bucket + optional object. """ if not isinstance(key, boto.s3.key.Key): raise InvalidUriError('Requested key (%s) is not a subclass of boto.s3.key.K...
def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw): r"""Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a DSON document) to a Python object. If ``s`` is a ``str`` instance and is encoded with a...
def function[loads, parameter[s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook]]: constant[Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a DSON document) to a Python object. If ``s`` is a ``str`` instance and is encoded with an ASCII based encod...
keyword[def] identifier[loads] ( identifier[s] , identifier[encoding] = keyword[None] , identifier[cls] = keyword[None] , identifier[object_hook] = keyword[None] , identifier[parse_float] = keyword[None] , identifier[parse_int] = keyword[None] , identifier[parse_constant] = keyword[None] , identifier[object_pairs_ho...
def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw): """Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a DSON document) to a Python object. If ``s`` is a ``str`` instance and is encoded with an ASCII b...
def _process_module(self, name, contents, parent, match, filepath=None): """Processes a regex match for a module to create a CodeElement.""" #First, get hold of the name and contents of the module so that we can process the other #parts of the module. modifiers = [] #We need to ...
def function[_process_module, parameter[self, name, contents, parent, match, filepath]]: constant[Processes a regex match for a module to create a CodeElement.] variable[modifiers] assign[=] list[[]] if call[name[self].RE_PRIV.search, parameter[name[contents]]] begin[:] call[name...
keyword[def] identifier[_process_module] ( identifier[self] , identifier[name] , identifier[contents] , identifier[parent] , identifier[match] , identifier[filepath] = keyword[None] ): literal[string] identifier[modifiers] =[] keyword[if] identifier[self] . ide...
def _process_module(self, name, contents, parent, match, filepath=None): """Processes a regex match for a module to create a CodeElement.""" #First, get hold of the name and contents of the module so that we can process the other #parts of the module. modifiers = [] #We need to check for the private...
def start_discovery(add_callback=None, remove_callback=None): """ Start discovering chromecasts on the network. This method will start discovering chromecasts on a separate thread. When a chromecast is discovered, the callback will be called with the discovered chromecast's zeroconf name. This is t...
def function[start_discovery, parameter[add_callback, remove_callback]]: constant[ Start discovering chromecasts on the network. This method will start discovering chromecasts on a separate thread. When a chromecast is discovered, the callback will be called with the discovered chromecast's zer...
keyword[def] identifier[start_discovery] ( identifier[add_callback] = keyword[None] , identifier[remove_callback] = keyword[None] ): literal[string] identifier[listener] = identifier[CastListener] ( identifier[add_callback] , identifier[remove_callback] ) identifier[service_browser] = keyword[False] ...
def start_discovery(add_callback=None, remove_callback=None): """ Start discovering chromecasts on the network. This method will start discovering chromecasts on a separate thread. When a chromecast is discovered, the callback will be called with the discovered chromecast's zeroconf name. This is t...
def get(self, pk): """ Returns the object for the key Override it for efficiency. """ for item in self.store.get(self.query_class): # coverts pk value to correct type pk = item.properties[item.pk].col_type(pk) if getattr(item, item.pk) ...
def function[get, parameter[self, pk]]: constant[ Returns the object for the key Override it for efficiency. ] for taget[name[item]] in starred[call[name[self].store.get, parameter[name[self].query_class]]] begin[:] variable[pk] assign[=] call[call[name[it...
keyword[def] identifier[get] ( identifier[self] , identifier[pk] ): literal[string] keyword[for] identifier[item] keyword[in] identifier[self] . identifier[store] . identifier[get] ( identifier[self] . identifier[query_class] ): identifier[pk] = identifier[item] . identifie...
def get(self, pk): """ Returns the object for the key Override it for efficiency. """ for item in self.store.get(self.query_class): # coverts pk value to correct type pk = item.properties[item.pk].col_type(pk) if getattr(item, item.pk) == pk: r...
def get_suffix_tree(self, suffix_tree_id): """Returns a suffix tree entity, equipped with node and edge repos it (at least at the moment) needs. """ suffix_tree = self.suffix_tree_repo[suffix_tree_id] assert isinstance(suffix_tree, GeneralizedSuffixTree) suffix_tree._node_repo = ...
def function[get_suffix_tree, parameter[self, suffix_tree_id]]: constant[Returns a suffix tree entity, equipped with node and edge repos it (at least at the moment) needs. ] variable[suffix_tree] assign[=] call[name[self].suffix_tree_repo][name[suffix_tree_id]] assert[call[name[isinstance], ...
keyword[def] identifier[get_suffix_tree] ( identifier[self] , identifier[suffix_tree_id] ): literal[string] identifier[suffix_tree] = identifier[self] . identifier[suffix_tree_repo] [ identifier[suffix_tree_id] ] keyword[assert] identifier[isinstance] ( identifier[suffix_tree] , identifie...
def get_suffix_tree(self, suffix_tree_id): """Returns a suffix tree entity, equipped with node and edge repos it (at least at the moment) needs. """ suffix_tree = self.suffix_tree_repo[suffix_tree_id] assert isinstance(suffix_tree, GeneralizedSuffixTree) suffix_tree._node_repo = self.node_repo ...
def get(self, key, default=None): """ Get an element of the collection. :param key: The index of the element :type key: mixed :param default: The default value to return :type default: mixed :rtype: mixed """ try: return self.items[k...
def function[get, parameter[self, key, default]]: constant[ Get an element of the collection. :param key: The index of the element :type key: mixed :param default: The default value to return :type default: mixed :rtype: mixed ] <ast.Try object at 0...
keyword[def] identifier[get] ( identifier[self] , identifier[key] , identifier[default] = keyword[None] ): literal[string] keyword[try] : keyword[return] identifier[self] . identifier[items] [ identifier[key] ] keyword[except] identifier[IndexError] : keyword[re...
def get(self, key, default=None): """ Get an element of the collection. :param key: The index of the element :type key: mixed :param default: The default value to return :type default: mixed :rtype: mixed """ try: return self.items[key] # depen...
def match(mode_lst: list, obj: 'object that has __destruct__ method'): """ >>> from Redy.ADT.Core import match, data, P >>> from Redy.ADT.traits import ConsInd, Discrete >>> @data >>> class List(ConsInd, Discrete): >>> # ConsInd(index following constructing) >>> # |-> Ind; >>>...
def function[match, parameter[mode_lst, obj]]: constant[ >>> from Redy.ADT.Core import match, data, P >>> from Redy.ADT.traits import ConsInd, Discrete >>> @data >>> class List(ConsInd, Discrete): >>> # ConsInd(index following constructing) >>> # |-> Ind; >>> # Discret...
keyword[def] identifier[match] ( identifier[mode_lst] : identifier[list] , identifier[obj] : literal[string] ): literal[string] keyword[try] : identifier[structure] = identifier[obj] . identifier[__destruct__] () keyword[except] identifier[AttributeError] : keyword[return]...
def match(mode_lst: list, obj: 'object that has __destruct__ method'): """ >>> from Redy.ADT.Core import match, data, P >>> from Redy.ADT.traits import ConsInd, Discrete >>> @data >>> class List(ConsInd, Discrete): >>> # ConsInd(index following constructing) >>> # |-> Ind; >>>...
def register(self, perm_func=None, model=None, allow_staff=None, allow_superuser=None, allow_anonymous=None, unauthenticated_handler=None, request_types=None, name=None, replace=False, _return_entry=False): """Register permission function & return the original function. ...
def function[register, parameter[self, perm_func, model, allow_staff, allow_superuser, allow_anonymous, unauthenticated_handler, request_types, name, replace, _return_entry]]: constant[Register permission function & return the original function. This is typically used as a decorator:: perm...
keyword[def] identifier[register] ( identifier[self] , identifier[perm_func] = keyword[None] , identifier[model] = keyword[None] , identifier[allow_staff] = keyword[None] , identifier[allow_superuser] = keyword[None] , identifier[allow_anonymous] = keyword[None] , identifier[unauthenticated_handler] = keyword[None] ...
def register(self, perm_func=None, model=None, allow_staff=None, allow_superuser=None, allow_anonymous=None, unauthenticated_handler=None, request_types=None, name=None, replace=False, _return_entry=False): """Register permission function & return the original function. This is typically used as a decorato...
def verify_precompiled_checksums(self, precompiled_path: Path) -> None: """ Compare source code checksums with those from a precompiled file. """ # We get the precompiled file data contracts_precompiled = ContractManager(precompiled_path) # Silence mypy assert self.contracts_ch...
def function[verify_precompiled_checksums, parameter[self, precompiled_path]]: constant[ Compare source code checksums with those from a precompiled file. ] variable[contracts_precompiled] assign[=] call[name[ContractManager], parameter[name[precompiled_path]]] assert[compare[name[self].contracts_ch...
keyword[def] identifier[verify_precompiled_checksums] ( identifier[self] , identifier[precompiled_path] : identifier[Path] )-> keyword[None] : literal[string] identifier[contracts_precompiled] = identifier[ContractManager] ( identifier[precompiled_path] ) keyword[assert...
def verify_precompiled_checksums(self, precompiled_path: Path) -> None: """ Compare source code checksums with those from a precompiled file. """ # We get the precompiled file data contracts_precompiled = ContractManager(precompiled_path) # Silence mypy assert self.contracts_checksums is not None ...
def __PrintAdditionalImports(self, imports): """Print additional imports needed for protorpc.""" google_imports = [x for x in imports if 'google' in x] other_imports = [x for x in imports if 'google' not in x] if other_imports: for import_ in sorted(other_imports): ...
def function[__PrintAdditionalImports, parameter[self, imports]]: constant[Print additional imports needed for protorpc.] variable[google_imports] assign[=] <ast.ListComp object at 0x7da1b0718b20> variable[other_imports] assign[=] <ast.ListComp object at 0x7da1b0719e10> if name[other_imp...
keyword[def] identifier[__PrintAdditionalImports] ( identifier[self] , identifier[imports] ): literal[string] identifier[google_imports] =[ identifier[x] keyword[for] identifier[x] keyword[in] identifier[imports] keyword[if] literal[string] keyword[in] identifier[x] ] identifier[ot...
def __PrintAdditionalImports(self, imports): """Print additional imports needed for protorpc.""" google_imports = [x for x in imports if 'google' in x] other_imports = [x for x in imports if 'google' not in x] if other_imports: for import_ in sorted(other_imports): self.__printer(imp...
def signed_number(number, precision=2): """ Return the given number as a string with a sign in front of it, ie. `+` if the number is positive, `-` otherwise. """ prefix = '' if number <= 0 else '+' number_str = '{}{:.{precision}f}'.format(prefix, number, precision=precision) return number_str
def function[signed_number, parameter[number, precision]]: constant[ Return the given number as a string with a sign in front of it, ie. `+` if the number is positive, `-` otherwise. ] variable[prefix] assign[=] <ast.IfExp object at 0x7da207f99ff0> variable[number_str] assign[=] call[con...
keyword[def] identifier[signed_number] ( identifier[number] , identifier[precision] = literal[int] ): literal[string] identifier[prefix] = literal[string] keyword[if] identifier[number] <= literal[int] keyword[else] literal[string] identifier[number_str] = literal[string] . identifier[format] ( i...
def signed_number(number, precision=2): """ Return the given number as a string with a sign in front of it, ie. `+` if the number is positive, `-` otherwise. """ prefix = '' if number <= 0 else '+' number_str = '{}{:.{precision}f}'.format(prefix, number, precision=precision) return number_str
def get_asset_details(self, **params): """Fetch details on assets. https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#asset-detail-user_data :param recvWindow: the number of milliseconds the request is valid for :type recvWindow: int :returns...
def function[get_asset_details, parameter[self]]: constant[Fetch details on assets. https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#asset-detail-user_data :param recvWindow: the number of milliseconds the request is valid for :type recvWindow: int ...
keyword[def] identifier[get_asset_details] ( identifier[self] ,** identifier[params] ): literal[string] identifier[res] = identifier[self] . identifier[_request_withdraw_api] ( literal[string] , literal[string] , keyword[True] , identifier[data] = identifier[params] ) keyword[if] keyword[...
def get_asset_details(self, **params): """Fetch details on assets. https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#asset-detail-user_data :param recvWindow: the number of milliseconds the request is valid for :type recvWindow: int :returns: AP...
def get_random_filename(content_type=None): """Get a pseudo-random, Planet-looking filename. >>> from planet.api import utils >>> print(utils.get_random_filename()) #doctest:+SKIP planet-61FPnh7K >>> print(utils.get_random_filename('image/tiff')) #doctest:+SKIP planet-V8ELYxy5.tif >>> ...
def function[get_random_filename, parameter[content_type]]: constant[Get a pseudo-random, Planet-looking filename. >>> from planet.api import utils >>> print(utils.get_random_filename()) #doctest:+SKIP planet-61FPnh7K >>> print(utils.get_random_filename('image/tiff')) #doctest:+SKIP planet-...
keyword[def] identifier[get_random_filename] ( identifier[content_type] = keyword[None] ): literal[string] identifier[extension] = identifier[mimetypes] . identifier[guess_extension] ( identifier[content_type] keyword[or] literal[string] ) keyword[or] literal[string] identifier[characters] = ident...
def get_random_filename(content_type=None): """Get a pseudo-random, Planet-looking filename. >>> from planet.api import utils >>> print(utils.get_random_filename()) #doctest:+SKIP planet-61FPnh7K >>> print(utils.get_random_filename('image/tiff')) #doctest:+SKIP planet-V8ELYxy5.tif >>> ...
def authentication_url(self): """Redirect your users to here to authenticate them.""" params = { 'client_id': self.client_id, 'response_type': self.type, 'redirect_uri': self.callback_url } return AUTHENTICATION_URL + "?" + urlencode(params)
def function[authentication_url, parameter[self]]: constant[Redirect your users to here to authenticate them.] variable[params] assign[=] dictionary[[<ast.Constant object at 0x7da20c6c4ca0>, <ast.Constant object at 0x7da20c6c5cc0>, <ast.Constant object at 0x7da20c6c70d0>], [<ast.Attribute object at 0x7d...
keyword[def] identifier[authentication_url] ( identifier[self] ): literal[string] identifier[params] ={ literal[string] : identifier[self] . identifier[client_id] , literal[string] : identifier[self] . identifier[type] , literal[string] : identifier[self] . identifier[cal...
def authentication_url(self): """Redirect your users to here to authenticate them.""" params = {'client_id': self.client_id, 'response_type': self.type, 'redirect_uri': self.callback_url} return AUTHENTICATION_URL + '?' + urlencode(params)
def run_supernova(ctx, executable, debug, quiet, environment, command, conf, echo, dashboard): """ You can use supernova with many OpenStack clients and avoid the pain of managing multiple sets of environment variables. Getting started is easy and there's some documentation that can h...
def function[run_supernova, parameter[ctx, executable, debug, quiet, environment, command, conf, echo, dashboard]]: constant[ You can use supernova with many OpenStack clients and avoid the pain of managing multiple sets of environment variables. Getting started is easy and there's some documentati...
keyword[def] identifier[run_supernova] ( identifier[ctx] , identifier[executable] , identifier[debug] , identifier[quiet] , identifier[environment] , identifier[command] , identifier[conf] , identifier[echo] , identifier[dashboard] ): literal[string] keyword[try] : identifier[nova_creds] = i...
def run_supernova(ctx, executable, debug, quiet, environment, command, conf, echo, dashboard): """ You can use supernova with many OpenStack clients and avoid the pain of managing multiple sets of environment variables. Getting started is easy and there's some documentation that can help: http:/...
def do_version(): """Return version details of the running server api""" v = ApiPool.ping.model.Version( name=ApiPool().current_server_name, version=ApiPool().current_server_api.get_version(), container=get_container_version(), ) log.info("/version: " + pprint.pformat(v)) ret...
def function[do_version, parameter[]]: constant[Return version details of the running server api] variable[v] assign[=] call[name[ApiPool].ping.model.Version, parameter[]] call[name[log].info, parameter[binary_operation[constant[/version: ] + call[name[pprint].pformat, parameter[name[v]]]]]] ...
keyword[def] identifier[do_version] (): literal[string] identifier[v] = identifier[ApiPool] . identifier[ping] . identifier[model] . identifier[Version] ( identifier[name] = identifier[ApiPool] (). identifier[current_server_name] , identifier[version] = identifier[ApiPool] (). identifier[current_...
def do_version(): """Return version details of the running server api""" v = ApiPool.ping.model.Version(name=ApiPool().current_server_name, version=ApiPool().current_server_api.get_version(), container=get_container_version()) log.info('/version: ' + pprint.pformat(v)) return v
def get_normalized_parameters(self): """Return a string that contains the parameters that must be signed.""" items = [] for key, value in self.items(): if key == 'oauth_signature': continue # 1.0a/9.1.1 states that kvp must be sorted by key, then by value,...
def function[get_normalized_parameters, parameter[self]]: constant[Return a string that contains the parameters that must be signed.] variable[items] assign[=] list[[]] for taget[tuple[[<ast.Name object at 0x7da1b1ddddb0>, <ast.Name object at 0x7da1b1ddfdc0>]]] in starred[call[name[self].items, ...
keyword[def] identifier[get_normalized_parameters] ( identifier[self] ): literal[string] identifier[items] =[] keyword[for] identifier[key] , identifier[value] keyword[in] identifier[self] . identifier[items] (): keyword[if] identifier[key] == literal[string] : ...
def get_normalized_parameters(self): """Return a string that contains the parameters that must be signed.""" items = [] for (key, value) in self.items(): if key == 'oauth_signature': continue # depends on [control=['if'], data=[]] # 1.0a/9.1.1 states that kvp must be sorted by k...
def distribute_payoff(self, match_set): """Distribute the payoff received in response to the selected action of the given match set among the rules in the action set which deserve credit for recommending the action. The match_set argument is the MatchSet instance which suggested the sele...
def function[distribute_payoff, parameter[self, match_set]]: constant[Distribute the payoff received in response to the selected action of the given match set among the rules in the action set which deserve credit for recommending the action. The match_set argument is the MatchSet instan...
keyword[def] identifier[distribute_payoff] ( identifier[self] , identifier[match_set] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[match_set] , identifier[MatchSet] ) keyword[assert] identifier[match_set] . identifier[algorithm] keyword[is] identifier[self] ...
def distribute_payoff(self, match_set): """Distribute the payoff received in response to the selected action of the given match set among the rules in the action set which deserve credit for recommending the action. The match_set argument is the MatchSet instance which suggested the selected...
def find_repositories_by_walking_and_following_symlinks(path): """Walk a tree and return a sequence of (directory, dotdir) pairs.""" repos = [] # This is for detecting symlink loops and escaping them. This is similar to # http://stackoverflow.com/questions/36977259/avoiding-infinite-recursion-with-os-w...
def function[find_repositories_by_walking_and_following_symlinks, parameter[path]]: constant[Walk a tree and return a sequence of (directory, dotdir) pairs.] variable[repos] assign[=] list[[]] def function[inode, parameter[path]]: variable[stats] assign[=] call[name[os].stat, par...
keyword[def] identifier[find_repositories_by_walking_and_following_symlinks] ( identifier[path] ): literal[string] identifier[repos] =[] keyword[def] identifier[inode] ( identifier[path] ): identifier[stats] = identifier[os] . identifier[stat] ( identifier[path] ) keyword...
def find_repositories_by_walking_and_following_symlinks(path): """Walk a tree and return a sequence of (directory, dotdir) pairs.""" repos = [] # This is for detecting symlink loops and escaping them. This is similar to # http://stackoverflow.com/questions/36977259/avoiding-infinite-recursion-with-os-wa...
def save(host=None, port=None, db=None, password=None): ''' Synchronously save the dataset to disk CLI Example: .. code-block:: bash salt '*' redis.save ''' server = _connect(host, port, db, password) return server.save()
def function[save, parameter[host, port, db, password]]: constant[ Synchronously save the dataset to disk CLI Example: .. code-block:: bash salt '*' redis.save ] variable[server] assign[=] call[name[_connect], parameter[name[host], name[port], name[db], name[password]]] re...
keyword[def] identifier[save] ( identifier[host] = keyword[None] , identifier[port] = keyword[None] , identifier[db] = keyword[None] , identifier[password] = keyword[None] ): literal[string] identifier[server] = identifier[_connect] ( identifier[host] , identifier[port] , identifier[db] , identifier[passwo...
def save(host=None, port=None, db=None, password=None): """ Synchronously save the dataset to disk CLI Example: .. code-block:: bash salt '*' redis.save """ server = _connect(host, port, db, password) return server.save()
def get_action_environment(op, name): """Return the environment for the operation.""" action = _get_action_by_name(op, name) if action: return action.get('environment')
def function[get_action_environment, parameter[op, name]]: constant[Return the environment for the operation.] variable[action] assign[=] call[name[_get_action_by_name], parameter[name[op], name[name]]] if name[action] begin[:] return[call[name[action].get, parameter[constant[environment...
keyword[def] identifier[get_action_environment] ( identifier[op] , identifier[name] ): literal[string] identifier[action] = identifier[_get_action_by_name] ( identifier[op] , identifier[name] ) keyword[if] identifier[action] : keyword[return] identifier[action] . identifier[get] ( literal[string] )
def get_action_environment(op, name): """Return the environment for the operation.""" action = _get_action_by_name(op, name) if action: return action.get('environment') # depends on [control=['if'], data=[]]
def read_md5(self, hex=False): """ Calculate the md5 hash for this file. hex - Return the digest as hex string. This reads through the entire file. """ f = self.open('rb') try: m = hashlib.md5() while True: d = f.read(8192) ...
def function[read_md5, parameter[self, hex]]: constant[ Calculate the md5 hash for this file. hex - Return the digest as hex string. This reads through the entire file. ] variable[f] assign[=] call[name[self].open, parameter[constant[rb]]] <ast.Try object at 0x7da1b247f7f0>...
keyword[def] identifier[read_md5] ( identifier[self] , identifier[hex] = keyword[False] ): literal[string] identifier[f] = identifier[self] . identifier[open] ( literal[string] ) keyword[try] : identifier[m] = identifier[hashlib] . identifier[md5] () keyword[while...
def read_md5(self, hex=False): """ Calculate the md5 hash for this file. hex - Return the digest as hex string. This reads through the entire file. """ f = self.open('rb') try: m = hashlib.md5() while True: d = f.read(8192) if not d: ...
def get_stamp(ra, decl, survey='DSS2 Red', scaling='Linear', sizepix=300, forcefetch=False, cachedir='~/.astrobase/stamp-cache', timeout=10.0, retry_failed=True, verbose=True, jitter=5.0): '...
def function[get_stamp, parameter[ra, decl, survey, scaling, sizepix, forcefetch, cachedir, timeout, retry_failed, verbose, jitter]]: constant[This gets a FITS cutout from the NASA GSFC SkyView service. This downloads stamps in FITS format from the NASA SkyView service: https://skyview.gsfc.nasa.gov/c...
keyword[def] identifier[get_stamp] ( identifier[ra] , identifier[decl] , identifier[survey] = literal[string] , identifier[scaling] = literal[string] , identifier[sizepix] = literal[int] , identifier[forcefetch] = keyword[False] , identifier[cachedir] = literal[string] , identifier[timeout] = literal[int] , id...
def get_stamp(ra, decl, survey='DSS2 Red', scaling='Linear', sizepix=300, forcefetch=False, cachedir='~/.astrobase/stamp-cache', timeout=10.0, retry_failed=True, verbose=True, jitter=5.0): """This gets a FITS cutout from the NASA GSFC SkyView service. This downloads stamps in FITS format from the NASA SkyView ...
def add_summary_stats_to_table(table_in, table_out, colnames): """Collect summary statisitics from an input table and add them to an output table Parameters ---------- table_in : `astropy.table.Table` Table with the input data. table_out : `astropy.table.Table` Table with the out...
def function[add_summary_stats_to_table, parameter[table_in, table_out, colnames]]: constant[Collect summary statisitics from an input table and add them to an output table Parameters ---------- table_in : `astropy.table.Table` Table with the input data. table_out : `astropy.table.Ta...
keyword[def] identifier[add_summary_stats_to_table] ( identifier[table_in] , identifier[table_out] , identifier[colnames] ): literal[string] keyword[for] identifier[col] keyword[in] identifier[colnames] : identifier[col_in] = identifier[table_in] [ identifier[col] ] identifier[stats] =...
def add_summary_stats_to_table(table_in, table_out, colnames): """Collect summary statisitics from an input table and add them to an output table Parameters ---------- table_in : `astropy.table.Table` Table with the input data. table_out : `astropy.table.Table` Table with the out...
def pnum_to_group(mesh_shape, group_dims, pnum): """Group number for grouped allreduce. Args: mesh_shape: a Shape group_dims: a list of integers (the dimensions reduced over) pnum: an integer Returns: an integer """ coord = pnum_to_processor_coordinates(mesh_shape, pnum) remaining_shape = ...
def function[pnum_to_group, parameter[mesh_shape, group_dims, pnum]]: constant[Group number for grouped allreduce. Args: mesh_shape: a Shape group_dims: a list of integers (the dimensions reduced over) pnum: an integer Returns: an integer ] variable[coord] assign[=] call[name[pnu...
keyword[def] identifier[pnum_to_group] ( identifier[mesh_shape] , identifier[group_dims] , identifier[pnum] ): literal[string] identifier[coord] = identifier[pnum_to_processor_coordinates] ( identifier[mesh_shape] , identifier[pnum] ) identifier[remaining_shape] = identifier[Shape] ( [ identifier[d] keyw...
def pnum_to_group(mesh_shape, group_dims, pnum): """Group number for grouped allreduce. Args: mesh_shape: a Shape group_dims: a list of integers (the dimensions reduced over) pnum: an integer Returns: an integer """ coord = pnum_to_processor_coordinates(mesh_shape, pnum) remaining_sh...
def extract_src_loss_table(dstore, loss_type): """ Extract the source loss table for a give loss type, ordered in decreasing order. Example: http://127.0.0.1:8800/v1/calc/30/extract/src_loss_table/structural """ oq = dstore['oqparam'] li = oq.lti[loss_type] source_ids = dstore['source_in...
def function[extract_src_loss_table, parameter[dstore, loss_type]]: constant[ Extract the source loss table for a give loss type, ordered in decreasing order. Example: http://127.0.0.1:8800/v1/calc/30/extract/src_loss_table/structural ] variable[oq] assign[=] call[name[dstore]][constant[...
keyword[def] identifier[extract_src_loss_table] ( identifier[dstore] , identifier[loss_type] ): literal[string] identifier[oq] = identifier[dstore] [ literal[string] ] identifier[li] = identifier[oq] . identifier[lti] [ identifier[loss_type] ] identifier[source_ids] = identifier[dstore] [ literal...
def extract_src_loss_table(dstore, loss_type): """ Extract the source loss table for a give loss type, ordered in decreasing order. Example: http://127.0.0.1:8800/v1/calc/30/extract/src_loss_table/structural """ oq = dstore['oqparam'] li = oq.lti[loss_type] source_ids = dstore['source_in...
def _gen_find_command(coll, spec, projection, skip, limit, batch_size, options, read_concern=DEFAULT_READ_CONCERN, collation=None): """Generate a find command document.""" cmd = SON([('find', coll)]) if '$query' in spec: cmd.update([(_MODIFIERS[key], val) ...
def function[_gen_find_command, parameter[coll, spec, projection, skip, limit, batch_size, options, read_concern, collation]]: constant[Generate a find command document.] variable[cmd] assign[=] call[name[SON], parameter[list[[<ast.Tuple object at 0x7da18ede76d0>]]]] if compare[constant[$query] ...
keyword[def] identifier[_gen_find_command] ( identifier[coll] , identifier[spec] , identifier[projection] , identifier[skip] , identifier[limit] , identifier[batch_size] , identifier[options] , identifier[read_concern] = identifier[DEFAULT_READ_CONCERN] , identifier[collation] = keyword[None] ): literal[string...
def _gen_find_command(coll, spec, projection, skip, limit, batch_size, options, read_concern=DEFAULT_READ_CONCERN, collation=None): """Generate a find command document.""" cmd = SON([('find', coll)]) if '$query' in spec: cmd.update([(_MODIFIERS[key], val) if key in _MODIFIERS else (key, val) for (ke...
def get_content_commit_date(extensions, acceptance_callback=None, root_dir='.'): """Get the datetime for the most recent commit to a project that affected certain types of content. Parameters ---------- extensions : sequence of 'str' Extensions of files to consid...
def function[get_content_commit_date, parameter[extensions, acceptance_callback, root_dir]]: constant[Get the datetime for the most recent commit to a project that affected certain types of content. Parameters ---------- extensions : sequence of 'str' Extensions of files to consider in ...
keyword[def] identifier[get_content_commit_date] ( identifier[extensions] , identifier[acceptance_callback] = keyword[None] , identifier[root_dir] = literal[string] ): literal[string] identifier[logger] = identifier[logging] . identifier[getLogger] ( identifier[__name__] ) keyword[def] identifier[_...
def get_content_commit_date(extensions, acceptance_callback=None, root_dir='.'): """Get the datetime for the most recent commit to a project that affected certain types of content. Parameters ---------- extensions : sequence of 'str' Extensions of files to consider in getting the most recen...
def linkfetch(self): """" Public method to call the internal methods """ request, handle = self.open() self._add_headers(request) if handle: self._get_crawled_urls(handle, request)
def function[linkfetch, parameter[self]]: constant[" Public method to call the internal methods ] <ast.Tuple object at 0x7da1b0954700> assign[=] call[name[self].open, parameter[]] call[name[self]._add_headers, parameter[name[request]]] if name[handle] begin[:] ...
keyword[def] identifier[linkfetch] ( identifier[self] ): literal[string] identifier[request] , identifier[handle] = identifier[self] . identifier[open] () identifier[self] . identifier[_add_headers] ( identifier[request] ) keyword[if] identifier[handle] : identifier[...
def linkfetch(self): """" Public method to call the internal methods """ (request, handle) = self.open() self._add_headers(request) if handle: self._get_crawled_urls(handle, request) # depends on [control=['if'], data=[]]
def feedkeys(self, keys, options='', escape_csi=True): """Push `keys` to Nvim user input buffer. Options can be a string with the following character flags: - 'm': Remap keys. This is default. - 'n': Do not remap keys. - 't': Handle keys as if typed; otherwise they are handled a...
def function[feedkeys, parameter[self, keys, options, escape_csi]]: constant[Push `keys` to Nvim user input buffer. Options can be a string with the following character flags: - 'm': Remap keys. This is default. - 'n': Do not remap keys. - 't': Handle keys as if typed; otherwise...
keyword[def] identifier[feedkeys] ( identifier[self] , identifier[keys] , identifier[options] = literal[string] , identifier[escape_csi] = keyword[True] ): literal[string] keyword[return] identifier[self] . identifier[request] ( literal[string] , identifier[keys] , identifier[options] , identifier...
def feedkeys(self, keys, options='', escape_csi=True): """Push `keys` to Nvim user input buffer. Options can be a string with the following character flags: - 'm': Remap keys. This is default. - 'n': Do not remap keys. - 't': Handle keys as if typed; otherwise they are handled as if...
def track_pageview(self, name, url, duration=0, properties=None, measurements=None): """Send information about the page viewed in the application (a web page for instance). Args: name (str). the name of the page that was viewed.\n url (str). the URL of the page that was viewed.\...
def function[track_pageview, parameter[self, name, url, duration, properties, measurements]]: constant[Send information about the page viewed in the application (a web page for instance). Args: name (str). the name of the page that was viewed. url (str). the URL of the page tha...
keyword[def] identifier[track_pageview] ( identifier[self] , identifier[name] , identifier[url] , identifier[duration] = literal[int] , identifier[properties] = keyword[None] , identifier[measurements] = keyword[None] ): literal[string] identifier[data] = identifier[channel] . identifier[contracts]...
def track_pageview(self, name, url, duration=0, properties=None, measurements=None): """Send information about the page viewed in the application (a web page for instance). Args: name (str). the name of the page that was viewed. url (str). the URL of the page that was viewed. ...
def from_xdr(cls, xdr): """Create a new :class:`TransactionEnvelope` from an XDR string. :param xdr: The XDR string that represents a transaction envelope. :type xdr: bytes, str """ xdr_decoded = base64.b64decode(xdr) te = Xdr.StellarXDRUnpacker(xdr_decoded)...
def function[from_xdr, parameter[cls, xdr]]: constant[Create a new :class:`TransactionEnvelope` from an XDR string. :param xdr: The XDR string that represents a transaction envelope. :type xdr: bytes, str ] variable[xdr_decoded] assign[=] call[name[base64].b64decode...
keyword[def] identifier[from_xdr] ( identifier[cls] , identifier[xdr] ): literal[string] identifier[xdr_decoded] = identifier[base64] . identifier[b64decode] ( identifier[xdr] ) identifier[te] = identifier[Xdr] . identifier[StellarXDRUnpacker] ( identifier[xdr_decoded] ) identifie...
def from_xdr(cls, xdr): """Create a new :class:`TransactionEnvelope` from an XDR string. :param xdr: The XDR string that represents a transaction envelope. :type xdr: bytes, str """ xdr_decoded = base64.b64decode(xdr) te = Xdr.StellarXDRUnpacker(xdr_decoded) te_xdr_...
def get_final_path(path): r""" For a given path, determine the ultimate location of that path. Useful for resolving symlink targets. This functions wraps the GetFinalPathNameByHandle from the Windows SDK. Note, this function fails if a handle cannot be obtained (such as for C:\Pagefile.sys on a stock windows sy...
def function[get_final_path, parameter[path]]: constant[ For a given path, determine the ultimate location of that path. Useful for resolving symlink targets. This functions wraps the GetFinalPathNameByHandle from the Windows SDK. Note, this function fails if a handle cannot be obtained (such as for C:\P...
keyword[def] identifier[get_final_path] ( identifier[path] ): literal[string] identifier[desired_access] = identifier[api] . identifier[NULL] identifier[share_mode] =( identifier[api] . identifier[FILE_SHARE_READ] | identifier[api] . identifier[FILE_SHARE_WRITE] | identifier[api] . identifier[FILE_SHARE_DEL...
def get_final_path(path): """ For a given path, determine the ultimate location of that path. Useful for resolving symlink targets. This functions wraps the GetFinalPathNameByHandle from the Windows SDK. Note, this function fails if a handle cannot be obtained (such as for C:\\Pagefile.sys on a stock windows...
def set(self, name, value, **kw): """Set the attribute to the given value. The keyword arguments represent the other attribute values to integrate constraints to other values. """ # check write permission sm = getSecurityManager() permission = permissions.Manage...
def function[set, parameter[self, name, value]]: constant[Set the attribute to the given value. The keyword arguments represent the other attribute values to integrate constraints to other values. ] variable[sm] assign[=] call[name[getSecurityManager], parameter[]] varia...
keyword[def] identifier[set] ( identifier[self] , identifier[name] , identifier[value] ,** identifier[kw] ): literal[string] identifier[sm] = identifier[getSecurityManager] () identifier[permission] = identifier[permissions] . identifier[ManagePortal] keyword[if] keywo...
def set(self, name, value, **kw): """Set the attribute to the given value. The keyword arguments represent the other attribute values to integrate constraints to other values. """ # check write permission sm = getSecurityManager() permission = permissions.ManagePortal if not...
def increment_step_and_update_last_reward(self): """ Increment the step count of the trainer and Updates the last reward """ if len(self.stats['Environment/Cumulative Reward']) > 0: mean_reward = np.mean(self.stats['Environment/Cumulative Reward']) self.policy.upd...
def function[increment_step_and_update_last_reward, parameter[self]]: constant[ Increment the step count of the trainer and Updates the last reward ] if compare[call[name[len], parameter[call[name[self].stats][constant[Environment/Cumulative Reward]]]] greater[>] constant[0]] begin[:] ...
keyword[def] identifier[increment_step_and_update_last_reward] ( identifier[self] ): literal[string] keyword[if] identifier[len] ( identifier[self] . identifier[stats] [ literal[string] ])> literal[int] : identifier[mean_reward] = identifier[np] . identifier[mean] ( identifier[self] ....
def increment_step_and_update_last_reward(self): """ Increment the step count of the trainer and Updates the last reward """ if len(self.stats['Environment/Cumulative Reward']) > 0: mean_reward = np.mean(self.stats['Environment/Cumulative Reward']) self.policy.update_reward(mean_...
def timestamp_to_local_time_str( timestamp, timezone_name, fmt="yyyy-MM-dd HH:mm:ss"): """Convert epoch timestamp to a localized datetime string. Arguments --------- timestamp : int The timestamp to convert. timezone_name : datetime.timezone The timezone of the desired local...
def function[timestamp_to_local_time_str, parameter[timestamp, timezone_name, fmt]]: constant[Convert epoch timestamp to a localized datetime string. Arguments --------- timestamp : int The timestamp to convert. timezone_name : datetime.timezone The timezone of the desired local...
keyword[def] identifier[timestamp_to_local_time_str] ( identifier[timestamp] , identifier[timezone_name] , identifier[fmt] = literal[string] ): literal[string] identifier[localized_d] = identifier[timestamp_to_local_time] ( identifier[timestamp] , identifier[timezone_name] ) identifier[localized_date...
def timestamp_to_local_time_str(timestamp, timezone_name, fmt='yyyy-MM-dd HH:mm:ss'): """Convert epoch timestamp to a localized datetime string. Arguments --------- timestamp : int The timestamp to convert. timezone_name : datetime.timezone The timezone of the desired local time. ...
def to_funset(self, lname="clamping", cname="clamped"): """ Converts the list of clampings to a set of `gringo.Fun`_ instances Parameters ---------- lname : str Predicate name for the clamping id cname : str Predicate name for the clamped variabl...
def function[to_funset, parameter[self, lname, cname]]: constant[ Converts the list of clampings to a set of `gringo.Fun`_ instances Parameters ---------- lname : str Predicate name for the clamping id cname : str Predicate name for the clamped v...
keyword[def] identifier[to_funset] ( identifier[self] , identifier[lname] = literal[string] , identifier[cname] = literal[string] ): literal[string] identifier[fs] = identifier[set] () keyword[for] identifier[i] , identifier[clamping] keyword[in] identifier[enumerate] ( identifier[self]...
def to_funset(self, lname='clamping', cname='clamped'): """ Converts the list of clampings to a set of `gringo.Fun`_ instances Parameters ---------- lname : str Predicate name for the clamping id cname : str Predicate name for the clamped variable ...
def gimbal_control_encode(self, target_system, target_component, demanded_rate_x, demanded_rate_y, demanded_rate_z): ''' Control message for rate gimbal target_system : System ID (uint8_t) target_component : Component ID (uint8_t) ...
def function[gimbal_control_encode, parameter[self, target_system, target_component, demanded_rate_x, demanded_rate_y, demanded_rate_z]]: constant[ Control message for rate gimbal target_system : System ID (uint8_t) target_component : Compone...
keyword[def] identifier[gimbal_control_encode] ( identifier[self] , identifier[target_system] , identifier[target_component] , identifier[demanded_rate_x] , identifier[demanded_rate_y] , identifier[demanded_rate_z] ): literal[string] keyword[return] identifier[MAVLink_gimbal_contro...
def gimbal_control_encode(self, target_system, target_component, demanded_rate_x, demanded_rate_y, demanded_rate_z): """ Control message for rate gimbal target_system : System ID (uint8_t) target_component : Component ID (uint8_t) ...
def is_velar(c,lang): """ Is the character a velar """ o=get_offset(c,lang) return (o>=VELAR_RANGE[0] and o<=VELAR_RANGE[1])
def function[is_velar, parameter[c, lang]]: constant[ Is the character a velar ] variable[o] assign[=] call[name[get_offset], parameter[name[c], name[lang]]] return[<ast.BoolOp object at 0x7da1b26ae710>]
keyword[def] identifier[is_velar] ( identifier[c] , identifier[lang] ): literal[string] identifier[o] = identifier[get_offset] ( identifier[c] , identifier[lang] ) keyword[return] ( identifier[o] >= identifier[VELAR_RANGE] [ literal[int] ] keyword[and] identifier[o] <= identifier[VELAR_RANGE] [ liter...
def is_velar(c, lang): """ Is the character a velar """ o = get_offset(c, lang) return o >= VELAR_RANGE[0] and o <= VELAR_RANGE[1]
def last_sleep_breakdown(self): """Return durations of sleep stages for last complete session.""" try: stages = self.intervals[1]['stages'] except KeyError: return None breakdown = {'awake': 0, 'light': 0, 'deep': 0, 'rem': 0} for stage in stages: ...
def function[last_sleep_breakdown, parameter[self]]: constant[Return durations of sleep stages for last complete session.] <ast.Try object at 0x7da20cabed70> variable[breakdown] assign[=] dictionary[[<ast.Constant object at 0x7da20cabc6d0>, <ast.Constant object at 0x7da20cabf790>, <ast.Constant obje...
keyword[def] identifier[last_sleep_breakdown] ( identifier[self] ): literal[string] keyword[try] : identifier[stages] = identifier[self] . identifier[intervals] [ literal[int] ][ literal[string] ] keyword[except] identifier[KeyError] : keyword[return] keyword[No...
def last_sleep_breakdown(self): """Return durations of sleep stages for last complete session.""" try: stages = self.intervals[1]['stages'] # depends on [control=['try'], data=[]] except KeyError: return None # depends on [control=['except'], data=[]] breakdown = {'awake': 0, 'light': ...
def diff_with_models(self): """ Return a dict stating the differences between current state of models and the configuration itself. TODO: Detect fields that are in conf, but not in models """ missing_from_conf = defaultdict(set) for model in get_models(): ...
def function[diff_with_models, parameter[self]]: constant[ Return a dict stating the differences between current state of models and the configuration itself. TODO: Detect fields that are in conf, but not in models ] variable[missing_from_conf] assign[=] call[name[default...
keyword[def] identifier[diff_with_models] ( identifier[self] ): literal[string] identifier[missing_from_conf] = identifier[defaultdict] ( identifier[set] ) keyword[for] identifier[model] keyword[in] identifier[get_models] (): identifier[db_tables_and_columns] = identifier[...
def diff_with_models(self): """ Return a dict stating the differences between current state of models and the configuration itself. TODO: Detect fields that are in conf, but not in models """ missing_from_conf = defaultdict(set) for model in get_models(): db_tables_an...
def connectionMade(self): """Callback handler from twisted when establishing a new connection.""" self.endpoint = self.transport.getPeer() # get the reference to the Address object in NodeLeader so we can manipulate it properly. tmp_addr = Address(f"{self.endpoint.host}:{self.endpoint.po...
def function[connectionMade, parameter[self]]: constant[Callback handler from twisted when establishing a new connection.] name[self].endpoint assign[=] call[name[self].transport.getPeer, parameter[]] variable[tmp_addr] assign[=] call[name[Address], parameter[<ast.JoinedStr object at 0x7da18bcc8...
keyword[def] identifier[connectionMade] ( identifier[self] ): literal[string] identifier[self] . identifier[endpoint] = identifier[self] . identifier[transport] . identifier[getPeer] () identifier[tmp_addr] = identifier[Address] ( literal[string] ) keyword[try] : ...
def connectionMade(self): """Callback handler from twisted when establishing a new connection.""" self.endpoint = self.transport.getPeer() # get the reference to the Address object in NodeLeader so we can manipulate it properly. tmp_addr = Address(f'{self.endpoint.host}:{self.endpoint.port}') try: ...
def execute_executable(nova_args, env_vars): """ Executes the executable given by the user. Hey, I know this method has a silly name, but I write the code here and I'm silly. """ process = subprocess.Popen(nova_args, stdout=sys.stdout, ...
def function[execute_executable, parameter[nova_args, env_vars]]: constant[ Executes the executable given by the user. Hey, I know this method has a silly name, but I write the code here and I'm silly. ] variable[process] assign[=] call[name[subprocess].Popen, parameter[name[nova_args]]...
keyword[def] identifier[execute_executable] ( identifier[nova_args] , identifier[env_vars] ): literal[string] identifier[process] = identifier[subprocess] . identifier[Popen] ( identifier[nova_args] , identifier[stdout] = identifier[sys] . identifier[stdout] , identifier[stderr] = identifier[subp...
def execute_executable(nova_args, env_vars): """ Executes the executable given by the user. Hey, I know this method has a silly name, but I write the code here and I'm silly. """ process = subprocess.Popen(nova_args, stdout=sys.stdout, stderr=subprocess.PIPE, env=env_vars) process.wait() ...
def switch_fingerprint_method(self, old=False): """ Switches main fingerprinting method. :param old: if True old fingerprinting method will be used. :return: """ if old: self.has_fingerprint = self.has_fingerprint_moduli else: self.has_fin...
def function[switch_fingerprint_method, parameter[self, old]]: constant[ Switches main fingerprinting method. :param old: if True old fingerprinting method will be used. :return: ] if name[old] begin[:] name[self].has_fingerprint assign[=] name[self].has_...
keyword[def] identifier[switch_fingerprint_method] ( identifier[self] , identifier[old] = keyword[False] ): literal[string] keyword[if] identifier[old] : identifier[self] . identifier[has_fingerprint] = identifier[self] . identifier[has_fingerprint_moduli] keyword[else] : ...
def switch_fingerprint_method(self, old=False): """ Switches main fingerprinting method. :param old: if True old fingerprinting method will be used. :return: """ if old: self.has_fingerprint = self.has_fingerprint_moduli # depends on [control=['if'], data=[]] else: ...
def list_tags(self, pattern: str = None) -> typing.List[str]: """ Returns list of tags, optionally matching "pattern" :param pattern: optional pattern to filter results :type pattern: str :return: existing tags :rtype: list of str """ tags: typing.List[st...
def function[list_tags, parameter[self, pattern]]: constant[ Returns list of tags, optionally matching "pattern" :param pattern: optional pattern to filter results :type pattern: str :return: existing tags :rtype: list of str ] <ast.AnnAssign object at 0x7da2...
keyword[def] identifier[list_tags] ( identifier[self] , identifier[pattern] : identifier[str] = keyword[None] )-> identifier[typing] . identifier[List] [ identifier[str] ]: literal[string] identifier[tags] : identifier[typing] . identifier[List] [ identifier[str] ]=[ identifier[str] ( identifier[ta...
def list_tags(self, pattern: str=None) -> typing.List[str]: """ Returns list of tags, optionally matching "pattern" :param pattern: optional pattern to filter results :type pattern: str :return: existing tags :rtype: list of str """ tags: typing.List[str] = [str(...
def make_application_private(application_id, sar_client=None): """ Set the application to be private. :param application_id: The Amazon Resource Name (ARN) of the application :type application_id: str :param sar_client: The boto3 client used to access SAR :type sar_client: boto3.client :rai...
def function[make_application_private, parameter[application_id, sar_client]]: constant[ Set the application to be private. :param application_id: The Amazon Resource Name (ARN) of the application :type application_id: str :param sar_client: The boto3 client used to access SAR :type sar_cli...
keyword[def] identifier[make_application_private] ( identifier[application_id] , identifier[sar_client] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[application_id] : keyword[raise] identifier[ValueError] ( literal[string] ) keyword[if] keyword[not] identifier[...
def make_application_private(application_id, sar_client=None): """ Set the application to be private. :param application_id: The Amazon Resource Name (ARN) of the application :type application_id: str :param sar_client: The boto3 client used to access SAR :type sar_client: boto3.client :rai...
def register(self, parent=None): '''Record the availability of this worker and get a unique identifer. This sets :attr:`worker_id` and calls :meth:`heartbeat`. This cannot be called multiple times without calling :meth:`unregister` in between. ''' if self.worker_id: ...
def function[register, parameter[self, parent]]: constant[Record the availability of this worker and get a unique identifer. This sets :attr:`worker_id` and calls :meth:`heartbeat`. This cannot be called multiple times without calling :meth:`unregister` in between. ] i...
keyword[def] identifier[register] ( identifier[self] , identifier[parent] = keyword[None] ): literal[string] keyword[if] identifier[self] . identifier[worker_id] : keyword[raise] identifier[ProgrammerError] ( literal[string] ) identifier[self] . identifier[parent] = identifi...
def register(self, parent=None): """Record the availability of this worker and get a unique identifer. This sets :attr:`worker_id` and calls :meth:`heartbeat`. This cannot be called multiple times without calling :meth:`unregister` in between. """ if self.worker_id: ra...
def shot_open_callback(self, *args, **kwargs): """Callback for the shot open button :returns: None :rtype: None :raises: None """ tf = self.browser.get_current_selection(1) if not tf: return if not os.path.exists(tf.path): msg = 'T...
def function[shot_open_callback, parameter[self]]: constant[Callback for the shot open button :returns: None :rtype: None :raises: None ] variable[tf] assign[=] call[name[self].browser.get_current_selection, parameter[constant[1]]] if <ast.UnaryOp object at 0x7da...
keyword[def] identifier[shot_open_callback] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[tf] = identifier[self] . identifier[browser] . identifier[get_current_selection] ( literal[int] ) keyword[if] keyword[not] identifier[tf] : ...
def shot_open_callback(self, *args, **kwargs): """Callback for the shot open button :returns: None :rtype: None :raises: None """ tf = self.browser.get_current_selection(1) if not tf: return # depends on [control=['if'], data=[]] if not os.path.exists(tf.path): ...
def calc_local_indices(shape, num_partitions, coordinate): """ calculate local indices, return start and stop index per dimension per process for local data field :param shape: global shape of data :param num_partitions: number of partition for each dimension (from MPI.Compute_dims()) :param coordinate...
def function[calc_local_indices, parameter[shape, num_partitions, coordinate]]: constant[ calculate local indices, return start and stop index per dimension per process for local data field :param shape: global shape of data :param num_partitions: number of partition for each dimension (from MPI.Comput...
keyword[def] identifier[calc_local_indices] ( identifier[shape] , identifier[num_partitions] , identifier[coordinate] ): literal[string] identifier[dimension] = identifier[len] ( identifier[shape] ) keyword[assert] identifier[dimension] == identifier[len] ( identifier[num_partitions] ) ide...
def calc_local_indices(shape, num_partitions, coordinate): """ calculate local indices, return start and stop index per dimension per process for local data field :param shape: global shape of data :param num_partitions: number of partition for each dimension (from MPI.Compute_dims()) :param coordinate...
def open_remote_file(dataset_key, file_name, profile='default', mode='w', **kwargs): """Open a remote file object that can be used to write to or read from a file in a data.world dataset :param dataset_key: Dataset identifier, in the form of owner/id :type dataset_key: str :par...
def function[open_remote_file, parameter[dataset_key, file_name, profile, mode]]: constant[Open a remote file object that can be used to write to or read from a file in a data.world dataset :param dataset_key: Dataset identifier, in the form of owner/id :type dataset_key: str :param file_name: ...
keyword[def] identifier[open_remote_file] ( identifier[dataset_key] , identifier[file_name] , identifier[profile] = literal[string] , identifier[mode] = literal[string] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[_get_instance] ( identifier[profile] ,** identifier[kwargs] ). iden...
def open_remote_file(dataset_key, file_name, profile='default', mode='w', **kwargs): """Open a remote file object that can be used to write to or read from a file in a data.world dataset :param dataset_key: Dataset identifier, in the form of owner/id :type dataset_key: str :param file_name: The nam...
def removeSingleCachedFile(self, fileStoreID): """ Removes a single file described by the fileStoreID from the cache forcibly. """ with self._CacheState.open(self) as cacheInfo: cachedFile = self.encodedFileID(fileStoreID) cachedFileStats = os.stat(cachedFile) ...
def function[removeSingleCachedFile, parameter[self, fileStoreID]]: constant[ Removes a single file described by the fileStoreID from the cache forcibly. ] with call[name[self]._CacheState.open, parameter[name[self]]] begin[:] variable[cachedFile] assign[=] call[name[self...
keyword[def] identifier[removeSingleCachedFile] ( identifier[self] , identifier[fileStoreID] ): literal[string] keyword[with] identifier[self] . identifier[_CacheState] . identifier[open] ( identifier[self] ) keyword[as] identifier[cacheInfo] : identifier[cachedFile] = identifier[sel...
def removeSingleCachedFile(self, fileStoreID): """ Removes a single file described by the fileStoreID from the cache forcibly. """ with self._CacheState.open(self) as cacheInfo: cachedFile = self.encodedFileID(fileStoreID) cachedFileStats = os.stat(cachedFile) # We know t...
def cfg_intf(self, protocol_interface, phy_interface=None): """Called by application to add an interface to the list. """ self.intf_list.append(protocol_interface) self.cfg_lldp_interface(protocol_interface, phy_interface)
def function[cfg_intf, parameter[self, protocol_interface, phy_interface]]: constant[Called by application to add an interface to the list. ] call[name[self].intf_list.append, parameter[name[protocol_interface]]] call[name[self].cfg_lldp_interface, parameter[name[protocol_interface], name[phy_in...
keyword[def] identifier[cfg_intf] ( identifier[self] , identifier[protocol_interface] , identifier[phy_interface] = keyword[None] ): literal[string] identifier[self] . identifier[intf_list] . identifier[append] ( identifier[protocol_interface] ) identifier[self] . identifier[cfg_lldp_inter...
def cfg_intf(self, protocol_interface, phy_interface=None): """Called by application to add an interface to the list. """ self.intf_list.append(protocol_interface) self.cfg_lldp_interface(protocol_interface, phy_interface)
def get_header(self, patch_dir=None): """ Returns bytes """ lines = [] if patch_dir: file = patch_dir + File(self.get_name()) name = file.get_name() else: name = self.get_name() with open(name, "rb") as f: for line in f: ...
def function[get_header, parameter[self, patch_dir]]: constant[ Returns bytes ] variable[lines] assign[=] list[[]] if name[patch_dir] begin[:] variable[file] assign[=] binary_operation[name[patch_dir] + call[name[File], parameter[call[name[self].get_name, parameter[]]]]] ...
keyword[def] identifier[get_header] ( identifier[self] , identifier[patch_dir] = keyword[None] ): literal[string] identifier[lines] =[] keyword[if] identifier[patch_dir] : identifier[file] = identifier[patch_dir] + identifier[File] ( identifier[self] . identifier[get_name] (...
def get_header(self, patch_dir=None): """ Returns bytes """ lines = [] if patch_dir: file = patch_dir + File(self.get_name()) name = file.get_name() # depends on [control=['if'], data=[]] else: name = self.get_name() with open(name, 'rb') as f: for line in f: ...
def bellman_operator(self, v, Tv=None, sigma=None): """ The Bellman operator, which computes and returns the updated value function `Tv` for a value function `v`. Parameters ---------- v : array_like(float, ndim=1) Value function vector, of length n. ...
def function[bellman_operator, parameter[self, v, Tv, sigma]]: constant[ The Bellman operator, which computes and returns the updated value function `Tv` for a value function `v`. Parameters ---------- v : array_like(float, ndim=1) Value function vector, of l...
keyword[def] identifier[bellman_operator] ( identifier[self] , identifier[v] , identifier[Tv] = keyword[None] , identifier[sigma] = keyword[None] ): literal[string] identifier[vals] = identifier[self] . identifier[R] + identifier[self] . identifier[beta] * identifier[self] . identifier[Q] . identif...
def bellman_operator(self, v, Tv=None, sigma=None): """ The Bellman operator, which computes and returns the updated value function `Tv` for a value function `v`. Parameters ---------- v : array_like(float, ndim=1) Value function vector, of length n. Tv ...
def get_api_keys(request): """Return the list of API keys.""" with db_connect() as db_conn: with db_conn.cursor() as cursor: cursor.execute("""\ SELECT row_to_json(combined_rows) FROM ( SELECT id, key, name, groups FROM api_keys ) AS combined_rows""") api_keys = [x[0] for x in ...
def function[get_api_keys, parameter[request]]: constant[Return the list of API keys.] with call[name[db_connect], parameter[]] begin[:] with call[name[db_conn].cursor, parameter[]] begin[:] call[name[cursor].execute, parameter[constant[SELECT row_to_json(combined...
keyword[def] identifier[get_api_keys] ( identifier[request] ): literal[string] keyword[with] identifier[db_connect] () keyword[as] identifier[db_conn] : keyword[with] identifier[db_conn] . identifier[cursor] () keyword[as] identifier[cursor] : identifier[cursor] . identifier[execu...
def get_api_keys(request): """Return the list of API keys.""" with db_connect() as db_conn: with db_conn.cursor() as cursor: cursor.execute('SELECT row_to_json(combined_rows) FROM (\n SELECT id, key, name, groups FROM api_keys\n) AS combined_rows') api_keys = [x[0] for x in curs...
def set_flavor(self, node, flavor): """Set a flavor to a given ironic node. :param uuid: the ironic node UUID :param flavor: the flavor name """ command = ( 'ironic node-update {uuid} add ' 'properties/capabilities=profile:{flavor},boot_option:local').for...
def function[set_flavor, parameter[self, node, flavor]]: constant[Set a flavor to a given ironic node. :param uuid: the ironic node UUID :param flavor: the flavor name ] variable[command] assign[=] call[constant[ironic node-update {uuid} add properties/capabilities=profile:{flav...
keyword[def] identifier[set_flavor] ( identifier[self] , identifier[node] , identifier[flavor] ): literal[string] identifier[command] =( literal[string] literal[string] ). identifier[format] ( identifier[uuid] = identifier[node] . identifier[uuid] , identifier[flavor] = ...
def set_flavor(self, node, flavor): """Set a flavor to a given ironic node. :param uuid: the ironic node UUID :param flavor: the flavor name """ command = 'ironic node-update {uuid} add properties/capabilities=profile:{flavor},boot_option:local'.format(uuid=node.uuid, flavor=flavor) ...
def populate_extra_files(): """ Creates a list of non-python data files to include in package distribution """ out = ['cauldron/settings.json'] for entry in glob.iglob('cauldron/resources/examples/**/*', recursive=True): out.append(entry) for entry in glob.iglob('cauldron/resources/te...
def function[populate_extra_files, parameter[]]: constant[ Creates a list of non-python data files to include in package distribution ] variable[out] assign[=] list[[<ast.Constant object at 0x7da1b1b6ab00>]] for taget[name[entry]] in starred[call[name[glob].iglob, parameter[constant[caul...
keyword[def] identifier[populate_extra_files] (): literal[string] identifier[out] =[ literal[string] ] keyword[for] identifier[entry] keyword[in] identifier[glob] . identifier[iglob] ( literal[string] , identifier[recursive] = keyword[True] ): identifier[out] . identifier[append] ( ident...
def populate_extra_files(): """ Creates a list of non-python data files to include in package distribution """ out = ['cauldron/settings.json'] for entry in glob.iglob('cauldron/resources/examples/**/*', recursive=True): out.append(entry) # depends on [control=['for'], data=['entry']] f...
def previousElementSibling(self): """Finds the first closest previous sibling of the node which is an element node. Note the handling of entities references is different than in the W3C DOM element traversal spec since we don't have back reference from entities content t...
def function[previousElementSibling, parameter[self]]: constant[Finds the first closest previous sibling of the node which is an element node. Note the handling of entities references is different than in the W3C DOM element traversal spec since we don't have back reference from ...
keyword[def] identifier[previousElementSibling] ( identifier[self] ): literal[string] identifier[ret] = identifier[libxml2mod] . identifier[xmlPreviousElementSibling] ( identifier[self] . identifier[_o] ) keyword[if] identifier[ret] keyword[is] keyword[None] : keyword[return] keyword[N...
def previousElementSibling(self): """Finds the first closest previous sibling of the node which is an element node. Note the handling of entities references is different than in the W3C DOM element traversal spec since we don't have back reference from entities content to en...
def user_agent_detail(self, **kwargs): """Get the user agent detail. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server cannot perform the request ...
def function[user_agent_detail, parameter[self]]: constant[Get the user agent detail. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server cannot per...
keyword[def] identifier[user_agent_detail] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[path] = literal[string] %( identifier[self] . identifier[manager] . identifier[path] , identifier[self] . identifier[get_id] ()) keyword[return] identifier[self] . identifier...
def user_agent_detail(self, **kwargs): """Get the user agent detail. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server cannot perform the request ...
def wrap_lons(lons, base, period): """ Wrap longitude values into the range between base and base+period. """ lons = lons.astype(np.float64) return ((lons - base + period * 2) % period) + base
def function[wrap_lons, parameter[lons, base, period]]: constant[ Wrap longitude values into the range between base and base+period. ] variable[lons] assign[=] call[name[lons].astype, parameter[name[np].float64]] return[binary_operation[binary_operation[binary_operation[binary_operation[name...
keyword[def] identifier[wrap_lons] ( identifier[lons] , identifier[base] , identifier[period] ): literal[string] identifier[lons] = identifier[lons] . identifier[astype] ( identifier[np] . identifier[float64] ) keyword[return] (( identifier[lons] - identifier[base] + identifier[period] * literal[int] ...
def wrap_lons(lons, base, period): """ Wrap longitude values into the range between base and base+period. """ lons = lons.astype(np.float64) return (lons - base + period * 2) % period + base
def chat(self): """ Access the Chat Twilio Domain :returns: Chat Twilio Domain :rtype: twilio.rest.chat.Chat """ if self._chat is None: from twilio.rest.chat import Chat self._chat = Chat(self) return self._chat
def function[chat, parameter[self]]: constant[ Access the Chat Twilio Domain :returns: Chat Twilio Domain :rtype: twilio.rest.chat.Chat ] if compare[name[self]._chat is constant[None]] begin[:] from relative_module[twilio.rest.chat] import module[Chat] ...
keyword[def] identifier[chat] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_chat] keyword[is] keyword[None] : keyword[from] identifier[twilio] . identifier[rest] . identifier[chat] keyword[import] identifier[Chat] identifier[self] ...
def chat(self): """ Access the Chat Twilio Domain :returns: Chat Twilio Domain :rtype: twilio.rest.chat.Chat """ if self._chat is None: from twilio.rest.chat import Chat self._chat = Chat(self) # depends on [control=['if'], data=[]] return self._chat
def is_duplicate_edge(data, data_other): """ Check if two edge data dictionaries are the same based on OSM ID and geometry. Parameters ---------- data : dict the first edge's data data_other : dict the second edge's data Returns ------- is_dupe : bool """ ...
def function[is_duplicate_edge, parameter[data, data_other]]: constant[ Check if two edge data dictionaries are the same based on OSM ID and geometry. Parameters ---------- data : dict the first edge's data data_other : dict the second edge's data Returns ------...
keyword[def] identifier[is_duplicate_edge] ( identifier[data] , identifier[data_other] ): literal[string] identifier[is_dupe] = keyword[False] identifier[osmid] = identifier[set] ( identifier[data] [ literal[string] ]) keyword[if] identifier[isinstance] ( identifier[data] [ literal[strin...
def is_duplicate_edge(data, data_other): """ Check if two edge data dictionaries are the same based on OSM ID and geometry. Parameters ---------- data : dict the first edge's data data_other : dict the second edge's data Returns ------- is_dupe : bool """ ...
def getActiveJobsForClientInfo(self, clientInfo, fields=[]): """ Fetch jobIDs for jobs in the table with optional fields given a specific clientInfo """ # Form the sequence of field name strings that will go into the # request dbFields = [self._jobs.pubToDBNameDict[x] for x in fields] dbFields...
def function[getActiveJobsForClientInfo, parameter[self, clientInfo, fields]]: constant[ Fetch jobIDs for jobs in the table with optional fields given a specific clientInfo ] variable[dbFields] assign[=] <ast.ListComp object at 0x7da20c6c42e0> variable[dbFieldsStr] assign[=] call[constant[,]...
keyword[def] identifier[getActiveJobsForClientInfo] ( identifier[self] , identifier[clientInfo] , identifier[fields] =[]): literal[string] identifier[dbFields] =[ identifier[self] . identifier[_jobs] . identifier[pubToDBNameDict] [ identifier[x] ] keyword[for] identifier[x] keyword[in] identi...
def getActiveJobsForClientInfo(self, clientInfo, fields=[]): """ Fetch jobIDs for jobs in the table with optional fields given a specific clientInfo """ # Form the sequence of field name strings that will go into the # request dbFields = [self._jobs.pubToDBNameDict[x] for x in fields] dbFieldsS...
def get_oauth_data(self, code, client_id, client_secret, state): ''' Get Oauth data from HelloSign Args: code (str): Code returned by HelloSign for our callback url client_id (str): Client id of the associated app client_secret (str): Secret ...
def function[get_oauth_data, parameter[self, code, client_id, client_secret, state]]: constant[ Get Oauth data from HelloSign Args: code (str): Code returned by HelloSign for our callback url client_id (str): Client id of the associated app clie...
keyword[def] identifier[get_oauth_data] ( identifier[self] , identifier[code] , identifier[client_id] , identifier[client_secret] , identifier[state] ): literal[string] identifier[request] = identifier[self] . identifier[_get_request] () identifier[response] = identifier[request] . identif...
def get_oauth_data(self, code, client_id, client_secret, state): """ Get Oauth data from HelloSign Args: code (str): Code returned by HelloSign for our callback url client_id (str): Client id of the associated app client_secret (str): Secret toke...
def _format_exception_only(self, etype, value): """Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.exc_info()[:2]. The return value is a list of strings, each ending in a newline. Normally, the list contains a single string;...
def function[_format_exception_only, parameter[self, etype, value]]: constant[Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.exc_info()[:2]. The return value is a list of strings, each ending in a newline. Normally, the lis...
keyword[def] identifier[_format_exception_only] ( identifier[self] , identifier[etype] , identifier[value] ): literal[string] identifier[have_filedata] = keyword[False] identifier[Colors] = identifier[self] . identifier[Colors] identifier[list] =[] identifier[stype] = ...
def _format_exception_only(self, etype, value): """Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.exc_info()[:2]. The return value is a list of strings, each ending in a newline. Normally, the list contains a single string; how...
def std(self, ddof=1, *args, **kwargs): """ Compute standard deviation of groups, excluding missing values. For multiple groupings, the result index will be a MultiIndex. Parameters ---------- ddof : integer, default 1 degrees of freedom """ ...
def function[std, parameter[self, ddof]]: constant[ Compute standard deviation of groups, excluding missing values. For multiple groupings, the result index will be a MultiIndex. Parameters ---------- ddof : integer, default 1 degrees of freedom ] ...
keyword[def] identifier[std] ( identifier[self] , identifier[ddof] = literal[int] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[nv] . identifier[validate_groupby_func] ( literal[string] , identifier[args] , identifier[kwargs] ) keyword[return] identifi...
def std(self, ddof=1, *args, **kwargs): """ Compute standard deviation of groups, excluding missing values. For multiple groupings, the result index will be a MultiIndex. Parameters ---------- ddof : integer, default 1 degrees of freedom """ # TODO: ...
def saveFiles(fileName1, fileName2, songs, artist, album, trackNum): """Save songs to files""" songs[0].export(fileName1, format=detectFormat(fileName1), tags={'artist': artist, 'album': album, 'track': trackNum}) songs[1].export(fileName2, format=detectFormat(fileName2), tags={'artist': artist, 'album': al...
def function[saveFiles, parameter[fileName1, fileName2, songs, artist, album, trackNum]]: constant[Save songs to files] call[call[name[songs]][constant[0]].export, parameter[name[fileName1]]] call[call[name[songs]][constant[1]].export, parameter[name[fileName2]]]
keyword[def] identifier[saveFiles] ( identifier[fileName1] , identifier[fileName2] , identifier[songs] , identifier[artist] , identifier[album] , identifier[trackNum] ): literal[string] identifier[songs] [ literal[int] ]. identifier[export] ( identifier[fileName1] , identifier[format] = identifier[detectFo...
def saveFiles(fileName1, fileName2, songs, artist, album, trackNum): """Save songs to files""" songs[0].export(fileName1, format=detectFormat(fileName1), tags={'artist': artist, 'album': album, 'track': trackNum}) songs[1].export(fileName2, format=detectFormat(fileName2), tags={'artist': artist, 'album': al...
def _parse_type(value, type_func): """ Attempt to cast *value* into *type_func*, returning *default* if it fails. """ default = type_func(0) if value is None: return default try: return type_func(value) except ValueError: return...
def function[_parse_type, parameter[value, type_func]]: constant[ Attempt to cast *value* into *type_func*, returning *default* if it fails. ] variable[default] assign[=] call[name[type_func], parameter[constant[0]]] if compare[name[value] is constant[None]] begin[:] retu...
keyword[def] identifier[_parse_type] ( identifier[value] , identifier[type_func] ): literal[string] identifier[default] = identifier[type_func] ( literal[int] ) keyword[if] identifier[value] keyword[is] keyword[None] : keyword[return] identifier[default] keyword[...
def _parse_type(value, type_func): """ Attempt to cast *value* into *type_func*, returning *default* if it fails. """ default = type_func(0) if value is None: return default # depends on [control=['if'], data=[]] try: return type_func(value) # depends on [control=['try'...
def keyring_auth(username=None, region=None, authenticate=True): """ Use the password stored within the keyring to authenticate. If a username is supplied, that name is used; otherwise, the keyring_username value from the config file is used. If there is no username defined, or if the keyring modul...
def function[keyring_auth, parameter[username, region, authenticate]]: constant[ Use the password stored within the keyring to authenticate. If a username is supplied, that name is used; otherwise, the keyring_username value from the config file is used. If there is no username defined, or if t...
keyword[def] identifier[keyring_auth] ( identifier[username] = keyword[None] , identifier[region] = keyword[None] , identifier[authenticate] = keyword[True] ): literal[string] keyword[if] keyword[not] identifier[keyring] : keyword[raise] identifier[exc] . identifier[KeyringModuleNotInstall...
def keyring_auth(username=None, region=None, authenticate=True): """ Use the password stored within the keyring to authenticate. If a username is supplied, that name is used; otherwise, the keyring_username value from the config file is used. If there is no username defined, or if the keyring modul...
def check_w3_errors (url_data, xml, w3type): """Add warnings for W3C HTML or CSS errors in xml format. w3type is either "W3C HTML" or "W3C CSS".""" dom = parseString(xml) for error in dom.getElementsByTagName('m:error'): warnmsg = _("%(w3type)s validation error at line %(line)s col %(column)s: %...
def function[check_w3_errors, parameter[url_data, xml, w3type]]: constant[Add warnings for W3C HTML or CSS errors in xml format. w3type is either "W3C HTML" or "W3C CSS".] variable[dom] assign[=] call[name[parseString], parameter[name[xml]]] for taget[name[error]] in starred[call[name[dom].g...
keyword[def] identifier[check_w3_errors] ( identifier[url_data] , identifier[xml] , identifier[w3type] ): literal[string] identifier[dom] = identifier[parseString] ( identifier[xml] ) keyword[for] identifier[error] keyword[in] identifier[dom] . identifier[getElementsByTagName] ( literal[string] ): ...
def check_w3_errors(url_data, xml, w3type): """Add warnings for W3C HTML or CSS errors in xml format. w3type is either "W3C HTML" or "W3C CSS".""" dom = parseString(xml) for error in dom.getElementsByTagName('m:error'): warnmsg = _('%(w3type)s validation error at line %(line)s col %(column)s: %(...
def deproject(self, depth_image): """Deprojects a DepthImage into a PointCloud. Parameters ---------- depth_image : :obj:`DepthImage` The 2D depth image to projet into a point cloud. Returns ------- :obj:`autolab_core.PointCloud` A 3D poi...
def function[deproject, parameter[self, depth_image]]: constant[Deprojects a DepthImage into a PointCloud. Parameters ---------- depth_image : :obj:`DepthImage` The 2D depth image to projet into a point cloud. Returns ------- :obj:`autolab_core.Point...
keyword[def] identifier[deproject] ( identifier[self] , identifier[depth_image] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[depth_image] , identifier[DepthImage] ): keyword[raise] identifier[ValueError] ( literal[string] ) keywor...
def deproject(self, depth_image): """Deprojects a DepthImage into a PointCloud. Parameters ---------- depth_image : :obj:`DepthImage` The 2D depth image to projet into a point cloud. Returns ------- :obj:`autolab_core.PointCloud` A 3D point c...
def _load_ssh_auth_post_yosemite(mac_username): """Starting with Yosemite, launchd was rearchitected and now only one launchd process runs for all users. This allows us to much more easily impersonate a user through launchd and extract the environment variables from their running processes.""" user_...
def function[_load_ssh_auth_post_yosemite, parameter[mac_username]]: constant[Starting with Yosemite, launchd was rearchitected and now only one launchd process runs for all users. This allows us to much more easily impersonate a user through launchd and extract the environment variables from their ...
keyword[def] identifier[_load_ssh_auth_post_yosemite] ( identifier[mac_username] ): literal[string] identifier[user_id] = identifier[subprocess] . identifier[check_output] ([ literal[string] , literal[string] , identifier[mac_username] ]) identifier[ssh_auth_sock] = identifier[subprocess] . identifier...
def _load_ssh_auth_post_yosemite(mac_username): """Starting with Yosemite, launchd was rearchitected and now only one launchd process runs for all users. This allows us to much more easily impersonate a user through launchd and extract the environment variables from their running processes.""" user_...
def domains(self): """The domains for this app.""" return self._h._get_resources( resource=('apps', self.name, 'domains'), obj=Domain, app=self )
def function[domains, parameter[self]]: constant[The domains for this app.] return[call[name[self]._h._get_resources, parameter[]]]
keyword[def] identifier[domains] ( identifier[self] ): literal[string] keyword[return] identifier[self] . identifier[_h] . identifier[_get_resources] ( identifier[resource] =( literal[string] , identifier[self] . identifier[name] , literal[string] ), identifier[obj] = identifier[...
def domains(self): """The domains for this app.""" return self._h._get_resources(resource=('apps', self.name, 'domains'), obj=Domain, app=self)
def data_cutout_ma(self): """ A 2D `~numpy.ma.MaskedArray` cutout from the data. The mask is `True` for pixels outside of the source segment (labeled region of interest), masked pixels from the ``mask`` input, or any non-finite ``data`` values (e.g. NaN or inf). """ ...
def function[data_cutout_ma, parameter[self]]: constant[ A 2D `~numpy.ma.MaskedArray` cutout from the data. The mask is `True` for pixels outside of the source segment (labeled region of interest), masked pixels from the ``mask`` input, or any non-finite ``data`` values (e.g. Na...
keyword[def] identifier[data_cutout_ma] ( identifier[self] ): literal[string] keyword[return] identifier[np] . identifier[ma] . identifier[masked_array] ( identifier[self] . identifier[_data] [ identifier[self] . identifier[_slice] ], identifier[mask] = identifier[self] . identifier[_tot...
def data_cutout_ma(self): """ A 2D `~numpy.ma.MaskedArray` cutout from the data. The mask is `True` for pixels outside of the source segment (labeled region of interest), masked pixels from the ``mask`` input, or any non-finite ``data`` values (e.g. NaN or inf). """ retu...
def _convert_data_block_and_headers_to_df(self, stream): """ stream : Streamlike object A Streamlike object (nominally StringIO) containing the data to be extracted ch : dict Column headers to use for the output pd.DataFrame Returns ------- ...
def function[_convert_data_block_and_headers_to_df, parameter[self, stream]]: constant[ stream : Streamlike object A Streamlike object (nominally StringIO) containing the data to be extracted ch : dict Column headers to use for the output pd.DataFrame ...
keyword[def] identifier[_convert_data_block_and_headers_to_df] ( identifier[self] , identifier[stream] ): literal[string] identifier[df] = identifier[pd] . identifier[read_csv] ( identifier[stream] , identifier[skip_blank_lines] = keyword[True] , identifier[delim_whitespa...
def _convert_data_block_and_headers_to_df(self, stream): """ stream : Streamlike object A Streamlike object (nominally StringIO) containing the data to be extracted ch : dict Column headers to use for the output pd.DataFrame Returns ------- ...
def create( self, resource_group_name, node_name, session, user_name=None, password=None, retention_period=None, credential_data_format=None, encryption_certificate_thumbprint=None, custom_headers=None, raw=False, polling=True, **operation_config): """Creates a session for a node. :param re...
def function[create, parameter[self, resource_group_name, node_name, session, user_name, password, retention_period, credential_data_format, encryption_certificate_thumbprint, custom_headers, raw, polling]]: constant[Creates a session for a node. :param resource_group_name: The resource group name uniq...
keyword[def] identifier[create] ( identifier[self] , identifier[resource_group_name] , identifier[node_name] , identifier[session] , identifier[user_name] = keyword[None] , identifier[password] = keyword[None] , identifier[retention_period] = keyword[None] , identifier[credential_data_format] = keyword[None] , ident...
def create(self, resource_group_name, node_name, session, user_name=None, password=None, retention_period=None, credential_data_format=None, encryption_certificate_thumbprint=None, custom_headers=None, raw=False, polling=True, **operation_config): """Creates a session for a node. :param resource_group_name...
def loop(self): """ loop : 'for' init; ctrl; inc block """ self.eat(TokenTypes.FOR_LOOP) init = NoOp() if self.cur_token.type != TokenTypes.SEMI_COLON: init = self.assign_statement() else: self.eat(TokenTypes.SEMI_COLON) ctrl...
def function[loop, parameter[self]]: constant[ loop : 'for' init; ctrl; inc block ] call[name[self].eat, parameter[name[TokenTypes].FOR_LOOP]] variable[init] assign[=] call[name[NoOp], parameter[]] if compare[name[self].cur_token.type not_equal[!=] name[TokenTypes]....
keyword[def] identifier[loop] ( identifier[self] ): literal[string] identifier[self] . identifier[eat] ( identifier[TokenTypes] . identifier[FOR_LOOP] ) identifier[init] = identifier[NoOp] () keyword[if] identifier[self] . identifier[cur_token] . identifier[type] != identifier[To...
def loop(self): """ loop : 'for' init; ctrl; inc block """ self.eat(TokenTypes.FOR_LOOP) init = NoOp() if self.cur_token.type != TokenTypes.SEMI_COLON: init = self.assign_statement() # depends on [control=['if'], data=[]] else: self.eat(TokenTypes.SEMI_COLON) ...
def save(self, mode=0o600): """ Serialize the config data to the user home directory. :param mode: The octal Unix mode (permissions) for the config file. """ if self._parent is not None: self._parent.save(mode=mode) else: config_dir = os.path.dirn...
def function[save, parameter[self, mode]]: constant[ Serialize the config data to the user home directory. :param mode: The octal Unix mode (permissions) for the config file. ] if compare[name[self]._parent is_not constant[None]] begin[:] call[name[self]._parent....
keyword[def] identifier[save] ( identifier[self] , identifier[mode] = literal[int] ): literal[string] keyword[if] identifier[self] . identifier[_parent] keyword[is] keyword[not] keyword[None] : identifier[self] . identifier[_parent] . identifier[save] ( identifier[mode] = identifie...
def save(self, mode=384): """ Serialize the config data to the user home directory. :param mode: The octal Unix mode (permissions) for the config file. """ if self._parent is not None: self._parent.save(mode=mode) # depends on [control=['if'], data=[]] else: config_...
def select_as_dataframe(self, table_name, columns=None, where=None, extra=None): """ Get data in the database and return fetched data as a :py:class:`pandas.Dataframe` instance. :param str table_name: |arg_select_table_name| :param list columns: |arg_select_as_xx_columns| ...
def function[select_as_dataframe, parameter[self, table_name, columns, where, extra]]: constant[ Get data in the database and return fetched data as a :py:class:`pandas.Dataframe` instance. :param str table_name: |arg_select_table_name| :param list columns: |arg_select_as_xx_col...
keyword[def] identifier[select_as_dataframe] ( identifier[self] , identifier[table_name] , identifier[columns] = keyword[None] , identifier[where] = keyword[None] , identifier[extra] = keyword[None] ): literal[string] keyword[import] identifier[pandas] keyword[if] identifier[columns] ...
def select_as_dataframe(self, table_name, columns=None, where=None, extra=None): """ Get data in the database and return fetched data as a :py:class:`pandas.Dataframe` instance. :param str table_name: |arg_select_table_name| :param list columns: |arg_select_as_xx_columns| :p...
def write_amendment(self, amendment_id, file_content, branch, author): """Given an amendment_id, temporary filename of content, branch and auth_info Deprecated but needed until we merge api local-dep to master... """ gh_user = branch.split('_amendment_')[0] msg = "Update Amendm...
def function[write_amendment, parameter[self, amendment_id, file_content, branch, author]]: constant[Given an amendment_id, temporary filename of content, branch and auth_info Deprecated but needed until we merge api local-dep to master... ] variable[gh_user] assign[=] call[call[name[b...
keyword[def] identifier[write_amendment] ( identifier[self] , identifier[amendment_id] , identifier[file_content] , identifier[branch] , identifier[author] ): literal[string] identifier[gh_user] = identifier[branch] . identifier[split] ( literal[string] )[ literal[int] ] identifier[msg] = ...
def write_amendment(self, amendment_id, file_content, branch, author): """Given an amendment_id, temporary filename of content, branch and auth_info Deprecated but needed until we merge api local-dep to master... """ gh_user = branch.split('_amendment_')[0] msg = "Update Amendment '%s' via...
def _execute(self, *args): """ Execute a given taskwarrior command with arguments Returns a 2-tuple of stdout and stderr (respectively). """ command = ( [ 'task', 'rc:%s' % self.config_filename, ] + self.get_configurat...
def function[_execute, parameter[self]]: constant[ Execute a given taskwarrior command with arguments Returns a 2-tuple of stdout and stderr (respectively). ] variable[command] assign[=] binary_operation[binary_operation[list[[<ast.Constant object at 0x7da18f58e7d0>, <ast.BinOp object ...
keyword[def] identifier[_execute] ( identifier[self] ,* identifier[args] ): literal[string] identifier[command] =( [ literal[string] , literal[string] % identifier[self] . identifier[config_filename] , ] + identifier[self] . identifier[get_configuration_ove...
def _execute(self, *args): """ Execute a given taskwarrior command with arguments Returns a 2-tuple of stdout and stderr (respectively). """ command = ['task', 'rc:%s' % self.config_filename] + self.get_configuration_override_args() + [six.text_type(arg) for arg in args] # subprocess is ex...
def insert(self, i, item_weight): """ Insert an item with the given weight in the sequence """ item, weight = item_weight self._seq.insert(i, item) self.weight += weight
def function[insert, parameter[self, i, item_weight]]: constant[ Insert an item with the given weight in the sequence ] <ast.Tuple object at 0x7da2054a5b70> assign[=] name[item_weight] call[name[self]._seq.insert, parameter[name[i], name[item]]] <ast.AugAssign object at 0x7da...
keyword[def] identifier[insert] ( identifier[self] , identifier[i] , identifier[item_weight] ): literal[string] identifier[item] , identifier[weight] = identifier[item_weight] identifier[self] . identifier[_seq] . identifier[insert] ( identifier[i] , identifier[item] ) identifier...
def insert(self, i, item_weight): """ Insert an item with the given weight in the sequence """ (item, weight) = item_weight self._seq.insert(i, item) self.weight += weight
def parse(input): ''' parse input to datetime ''' if isinstance(input, datetime): return input if isinstance(input, date): return date_to_datetime(input) if isinstance(input, time): return time_to_datetime(input) if isinstance(input, (int, float)): return time...
def function[parse, parameter[input]]: constant[ parse input to datetime ] if call[name[isinstance], parameter[name[input], name[datetime]]] begin[:] return[name[input]] if call[name[isinstance], parameter[name[input], name[date]]] begin[:] return[call[name[date_to_dateti...
keyword[def] identifier[parse] ( identifier[input] ): literal[string] keyword[if] identifier[isinstance] ( identifier[input] , identifier[datetime] ): keyword[return] identifier[input] keyword[if] identifier[isinstance] ( identifier[input] , identifier[date] ): keyword[return] i...
def parse(input): """ parse input to datetime """ if isinstance(input, datetime): return input # depends on [control=['if'], data=[]] if isinstance(input, date): return date_to_datetime(input) # depends on [control=['if'], data=[]] if isinstance(input, time): return tim...
def get_interface_detail_output_interface_line_protocol_exception_info(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") get_interface_detail = ET.Element("get_interface_detail") config = get_interface_detail output = ET.SubElement(get_interface_de...
def function[get_interface_detail_output_interface_line_protocol_exception_info, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[get_interface_detail] assign[=] call[name[ET].Element, parameter[const...
keyword[def] identifier[get_interface_detail_output_interface_line_protocol_exception_info] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[get_interface_detail] = identifier[ET] . identif...
def get_interface_detail_output_interface_line_protocol_exception_info(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') get_interface_detail = ET.Element('get_interface_detail') config = get_interface_detail output = ET.SubElement(get_interface_detail, 'output') ...
def has_active_condition(self, condition, instances): """ Given a list of instances, and the condition active for this switch, returns a boolean representing if the conditional is met, including a non-instance default. """ return_value = None for instance in insta...
def function[has_active_condition, parameter[self, condition, instances]]: constant[ Given a list of instances, and the condition active for this switch, returns a boolean representing if the conditional is met, including a non-instance default. ] variable[return_value] a...
keyword[def] identifier[has_active_condition] ( identifier[self] , identifier[condition] , identifier[instances] ): literal[string] identifier[return_value] = keyword[None] keyword[for] identifier[instance] keyword[in] identifier[instances] +[ keyword[None] ]: keyword[if] ...
def has_active_condition(self, condition, instances): """ Given a list of instances, and the condition active for this switch, returns a boolean representing if the conditional is met, including a non-instance default. """ return_value = None for instance in instances + [None...
def generate_hexagonal_lattice(maxv1, minv1, maxv2, minv2, mindist): """ This function generates a 2-dimensional lattice of points using a hexagonal lattice. Parameters ----------- maxv1 : float Largest value in the 1st dimension to cover minv1 : float Smallest value in the ...
def function[generate_hexagonal_lattice, parameter[maxv1, minv1, maxv2, minv2, mindist]]: constant[ This function generates a 2-dimensional lattice of points using a hexagonal lattice. Parameters ----------- maxv1 : float Largest value in the 1st dimension to cover minv1 : float...
keyword[def] identifier[generate_hexagonal_lattice] ( identifier[maxv1] , identifier[minv1] , identifier[maxv2] , identifier[minv2] , identifier[mindist] ): literal[string] keyword[if] identifier[minv1] > identifier[maxv1] : keyword[raise] identifier[ValueError] ( literal[string] ) keyword[...
def generate_hexagonal_lattice(maxv1, minv1, maxv2, minv2, mindist): """ This function generates a 2-dimensional lattice of points using a hexagonal lattice. Parameters ----------- maxv1 : float Largest value in the 1st dimension to cover minv1 : float Smallest value in the ...
def get_init_container(self, init_command, init_args, env_vars, context_mounts, persistence_outputs, persistence_data): """Pod init container for sett...
def function[get_init_container, parameter[self, init_command, init_args, env_vars, context_mounts, persistence_outputs, persistence_data]]: constant[Pod init container for setting outputs path.] variable[env_vars] assign[=] call[name[to_list], parameter[name[env_vars]]] <ast.AugAssign object at 0x7...
keyword[def] identifier[get_init_container] ( identifier[self] , identifier[init_command] , identifier[init_args] , identifier[env_vars] , identifier[context_mounts] , identifier[persistence_outputs] , identifier[persistence_data] ): literal[string] identifier[env_vars] = identifier[to_list] ...
def get_init_container(self, init_command, init_args, env_vars, context_mounts, persistence_outputs, persistence_data): """Pod init container for setting outputs path.""" env_vars = to_list(env_vars, check_none=True) env_vars += [get_env_var(name=constants.CONFIG_MAP_JOB_INFO_KEY_NAME, value=json.dumps(self...
def extract_uasts(self): """ Returns a new DataFrame with the parsed UAST data of any blob added to its row. >>> blobs_df.extract_uasts :rtype: UASTsDataFrame """ return UASTsDataFrame(self._engine_dataframe.extractUASTs(), self._se...
def function[extract_uasts, parameter[self]]: constant[ Returns a new DataFrame with the parsed UAST data of any blob added to its row. >>> blobs_df.extract_uasts :rtype: UASTsDataFrame ] return[call[name[UASTsDataFrame], parameter[call[name[self]._engine_dataframe....
keyword[def] identifier[extract_uasts] ( identifier[self] ): literal[string] keyword[return] identifier[UASTsDataFrame] ( identifier[self] . identifier[_engine_dataframe] . identifier[extractUASTs] (), identifier[self] . identifier[_session] , identifier[self] . identifier[_implicits] )
def extract_uasts(self): """ Returns a new DataFrame with the parsed UAST data of any blob added to its row. >>> blobs_df.extract_uasts :rtype: UASTsDataFrame """ return UASTsDataFrame(self._engine_dataframe.extractUASTs(), self._session, self._implicits)
def get_object_by_record(record): """Find an object by a given record Inspects request the record to locate an object :param record: A dictionary representation of an object :type record: dict :returns: Found Object or None :rtype: object """ # nothing to do here if not record: ...
def function[get_object_by_record, parameter[record]]: constant[Find an object by a given record Inspects request the record to locate an object :param record: A dictionary representation of an object :type record: dict :returns: Found Object or None :rtype: object ] if <ast.Un...
keyword[def] identifier[get_object_by_record] ( identifier[record] ): literal[string] keyword[if] keyword[not] identifier[record] : keyword[return] keyword[None] keyword[if] identifier[record] . identifier[get] ( literal[string] ): keyword[return] identifier[get_object_b...
def get_object_by_record(record): """Find an object by a given record Inspects request the record to locate an object :param record: A dictionary representation of an object :type record: dict :returns: Found Object or None :rtype: object """ # nothing to do here if not record: ...
def get_item(exchange_id, format=u"Default"): """ Requests a calendar item from the store. exchange_id is the id for this event in the Exchange store. format controls how much data you get back from Exchange. Full docs are here, but acceptible values are IdOnly, Default, and AllProperties. http...
def function[get_item, parameter[exchange_id, format]]: constant[ Requests a calendar item from the store. exchange_id is the id for this event in the Exchange store. format controls how much data you get back from Exchange. Full docs are here, but acceptible values are IdOnly, Default, and Al...
keyword[def] identifier[get_item] ( identifier[exchange_id] , identifier[format] = literal[string] ): literal[string] identifier[elements] = identifier[list] () keyword[if] identifier[type] ( identifier[exchange_id] )== identifier[list] : keyword[for] identifier[item] keyword[in] identifier[exchan...
def get_item(exchange_id, format=u'Default'): """ Requests a calendar item from the store. exchange_id is the id for this event in the Exchange store. format controls how much data you get back from Exchange. Full docs are here, but acceptible values are IdOnly, Default, and AllProperties. ht...
def save_xml(self, doc, element): '''Save this message_sending object into an xml.dom.Element object.''' for cond in self._targets: new_element = doc.createElementNS(RTS_NS, RTS_NS_S + 'targets') new_element.setAttributeNS(XSI_NS, XSI_NS_S + 'type', 'rtsExt:condition_ext') ...
def function[save_xml, parameter[self, doc, element]]: constant[Save this message_sending object into an xml.dom.Element object.] for taget[name[cond]] in starred[name[self]._targets] begin[:] variable[new_element] assign[=] call[name[doc].createElementNS, parameter[name[RTS_NS], binary_...
keyword[def] identifier[save_xml] ( identifier[self] , identifier[doc] , identifier[element] ): literal[string] keyword[for] identifier[cond] keyword[in] identifier[self] . identifier[_targets] : identifier[new_element] = identifier[doc] . identifier[createElementNS] ( identifier[RT...
def save_xml(self, doc, element): """Save this message_sending object into an xml.dom.Element object.""" for cond in self._targets: new_element = doc.createElementNS(RTS_NS, RTS_NS_S + 'targets') new_element.setAttributeNS(XSI_NS, XSI_NS_S + 'type', 'rtsExt:condition_ext') cond.save_xml(...
def to_even_columns(data, headers=None): """ Nicely format the 2-dimensional list into evenly spaced columns """ result = '' col_width = max(len(word) for row in data for word in row) + 2 # padding if headers: header_width = max(len(word) for row in headers for word in row) + 2 ...
def function[to_even_columns, parameter[data, headers]]: constant[ Nicely format the 2-dimensional list into evenly spaced columns ] variable[result] assign[=] constant[] variable[col_width] assign[=] binary_operation[call[name[max], parameter[<ast.GeneratorExp object at 0x7da18f00caf0>]...
keyword[def] identifier[to_even_columns] ( identifier[data] , identifier[headers] = keyword[None] ): literal[string] identifier[result] = literal[string] identifier[col_width] = identifier[max] ( identifier[len] ( identifier[word] ) keyword[for] identifier[row] keyword[in] identifier[data] keywor...
def to_even_columns(data, headers=None): """ Nicely format the 2-dimensional list into evenly spaced columns """ result = '' col_width = max((len(word) for row in data for word in row)) + 2 # padding if headers: header_width = max((len(word) for row in headers for word in row)) + 2 ...
def traverse_to_chron_var(temp_sheet): """ Traverse down to the row that has the first variable :param obj temp_sheet: :return int: """ row = 0 while row < temp_sheet.nrows - 1: if 'Parameter' in temp_sheet.cell_value(row, 0): row += 1 break row += 1 ...
def function[traverse_to_chron_var, parameter[temp_sheet]]: constant[ Traverse down to the row that has the first variable :param obj temp_sheet: :return int: ] variable[row] assign[=] constant[0] while compare[name[row] less[<] binary_operation[name[temp_sheet].nrows - constant[...
keyword[def] identifier[traverse_to_chron_var] ( identifier[temp_sheet] ): literal[string] identifier[row] = literal[int] keyword[while] identifier[row] < identifier[temp_sheet] . identifier[nrows] - literal[int] : keyword[if] literal[string] keyword[in] identifier[temp_sheet] . identifi...
def traverse_to_chron_var(temp_sheet): """ Traverse down to the row that has the first variable :param obj temp_sheet: :return int: """ row = 0 while row < temp_sheet.nrows - 1: if 'Parameter' in temp_sheet.cell_value(row, 0): row += 1 break # depends on [con...