code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def add_to_filemenu(): """Add Pyblish to file-menu .. note:: We're going a bit hacky here, probably due to my lack of understanding for `evalDeferred` or `executeDeferred`, so if you can think of a better solution, feel free to edit. """ if hasattr(cmds, 'about') and not cmds.about(ba...
def function[add_to_filemenu, parameter[]]: constant[Add Pyblish to file-menu .. note:: We're going a bit hacky here, probably due to my lack of understanding for `evalDeferred` or `executeDeferred`, so if you can think of a better solution, feel free to edit. ] if <ast.BoolOp ...
keyword[def] identifier[add_to_filemenu] (): literal[string] keyword[if] identifier[hasattr] ( identifier[cmds] , literal[string] ) keyword[and] keyword[not] identifier[cmds] . identifier[about] ( identifier[batch] = keyword[True] ): identifier[mel] . identifier[eval] ( literal[...
def add_to_filemenu(): """Add Pyblish to file-menu .. note:: We're going a bit hacky here, probably due to my lack of understanding for `evalDeferred` or `executeDeferred`, so if you can think of a better solution, feel free to edit. """ if hasattr(cmds, 'about') and (not cmds.about(ba...
def determine_target_roots(self, goal_name): """Helper for tasks that scan for default target roots. :param string goal_name: The goal name to use for any warning emissions. """ if not self.context.target_roots: print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys.st...
def function[determine_target_roots, parameter[self, goal_name]]: constant[Helper for tasks that scan for default target roots. :param string goal_name: The goal name to use for any warning emissions. ] if <ast.UnaryOp object at 0x7da1b227beb0> begin[:] call[name[print], paramet...
keyword[def] identifier[determine_target_roots] ( identifier[self] , identifier[goal_name] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[context] . identifier[target_roots] : identifier[print] ( literal[string] . identifier[format] ( identifier[goal_name] ), identifier[...
def determine_target_roots(self, goal_name): """Helper for tasks that scan for default target roots. :param string goal_name: The goal name to use for any warning emissions. """ if not self.context.target_roots: print('WARNING: No targets were matched in goal `{}`.'.format(goal_name), file=sys....
def keyStats(symbol, token='', version=''): '''Key Stats about company https://iexcloud.io/docs/api/#key-stats 8am, 9am ET Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result ''' _raiseIf...
def function[keyStats, parameter[symbol, token, version]]: constant[Key Stats about company https://iexcloud.io/docs/api/#key-stats 8am, 9am ET Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: re...
keyword[def] identifier[keyStats] ( identifier[symbol] , identifier[token] = literal[string] , identifier[version] = literal[string] ): literal[string] identifier[_raiseIfNotStr] ( identifier[symbol] ) keyword[return] identifier[_getJson] ( literal[string] + identifier[symbol] + literal[string] , ide...
def keyStats(symbol, token='', version=''): """Key Stats about company https://iexcloud.io/docs/api/#key-stats 8am, 9am ET Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result """ _raiseIf...
def parseCmdline(rh): """ Parse the request command input. Input: Request Handle Output: Request Handle updated with parsed input. Return code - 0: ok, non-zero: error """ rh.printSysLog("Enter getHost.parseCmdline") rh.userid = '' if rh.totalParms >= 2: ...
def function[parseCmdline, parameter[rh]]: constant[ Parse the request command input. Input: Request Handle Output: Request Handle updated with parsed input. Return code - 0: ok, non-zero: error ] call[name[rh].printSysLog, parameter[constant[Enter getHost.parseCmd...
keyword[def] identifier[parseCmdline] ( identifier[rh] ): literal[string] identifier[rh] . identifier[printSysLog] ( literal[string] ) identifier[rh] . identifier[userid] = literal[string] keyword[if] identifier[rh] . identifier[totalParms] >= literal[int] : identifier[rh] . identif...
def parseCmdline(rh): """ Parse the request command input. Input: Request Handle Output: Request Handle updated with parsed input. Return code - 0: ok, non-zero: error """ rh.printSysLog('Enter getHost.parseCmdline') rh.userid = '' if rh.totalParms >= 2: rh...
def objectAtCursor(self): """ Returns the python object that the text is representing. :return <object> || None """ # determine the text block cursor = self.textCursor() text = projex.text.nativestring(cursor.block().text()) ...
def function[objectAtCursor, parameter[self]]: constant[ Returns the python object that the text is representing. :return <object> || None ] variable[cursor] assign[=] call[name[self].textCursor, parameter[]] variable[text] assign[=] call[name[projex].text.na...
keyword[def] identifier[objectAtCursor] ( identifier[self] ): literal[string] identifier[cursor] = identifier[self] . identifier[textCursor] () identifier[text] = identifier[projex] . identifier[text] . identifier[nativestring] ( identifier[cursor] . identifier[block] (). id...
def objectAtCursor(self): """ Returns the python object that the text is representing. :return <object> || None """ # determine the text block cursor = self.textCursor() text = projex.text.nativestring(cursor.block().text()) position = cursor.positionInBlock() - 1 ...
def new(self, page_name, **dict): ''' Create a new item with the provided dict information at the given page_name. Returns the new item. As of version 2.2 of Redmine, this doesn't seem to function. ''' self._item_new_path = '/projects/%s/wiki/%s.json' % \ (s...
def function[new, parameter[self, page_name]]: constant[ Create a new item with the provided dict information at the given page_name. Returns the new item. As of version 2.2 of Redmine, this doesn't seem to function. ] name[self]._item_new_path assign[=] binary_operatio...
keyword[def] identifier[new] ( identifier[self] , identifier[page_name] ,** identifier[dict] ): literal[string] identifier[self] . identifier[_item_new_path] = literal[string] %( identifier[self] . identifier[_project] . identifier[identifier] , identifier[page_name] ) keyword[ret...
def new(self, page_name, **dict): """ Create a new item with the provided dict information at the given page_name. Returns the new item. As of version 2.2 of Redmine, this doesn't seem to function. """ self._item_new_path = '/projects/%s/wiki/%s.json' % (self._project.identifie...
def CreateEvent(self, EventId, Caption, Hint): """Creates a custom event displayed in Skype client's events pane. :Parameters: EventId : unicode Unique identifier for the event. Caption : unicode Caption text. Hint : unicode Hint text. S...
def function[CreateEvent, parameter[self, EventId, Caption, Hint]]: constant[Creates a custom event displayed in Skype client's events pane. :Parameters: EventId : unicode Unique identifier for the event. Caption : unicode Caption text. Hint : unico...
keyword[def] identifier[CreateEvent] ( identifier[self] , identifier[EventId] , identifier[Caption] , identifier[Hint] ): literal[string] identifier[self] . identifier[_Skype] . identifier[_DoCommand] ( literal[string] %( identifier[tounicode] ( identifier[EventId] ), identifier[quote] ( i...
def CreateEvent(self, EventId, Caption, Hint): """Creates a custom event displayed in Skype client's events pane. :Parameters: EventId : unicode Unique identifier for the event. Caption : unicode Caption text. Hint : unicode Hint text. Shown...
def home(request): """This view generates the data for the home page. This login restricted view passes dictionaries containing the current cages, animals and strains as well as the totals for each. This data is passed to the template home.html""" cage_list = Animal.objects.values("Cage").distinct() ...
def function[home, parameter[request]]: constant[This view generates the data for the home page. This login restricted view passes dictionaries containing the current cages, animals and strains as well as the totals for each. This data is passed to the template home.html] variable[cage_list] a...
keyword[def] identifier[home] ( identifier[request] ): literal[string] identifier[cage_list] = identifier[Animal] . identifier[objects] . identifier[values] ( literal[string] ). identifier[distinct] () identifier[cage_list_current] = identifier[cage_list] . identifier[filter] ( identifier[Alive] = key...
def home(request): """This view generates the data for the home page. This login restricted view passes dictionaries containing the current cages, animals and strains as well as the totals for each. This data is passed to the template home.html""" cage_list = Animal.objects.values('Cage').distinct() ...
def init_log(*handlers, **kwargs): """ :param handlers: :return: """ disable_existing_loggers = kwargs.get('disable_existing_loggers', False) handlers_config = [t.get_handler() for t in handlers] new_handlers_config = {} for t in handlers_config: new_handlers_config.update(t) ...
def function[init_log, parameter[]]: constant[ :param handlers: :return: ] variable[disable_existing_loggers] assign[=] call[name[kwargs].get, parameter[constant[disable_existing_loggers], constant[False]]] variable[handlers_config] assign[=] <ast.ListComp object at 0x7da1b242fbb0> ...
keyword[def] identifier[init_log] (* identifier[handlers] ,** identifier[kwargs] ): literal[string] identifier[disable_existing_loggers] = identifier[kwargs] . identifier[get] ( literal[string] , keyword[False] ) identifier[handlers_config] =[ identifier[t] . identifier[get_handler] () keyword[for] ...
def init_log(*handlers, **kwargs): """ :param handlers: :return: """ disable_existing_loggers = kwargs.get('disable_existing_loggers', False) handlers_config = [t.get_handler() for t in handlers] new_handlers_config = {} for t in handlers_config: new_handlers_config.update(t) # ...
def _parseCounters(self, data): """Parse simple stats list of key, value pairs. @param data: Multiline data with one key-value pair in each line. @return: Dictionary of stats. """ info_dict = util.NestedDict() for line in data.splitlines(): ...
def function[_parseCounters, parameter[self, data]]: constant[Parse simple stats list of key, value pairs. @param data: Multiline data with one key-value pair in each line. @return: Dictionary of stats. ] variable[info_dict] assign[=] call[name[util].Nes...
keyword[def] identifier[_parseCounters] ( identifier[self] , identifier[data] ): literal[string] identifier[info_dict] = identifier[util] . identifier[NestedDict] () keyword[for] identifier[line] keyword[in] identifier[data] . identifier[splitlines] (): identifier[mobj] = i...
def _parseCounters(self, data): """Parse simple stats list of key, value pairs. @param data: Multiline data with one key-value pair in each line. @return: Dictionary of stats. """ info_dict = util.NestedDict() for line in data.splitlines(): mobj = re...
def set_video_config(self, video_config): ''' .. versionchanged:: 0.6.1 Log video source process ID. ''' self.video_config = video_config if video_config is None: self.disable_video() return py_exe = sys.executable port = self....
def function[set_video_config, parameter[self, video_config]]: constant[ .. versionchanged:: 0.6.1 Log video source process ID. ] name[self].video_config assign[=] name[video_config] if compare[name[video_config] is constant[None]] begin[:] call[name[s...
keyword[def] identifier[set_video_config] ( identifier[self] , identifier[video_config] ): literal[string] identifier[self] . identifier[video_config] = identifier[video_config] keyword[if] identifier[video_config] keyword[is] keyword[None] : identifier[self] . identifier[...
def set_video_config(self, video_config): """ .. versionchanged:: 0.6.1 Log video source process ID. """ self.video_config = video_config if video_config is None: self.disable_video() return # depends on [control=['if'], data=[]] py_exe = sys.executable p...
def _to_rest_includes(models, includes): """ Fetch the models to be included The includes should follow a few basic rules: * the include MUST not already be an array member of the included array (no dupes) * the include MUST not be the same as the primary data if the prima...
def function[_to_rest_includes, parameter[models, includes]]: constant[ Fetch the models to be included The includes should follow a few basic rules: * the include MUST not already be an array member of the included array (no dupes) * the include MUST not be the same as the prim...
keyword[def] identifier[_to_rest_includes] ( identifier[models] , identifier[includes] ): literal[string] identifier[included] =[] identifier[includes] = identifier[includes] keyword[or] [] keyword[if] keyword[not] identifier[isinstance] ( identifier[models] , identifier[list] ): id...
def _to_rest_includes(models, includes): """ Fetch the models to be included The includes should follow a few basic rules: * the include MUST not already be an array member of the included array (no dupes) * the include MUST not be the same as the primary data if the prima...
def clear_line(mode=2): ''' Clear the current line. Arguments: mode: | 0 | 'forward' | 'right' - Clear cursor to end of line. | 1 | 'backward' | 'left' - Clear cursor to beginning of line. | 2 | 'full' - Clear entire line. Note: ...
def function[clear_line, parameter[mode]]: constant[ Clear the current line. Arguments: mode: | 0 | 'forward' | 'right' - Clear cursor to end of line. | 1 | 'backward' | 'left' - Clear cursor to beginning of line. | 2 | 'full' - Clear ...
keyword[def] identifier[clear_line] ( identifier[mode] = literal[int] ): literal[string] identifier[text] = identifier[sc] . identifier[erase_line] ( identifier[_mode_map] . identifier[get] ( identifier[mode] , identifier[mode] )) identifier[_write] ( identifier[text] ) keyword[return] identifie...
def clear_line(mode=2): """ Clear the current line. Arguments: mode: | 0 | 'forward' | 'right' - Clear cursor to end of line. | 1 | 'backward' | 'left' - Clear cursor to beginning of line. | 2 | 'full' - Clear entire line. Note: ...
def media(self, uri): """Play a media file.""" try: local_path, _ = urllib.request.urlretrieve(uri) metadata = mutagen.File(local_path, easy=True) if metadata.tags: self._tags = metadata.tags title = self._tags.get(TAG_TITLE, []) ...
def function[media, parameter[self, uri]]: constant[Play a media file.] <ast.Try object at 0x7da2054a51e0> call[name[self]._player.set_state, parameter[name[Gst].State.NULL]] call[name[self]._player.set_property, parameter[name[PROP_URI], name[local_uri]]] call[name[self]._player.set...
keyword[def] identifier[media] ( identifier[self] , identifier[uri] ): literal[string] keyword[try] : identifier[local_path] , identifier[_] = identifier[urllib] . identifier[request] . identifier[urlretrieve] ( identifier[uri] ) identifier[metadata] = identifier[mutagen] ...
def media(self, uri): """Play a media file.""" try: (local_path, _) = urllib.request.urlretrieve(uri) metadata = mutagen.File(local_path, easy=True) if metadata.tags: self._tags = metadata.tags # depends on [control=['if'], data=[]] title = self._tags.get(TAG_TITLE, ...
def list_apps(self): """获得当前账号的应用列表 列出所属应用为当前请求方的应用列表。 Returns: 返回一个tuple对象,其格式为(<result>, <ResponseInfo>) - result 成功返回应用列表,失败返回None - ResponseInfo 请求的Response信息 """ url = '{0}/v3/apps'.format(self.host) return http._get...
def function[list_apps, parameter[self]]: constant[获得当前账号的应用列表 列出所属应用为当前请求方的应用列表。 Returns: 返回一个tuple对象,其格式为(<result>, <ResponseInfo>) - result 成功返回应用列表,失败返回None - ResponseInfo 请求的Response信息 ] variable[url] assign[=] call[constant[...
keyword[def] identifier[list_apps] ( identifier[self] ): literal[string] identifier[url] = literal[string] . identifier[format] ( identifier[self] . identifier[host] ) keyword[return] identifier[http] . identifier[_get_with_qiniu_mac] ( identifier[url] , keyword[None] , identifier[self] ...
def list_apps(self): """获得当前账号的应用列表 列出所属应用为当前请求方的应用列表。 Returns: 返回一个tuple对象,其格式为(<result>, <ResponseInfo>) - result 成功返回应用列表,失败返回None - ResponseInfo 请求的Response信息 """ url = '{0}/v3/apps'.format(self.host) return http._get_with_qiniu_m...
def delete_task(self, task_name): """ Deletes the named Task in this Job. """ logger.debug('Deleting task {0}'.format(task_name)) if not self.state.allow_change_graph: raise DagobahError("job's graph is immutable in its current state: %s" % self.state....
def function[delete_task, parameter[self, task_name]]: constant[ Deletes the named Task in this Job. ] call[name[logger].debug, parameter[call[constant[Deleting task {0}].format, parameter[name[task_name]]]]] if <ast.UnaryOp object at 0x7da1b0bdae90> begin[:] <ast.Raise object at 0x7da1b...
keyword[def] identifier[delete_task] ( identifier[self] , identifier[task_name] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] . identifier[format] ( identifier[task_name] )) keyword[if] keyword[not] identifier[self] . identifier[state] . identifier[allow_ch...
def delete_task(self, task_name): """ Deletes the named Task in this Job. """ logger.debug('Deleting task {0}'.format(task_name)) if not self.state.allow_change_graph: raise DagobahError("job's graph is immutable in its current state: %s" % self.state.status) # depends on [control=['if'], data=[]] ...
def get_thermostability(self, at_temp): """Run the thermostability calculator using either the Dill or Oobatake methods. Stores calculated (dG, Keq) tuple in the ``annotations`` attribute, under the key `thermostability_<TEMP>-<METHOD_USED>`. See :func:`ssbio.protein.sequence.propertie...
def function[get_thermostability, parameter[self, at_temp]]: constant[Run the thermostability calculator using either the Dill or Oobatake methods. Stores calculated (dG, Keq) tuple in the ``annotations`` attribute, under the key `thermostability_<TEMP>-<METHOD_USED>`. See :func:`ssbio...
keyword[def] identifier[get_thermostability] ( identifier[self] , identifier[at_temp] ): literal[string] keyword[import] identifier[ssbio] . identifier[protein] . identifier[sequence] . identifier[properties] . identifier[thermostability] keyword[as] identifier[ts] identifier[dG] = i...
def get_thermostability(self, at_temp): """Run the thermostability calculator using either the Dill or Oobatake methods. Stores calculated (dG, Keq) tuple in the ``annotations`` attribute, under the key `thermostability_<TEMP>-<METHOD_USED>`. See :func:`ssbio.protein.sequence.properties.th...
def from_array_list(required_type, result, list_level, is_builtin): """ Tries to parse the `result` as type given in `required_type`, while traversing into lists as often as specified in `list_level`. :param required_type: What it should be parsed as :type required_type: class :param result: The ...
def function[from_array_list, parameter[required_type, result, list_level, is_builtin]]: constant[ Tries to parse the `result` as type given in `required_type`, while traversing into lists as often as specified in `list_level`. :param required_type: What it should be parsed as :type required_type:...
keyword[def] identifier[from_array_list] ( identifier[required_type] , identifier[result] , identifier[list_level] , identifier[is_builtin] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] . identifier[format] ( identifier[type] = identifier[required_type] . identifier[__nam...
def from_array_list(required_type, result, list_level, is_builtin): """ Tries to parse the `result` as type given in `required_type`, while traversing into lists as often as specified in `list_level`. :param required_type: What it should be parsed as :type required_type: class :param result: The ...
def btc_tx_sighash_segwit(tx, i, prevout_amount, prevout_script, hashcode=SIGHASH_ALL): """ Calculate the sighash for a segwit transaction, according to bip143 """ txobj = btc_tx_deserialize(tx) hash_prevouts = encoding.encode(0, 256, 32) hash_sequence = encoding.encode(0, 256, 32) hash_out...
def function[btc_tx_sighash_segwit, parameter[tx, i, prevout_amount, prevout_script, hashcode]]: constant[ Calculate the sighash for a segwit transaction, according to bip143 ] variable[txobj] assign[=] call[name[btc_tx_deserialize], parameter[name[tx]]] variable[hash_prevouts] assign[=]...
keyword[def] identifier[btc_tx_sighash_segwit] ( identifier[tx] , identifier[i] , identifier[prevout_amount] , identifier[prevout_script] , identifier[hashcode] = identifier[SIGHASH_ALL] ): literal[string] identifier[txobj] = identifier[btc_tx_deserialize] ( identifier[tx] ) identifier[hash_prevouts]...
def btc_tx_sighash_segwit(tx, i, prevout_amount, prevout_script, hashcode=SIGHASH_ALL): """ Calculate the sighash for a segwit transaction, according to bip143 """ txobj = btc_tx_deserialize(tx) hash_prevouts = encoding.encode(0, 256, 32) hash_sequence = encoding.encode(0, 256, 32) hash_outp...
def run_job(self, job_id, array_id = None): """Overwrites the run-job command from the manager to extract the correct job id before calling base class implementation.""" # get the unique job id from the given grid id self.lock() jobs = list(self.session.query(Job).filter(Job.id == job_id)) if len(jo...
def function[run_job, parameter[self, job_id, array_id]]: constant[Overwrites the run-job command from the manager to extract the correct job id before calling base class implementation.] call[name[self].lock, parameter[]] variable[jobs] assign[=] call[name[list], parameter[call[call[name[self]....
keyword[def] identifier[run_job] ( identifier[self] , identifier[job_id] , identifier[array_id] = keyword[None] ): literal[string] identifier[self] . identifier[lock] () identifier[jobs] = identifier[list] ( identifier[self] . identifier[session] . identifier[query] ( identifier[Job] ). identifie...
def run_job(self, job_id, array_id=None): """Overwrites the run-job command from the manager to extract the correct job id before calling base class implementation.""" # get the unique job id from the given grid id self.lock() jobs = list(self.session.query(Job).filter(Job.id == job_id)) if len(jobs...
def _get_path_pattern_tornado45(self, router=None): """Return the path pattern used when routing a request. (Tornado>=4.5) :param tornado.routing.Router router: (Optional) The router to scan. Defaults to the application's router. :rtype: str """ if router is None: ...
def function[_get_path_pattern_tornado45, parameter[self, router]]: constant[Return the path pattern used when routing a request. (Tornado>=4.5) :param tornado.routing.Router router: (Optional) The router to scan. Defaults to the application's router. :rtype: str ] ...
keyword[def] identifier[_get_path_pattern_tornado45] ( identifier[self] , identifier[router] = keyword[None] ): literal[string] keyword[if] identifier[router] keyword[is] keyword[None] : identifier[router] = identifier[self] . identifier[application] . identifier[default_router] ...
def _get_path_pattern_tornado45(self, router=None): """Return the path pattern used when routing a request. (Tornado>=4.5) :param tornado.routing.Router router: (Optional) The router to scan. Defaults to the application's router. :rtype: str """ if router is None: r...
def dumpf(obj, path, encoding=None): """Serialize obj to path in ARPA format (.arpa, .gz).""" path = str(path) if path.endswith('.gz'): with gzip.open(path, mode='wt', encoding=encoding) as f: return dump(obj, f) else: with open(path, mode='wt', encoding=encoding) as f: ...
def function[dumpf, parameter[obj, path, encoding]]: constant[Serialize obj to path in ARPA format (.arpa, .gz).] variable[path] assign[=] call[name[str], parameter[name[path]]] if call[name[path].endswith, parameter[constant[.gz]]] begin[:] with call[name[gzip].open, parameter[n...
keyword[def] identifier[dumpf] ( identifier[obj] , identifier[path] , identifier[encoding] = keyword[None] ): literal[string] identifier[path] = identifier[str] ( identifier[path] ) keyword[if] identifier[path] . identifier[endswith] ( literal[string] ): keyword[with] identifier[gzip] . ide...
def dumpf(obj, path, encoding=None): """Serialize obj to path in ARPA format (.arpa, .gz).""" path = str(path) if path.endswith('.gz'): with gzip.open(path, mode='wt', encoding=encoding) as f: return dump(obj, f) # depends on [control=['with'], data=['f']] # depends on [control=['if'],...
def split_date(value): """ This method splits a date in a tuple. value: valid iso date ex: 2016-01-31: ('2016','01','01') 2016-01: ('2016','01','') 2016: ('2016','','') """ if not is_valid_date(value): return ('', '', '') splited = value.split('-...
def function[split_date, parameter[value]]: constant[ This method splits a date in a tuple. value: valid iso date ex: 2016-01-31: ('2016','01','01') 2016-01: ('2016','01','') 2016: ('2016','','') ] if <ast.UnaryOp object at 0x7da204962e30> begin[:] ...
keyword[def] identifier[split_date] ( identifier[value] ): literal[string] keyword[if] keyword[not] identifier[is_valid_date] ( identifier[value] ): keyword[return] ( literal[string] , literal[string] , literal[string] ) identifier[splited] = identifier[value] . identifier[split] ( literal...
def split_date(value): """ This method splits a date in a tuple. value: valid iso date ex: 2016-01-31: ('2016','01','01') 2016-01: ('2016','01','') 2016: ('2016','','') """ if not is_valid_date(value): return ('', '', '') # depends on [control=['if']...
def enable_cloud_password( self, password: str, hint: str = "", email: str = None ) -> bool: """Use this method to enable the Two-Step Verification security feature (Cloud Password) on your account. This password will be asked when you log-in on a new device in addit...
def function[enable_cloud_password, parameter[self, password, hint, email]]: constant[Use this method to enable the Two-Step Verification security feature (Cloud Password) on your account. This password will be asked when you log-in on a new device in addition to the SMS code. Args: ...
keyword[def] identifier[enable_cloud_password] ( identifier[self] , identifier[password] : identifier[str] , identifier[hint] : identifier[str] = literal[string] , identifier[email] : identifier[str] = keyword[None] )-> identifier[bool] : literal[string] identifier[r] = identifier[self] . iden...
def enable_cloud_password(self, password: str, hint: str='', email: str=None) -> bool: """Use this method to enable the Two-Step Verification security feature (Cloud Password) on your account. This password will be asked when you log-in on a new device in addition to the SMS code. Args: ...
def course(self): """ Course this node belongs to """ course = self.parent while course.parent: course = course.parent return course
def function[course, parameter[self]]: constant[ Course this node belongs to ] variable[course] assign[=] name[self].parent while name[course].parent begin[:] variable[course] assign[=] name[course].parent return[name[course]]
keyword[def] identifier[course] ( identifier[self] ): literal[string] identifier[course] = identifier[self] . identifier[parent] keyword[while] identifier[course] . identifier[parent] : identifier[course] = identifier[course] . identifier[parent] keyword[return] i...
def course(self): """ Course this node belongs to """ course = self.parent while course.parent: course = course.parent # depends on [control=['while'], data=[]] return course
def fields(*fields, **keys): """ Factory for for L{MessageType} and L{ActionType} field definitions. @param *fields: A L{tuple} of L{Field} instances. @param **keys: A L{dict} mapping key names to the expected type of the field's values. @return: A L{list} of L{Field} instances. """ ...
def function[fields, parameter[]]: constant[ Factory for for L{MessageType} and L{ActionType} field definitions. @param *fields: A L{tuple} of L{Field} instances. @param **keys: A L{dict} mapping key names to the expected type of the field's values. @return: A L{list} of L{Field} inst...
keyword[def] identifier[fields] (* identifier[fields] ,** identifier[keys] ): literal[string] keyword[return] identifier[list] ( identifier[fields] )+[ identifier[Field] . identifier[forTypes] ( identifier[key] ,[ identifier[value] ], literal[string] ) keyword[for] identifier[key] , identifier[value...
def fields(*fields, **keys): """ Factory for for L{MessageType} and L{ActionType} field definitions. @param *fields: A L{tuple} of L{Field} instances. @param **keys: A L{dict} mapping key names to the expected type of the field's values. @return: A L{list} of L{Field} instances. """ ...
def query_tissue_specificity(): """ Returns list of tissue specificity by query parameters --- tags: - Query functions parameters: - name: comment in: query type: string required: false description: Comment to tissue specificity default: '%APP6...
def function[query_tissue_specificity, parameter[]]: constant[ Returns list of tissue specificity by query parameters --- tags: - Query functions parameters: - name: comment in: query type: string required: false description: Comment to tissue spec...
keyword[def] identifier[query_tissue_specificity] (): literal[string] identifier[args] = identifier[get_args] ( identifier[request_args] = identifier[request] . identifier[args] , identifier[allowed_str_args] =[ literal[string] , literal[string] ], identifier[allowed_int_args] =[ literal[str...
def query_tissue_specificity(): """ Returns list of tissue specificity by query parameters --- tags: - Query functions parameters: - name: comment in: query type: string required: false description: Comment to tissue specificity default: '%APP6...
def groupIntoChoices(splitsOnWord, wordWidth: int, origin: OneOfTransaction): """ :param splitsOnWord: list of lists of parts (fields splited on word boundaries) :return: generators of ChoicesOfFrameParts for each word which are not crossing word boundaries """ def cmpWordIndex(a, b)...
def function[groupIntoChoices, parameter[splitsOnWord, wordWidth, origin]]: constant[ :param splitsOnWord: list of lists of parts (fields splited on word boundaries) :return: generators of ChoicesOfFrameParts for each word which are not crossing word boundaries ] def function...
keyword[def] identifier[groupIntoChoices] ( identifier[splitsOnWord] , identifier[wordWidth] : identifier[int] , identifier[origin] : identifier[OneOfTransaction] ): literal[string] keyword[def] identifier[cmpWordIndex] ( identifier[a] , identifier[b] ): keyword[return] identifier[a] . identifie...
def groupIntoChoices(splitsOnWord, wordWidth: int, origin: OneOfTransaction): """ :param splitsOnWord: list of lists of parts (fields splited on word boundaries) :return: generators of ChoicesOfFrameParts for each word which are not crossing word boundaries """ def cmpWordIndex(a, b...
def update(self, **kwargs): """ Update the project :param kwargs: Project properties """ old_json = self.__json__() for prop in kwargs: setattr(self, prop, kwargs[prop]) # We send notif only if object has changed if old_json != self.__json__...
def function[update, parameter[self]]: constant[ Update the project :param kwargs: Project properties ] variable[old_json] assign[=] call[name[self].__json__, parameter[]] for taget[name[prop]] in starred[name[kwargs]] begin[:] call[name[setattr], paramete...
keyword[def] identifier[update] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[old_json] = identifier[self] . identifier[__json__] () keyword[for] identifier[prop] keyword[in] identifier[kwargs] : identifier[setattr] ( identifier[self] , identifie...
def update(self, **kwargs): """ Update the project :param kwargs: Project properties """ old_json = self.__json__() for prop in kwargs: setattr(self, prop, kwargs[prop]) # depends on [control=['for'], data=['prop']] # We send notif only if object has changed if old_j...
def get_new_term_doc_mat(self, doc_domains): ''' Combines documents together that are in the same domain Parameters ---------- doc_domains : array-like Returns ------- scipy.sparse.csr_matrix ''' assert len(doc_domains) == self.term_doc_matrix.get_num_docs() doc_domain_set = set(doc_domains) ...
def function[get_new_term_doc_mat, parameter[self, doc_domains]]: constant[ Combines documents together that are in the same domain Parameters ---------- doc_domains : array-like Returns ------- scipy.sparse.csr_matrix ] assert[compare[call[name[len], parameter[name[doc_domains]]] equal[=...
keyword[def] identifier[get_new_term_doc_mat] ( identifier[self] , identifier[doc_domains] ): literal[string] keyword[assert] identifier[len] ( identifier[doc_domains] )== identifier[self] . identifier[term_doc_matrix] . identifier[get_num_docs] () identifier[doc_domain_set] = identifier[set] ( identifier[...
def get_new_term_doc_mat(self, doc_domains): """ Combines documents together that are in the same domain Parameters ---------- doc_domains : array-like Returns ------- scipy.sparse.csr_matrix """ assert len(doc_domains) == self.term_doc_matrix.get_num_docs() doc_domain_set = set(doc_domai...
def get_coordinates(filename, fmt): """ Get coordinates from filename in format fmt. Supports XYZ and PDB. Parameters ---------- filename : string Filename to read fmt : string Format of filename. Either xyz or pdb. Returns ------- atoms : list List of atomic ...
def function[get_coordinates, parameter[filename, fmt]]: constant[ Get coordinates from filename in format fmt. Supports XYZ and PDB. Parameters ---------- filename : string Filename to read fmt : string Format of filename. Either xyz or pdb. Returns ------- atoms...
keyword[def] identifier[get_coordinates] ( identifier[filename] , identifier[fmt] ): literal[string] keyword[if] identifier[fmt] == literal[string] : identifier[get_func] = identifier[get_coordinates_xyz] keyword[elif] identifier[fmt] == literal[string] : identifier[get_func] = id...
def get_coordinates(filename, fmt): """ Get coordinates from filename in format fmt. Supports XYZ and PDB. Parameters ---------- filename : string Filename to read fmt : string Format of filename. Either xyz or pdb. Returns ------- atoms : list List of atomic ...
def _vec_lnqmed_residuals(self, catchments): """ Return ln(QMED) model errors for a list of catchments :param catchments: List of gauged catchments :type catchments: list of :class:`Catchment` :return: Model errors :rtype: list of float """ result = np.em...
def function[_vec_lnqmed_residuals, parameter[self, catchments]]: constant[ Return ln(QMED) model errors for a list of catchments :param catchments: List of gauged catchments :type catchments: list of :class:`Catchment` :return: Model errors :rtype: list of float ...
keyword[def] identifier[_vec_lnqmed_residuals] ( identifier[self] , identifier[catchments] ): literal[string] identifier[result] = identifier[np] . identifier[empty] ( identifier[len] ( identifier[catchments] )) keyword[for] identifier[index] , identifier[donor] keyword[in] identifier[e...
def _vec_lnqmed_residuals(self, catchments): """ Return ln(QMED) model errors for a list of catchments :param catchments: List of gauged catchments :type catchments: list of :class:`Catchment` :return: Model errors :rtype: list of float """ result = np.empty(len(...
def upload_activity(self, activity_file, data_type, name=None, description=None, activity_type=None, private=None, external_id=None): """ Uploads a GPS file (tcx, gpx) to create a new activity for current athlete. http://strava.github.io/api/v3/athlete/#get-details ...
def function[upload_activity, parameter[self, activity_file, data_type, name, description, activity_type, private, external_id]]: constant[ Uploads a GPS file (tcx, gpx) to create a new activity for current athlete. http://strava.github.io/api/v3/athlete/#get-details :param activity_fi...
keyword[def] identifier[upload_activity] ( identifier[self] , identifier[activity_file] , identifier[data_type] , identifier[name] = keyword[None] , identifier[description] = keyword[None] , identifier[activity_type] = keyword[None] , identifier[private] = keyword[None] , identifier[external_id] = keyword[None] ): ...
def upload_activity(self, activity_file, data_type, name=None, description=None, activity_type=None, private=None, external_id=None): """ Uploads a GPS file (tcx, gpx) to create a new activity for current athlete. http://strava.github.io/api/v3/athlete/#get-details :param activity_file: Th...
def list_all(self): ''' Return a list of the reactors ''' if isinstance(self.minion.opts['reactor'], six.string_types): log.debug('Reading reactors from yaml %s', self.opts['reactor']) try: with salt.utils.files.fopen(self.opts['reactor']) as fp_: ...
def function[list_all, parameter[self]]: constant[ Return a list of the reactors ] if call[name[isinstance], parameter[call[name[self].minion.opts][constant[reactor]], name[six].string_types]] begin[:] call[name[log].debug, parameter[constant[Reading reactors from yaml %s...
keyword[def] identifier[list_all] ( identifier[self] ): literal[string] keyword[if] identifier[isinstance] ( identifier[self] . identifier[minion] . identifier[opts] [ literal[string] ], identifier[six] . identifier[string_types] ): identifier[log] . identifier[debug] ( literal[string...
def list_all(self): """ Return a list of the reactors """ if isinstance(self.minion.opts['reactor'], six.string_types): log.debug('Reading reactors from yaml %s', self.opts['reactor']) try: with salt.utils.files.fopen(self.opts['reactor']) as fp_: reac...
def always_iterable(item): """ Given an object, always return an iterable. If the item is not already iterable, return a tuple containing only the item. If item is None, an empty iterable is returned. >>> always_iterable([1,2,3]) <list_iterator...> >>> always_iterable('foo') <tuple_iterator...> >>> always_ite...
def function[always_iterable, parameter[item]]: constant[ Given an object, always return an iterable. If the item is not already iterable, return a tuple containing only the item. If item is None, an empty iterable is returned. >>> always_iterable([1,2,3]) <list_iterator...> >>> always_iterable('foo') <...
keyword[def] identifier[always_iterable] ( identifier[item] ): literal[string] identifier[base_types] = identifier[six] . identifier[text_type] , identifier[bytes] , identifier[collections] . identifier[abc] . identifier[Mapping] keyword[return] identifier[more_itertools] . identifier[always_iterable] ( iden...
def always_iterable(item): """ Given an object, always return an iterable. If the item is not already iterable, return a tuple containing only the item. If item is None, an empty iterable is returned. >>> always_iterable([1,2,3]) <list_iterator...> >>> always_iterable('foo') <tuple_iterator...> >>> always_...
def add_args(p): """ Update parser with tool specific arguments. This overwrites was is done in utils.uns_args. """ # dictionary for adding arguments dadd_args = { '--opfile': { 'default': '', 'metavar': 'f', 'type': str, 'help': 'Specify ...
def function[add_args, parameter[p]]: constant[ Update parser with tool specific arguments. This overwrites was is done in utils.uns_args. ] variable[dadd_args] assign[=] dictionary[[<ast.Constant object at 0x7da20c6c5720>], [<ast.Dict object at 0x7da20c6c4370>]] variable[p] assign[...
keyword[def] identifier[add_args] ( identifier[p] ): literal[string] identifier[dadd_args] ={ literal[string] :{ literal[string] : literal[string] , literal[string] : literal[string] , literal[string] : identifier[str] , literal[string] : literal[string] literal[string] ...
def add_args(p): """ Update parser with tool specific arguments. This overwrites was is done in utils.uns_args. """ # dictionary for adding arguments dadd_args = {'--opfile': {'default': '', 'metavar': 'f', 'type': str, 'help': 'Specify a parameter file (default: "sim/${exkey}_params.txt")'}} ...
def pop_all(self): """ NON-BLOCKING POP ALL IN QUEUE, IF ANY """ with self.lock: output = list(self.queue) self.queue.clear() return output
def function[pop_all, parameter[self]]: constant[ NON-BLOCKING POP ALL IN QUEUE, IF ANY ] with name[self].lock begin[:] variable[output] assign[=] call[name[list], parameter[name[self].queue]] call[name[self].queue.clear, parameter[]] return[name[outpu...
keyword[def] identifier[pop_all] ( identifier[self] ): literal[string] keyword[with] identifier[self] . identifier[lock] : identifier[output] = identifier[list] ( identifier[self] . identifier[queue] ) identifier[self] . identifier[queue] . identifier[clear] () ...
def pop_all(self): """ NON-BLOCKING POP ALL IN QUEUE, IF ANY """ with self.lock: output = list(self.queue) self.queue.clear() # depends on [control=['with'], data=[]] return output
def generate_jsapi_signature(self, timestamp, noncestr, url, jsapi_ticket=None): """ 使用 jsapi_ticket 对 url 进行签名 :param timestamp: 时间戳 :param noncestr: 随机数 :param url: 要签名的 url,不包含 # 及其后面部分 :param jsapi_ticket: (可选参数) jsapi_ticket 值 (如不提供将自动通过 appid 和 appsecret 获取) ...
def function[generate_jsapi_signature, parameter[self, timestamp, noncestr, url, jsapi_ticket]]: constant[ 使用 jsapi_ticket 对 url 进行签名 :param timestamp: 时间戳 :param noncestr: 随机数 :param url: 要签名的 url,不包含 # 及其后面部分 :param jsapi_ticket: (可选参数) jsapi_ticket 值 (如不提供将自动通过 appid 和...
keyword[def] identifier[generate_jsapi_signature] ( identifier[self] , identifier[timestamp] , identifier[noncestr] , identifier[url] , identifier[jsapi_ticket] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[jsapi_ticket] : identifier[jsapi_ticket] = identifie...
def generate_jsapi_signature(self, timestamp, noncestr, url, jsapi_ticket=None): """ 使用 jsapi_ticket 对 url 进行签名 :param timestamp: 时间戳 :param noncestr: 随机数 :param url: 要签名的 url,不包含 # 及其后面部分 :param jsapi_ticket: (可选参数) jsapi_ticket 值 (如不提供将自动通过 appid 和 appsecret 获取) :re...
def data(self, ctx=None): """Returns a copy of this parameter on one context. Must have been initialized on this context before. Parameters ---------- ctx : Context Desired context. Returns ------- NDArray on ctx """ d = self._...
def function[data, parameter[self, ctx]]: constant[Returns a copy of this parameter on one context. Must have been initialized on this context before. Parameters ---------- ctx : Context Desired context. Returns ------- NDArray on ctx ...
keyword[def] identifier[data] ( identifier[self] , identifier[ctx] = keyword[None] ): literal[string] identifier[d] = identifier[self] . identifier[_check_and_get] ( identifier[self] . identifier[_data] , identifier[ctx] ) keyword[if] identifier[self] . identifier[_rate] : id...
def data(self, ctx=None): """Returns a copy of this parameter on one context. Must have been initialized on this context before. Parameters ---------- ctx : Context Desired context. Returns ------- NDArray on ctx """ d = self._check_an...
def mid_pt(self): """Midpoint of this interval product.""" midp = (self.max_pt + self.min_pt) / 2. midp[~self.nondegen_byaxis] = self.min_pt[~self.nondegen_byaxis] return midp
def function[mid_pt, parameter[self]]: constant[Midpoint of this interval product.] variable[midp] assign[=] binary_operation[binary_operation[name[self].max_pt + name[self].min_pt] / constant[2.0]] call[name[midp]][<ast.UnaryOp object at 0x7da1b20faf50>] assign[=] call[name[self].min_pt][<ast.U...
keyword[def] identifier[mid_pt] ( identifier[self] ): literal[string] identifier[midp] =( identifier[self] . identifier[max_pt] + identifier[self] . identifier[min_pt] )/ literal[int] identifier[midp] [~ identifier[self] . identifier[nondegen_byaxis] ]= identifier[self] . identifier[min_p...
def mid_pt(self): """Midpoint of this interval product.""" midp = (self.max_pt + self.min_pt) / 2.0 midp[~self.nondegen_byaxis] = self.min_pt[~self.nondegen_byaxis] return midp
def assistant_fallback_actions(self): """ Access the assistant_fallback_actions :returns: twilio.rest.preview.understand.assistant.assistant_fallback_actions.AssistantFallbackActionsList :rtype: twilio.rest.preview.understand.assistant.assistant_fallback_actions.AssistantFallbackActions...
def function[assistant_fallback_actions, parameter[self]]: constant[ Access the assistant_fallback_actions :returns: twilio.rest.preview.understand.assistant.assistant_fallback_actions.AssistantFallbackActionsList :rtype: twilio.rest.preview.understand.assistant.assistant_fallback_actio...
keyword[def] identifier[assistant_fallback_actions] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_assistant_fallback_actions] keyword[is] keyword[None] : identifier[self] . identifier[_assistant_fallback_actions] = identifier[AssistantFallbackActio...
def assistant_fallback_actions(self): """ Access the assistant_fallback_actions :returns: twilio.rest.preview.understand.assistant.assistant_fallback_actions.AssistantFallbackActionsList :rtype: twilio.rest.preview.understand.assistant.assistant_fallback_actions.AssistantFallbackActionsList...
def parse_services(config, services): """Parse configuration to return number of enabled service checks. Arguments: config (obj): A configparser object with the configuration of anycast-healthchecker. services (list): A list of section names which holds configuration for each se...
def function[parse_services, parameter[config, services]]: constant[Parse configuration to return number of enabled service checks. Arguments: config (obj): A configparser object with the configuration of anycast-healthchecker. services (list): A list of section names which holds co...
keyword[def] identifier[parse_services] ( identifier[config] , identifier[services] ): literal[string] identifier[enabled] = literal[int] keyword[for] identifier[service] keyword[in] identifier[services] : identifier[check_disabled] = identifier[config] . identifier[getboolean] ( identifi...
def parse_services(config, services): """Parse configuration to return number of enabled service checks. Arguments: config (obj): A configparser object with the configuration of anycast-healthchecker. services (list): A list of section names which holds configuration for each se...
def convert_trees(self, ptb_trees, representation='basic', include_punct=True, include_erased=False, universal=True, debug=False): """Convert a list of Penn Treebank formatted trees (ptb_trees) into Stanford Dependencies. The dependencies are represented ...
def function[convert_trees, parameter[self, ptb_trees, representation, include_punct, include_erased, universal, debug]]: constant[Convert a list of Penn Treebank formatted trees (ptb_trees) into Stanford Dependencies. The dependencies are represented as a list of sentences, where each sentence ...
keyword[def] identifier[convert_trees] ( identifier[self] , identifier[ptb_trees] , identifier[representation] = literal[string] , identifier[include_punct] = keyword[True] , identifier[include_erased] = keyword[False] , identifier[universal] = keyword[True] , identifier[debug] = keyword[False] ): literal[...
def convert_trees(self, ptb_trees, representation='basic', include_punct=True, include_erased=False, universal=True, debug=False): """Convert a list of Penn Treebank formatted trees (ptb_trees) into Stanford Dependencies. The dependencies are represented as a list of sentences, where each sentence i...
def get_files_map(self): """stub""" files_map = {} if self.has_files(): for label in self.my_osid_object._my_map['fileIds']: asset_content = self._get_asset_content( Id(self.my_osid_object._my_map['fileIds'][label]['assetId']), ...
def function[get_files_map, parameter[self]]: constant[stub] variable[files_map] assign[=] dictionary[[], []] if call[name[self].has_files, parameter[]] begin[:] for taget[name[label]] in starred[call[name[self].my_osid_object._my_map][constant[fileIds]]] begin[:] ...
keyword[def] identifier[get_files_map] ( identifier[self] ): literal[string] identifier[files_map] ={} keyword[if] identifier[self] . identifier[has_files] (): keyword[for] identifier[label] keyword[in] identifier[self] . identifier[my_osid_object] . identifier[_my_map] [ ...
def get_files_map(self): """stub""" files_map = {} if self.has_files(): for label in self.my_osid_object._my_map['fileIds']: asset_content = self._get_asset_content(Id(self.my_osid_object._my_map['fileIds'][label]['assetId']), Type(self.my_osid_object._my_map['fileIds'][label]['assetCont...
def get_obj(self, name): """ Returns the AWS object associated with a given option. The heuristics used are a bit lame. If the option name contains the word 'bucket' it is assumed to be an S3 bucket, if the name contains the word 'queue' it is assumed to be an SQS queue and ...
def function[get_obj, parameter[self, name]]: constant[ Returns the AWS object associated with a given option. The heuristics used are a bit lame. If the option name contains the word 'bucket' it is assumed to be an S3 bucket, if the name contains the word 'queue' it is assumed...
keyword[def] identifier[get_obj] ( identifier[self] , identifier[name] ): literal[string] identifier[val] = identifier[self] . identifier[get] ( identifier[name] ) keyword[if] keyword[not] identifier[val] : keyword[return] keyword[None] keyword[if] identifier[nam...
def get_obj(self, name): """ Returns the AWS object associated with a given option. The heuristics used are a bit lame. If the option name contains the word 'bucket' it is assumed to be an S3 bucket, if the name contains the word 'queue' it is assumed to be an SQS queue and ...
def get_subject_without_validation(jwt_bu64): """Extract subject from the JWT without validating the JWT. - The extracted subject cannot be trusted for authn or authz. Args: jwt_bu64: bytes JWT, encoded using a a URL safe flavor of Base64. Returns: str: The subject contained in th...
def function[get_subject_without_validation, parameter[jwt_bu64]]: constant[Extract subject from the JWT without validating the JWT. - The extracted subject cannot be trusted for authn or authz. Args: jwt_bu64: bytes JWT, encoded using a a URL safe flavor of Base64. Returns: s...
keyword[def] identifier[get_subject_without_validation] ( identifier[jwt_bu64] ): literal[string] keyword[try] : identifier[jwt_dict] = identifier[get_jwt_dict] ( identifier[jwt_bu64] ) keyword[except] identifier[JwtException] keyword[as] identifier[e] : keyword[return] identifie...
def get_subject_without_validation(jwt_bu64): """Extract subject from the JWT without validating the JWT. - The extracted subject cannot be trusted for authn or authz. Args: jwt_bu64: bytes JWT, encoded using a a URL safe flavor of Base64. Returns: str: The subject contained in th...
def update_share(self, share_id, **kwargs): """Updates a given share :param share_id: (int) Share ID :param perms: (int) update permissions (see share_file_with_user() below) :param password: (string) updated password for public link Share :param public_upload: (boolean) enable/...
def function[update_share, parameter[self, share_id]]: constant[Updates a given share :param share_id: (int) Share ID :param perms: (int) update permissions (see share_file_with_user() below) :param password: (string) updated password for public link Share :param public_upload: ...
keyword[def] identifier[update_share] ( identifier[self] , identifier[share_id] ,** identifier[kwargs] ): literal[string] identifier[perms] = identifier[kwargs] . identifier[get] ( literal[string] , keyword[None] ) identifier[password] = identifier[kwargs] . identifier[get] ( literal[stri...
def update_share(self, share_id, **kwargs): """Updates a given share :param share_id: (int) Share ID :param perms: (int) update permissions (see share_file_with_user() below) :param password: (string) updated password for public link Share :param public_upload: (boolean) enable/disa...
def run(): """ Runs flake8 lint :return: A bool - if flake8 did not find any errors """ print('Running flake8 %s' % flake8.__version__) flake8_style = get_style_guide(config_file=os.path.join(package_root, 'tox.ini')) paths = [] for _dir in [package_name, 'dev', 'tests']: ...
def function[run, parameter[]]: constant[ Runs flake8 lint :return: A bool - if flake8 did not find any errors ] call[name[print], parameter[binary_operation[constant[Running flake8 %s] <ast.Mod object at 0x7da2590d6920> name[flake8].__version__]]] variable[flake8_style] ass...
keyword[def] identifier[run] (): literal[string] identifier[print] ( literal[string] % identifier[flake8] . identifier[__version__] ) identifier[flake8_style] = identifier[get_style_guide] ( identifier[config_file] = identifier[os] . identifier[path] . identifier[join] ( identifier[package_root] , l...
def run(): """ Runs flake8 lint :return: A bool - if flake8 did not find any errors """ print('Running flake8 %s' % flake8.__version__) flake8_style = get_style_guide(config_file=os.path.join(package_root, 'tox.ini')) paths = [] for _dir in [package_name, 'dev', 'tests']: ...
def to_dense(self): """Convert sparse Dataset to dense matrix.""" if hasattr(self._X_train, 'todense'): self._X_train = self._X_train.todense() self._X_test = self._X_test.todense()
def function[to_dense, parameter[self]]: constant[Convert sparse Dataset to dense matrix.] if call[name[hasattr], parameter[name[self]._X_train, constant[todense]]] begin[:] name[self]._X_train assign[=] call[name[self]._X_train.todense, parameter[]] name[self]._X_test as...
keyword[def] identifier[to_dense] ( identifier[self] ): literal[string] keyword[if] identifier[hasattr] ( identifier[self] . identifier[_X_train] , literal[string] ): identifier[self] . identifier[_X_train] = identifier[self] . identifier[_X_train] . identifier[todense] () ...
def to_dense(self): """Convert sparse Dataset to dense matrix.""" if hasattr(self._X_train, 'todense'): self._X_train = self._X_train.todense() self._X_test = self._X_test.todense() # depends on [control=['if'], data=[]]
def results(self): """Saved results from the nested sampling run. If bounding distributions were saved, those are also returned.""" # Add all saved samples to the results. if self.save_samples: with warnings.catch_warnings(): warnings.simplefilter("ignore") ...
def function[results, parameter[self]]: constant[Saved results from the nested sampling run. If bounding distributions were saved, those are also returned.] if name[self].save_samples begin[:] with call[name[warnings].catch_warnings, parameter[]] begin[:] ...
keyword[def] identifier[results] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[save_samples] : keyword[with] identifier[warnings] . identifier[catch_warnings] (): identifier[warnings] . identifier[simplefilter] ( literal[st...
def results(self): """Saved results from the nested sampling run. If bounding distributions were saved, those are also returned.""" # Add all saved samples to the results. if self.save_samples: with warnings.catch_warnings(): warnings.simplefilter('ignore') results = ...
def prepare_queues(queues, lock): """Replaces queue._put() method in order to notify the waiting Condition.""" for queue in queues: queue._pebble_lock = lock with queue.mutex: queue._pebble_old_method = queue._put queue._put = MethodType(new_method, queue)
def function[prepare_queues, parameter[queues, lock]]: constant[Replaces queue._put() method in order to notify the waiting Condition.] for taget[name[queue]] in starred[name[queues]] begin[:] name[queue]._pebble_lock assign[=] name[lock] with name[queue].mutex begin[:] ...
keyword[def] identifier[prepare_queues] ( identifier[queues] , identifier[lock] ): literal[string] keyword[for] identifier[queue] keyword[in] identifier[queues] : identifier[queue] . identifier[_pebble_lock] = identifier[lock] keyword[with] identifier[queue] . identifier[mutex] : ...
def prepare_queues(queues, lock): """Replaces queue._put() method in order to notify the waiting Condition.""" for queue in queues: queue._pebble_lock = lock with queue.mutex: queue._pebble_old_method = queue._put queue._put = MethodType(new_method, queue) # depends on [...
def validation_error_message(cls, spec, backends=None): """ Returns an options validation error message if there are any invalid keywords. Otherwise returns None. """ try: cls.validate_spec(spec, backends=backends) except OptionError as e: return e...
def function[validation_error_message, parameter[cls, spec, backends]]: constant[ Returns an options validation error message if there are any invalid keywords. Otherwise returns None. ] <ast.Try object at 0x7da20c990be0>
keyword[def] identifier[validation_error_message] ( identifier[cls] , identifier[spec] , identifier[backends] = keyword[None] ): literal[string] keyword[try] : identifier[cls] . identifier[validate_spec] ( identifier[spec] , identifier[backends] = identifier[backends] ) keywor...
def validation_error_message(cls, spec, backends=None): """ Returns an options validation error message if there are any invalid keywords. Otherwise returns None. """ try: cls.validate_spec(spec, backends=backends) # depends on [control=['try'], data=[]] except OptionError a...
def allow_event_stream(self, **kwargs): """ Allow the user of this token to access their event stream. """ scope = ScopeURI('stream', 'subscribe', {'path': '/2010-04-01/Events'}) if kwargs: scope.add_param('params', urlencode(kwargs, doseq=True)) self.capabil...
def function[allow_event_stream, parameter[self]]: constant[ Allow the user of this token to access their event stream. ] variable[scope] assign[=] call[name[ScopeURI], parameter[constant[stream], constant[subscribe], dictionary[[<ast.Constant object at 0x7da20e749ab0>], [<ast.Constant o...
keyword[def] identifier[allow_event_stream] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[scope] = identifier[ScopeURI] ( literal[string] , literal[string] ,{ literal[string] : literal[string] }) keyword[if] identifier[kwargs] : identifier[scope] . i...
def allow_event_stream(self, **kwargs): """ Allow the user of this token to access their event stream. """ scope = ScopeURI('stream', 'subscribe', {'path': '/2010-04-01/Events'}) if kwargs: scope.add_param('params', urlencode(kwargs, doseq=True)) # depends on [control=['if'], data=[...
def _send(data): """Send data to the Clowder API. :param data: Dictionary of API data :type data: dict """ url = data.get('url', CLOWDER_API_URL) _validate_data(data) if api_key is not None: data['api_key'] = api_key if 'value' not in data: data['value'] = data.get('s...
def function[_send, parameter[data]]: constant[Send data to the Clowder API. :param data: Dictionary of API data :type data: dict ] variable[url] assign[=] call[name[data].get, parameter[constant[url], name[CLOWDER_API_URL]]] call[name[_validate_data], parameter[name[data]]] ...
keyword[def] identifier[_send] ( identifier[data] ): literal[string] identifier[url] = identifier[data] . identifier[get] ( literal[string] , identifier[CLOWDER_API_URL] ) identifier[_validate_data] ( identifier[data] ) keyword[if] identifier[api_key] keyword[is] keyword[not] keyword[None] ...
def _send(data): """Send data to the Clowder API. :param data: Dictionary of API data :type data: dict """ url = data.get('url', CLOWDER_API_URL) _validate_data(data) if api_key is not None: data['api_key'] = api_key # depends on [control=['if'], data=['api_key']] if 'value' no...
def _elsed_block_range(self, lineno, orelse, last=None): """handle block line numbers range for try/finally, for, if and while statements """ if lineno == self.fromlineno: return lineno, lineno if orelse: if lineno >= orelse[0].fromlineno: ...
def function[_elsed_block_range, parameter[self, lineno, orelse, last]]: constant[handle block line numbers range for try/finally, for, if and while statements ] if compare[name[lineno] equal[==] name[self].fromlineno] begin[:] return[tuple[[<ast.Name object at 0x7da1b1ec1f30>, <...
keyword[def] identifier[_elsed_block_range] ( identifier[self] , identifier[lineno] , identifier[orelse] , identifier[last] = keyword[None] ): literal[string] keyword[if] identifier[lineno] == identifier[self] . identifier[fromlineno] : keyword[return] identifier[lineno] , identifier...
def _elsed_block_range(self, lineno, orelse, last=None): """handle block line numbers range for try/finally, for, if and while statements """ if lineno == self.fromlineno: return (lineno, lineno) # depends on [control=['if'], data=['lineno']] if orelse: if lineno >= orelse[0...
def fillstats(args): """ %prog fillstats genome.fill Build stats on .fill file from GapCloser. """ from jcvi.utils.cbook import SummaryStats, percentage, thousands p = OptionParser(fillstats.__doc__) opts, args = p.parse_args(args) if len(args) != 1: sys.exit(not p.print_help(...
def function[fillstats, parameter[args]]: constant[ %prog fillstats genome.fill Build stats on .fill file from GapCloser. ] from relative_module[jcvi.utils.cbook] import module[SummaryStats], module[percentage], module[thousands] variable[p] assign[=] call[name[OptionParser], parameter[...
keyword[def] identifier[fillstats] ( identifier[args] ): literal[string] keyword[from] identifier[jcvi] . identifier[utils] . identifier[cbook] keyword[import] identifier[SummaryStats] , identifier[percentage] , identifier[thousands] identifier[p] = identifier[OptionParser] ( identifier[fillstats...
def fillstats(args): """ %prog fillstats genome.fill Build stats on .fill file from GapCloser. """ from jcvi.utils.cbook import SummaryStats, percentage, thousands p = OptionParser(fillstats.__doc__) (opts, args) = p.parse_args(args) if len(args) != 1: sys.exit(not p.print_help(...
def download(self, bucket_name, object_name, filename=None): """ Get a file from Google Cloud Storage. :param bucket_name: The bucket to fetch from. :type bucket_name: str :param object_name: The object to fetch. :type object_name: str :param filename: If set, a ...
def function[download, parameter[self, bucket_name, object_name, filename]]: constant[ Get a file from Google Cloud Storage. :param bucket_name: The bucket to fetch from. :type bucket_name: str :param object_name: The object to fetch. :type object_name: str :para...
keyword[def] identifier[download] ( identifier[self] , identifier[bucket_name] , identifier[object_name] , identifier[filename] = keyword[None] ): literal[string] identifier[client] = identifier[self] . identifier[get_conn] () identifier[bucket] = identifier[client] . identifier[get_bucket...
def download(self, bucket_name, object_name, filename=None): """ Get a file from Google Cloud Storage. :param bucket_name: The bucket to fetch from. :type bucket_name: str :param object_name: The object to fetch. :type object_name: str :param filename: If set, a loca...
def p_expr_end(p): "end : END_EXPR" p[0] = node.expr( op="end", args=node.expr_list([node.number(0), node.number(0)]))
def function[p_expr_end, parameter[p]]: constant[end : END_EXPR] call[name[p]][constant[0]] assign[=] call[name[node].expr, parameter[]]
keyword[def] identifier[p_expr_end] ( identifier[p] ): literal[string] identifier[p] [ literal[int] ]= identifier[node] . identifier[expr] ( identifier[op] = literal[string] , identifier[args] = identifier[node] . identifier[expr_list] ([ identifier[node] . identifier[number] ( literal[int] ), identif...
def p_expr_end(p): """end : END_EXPR""" p[0] = node.expr(op='end', args=node.expr_list([node.number(0), node.number(0)]))
def get_data_metadata(self): """Gets the metadata for the content data. return: (osid.Metadata) - metadata for the content data *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.resource.ResourceForm.get_group_metadata_template...
def function[get_data_metadata, parameter[self]]: constant[Gets the metadata for the content data. return: (osid.Metadata) - metadata for the content data *compliance: mandatory -- This method must be implemented.* ] variable[metadata] assign[=] call[name[dict], parameter[call[...
keyword[def] identifier[get_data_metadata] ( identifier[self] ): literal[string] identifier[metadata] = identifier[dict] ( identifier[self] . identifier[_mdata] [ literal[string] ]) identifier[metadata] . identifier[update] ({ literal[string] : identifier[self] . identifier[_my_ma...
def get_data_metadata(self): """Gets the metadata for the content data. return: (osid.Metadata) - metadata for the content data *compliance: mandatory -- This method must be implemented.* """ # Implemented from template for osid.resource.ResourceForm.get_group_metadata_template met...
def wikibase_item_engine_factory(cls, mediawiki_api_url, sparql_endpoint_url, name='LocalItemEngine'): """ Helper function for creating a WDItemEngine class with arguments set for a different Wikibase instance than Wikidata. :param mediawiki_api_url: Mediawiki api url. For wikidata, this...
def function[wikibase_item_engine_factory, parameter[cls, mediawiki_api_url, sparql_endpoint_url, name]]: constant[ Helper function for creating a WDItemEngine class with arguments set for a different Wikibase instance than Wikidata. :param mediawiki_api_url: Mediawiki api url. For wikid...
keyword[def] identifier[wikibase_item_engine_factory] ( identifier[cls] , identifier[mediawiki_api_url] , identifier[sparql_endpoint_url] , identifier[name] = literal[string] ): literal[string] keyword[class] identifier[SubCls] ( identifier[cls] ): keyword[def] identifier[__init__] ...
def wikibase_item_engine_factory(cls, mediawiki_api_url, sparql_endpoint_url, name='LocalItemEngine'): """ Helper function for creating a WDItemEngine class with arguments set for a different Wikibase instance than Wikidata. :param mediawiki_api_url: Mediawiki api url. For wikidata, this is:...
def message_proxy(self, work_dir): """ drone_data_inboud is for data comming from drones drone_data_outbound is for commands to the drones, topic must either be a drone ID or all for sending a broadcast message to all drones """ public_keys_dir = os....
def function[message_proxy, parameter[self, work_dir]]: constant[ drone_data_inboud is for data comming from drones drone_data_outbound is for commands to the drones, topic must either be a drone ID or all for sending a broadcast message to all drones ] ...
keyword[def] identifier[message_proxy] ( identifier[self] , identifier[work_dir] ): literal[string] identifier[public_keys_dir] = identifier[os] . identifier[path] . identifier[join] ( identifier[work_dir] , literal[string] , literal[string] ) identifier[secret_keys_dir] = identifier[os] ....
def message_proxy(self, work_dir): """ drone_data_inboud is for data comming from drones drone_data_outbound is for commands to the drones, topic must either be a drone ID or all for sending a broadcast message to all drones """ public_keys_dir = os.path.joi...
def get_set_voltage(self, channel): """ channel: 1=OP1, 2=OP2, AUX is not supported""" ret = self.ask("V%d?" % channel) if ret[:3] != "V%d " % channel: print("ttiQl355tp.get_voltage() format error", ret) return None return float(ret[3:])
def function[get_set_voltage, parameter[self, channel]]: constant[ channel: 1=OP1, 2=OP2, AUX is not supported] variable[ret] assign[=] call[name[self].ask, parameter[binary_operation[constant[V%d?] <ast.Mod object at 0x7da2590d6920> name[channel]]]] if compare[call[name[ret]][<ast.Slice object ...
keyword[def] identifier[get_set_voltage] ( identifier[self] , identifier[channel] ): literal[string] identifier[ret] = identifier[self] . identifier[ask] ( literal[string] % identifier[channel] ) keyword[if] identifier[ret] [: literal[int] ]!= literal[string] % identifier[channel] : ...
def get_set_voltage(self, channel): """ channel: 1=OP1, 2=OP2, AUX is not supported""" ret = self.ask('V%d?' % channel) if ret[:3] != 'V%d ' % channel: print('ttiQl355tp.get_voltage() format error', ret) return None # depends on [control=['if'], data=[]] return float(ret[3:])
def _parseSections(self, data, imageDosHeader, imageNtHeaders, parse_header_only=False): """Parses the sections in the memory and returns a list of them""" sections = [] optional_header_offset = imageDosHeader.header.e_lfanew + 4 + sizeof(IMAGE_FILE_HEADER) offset = optional_header_offs...
def function[_parseSections, parameter[self, data, imageDosHeader, imageNtHeaders, parse_header_only]]: constant[Parses the sections in the memory and returns a list of them] variable[sections] assign[=] list[[]] variable[optional_header_offset] assign[=] binary_operation[binary_operation[name[i...
keyword[def] identifier[_parseSections] ( identifier[self] , identifier[data] , identifier[imageDosHeader] , identifier[imageNtHeaders] , identifier[parse_header_only] = keyword[False] ): literal[string] identifier[sections] =[] identifier[optional_header_offset] = identifier[imageDosHead...
def _parseSections(self, data, imageDosHeader, imageNtHeaders, parse_header_only=False): """Parses the sections in the memory and returns a list of them""" sections = [] optional_header_offset = imageDosHeader.header.e_lfanew + 4 + sizeof(IMAGE_FILE_HEADER) offset = optional_header_offset + imageNtHeade...
def div(self, y): r"""Compute the divergence of a signal defined on the edges. The divergence :math:`z` of a signal :math:`y` is defined as .. math:: z = \operatorname{div}_\mathcal{G} y = D y, where :math:`D` is the differential operator :attr:`D`. The value of the divergenc...
def function[div, parameter[self, y]]: constant[Compute the divergence of a signal defined on the edges. The divergence :math:`z` of a signal :math:`y` is defined as .. math:: z = \operatorname{div}_\mathcal{G} y = D y, where :math:`D` is the differential operator :attr:`D`. ...
keyword[def] identifier[div] ( identifier[self] , identifier[y] ): literal[string] identifier[y] = identifier[np] . identifier[asanyarray] ( identifier[y] ) keyword[if] identifier[y] . identifier[shape] [ literal[int] ]!= identifier[self] . identifier[Ne] : keyword[raise] id...
def div(self, y): """Compute the divergence of a signal defined on the edges. The divergence :math:`z` of a signal :math:`y` is defined as .. math:: z = \\operatorname{div}_\\mathcal{G} y = D y, where :math:`D` is the differential operator :attr:`D`. The value of the divergence o...
def read_eeprom_calibration(self, temperature=False): # use default values for temperature, EEPROM values are usually not calibrated and random '''Reading EEPROM calibration for power regulators and temperature ''' header = self.get_format() if header == self.HEADER_V2: data...
def function[read_eeprom_calibration, parameter[self, temperature]]: constant[Reading EEPROM calibration for power regulators and temperature ] variable[header] assign[=] call[name[self].get_format, parameter[]] if compare[name[header] equal[==] name[self].HEADER_V2] begin[:] ...
keyword[def] identifier[read_eeprom_calibration] ( identifier[self] , identifier[temperature] = keyword[False] ): literal[string] identifier[header] = identifier[self] . identifier[get_format] () keyword[if] identifier[header] == identifier[self] . identifier[HEADER_V2] : ide...
def read_eeprom_calibration(self, temperature=False): # use default values for temperature, EEPROM values are usually not calibrated and random 'Reading EEPROM calibration for power regulators and temperature\n ' header = self.get_format() if header == self.HEADER_V2: data = self._read_eepro...
def alter_columns(op, name, *columns, **kwargs): """Alter columns from a table. Parameters ---------- name : str The name of the table. *columns The new columns to have. selection_string : str, optional The string to use in the selection. If not provided, it will select ...
def function[alter_columns, parameter[op, name]]: constant[Alter columns from a table. Parameters ---------- name : str The name of the table. *columns The new columns to have. selection_string : str, optional The string to use in the selection. If not provided, it w...
keyword[def] identifier[alter_columns] ( identifier[op] , identifier[name] ,* identifier[columns] ,** identifier[kwargs] ): literal[string] identifier[selection_string] = identifier[kwargs] . identifier[pop] ( literal[string] , keyword[None] ) keyword[if] identifier[kwargs] : keyword[raise] ...
def alter_columns(op, name, *columns, **kwargs): """Alter columns from a table. Parameters ---------- name : str The name of the table. *columns The new columns to have. selection_string : str, optional The string to use in the selection. If not provided, it will select ...
def peak_interval(self, name, alpha=_alpha, npoints=_npoints, **kwargs): """ Calculate peak interval for parameter. """ data = self.get(name, **kwargs) return peak_interval(data,alpha,npoints)
def function[peak_interval, parameter[self, name, alpha, npoints]]: constant[ Calculate peak interval for parameter. ] variable[data] assign[=] call[name[self].get, parameter[name[name]]] return[call[name[peak_interval], parameter[name[data], name[alpha], name[npoints]]]]
keyword[def] identifier[peak_interval] ( identifier[self] , identifier[name] , identifier[alpha] = identifier[_alpha] , identifier[npoints] = identifier[_npoints] ,** identifier[kwargs] ): literal[string] identifier[data] = identifier[self] . identifier[get] ( identifier[name] ,** identifier[kwargs...
def peak_interval(self, name, alpha=_alpha, npoints=_npoints, **kwargs): """ Calculate peak interval for parameter. """ data = self.get(name, **kwargs) return peak_interval(data, alpha, npoints)
def fingerprint_helper(egg, permute=False, n_perms=1000, match='exact', distance='euclidean', features=None): """ Computes clustering along a set of feature dimensions Parameters ---------- egg : quail.Egg Data to analyze dist_funcs : dict Dictionary of d...
def function[fingerprint_helper, parameter[egg, permute, n_perms, match, distance, features]]: constant[ Computes clustering along a set of feature dimensions Parameters ---------- egg : quail.Egg Data to analyze dist_funcs : dict Dictionary of distance functions for featur...
keyword[def] identifier[fingerprint_helper] ( identifier[egg] , identifier[permute] = keyword[False] , identifier[n_perms] = literal[int] , identifier[match] = literal[string] , identifier[distance] = literal[string] , identifier[features] = keyword[None] ): literal[string] keyword[if] identifier[featur...
def fingerprint_helper(egg, permute=False, n_perms=1000, match='exact', distance='euclidean', features=None): """ Computes clustering along a set of feature dimensions Parameters ---------- egg : quail.Egg Data to analyze dist_funcs : dict Dictionary of distance functions for f...
def extendsTree( self ): """ Returns whether or not the grid lines should extend through the tree \ area or not. :return <bool> """ delegate = self.itemDelegate() if ( isinstance(delegate, XTreeWidgetDelegate) ): return delegate.exten...
def function[extendsTree, parameter[self]]: constant[ Returns whether or not the grid lines should extend through the tree area or not. :return <bool> ] variable[delegate] assign[=] call[name[self].itemDelegate, parameter[]] if call[name[isinstance], para...
keyword[def] identifier[extendsTree] ( identifier[self] ): literal[string] identifier[delegate] = identifier[self] . identifier[itemDelegate] () keyword[if] ( identifier[isinstance] ( identifier[delegate] , identifier[XTreeWidgetDelegate] )): keyword[return] identifier[de...
def extendsTree(self): """ Returns whether or not the grid lines should extend through the tree area or not. :return <bool> """ delegate = self.itemDelegate() if isinstance(delegate, XTreeWidgetDelegate): return delegate.extendsTree() # depends on [control=[...
def clean_value(self): """ Populates json serialization ready data. This is the method used to serialize and store the object data in to DB Returns: List of dicts. """ result = [] for mdl in self: result.append(super(ListNode, mdl).clean_v...
def function[clean_value, parameter[self]]: constant[ Populates json serialization ready data. This is the method used to serialize and store the object data in to DB Returns: List of dicts. ] variable[result] assign[=] list[[]] for taget[name[mdl]] i...
keyword[def] identifier[clean_value] ( identifier[self] ): literal[string] identifier[result] =[] keyword[for] identifier[mdl] keyword[in] identifier[self] : identifier[result] . identifier[append] ( identifier[super] ( identifier[ListNode] , identifier[mdl] ). identifier[c...
def clean_value(self): """ Populates json serialization ready data. This is the method used to serialize and store the object data in to DB Returns: List of dicts. """ result = [] for mdl in self: result.append(super(ListNode, mdl).clean_value()) # depen...
def get_all_enclave_tags(self, enclave_ids=None): """ Retrieves all tags present in the given enclaves. If the enclave list is empty, the tags returned include all tags for all enclaves the user has access to. :param (string) list enclave_ids: list of enclave IDs :return: The li...
def function[get_all_enclave_tags, parameter[self, enclave_ids]]: constant[ Retrieves all tags present in the given enclaves. If the enclave list is empty, the tags returned include all tags for all enclaves the user has access to. :param (string) list enclave_ids: list of enclave IDs ...
keyword[def] identifier[get_all_enclave_tags] ( identifier[self] , identifier[enclave_ids] = keyword[None] ): literal[string] identifier[params] ={ literal[string] : identifier[enclave_ids] } identifier[resp] = identifier[self] . identifier[_client] . identifier[get] ( literal[string] , i...
def get_all_enclave_tags(self, enclave_ids=None): """ Retrieves all tags present in the given enclaves. If the enclave list is empty, the tags returned include all tags for all enclaves the user has access to. :param (string) list enclave_ids: list of enclave IDs :return: The list o...
def trimmed_mean(self, p1, p2): """ Computes the mean of the distribution between the two percentiles p1 and p2. This is a modified algorithm than the one presented in the original t-Digest paper. """ if not (p1 < p2): raise ValueError("p1 must be between 0 and 100 a...
def function[trimmed_mean, parameter[self, p1, p2]]: constant[ Computes the mean of the distribution between the two percentiles p1 and p2. This is a modified algorithm than the one presented in the original t-Digest paper. ] if <ast.UnaryOp object at 0x7da1b0786e30> begin[:] ...
keyword[def] identifier[trimmed_mean] ( identifier[self] , identifier[p1] , identifier[p2] ): literal[string] keyword[if] keyword[not] ( identifier[p1] < identifier[p2] ): keyword[raise] identifier[ValueError] ( literal[string] ) identifier[min_count] = identifier[p1] / lit...
def trimmed_mean(self, p1, p2): """ Computes the mean of the distribution between the two percentiles p1 and p2. This is a modified algorithm than the one presented in the original t-Digest paper. """ if not p1 < p2: raise ValueError('p1 must be between 0 and 100 and less than p...
async def new_messages(self, poll_period=30, *, fromid=None): """New messages on the Regional Message Board:: tnp = region('The North Pacific') async for post in tnp.new_messages(): # Your processing code here print(post.text) # As an example Gu...
<ast.AsyncFunctionDef object at 0x7da18c4ccd90>
keyword[async] keyword[def] identifier[new_messages] ( identifier[self] , identifier[poll_period] = literal[int] ,*, identifier[fromid] = keyword[None] ): literal[string] keyword[if] identifier[fromid] keyword[is] keyword[not] keyword[None] : identifier[fromid] = literal[...
async def new_messages(self, poll_period=30, *, fromid=None): """New messages on the Regional Message Board:: tnp = region('The North Pacific') async for post in tnp.new_messages(): # Your processing code here print(post.text) # As an example Guaran...
def get_top_edge_depth(self): """ Return minimum depth of surface's top edge. :returns: Float value, the vertical distance between the earth surface and the shallowest point in surface's top edge in km. """ top_edge = self.mesh[0:1] if top_edge.de...
def function[get_top_edge_depth, parameter[self]]: constant[ Return minimum depth of surface's top edge. :returns: Float value, the vertical distance between the earth surface and the shallowest point in surface's top edge in km. ] variable[top_edge] assi...
keyword[def] identifier[get_top_edge_depth] ( identifier[self] ): literal[string] identifier[top_edge] = identifier[self] . identifier[mesh] [ literal[int] : literal[int] ] keyword[if] identifier[top_edge] . identifier[depths] keyword[is] keyword[None] : keyword[return] li...
def get_top_edge_depth(self): """ Return minimum depth of surface's top edge. :returns: Float value, the vertical distance between the earth surface and the shallowest point in surface's top edge in km. """ top_edge = self.mesh[0:1] if top_edge.depths is None...
def connect(self): """Create new connection unless we already have one.""" if not getattr(self._local, 'conn', None): try: server = self._servers.get() logger.debug('Connecting to %s', server) self._local.conn = ClientTransport(server, self._fr...
def function[connect, parameter[self]]: constant[Create new connection unless we already have one.] if <ast.UnaryOp object at 0x7da1b0e6cf40> begin[:] <ast.Try object at 0x7da18c4cf370> return[name[self]._local.conn]
keyword[def] identifier[connect] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[getattr] ( identifier[self] . identifier[_local] , literal[string] , keyword[None] ): keyword[try] : identifier[server] = identifier[self] . identifier[_servers...
def connect(self): """Create new connection unless we already have one.""" if not getattr(self._local, 'conn', None): try: server = self._servers.get() logger.debug('Connecting to %s', server) self._local.conn = ClientTransport(server, self._framed_transport, self._ti...
def to_python(self, value): """ Overrides standard to_python method from django models to allow correct translation of Mongo array to a python list. """ if value is None: return value assert isinstance(value, list) ret = [] for mdl_d...
def function[to_python, parameter[self, value]]: constant[ Overrides standard to_python method from django models to allow correct translation of Mongo array to a python list. ] if compare[name[value] is constant[None]] begin[:] return[name[value]] assert[call[name[is...
keyword[def] identifier[to_python] ( identifier[self] , identifier[value] ): literal[string] keyword[if] identifier[value] keyword[is] keyword[None] : keyword[return] identifier[value] keyword[assert] identifier[isinstance] ( identifier[value] , identifier[list] ) ...
def to_python(self, value): """ Overrides standard to_python method from django models to allow correct translation of Mongo array to a python list. """ if value is None: return value # depends on [control=['if'], data=['value']] assert isinstance(value, list) ret = [] ...
def _serialize(self): """ Serialize the ResponseObject. Returns a webob `Response` object. """ # Do something appropriate if the response object is unbound if self._defcode is None: raise exceptions.UnboundResponse() # Build the response res...
def function[_serialize, parameter[self]]: constant[ Serialize the ResponseObject. Returns a webob `Response` object. ] if compare[name[self]._defcode is constant[None]] begin[:] <ast.Raise object at 0x7da18bcc9a20> variable[resp] assign[=] call[name[self].respon...
keyword[def] identifier[_serialize] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_defcode] keyword[is] keyword[None] : keyword[raise] identifier[exceptions] . identifier[UnboundResponse] () identifier[resp] = ident...
def _serialize(self): """ Serialize the ResponseObject. Returns a webob `Response` object. """ # Do something appropriate if the response object is unbound if self._defcode is None: raise exceptions.UnboundResponse() # depends on [control=['if'], data=[]] # Build the re...
def get_plugin_icon(self): """Return widget icon""" path = osp.join(self.PLUGIN_PATH, self.IMG_PATH) return ima.icon('pylint', icon_path=path)
def function[get_plugin_icon, parameter[self]]: constant[Return widget icon] variable[path] assign[=] call[name[osp].join, parameter[name[self].PLUGIN_PATH, name[self].IMG_PATH]] return[call[name[ima].icon, parameter[constant[pylint]]]]
keyword[def] identifier[get_plugin_icon] ( identifier[self] ): literal[string] identifier[path] = identifier[osp] . identifier[join] ( identifier[self] . identifier[PLUGIN_PATH] , identifier[self] . identifier[IMG_PATH] ) keyword[return] identifier[ima] . identifier[icon] ( literal[str...
def get_plugin_icon(self): """Return widget icon""" path = osp.join(self.PLUGIN_PATH, self.IMG_PATH) return ima.icon('pylint', icon_path=path)
def write_vcf(tree_dict, file_name):#, compress=False): """ Writes out a VCF-style file (which seems to be minimally handleable by vcftools and pyvcf) of the alignment. This is created from a dict in a similar format to what's created by :py:meth:`treetime.vcf_utils.read_vcf` Positions of var...
def function[write_vcf, parameter[tree_dict, file_name]]: constant[ Writes out a VCF-style file (which seems to be minimally handleable by vcftools and pyvcf) of the alignment. This is created from a dict in a similar format to what's created by :py:meth:`treetime.vcf_utils.read_vcf` Positions ...
keyword[def] identifier[write_vcf] ( identifier[tree_dict] , identifier[file_name] ): literal[string] identifier[sequences] = identifier[tree_dic...
def write_vcf(tree_dict, file_name): #, compress=False): "\n Writes out a VCF-style file (which seems to be minimally handleable\n by vcftools and pyvcf) of the alignment. This is created from a dict\n in a similar format to what's created by :py:meth:`treetime.vcf_utils.read_vcf`\n\n Positions of vari...
def _reinit_daq_daemons(sender, instance, **kwargs): """ update the daq daemon configuration when changes be applied in the models """ if type(instance) is SMbusDevice: post_save.send_robust(sender=Device, instance=instance.smbus_device) elif type(instance) is SMbusVariable: post_sav...
def function[_reinit_daq_daemons, parameter[sender, instance]]: constant[ update the daq daemon configuration when changes be applied in the models ] if compare[call[name[type], parameter[name[instance]]] is name[SMbusDevice]] begin[:] call[name[post_save].send_robust, parameter[...
keyword[def] identifier[_reinit_daq_daemons] ( identifier[sender] , identifier[instance] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[type] ( identifier[instance] ) keyword[is] identifier[SMbusDevice] : identifier[post_save] . identifier[send_robust] ( identifier[sender] = id...
def _reinit_daq_daemons(sender, instance, **kwargs): """ update the daq daemon configuration when changes be applied in the models """ if type(instance) is SMbusDevice: post_save.send_robust(sender=Device, instance=instance.smbus_device) # depends on [control=['if'], data=[]] elif type(inst...
def invalid_content_type(self, request=None, response=None): """Returns the content type that should be used by default on validation errors""" if callable(self.invalid_outputs.content_type): return self.invalid_outputs.content_type(request=request, response=response) else: ...
def function[invalid_content_type, parameter[self, request, response]]: constant[Returns the content type that should be used by default on validation errors] if call[name[callable], parameter[name[self].invalid_outputs.content_type]] begin[:] return[call[name[self].invalid_outputs.content_type,...
keyword[def] identifier[invalid_content_type] ( identifier[self] , identifier[request] = keyword[None] , identifier[response] = keyword[None] ): literal[string] keyword[if] identifier[callable] ( identifier[self] . identifier[invalid_outputs] . identifier[content_type] ): keyword[retu...
def invalid_content_type(self, request=None, response=None): """Returns the content type that should be used by default on validation errors""" if callable(self.invalid_outputs.content_type): return self.invalid_outputs.content_type(request=request, response=response) # depends on [control=['if'], data...
def init_poolmanager(self, connections, maxsize, block=requests.adapters.DEFAULT_POOLBLOCK, **pool_kwargs): """Initialize poolmanager with cipher and Tlsv1""" context = create_urllib3_context(ciphers=self.CIPHERS, ...
def function[init_poolmanager, parameter[self, connections, maxsize, block]]: constant[Initialize poolmanager with cipher and Tlsv1] variable[context] assign[=] call[name[create_urllib3_context], parameter[]] call[name[pool_kwargs]][constant[ssl_context]] assign[=] name[context] return[call[...
keyword[def] identifier[init_poolmanager] ( identifier[self] , identifier[connections] , identifier[maxsize] , identifier[block] = identifier[requests] . identifier[adapters] . identifier[DEFAULT_POOLBLOCK] , ** identifier[pool_kwargs] ): literal[string] identifier[context] = identifier[create_url...
def init_poolmanager(self, connections, maxsize, block=requests.adapters.DEFAULT_POOLBLOCK, **pool_kwargs): """Initialize poolmanager with cipher and Tlsv1""" context = create_urllib3_context(ciphers=self.CIPHERS, ssl_version=ssl.PROTOCOL_TLSv1) pool_kwargs['ssl_context'] = context return super(TLSv1Ada...
def __write_filter_dic(wk_sheet, column): ''' return filter dic for certain column ''' row1_val = wk_sheet['{0}1'.format(column)].value row2_val = wk_sheet['{0}2'.format(column)].value row3_val = wk_sheet['{0}3'.format(column)].value row4_val = wk_sheet['{0}4'.format(column)].value if r...
def function[__write_filter_dic, parameter[wk_sheet, column]]: constant[ return filter dic for certain column ] variable[row1_val] assign[=] call[name[wk_sheet]][call[constant[{0}1].format, parameter[name[column]]]].value variable[row2_val] assign[=] call[name[wk_sheet]][call[constant[{0...
keyword[def] identifier[__write_filter_dic] ( identifier[wk_sheet] , identifier[column] ): literal[string] identifier[row1_val] = identifier[wk_sheet] [ literal[string] . identifier[format] ( identifier[column] )]. identifier[value] identifier[row2_val] = identifier[wk_sheet] [ literal[string] . iden...
def __write_filter_dic(wk_sheet, column): """ return filter dic for certain column """ row1_val = wk_sheet['{0}1'.format(column)].value row2_val = wk_sheet['{0}2'.format(column)].value row3_val = wk_sheet['{0}3'.format(column)].value row4_val = wk_sheet['{0}4'.format(column)].value if ro...
def autoload(self, state=True): """ Begins the process for autoloading this item when it becomes visible within the tree. :param state | <bool> """ if state and not self._timer: self._timer = QtCore.QTimer() self._timer.setIn...
def function[autoload, parameter[self, state]]: constant[ Begins the process for autoloading this item when it becomes visible within the tree. :param state | <bool> ] if <ast.BoolOp object at 0x7da18f09d600> begin[:] name[self]._timer assign...
keyword[def] identifier[autoload] ( identifier[self] , identifier[state] = keyword[True] ): literal[string] keyword[if] identifier[state] keyword[and] keyword[not] identifier[self] . identifier[_timer] : identifier[self] . identifier[_timer] = identifier[QtCore] . identifier[QTi...
def autoload(self, state=True): """ Begins the process for autoloading this item when it becomes visible within the tree. :param state | <bool> """ if state and (not self._timer): self._timer = QtCore.QTimer() self._timer.setInterval(500) sel...
def get_server_model(snmp_client): """Get server model of the node. :param snmp_client: an SNMP client object. :raises: SNMPFailure if SNMP operation failed. :returns: a string of server model. """ try: server_model = snmp_client.get(SERVER_MODEL_OID) return six.text_type(serve...
def function[get_server_model, parameter[snmp_client]]: constant[Get server model of the node. :param snmp_client: an SNMP client object. :raises: SNMPFailure if SNMP operation failed. :returns: a string of server model. ] <ast.Try object at 0x7da1b19d05e0>
keyword[def] identifier[get_server_model] ( identifier[snmp_client] ): literal[string] keyword[try] : identifier[server_model] = identifier[snmp_client] . identifier[get] ( identifier[SERVER_MODEL_OID] ) keyword[return] identifier[six] . identifier[text_type] ( identifier[server_model] ...
def get_server_model(snmp_client): """Get server model of the node. :param snmp_client: an SNMP client object. :raises: SNMPFailure if SNMP operation failed. :returns: a string of server model. """ try: server_model = snmp_client.get(SERVER_MODEL_OID) return six.text_type(server...
def open(self, url): """ Open a WSDL schema at the specified I{URL}. First, the WSDL schema is looked up in the I{object cache}. If not found, a new one constructed using the I{fn} factory function and the result is cached for the next open(). @param url: A WSDL URL. ...
def function[open, parameter[self, url]]: constant[ Open a WSDL schema at the specified I{URL}. First, the WSDL schema is looked up in the I{object cache}. If not found, a new one constructed using the I{fn} factory function and the result is cached for the next open(). ...
keyword[def] identifier[open] ( identifier[self] , identifier[url] ): literal[string] identifier[cache] = identifier[self] . identifier[__cache] () identifier[id] = identifier[self] . identifier[mangle] ( identifier[url] , literal[string] ) identifier[wsdl] = identifier[cache] . i...
def open(self, url): """ Open a WSDL schema at the specified I{URL}. First, the WSDL schema is looked up in the I{object cache}. If not found, a new one constructed using the I{fn} factory function and the result is cached for the next open(). @param url: A WSDL URL. ...
def mutateString(original, n, replacements='acgt'): """ Mutate C{original} in C{n} places with chars chosen from C{replacements}. @param original: The original C{str} to mutate. @param n: The C{int} number of locations to mutate. @param replacements: The C{str} of replacement letters. @return:...
def function[mutateString, parameter[original, n, replacements]]: constant[ Mutate C{original} in C{n} places with chars chosen from C{replacements}. @param original: The original C{str} to mutate. @param n: The C{int} number of locations to mutate. @param replacements: The C{str} of replacemen...
keyword[def] identifier[mutateString] ( identifier[original] , identifier[n] , identifier[replacements] = literal[string] ): literal[string] keyword[if] keyword[not] identifier[original] : keyword[raise] identifier[ValueError] ( literal[string] ) keyword[if] identifier[n] > identifier[le...
def mutateString(original, n, replacements='acgt'): """ Mutate C{original} in C{n} places with chars chosen from C{replacements}. @param original: The original C{str} to mutate. @param n: The C{int} number of locations to mutate. @param replacements: The C{str} of replacement letters. @return:...
def virtual(cls, **options): """ Allows for defining virtual columns and collectors on models -- these are objects that are defined in code and not directly in a data store. :param cls: :param options: :return: """ def wrapped(func): param_name = inflection.underscore(func.__nam...
def function[virtual, parameter[cls]]: constant[ Allows for defining virtual columns and collectors on models -- these are objects that are defined in code and not directly in a data store. :param cls: :param options: :return: ] def function[wrapped, parameter[func]]: ...
keyword[def] identifier[virtual] ( identifier[cls] ,** identifier[options] ): literal[string] keyword[def] identifier[wrapped] ( identifier[func] ): identifier[param_name] = identifier[inflection] . identifier[underscore] ( identifier[func] . identifier[__name__] ) identifier[options] . ...
def virtual(cls, **options): """ Allows for defining virtual columns and collectors on models -- these are objects that are defined in code and not directly in a data store. :param cls: :param options: :return: """ def wrapped(func): param_name = inflection.underscore(func.__na...
def get_course_video_image_url(course_id, edx_video_id): """ Returns course video image url or None if no image found """ try: video_image = CourseVideo.objects.select_related('video_image').get( course_id=course_id, video__edx_video_id=edx_video_id ).video_image retu...
def function[get_course_video_image_url, parameter[course_id, edx_video_id]]: constant[ Returns course video image url or None if no image found ] <ast.Try object at 0x7da1b0334e50>
keyword[def] identifier[get_course_video_image_url] ( identifier[course_id] , identifier[edx_video_id] ): literal[string] keyword[try] : identifier[video_image] = identifier[CourseVideo] . identifier[objects] . identifier[select_related] ( literal[string] ). identifier[get] ( identifier[c...
def get_course_video_image_url(course_id, edx_video_id): """ Returns course video image url or None if no image found """ try: video_image = CourseVideo.objects.select_related('video_image').get(course_id=course_id, video__edx_video_id=edx_video_id).video_image return video_image.image_u...
def use_federated_family_view(self): """Pass through to provider RelationshipLookupSession.use_federated_family_view""" self._family_view = FEDERATED # self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked for session in self._get_provider_sessio...
def function[use_federated_family_view, parameter[self]]: constant[Pass through to provider RelationshipLookupSession.use_federated_family_view] name[self]._family_view assign[=] name[FEDERATED] for taget[name[session]] in starred[call[name[self]._get_provider_sessions, parameter[]]] begin[:] ...
keyword[def] identifier[use_federated_family_view] ( identifier[self] ): literal[string] identifier[self] . identifier[_family_view] = identifier[FEDERATED] keyword[for] identifier[session] keyword[in] identifier[self] . identifier[_get_provider_sessions] (): keyw...
def use_federated_family_view(self): """Pass through to provider RelationshipLookupSession.use_federated_family_view""" self._family_view = FEDERATED # self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked for session in self._get_provider_sessions(): tr...
def atexit_rmglob(path, glob=glob.glob, isdir=os.path.isdir, isfile=os.path.isfile, remove=os.remove, rmtree=shutil.rmtree): # pragma: no cover """Ensure removal of multiple files at interpreter exit.""" for p in glob(pat...
def function[atexit_rmglob, parameter[path, glob, isdir, isfile, remove, rmtree]]: constant[Ensure removal of multiple files at interpreter exit.] for taget[name[p]] in starred[call[name[glob], parameter[name[path]]]] begin[:] if call[name[isfile], parameter[name[p]]] begin[:] ...
keyword[def] identifier[atexit_rmglob] ( identifier[path] , identifier[glob] = identifier[glob] . identifier[glob] , identifier[isdir] = identifier[os] . identifier[path] . identifier[isdir] , identifier[isfile] = identifier[os] . identifier[path] . identifier[isfile] , identifier[remove] = identifier[os] . ident...
def atexit_rmglob(path, glob=glob.glob, isdir=os.path.isdir, isfile=os.path.isfile, remove=os.remove, rmtree=shutil.rmtree): # pragma: no cover 'Ensure removal of multiple files at interpreter exit.' for p in glob(path): if isfile(p): remove(p) # depends on [control=['if'], data=[]] ...
def unmajority(p, a, b, c): """Unmajority gate.""" p.ccx(a, b, c) p.cx(c, a) p.cx(a, b)
def function[unmajority, parameter[p, a, b, c]]: constant[Unmajority gate.] call[name[p].ccx, parameter[name[a], name[b], name[c]]] call[name[p].cx, parameter[name[c], name[a]]] call[name[p].cx, parameter[name[a], name[b]]]
keyword[def] identifier[unmajority] ( identifier[p] , identifier[a] , identifier[b] , identifier[c] ): literal[string] identifier[p] . identifier[ccx] ( identifier[a] , identifier[b] , identifier[c] ) identifier[p] . identifier[cx] ( identifier[c] , identifier[a] ) identifier[p] . identifier[cx] ...
def unmajority(p, a, b, c): """Unmajority gate.""" p.ccx(a, b, c) p.cx(c, a) p.cx(a, b)
def get_init_argspec(klass): """Wrapper around inspect.getargspec(klass.__init__) which, for cython classes uses an auxiliary '_init_argspec' method, since they don't play nice with the inspect module. By convention, a cython class should define the classmethod _init_argspec that, when called, retu...
def function[get_init_argspec, parameter[klass]]: constant[Wrapper around inspect.getargspec(klass.__init__) which, for cython classes uses an auxiliary '_init_argspec' method, since they don't play nice with the inspect module. By convention, a cython class should define the classmethod _init_args...
keyword[def] identifier[get_init_argspec] ( identifier[klass] ): literal[string] keyword[if] identifier[hasattr] ( identifier[klass] , literal[string] ): keyword[return] identifier[_shim_argspec] ( identifier[klass] . identifier[_init_argspec] ()) keyword[elif] identifier[PY2] : k...
def get_init_argspec(klass): """Wrapper around inspect.getargspec(klass.__init__) which, for cython classes uses an auxiliary '_init_argspec' method, since they don't play nice with the inspect module. By convention, a cython class should define the classmethod _init_argspec that, when called, retu...
def collapsedintervals(table, start='start', stop='stop', key=None): """ Utility function to collapse intervals in a table. If no facet `key` is given, returns an iterator over `(start, stop)` tuples. If facet `key` is given, returns an iterator over `(key, start, stop)` tuples. ...
def function[collapsedintervals, parameter[table, start, stop, key]]: constant[ Utility function to collapse intervals in a table. If no facet `key` is given, returns an iterator over `(start, stop)` tuples. If facet `key` is given, returns an iterator over `(key, start, stop)` tuples...
keyword[def] identifier[collapsedintervals] ( identifier[table] , identifier[start] = literal[string] , identifier[stop] = literal[string] , identifier[key] = keyword[None] ): literal[string] keyword[if] identifier[key] keyword[is] keyword[None] : identifier[table] = identifier[sort] ( identif...
def collapsedintervals(table, start='start', stop='stop', key=None): """ Utility function to collapse intervals in a table. If no facet `key` is given, returns an iterator over `(start, stop)` tuples. If facet `key` is given, returns an iterator over `(key, start, stop)` tuples. ...
def tag_id(self, name): """ Get the unique tag identifier for a given tag. :param name: The tag :type name: str :rtype: str """ return self._store.get(self.tag_key(name)) or self.reset_tag(name)
def function[tag_id, parameter[self, name]]: constant[ Get the unique tag identifier for a given tag. :param name: The tag :type name: str :rtype: str ] return[<ast.BoolOp object at 0x7da1b1932f20>]
keyword[def] identifier[tag_id] ( identifier[self] , identifier[name] ): literal[string] keyword[return] identifier[self] . identifier[_store] . identifier[get] ( identifier[self] . identifier[tag_key] ( identifier[name] )) keyword[or] identifier[self] . identifier[reset_tag] ( identifier[name] )
def tag_id(self, name): """ Get the unique tag identifier for a given tag. :param name: The tag :type name: str :rtype: str """ return self._store.get(self.tag_key(name)) or self.reset_tag(name)
def to_unicode(value): """Converts bytes, unicode, and C char arrays to unicode strings. Bytes and C char arrays are decoded from UTF-8. """ if isinstance(value, ffi.CData): return ffi.string(value).decode('utf-8') elif isinstance(value, binary_type): return value.decode('utf-8') ...
def function[to_unicode, parameter[value]]: constant[Converts bytes, unicode, and C char arrays to unicode strings. Bytes and C char arrays are decoded from UTF-8. ] if call[name[isinstance], parameter[name[value], name[ffi].CData]] begin[:] return[call[call[name[ffi].string, parameter[...
keyword[def] identifier[to_unicode] ( identifier[value] ): literal[string] keyword[if] identifier[isinstance] ( identifier[value] , identifier[ffi] . identifier[CData] ): keyword[return] identifier[ffi] . identifier[string] ( identifier[value] ). identifier[decode] ( literal[string] ) keywo...
def to_unicode(value): """Converts bytes, unicode, and C char arrays to unicode strings. Bytes and C char arrays are decoded from UTF-8. """ if isinstance(value, ffi.CData): return ffi.string(value).decode('utf-8') # depends on [control=['if'], data=[]] elif isinstance(value, binary_type):...
def purgeCache(self, *args, **kwargs): """ Purge Worker Cache Publish a purge-cache message to purge caches named `cacheName` with `provisionerId` and `workerType` in the routing-key. Workers should be listening for this message and purge caches when they see it. This m...
def function[purgeCache, parameter[self]]: constant[ Purge Worker Cache Publish a purge-cache message to purge caches named `cacheName` with `provisionerId` and `workerType` in the routing-key. Workers should be listening for this message and purge caches when they see it. ...
keyword[def] identifier[purgeCache] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[self] . identifier[_makeApiCall] ( identifier[self] . identifier[funcinfo] [ literal[string] ],* identifier[args] ,** identifier[kwargs] )
def purgeCache(self, *args, **kwargs): """ Purge Worker Cache Publish a purge-cache message to purge caches named `cacheName` with `provisionerId` and `workerType` in the routing-key. Workers should be listening for this message and purge caches when they see it. This metho...
async def checked_run(*cmd): """Run the given subprocess command in a coroutine. Args: *cmd: the command to run and its arguments. Returns: The output that the command wrote to stdout. Raises: RuntimeError: if the command returns a non-zero result. """ # Start the subprocess. logging.info(...
<ast.AsyncFunctionDef object at 0x7da1b21efd30>
keyword[async] keyword[def] identifier[checked_run] (* identifier[cmd] ): literal[string] identifier[logging] . identifier[info] ( literal[string] , identifier[expand_cmd_str] ( identifier[cmd] )) keyword[with] identifier[logged_timer] ( literal[string] . identifier[format] ( identifier[get_cmd_name] ...
async def checked_run(*cmd): """Run the given subprocess command in a coroutine. Args: *cmd: the command to run and its arguments. Returns: The output that the command wrote to stdout. Raises: RuntimeError: if the command returns a non-zero result. """ # Start the subprocess. logging....
def confirm(prompt, default=None, show_default=True, abort=False, input_function=None): '''Prompts for confirmation from the user. ''' valid = { 'yes': True, 'y': True, 'no': False, 'n': False } input_function = get_input_fn(input_function) if default not in ['yes', 'no', None]: default = None if show_...
def function[confirm, parameter[prompt, default, show_default, abort, input_function]]: constant[Prompts for confirmation from the user. ] variable[valid] assign[=] dictionary[[<ast.Constant object at 0x7da18ede6b60>, <ast.Constant object at 0x7da18ede74f0>, <ast.Constant object at 0x7da18ede73a0>, <as...
keyword[def] identifier[confirm] ( identifier[prompt] , identifier[default] = keyword[None] , identifier[show_default] = keyword[True] , identifier[abort] = keyword[False] , identifier[input_function] = keyword[None] ): literal[string] identifier[valid] ={ literal[string] : keyword[True] , literal[string] : ...
def confirm(prompt, default=None, show_default=True, abort=False, input_function=None): """Prompts for confirmation from the user. """ valid = {'yes': True, 'y': True, 'no': False, 'n': False} input_function = get_input_fn(input_function) if default not in ['yes', 'no', None]: default = None #...
def collect_episodes(local_evaluator=None, remote_evaluators=[], timeout_seconds=180): """Gathers new episodes metrics tuples from the given evaluators.""" pending = [ a.apply.remote(lambda ev: ev.get_metrics()) for a in remote_evaluators ] collected, _...
def function[collect_episodes, parameter[local_evaluator, remote_evaluators, timeout_seconds]]: constant[Gathers new episodes metrics tuples from the given evaluators.] variable[pending] assign[=] <ast.ListComp object at 0x7da18eb54b80> <ast.Tuple object at 0x7da18f09d7e0> assign[=] call[name[ra...
keyword[def] identifier[collect_episodes] ( identifier[local_evaluator] = keyword[None] , identifier[remote_evaluators] =[], identifier[timeout_seconds] = literal[int] ): literal[string] identifier[pending] =[ identifier[a] . identifier[apply] . identifier[remote] ( keyword[lambda] identifier[ev] ...
def collect_episodes(local_evaluator=None, remote_evaluators=[], timeout_seconds=180): """Gathers new episodes metrics tuples from the given evaluators.""" pending = [a.apply.remote(lambda ev: ev.get_metrics()) for a in remote_evaluators] (collected, _) = ray.wait(pending, num_returns=len(pending), timeout=...