code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def search(self, keyword, types=[], terr=KKBOXTerritory.TAIWAN): ''' Searches within KKBOX's database. :param keyword: the keyword. :type keyword: str :param types: the search types. :return: list :param terr: the current territory. :return: API response....
def function[search, parameter[self, keyword, types, terr]]: constant[ Searches within KKBOX's database. :param keyword: the keyword. :type keyword: str :param types: the search types. :return: list :param terr: the current territory. :return: API respons...
keyword[def] identifier[search] ( identifier[self] , identifier[keyword] , identifier[types] =[], identifier[terr] = identifier[KKBOXTerritory] . identifier[TAIWAN] ): literal[string] identifier[url] = literal[string] identifier[url] += literal[string] + identifier[url_parse] . identifier...
def search(self, keyword, types=[], terr=KKBOXTerritory.TAIWAN): """ Searches within KKBOX's database. :param keyword: the keyword. :type keyword: str :param types: the search types. :return: list :param terr: the current territory. :return: API response. ...
def code128(self, data, **kwargs): """Renders given ``data`` as **Code 128** barcode symbology. :param str codeset: Optional. Keyword argument for the subtype (code set) to render. Defaults to :attr:`escpos.barcode.CODE128_A`. .. warning:: You should draw up your data ...
def function[code128, parameter[self, data]]: constant[Renders given ``data`` as **Code 128** barcode symbology. :param str codeset: Optional. Keyword argument for the subtype (code set) to render. Defaults to :attr:`escpos.barcode.CODE128_A`. .. warning:: You should d...
keyword[def] identifier[code128] ( identifier[self] , identifier[data] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[re] . identifier[match] ( literal[string] , identifier[data] ): keyword[raise] identifier[ValueError] ( literal[string] ...
def code128(self, data, **kwargs): """Renders given ``data`` as **Code 128** barcode symbology. :param str codeset: Optional. Keyword argument for the subtype (code set) to render. Defaults to :attr:`escpos.barcode.CODE128_A`. .. warning:: You should draw up your data acco...
def build_for_each(self, db, safe_mode=False, extra=None): """Builds the for-each context.""" result = dict() for var, query in iteritems(self.for_each): result[var] = db.query( query, additional_locals=extra, safe_mode=safe_mode ...
def function[build_for_each, parameter[self, db, safe_mode, extra]]: constant[Builds the for-each context.] variable[result] assign[=] call[name[dict], parameter[]] for taget[tuple[[<ast.Name object at 0x7da1b11d4fa0>, <ast.Name object at 0x7da1b11d6fb0>]]] in starred[call[name[iteritems], param...
keyword[def] identifier[build_for_each] ( identifier[self] , identifier[db] , identifier[safe_mode] = keyword[False] , identifier[extra] = keyword[None] ): literal[string] identifier[result] = identifier[dict] () keyword[for] identifier[var] , identifier[query] keyword[in] identifier[it...
def build_for_each(self, db, safe_mode=False, extra=None): """Builds the for-each context.""" result = dict() for (var, query) in iteritems(self.for_each): result[var] = db.query(query, additional_locals=extra, safe_mode=safe_mode) # depends on [control=['for'], data=[]] return result
def _get_span_name(servicer_context): """Generates a span name based off of the gRPC server rpc_request_info""" method_name = servicer_context._rpc_event.call_details.method[1:] if isinstance(method_name, bytes): method_name = method_name.decode('utf-8') method_name = method_name.replace('/', '....
def function[_get_span_name, parameter[servicer_context]]: constant[Generates a span name based off of the gRPC server rpc_request_info] variable[method_name] assign[=] call[name[servicer_context]._rpc_event.call_details.method][<ast.Slice object at 0x7da2045660e0>] if call[name[isinstance], par...
keyword[def] identifier[_get_span_name] ( identifier[servicer_context] ): literal[string] identifier[method_name] = identifier[servicer_context] . identifier[_rpc_event] . identifier[call_details] . identifier[method] [ literal[int] :] keyword[if] identifier[isinstance] ( identifier[method_name] , id...
def _get_span_name(servicer_context): """Generates a span name based off of the gRPC server rpc_request_info""" method_name = servicer_context._rpc_event.call_details.method[1:] if isinstance(method_name, bytes): method_name = method_name.decode('utf-8') # depends on [control=['if'], data=[]] m...
def draw(self): """ Draw guide Returns ------- out : matplotlib.offsetbox.Offsetbox A drawing of this legend """ obverse = slice(0, None) reverse = slice(None, None, -1) width = self.barwidth height = self.barheight nba...
def function[draw, parameter[self]]: constant[ Draw guide Returns ------- out : matplotlib.offsetbox.Offsetbox A drawing of this legend ] variable[obverse] assign[=] call[name[slice], parameter[constant[0], constant[None]]] variable[reverse] a...
keyword[def] identifier[draw] ( identifier[self] ): literal[string] identifier[obverse] = identifier[slice] ( literal[int] , keyword[None] ) identifier[reverse] = identifier[slice] ( keyword[None] , keyword[None] ,- literal[int] ) identifier[width] = identifier[self] . identifier[...
def draw(self): """ Draw guide Returns ------- out : matplotlib.offsetbox.Offsetbox A drawing of this legend """ obverse = slice(0, None) reverse = slice(None, None, -1) width = self.barwidth height = self.barheight nbars = len(self.bar) l...
def can(self, event): """ returns a list of states that can result from processing this event """ return [t.new_state for t in self._transitions if t.event.equals(event)]
def function[can, parameter[self, event]]: constant[ returns a list of states that can result from processing this event ] return[<ast.ListComp object at 0x7da1b085c610>]
keyword[def] identifier[can] ( identifier[self] , identifier[event] ): literal[string] keyword[return] [ identifier[t] . identifier[new_state] keyword[for] identifier[t] keyword[in] identifier[self] . identifier[_transitions] keyword[if] identifier[t] . identifier[event] . identifier[equals] ...
def can(self, event): """ returns a list of states that can result from processing this event """ return [t.new_state for t in self._transitions if t.event.equals(event)]
def push(self, kv): """ Adds a new item from the given (key, value)-tuple. If the key exists, pushes the updated item to the head of the dict. """ if kv[0] in self: self.__delitem__(kv[0]) self.__setitem__(kv[0], kv[1])
def function[push, parameter[self, kv]]: constant[ Adds a new item from the given (key, value)-tuple. If the key exists, pushes the updated item to the head of the dict. ] if compare[call[name[kv]][constant[0]] in name[self]] begin[:] call[name[self].__delitem__, para...
keyword[def] identifier[push] ( identifier[self] , identifier[kv] ): literal[string] keyword[if] identifier[kv] [ literal[int] ] keyword[in] identifier[self] : identifier[self] . identifier[__delitem__] ( identifier[kv] [ literal[int] ]) identifier[self] . identifier[__setit...
def push(self, kv): """ Adds a new item from the given (key, value)-tuple. If the key exists, pushes the updated item to the head of the dict. """ if kv[0] in self: self.__delitem__(kv[0]) # depends on [control=['if'], data=['self']] self.__setitem__(kv[0], kv[1])
def create_lockfile(self): """ Write recursive dependencies list to outfile with hard-pinned versions. Then fix it. """ process = subprocess.Popen( self.pin_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) stdo...
def function[create_lockfile, parameter[self]]: constant[ Write recursive dependencies list to outfile with hard-pinned versions. Then fix it. ] variable[process] assign[=] call[name[subprocess].Popen, parameter[name[self].pin_command]] <ast.Tuple object at 0x7da1...
keyword[def] identifier[create_lockfile] ( identifier[self] ): literal[string] identifier[process] = identifier[subprocess] . identifier[Popen] ( identifier[self] . identifier[pin_command] , identifier[stdout] = identifier[subprocess] . identifier[PIPE] , identifier[stder...
def create_lockfile(self): """ Write recursive dependencies list to outfile with hard-pinned versions. Then fix it. """ process = subprocess.Popen(self.pin_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdout, stderr) = process.communicate() if process.returnc...
def pickNthWeekday(year, month, dayofweek, hour, minute, whichweek): """dayofweek == 0 means Sunday, whichweek > 4 means last instance""" first = datetime.datetime(year=year, month=month, hour=hour, minute=minute, day=1) weekdayone = first.replace(day=((dayofweek - first.isowee...
def function[pickNthWeekday, parameter[year, month, dayofweek, hour, minute, whichweek]]: constant[dayofweek == 0 means Sunday, whichweek > 4 means last instance] variable[first] assign[=] call[name[datetime].datetime, parameter[]] variable[weekdayone] assign[=] call[name[first].replace, paramet...
keyword[def] identifier[pickNthWeekday] ( identifier[year] , identifier[month] , identifier[dayofweek] , identifier[hour] , identifier[minute] , identifier[whichweek] ): literal[string] identifier[first] = identifier[datetime] . identifier[datetime] ( identifier[year] = identifier[year] , identifier[month]...
def pickNthWeekday(year, month, dayofweek, hour, minute, whichweek): """dayofweek == 0 means Sunday, whichweek > 4 means last instance""" first = datetime.datetime(year=year, month=month, hour=hour, minute=minute, day=1) weekdayone = first.replace(day=(dayofweek - first.isoweekday()) % 7 + 1) for n in x...
def dict_to_paths(dict_): """Convert a dict to metric paths. >>> dict_to_paths({'foo': {'bar': 1}, 'baz': 2}) { 'foo.bar': 1, 'baz': 2, } """ metrics = {} for k, v in dict_.iteritems(): if isinstance(v, dict): submetrics = dict_to_paths(v) for...
def function[dict_to_paths, parameter[dict_]]: constant[Convert a dict to metric paths. >>> dict_to_paths({'foo': {'bar': 1}, 'baz': 2}) { 'foo.bar': 1, 'baz': 2, } ] variable[metrics] assign[=] dictionary[[], []] for taget[tuple[[<ast.Name object at 0x7da18fe91b...
keyword[def] identifier[dict_to_paths] ( identifier[dict_] ): literal[string] identifier[metrics] ={} keyword[for] identifier[k] , identifier[v] keyword[in] identifier[dict_] . identifier[iteritems] (): keyword[if] identifier[isinstance] ( identifier[v] , identifier[dict] ): ...
def dict_to_paths(dict_): """Convert a dict to metric paths. >>> dict_to_paths({'foo': {'bar': 1}, 'baz': 2}) { 'foo.bar': 1, 'baz': 2, } """ metrics = {} for (k, v) in dict_.iteritems(): if isinstance(v, dict): submetrics = dict_to_paths(v) f...
def unescape(b, encoding): '''Unescape all string and unicode literals in bytes.''' return string_literal_re.sub( lambda m: unescape_string_literal(m.group(), encoding), b )
def function[unescape, parameter[b, encoding]]: constant[Unescape all string and unicode literals in bytes.] return[call[name[string_literal_re].sub, parameter[<ast.Lambda object at 0x7da1b033ff70>, name[b]]]]
keyword[def] identifier[unescape] ( identifier[b] , identifier[encoding] ): literal[string] keyword[return] identifier[string_literal_re] . identifier[sub] ( keyword[lambda] identifier[m] : identifier[unescape_string_literal] ( identifier[m] . identifier[group] (), identifier[encoding] ), ident...
def unescape(b, encoding): """Unescape all string and unicode literals in bytes.""" return string_literal_re.sub(lambda m: unescape_string_literal(m.group(), encoding), b)
def _get_nonce(self, url): """ Get a nonce to use in a request, removing it from the nonces on hand. """ action = LOG_JWS_GET_NONCE() if len(self._nonces) > 0: with action: nonce = self._nonces.pop() action.add_success_fields(nonce=nonc...
def function[_get_nonce, parameter[self, url]]: constant[ Get a nonce to use in a request, removing it from the nonces on hand. ] variable[action] assign[=] call[name[LOG_JWS_GET_NONCE], parameter[]] if compare[call[name[len], parameter[name[self]._nonces]] greater[>] constant[0]...
keyword[def] identifier[_get_nonce] ( identifier[self] , identifier[url] ): literal[string] identifier[action] = identifier[LOG_JWS_GET_NONCE] () keyword[if] identifier[len] ( identifier[self] . identifier[_nonces] )> literal[int] : keyword[with] identifier[action] : ...
def _get_nonce(self, url): """ Get a nonce to use in a request, removing it from the nonces on hand. """ action = LOG_JWS_GET_NONCE() if len(self._nonces) > 0: with action: nonce = self._nonces.pop() action.add_success_fields(nonce=nonce) return su...
def send_bytes(self, bytes): """ Send data to DCC peer. """ try: self.socket.send(bytes) log.debug("TO PEER: %r\n", bytes) except socket.error: self.disconnect("Connection reset by peer.")
def function[send_bytes, parameter[self, bytes]]: constant[ Send data to DCC peer. ] <ast.Try object at 0x7da1b0b44340>
keyword[def] identifier[send_bytes] ( identifier[self] , identifier[bytes] ): literal[string] keyword[try] : identifier[self] . identifier[socket] . identifier[send] ( identifier[bytes] ) identifier[log] . identifier[debug] ( literal[string] , identifier[bytes] ) ...
def send_bytes(self, bytes): """ Send data to DCC peer. """ try: self.socket.send(bytes) log.debug('TO PEER: %r\n', bytes) # depends on [control=['try'], data=[]] except socket.error: self.disconnect('Connection reset by peer.') # depends on [control=['except'], dat...
def parse_polygonal_poi(coords, response): """ Parse areal POI way polygons from OSM node coords. Parameters ---------- coords : dict dict of node IDs and their lat, lon coordinates Returns ------- dict of POIs containing each's nodes, polygon geometry, and osmid """ i...
def function[parse_polygonal_poi, parameter[coords, response]]: constant[ Parse areal POI way polygons from OSM node coords. Parameters ---------- coords : dict dict of node IDs and their lat, lon coordinates Returns ------- dict of POIs containing each's nodes, polygon geo...
keyword[def] identifier[parse_polygonal_poi] ( identifier[coords] , identifier[response] ): literal[string] keyword[if] literal[string] keyword[in] identifier[response] keyword[and] identifier[response] [ literal[string] ]== literal[string] : identifier[nodes] = identifier[response] [ litera...
def parse_polygonal_poi(coords, response): """ Parse areal POI way polygons from OSM node coords. Parameters ---------- coords : dict dict of node IDs and their lat, lon coordinates Returns ------- dict of POIs containing each's nodes, polygon geometry, and osmid """ if...
def has_zero_length_fragments(self, min_index=None, max_index=None): """ Return ``True`` if the list has at least one interval with zero length withing ``min_index`` and ``max_index``. If the latter are not specified, check all intervals. :param int min_index: examine fragments ...
def function[has_zero_length_fragments, parameter[self, min_index, max_index]]: constant[ Return ``True`` if the list has at least one interval with zero length withing ``min_index`` and ``max_index``. If the latter are not specified, check all intervals. :param int min_index: e...
keyword[def] identifier[has_zero_length_fragments] ( identifier[self] , identifier[min_index] = keyword[None] , identifier[max_index] = keyword[None] ): literal[string] identifier[min_index] , identifier[max_index] = identifier[self] . identifier[_check_min_max_indices] ( identifier[min_index] , id...
def has_zero_length_fragments(self, min_index=None, max_index=None): """ Return ``True`` if the list has at least one interval with zero length withing ``min_index`` and ``max_index``. If the latter are not specified, check all intervals. :param int min_index: examine fragments with...
def parse_data_line(self, sline): """ Parses the data line and builds the dictionary. :param sline: a split data line to parse :returns: the number of rows to jump and parse the next data line or return the code error -1 """ # if there are less values founded than headers...
def function[parse_data_line, parameter[self, sline]]: constant[ Parses the data line and builds the dictionary. :param sline: a split data line to parse :returns: the number of rows to jump and parse the next data line or return the code error -1 ] if compare[call[name[l...
keyword[def] identifier[parse_data_line] ( identifier[self] , identifier[sline] ): literal[string] keyword[if] identifier[len] ( identifier[sline] )!= identifier[len] ( identifier[self] . identifier[_columns] ): identifier[self] . identifier[err] ( literal[string] ) ...
def parse_data_line(self, sline): """ Parses the data line and builds the dictionary. :param sline: a split data line to parse :returns: the number of rows to jump and parse the next data line or return the code error -1 """ # if there are less values founded than headers, it's a...
def MAXSIDE(a, b): """maxside: Sort pack by maximum sides""" return cmp(max(b[0], b[1]), max(a[0], a[1])) or cmp(min(b[0], b[1]), min(a[0], a[1])) or cmp(b[1], a[1]) or cmp(b[0], a[0])
def function[MAXSIDE, parameter[a, b]]: constant[maxside: Sort pack by maximum sides] return[<ast.BoolOp object at 0x7da1b0d018d0>]
keyword[def] identifier[MAXSIDE] ( identifier[a] , identifier[b] ): literal[string] keyword[return] identifier[cmp] ( identifier[max] ( identifier[b] [ literal[int] ], identifier[b] [ literal[int] ]), identifier[max] ( identifier[a] [ literal[int] ], identifier[a] [ literal[int] ])) keyword[or] i...
def MAXSIDE(a, b): """maxside: Sort pack by maximum sides""" return cmp(max(b[0], b[1]), max(a[0], a[1])) or cmp(min(b[0], b[1]), min(a[0], a[1])) or cmp(b[1], a[1]) or cmp(b[0], a[0])
def DeserializeFromBufer(buffer, offset=0): """ Deserialize object instance from the specified buffer. Args: buffer (bytes, bytearray, BytesIO): (Optional) data to create the stream from. offset: UNUSED Returns: Transaction: """ mstre...
def function[DeserializeFromBufer, parameter[buffer, offset]]: constant[ Deserialize object instance from the specified buffer. Args: buffer (bytes, bytearray, BytesIO): (Optional) data to create the stream from. offset: UNUSED Returns: Transaction: ...
keyword[def] identifier[DeserializeFromBufer] ( identifier[buffer] , identifier[offset] = literal[int] ): literal[string] identifier[mstream] = identifier[StreamManager] . identifier[GetStream] ( identifier[buffer] ) identifier[reader] = identifier[BinaryReader] ( identifier[mstream] ) ...
def DeserializeFromBufer(buffer, offset=0): """ Deserialize object instance from the specified buffer. Args: buffer (bytes, bytearray, BytesIO): (Optional) data to create the stream from. offset: UNUSED Returns: Transaction: """ mstream = Str...
def create_records(marcxml, verbose=CFG_BIBRECORD_DEFAULT_VERBOSE_LEVEL, correct=CFG_BIBRECORD_DEFAULT_CORRECT, parser='', keep_singletons=CFG_BIBRECORD_KEEP_SINGLETONS): """ Create a list of records from the marcxml description. :returns: a list of objects initiated b...
def function[create_records, parameter[marcxml, verbose, correct, parser, keep_singletons]]: constant[ Create a list of records from the marcxml description. :returns: a list of objects initiated by the function create_record(). Please see that function's docstring. ] variable...
keyword[def] identifier[create_records] ( identifier[marcxml] , identifier[verbose] = identifier[CFG_BIBRECORD_DEFAULT_VERBOSE_LEVEL] , identifier[correct] = identifier[CFG_BIBRECORD_DEFAULT_CORRECT] , identifier[parser] = literal[string] , identifier[keep_singletons] = identifier[CFG_BIBRECORD_KEEP_SINGLETONS] ): ...
def create_records(marcxml, verbose=CFG_BIBRECORD_DEFAULT_VERBOSE_LEVEL, correct=CFG_BIBRECORD_DEFAULT_CORRECT, parser='', keep_singletons=CFG_BIBRECORD_KEEP_SINGLETONS): """ Create a list of records from the marcxml description. :returns: a list of objects initiated by the function create_record(). ...
def StartClients(cls, hunt_id, client_ids, token=None): """This method is called by the foreman for each client it discovers. Note that this function is performance sensitive since it is called by the foreman for every client which needs to be scheduled. Args: hunt_id: The hunt to schedule. ...
def function[StartClients, parameter[cls, hunt_id, client_ids, token]]: constant[This method is called by the foreman for each client it discovers. Note that this function is performance sensitive since it is called by the foreman for every client which needs to be scheduled. Args: hunt_id: ...
keyword[def] identifier[StartClients] ( identifier[cls] , identifier[hunt_id] , identifier[client_ids] , identifier[token] = keyword[None] ): literal[string] identifier[token] = identifier[token] keyword[or] identifier[access_control] . identifier[ACLToken] ( identifier[username] = literal[string] , iden...
def StartClients(cls, hunt_id, client_ids, token=None): """This method is called by the foreman for each client it discovers. Note that this function is performance sensitive since it is called by the foreman for every client which needs to be scheduled. Args: hunt_id: The hunt to schedule. ...
def _handle_wrong_field(cls, field_name, field_type): """Raise an exception whenever an invalid attribute with the given name was attempted to be set to or retrieved from this model class. Assumes that the given field is invalid, without making any checks. Also adds an entry to...
def function[_handle_wrong_field, parameter[cls, field_name, field_type]]: constant[Raise an exception whenever an invalid attribute with the given name was attempted to be set to or retrieved from this model class. Assumes that the given field is invalid, without making any checks. ...
keyword[def] identifier[_handle_wrong_field] ( identifier[cls] , identifier[field_name] , identifier[field_type] ): literal[string] keyword[if] identifier[field_type] == identifier[ATTR_TYPE_READ] : identifier[field_type] = literal[string] keyword[elif] identifier[field_typ...
def _handle_wrong_field(cls, field_name, field_type): """Raise an exception whenever an invalid attribute with the given name was attempted to be set to or retrieved from this model class. Assumes that the given field is invalid, without making any checks. Also adds an entry to the...
def parse_psimitab(content, fmt='tab27'): """https://code.google.com/archive/p/psimi/wikis/PsimiTab27Format.wiki """ columns = [ 'Unique identifier for interactor A', 'Unique identifier for interactor B', 'Alternative identifier for interactor A', 'Alternative identifier for ...
def function[parse_psimitab, parameter[content, fmt]]: constant[https://code.google.com/archive/p/psimi/wikis/PsimiTab27Format.wiki ] variable[columns] assign[=] list[[<ast.Constant object at 0x7da1b0dc0250>, <ast.Constant object at 0x7da1b0dc1de0>, <ast.Constant object at 0x7da1b0dc1540>, <ast.Cons...
keyword[def] identifier[parse_psimitab] ( identifier[content] , identifier[fmt] = literal[string] ): literal[string] identifier[columns] =[ literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , l...
def parse_psimitab(content, fmt='tab27'): """https://code.google.com/archive/p/psimi/wikis/PsimiTab27Format.wiki """ columns = ['Unique identifier for interactor A', 'Unique identifier for interactor B', 'Alternative identifier for interactor A', 'Alternative identifier for interactor B', 'Aliases for A', '...
def __SetBaseHeaders(self, http_request, client): """Fill in the basic headers on http_request.""" # TODO(craigcitro): Make the default a little better here, and # include the apitools version. user_agent = client.user_agent or 'apitools-client/1.0' http_request.headers['user-age...
def function[__SetBaseHeaders, parameter[self, http_request, client]]: constant[Fill in the basic headers on http_request.] variable[user_agent] assign[=] <ast.BoolOp object at 0x7da1b07f9750> call[name[http_request].headers][constant[user-agent]] assign[=] name[user_agent] call[name[htt...
keyword[def] identifier[__SetBaseHeaders] ( identifier[self] , identifier[http_request] , identifier[client] ): literal[string] identifier[user_agent] = identifier[client] . identifier[user_agent] keyword[or] literal[string] identifier[http_request] . identifier[header...
def __SetBaseHeaders(self, http_request, client): """Fill in the basic headers on http_request.""" # TODO(craigcitro): Make the default a little better here, and # include the apitools version. user_agent = client.user_agent or 'apitools-client/1.0' http_request.headers['user-agent'] = user_agent ...
def setup_prjs_signals(self, ): """Setup the signals for the projects page :returns: None :rtype: None :raises: None """ log.debug("Setting up projects page signals.") self.prjs_prj_view_pb.clicked.connect(self.prjs_view_prj) self.prjs_prj_create_pb.click...
def function[setup_prjs_signals, parameter[self]]: constant[Setup the signals for the projects page :returns: None :rtype: None :raises: None ] call[name[log].debug, parameter[constant[Setting up projects page signals.]]] call[name[self].prjs_prj_view_pb.clicked....
keyword[def] identifier[setup_prjs_signals] ( identifier[self] ,): literal[string] identifier[log] . identifier[debug] ( literal[string] ) identifier[self] . identifier[prjs_prj_view_pb] . identifier[clicked] . identifier[connect] ( identifier[self] . identifier[prjs_view_prj] ) i...
def setup_prjs_signals(self): """Setup the signals for the projects page :returns: None :rtype: None :raises: None """ log.debug('Setting up projects page signals.') self.prjs_prj_view_pb.clicked.connect(self.prjs_view_prj) self.prjs_prj_create_pb.clicked.connect(self.pr...
def split_candidates(candsfile, featind1, featind2, candsfile1, candsfile2): """ Split features from one candsfile into two new candsfiles featind1/2 is list of indices to take from d['features']. New features and updated state dict go to candsfile1/2. """ with open(candsfile, 'rb') as pkl: ...
def function[split_candidates, parameter[candsfile, featind1, featind2, candsfile1, candsfile2]]: constant[ Split features from one candsfile into two new candsfiles featind1/2 is list of indices to take from d['features']. New features and updated state dict go to candsfile1/2. ] with call...
keyword[def] identifier[split_candidates] ( identifier[candsfile] , identifier[featind1] , identifier[featind2] , identifier[candsfile1] , identifier[candsfile2] ): literal[string] keyword[with] identifier[open] ( identifier[candsfile] , literal[string] ) keyword[as] identifier[pkl] : identifie...
def split_candidates(candsfile, featind1, featind2, candsfile1, candsfile2): """ Split features from one candsfile into two new candsfiles featind1/2 is list of indices to take from d['features']. New features and updated state dict go to candsfile1/2. """ with open(candsfile, 'rb') as pkl: ...
def deploy_template(access_token, subscription_id, resource_group, deployment_name, template, parameters): '''Deploy a template referenced by a JSON string, with parameters as a JSON string. Args: access_token (str): A valid Azure authentication token. subscription_id (str):...
def function[deploy_template, parameter[access_token, subscription_id, resource_group, deployment_name, template, parameters]]: constant[Deploy a template referenced by a JSON string, with parameters as a JSON string. Args: access_token (str): A valid Azure authentication token. subscriptio...
keyword[def] identifier[deploy_template] ( identifier[access_token] , identifier[subscription_id] , identifier[resource_group] , identifier[deployment_name] , identifier[template] , identifier[parameters] ): literal[string] identifier[endpoint] = literal[string] . identifier[join] ([ identifier[get_rm_end...
def deploy_template(access_token, subscription_id, resource_group, deployment_name, template, parameters): """Deploy a template referenced by a JSON string, with parameters as a JSON string. Args: access_token (str): A valid Azure authentication token. subscription_id (str): Azure subscription ...
def get_endpoint_name(self, headers): """Parses request headers and extracts part od the X-Amz-Target that corresponds to a method of DynamoHandler ie: X-Amz-Target: DynamoDB_20111205.ListTables -> ListTables """ # Headers are case-insensitive. Probably a better way to do this. ...
def function[get_endpoint_name, parameter[self, headers]]: constant[Parses request headers and extracts part od the X-Amz-Target that corresponds to a method of DynamoHandler ie: X-Amz-Target: DynamoDB_20111205.ListTables -> ListTables ] variable[match] assign[=] <ast.BoolOp obj...
keyword[def] identifier[get_endpoint_name] ( identifier[self] , identifier[headers] ): literal[string] identifier[match] = identifier[headers] . identifier[get] ( literal[string] ) keyword[or] identifier[headers] . identifier[get] ( literal[string] ) keyword[if] identifier[match...
def get_endpoint_name(self, headers): """Parses request headers and extracts part od the X-Amz-Target that corresponds to a method of DynamoHandler ie: X-Amz-Target: DynamoDB_20111205.ListTables -> ListTables """ # Headers are case-insensitive. Probably a better way to do this. matc...
def runPowerNotificationsThread(self): """Main method of the spawned NSThread. Registers run loop source and runs current NSRunLoop.""" pool = NSAutoreleasePool.alloc().init() @objc.callbackFor(IOPSNotificationCreateRunLoopSource) def on_power_source_notification(context): w...
def function[runPowerNotificationsThread, parameter[self]]: constant[Main method of the spawned NSThread. Registers run loop source and runs current NSRunLoop.] variable[pool] assign[=] call[call[name[NSAutoreleasePool].alloc, parameter[]].init, parameter[]] def function[on_power_source_notifica...
keyword[def] identifier[runPowerNotificationsThread] ( identifier[self] ): literal[string] identifier[pool] = identifier[NSAutoreleasePool] . identifier[alloc] (). identifier[init] () @ identifier[objc] . identifier[callbackFor] ( identifier[IOPSNotificationCreateRunLoopSource] ) ...
def runPowerNotificationsThread(self): """Main method of the spawned NSThread. Registers run loop source and runs current NSRunLoop.""" pool = NSAutoreleasePool.alloc().init() @objc.callbackFor(IOPSNotificationCreateRunLoopSource) def on_power_source_notification(context): with self._lock: ...
def get_data_coeficientes_perfilado_2017(force_download=False): """Extrae la información de las dos hojas del Excel proporcionado por REE con los perfiles iniciales para 2017. :param force_download: Descarga el fichero 'raw' del servidor, en vez de acudir a la copia local. :return: perfiles_2017, coefs_...
def function[get_data_coeficientes_perfilado_2017, parameter[force_download]]: constant[Extrae la información de las dos hojas del Excel proporcionado por REE con los perfiles iniciales para 2017. :param force_download: Descarga el fichero 'raw' del servidor, en vez de acudir a la copia local. :retu...
keyword[def] identifier[get_data_coeficientes_perfilado_2017] ( identifier[force_download] = keyword[False] ): literal[string] identifier[path_perfs] = identifier[os] . identifier[path] . identifier[join] ( identifier[STORAGE_DIR] , literal[string] ) keyword[if] identifier[force_download] keyword[o...
def get_data_coeficientes_perfilado_2017(force_download=False): """Extrae la información de las dos hojas del Excel proporcionado por REE con los perfiles iniciales para 2017. :param force_download: Descarga el fichero 'raw' del servidor, en vez de acudir a la copia local. :return: perfiles_2017, coefs_...
def _DeepCopy(self, obj): """Creates an object copy by serializing/deserializing it. RDFStruct.Copy() doesn't deep-copy repeated fields which may lead to hard to catch bugs. Args: obj: RDFValue to be copied. Returns: A deep copy of the passed RDFValue. """ precondition.AssertT...
def function[_DeepCopy, parameter[self, obj]]: constant[Creates an object copy by serializing/deserializing it. RDFStruct.Copy() doesn't deep-copy repeated fields which may lead to hard to catch bugs. Args: obj: RDFValue to be copied. Returns: A deep copy of the passed RDFValue. ...
keyword[def] identifier[_DeepCopy] ( identifier[self] , identifier[obj] ): literal[string] identifier[precondition] . identifier[AssertType] ( identifier[obj] , identifier[rdfvalue] . identifier[RDFValue] ) keyword[return] identifier[obj] . identifier[__class__] . identifier[FromSerializedString] ( ...
def _DeepCopy(self, obj): """Creates an object copy by serializing/deserializing it. RDFStruct.Copy() doesn't deep-copy repeated fields which may lead to hard to catch bugs. Args: obj: RDFValue to be copied. Returns: A deep copy of the passed RDFValue. """ precondition.AssertT...
def _fetch(self, resource, params): """Fetch a resource. :param resource: resource to get :param params: dict with the HTTP parameters needed to get the given resource """ url = self.URL % {'resource': resource} params[self.PTOKEN] = self.api_token l...
def function[_fetch, parameter[self, resource, params]]: constant[Fetch a resource. :param resource: resource to get :param params: dict with the HTTP parameters needed to get the given resource ] variable[url] assign[=] binary_operation[name[self].URL <ast.Mod objec...
keyword[def] identifier[_fetch] ( identifier[self] , identifier[resource] , identifier[params] ): literal[string] identifier[url] = identifier[self] . identifier[URL] %{ literal[string] : identifier[resource] } identifier[params] [ identifier[self] . identifier[PTOKEN] ]= identifier[self] ...
def _fetch(self, resource, params): """Fetch a resource. :param resource: resource to get :param params: dict with the HTTP parameters needed to get the given resource """ url = self.URL % {'resource': resource} params[self.PTOKEN] = self.api_token logger.debug('Slac...
def K(self, parm): """ Returns the Gram Matrix Parameters ---------- parm : np.ndarray Parameters for the Gram Matrix Returns ---------- - Gram Matrix (np.ndarray) """ return Periodic_K_matrix(self.X, parm) + np.identity(self.X.shape[...
def function[K, parameter[self, parm]]: constant[ Returns the Gram Matrix Parameters ---------- parm : np.ndarray Parameters for the Gram Matrix Returns ---------- - Gram Matrix (np.ndarray) ] return[binary_operation[call[name[Periodic_K_...
keyword[def] identifier[K] ( identifier[self] , identifier[parm] ): literal[string] keyword[return] identifier[Periodic_K_matrix] ( identifier[self] . identifier[X] , identifier[parm] )+ identifier[np] . identifier[identity] ( identifier[self] . identifier[X] . identifier[shape] [ literal[int] ])*...
def K(self, parm): """ Returns the Gram Matrix Parameters ---------- parm : np.ndarray Parameters for the Gram Matrix Returns ---------- - Gram Matrix (np.ndarray) """ return Periodic_K_matrix(self.X, parm) + np.identity(self.X.shape[0]) * 10...
def fake2db_sqlite_initiator(self, number_of_rows, name=None, custom=None): '''Main handler for the operation ''' rows = number_of_rows conn = self.database_caller_creator(name) if custom: self.custom_db_creator(rows, conn, custom) conn.close() ...
def function[fake2db_sqlite_initiator, parameter[self, number_of_rows, name, custom]]: constant[Main handler for the operation ] variable[rows] assign[=] name[number_of_rows] variable[conn] assign[=] call[name[self].database_caller_creator, parameter[name[name]]] if name[custom] ...
keyword[def] identifier[fake2db_sqlite_initiator] ( identifier[self] , identifier[number_of_rows] , identifier[name] = keyword[None] , identifier[custom] = keyword[None] ): literal[string] identifier[rows] = identifier[number_of_rows] identifier[conn] = identifier[self] . identifier[datab...
def fake2db_sqlite_initiator(self, number_of_rows, name=None, custom=None): """Main handler for the operation """ rows = number_of_rows conn = self.database_caller_creator(name) if custom: self.custom_db_creator(rows, conn, custom) conn.close() sys.exit(0) # depends on [...
def gaussian_filter(data, sigma): """ Drop-in replacement for scipy.ndimage.gaussian_filter. (note: results are only approximately equal to the output of gaussian_filter) """ if np.isscalar(sigma): sigma = (sigma,) * data.ndim baseline = data.mean() filtered = data - baseline ...
def function[gaussian_filter, parameter[data, sigma]]: constant[ Drop-in replacement for scipy.ndimage.gaussian_filter. (note: results are only approximately equal to the output of gaussian_filter) ] if call[name[np].isscalar, parameter[name[sigma]]] begin[:] variable[s...
keyword[def] identifier[gaussian_filter] ( identifier[data] , identifier[sigma] ): literal[string] keyword[if] identifier[np] . identifier[isscalar] ( identifier[sigma] ): identifier[sigma] =( identifier[sigma] ,)* identifier[data] . identifier[ndim] identifier[baseline] = identifier[data]...
def gaussian_filter(data, sigma): """ Drop-in replacement for scipy.ndimage.gaussian_filter. (note: results are only approximately equal to the output of gaussian_filter) """ if np.isscalar(sigma): sigma = (sigma,) * data.ndim # depends on [control=['if'], data=[]] baseline = data...
def has_object_permission(self, request, view, obj): """Check object permissions.""" # admins can do anything if request.user.is_superuser: return True # `share` permission is required for editing permissions if 'permissions' in view.action: self.perms_ma...
def function[has_object_permission, parameter[self, request, view, obj]]: constant[Check object permissions.] if name[request].user.is_superuser begin[:] return[constant[True]] if compare[constant[permissions] in name[view].action] begin[:] call[name[self].perms_map][cons...
keyword[def] identifier[has_object_permission] ( identifier[self] , identifier[request] , identifier[view] , identifier[obj] ): literal[string] keyword[if] identifier[request] . identifier[user] . identifier[is_superuser] : keyword[return] keyword[True] ...
def has_object_permission(self, request, view, obj): """Check object permissions.""" # admins can do anything if request.user.is_superuser: return True # depends on [control=['if'], data=[]] # `share` permission is required for editing permissions if 'permissions' in view.action: se...
def check_actors(self): """ Checks the actors of the owner. Raises an exception if invalid. """ actors = [] for actor in self.owner.actors: if actor.skip: continue actors.append(actor) if len(actors) == 0: return ...
def function[check_actors, parameter[self]]: constant[ Checks the actors of the owner. Raises an exception if invalid. ] variable[actors] assign[=] list[[]] for taget[name[actor]] in starred[name[self].owner.actors] begin[:] if name[actor].skip begin[:] ...
keyword[def] identifier[check_actors] ( identifier[self] ): literal[string] identifier[actors] =[] keyword[for] identifier[actor] keyword[in] identifier[self] . identifier[owner] . identifier[actors] : keyword[if] identifier[actor] . identifier[skip] : key...
def check_actors(self): """ Checks the actors of the owner. Raises an exception if invalid. """ actors = [] for actor in self.owner.actors: if actor.skip: continue # depends on [control=['if'], data=[]] actors.append(actor) # depends on [control=['for'], data=['...
def disable_host_flap_detection(self, host): """Disable flap detection for a host Format of the line that triggers function call:: DISABLE_HOST_FLAP_DETECTION;<host_name> :param host: host to edit :type host: alignak.objects.host.Host :return: None """ i...
def function[disable_host_flap_detection, parameter[self, host]]: constant[Disable flap detection for a host Format of the line that triggers function call:: DISABLE_HOST_FLAP_DETECTION;<host_name> :param host: host to edit :type host: alignak.objects.host.Host :return:...
keyword[def] identifier[disable_host_flap_detection] ( identifier[self] , identifier[host] ): literal[string] keyword[if] identifier[host] . identifier[flap_detection_enabled] : identifier[host] . identifier[modified_attributes] |= identifier[DICT_MODATTR] [ literal[string] ]. identif...
def disable_host_flap_detection(self, host): """Disable flap detection for a host Format of the line that triggers function call:: DISABLE_HOST_FLAP_DETECTION;<host_name> :param host: host to edit :type host: alignak.objects.host.Host :return: None """ if host.f...
def _parse_path(self): """ Parse the storage path in the config. Returns: str """ if self.engine == ENGINE_DROPBOX: path = get_dropbox_folder_location() elif self.engine == ENGINE_GDRIVE: path = get_google_drive_folder_location() ...
def function[_parse_path, parameter[self]]: constant[ Parse the storage path in the config. Returns: str ] if compare[name[self].engine equal[==] name[ENGINE_DROPBOX]] begin[:] variable[path] assign[=] call[name[get_dropbox_folder_location], parameter...
keyword[def] identifier[_parse_path] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[engine] == identifier[ENGINE_DROPBOX] : identifier[path] = identifier[get_dropbox_folder_location] () keyword[elif] identifier[self] . identifier[engine] == i...
def _parse_path(self): """ Parse the storage path in the config. Returns: str """ if self.engine == ENGINE_DROPBOX: path = get_dropbox_folder_location() # depends on [control=['if'], data=[]] elif self.engine == ENGINE_GDRIVE: path = get_google_drive_fol...
def parse_format(self): """Check format parameter. All formats values listed in the specification are lowercase alphanumeric value commonly used as file extensions. To leave opportunity for extension here just do a limited sanity check on characters and length. """ ...
def function[parse_format, parameter[self]]: constant[Check format parameter. All formats values listed in the specification are lowercase alphanumeric value commonly used as file extensions. To leave opportunity for extension here just do a limited sanity check on characters an...
keyword[def] identifier[parse_format] ( identifier[self] ): literal[string] keyword[if] ( identifier[self] . identifier[format] keyword[is] keyword[not] keyword[None] keyword[and] keyword[not] identifier[re] . identifier[match] ( literal[string] , identifier[self] . identifier[format...
def parse_format(self): """Check format parameter. All formats values listed in the specification are lowercase alphanumeric value commonly used as file extensions. To leave opportunity for extension here just do a limited sanity check on characters and length. """ if se...
def SInt64(value, min_value=None, max_value=None, encoder=ENC_INT_DEFAULT, fuzzable=True, name=None, full_range=False): '''Signed 64-bit field''' return BitField(value, 64, signed=True, min_value=min_value, max_value=max_value, encoder=encoder, fuzzable=fuzzable, name=name, full_range=full_range)
def function[SInt64, parameter[value, min_value, max_value, encoder, fuzzable, name, full_range]]: constant[Signed 64-bit field] return[call[name[BitField], parameter[name[value], constant[64]]]]
keyword[def] identifier[SInt64] ( identifier[value] , identifier[min_value] = keyword[None] , identifier[max_value] = keyword[None] , identifier[encoder] = identifier[ENC_INT_DEFAULT] , identifier[fuzzable] = keyword[True] , identifier[name] = keyword[None] , identifier[full_range] = keyword[False] ): literal[st...
def SInt64(value, min_value=None, max_value=None, encoder=ENC_INT_DEFAULT, fuzzable=True, name=None, full_range=False): """Signed 64-bit field""" return BitField(value, 64, signed=True, min_value=min_value, max_value=max_value, encoder=encoder, fuzzable=fuzzable, name=name, full_range=full_range)
def plugin_counts(self): """plugin_counts Returns the plugin counts as dictionary with the last updated info if its available. """ ret = { 'total': 0, } # As ususal, we need data before we can actually do anything ;) data = self.raw_query('plu...
def function[plugin_counts, parameter[self]]: constant[plugin_counts Returns the plugin counts as dictionary with the last updated info if its available. ] variable[ret] assign[=] dictionary[[<ast.Constant object at 0x7da1b2865c00>], [<ast.Constant object at 0x7da1b2865450>]] ...
keyword[def] identifier[plugin_counts] ( identifier[self] ): literal[string] identifier[ret] ={ literal[string] : literal[int] , } identifier[data] = identifier[self] . identifier[raw_query] ( literal[string] , literal[string] ) ...
def plugin_counts(self): """plugin_counts Returns the plugin counts as dictionary with the last updated info if its available. """ ret = {'total': 0} # As ususal, we need data before we can actually do anything ;) data = self.raw_query('plugin', 'init') # For backwards compat...
def run_multiple_processes(args_list: List[List[str]], die_on_failure: bool = True) -> None: """ Fire up multiple processes, and wait for them to finihs. Args: args_list: command arguments for each process die_on_failure: see :func:`wait_for_processes` """ ...
def function[run_multiple_processes, parameter[args_list, die_on_failure]]: constant[ Fire up multiple processes, and wait for them to finihs. Args: args_list: command arguments for each process die_on_failure: see :func:`wait_for_processes` ] for taget[name[procargs]] in st...
keyword[def] identifier[run_multiple_processes] ( identifier[args_list] : identifier[List] [ identifier[List] [ identifier[str] ]], identifier[die_on_failure] : identifier[bool] = keyword[True] )-> keyword[None] : literal[string] keyword[for] identifier[procargs] keyword[in] identifier[args_list] : ...
def run_multiple_processes(args_list: List[List[str]], die_on_failure: bool=True) -> None: """ Fire up multiple processes, and wait for them to finihs. Args: args_list: command arguments for each process die_on_failure: see :func:`wait_for_processes` """ for procargs in args_list: ...
def process_exception(self, request, exception): """ Return a redirect response for the :class:`~fluent_contents.extensions.HttpRedirectRequest` """ if isinstance(exception, HttpRedirectRequest): return HttpResponseRedirect(exception.url, status=exception.status) else...
def function[process_exception, parameter[self, request, exception]]: constant[ Return a redirect response for the :class:`~fluent_contents.extensions.HttpRedirectRequest` ] if call[name[isinstance], parameter[name[exception], name[HttpRedirectRequest]]] begin[:] return[call[name...
keyword[def] identifier[process_exception] ( identifier[self] , identifier[request] , identifier[exception] ): literal[string] keyword[if] identifier[isinstance] ( identifier[exception] , identifier[HttpRedirectRequest] ): keyword[return] identifier[HttpResponseRedirect] ( identifier...
def process_exception(self, request, exception): """ Return a redirect response for the :class:`~fluent_contents.extensions.HttpRedirectRequest` """ if isinstance(exception, HttpRedirectRequest): return HttpResponseRedirect(exception.url, status=exception.status) # depends on [control=[...
def popitem(self): """remove the next prioritized [key, val, priority] and return it""" pq = self.pq while pq: priority, key, val = heapq.heappop(pq) if val is None: self.removed_count -= 1 else: del self.item_finder[key] ...
def function[popitem, parameter[self]]: constant[remove the next prioritized [key, val, priority] and return it] variable[pq] assign[=] name[self].pq while name[pq] begin[:] <ast.Tuple object at 0x7da20c6e4ca0> assign[=] call[name[heapq].heappop, parameter[name[pq]]] ...
keyword[def] identifier[popitem] ( identifier[self] ): literal[string] identifier[pq] = identifier[self] . identifier[pq] keyword[while] identifier[pq] : identifier[priority] , identifier[key] , identifier[val] = identifier[heapq] . identifier[heappop] ( identifier[pq] ) ...
def popitem(self): """remove the next prioritized [key, val, priority] and return it""" pq = self.pq while pq: (priority, key, val) = heapq.heappop(pq) if val is None: self.removed_count -= 1 # depends on [control=['if'], data=[]] else: del self.item_finder[k...
def on_backward_begin(self, smooth_loss:Tensor, **kwargs:Any)->None: "Record the loss before any other callback has a chance to modify it." self.losses.append(smooth_loss) if self.pbar is not None and hasattr(self.pbar,'child'): self.pbar.child.comment = f'{smooth_loss:.4f}'
def function[on_backward_begin, parameter[self, smooth_loss]]: constant[Record the loss before any other callback has a chance to modify it.] call[name[self].losses.append, parameter[name[smooth_loss]]] if <ast.BoolOp object at 0x7da20e9b2a10> begin[:] name[self].pbar.child.comme...
keyword[def] identifier[on_backward_begin] ( identifier[self] , identifier[smooth_loss] : identifier[Tensor] ,** identifier[kwargs] : identifier[Any] )-> keyword[None] : literal[string] identifier[self] . identifier[losses] . identifier[append] ( identifier[smooth_loss] ) keyword[if] iden...
def on_backward_begin(self, smooth_loss: Tensor, **kwargs: Any) -> None: """Record the loss before any other callback has a chance to modify it.""" self.losses.append(smooth_loss) if self.pbar is not None and hasattr(self.pbar, 'child'): self.pbar.child.comment = f'{smooth_loss:.4f}' # depends on [...
def add_path(self, nodes, **attr): """In replacement for Deprecated add_path method""" if nx.__version__[0] == "1": return super().add_path(nodes, **attr) else: return nx.add_path(self, nodes, **attr)
def function[add_path, parameter[self, nodes]]: constant[In replacement for Deprecated add_path method] if compare[call[name[nx].__version__][constant[0]] equal[==] constant[1]] begin[:] return[call[call[name[super], parameter[]].add_path, parameter[name[nodes]]]]
keyword[def] identifier[add_path] ( identifier[self] , identifier[nodes] ,** identifier[attr] ): literal[string] keyword[if] identifier[nx] . identifier[__version__] [ literal[int] ]== literal[string] : keyword[return] identifier[super] (). identifier[add_path] ( identifier[nodes] ,*...
def add_path(self, nodes, **attr): """In replacement for Deprecated add_path method""" if nx.__version__[0] == '1': return super().add_path(nodes, **attr) # depends on [control=['if'], data=[]] else: return nx.add_path(self, nodes, **attr)
def make_final_message(version, error, codewords): """\ Constructs the final message (codewords incl. error correction). ISO/IEC 18004:2015(E) -- 7.6 Constructing the final message codeword sequence (page 45) :param int version: (Micro) QR Code version constant. :param int error: Error level const...
def function[make_final_message, parameter[version, error, codewords]]: constant[ Constructs the final message (codewords incl. error correction). ISO/IEC 18004:2015(E) -- 7.6 Constructing the final message codeword sequence (page 45) :param int version: (Micro) QR Code version constant. :param...
keyword[def] identifier[make_final_message] ( identifier[version] , identifier[error] , identifier[codewords] ): literal[string] identifier[ec_infos] = identifier[consts] . identifier[ECC] [ identifier[version] ][ identifier[error] ] identifier[last_cw_is_four] = identifier[version] keyword[in] ( ide...
def make_final_message(version, error, codewords): """ Constructs the final message (codewords incl. error correction). ISO/IEC 18004:2015(E) -- 7.6 Constructing the final message codeword sequence (page 45) :param int version: (Micro) QR Code version constant. :param int error: Error level constan...
def _split_file(self, data=''): """ Splits SAR output or SAR output file (in ASCII format) in order to extract info we need for it, in the format we want. :param data: Input data instead of file :type data: str. :return: ``List``-style of SAR file sections sep...
def function[_split_file, parameter[self, data]]: constant[ Splits SAR output or SAR output file (in ASCII format) in order to extract info we need for it, in the format we want. :param data: Input data instead of file :type data: str. :return: ``List``-style ...
keyword[def] identifier[_split_file] ( identifier[self] , identifier[data] = literal[string] ): literal[string] keyword[if] (( identifier[self] . identifier[__filename] keyword[and] identifier[os] . identifier[access] ( identifier[self] . identifier[__filename] , identifier[os] . identi...
def _split_file(self, data=''): """ Splits SAR output or SAR output file (in ASCII format) in order to extract info we need for it, in the format we want. :param data: Input data instead of file :type data: str. :return: ``List``-style of SAR file sections separat...
def search(self, index=None, body=None, params=None): """ Execute a search query and get back search hits that match the query. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html>`_ :arg index: A list of index names to search, or a string containing a ...
def function[search, parameter[self, index, body, params]]: constant[ Execute a search query and get back search hits that match the query. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html>`_ :arg index: A list of index names to search, or a string con...
keyword[def] identifier[search] ( identifier[self] , identifier[index] = keyword[None] , identifier[body] = keyword[None] , identifier[params] = keyword[None] ): literal[string] keyword[if] literal[string] keyword[in] identifier[params] : identifier[params] [ literal[string...
def search(self, index=None, body=None, params=None): """ Execute a search query and get back search hits that match the query. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html>`_ :arg index: A list of index names to search, or a string containing a ...
def execute(cmd, shell=False, poll_period=1.0, catch_out=False): """Execute UNIX command and wait for its completion Args: cmd (str or list): command to execute shell (bool): invoke inside shell environment catch_out (bool): collect process' output Returns: returncode (...
def function[execute, parameter[cmd, shell, poll_period, catch_out]]: constant[Execute UNIX command and wait for its completion Args: cmd (str or list): command to execute shell (bool): invoke inside shell environment catch_out (bool): collect process' output Returns: ...
keyword[def] identifier[execute] ( identifier[cmd] , identifier[shell] = keyword[False] , identifier[poll_period] = literal[int] , identifier[catch_out] = keyword[False] ): literal[string] identifier[log] = identifier[logging] . identifier[getLogger] ( identifier[__name__] ) identifier[log] . ide...
def execute(cmd, shell=False, poll_period=1.0, catch_out=False): """Execute UNIX command and wait for its completion Args: cmd (str or list): command to execute shell (bool): invoke inside shell environment catch_out (bool): collect process' output Returns: returncode (...
def _run(self): '''The actor's main work loop''' while self._is_running: yield from self._task() # Signal that the loop has finished. self._run_complete.set_result(True)
def function[_run, parameter[self]]: constant[The actor's main work loop] while name[self]._is_running begin[:] <ast.YieldFrom object at 0x7da1b0a9e2f0> call[name[self]._run_complete.set_result, parameter[constant[True]]]
keyword[def] identifier[_run] ( identifier[self] ): literal[string] keyword[while] identifier[self] . identifier[_is_running] : keyword[yield] keyword[from] identifier[self] . identifier[_task] () identifier[self] . identifier[_run_complete] . identifier[set_...
def _run(self): """The actor's main work loop""" while self._is_running: yield from self._task() # depends on [control=['while'], data=[]] # Signal that the loop has finished. self._run_complete.set_result(True)
def strip_rate(self, idx): """strip(1 byte) radiotap.datarate note that, unit of this field is originally 0.5 Mbps :idx: int :return: int idx :return: double rate in terms of Mbps """ val, = struct.unpack_from('<B', self._rtap, idx) ...
def function[strip_rate, parameter[self, idx]]: constant[strip(1 byte) radiotap.datarate note that, unit of this field is originally 0.5 Mbps :idx: int :return: int idx :return: double rate in terms of Mbps ] <ast.Tuple object at 0x7da1aff0...
keyword[def] identifier[strip_rate] ( identifier[self] , identifier[idx] ): literal[string] identifier[val] ,= identifier[struct] . identifier[unpack_from] ( literal[string] , identifier[self] . identifier[_rtap] , identifier[idx] ) identifier[rate_unit] = identifier[float] ( literal[int] ...
def strip_rate(self, idx): """strip(1 byte) radiotap.datarate note that, unit of this field is originally 0.5 Mbps :idx: int :return: int idx :return: double rate in terms of Mbps """ (val,) = struct.unpack_from('<B', self._rtap, idx) rate_unit...
def _get(self, ip): """ Get information about an IP. Args: ip (str): an IP (xxx.xxx.xxx.xxx). Returns: dict: see http://ipinfo.io/developers/getting-started """ # Geoloc updated up to once a week: # http://ipinfo.io/developers/data#geoloc...
def function[_get, parameter[self, ip]]: constant[ Get information about an IP. Args: ip (str): an IP (xxx.xxx.xxx.xxx). Returns: dict: see http://ipinfo.io/developers/getting-started ] variable[retries] assign[=] constant[10] for taget[n...
keyword[def] identifier[_get] ( identifier[self] , identifier[ip] ): literal[string] identifier[retries] = literal[int] keyword[for] identifier[retry] keyword[in] identifier[range] ( identifier[retries] ): keyword[try] : identifier[respon...
def _get(self, ip): """ Get information about an IP. Args: ip (str): an IP (xxx.xxx.xxx.xxx). Returns: dict: see http://ipinfo.io/developers/getting-started """ # Geoloc updated up to once a week: # http://ipinfo.io/developers/data#geolocation-data ...
def append_note(self, player, text): """Append text to an already existing note.""" note = self._find_note(player) note.text += text
def function[append_note, parameter[self, player, text]]: constant[Append text to an already existing note.] variable[note] assign[=] call[name[self]._find_note, parameter[name[player]]] <ast.AugAssign object at 0x7da1b15f01f0>
keyword[def] identifier[append_note] ( identifier[self] , identifier[player] , identifier[text] ): literal[string] identifier[note] = identifier[self] . identifier[_find_note] ( identifier[player] ) identifier[note] . identifier[text] += identifier[text]
def append_note(self, player, text): """Append text to an already existing note.""" note = self._find_note(player) note.text += text
def switch(stage): """ Switch to given stage (dev/qa/production) + pull """ stage = stage.lower() local("git pull") if stage in ['dev', 'devel', 'develop']: branch_name = 'develop' elif stage in ['qa', 'release']: branches = local('git branch -r', capture=True) po...
def function[switch, parameter[stage]]: constant[ Switch to given stage (dev/qa/production) + pull ] variable[stage] assign[=] call[name[stage].lower, parameter[]] call[name[local], parameter[constant[git pull]]] if compare[name[stage] in list[[<ast.Constant object at 0x7da20...
keyword[def] identifier[switch] ( identifier[stage] ): literal[string] identifier[stage] = identifier[stage] . identifier[lower] () identifier[local] ( literal[string] ) keyword[if] identifier[stage] keyword[in] [ literal[string] , literal[string] , literal[string] ]: identifier[branch...
def switch(stage): """ Switch to given stage (dev/qa/production) + pull """ stage = stage.lower() local('git pull') if stage in ['dev', 'devel', 'develop']: branch_name = 'develop' # depends on [control=['if'], data=[]] elif stage in ['qa', 'release']: branches = local('...
def kde_statsmodels_u(data, grid, **kwargs): """ Univariate Kernel Density Estimation with Statsmodels Parameters ---------- data : numpy.array Data points used to compute a density estimator. It has `n x 1` dimensions, representing n points and p variables. grid : numpy...
def function[kde_statsmodels_u, parameter[data, grid]]: constant[ Univariate Kernel Density Estimation with Statsmodels Parameters ---------- data : numpy.array Data points used to compute a density estimator. It has `n x 1` dimensions, representing n points and p variab...
keyword[def] identifier[kde_statsmodels_u] ( identifier[data] , identifier[grid] ,** identifier[kwargs] ): literal[string] identifier[kde] = identifier[KDEUnivariate] ( identifier[data] ) identifier[kde] . identifier[fit] (** identifier[kwargs] ) keyword[return] identifier[kde] . identifier[eval...
def kde_statsmodels_u(data, grid, **kwargs): """ Univariate Kernel Density Estimation with Statsmodels Parameters ---------- data : numpy.array Data points used to compute a density estimator. It has `n x 1` dimensions, representing n points and p variables. grid : numpy...
def add_time(data): """And a friendly update time to the supplied data. Arguments: data (:py:class:`dict`): The response data and its update time. Returns: :py:class:`dict`: The data with a friendly update time. """ payload = data['data'] updated = data['updated'].date() if up...
def function[add_time, parameter[data]]: constant[And a friendly update time to the supplied data. Arguments: data (:py:class:`dict`): The response data and its update time. Returns: :py:class:`dict`: The data with a friendly update time. ] variable[payload] assign[=] call[nam...
keyword[def] identifier[add_time] ( identifier[data] ): literal[string] identifier[payload] = identifier[data] [ literal[string] ] identifier[updated] = identifier[data] [ literal[string] ]. identifier[date] () keyword[if] identifier[updated] == identifier[date] . identifier[today] (): ...
def add_time(data): """And a friendly update time to the supplied data. Arguments: data (:py:class:`dict`): The response data and its update time. Returns: :py:class:`dict`: The data with a friendly update time. """ payload = data['data'] updated = data['updated'].date() if up...
def process_master(m): '''process packets from the MAVLink master''' try: s = m.recv(16*1024) except Exception: time.sleep(0.1) return # prevent a dead serial port from causing the CPU to spin. The user hitting enter will # cause it to try and reconnect if len(s) == 0: ...
def function[process_master, parameter[m]]: constant[process packets from the MAVLink master] <ast.Try object at 0x7da2041da8c0> if compare[call[name[len], parameter[name[s]]] equal[==] constant[0]] begin[:] call[name[time].sleep, parameter[constant[0.1]]] return[None] ...
keyword[def] identifier[process_master] ( identifier[m] ): literal[string] keyword[try] : identifier[s] = identifier[m] . identifier[recv] ( literal[int] * literal[int] ) keyword[except] identifier[Exception] : identifier[time] . identifier[sleep] ( literal[int] ) keyword[r...
def process_master(m): """process packets from the MAVLink master""" try: s = m.recv(16 * 1024) # depends on [control=['try'], data=[]] except Exception: time.sleep(0.1) return # depends on [control=['except'], data=[]] # prevent a dead serial port from causing the CPU to spin....
def cli(ctx, feature_id, organism="", sequence=""): """Set the feature to read through the first encountered stop codon Output: A standard apollo feature dictionary ({"features": [{...}]}) """ return ctx.gi.annotations.set_readthrough_stop_codon(feature_id, organism=organism, sequence=sequence)
def function[cli, parameter[ctx, feature_id, organism, sequence]]: constant[Set the feature to read through the first encountered stop codon Output: A standard apollo feature dictionary ({"features": [{...}]}) ] return[call[name[ctx].gi.annotations.set_readthrough_stop_codon, parameter[name[featur...
keyword[def] identifier[cli] ( identifier[ctx] , identifier[feature_id] , identifier[organism] = literal[string] , identifier[sequence] = literal[string] ): literal[string] keyword[return] identifier[ctx] . identifier[gi] . identifier[annotations] . identifier[set_readthrough_stop_codon] ( identifier[feat...
def cli(ctx, feature_id, organism='', sequence=''): """Set the feature to read through the first encountered stop codon Output: A standard apollo feature dictionary ({"features": [{...}]}) """ return ctx.gi.annotations.set_readthrough_stop_codon(feature_id, organism=organism, sequence=sequence)
def prepare(args): """ %prog prepare countfolder families Parse list of count files and group per family into families folder. """ p = OptionParser(prepare.__doc__) opts, args = p.parse_args(args) if len(args) != 2: sys.exit(not p.print_help()) counts, families = args coun...
def function[prepare, parameter[args]]: constant[ %prog prepare countfolder families Parse list of count files and group per family into families folder. ] variable[p] assign[=] call[name[OptionParser], parameter[name[prepare].__doc__]] <ast.Tuple object at 0x7da2054a4670> assign[=]...
keyword[def] identifier[prepare] ( identifier[args] ): literal[string] identifier[p] = identifier[OptionParser] ( identifier[prepare] . identifier[__doc__] ) identifier[opts] , identifier[args] = identifier[p] . identifier[parse_args] ( identifier[args] ) keyword[if] identifier[len] ( identifie...
def prepare(args): """ %prog prepare countfolder families Parse list of count files and group per family into families folder. """ p = OptionParser(prepare.__doc__) (opts, args) = p.parse_args(args) if len(args) != 2: sys.exit(not p.print_help()) # depends on [control=['if'], data=...
def _validate_partition_boundary(boundary): ''' Ensure valid partition boundaries are supplied. ''' boundary = six.text_type(boundary) match = re.search(r'^([\d.]+)(\D*)$', boundary) if match: unit = match.group(2) if not unit or unit in VALID_UNITS: return raise ...
def function[_validate_partition_boundary, parameter[boundary]]: constant[ Ensure valid partition boundaries are supplied. ] variable[boundary] assign[=] call[name[six].text_type, parameter[name[boundary]]] variable[match] assign[=] call[name[re].search, parameter[constant[^([\d.]+)(\D*)...
keyword[def] identifier[_validate_partition_boundary] ( identifier[boundary] ): literal[string] identifier[boundary] = identifier[six] . identifier[text_type] ( identifier[boundary] ) identifier[match] = identifier[re] . identifier[search] ( literal[string] , identifier[boundary] ) keyword[if] i...
def _validate_partition_boundary(boundary): """ Ensure valid partition boundaries are supplied. """ boundary = six.text_type(boundary) match = re.search('^([\\d.]+)(\\D*)$', boundary) if match: unit = match.group(2) if not unit or unit in VALID_UNITS: return # depend...
def from_dict(d): """ Re-create the Specs from a dictionary representation. :param Dict[str, Any] d: The dictionary representation. :return: The restored Specs. :rtype: Specs """ return Specs( qubits_specs=sorted([QubitSpecs(id=int(q), ...
def function[from_dict, parameter[d]]: constant[ Re-create the Specs from a dictionary representation. :param Dict[str, Any] d: The dictionary representation. :return: The restored Specs. :rtype: Specs ] return[call[name[Specs], parameter[]]]
keyword[def] identifier[from_dict] ( identifier[d] ): literal[string] keyword[return] identifier[Specs] ( identifier[qubits_specs] = identifier[sorted] ([ identifier[QubitSpecs] ( identifier[id] = identifier[int] ( identifier[q] ), identifier[fRO] = identifier[qspecs] . identifie...
def from_dict(d): """ Re-create the Specs from a dictionary representation. :param Dict[str, Any] d: The dictionary representation. :return: The restored Specs. :rtype: Specs """ return Specs(qubits_specs=sorted([QubitSpecs(id=int(q), fRO=qspecs.get('fRO'), f1QRB=qspecs....
def steady_connection(self): """Get a steady, unpooled PostgreSQL connection.""" return SteadyPgConnection(self._maxusage, self._setsession, True, *self._args, **self._kwargs)
def function[steady_connection, parameter[self]]: constant[Get a steady, unpooled PostgreSQL connection.] return[call[name[SteadyPgConnection], parameter[name[self]._maxusage, name[self]._setsession, constant[True], <ast.Starred object at 0x7da207f034f0>]]]
keyword[def] identifier[steady_connection] ( identifier[self] ): literal[string] keyword[return] identifier[SteadyPgConnection] ( identifier[self] . identifier[_maxusage] , identifier[self] . identifier[_setsession] , keyword[True] , * identifier[self] . identifier[_args] ,** identifier[se...
def steady_connection(self): """Get a steady, unpooled PostgreSQL connection.""" return SteadyPgConnection(self._maxusage, self._setsession, True, *self._args, **self._kwargs)
def address(self, s): """ Parse an address, any of p2pkh, p2sh, p2pkh_segwit, or p2sh_segwit. Return a :class:`Contract <Contract>`, or None. """ s = parseable_str(s) return self.p2pkh(s) or self.p2sh(s) or self.p2pkh_segwit(s) or self.p2sh_segwit(s)
def function[address, parameter[self, s]]: constant[ Parse an address, any of p2pkh, p2sh, p2pkh_segwit, or p2sh_segwit. Return a :class:`Contract <Contract>`, or None. ] variable[s] assign[=] call[name[parseable_str], parameter[name[s]]] return[<ast.BoolOp object at 0x7da1b1...
keyword[def] identifier[address] ( identifier[self] , identifier[s] ): literal[string] identifier[s] = identifier[parseable_str] ( identifier[s] ) keyword[return] identifier[self] . identifier[p2pkh] ( identifier[s] ) keyword[or] identifier[self] . identifier[p2sh] ( identifier[s] ) keyw...
def address(self, s): """ Parse an address, any of p2pkh, p2sh, p2pkh_segwit, or p2sh_segwit. Return a :class:`Contract <Contract>`, or None. """ s = parseable_str(s) return self.p2pkh(s) or self.p2sh(s) or self.p2pkh_segwit(s) or self.p2sh_segwit(s)
def to_text(self, name=None, origin=None, relativize=True, override_rdclass=None, **kw): """Convert the rdataset into DNS master file format. @see: L{dns.name.Name.choose_relativity} for more information on how I{origin} and I{relativize} determine the way names are emit...
def function[to_text, parameter[self, name, origin, relativize, override_rdclass]]: constant[Convert the rdataset into DNS master file format. @see: L{dns.name.Name.choose_relativity} for more information on how I{origin} and I{relativize} determine the way names are emitted. A...
keyword[def] identifier[to_text] ( identifier[self] , identifier[name] = keyword[None] , identifier[origin] = keyword[None] , identifier[relativize] = keyword[True] , identifier[override_rdclass] = keyword[None] ,** identifier[kw] ): literal[string] keyword[if] keyword[not] identifier[name] key...
def to_text(self, name=None, origin=None, relativize=True, override_rdclass=None, **kw): """Convert the rdataset into DNS master file format. @see: L{dns.name.Name.choose_relativity} for more information on how I{origin} and I{relativize} determine the way names are emitted. Any ad...
def write_relative_abundance(rel_abd, biomf, out_fn, sort_by=None): """ Given a BIOM table, calculate per-sample relative abundance for each OTU and write out to a tab-separated file listing OTUs as rows and Samples as columns. :type biom: biom object :param biom: BIOM-formatted OTU/Sample abund...
def function[write_relative_abundance, parameter[rel_abd, biomf, out_fn, sort_by]]: constant[ Given a BIOM table, calculate per-sample relative abundance for each OTU and write out to a tab-separated file listing OTUs as rows and Samples as columns. :type biom: biom object :param biom: BIOM-...
keyword[def] identifier[write_relative_abundance] ( identifier[rel_abd] , identifier[biomf] , identifier[out_fn] , identifier[sort_by] = keyword[None] ): literal[string] keyword[with] identifier[open] ( identifier[out_fn] , literal[string] ) keyword[as] identifier[out_f] : identifier[sids] = ide...
def write_relative_abundance(rel_abd, biomf, out_fn, sort_by=None): """ Given a BIOM table, calculate per-sample relative abundance for each OTU and write out to a tab-separated file listing OTUs as rows and Samples as columns. :type biom: biom object :param biom: BIOM-formatted OTU/Sample abund...
def decrease_posts_count_after_post_unaproval(sender, instance, **kwargs): """ Decreases the member's post count after a post unaproval. This receiver handles the unaproval of a forum post: the posts count associated with the post's author is decreased. """ if not instance.pk: # Do not cons...
def function[decrease_posts_count_after_post_unaproval, parameter[sender, instance]]: constant[ Decreases the member's post count after a post unaproval. This receiver handles the unaproval of a forum post: the posts count associated with the post's author is decreased. ] if <ast.UnaryOp ob...
keyword[def] identifier[decrease_posts_count_after_post_unaproval] ( identifier[sender] , identifier[instance] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[instance] . identifier[pk] : keyword[return] identifier[profile] , identifier[dummy] = identifi...
def decrease_posts_count_after_post_unaproval(sender, instance, **kwargs): """ Decreases the member's post count after a post unaproval. This receiver handles the unaproval of a forum post: the posts count associated with the post's author is decreased. """ if not instance.pk: # Do not cons...
def from_edgerc(rcinput, section='default'): """Returns an EdgeGridAuth object from the configuration from the given section of the given edgerc file. :param filename: path to the edgerc file :param section: the section to use (this is the [bracketed] part of the edgerc, ...
def function[from_edgerc, parameter[rcinput, section]]: constant[Returns an EdgeGridAuth object from the configuration from the given section of the given edgerc file. :param filename: path to the edgerc file :param section: the section to use (this is the [bracketed] part of the ed...
keyword[def] identifier[from_edgerc] ( identifier[rcinput] , identifier[section] = literal[string] ): literal[string] keyword[from] . identifier[edgerc] keyword[import] identifier[EdgeRc] keyword[if] identifier[isinstance] ( identifier[rcinput] , identifier[EdgeRc] ): iden...
def from_edgerc(rcinput, section='default'): """Returns an EdgeGridAuth object from the configuration from the given section of the given edgerc file. :param filename: path to the edgerc file :param section: the section to use (this is the [bracketed] part of the edgerc, de...
def _parse_req(requnit, reqval): ''' Parse a non-day fixed value ''' assert reqval[0] != '=' try: retn = [] for val in reqval.split(','): if requnit == 'month': if reqval[0].isdigit(): retn.append(int(reqval)) ...
def function[_parse_req, parameter[requnit, reqval]]: constant[ Parse a non-day fixed value ] assert[compare[call[name[reqval]][constant[0]] not_equal[!=] constant[=]]] <ast.Try object at 0x7da1b23ee6e0> if <ast.UnaryOp object at 0x7da18eb57e20> begin[:] return[constant[None]] return...
keyword[def] identifier[_parse_req] ( identifier[requnit] , identifier[reqval] ): literal[string] keyword[assert] identifier[reqval] [ literal[int] ]!= literal[string] keyword[try] : identifier[retn] =[] keyword[for] identifier[val] keyword[in] identifier[re...
def _parse_req(requnit, reqval): """ Parse a non-day fixed value """ assert reqval[0] != '=' try: retn = [] for val in reqval.split(','): if requnit == 'month': if reqval[0].isdigit(): retn.append(int(reqval)) # must be a month (1-12) # depen...
def comment(request, template="generic/comments.html", extra_context=None): """ Handle a ``ThreadedCommentForm`` submission and redirect back to its related object. """ response = initial_validation(request, "comment") if isinstance(response, HttpResponse): return response obj, post_...
def function[comment, parameter[request, template, extra_context]]: constant[ Handle a ``ThreadedCommentForm`` submission and redirect back to its related object. ] variable[response] assign[=] call[name[initial_validation], parameter[name[request], constant[comment]]] if call[name[i...
keyword[def] identifier[comment] ( identifier[request] , identifier[template] = literal[string] , identifier[extra_context] = keyword[None] ): literal[string] identifier[response] = identifier[initial_validation] ( identifier[request] , literal[string] ) keyword[if] identifier[isinstance] ( identifie...
def comment(request, template='generic/comments.html', extra_context=None): """ Handle a ``ThreadedCommentForm`` submission and redirect back to its related object. """ response = initial_validation(request, 'comment') if isinstance(response, HttpResponse): return response # depends on ...
def path_requests(self, path): """ Returns a Resource instace that will have attributes, one for each of the http-methods supported on that path. For example: >>> hcl_api = client.path_requests('/api/hcl/{id}') >>> dir(hcl_api) [u'delete', u'get', u'put'] ...
def function[path_requests, parameter[self, path]]: constant[ Returns a Resource instace that will have attributes, one for each of the http-methods supported on that path. For example: >>> hcl_api = client.path_requests('/api/hcl/{id}') >>> dir(hcl_api) [u'...
keyword[def] identifier[path_requests] ( identifier[self] , identifier[path] ): literal[string] identifier[path_spec] = identifier[self] . identifier[client] . identifier[origin_spec] [ literal[string] ]. identifier[get] ( identifier[path] ) keyword[if] keyword[not] identifier[path_spec]...
def path_requests(self, path): """ Returns a Resource instace that will have attributes, one for each of the http-methods supported on that path. For example: >>> hcl_api = client.path_requests('/api/hcl/{id}') >>> dir(hcl_api) [u'delete', u'get', u'put'] ...
def open(self): """Open the files """ segments = [] files = config.get('env', 'jpl', fallback=[]) if not files: raise JplConfigError("No JPL file defined") # Extraction of segments from each .bsp file for filepath in files: filepath = P...
def function[open, parameter[self]]: constant[Open the files ] variable[segments] assign[=] list[[]] variable[files] assign[=] call[name[config].get, parameter[constant[env], constant[jpl]]] if <ast.UnaryOp object at 0x7da18eb55480> begin[:] <ast.Raise object at 0x7da18eb...
keyword[def] identifier[open] ( identifier[self] ): literal[string] identifier[segments] =[] identifier[files] = identifier[config] . identifier[get] ( literal[string] , literal[string] , identifier[fallback] =[]) keyword[if] keyword[not] identifier[files] : keywo...
def open(self): """Open the files """ segments = [] files = config.get('env', 'jpl', fallback=[]) if not files: raise JplConfigError('No JPL file defined') # depends on [control=['if'], data=[]] # Extraction of segments from each .bsp file for filepath in files: filepath...
def copy_to(name, source, dest, exec_driver=None, overwrite=False, makedirs=False): ''' Copy a file from the host into a container name Container name source File to be copied to the container. Can be a local path on the Minio...
def function[copy_to, parameter[name, source, dest, exec_driver, overwrite, makedirs]]: constant[ Copy a file from the host into a container name Container name source File to be copied to the container. Can be a local path on the Minion or a remote file from the Salt files...
keyword[def] identifier[copy_to] ( identifier[name] , identifier[source] , identifier[dest] , identifier[exec_driver] = keyword[None] , identifier[overwrite] = keyword[False] , identifier[makedirs] = keyword[False] ): literal[string] keyword[if] identifier[exec_driver] keyword[is] keyword[None] : ...
def copy_to(name, source, dest, exec_driver=None, overwrite=False, makedirs=False): """ Copy a file from the host into a container name Container name source File to be copied to the container. Can be a local path on the Minion or a remote file from the Salt fileserver. de...
def make_hashcode(uri, payload, headers): """Generate a SHA1 based on the given arguments. Hashcodes created by this method will used as unique identifiers for the raw items or resources stored by this archive. :param uri: URI to the resource :param payload: payload of the requ...
def function[make_hashcode, parameter[uri, payload, headers]]: constant[Generate a SHA1 based on the given arguments. Hashcodes created by this method will used as unique identifiers for the raw items or resources stored by this archive. :param uri: URI to the resource :param p...
keyword[def] identifier[make_hashcode] ( identifier[uri] , identifier[payload] , identifier[headers] ): literal[string] keyword[def] identifier[dict_to_json_str] ( identifier[data] ): keyword[return] identifier[json] . identifier[dumps] ( identifier[data] , identifier[sort_keys] = ke...
def make_hashcode(uri, payload, headers): """Generate a SHA1 based on the given arguments. Hashcodes created by this method will used as unique identifiers for the raw items or resources stored by this archive. :param uri: URI to the resource :param payload: payload of the request ...
def create(item_data, item_id, observation_data = None, user_id = None, target = None, weights = 'auto', similarity_metrics = 'auto', item_data_transform = 'auto', max_item_neighborhood_size = 64, verbose=True): """Create a content-based recommender...
def function[create, parameter[item_data, item_id, observation_data, user_id, target, weights, similarity_metrics, item_data_transform, max_item_neighborhood_size, verbose]]: constant[Create a content-based recommender model in which the similarity between the items recommended is determined by the content ...
keyword[def] identifier[create] ( identifier[item_data] , identifier[item_id] , identifier[observation_data] = keyword[None] , identifier[user_id] = keyword[None] , identifier[target] = keyword[None] , identifier[weights] = literal[string] , identifier[similarity_metrics] = literal[string] , identifier[item_data...
def create(item_data, item_id, observation_data=None, user_id=None, target=None, weights='auto', similarity_metrics='auto', item_data_transform='auto', max_item_neighborhood_size=64, verbose=True): """Create a content-based recommender model in which the similarity between the items recommended is determined by...
def build_preauth_str(preauth_key, account_name, timestamp, expires, admin=False): """ Builds the preauth string and hmac it, following the zimbra spec. Spec and examples are here http://wiki.zimbra.com/wiki/Preauth """ if admin: s = '{0}|1|name|{1}|{2}'.format(account_nam...
def function[build_preauth_str, parameter[preauth_key, account_name, timestamp, expires, admin]]: constant[ Builds the preauth string and hmac it, following the zimbra spec. Spec and examples are here http://wiki.zimbra.com/wiki/Preauth ] if name[admin] begin[:] variable[s] assi...
keyword[def] identifier[build_preauth_str] ( identifier[preauth_key] , identifier[account_name] , identifier[timestamp] , identifier[expires] , identifier[admin] = keyword[False] ): literal[string] keyword[if] identifier[admin] : identifier[s] = literal[string] . identifier[format] ( identifier[...
def build_preauth_str(preauth_key, account_name, timestamp, expires, admin=False): """ Builds the preauth string and hmac it, following the zimbra spec. Spec and examples are here http://wiki.zimbra.com/wiki/Preauth """ if admin: s = '{0}|1|name|{1}|{2}'.format(account_name, expires, timestamp)...
def _put_model(D, name, dat, m): """ Place the model data given, into the location (m) given. :param dict D: Metadata (dataset) :param str name: Model name (ex: chron0model0) :param dict dat: Model data :param regex m: Model name regex groups :return dict D: Metadata (dataset) """ t...
def function[_put_model, parameter[D, name, dat, m]]: constant[ Place the model data given, into the location (m) given. :param dict D: Metadata (dataset) :param str name: Model name (ex: chron0model0) :param dict dat: Model data :param regex m: Model name regex groups :return dict D: M...
keyword[def] identifier[_put_model] ( identifier[D] , identifier[name] , identifier[dat] , identifier[m] ): literal[string] keyword[try] : identifier[_pc] = identifier[m] . identifier[group] ( literal[int] )+ literal[string] identifier[_section] = identifier[m] . identifier[group] (...
def _put_model(D, name, dat, m): """ Place the model data given, into the location (m) given. :param dict D: Metadata (dataset) :param str name: Model name (ex: chron0model0) :param dict dat: Model data :param regex m: Model name regex groups :return dict D: Metadata (dataset) """ t...
def get_stream_formats(self, media_item): """Get the available media formats for a given media item @param crunchyroll.models.Media @return dict """ scraper = ScraperApi(self._ajax_api._connector) formats = scraper.get_media_formats(media_item.media_id) return fo...
def function[get_stream_formats, parameter[self, media_item]]: constant[Get the available media formats for a given media item @param crunchyroll.models.Media @return dict ] variable[scraper] assign[=] call[name[ScraperApi], parameter[name[self]._ajax_api._connector]] va...
keyword[def] identifier[get_stream_formats] ( identifier[self] , identifier[media_item] ): literal[string] identifier[scraper] = identifier[ScraperApi] ( identifier[self] . identifier[_ajax_api] . identifier[_connector] ) identifier[formats] = identifier[scraper] . identifier[get_media_for...
def get_stream_formats(self, media_item): """Get the available media formats for a given media item @param crunchyroll.models.Media @return dict """ scraper = ScraperApi(self._ajax_api._connector) formats = scraper.get_media_formats(media_item.media_id) return formats
def write(self, data): """ write data on the OUT endpoint associated to the HID interface """ for _ in range(64 - len(data)): data.append(0) #logging.debug("send: %s", data) self.device.write(bytearray([0]) + data) return
def function[write, parameter[self, data]]: constant[ write data on the OUT endpoint associated to the HID interface ] for taget[name[_]] in starred[call[name[range], parameter[binary_operation[constant[64] - call[name[len], parameter[name[data]]]]]]] begin[:] call[name[d...
keyword[def] identifier[write] ( identifier[self] , identifier[data] ): literal[string] keyword[for] identifier[_] keyword[in] identifier[range] ( literal[int] - identifier[len] ( identifier[data] )): identifier[data] . identifier[append] ( literal[int] ) ident...
def write(self, data): """ write data on the OUT endpoint associated to the HID interface """ for _ in range(64 - len(data)): data.append(0) # depends on [control=['for'], data=[]] #logging.debug("send: %s", data) self.device.write(bytearray([0]) + data) return
def get_branches(self): """ :calls: `GET /repos/:owner/:repo/branches <http://developer.github.com/v3/repos>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Branch.Branch` """ return github.PaginatedList.PaginatedList( github.Branch.Branch, ...
def function[get_branches, parameter[self]]: constant[ :calls: `GET /repos/:owner/:repo/branches <http://developer.github.com/v3/repos>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Branch.Branch` ] return[call[name[github].PaginatedList.PaginatedList, param...
keyword[def] identifier[get_branches] ( identifier[self] ): literal[string] keyword[return] identifier[github] . identifier[PaginatedList] . identifier[PaginatedList] ( identifier[github] . identifier[Branch] . identifier[Branch] , identifier[self] . identifier[_requester] , ...
def get_branches(self): """ :calls: `GET /repos/:owner/:repo/branches <http://developer.github.com/v3/repos>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Branch.Branch` """ return github.PaginatedList.PaginatedList(github.Branch.Branch, self._requester, self.ur...
def _download_response(self): """Returns a response body string from the server.""" if self.network.limit_rate: self.network._delay_call() data = [] for name in self.params.keys(): data.append("=".join((name, url_quote_plus(_string(self.params[name]))))) ...
def function[_download_response, parameter[self]]: constant[Returns a response body string from the server.] if name[self].network.limit_rate begin[:] call[name[self].network._delay_call, parameter[]] variable[data] assign[=] list[[]] for taget[name[name]] in starred[call...
keyword[def] identifier[_download_response] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[network] . identifier[limit_rate] : identifier[self] . identifier[network] . identifier[_delay_call] () identifier[data] =[] keyword[for] id...
def _download_response(self): """Returns a response body string from the server.""" if self.network.limit_rate: self.network._delay_call() # depends on [control=['if'], data=[]] data = [] for name in self.params.keys(): data.append('='.join((name, url_quote_plus(_string(self.params[name...
def find_n_pc(u, factor=0.5): """Find number of principal components This method finds the minimum number of principal components required Parameters ---------- u : np.ndarray Left singular vector of the original data factor : float, optional Factor for testing the auto correla...
def function[find_n_pc, parameter[u, factor]]: constant[Find number of principal components This method finds the minimum number of principal components required Parameters ---------- u : np.ndarray Left singular vector of the original data factor : float, optional Factor f...
keyword[def] identifier[find_n_pc] ( identifier[u] , identifier[factor] = literal[int] ): literal[string] keyword[if] identifier[np] . identifier[sqrt] ( identifier[u] . identifier[shape] [ literal[int] ])% literal[int] : keyword[raise] identifier[ValueError] ( literal[string] literal...
def find_n_pc(u, factor=0.5): """Find number of principal components This method finds the minimum number of principal components required Parameters ---------- u : np.ndarray Left singular vector of the original data factor : float, optional Factor for testing the auto correla...
def select_files_by_ifo_combination(ifocomb, insps): """ This function selects single-detector files ('insps') for a given ifo combination """ inspcomb = FileList() for ifo, ifile in zip(*insps.categorize_by_attr('ifo')): if ifo in ifocomb: inspcomb += ifile return inspcomb
def function[select_files_by_ifo_combination, parameter[ifocomb, insps]]: constant[ This function selects single-detector files ('insps') for a given ifo combination ] variable[inspcomb] assign[=] call[name[FileList], parameter[]] for taget[tuple[[<ast.Name object at 0x7da2041daef0>, <as...
keyword[def] identifier[select_files_by_ifo_combination] ( identifier[ifocomb] , identifier[insps] ): literal[string] identifier[inspcomb] = identifier[FileList] () keyword[for] identifier[ifo] , identifier[ifile] keyword[in] identifier[zip] (* identifier[insps] . identifier[categorize_by_attr] ( l...
def select_files_by_ifo_combination(ifocomb, insps): """ This function selects single-detector files ('insps') for a given ifo combination """ inspcomb = FileList() for (ifo, ifile) in zip(*insps.categorize_by_attr('ifo')): if ifo in ifocomb: inspcomb += ifile # depends on [cont...
def glr_path_static(): """Returns path to packaged static files""" return os.path.abspath(os.path.join(os.path.dirname(__file__), '_static'))
def function[glr_path_static, parameter[]]: constant[Returns path to packaged static files] return[call[name[os].path.abspath, parameter[call[name[os].path.join, parameter[call[name[os].path.dirname, parameter[name[__file__]]], constant[_static]]]]]]
keyword[def] identifier[glr_path_static] (): literal[string] keyword[return] identifier[os] . identifier[path] . identifier[abspath] ( identifier[os] . identifier[path] . identifier[join] ( identifier[os] . identifier[path] . identifier[dirname] ( identifier[__file__] ), literal[string] ))
def glr_path_static(): """Returns path to packaged static files""" return os.path.abspath(os.path.join(os.path.dirname(__file__), '_static'))
def get(self, interface_id, interface_ip=None): """ Get will return a list of interface references based on the specified interface id. Multiple references can be returned if a single interface has multiple IP addresses assigned. :return: If interface_ip is provided, a s...
def function[get, parameter[self, interface_id, interface_ip]]: constant[ Get will return a list of interface references based on the specified interface id. Multiple references can be returned if a single interface has multiple IP addresses assigned. :return: If interfa...
keyword[def] identifier[get] ( identifier[self] , identifier[interface_id] , identifier[interface_ip] = keyword[None] ): literal[string] identifier[interfaces] =[] keyword[for] identifier[interface] keyword[in] identifier[iter] ( identifier[self] ): keyword[if] identifier[...
def get(self, interface_id, interface_ip=None): """ Get will return a list of interface references based on the specified interface id. Multiple references can be returned if a single interface has multiple IP addresses assigned. :return: If interface_ip is provided, a singl...
def _normalize(number): """Normalizes a string of characters representing a phone number. This performs the following conversions: - Punctuation is stripped. - For ALPHA/VANITY numbers: - Letters are converted to their numeric representation on a telephone keypad. The keypad used he...
def function[_normalize, parameter[number]]: constant[Normalizes a string of characters representing a phone number. This performs the following conversions: - Punctuation is stripped. - For ALPHA/VANITY numbers: - Letters are converted to their numeric representation on a telephone ...
keyword[def] identifier[_normalize] ( identifier[number] ): literal[string] identifier[m] = identifier[fullmatch] ( identifier[_VALID_ALPHA_PHONE_PATTERN] , identifier[number] ) keyword[if] identifier[m] : keyword[return] identifier[_normalize_helper] ( identifier[number] , identifier[_ALPH...
def _normalize(number): """Normalizes a string of characters representing a phone number. This performs the following conversions: - Punctuation is stripped. - For ALPHA/VANITY numbers: - Letters are converted to their numeric representation on a telephone keypad. The keypad used he...
def random_walk_normal_fn(scale=1., name=None): """Returns a callable that adds a random normal perturbation to the input. This function returns a callable that accepts a Python `list` of `Tensor`s of any shapes and `dtypes` representing the state parts of the `current_state` and a random seed. The supplied a...
def function[random_walk_normal_fn, parameter[scale, name]]: constant[Returns a callable that adds a random normal perturbation to the input. This function returns a callable that accepts a Python `list` of `Tensor`s of any shapes and `dtypes` representing the state parts of the `current_state` and a ra...
keyword[def] identifier[random_walk_normal_fn] ( identifier[scale] = literal[int] , identifier[name] = keyword[None] ): literal[string] keyword[def] identifier[_fn] ( identifier[state_parts] , identifier[seed] ): literal[string] keyword[with] identifier[tf] . identifier[compat] . identifier[v1] . ...
def random_walk_normal_fn(scale=1.0, name=None): """Returns a callable that adds a random normal perturbation to the input. This function returns a callable that accepts a Python `list` of `Tensor`s of any shapes and `dtypes` representing the state parts of the `current_state` and a random seed. The supplie...
def post_helper(form_tag=True, edit_mode=False): """ Post's form layout helper """ helper = FormHelper() helper.form_action = '.' helper.attrs = {'data_abide': ''} helper.form_tag = form_tag fieldsets = [ Row( Column( 'text', css_c...
def function[post_helper, parameter[form_tag, edit_mode]]: constant[ Post's form layout helper ] variable[helper] assign[=] call[name[FormHelper], parameter[]] name[helper].form_action assign[=] constant[.] name[helper].attrs assign[=] dictionary[[<ast.Constant object at 0x7da1b1...
keyword[def] identifier[post_helper] ( identifier[form_tag] = keyword[True] , identifier[edit_mode] = keyword[False] ): literal[string] identifier[helper] = identifier[FormHelper] () identifier[helper] . identifier[form_action] = literal[string] identifier[helper] . identifier[attrs] ={ literal[...
def post_helper(form_tag=True, edit_mode=False): """ Post's form layout helper """ helper = FormHelper() helper.form_action = '.' helper.attrs = {'data_abide': ''} helper.form_tag = form_tag fieldsets = [Row(Column('text', css_class='small-12'))] # Threadwatch option is not in edit f...
def has_perm(self, perm, obj, check_groups=True, approved=True): """ Check if user has the permission for the given object """ if self.user: if self.has_user_perms(perm, obj, approved, check_groups): return True if self.group: return self.h...
def function[has_perm, parameter[self, perm, obj, check_groups, approved]]: constant[ Check if user has the permission for the given object ] if name[self].user begin[:] if call[name[self].has_user_perms, parameter[name[perm], name[obj], name[approved], name[check_groups]...
keyword[def] identifier[has_perm] ( identifier[self] , identifier[perm] , identifier[obj] , identifier[check_groups] = keyword[True] , identifier[approved] = keyword[True] ): literal[string] keyword[if] identifier[self] . identifier[user] : keyword[if] identifier[self] . identifier[h...
def has_perm(self, perm, obj, check_groups=True, approved=True): """ Check if user has the permission for the given object """ if self.user: if self.has_user_perms(perm, obj, approved, check_groups): return True # depends on [control=['if'], data=[]] # depends on [control=[...
def gammatone(freq, bandwidth): """ ``Slaney, M. "An Efficient Implementation of the Patterson-Holdsworth Auditory Filter Bank", Apple Computer Technical Report #35, 1993.`` """ A = exp(-bandwidth) cosw = cos(freq) sinw = sin(freq) sig = [1., -1.] coeff = [cosw + s1 * (sqrt(2) + s2) * sinw for s1 ...
def function[gammatone, parameter[freq, bandwidth]]: constant[ ``Slaney, M. "An Efficient Implementation of the Patterson-Holdsworth Auditory Filter Bank", Apple Computer Technical Report #35, 1993.`` ] variable[A] assign[=] call[name[exp], parameter[<ast.UnaryOp object at 0x7da1b074fee0>]] ...
keyword[def] identifier[gammatone] ( identifier[freq] , identifier[bandwidth] ): literal[string] identifier[A] = identifier[exp] (- identifier[bandwidth] ) identifier[cosw] = identifier[cos] ( identifier[freq] ) identifier[sinw] = identifier[sin] ( identifier[freq] ) identifier[sig] =[ literal[int] ,-...
def gammatone(freq, bandwidth): """ ``Slaney, M. "An Efficient Implementation of the Patterson-Holdsworth Auditory Filter Bank", Apple Computer Technical Report #35, 1993.`` """ A = exp(-bandwidth) cosw = cos(freq) sinw = sin(freq) sig = [1.0, -1.0] coeff = [cosw + s1 * (sqrt(2) + s2) ...
def show_phase_matrix(sync_output_dynamic, grid_width = None, grid_height = None, iteration = None): """! @brief Shows 2D matrix of phase values of oscillators at the specified iteration. @details User should ensure correct matrix sizes in line with following expression grid_width x grid_heig...
def function[show_phase_matrix, parameter[sync_output_dynamic, grid_width, grid_height, iteration]]: constant[! @brief Shows 2D matrix of phase values of oscillators at the specified iteration. @details User should ensure correct matrix sizes in line with following expression grid_width x grid_h...
keyword[def] identifier[show_phase_matrix] ( identifier[sync_output_dynamic] , identifier[grid_width] = keyword[None] , identifier[grid_height] = keyword[None] , identifier[iteration] = keyword[None] ): literal[string] identifier[_] = identifier[plt] . identifier[figure] (); identifie...
def show_phase_matrix(sync_output_dynamic, grid_width=None, grid_height=None, iteration=None): """! @brief Shows 2D matrix of phase values of oscillators at the specified iteration. @details User should ensure correct matrix sizes in line with following expression grid_width x grid_height that shoul...
def add_formatted_field(cls, field, format_string, title=''): """Adds a ``list_display`` attribute showing a field in the object using a python %formatted string. :param field: Name of the field in the object. :param format_string: A old-style (to remain python ...
def function[add_formatted_field, parameter[cls, field, format_string, title]]: constant[Adds a ``list_display`` attribute showing a field in the object using a python %formatted string. :param field: Name of the field in the object. :param format_string: A old-...
keyword[def] identifier[add_formatted_field] ( identifier[cls] , identifier[field] , identifier[format_string] , identifier[title] = literal[string] ): literal[string] keyword[global] identifier[klass_count] identifier[klass_count] += literal[int] identifier[fn_name] = literal[...
def add_formatted_field(cls, field, format_string, title=''): """Adds a ``list_display`` attribute showing a field in the object using a python %formatted string. :param field: Name of the field in the object. :param format_string: A old-style (to remain python 2.x ...
def get_public_keys_der_v3(self): """ Return a list of DER coded X.509 public keys from the v3 signature block """ if self._v3_signing_data == None: self.parse_v3_signing_block() public_keys = [] for signer in self._v3_signing_data: public_keys....
def function[get_public_keys_der_v3, parameter[self]]: constant[ Return a list of DER coded X.509 public keys from the v3 signature block ] if compare[name[self]._v3_signing_data equal[==] constant[None]] begin[:] call[name[self].parse_v3_signing_block, parameter[]] ...
keyword[def] identifier[get_public_keys_der_v3] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_v3_signing_data] == keyword[None] : identifier[self] . identifier[parse_v3_signing_block] () identifier[public_keys] =[] keyword[for] ...
def get_public_keys_der_v3(self): """ Return a list of DER coded X.509 public keys from the v3 signature block """ if self._v3_signing_data == None: self.parse_v3_signing_block() # depends on [control=['if'], data=[]] public_keys = [] for signer in self._v3_signing_data: ...
def update_ostree_summary(self, release): """Update the ostree summary file and return a path to it""" self.log.info('Updating the ostree summary for %s', release['name']) self.mock_chroot(release, release['ostree_summary']) return os.path.join(release['output_dir'], 'summary')
def function[update_ostree_summary, parameter[self, release]]: constant[Update the ostree summary file and return a path to it] call[name[self].log.info, parameter[constant[Updating the ostree summary for %s], call[name[release]][constant[name]]]] call[name[self].mock_chroot, parameter[name[rele...
keyword[def] identifier[update_ostree_summary] ( identifier[self] , identifier[release] ): literal[string] identifier[self] . identifier[log] . identifier[info] ( literal[string] , identifier[release] [ literal[string] ]) identifier[self] . identifier[mock_chroot] ( identifier[release] , i...
def update_ostree_summary(self, release): """Update the ostree summary file and return a path to it""" self.log.info('Updating the ostree summary for %s', release['name']) self.mock_chroot(release, release['ostree_summary']) return os.path.join(release['output_dir'], 'summary')
def infer_namespaces(ac): """infer possible namespaces of given accession based on syntax Always returns a list, possibly empty >>> infer_namespaces("ENST00000530893.6") ['ensembl'] >>> infer_namespaces("ENST00000530893") ['ensembl'] >>> infer_namespaces("ENSQ00000530893") [] >>> in...
def function[infer_namespaces, parameter[ac]]: constant[infer possible namespaces of given accession based on syntax Always returns a list, possibly empty >>> infer_namespaces("ENST00000530893.6") ['ensembl'] >>> infer_namespaces("ENST00000530893") ['ensembl'] >>> infer_namespaces("ENSQ...
keyword[def] identifier[infer_namespaces] ( identifier[ac] ): literal[string] keyword[return] [ identifier[v] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[ac_namespace_regexps] . identifier[items] () keyword[if] identifier[k] . identifier[match] ( identifier[ac] )]
def infer_namespaces(ac): """infer possible namespaces of given accession based on syntax Always returns a list, possibly empty >>> infer_namespaces("ENST00000530893.6") ['ensembl'] >>> infer_namespaces("ENST00000530893") ['ensembl'] >>> infer_namespaces("ENSQ00000530893") [] >>> in...
def _interpolate_cube(self, lon, lat, egy=None, interp_log=True): """Perform interpolation on a healpix cube. If egy is None then interpolation will be performed on the existing energy planes. """ shape = np.broadcast(lon, lat, egy).shape lon = lon * np.ones(shape) ...
def function[_interpolate_cube, parameter[self, lon, lat, egy, interp_log]]: constant[Perform interpolation on a healpix cube. If egy is None then interpolation will be performed on the existing energy planes. ] variable[shape] assign[=] call[name[np].broadcast, parameter[name[...
keyword[def] identifier[_interpolate_cube] ( identifier[self] , identifier[lon] , identifier[lat] , identifier[egy] = keyword[None] , identifier[interp_log] = keyword[True] ): literal[string] identifier[shape] = identifier[np] . identifier[broadcast] ( identifier[lon] , identifier[lat] , identifie...
def _interpolate_cube(self, lon, lat, egy=None, interp_log=True): """Perform interpolation on a healpix cube. If egy is None then interpolation will be performed on the existing energy planes. """ shape = np.broadcast(lon, lat, egy).shape lon = lon * np.ones(shape) lat = lat * ...
def _left_zero_blocks(self, r): """Number of blocks with zeros from the left in block row `r`.""" if not self._include_off_diagonal: return r elif not self._upper: return 0 elif self._include_diagonal: return r else: return r + 1
def function[_left_zero_blocks, parameter[self, r]]: constant[Number of blocks with zeros from the left in block row `r`.] if <ast.UnaryOp object at 0x7da1b1caf370> begin[:] return[name[r]]
keyword[def] identifier[_left_zero_blocks] ( identifier[self] , identifier[r] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_include_off_diagonal] : keyword[return] identifier[r] keyword[elif] keyword[not] identifier[self] . identifier[_upper] : keyword[...
def _left_zero_blocks(self, r): """Number of blocks with zeros from the left in block row `r`.""" if not self._include_off_diagonal: return r # depends on [control=['if'], data=[]] elif not self._upper: return 0 # depends on [control=['if'], data=[]] elif self._include_diagonal: ...
def configurations(self): """Configurations from uwsgiconf module.""" if self._confs is not None: return self._confs with output_capturing(): module = self.load(self.fpath) confs = getattr(module, CONFIGS_MODULE_ATTR) confs = listify(confs) ...
def function[configurations, parameter[self]]: constant[Configurations from uwsgiconf module.] if compare[name[self]._confs is_not constant[None]] begin[:] return[name[self]._confs] with call[name[output_capturing], parameter[]] begin[:] variable[module] assign[=] call[na...
keyword[def] identifier[configurations] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_confs] keyword[is] keyword[not] keyword[None] : keyword[return] identifier[self] . identifier[_confs] keyword[with] identifier[output_capturing] ()...
def configurations(self): """Configurations from uwsgiconf module.""" if self._confs is not None: return self._confs # depends on [control=['if'], data=[]] with output_capturing(): module = self.load(self.fpath) confs = getattr(module, CONFIGS_MODULE_ATTR) confs = listify(co...
def register_mark(key=None): """Returns a decorator registering a mark class in the mark type registry. If no key is provided, the class name is used as a key. A key is provided for each core bqplot mark so that the frontend can use this key regardless of the kernel language. """ def wrap(mark)...
def function[register_mark, parameter[key]]: constant[Returns a decorator registering a mark class in the mark type registry. If no key is provided, the class name is used as a key. A key is provided for each core bqplot mark so that the frontend can use this key regardless of the kernel language. ...
keyword[def] identifier[register_mark] ( identifier[key] = keyword[None] ): literal[string] keyword[def] identifier[wrap] ( identifier[mark] ): identifier[name] = identifier[key] keyword[if] identifier[key] keyword[is] keyword[not] keyword[None] keyword[else] identifier[mark] . identifier[...
def register_mark(key=None): """Returns a decorator registering a mark class in the mark type registry. If no key is provided, the class name is used as a key. A key is provided for each core bqplot mark so that the frontend can use this key regardless of the kernel language. """ def wrap(mark...
def survival_rate(work_db): """Calcuate the survival rate for the results in a WorkDB. """ kills = sum(r.is_killed for _, r in work_db.results) num_results = work_db.num_results if not num_results: return 0 return (1 - kills / num_results) * 100
def function[survival_rate, parameter[work_db]]: constant[Calcuate the survival rate for the results in a WorkDB. ] variable[kills] assign[=] call[name[sum], parameter[<ast.GeneratorExp object at 0x7da1b078b1c0>]] variable[num_results] assign[=] name[work_db].num_results if <ast.Unar...
keyword[def] identifier[survival_rate] ( identifier[work_db] ): literal[string] identifier[kills] = identifier[sum] ( identifier[r] . identifier[is_killed] keyword[for] identifier[_] , identifier[r] keyword[in] identifier[work_db] . identifier[results] ) identifier[num_results] = identifier[work_d...
def survival_rate(work_db): """Calcuate the survival rate for the results in a WorkDB. """ kills = sum((r.is_killed for (_, r) in work_db.results)) num_results = work_db.num_results if not num_results: return 0 # depends on [control=['if'], data=[]] return (1 - kills / num_results) * 10...