code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def render_applicationNavigation(self, ctx, data): """ For authenticated users, add primary application navigation to the given tag. For unauthenticated users, remove the given tag from the output. @see L{xmantissa.webnav.applicationNavigation} """ if self.usern...
def function[render_applicationNavigation, parameter[self, ctx, data]]: constant[ For authenticated users, add primary application navigation to the given tag. For unauthenticated users, remove the given tag from the output. @see L{xmantissa.webnav.applicationNavigation} ...
keyword[def] identifier[render_applicationNavigation] ( identifier[self] , identifier[ctx] , identifier[data] ): literal[string] keyword[if] identifier[self] . identifier[username] keyword[is] keyword[None] : keyword[return] literal[string] identifier[translator] = identi...
def render_applicationNavigation(self, ctx, data): """ For authenticated users, add primary application navigation to the given tag. For unauthenticated users, remove the given tag from the output. @see L{xmantissa.webnav.applicationNavigation} """ if self.username is N...
def register_module(module=None): """ Registers given module or caller introspected module in the candidates modules for tracing. :param module: Module to register. :type module: ModuleType :return: Definition success. :rtype: bool """ global REGISTERED_MODULES if module is None: ...
def function[register_module, parameter[module]]: constant[ Registers given module or caller introspected module in the candidates modules for tracing. :param module: Module to register. :type module: ModuleType :return: Definition success. :rtype: bool ] <ast.Global object at 0x7da...
keyword[def] identifier[register_module] ( identifier[module] = keyword[None] ): literal[string] keyword[global] identifier[REGISTERED_MODULES] keyword[if] identifier[module] keyword[is] keyword[None] : identifier[module] = identifier[sys] . identifier[modules] . identifier[get] (...
def register_module(module=None): """ Registers given module or caller introspected module in the candidates modules for tracing. :param module: Module to register. :type module: ModuleType :return: Definition success. :rtype: bool """ global REGISTERED_MODULES if module is None: ...
def make_table(headers, lines, prefix=None): """ Generates an ASCII table according to the given headers and lines :param headers: List of table headers (N-tuple) :param lines: List of table lines (N-tuples) :param prefix: Optional prefix for each line :return: The ASCII...
def function[make_table, parameter[headers, lines, prefix]]: constant[ Generates an ASCII table according to the given headers and lines :param headers: List of table headers (N-tuple) :param lines: List of table lines (N-tuples) :param prefix: Optional prefix for each line ...
keyword[def] identifier[make_table] ( identifier[headers] , identifier[lines] , identifier[prefix] = keyword[None] ): literal[string] identifier[prefix] = identifier[str] ( identifier[prefix] keyword[or] literal[string] ) identifier[lengths] =[ identifier[len] ( identi...
def make_table(headers, lines, prefix=None): """ Generates an ASCII table according to the given headers and lines :param headers: List of table headers (N-tuple) :param lines: List of table lines (N-tuples) :param prefix: Optional prefix for each line :return: The ASCII rep...
def get_equivalents(term_id: str) -> List[Mapping[str, Union[str, bool]]]: """Get equivalents given ns:id Args: term_id (str): term id Returns: List[Mapping[str, Union[str, bool]]]: e.g. [{'term_id': 'HGNC:5', 'namespace': 'HGNC'}, 'primary': False] """ try: errors = [] ...
def function[get_equivalents, parameter[term_id]]: constant[Get equivalents given ns:id Args: term_id (str): term id Returns: List[Mapping[str, Union[str, bool]]]: e.g. [{'term_id': 'HGNC:5', 'namespace': 'HGNC'}, 'primary': False] ] <ast.Try object at 0x7da1b19cd330>
keyword[def] identifier[get_equivalents] ( identifier[term_id] : identifier[str] )-> identifier[List] [ identifier[Mapping] [ identifier[str] , identifier[Union] [ identifier[str] , identifier[bool] ]]]: literal[string] keyword[try] : identifier[errors] =[] identifier[terms] = identifier[...
def get_equivalents(term_id: str) -> List[Mapping[str, Union[str, bool]]]: """Get equivalents given ns:id Args: term_id (str): term id Returns: List[Mapping[str, Union[str, bool]]]: e.g. [{'term_id': 'HGNC:5', 'namespace': 'HGNC'}, 'primary': False] """ try: errors = [] ...
def dropdb(): """Drop database tables""" manager.db.engine.echo = True if prompt_bool("Are you sure you want to lose all your data"): manager.db.drop_all() metadata, alembic_version = alembic_table_metadata() alembic_version.drop() manager.db.session.commit()
def function[dropdb, parameter[]]: constant[Drop database tables] name[manager].db.engine.echo assign[=] constant[True] if call[name[prompt_bool], parameter[constant[Are you sure you want to lose all your data]]] begin[:] call[name[manager].db.drop_all, parameter[]] ...
keyword[def] identifier[dropdb] (): literal[string] identifier[manager] . identifier[db] . identifier[engine] . identifier[echo] = keyword[True] keyword[if] identifier[prompt_bool] ( literal[string] ): identifier[manager] . identifier[db] . identifier[drop_all] () identifier[metada...
def dropdb(): """Drop database tables""" manager.db.engine.echo = True if prompt_bool('Are you sure you want to lose all your data'): manager.db.drop_all() (metadata, alembic_version) = alembic_table_metadata() alembic_version.drop() manager.db.session.commit() # depends on ...
def code(ctx, show_hidden, query, single): """ Generate codes. Generate codes from credentials stored on your YubiKey. Provide a query string to match one or more specific credentials. Touch and HOTP credentials require a single match to be triggered. """ ensure_validated(ctx) control...
def function[code, parameter[ctx, show_hidden, query, single]]: constant[ Generate codes. Generate codes from credentials stored on your YubiKey. Provide a query string to match one or more specific credentials. Touch and HOTP credentials require a single match to be triggered. ] ca...
keyword[def] identifier[code] ( identifier[ctx] , identifier[show_hidden] , identifier[query] , identifier[single] ): literal[string] identifier[ensure_validated] ( identifier[ctx] ) identifier[controller] = identifier[ctx] . identifier[obj] [ literal[string] ] identifier[creds] =[( identifier[...
def code(ctx, show_hidden, query, single): """ Generate codes. Generate codes from credentials stored on your YubiKey. Provide a query string to match one or more specific credentials. Touch and HOTP credentials require a single match to be triggered. """ ensure_validated(ctx) controlle...
def hook_point(self, hook_name): """Generic function to call modules methods if such method is avalaible :param hook_name: function name to call :type hook_name: str :return:None """ self.my_daemon.hook_point(hook_name=hook_name, handle=self)
def function[hook_point, parameter[self, hook_name]]: constant[Generic function to call modules methods if such method is avalaible :param hook_name: function name to call :type hook_name: str :return:None ] call[name[self].my_daemon.hook_point, parameter[]]
keyword[def] identifier[hook_point] ( identifier[self] , identifier[hook_name] ): literal[string] identifier[self] . identifier[my_daemon] . identifier[hook_point] ( identifier[hook_name] = identifier[hook_name] , identifier[handle] = identifier[self] )
def hook_point(self, hook_name): """Generic function to call modules methods if such method is avalaible :param hook_name: function name to call :type hook_name: str :return:None """ self.my_daemon.hook_point(hook_name=hook_name, handle=self)
def delete(self): """Delete this file""" if not self.remote: if not os.path.exists(self.projectpath + self.basedir + '/' + self.filename): return False else: os.unlink(self.projectpath + self.basedir + '/' + self.filename) #Remove meta...
def function[delete, parameter[self]]: constant[Delete this file] if <ast.UnaryOp object at 0x7da18dc06a40> begin[:] if <ast.UnaryOp object at 0x7da18dc05e70> begin[:] return[constant[False]] variable[metafile] assign[=] binary_operation[binary_operation[binar...
keyword[def] identifier[delete] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[remote] : keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[exists] ( identifier[self] . identifier[projectpath] + identifier[self] . i...
def delete(self): """Delete this file""" if not self.remote: if not os.path.exists(self.projectpath + self.basedir + '/' + self.filename): return False # depends on [control=['if'], data=[]] else: os.unlink(self.projectpath + self.basedir + '/' + self.filename) #...
def consume_token(self, tokens, index, tokens_len): """Consume a token. Returns a tuple of (tokens, tokens_len, index) when consumption is completed and tokens have been merged together. """ finished = False if tokens[index].line > self.line: finished = True...
def function[consume_token, parameter[self, tokens, index, tokens_len]]: constant[Consume a token. Returns a tuple of (tokens, tokens_len, index) when consumption is completed and tokens have been merged together. ] variable[finished] assign[=] constant[False] if compare...
keyword[def] identifier[consume_token] ( identifier[self] , identifier[tokens] , identifier[index] , identifier[tokens_len] ): literal[string] identifier[finished] = keyword[False] keyword[if] identifier[tokens] [ identifier[index] ]. identifier[line] > identifier[self] . identifier[lin...
def consume_token(self, tokens, index, tokens_len): """Consume a token. Returns a tuple of (tokens, tokens_len, index) when consumption is completed and tokens have been merged together. """ finished = False if tokens[index].line > self.line: finished = True end = in...
def delete_index(self, attr): """Deletes an index from the Table. Can be used to drop and rebuild an index, or to convert a non-unique index to a unique index, or vice versa. @param attr: name of an indexed attribute @type attr: string """ if attr in self._index...
def function[delete_index, parameter[self, attr]]: constant[Deletes an index from the Table. Can be used to drop and rebuild an index, or to convert a non-unique index to a unique index, or vice versa. @param attr: name of an indexed attribute @type attr: string ] ...
keyword[def] identifier[delete_index] ( identifier[self] , identifier[attr] ): literal[string] keyword[if] identifier[attr] keyword[in] identifier[self] . identifier[_indexes] : keyword[del] identifier[self] . identifier[_indexes] [ identifier[attr] ] identifier[self] ...
def delete_index(self, attr): """Deletes an index from the Table. Can be used to drop and rebuild an index, or to convert a non-unique index to a unique index, or vice versa. @param attr: name of an indexed attribute @type attr: string """ if attr in self._indexes: ...
def page_elements(self): """Find multiple PageElement using element locator :returns: list of page element objects :rtype: list of toolium.pageelements.PageElement """ if not self._page_elements or not self.config.getboolean_optional('Driver', 'save_web_element'): se...
def function[page_elements, parameter[self]]: constant[Find multiple PageElement using element locator :returns: list of page element objects :rtype: list of toolium.pageelements.PageElement ] if <ast.BoolOp object at 0x7da1b1d4e7a0> begin[:] name[self]._page_ele...
keyword[def] identifier[page_elements] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_page_elements] keyword[or] keyword[not] identifier[self] . identifier[config] . identifier[getboolean_optional] ( literal[string] , literal[string] ): ...
def page_elements(self): """Find multiple PageElement using element locator :returns: list of page element objects :rtype: list of toolium.pageelements.PageElement """ if not self._page_elements or not self.config.getboolean_optional('Driver', 'save_web_element'): self._page_ele...
def add_user(self, name, password=None, read_only=None, **kwargs): """Create user `name` with password `password`. Add a new user with permissions for this :class:`Database`. .. note:: Will change the password if user `name` already exists. :Parameters: - `name`: the name of...
def function[add_user, parameter[self, name, password, read_only]]: constant[Create user `name` with password `password`. Add a new user with permissions for this :class:`Database`. .. note:: Will change the password if user `name` already exists. :Parameters: - `name`: the ...
keyword[def] identifier[add_user] ( identifier[self] , identifier[name] , identifier[password] = keyword[None] , identifier[read_only] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[name] , identifier[string_type] ): ...
def add_user(self, name, password=None, read_only=None, **kwargs): """Create user `name` with password `password`. Add a new user with permissions for this :class:`Database`. .. note:: Will change the password if user `name` already exists. :Parameters: - `name`: the name of the...
def update_stampfile_hook(self, dependencies): # suppress(no-self-use) """Loop over all dependencies and store hash for each of them.""" hashes = {d: _sha1_for_file(d) for d in dependencies if os.path.exists(d)} with open(self._stamp_file_hashes_path, "wb") as hashes_file: ...
def function[update_stampfile_hook, parameter[self, dependencies]]: constant[Loop over all dependencies and store hash for each of them.] variable[hashes] assign[=] <ast.DictComp object at 0x7da2054a50f0> with call[name[open], parameter[name[self]._stamp_file_hashes_path, constant[wb]]] begin[:]...
keyword[def] identifier[update_stampfile_hook] ( identifier[self] , identifier[dependencies] ): literal[string] identifier[hashes] ={ identifier[d] : identifier[_sha1_for_file] ( identifier[d] ) keyword[for] identifier[d] keyword[in] identifier[dependencies] keyword[if] identifier[os]...
def update_stampfile_hook(self, dependencies): # suppress(no-self-use) 'Loop over all dependencies and store hash for each of them.' hashes = {d: _sha1_for_file(d) for d in dependencies if os.path.exists(d)} with open(self._stamp_file_hashes_path, 'wb') as hashes_file: hashes_file.write(json.dumps(...
def nguHanhNapAm(diaChi, thienCan, xuatBanMenh=False): """Sử dụng Ngũ Hành nạp âm để tính Hành của năm. Args: diaChi (integer): Số thứ tự của địa chi (Tý=1, Sửu=2,...) thienCan (integer): Số thứ tự của thiên can (Giáp=1, Ất=2,...) Returns: Trả về chữ viết tắt Hành của năm (K, T, H,...
def function[nguHanhNapAm, parameter[diaChi, thienCan, xuatBanMenh]]: constant[Sử dụng Ngũ Hành nạp âm để tính Hành của năm. Args: diaChi (integer): Số thứ tự của địa chi (Tý=1, Sửu=2,...) thienCan (integer): Số thứ tự của thiên can (Giáp=1, Ất=2,...) Returns: Trả về chữ viết t...
keyword[def] identifier[nguHanhNapAm] ( identifier[diaChi] , identifier[thienCan] , identifier[xuatBanMenh] = keyword[False] ): literal[string] identifier[banMenh] ={ literal[string] : literal[string] , literal[string] : literal[string] , literal[string] : literal[string] , literal[stri...
def nguHanhNapAm(diaChi, thienCan, xuatBanMenh=False): """Sử dụng Ngũ Hành nạp âm để tính Hành của năm. Args: diaChi (integer): Số thứ tự của địa chi (Tý=1, Sửu=2,...) thienCan (integer): Số thứ tự của thiên can (Giáp=1, Ất=2,...) Returns: Trả về chữ viết tắt Hành của năm (K, T, H,...
def set_default(self, name, value): """Changes the default value of the named flag object. The flag's current value is also updated if the flag is currently using the default value, i.e. not specified in the command line, and not set by FLAGS.name = value. Args: name: str, the name of the fl...
def function[set_default, parameter[self, name, value]]: constant[Changes the default value of the named flag object. The flag's current value is also updated if the flag is currently using the default value, i.e. not specified in the command line, and not set by FLAGS.name = value. Args: ...
keyword[def] identifier[set_default] ( identifier[self] , identifier[name] , identifier[value] ): literal[string] identifier[fl] = identifier[self] . identifier[_flags] () keyword[if] identifier[name] keyword[not] keyword[in] identifier[fl] : identifier[self] . identifier[_set_unknown_flag]...
def set_default(self, name, value): """Changes the default value of the named flag object. The flag's current value is also updated if the flag is currently using the default value, i.e. not specified in the command line, and not set by FLAGS.name = value. Args: name: str, the name of the fl...
def get_product_value(self, value_name, wanted_type=None): ''' For the product section of the registry return the name value. Args: value_name (str): Registry value name. wanted_type (str): The type of value wanted if the type does not match ...
def function[get_product_value, parameter[self, value_name, wanted_type]]: constant[ For the product section of the registry return the name value. Args: value_name (str): Registry value name. wanted_type (str): The type of value wanted if the type does n...
keyword[def] identifier[get_product_value] ( identifier[self] , identifier[value_name] , identifier[wanted_type] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[__reg_products_handle] : keyword[return] keyword[None] identifier[subk...
def get_product_value(self, value_name, wanted_type=None): """ For the product section of the registry return the name value. Args: value_name (str): Registry value name. wanted_type (str): The type of value wanted if the type does not match N...
def bar(*args, **kwargs): """ Creates a bar plot, with white outlines and a fill color that defaults to the first teal-ish green in ColorBrewer's Set2. Optionally accepts grid='y' or grid='x' to draw a white grid over the bars, to show the scale. Almost like "erasing" some of the plot, but i...
def function[bar, parameter[]]: constant[ Creates a bar plot, with white outlines and a fill color that defaults to the first teal-ish green in ColorBrewer's Set2. Optionally accepts grid='y' or grid='x' to draw a white grid over the bars, to show the scale. Almost like "erasing" some of the ...
keyword[def] identifier[bar] (* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[ax] , identifier[args] , identifier[kwargs] = identifier[maybe_get_ax] (* identifier[args] ,** identifier[kwargs] ) identifier[kwargs] . identifier[setdefault] ( literal[string] , identifier[set2] [ l...
def bar(*args, **kwargs): """ Creates a bar plot, with white outlines and a fill color that defaults to the first teal-ish green in ColorBrewer's Set2. Optionally accepts grid='y' or grid='x' to draw a white grid over the bars, to show the scale. Almost like "erasing" some of the plot, but i...
def count_SMS(self, conditions={}): """ Count all certified sms """ url = self.SMS_COUNT_URL + "?" for key, value in conditions.items(): if key is 'ids': value = ",".join(value) url += '&%s=%s' % (key, value) connection = Connect...
def function[count_SMS, parameter[self, conditions]]: constant[ Count all certified sms ] variable[url] assign[=] binary_operation[name[self].SMS_COUNT_URL + constant[?]] for taget[tuple[[<ast.Name object at 0x7da1b1152590>, <ast.Name object at 0x7da1b11508b0>]]] in starred[call[...
keyword[def] identifier[count_SMS] ( identifier[self] , identifier[conditions] ={}): literal[string] identifier[url] = identifier[self] . identifier[SMS_COUNT_URL] + literal[string] keyword[for] identifier[key] , identifier[value] keyword[in] identifier[conditions] . identifier[items]...
def count_SMS(self, conditions={}): """ Count all certified sms """ url = self.SMS_COUNT_URL + '?' for (key, value) in conditions.items(): if key is 'ids': value = ','.join(value) # depends on [control=['if'], data=[]] url += '&%s=%s' % (key, value) # depends on...
def search(self, filters=None, start_index=0, limit=100): """ Search for a list of notes that can be invested in. (similar to searching for notes in the Browse section on the site) Parameters ---------- filters : lendingclub.filters.*, optional The filter to ...
def function[search, parameter[self, filters, start_index, limit]]: constant[ Search for a list of notes that can be invested in. (similar to searching for notes in the Browse section on the site) Parameters ---------- filters : lendingclub.filters.*, optional ...
keyword[def] identifier[search] ( identifier[self] , identifier[filters] = keyword[None] , identifier[start_index] = literal[int] , identifier[limit] = literal[int] ): literal[string] keyword[assert] identifier[filters] keyword[is] keyword[None] keyword[or] identifier[isinstance] ( identifier[...
def search(self, filters=None, start_index=0, limit=100): """ Search for a list of notes that can be invested in. (similar to searching for notes in the Browse section on the site) Parameters ---------- filters : lendingclub.filters.*, optional The filter to use ...
def create_license_helper(self, lic): """ Handle single(no conjunction/disjunction) licenses. Return the created node. """ if isinstance(lic, document.ExtractedLicense): return self.create_extracted_license(lic) if lic.identifier.rstrip('+') in config.LICENSE_...
def function[create_license_helper, parameter[self, lic]]: constant[ Handle single(no conjunction/disjunction) licenses. Return the created node. ] if call[name[isinstance], parameter[name[lic], name[document].ExtractedLicense]] begin[:] return[call[name[self].create_extr...
keyword[def] identifier[create_license_helper] ( identifier[self] , identifier[lic] ): literal[string] keyword[if] identifier[isinstance] ( identifier[lic] , identifier[document] . identifier[ExtractedLicense] ): keyword[return] identifier[self] . identifier[create_extracted_license]...
def create_license_helper(self, lic): """ Handle single(no conjunction/disjunction) licenses. Return the created node. """ if isinstance(lic, document.ExtractedLicense): return self.create_extracted_license(lic) # depends on [control=['if'], data=[]] if lic.identifier.rstrip...
def read_graph_from_string(txt): """Read a graph from a string, either in dot format, or our own compressed format. Returns: `pygraph.digraph`: Graph object. """ if not txt.startswith('{'): return read_dot(txt) # standard dot format def conv(value): if isinstance(value...
def function[read_graph_from_string, parameter[txt]]: constant[Read a graph from a string, either in dot format, or our own compressed format. Returns: `pygraph.digraph`: Graph object. ] if <ast.UnaryOp object at 0x7da18f8112a0> begin[:] return[call[name[read_dot], parameter...
keyword[def] identifier[read_graph_from_string] ( identifier[txt] ): literal[string] keyword[if] keyword[not] identifier[txt] . identifier[startswith] ( literal[string] ): keyword[return] identifier[read_dot] ( identifier[txt] ) keyword[def] identifier[conv] ( identifier[value] ): ...
def read_graph_from_string(txt): """Read a graph from a string, either in dot format, or our own compressed format. Returns: `pygraph.digraph`: Graph object. """ if not txt.startswith('{'): return read_dot(txt) # standard dot format # depends on [control=['if'], data=[]] def ...
def configure_inline_support(shell, backend, user_ns=None): """Configure an IPython shell object for matplotlib use. Parameters ---------- shell : InteractiveShell instance backend : matplotlib backend user_ns : dict A namespace where all configured variables will be placed. If not giv...
def function[configure_inline_support, parameter[shell, backend, user_ns]]: constant[Configure an IPython shell object for matplotlib use. Parameters ---------- shell : InteractiveShell instance backend : matplotlib backend user_ns : dict A namespace where all configured variables w...
keyword[def] identifier[configure_inline_support] ( identifier[shell] , identifier[backend] , identifier[user_ns] = keyword[None] ): literal[string] keyword[try] : keyword[from] identifier[IPython] . identifier[zmq] . identifier[pylab] . identifier[backend_inline] ...
def configure_inline_support(shell, backend, user_ns=None): """Configure an IPython shell object for matplotlib use. Parameters ---------- shell : InteractiveShell instance backend : matplotlib backend user_ns : dict A namespace where all configured variables will be placed. If not giv...
def format_back( number: FormatArg, light: Optional[bool] = False, extended: Optional[bool] = False) -> str: """ Return an escape code for a back color, by number. This is a convenience method for handling the different code types all in one shot. It also handles some...
def function[format_back, parameter[number, light, extended]]: constant[ Return an escape code for a back color, by number. This is a convenience method for handling the different code types all in one shot. It also handles some validation. ] return[call[name[_format_code], param...
keyword[def] identifier[format_back] ( identifier[number] : identifier[FormatArg] , identifier[light] : identifier[Optional] [ identifier[bool] ]= keyword[False] , identifier[extended] : identifier[Optional] [ identifier[bool] ]= keyword[False] )-> identifier[str] : literal[string] keyword[return] iden...
def format_back(number: FormatArg, light: Optional[bool]=False, extended: Optional[bool]=False) -> str: """ Return an escape code for a back color, by number. This is a convenience method for handling the different code types all in one shot. It also handles some validation. """ retu...
def roundrobin(*iterables): "roundrobin('ABC', 'D', 'EF') --> A D E B F C" # Recipe credited to George Sakkis pending = len(iterables) nexts = itertools.cycle(iter(it).next for it in iterables) while pending: try: for next in nexts: yield next() except Sto...
def function[roundrobin, parameter[]]: constant[roundrobin('ABC', 'D', 'EF') --> A D E B F C] variable[pending] assign[=] call[name[len], parameter[name[iterables]]] variable[nexts] assign[=] call[name[itertools].cycle, parameter[<ast.GeneratorExp object at 0x7da1b2842290>]] while name[p...
keyword[def] identifier[roundrobin] (* identifier[iterables] ): literal[string] identifier[pending] = identifier[len] ( identifier[iterables] ) identifier[nexts] = identifier[itertools] . identifier[cycle] ( identifier[iter] ( identifier[it] ). identifier[next] keyword[for] identifier[it] keyw...
def roundrobin(*iterables): """roundrobin('ABC', 'D', 'EF') --> A D E B F C""" # Recipe credited to George Sakkis pending = len(iterables) nexts = itertools.cycle((iter(it).next for it in iterables)) while pending: try: for next in nexts: yield next() # depends o...
def _handle_sigint(self, signum: int, frame: Any) -> None: """Shutdown after processing current task.""" logger.warning("Catched SIGINT") self.shutdown()
def function[_handle_sigint, parameter[self, signum, frame]]: constant[Shutdown after processing current task.] call[name[logger].warning, parameter[constant[Catched SIGINT]]] call[name[self].shutdown, parameter[]]
keyword[def] identifier[_handle_sigint] ( identifier[self] , identifier[signum] : identifier[int] , identifier[frame] : identifier[Any] )-> keyword[None] : literal[string] identifier[logger] . identifier[warning] ( literal[string] ) identifier[self] . identifier[shutdown] ()
def _handle_sigint(self, signum: int, frame: Any) -> None: """Shutdown after processing current task.""" logger.warning('Catched SIGINT') self.shutdown()
def _encode_multipart(**kw): ' build a multipart/form-data body with randomly generated boundary ' boundary = '----------%s' % hex(int(time.time() * 1000)) data = [] for k, v in kw.iteritems(): data.append('--%s' % boundary) if hasattr(v, 'read'): # file-like object: ...
def function[_encode_multipart, parameter[]]: constant[ build a multipart/form-data body with randomly generated boundary ] variable[boundary] assign[=] binary_operation[constant[----------%s] <ast.Mod object at 0x7da2590d6920> call[name[hex], parameter[call[name[int], parameter[binary_operation[call[na...
keyword[def] identifier[_encode_multipart] (** identifier[kw] ): literal[string] identifier[boundary] = literal[string] % identifier[hex] ( identifier[int] ( identifier[time] . identifier[time] ()* literal[int] )) identifier[data] =[] keyword[for] identifier[k] , identifier[v] keyword[in] iden...
def _encode_multipart(**kw): """ build a multipart/form-data body with randomly generated boundary """ boundary = '----------%s' % hex(int(time.time() * 1000)) data = [] for (k, v) in kw.iteritems(): data.append('--%s' % boundary) if hasattr(v, 'read'): # file-like object: ...
def add(self, variant, arch, image): """ Assign an :class:`.Image` object to variant and arch. :param variant: compose variant UID :type variant: str :param arch: compose architecture :type arch: str :param image: image :type image: :class:`....
def function[add, parameter[self, variant, arch, image]]: constant[ Assign an :class:`.Image` object to variant and arch. :param variant: compose variant UID :type variant: str :param arch: compose architecture :type arch: str :param image: image ...
keyword[def] identifier[add] ( identifier[self] , identifier[variant] , identifier[arch] , identifier[image] ): literal[string] keyword[if] identifier[arch] keyword[not] keyword[in] identifier[productmd] . identifier[common] . identifier[RPM_ARCHES] : keyword[raise] identifier[Va...
def add(self, variant, arch, image): """ Assign an :class:`.Image` object to variant and arch. :param variant: compose variant UID :type variant: str :param arch: compose architecture :type arch: str :param image: image :type image: :class:`.Imag...
def build_circle_dict(self, center_lat, center_lng, radius, stroke_color='#FF0000', stroke_opacity=.8, stroke_weight=2, fill_color='#FF000...
def function[build_circle_dict, parameter[self, center_lat, center_lng, radius, stroke_color, stroke_opacity, stroke_weight, fill_color, fill_opacity]]: constant[ Set a dictionary with the javascript class Circle parameters This function sets a default drawing configuration if the user just pas...
keyword[def] identifier[build_circle_dict] ( identifier[self] , identifier[center_lat] , identifier[center_lng] , identifier[radius] , identifier[stroke_color] = literal[string] , identifier[stroke_opacity] = literal[int] , identifier[stroke_weight] = literal[int] , identifier[fill_color] = literal[string] , ...
def build_circle_dict(self, center_lat, center_lng, radius, stroke_color='#FF0000', stroke_opacity=0.8, stroke_weight=2, fill_color='#FF0000', fill_opacity=0.3): """ Set a dictionary with the javascript class Circle parameters This function sets a default drawing configuration if the user just pass...
def _filter(self, filename): """ return 'true' if filename doesn't match name_filter regex and should be filtered out of the list. @param filename: @return: """ return self.name_filter is not None and re.search(self.name_filter, filename) is None
def function[_filter, parameter[self, filename]]: constant[ return 'true' if filename doesn't match name_filter regex and should be filtered out of the list. @param filename: @return: ] return[<ast.BoolOp object at 0x7da1b19d8340>]
keyword[def] identifier[_filter] ( identifier[self] , identifier[filename] ): literal[string] keyword[return] identifier[self] . identifier[name_filter] keyword[is] keyword[not] keyword[None] keyword[and] identifier[re] . identifier[search] ( identifier[self] . identifier[name_filter] , ident...
def _filter(self, filename): """ return 'true' if filename doesn't match name_filter regex and should be filtered out of the list. @param filename: @return: """ return self.name_filter is not None and re.search(self.name_filter, filename) is None
def close(self): """ Close the policy instance and its shared database connection. """ self._logger.info("Closing") if self._conn is not None: self._conn.close() self._conn = None else: self._logger.warning( "close() called, but connection policy was alredy closed") return
def function[close, parameter[self]]: constant[ Close the policy instance and its shared database connection. ] call[name[self]._logger.info, parameter[constant[Closing]]] if compare[name[self]._conn is_not constant[None]] begin[:] call[name[self]._conn.close, parameter[]] ...
keyword[def] identifier[close] ( identifier[self] ): literal[string] identifier[self] . identifier[_logger] . identifier[info] ( literal[string] ) keyword[if] identifier[self] . identifier[_conn] keyword[is] keyword[not] keyword[None] : identifier[self] . identifier[_conn] . identifier[clos...
def close(self): """ Close the policy instance and its shared database connection. """ self._logger.info('Closing') if self._conn is not None: self._conn.close() self._conn = None # depends on [control=['if'], data=[]] else: self._logger.warning('close() called, but connection p...
def Compile(self, filter_implementation): """Compile the binary expression into a filter object.""" operator = self.operator.lower() if operator in ('and', '&&'): method = 'AndFilter' elif operator in ('or', '||'): method = 'OrFilter' else: raise errors.ParseError( 'Inval...
def function[Compile, parameter[self, filter_implementation]]: constant[Compile the binary expression into a filter object.] variable[operator] assign[=] call[name[self].operator.lower, parameter[]] if compare[name[operator] in tuple[[<ast.Constant object at 0x7da18ede7970>, <ast.Constant object...
keyword[def] identifier[Compile] ( identifier[self] , identifier[filter_implementation] ): literal[string] identifier[operator] = identifier[self] . identifier[operator] . identifier[lower] () keyword[if] identifier[operator] keyword[in] ( literal[string] , literal[string] ): identifier[metho...
def Compile(self, filter_implementation): """Compile the binary expression into a filter object.""" operator = self.operator.lower() if operator in ('and', '&&'): method = 'AndFilter' # depends on [control=['if'], data=[]] elif operator in ('or', '||'): method = 'OrFilter' # depends on...
def get(cls, uuid): """Retrieve one specific object from the server by its UUID (unique 16-character id). UUIDs can be found in the web browser's address bar while viewing analyses and other objects. Parameters ---------- uuid : string UUID of the object to retrieve....
def function[get, parameter[cls, uuid]]: constant[Retrieve one specific object from the server by its UUID (unique 16-character id). UUIDs can be found in the web browser's address bar while viewing analyses and other objects. Parameters ---------- uuid : string UUID...
keyword[def] identifier[get] ( identifier[cls] , identifier[uuid] ): literal[string] identifier[check_bind] ( identifier[cls] ) keyword[try] : identifier[resource] = identifier[cls] . identifier[_resource] . identifier[fetch] ( identifier[uuid] ) keyword...
def get(cls, uuid): """Retrieve one specific object from the server by its UUID (unique 16-character id). UUIDs can be found in the web browser's address bar while viewing analyses and other objects. Parameters ---------- uuid : string UUID of the object to retrieve. ...
def parse_lines(stream, separator=None): """ Takes each line of a stream, creating a generator that yields tuples of line, row - where row is the line split by separator (or by whitespace if separator is None. :param stream: :param separator: (optional) :return: generator """ separa...
def function[parse_lines, parameter[stream, separator]]: constant[ Takes each line of a stream, creating a generator that yields tuples of line, row - where row is the line split by separator (or by whitespace if separator is None. :param stream: :param separator: (optional) :return: ge...
keyword[def] identifier[parse_lines] ( identifier[stream] , identifier[separator] = keyword[None] ): literal[string] identifier[separator] = keyword[None] keyword[if] identifier[separator] keyword[is] keyword[None] keyword[else] identifier[unicode] ( identifier[separator] ) keyword[for] identif...
def parse_lines(stream, separator=None): """ Takes each line of a stream, creating a generator that yields tuples of line, row - where row is the line split by separator (or by whitespace if separator is None. :param stream: :param separator: (optional) :return: generator """ separa...
def exp2prob(expression_vector): """Convert an expression vector into a probability vector. Attribute: expression_vector (list): List of expression values. """ v = np.asarray(expression_vector) if np.sum(v) == 0: return np.zeros(len(expression_vector)) else: retu...
def function[exp2prob, parameter[expression_vector]]: constant[Convert an expression vector into a probability vector. Attribute: expression_vector (list): List of expression values. ] variable[v] assign[=] call[name[np].asarray, parameter[name[expression_vector]]] if compare[cal...
keyword[def] identifier[exp2prob] ( identifier[expression_vector] ): literal[string] identifier[v] = identifier[np] . identifier[asarray] ( identifier[expression_vector] ) keyword[if] identifier[np] . identifier[sum] ( identifier[v] )== literal[int] : keyword[return] identifier[np] . id...
def exp2prob(expression_vector): """Convert an expression vector into a probability vector. Attribute: expression_vector (list): List of expression values. """ v = np.asarray(expression_vector) if np.sum(v) == 0: return np.zeros(len(expression_vector)) # depends on [control=['if'], ...
def load_class(self, classname, namespace=None): """ Loads a class looking for it in each module registered. It's possible to load a class from specific namespace using **namespace** parameter or using classname as "namespace:classname". :param classname: Class name you want to load. ...
def function[load_class, parameter[self, classname, namespace]]: constant[ Loads a class looking for it in each module registered. It's possible to load a class from specific namespace using **namespace** parameter or using classname as "namespace:classname". :param classname: Class nam...
keyword[def] identifier[load_class] ( identifier[self] , identifier[classname] , identifier[namespace] = keyword[None] ): literal[string] keyword[if] identifier[namespace] keyword[is] keyword[None] keyword[and] literal[string] keyword[in] identifier[classname] : identifier[names...
def load_class(self, classname, namespace=None): """ Loads a class looking for it in each module registered. It's possible to load a class from specific namespace using **namespace** parameter or using classname as "namespace:classname". :param classname: Class name you want to load. ...
def load_data_and_model(items_as_dict, **context): """ Loads every file in a dictionary {key: filename}. The extension is either *pkl* and *onnx* and determines how it it loaded. If the value is not a string, the function assumes it was already loaded. """ res = {} for k, v in items_as_d...
def function[load_data_and_model, parameter[items_as_dict]]: constant[ Loads every file in a dictionary {key: filename}. The extension is either *pkl* and *onnx* and determines how it it loaded. If the value is not a string, the function assumes it was already loaded. ] variable[res]...
keyword[def] identifier[load_data_and_model] ( identifier[items_as_dict] ,** identifier[context] ): literal[string] identifier[res] ={} keyword[for] identifier[k] , identifier[v] keyword[in] identifier[items_as_dict] . identifier[items] (): keyword[if] identifier[isinstance] ( identifier[...
def load_data_and_model(items_as_dict, **context): """ Loads every file in a dictionary {key: filename}. The extension is either *pkl* and *onnx* and determines how it it loaded. If the value is not a string, the function assumes it was already loaded. """ res = {} for (k, v) in items_as...
def load_config(self): """ Load configuration for the service Args: config_file: Configuration file path """ logger.debug('loading config file: %s', self.config_file) if os.path.exists(self.config_file): with open(self.config_file) as file_handle:...
def function[load_config, parameter[self]]: constant[ Load configuration for the service Args: config_file: Configuration file path ] call[name[logger].debug, parameter[constant[loading config file: %s], name[self].config_file]] if call[name[os].path.exists, ...
keyword[def] identifier[load_config] ( identifier[self] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] , identifier[self] . identifier[config_file] ) keyword[if] identifier[os] . identifier[path] . identifier[exists] ( identifier[self] . identifier[config_file...
def load_config(self): """ Load configuration for the service Args: config_file: Configuration file path """ logger.debug('loading config file: %s', self.config_file) if os.path.exists(self.config_file): with open(self.config_file) as file_handle: ret...
def _modifyInternal(self, *, sort=None, purge=False, done=None): """Creates a whole new database from existing one, based on given modifiers. :sort: pattern should look like this: ([(<index>, True|False)], {<level_index>: [(<index>, True|False)]}), where True|False indicate whet...
def function[_modifyInternal, parameter[self]]: constant[Creates a whole new database from existing one, based on given modifiers. :sort: pattern should look like this: ([(<index>, True|False)], {<level_index>: [(<index>, True|False)]}), where True|False indicate whether to reve...
keyword[def] identifier[_modifyInternal] ( identifier[self] ,*, identifier[sort] = keyword[None] , identifier[purge] = keyword[False] , identifier[done] = keyword[None] ): literal[string] identifier[sortAll] , identifier[sortLevels] = identifier[sort] keyword[is] keyword[not] keyword[None] keyw...
def _modifyInternal(self, *, sort=None, purge=False, done=None): """Creates a whole new database from existing one, based on given modifiers. :sort: pattern should look like this: ([(<index>, True|False)], {<level_index>: [(<index>, True|False)]}), where True|False indicate whether ...
def t_EQUAL(self, t): r"\=" t.endlexpos = t.lexpos + len(t.value) return t
def function[t_EQUAL, parameter[self, t]]: constant[\=] name[t].endlexpos assign[=] binary_operation[name[t].lexpos + call[name[len], parameter[name[t].value]]] return[name[t]]
keyword[def] identifier[t_EQUAL] ( identifier[self] , identifier[t] ): literal[string] identifier[t] . identifier[endlexpos] = identifier[t] . identifier[lexpos] + identifier[len] ( identifier[t] . identifier[value] ) keyword[return] identifier[t]
def t_EQUAL(self, t): """\\=""" t.endlexpos = t.lexpos + len(t.value) return t
def _set_zero(self, i, j, a, b, r, s, t): """Let A[i, j] be zero based on Bezout's identity [ii ij] [ji jj] is a (k,k) minor of original 3x3 matrix. """ L = np.eye(3, dtype='intc') L[i, i] = s L[i, j] = t L[j, i] = -b // r L[j, j] = a // r...
def function[_set_zero, parameter[self, i, j, a, b, r, s, t]]: constant[Let A[i, j] be zero based on Bezout's identity [ii ij] [ji jj] is a (k,k) minor of original 3x3 matrix. ] variable[L] assign[=] call[name[np].eye, parameter[constant[3]]] call[name[L]][tuple[[...
keyword[def] identifier[_set_zero] ( identifier[self] , identifier[i] , identifier[j] , identifier[a] , identifier[b] , identifier[r] , identifier[s] , identifier[t] ): literal[string] identifier[L] = identifier[np] . identifier[eye] ( literal[int] , identifier[dtype] = literal[string] ) ...
def _set_zero(self, i, j, a, b, r, s, t): """Let A[i, j] be zero based on Bezout's identity [ii ij] [ji jj] is a (k,k) minor of original 3x3 matrix. """ L = np.eye(3, dtype='intc') L[i, i] = s L[i, j] = t L[j, i] = -b // r L[j, j] = a // r self._L.append(L.cop...
def _get_content_type(url): """Get the Content-Type of the given url, using a HEAD request""" scheme, netloc, path, query, fragment = urlparse.urlsplit(url) if not scheme in ('http', 'https', 'ftp', 'ftps'): ## FIXME: some warning or something? ## assertion error? ...
def function[_get_content_type, parameter[url]]: constant[Get the Content-Type of the given url, using a HEAD request] <ast.Tuple object at 0x7da207f9af20> assign[=] call[name[urlparse].urlsplit, parameter[name[url]]] if <ast.UnaryOp object at 0x7da207f98910> begin[:] return[constant[]] ...
keyword[def] identifier[_get_content_type] ( identifier[url] ): literal[string] identifier[scheme] , identifier[netloc] , identifier[path] , identifier[query] , identifier[fragment] = identifier[urlparse] . identifier[urlsplit] ( identifier[url] ) keyword[if] keyword[not] identifier[sche...
def _get_content_type(url): """Get the Content-Type of the given url, using a HEAD request""" (scheme, netloc, path, query, fragment) = urlparse.urlsplit(url) if not scheme in ('http', 'https', 'ftp', 'ftps'): ## FIXME: some warning or something? ## assertion error? return '' # depe...
def find(self, item, logical=False): """Find files using :attr:`finders` registry. The ``item`` parameter can be an instance of :class:`~gears.asset_attributes.AssetAttributes` class, a path to the asset or a logical path to the asset. If ``item`` is a logical path, `logical` parameter m...
def function[find, parameter[self, item, logical]]: constant[Find files using :attr:`finders` registry. The ``item`` parameter can be an instance of :class:`~gears.asset_attributes.AssetAttributes` class, a path to the asset or a logical path to the asset. If ``item`` is a logical path, ...
keyword[def] identifier[find] ( identifier[self] , identifier[item] , identifier[logical] = keyword[False] ): literal[string] keyword[if] identifier[isinstance] ( identifier[item] , identifier[AssetAttributes] ): keyword[for] identifier[path] keyword[in] identifier[item] . identifi...
def find(self, item, logical=False): """Find files using :attr:`finders` registry. The ``item`` parameter can be an instance of :class:`~gears.asset_attributes.AssetAttributes` class, a path to the asset or a logical path to the asset. If ``item`` is a logical path, `logical` parameter must ...
def register_plugin(self): """Register plugin in Spyder's main window""" self.focus_changed.connect(self.main.plugin_focus_changed) self.main.add_dockwidget(self) # self.main.console.set_historylog(self) self.main.console.shell.refresh.connect(self.refresh_plugin)
def function[register_plugin, parameter[self]]: constant[Register plugin in Spyder's main window] call[name[self].focus_changed.connect, parameter[name[self].main.plugin_focus_changed]] call[name[self].main.add_dockwidget, parameter[name[self]]] call[name[self].main.console.shell.refresh...
keyword[def] identifier[register_plugin] ( identifier[self] ): literal[string] identifier[self] . identifier[focus_changed] . identifier[connect] ( identifier[self] . identifier[main] . identifier[plugin_focus_changed] ) identifier[self] . identifier[main] . identifier[add_dockwidget] (...
def register_plugin(self): """Register plugin in Spyder's main window""" self.focus_changed.connect(self.main.plugin_focus_changed) self.main.add_dockwidget(self) # self.main.console.set_historylog(self) self.main.console.shell.refresh.connect(self.refresh_plugin)
def _get_base_model(self): """ :return: base model from Keras based on user-supplied model name """ if self.model_name == 'inception_v3': return InceptionV3(weights='imagenet', include_top=False) elif self.model_name == 'xception': return Xception(weights=...
def function[_get_base_model, parameter[self]]: constant[ :return: base model from Keras based on user-supplied model name ] if compare[name[self].model_name equal[==] constant[inception_v3]] begin[:] return[call[name[InceptionV3], parameter[]]]
keyword[def] identifier[_get_base_model] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[model_name] == literal[string] : keyword[return] identifier[InceptionV3] ( identifier[weights] = literal[string] , identifier[include_top] = keyword[False] ) ...
def _get_base_model(self): """ :return: base model from Keras based on user-supplied model name """ if self.model_name == 'inception_v3': return InceptionV3(weights='imagenet', include_top=False) # depends on [control=['if'], data=[]] elif self.model_name == 'xception': retu...
def binary(self): """ Get the object this function belongs to. :return: The object this function belongs to. """ return self._project.loader.find_object_containing(self.addr, membership_check=False)
def function[binary, parameter[self]]: constant[ Get the object this function belongs to. :return: The object this function belongs to. ] return[call[name[self]._project.loader.find_object_containing, parameter[name[self].addr]]]
keyword[def] identifier[binary] ( identifier[self] ): literal[string] keyword[return] identifier[self] . identifier[_project] . identifier[loader] . identifier[find_object_containing] ( identifier[self] . identifier[addr] , identifier[membership_check] = keyword[False] )
def binary(self): """ Get the object this function belongs to. :return: The object this function belongs to. """ return self._project.loader.find_object_containing(self.addr, membership_check=False)
def get_course(self, courseid): """ :param courseid: the course id of the course :raise InvalidNameException, CourseNotFoundException, CourseUnreadableException :return: an object representing the course, of the type given in the constructor """ if not id_checker(courseid...
def function[get_course, parameter[self, courseid]]: constant[ :param courseid: the course id of the course :raise InvalidNameException, CourseNotFoundException, CourseUnreadableException :return: an object representing the course, of the type given in the constructor ] i...
keyword[def] identifier[get_course] ( identifier[self] , identifier[courseid] ): literal[string] keyword[if] keyword[not] identifier[id_checker] ( identifier[courseid] ): keyword[raise] identifier[InvalidNameException] ( literal[string] + identifier[courseid] ) keyword[if] ...
def get_course(self, courseid): """ :param courseid: the course id of the course :raise InvalidNameException, CourseNotFoundException, CourseUnreadableException :return: an object representing the course, of the type given in the constructor """ if not id_checker(courseid): ...
def parse_nexus(self): "get newick data from NEXUS" if self.data[0].strip().upper() == "#NEXUS": nex = NexusParser(self.data) self.data = nex.newicks self.tdict = nex.tdict
def function[parse_nexus, parameter[self]]: constant[get newick data from NEXUS] if compare[call[call[call[name[self].data][constant[0]].strip, parameter[]].upper, parameter[]] equal[==] constant[#NEXUS]] begin[:] variable[nex] assign[=] call[name[NexusParser], parameter[name[self].data]...
keyword[def] identifier[parse_nexus] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[data] [ literal[int] ]. identifier[strip] (). identifier[upper] ()== literal[string] : identifier[nex] = identifier[NexusParser] ( identifier[self] . identifier[data] )...
def parse_nexus(self): """get newick data from NEXUS""" if self.data[0].strip().upper() == '#NEXUS': nex = NexusParser(self.data) self.data = nex.newicks self.tdict = nex.tdict # depends on [control=['if'], data=[]]
def get_consumer_offsets_metadata( kafka_client, group, topics, raise_on_error=True, ): """This method: * refreshes metadata for the kafka client * fetches group offsets * fetches watermarks :param kafka_client: KafkaToolClient instance :param group: group id :pa...
def function[get_consumer_offsets_metadata, parameter[kafka_client, group, topics, raise_on_error]]: constant[This method: * refreshes metadata for the kafka client * fetches group offsets * fetches watermarks :param kafka_client: KafkaToolClient instance :param group: group id ...
keyword[def] identifier[get_consumer_offsets_metadata] ( identifier[kafka_client] , identifier[group] , identifier[topics] , identifier[raise_on_error] = keyword[True] , ): literal[string] keyword[try] : identifier[kafka_client] . identifier[load_metadata_for_topics] () key...
def get_consumer_offsets_metadata(kafka_client, group, topics, raise_on_error=True): """This method: * refreshes metadata for the kafka client * fetches group offsets * fetches watermarks :param kafka_client: KafkaToolClient instance :param group: group id :param topics: list of...
def load_session_from_file(self, username: str, filename: Optional[str] = None) -> None: """Internally stores :class:`requests.Session` object loaded from file. If filename is None, the file with the default session path is loaded. :raises FileNotFoundError: If the file does not exist. ...
def function[load_session_from_file, parameter[self, username, filename]]: constant[Internally stores :class:`requests.Session` object loaded from file. If filename is None, the file with the default session path is loaded. :raises FileNotFoundError: If the file does not exist. ] ...
keyword[def] identifier[load_session_from_file] ( identifier[self] , identifier[username] : identifier[str] , identifier[filename] : identifier[Optional] [ identifier[str] ]= keyword[None] )-> keyword[None] : literal[string] keyword[if] identifier[filename] keyword[is] keyword[None] : ...
def load_session_from_file(self, username: str, filename: Optional[str]=None) -> None: """Internally stores :class:`requests.Session` object loaded from file. If filename is None, the file with the default session path is loaded. :raises FileNotFoundError: If the file does not exist. """ ...
def validator_for(schema, default=_LATEST_VERSION): """ Retrieve the validator class appropriate for validating the given schema. Uses the :validator:`$schema` property that should be present in the given schema to look up the appropriate validator class. Arguments: schema (collections.Ma...
def function[validator_for, parameter[schema, default]]: constant[ Retrieve the validator class appropriate for validating the given schema. Uses the :validator:`$schema` property that should be present in the given schema to look up the appropriate validator class. Arguments: schema ...
keyword[def] identifier[validator_for] ( identifier[schema] , identifier[default] = identifier[_LATEST_VERSION] ): literal[string] keyword[if] identifier[schema] keyword[is] keyword[True] keyword[or] identifier[schema] keyword[is] keyword[False] keyword[or] literal[string] keyword[not] keyword[i...
def validator_for(schema, default=_LATEST_VERSION): """ Retrieve the validator class appropriate for validating the given schema. Uses the :validator:`$schema` property that should be present in the given schema to look up the appropriate validator class. Arguments: schema (collections.Ma...
def get_context_data(self, **kwargs): """ Add the current category in context. """ context = super(BaseCategoryDetail, self).get_context_data(**kwargs) context['category'] = self.category return context
def function[get_context_data, parameter[self]]: constant[ Add the current category in context. ] variable[context] assign[=] call[call[name[super], parameter[name[BaseCategoryDetail], name[self]]].get_context_data, parameter[]] call[name[context]][constant[category]] assign[=] n...
keyword[def] identifier[get_context_data] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[context] = identifier[super] ( identifier[BaseCategoryDetail] , identifier[self] ). identifier[get_context_data] (** identifier[kwargs] ) identifier[context] [ literal[string] ...
def get_context_data(self, **kwargs): """ Add the current category in context. """ context = super(BaseCategoryDetail, self).get_context_data(**kwargs) context['category'] = self.category return context
def add(self, varname, result, pointer=None): """Adds the specified python-typed result and an optional Ftype pointer to use when cleaning up this object. :arg result: a python-typed representation of the result. :arg pointer: an instance of Ftype with pointer information for deallocati...
def function[add, parameter[self, varname, result, pointer]]: constant[Adds the specified python-typed result and an optional Ftype pointer to use when cleaning up this object. :arg result: a python-typed representation of the result. :arg pointer: an instance of Ftype with pointer info...
keyword[def] identifier[add] ( identifier[self] , identifier[varname] , identifier[result] , identifier[pointer] = keyword[None] ): literal[string] identifier[self] . identifier[result] [ identifier[varname] ]= identifier[result] identifier[setattr] ( identifier[self] , identifier[varname...
def add(self, varname, result, pointer=None): """Adds the specified python-typed result and an optional Ftype pointer to use when cleaning up this object. :arg result: a python-typed representation of the result. :arg pointer: an instance of Ftype with pointer information for deallocating ...
def quit(self): """ Quit the player, blocking until the process has died """ if self._process is None: logger.debug('Quit was called after self._process had already been released') return try: logger.debug('Quitting OMXPlayer') proc...
def function[quit, parameter[self]]: constant[ Quit the player, blocking until the process has died ] if compare[name[self]._process is constant[None]] begin[:] call[name[logger].debug, parameter[constant[Quit was called after self._process had already been released]]] ...
keyword[def] identifier[quit] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_process] keyword[is] keyword[None] : identifier[logger] . identifier[debug] ( literal[string] ) keyword[return] keyword[try] : identifie...
def quit(self): """ Quit the player, blocking until the process has died """ if self._process is None: logger.debug('Quit was called after self._process had already been released') return # depends on [control=['if'], data=[]] try: logger.debug('Quitting OMXPlayer') ...
def cert(name, aliases=None, email=None, webroot=None, test_cert=False, renew=None, keysize=None, server=None, owner='root', group='root', mode='0640', certname=None, preferred_challenges=None, tls_sni_0...
def function[cert, parameter[name, aliases, email, webroot, test_cert, renew, keysize, server, owner, group, mode, certname, preferred_challenges, tls_sni_01_port, tls_sni_01_address, http_01_port, http_01_address, dns_plugin, dns_plugin_credentials]]: constant[ Obtain/renew a certificate from an ACME CA, p...
keyword[def] identifier[cert] ( identifier[name] , identifier[aliases] = keyword[None] , identifier[email] = keyword[None] , identifier[webroot] = keyword[None] , identifier[test_cert] = keyword[False] , identifier[renew] = keyword[None] , identifier[keysize] = keyword[None] , identifier[server] = keyword[None...
def cert(name, aliases=None, email=None, webroot=None, test_cert=False, renew=None, keysize=None, server=None, owner='root', group='root', mode='0640', certname=None, preferred_challenges=None, tls_sni_01_port=None, tls_sni_01_address=None, http_01_port=None, http_01_address=None, dns_plugin=None, dns_plugin_credential...
def check_rst(code, ignore): """Yield errors in nested RST code.""" filename = '<string>' for result in check(code, filename=filename, ignore=ignore): yield result
def function[check_rst, parameter[code, ignore]]: constant[Yield errors in nested RST code.] variable[filename] assign[=] constant[<string>] for taget[name[result]] in starred[call[name[check], parameter[name[code]]]] begin[:] <ast.Yield object at 0x7da1b08b09a0>
keyword[def] identifier[check_rst] ( identifier[code] , identifier[ignore] ): literal[string] identifier[filename] = literal[string] keyword[for] identifier[result] keyword[in] identifier[check] ( identifier[code] , identifier[filename] = identifier[filename] , identifier[ignore] = iden...
def check_rst(code, ignore): """Yield errors in nested RST code.""" filename = '<string>' for result in check(code, filename=filename, ignore=ignore): yield result # depends on [control=['for'], data=['result']]
def supplement_filesystem(old_size, user_cap=False): """Return new size accounting for the metadata.""" new_size = old_size if user_cap: if old_size <= _GiB_to_Byte(1.5): new_size = _GiB_to_Byte(3) else: new_size += _GiB_to_Byte(1.5) return int(new_size)
def function[supplement_filesystem, parameter[old_size, user_cap]]: constant[Return new size accounting for the metadata.] variable[new_size] assign[=] name[old_size] if name[user_cap] begin[:] if compare[name[old_size] less_or_equal[<=] call[name[_GiB_to_Byte], parameter[constan...
keyword[def] identifier[supplement_filesystem] ( identifier[old_size] , identifier[user_cap] = keyword[False] ): literal[string] identifier[new_size] = identifier[old_size] keyword[if] identifier[user_cap] : keyword[if] identifier[old_size] <= identifier[_GiB_to_Byte] ( literal[int] ): ...
def supplement_filesystem(old_size, user_cap=False): """Return new size accounting for the metadata.""" new_size = old_size if user_cap: if old_size <= _GiB_to_Byte(1.5): new_size = _GiB_to_Byte(3) # depends on [control=['if'], data=[]] else: new_size += _GiB_to_Byte...
def get_body(self): '''Get the response Body :returns Body: A Body object containing the response. ''' if self._body is None: resp = self._dispatcher._dispatch(self.request) self._body = self._create_body(resp) return self._body
def function[get_body, parameter[self]]: constant[Get the response Body :returns Body: A Body object containing the response. ] if compare[name[self]._body is constant[None]] begin[:] variable[resp] assign[=] call[name[self]._dispatcher._dispatch, parameter[name[self].re...
keyword[def] identifier[get_body] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_body] keyword[is] keyword[None] : identifier[resp] = identifier[self] . identifier[_dispatcher] . identifier[_dispatch] ( identifier[self] . identifier[request] ) ...
def get_body(self): """Get the response Body :returns Body: A Body object containing the response. """ if self._body is None: resp = self._dispatcher._dispatch(self.request) self._body = self._create_body(resp) # depends on [control=['if'], data=[]] return self._body
def is_all_field_none(self): """ :rtype: bool """ if self._tab is not None: return False if self._payment is not None: return False if self._request_reference_split_the_bill is not None: return False return True
def function[is_all_field_none, parameter[self]]: constant[ :rtype: bool ] if compare[name[self]._tab is_not constant[None]] begin[:] return[constant[False]] if compare[name[self]._payment is_not constant[None]] begin[:] return[constant[False]] if compare[...
keyword[def] identifier[is_all_field_none] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_tab] keyword[is] keyword[not] keyword[None] : keyword[return] keyword[False] keyword[if] identifier[self] . identifier[_payment] keyword[is] k...
def is_all_field_none(self): """ :rtype: bool """ if self._tab is not None: return False # depends on [control=['if'], data=[]] if self._payment is not None: return False # depends on [control=['if'], data=[]] if self._request_reference_split_the_bill is not None: ...
def read_ascii_catalog(filename, format_, unit=None): """ Read an ASCII catalog file using Astropy. This routine is used by pymoctool to load coordinates from a catalog file in order to generate a MOC representation. """ catalog = ascii.read(filename, format=format_) columns = catalog.colu...
def function[read_ascii_catalog, parameter[filename, format_, unit]]: constant[ Read an ASCII catalog file using Astropy. This routine is used by pymoctool to load coordinates from a catalog file in order to generate a MOC representation. ] variable[catalog] assign[=] call[name[ascii].r...
keyword[def] identifier[read_ascii_catalog] ( identifier[filename] , identifier[format_] , identifier[unit] = keyword[None] ): literal[string] identifier[catalog] = identifier[ascii] . identifier[read] ( identifier[filename] , identifier[format] = identifier[format_] ) identifier[columns] = identifie...
def read_ascii_catalog(filename, format_, unit=None): """ Read an ASCII catalog file using Astropy. This routine is used by pymoctool to load coordinates from a catalog file in order to generate a MOC representation. """ catalog = ascii.read(filename, format=format_) columns = catalog.colum...
def choose_language(self, lang, request): """Deal with the multiple corner case of choosing the language.""" # Can be an empty string or None if not lang: lang = get_language_from_request(request) # Raise a 404 if the language is not in not in the list if lang not i...
def function[choose_language, parameter[self, lang, request]]: constant[Deal with the multiple corner case of choosing the language.] if <ast.UnaryOp object at 0x7da18dc9a5c0> begin[:] variable[lang] assign[=] call[name[get_language_from_request], parameter[name[request]]] if com...
keyword[def] identifier[choose_language] ( identifier[self] , identifier[lang] , identifier[request] ): literal[string] keyword[if] keyword[not] identifier[lang] : identifier[lang] = identifier[get_language_from_request] ( identifier[request] ) keywor...
def choose_language(self, lang, request): """Deal with the multiple corner case of choosing the language.""" # Can be an empty string or None if not lang: lang = get_language_from_request(request) # depends on [control=['if'], data=[]] # Raise a 404 if the language is not in not in the list ...
def production_url(path, original): """ For a production environment (DEBUG=False), replaces original path created by Django's {% static %} template tag with relevant path from our mapping. """ mapping = _get_mapping() if mapping: if path in mapping: return original.repla...
def function[production_url, parameter[path, original]]: constant[ For a production environment (DEBUG=False), replaces original path created by Django's {% static %} template tag with relevant path from our mapping. ] variable[mapping] assign[=] call[name[_get_mapping], parameter[]] ...
keyword[def] identifier[production_url] ( identifier[path] , identifier[original] ): literal[string] identifier[mapping] = identifier[_get_mapping] () keyword[if] identifier[mapping] : keyword[if] identifier[path] keyword[in] identifier[mapping] : keyword[return] identifier[...
def production_url(path, original): """ For a production environment (DEBUG=False), replaces original path created by Django's {% static %} template tag with relevant path from our mapping. """ mapping = _get_mapping() if mapping: if path in mapping: return original.repla...
def SetHasherNames(self, hasher_names_string): """Sets the hashers that should be enabled. Args: hasher_names_string (str): comma separated names of hashers to enable. """ hasher_names = hashers_manager.HashersManager.GetHasherNamesFromString( hasher_names_string) debug_hasher_names ...
def function[SetHasherNames, parameter[self, hasher_names_string]]: constant[Sets the hashers that should be enabled. Args: hasher_names_string (str): comma separated names of hashers to enable. ] variable[hasher_names] assign[=] call[name[hashers_manager].HashersManager.GetHasherNamesFro...
keyword[def] identifier[SetHasherNames] ( identifier[self] , identifier[hasher_names_string] ): literal[string] identifier[hasher_names] = identifier[hashers_manager] . identifier[HashersManager] . identifier[GetHasherNamesFromString] ( identifier[hasher_names_string] ) identifier[debug_hasher_n...
def SetHasherNames(self, hasher_names_string): """Sets the hashers that should be enabled. Args: hasher_names_string (str): comma separated names of hashers to enable. """ hasher_names = hashers_manager.HashersManager.GetHasherNamesFromString(hasher_names_string) debug_hasher_names = ', '.joi...
def ConsultarCaracteres(self, sep="||"): "Retorna listado de caracteres emisor/receptor (código, descripción)" ret = self.client.consultarCaracteresParticipante( auth={ 'token': self.Token, 'sign': self.Sign, 'cuit': self.Cu...
def function[ConsultarCaracteres, parameter[self, sep]]: constant[Retorna listado de caracteres emisor/receptor (código, descripción)] variable[ret] assign[=] call[call[name[self].client.consultarCaracteresParticipante, parameter[]]][constant[respuesta]] call[name[self].__analizar_errores, param...
keyword[def] identifier[ConsultarCaracteres] ( identifier[self] , identifier[sep] = literal[string] ): literal[string] identifier[ret] = identifier[self] . identifier[client] . identifier[consultarCaracteresParticipante] ( identifier[auth] ={ literal[string] : identifier[self] . i...
def ConsultarCaracteres(self, sep='||'): """Retorna listado de caracteres emisor/receptor (código, descripción)""" ret = self.client.consultarCaracteresParticipante(auth={'token': self.Token, 'sign': self.Sign, 'cuit': self.Cuit})['respuesta'] self.__analizar_errores(ret) array = ret.get('caracter', [])...
def delete_os_dummy_rtr_nwk(self, rtr_id, net_id, subnet_id): """Delete the dummy interface to the router. """ subnet_lst = set() subnet_lst.add(subnet_id) ret = self.os_helper.delete_intf_router(None, None, rtr_id, subnet_lst) if not ret: return ret return s...
def function[delete_os_dummy_rtr_nwk, parameter[self, rtr_id, net_id, subnet_id]]: constant[Delete the dummy interface to the router. ] variable[subnet_lst] assign[=] call[name[set], parameter[]] call[name[subnet_lst].add, parameter[name[subnet_id]]] variable[ret] assign[=] call[name[se...
keyword[def] identifier[delete_os_dummy_rtr_nwk] ( identifier[self] , identifier[rtr_id] , identifier[net_id] , identifier[subnet_id] ): literal[string] identifier[subnet_lst] = identifier[set] () identifier[subnet_lst] . identifier[add] ( identifier[subnet_id] ) identifier[ret] =...
def delete_os_dummy_rtr_nwk(self, rtr_id, net_id, subnet_id): """Delete the dummy interface to the router. """ subnet_lst = set() subnet_lst.add(subnet_id) ret = self.os_helper.delete_intf_router(None, None, rtr_id, subnet_lst) if not ret: return ret # depends on [control=['if'], data=[]] ...
def clean(self): """ Make sure that the scope is less or equal to the scope allowed on the grant! """ data = self.cleaned_data want_scope = data.get('scope') or 0 grant = data.get('grant') has_scope = grant.scope if grant else 0 # Only check if we...
def function[clean, parameter[self]]: constant[ Make sure that the scope is less or equal to the scope allowed on the grant! ] variable[data] assign[=] name[self].cleaned_data variable[want_scope] assign[=] <ast.BoolOp object at 0x7da18dc07cd0> variable[grant] ass...
keyword[def] identifier[clean] ( identifier[self] ): literal[string] identifier[data] = identifier[self] . identifier[cleaned_data] identifier[want_scope] = identifier[data] . identifier[get] ( literal[string] ) keyword[or] literal[int] identifier[grant] = identifier[data] . id...
def clean(self): """ Make sure that the scope is less or equal to the scope allowed on the grant! """ data = self.cleaned_data want_scope = data.get('scope') or 0 grant = data.get('grant') has_scope = grant.scope if grant else 0 # Only check if we've actually got a scope ...
def resume_follow(self, index, body=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html>`_ :arg index: The name of the follow index to resume following. :arg body: The name of the leader index and other optional ccr relat...
def function[resume_follow, parameter[self, index, body, params]]: constant[ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html>`_ :arg index: The name of the follow index to resume following. :arg body: The name of the leader index and other o...
keyword[def] identifier[resume_follow] ( identifier[self] , identifier[index] , identifier[body] = keyword[None] , identifier[params] = keyword[None] ): literal[string] keyword[if] identifier[index] keyword[in] identifier[SKIP_IN_PATH] : keyword[raise] identifier[ValueError] ( lite...
def resume_follow(self, index, body=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html>`_ :arg index: The name of the follow index to resume following. :arg body: The name of the leader index and other optional ccr related ...
def parse(self, root): """Returns a dictionary of values extracted from the root of the specified XML file. It is assumed that the file is an input/output file to be converted into plaintext. As such the file should only specify a single version number.""" #Use the first element ...
def function[parse, parameter[self, root]]: constant[Returns a dictionary of values extracted from the root of the specified XML file. It is assumed that the file is an input/output file to be converted into plaintext. As such the file should only specify a single version number.] ...
keyword[def] identifier[parse] ( identifier[self] , identifier[root] ): literal[string] identifier[v] = identifier[_get_xml_version] ( identifier[root] )[ literal[int] ] identifier[result] ={} keyword[for] identifier[child] keyword[in] identifier[root] : ...
def parse(self, root): """Returns a dictionary of values extracted from the root of the specified XML file. It is assumed that the file is an input/output file to be converted into plaintext. As such the file should only specify a single version number.""" #Use the first element in the v...
def toStringProto(self, inObject, proto): """ Wraps the object in a list, and then defers to ``amp.AmpList``. """ return amp.AmpList.toStringProto(self, [inObject], proto)
def function[toStringProto, parameter[self, inObject, proto]]: constant[ Wraps the object in a list, and then defers to ``amp.AmpList``. ] return[call[name[amp].AmpList.toStringProto, parameter[name[self], list[[<ast.Name object at 0x7da18fe92e30>]], name[proto]]]]
keyword[def] identifier[toStringProto] ( identifier[self] , identifier[inObject] , identifier[proto] ): literal[string] keyword[return] identifier[amp] . identifier[AmpList] . identifier[toStringProto] ( identifier[self] ,[ identifier[inObject] ], identifier[proto] )
def toStringProto(self, inObject, proto): """ Wraps the object in a list, and then defers to ``amp.AmpList``. """ return amp.AmpList.toStringProto(self, [inObject], proto)
def p_assignment_expr(self, p): """ assignment_expr \ : conditional_expr | left_hand_side_expr assignment_operator assignment_expr """ if len(p) == 2: p[0] = p[1] else: p[0] = ast.Assign(left=p[1], op=p[2], right=p[3])
def function[p_assignment_expr, parameter[self, p]]: constant[ assignment_expr : conditional_expr | left_hand_side_expr assignment_operator assignment_expr ] if compare[call[name[len], parameter[name[p]]] equal[==] constant[2]] begin[:] call[name[p...
keyword[def] identifier[p_assignment_expr] ( identifier[self] , identifier[p] ): literal[string] keyword[if] identifier[len] ( identifier[p] )== literal[int] : identifier[p] [ literal[int] ]= identifier[p] [ literal[int] ] keyword[else] : identifier[p] [ literal[...
def p_assignment_expr(self, p): """ assignment_expr : conditional_expr | left_hand_side_expr assignment_operator assignment_expr """ if len(p) == 2: p[0] = p[1] # depends on [control=['if'], data=[]] else: p[0] = ast.Assign(left=p[1], op=p[2], right=p...
def from_edf(fname): """ DataFrame constructor to open XBT EDF ASCII format. Examples -------- >>> from pathlib import Path >>> import ctd >>> data_path = Path(__file__).parents[1].joinpath("tests", "data") >>> cast = ctd.from_edf(data_path.joinpath('XBT.EDF.gz')) >>> ax = cast['tem...
def function[from_edf, parameter[fname]]: constant[ DataFrame constructor to open XBT EDF ASCII format. Examples -------- >>> from pathlib import Path >>> import ctd >>> data_path = Path(__file__).parents[1].joinpath("tests", "data") >>> cast = ctd.from_edf(data_path.joinpath('XBT.E...
keyword[def] identifier[from_edf] ( identifier[fname] ): literal[string] identifier[f] = identifier[_read_file] ( identifier[fname] ) identifier[header] , identifier[names] =[],[] keyword[for] identifier[k] , identifier[line] keyword[in] identifier[enumerate] ( identifier[f] . identifier[readl...
def from_edf(fname): """ DataFrame constructor to open XBT EDF ASCII format. Examples -------- >>> from pathlib import Path >>> import ctd >>> data_path = Path(__file__).parents[1].joinpath("tests", "data") >>> cast = ctd.from_edf(data_path.joinpath('XBT.EDF.gz')) >>> ax = cast['tem...
def raise_204(instance): """Abort the current request with a 204 (No Content) response code. Clears out the body of the response. :param instance: Resource instance (used to access the response) :type instance: :class:`webob.resource.Resource` :raises: :class:`webob.exceptions.ResponseException` of...
def function[raise_204, parameter[instance]]: constant[Abort the current request with a 204 (No Content) response code. Clears out the body of the response. :param instance: Resource instance (used to access the response) :type instance: :class:`webob.resource.Resource` :raises: :class:`webob.e...
keyword[def] identifier[raise_204] ( identifier[instance] ): literal[string] identifier[instance] . identifier[response] . identifier[status] = literal[int] identifier[instance] . identifier[response] . identifier[body] = literal[string] identifier[instance] . identifier[response] . identifier[...
def raise_204(instance): """Abort the current request with a 204 (No Content) response code. Clears out the body of the response. :param instance: Resource instance (used to access the response) :type instance: :class:`webob.resource.Resource` :raises: :class:`webob.exceptions.ResponseException` of...
def supported_tasks(self, lang=None): """Languages that are covered by a specific task. Args: lang (string): Language code name. """ if lang: collection = self.get_collection(lang=lang) return [x.id.split('.')[0] for x in collection.packages] else: return [x.name.split()[0] ...
def function[supported_tasks, parameter[self, lang]]: constant[Languages that are covered by a specific task. Args: lang (string): Language code name. ] if name[lang] begin[:] variable[collection] assign[=] call[name[self].get_collection, parameter[]] return[<ast.L...
keyword[def] identifier[supported_tasks] ( identifier[self] , identifier[lang] = keyword[None] ): literal[string] keyword[if] identifier[lang] : identifier[collection] = identifier[self] . identifier[get_collection] ( identifier[lang] = identifier[lang] ) keyword[return] [ identifier[x] . id...
def supported_tasks(self, lang=None): """Languages that are covered by a specific task. Args: lang (string): Language code name. """ if lang: collection = self.get_collection(lang=lang) return [x.id.split('.')[0] for x in collection.packages] # depends on [control=['if'], data=[]...
def cv(data, channels=None): """ Calculate the Coeff. of Variation of the events in an FCSData object. Parameters ---------- data : FCSData or numpy array NxD flow cytometry data where N is the number of events and D is the number of parameters (aka channels). channels : int or ...
def function[cv, parameter[data, channels]]: constant[ Calculate the Coeff. of Variation of the events in an FCSData object. Parameters ---------- data : FCSData or numpy array NxD flow cytometry data where N is the number of events and D is the number of parameters (aka channel...
keyword[def] identifier[cv] ( identifier[data] , identifier[channels] = keyword[None] ): literal[string] keyword[if] identifier[channels] keyword[is] keyword[None] : identifier[data_stats] = identifier[data] keyword[else] : identifier[data_stats] = identifier[data] [:, ident...
def cv(data, channels=None): """ Calculate the Coeff. of Variation of the events in an FCSData object. Parameters ---------- data : FCSData or numpy array NxD flow cytometry data where N is the number of events and D is the number of parameters (aka channels). channels : int or ...
def has_files(self): """stub""" # I had to add the following check because file record types # don't seem to be implemented # correctly for raw edx Question objects if 'fileIds' not in self.my_osid_object._my_map: return False return bool(self.my_osid_object._...
def function[has_files, parameter[self]]: constant[stub] if compare[constant[fileIds] <ast.NotIn object at 0x7da2590d7190> name[self].my_osid_object._my_map] begin[:] return[constant[False]] return[call[name[bool], parameter[call[name[self].my_osid_object._my_map][constant[fileIds]]]]]
keyword[def] identifier[has_files] ( identifier[self] ): literal[string] keyword[if] literal[string] keyword[not] keyword[in] identifier[self] . identifier[my_osid_object] . identifier[_my_map] : keyword[return] keyword[False] keyword[return] ...
def has_files(self): """stub""" # I had to add the following check because file record types # don't seem to be implemented # correctly for raw edx Question objects if 'fileIds' not in self.my_osid_object._my_map: return False # depends on [control=['if'], data=[]] return bool(self.my_o...
def _extract_query(self, redirect_url): """Extract query parameters from a url. Parameters redirect_url (str) The full URL that the Lyft server redirected to after the user authorized your app. Returns (dict) A dictionary of...
def function[_extract_query, parameter[self, redirect_url]]: constant[Extract query parameters from a url. Parameters redirect_url (str) The full URL that the Lyft server redirected to after the user authorized your app. Returns (dict) ...
keyword[def] identifier[_extract_query] ( identifier[self] , identifier[redirect_url] ): literal[string] identifier[qs] = identifier[urlparse] ( identifier[redirect_url] ) identifier[qs] = identifier[qs] . identifier[query] identifier[query_params] = identifier[parse_q...
def _extract_query(self, redirect_url): """Extract query parameters from a url. Parameters redirect_url (str) The full URL that the Lyft server redirected to after the user authorized your app. Returns (dict) A dictionary of que...
def stream_by_id(self, dst_id): """ Return the :class:`Stream` that should be used to communicate with `dst_id`. If a specific route for `dst_id` is not known, a reference to the parent context's stream is returned. """ return ( self._stream_by_id.get(dst_id) ...
def function[stream_by_id, parameter[self, dst_id]]: constant[ Return the :class:`Stream` that should be used to communicate with `dst_id`. If a specific route for `dst_id` is not known, a reference to the parent context's stream is returned. ] return[<ast.BoolOp object at 0x...
keyword[def] identifier[stream_by_id] ( identifier[self] , identifier[dst_id] ): literal[string] keyword[return] ( identifier[self] . identifier[_stream_by_id] . identifier[get] ( identifier[dst_id] ) keyword[or] identifier[self] . identifier[_stream_by_id] . identifier[get] ( id...
def stream_by_id(self, dst_id): """ Return the :class:`Stream` that should be used to communicate with `dst_id`. If a specific route for `dst_id` is not known, a reference to the parent context's stream is returned. """ return self._stream_by_id.get(dst_id) or self._stream_by_id....
def make_call_keywords(stack_builders, count): """ Make the keywords entry for an ast.Call node. """ out = [] for _ in range(count): value = make_expr(stack_builders) load_kwname = stack_builders.pop() if not isinstance(load_kwname, instrs.LOAD_CONST): raise Decom...
def function[make_call_keywords, parameter[stack_builders, count]]: constant[ Make the keywords entry for an ast.Call node. ] variable[out] assign[=] list[[]] for taget[name[_]] in starred[call[name[range], parameter[name[count]]]] begin[:] variable[value] assign[=] call[...
keyword[def] identifier[make_call_keywords] ( identifier[stack_builders] , identifier[count] ): literal[string] identifier[out] =[] keyword[for] identifier[_] keyword[in] identifier[range] ( identifier[count] ): identifier[value] = identifier[make_expr] ( identifier[stack_builders] ) ...
def make_call_keywords(stack_builders, count): """ Make the keywords entry for an ast.Call node. """ out = [] for _ in range(count): value = make_expr(stack_builders) load_kwname = stack_builders.pop() if not isinstance(load_kwname, instrs.LOAD_CONST): raise Decom...
def FDMT_params(f_min, f_max, maxDT, inttime): """ Summarize DM grid and other parameters. """ maxDM = inttime*maxDT/(4.1488e-3 * (1/f_min**2 - 1/f_max**2)) logger.info('Freqs from {0}-{1}, MaxDT {2}, Int time {3} => maxDM {4}'.format(f_min, f_max, maxDT, inttime, maxDM))
def function[FDMT_params, parameter[f_min, f_max, maxDT, inttime]]: constant[ Summarize DM grid and other parameters. ] variable[maxDM] assign[=] binary_operation[binary_operation[name[inttime] * name[maxDT]] / binary_operation[constant[0.0041488] * binary_operation[binary_operation[constant[1] ...
keyword[def] identifier[FDMT_params] ( identifier[f_min] , identifier[f_max] , identifier[maxDT] , identifier[inttime] ): literal[string] identifier[maxDM] = identifier[inttime] * identifier[maxDT] /( literal[int] *( literal[int] / identifier[f_min] ** literal[int] - literal[int] / identifier[f_max] ** li...
def FDMT_params(f_min, f_max, maxDT, inttime): """ Summarize DM grid and other parameters. """ maxDM = inttime * maxDT / (0.0041488 * (1 / f_min ** 2 - 1 / f_max ** 2)) logger.info('Freqs from {0}-{1}, MaxDT {2}, Int time {3} => maxDM {4}'.format(f_min, f_max, maxDT, inttime, maxDM))
def get_filtered_graph(self, relations=None, prefix=None): """ Returns a networkx graph for the whole ontology, for a subset of relations Only implemented for eager methods. Implementation notes: currently this is not cached Arguments --------- - relations : ...
def function[get_filtered_graph, parameter[self, relations, prefix]]: constant[ Returns a networkx graph for the whole ontology, for a subset of relations Only implemented for eager methods. Implementation notes: currently this is not cached Arguments --------- ...
keyword[def] identifier[get_filtered_graph] ( identifier[self] , identifier[relations] = keyword[None] , identifier[prefix] = keyword[None] ): literal[string] identifier[self] . identifier[all_synonyms] () identifier[self] . identifier[all_obsoletes] () identif...
def get_filtered_graph(self, relations=None, prefix=None): """ Returns a networkx graph for the whole ontology, for a subset of relations Only implemented for eager methods. Implementation notes: currently this is not cached Arguments --------- - relations : list...
def _get_platform_patterns(spec, package, src_dir): """ yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. """ raw_patterns = itertools....
def function[_get_platform_patterns, parameter[spec, package, src_dir]]: constant[ yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. ] ...
keyword[def] identifier[_get_platform_patterns] ( identifier[spec] , identifier[package] , identifier[src_dir] ): literal[string] identifier[raw_patterns] = identifier[itertools] . identifier[chain] ( identifier[spec] . identifier[get] ( literal[string] ,[]), identifier[spec] . id...
def _get_platform_patterns(spec, package, src_dir): """ yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. """ raw_patterns = itertools.chain(sp...
def fetch_assets(self): """ download bootstrap assets to control host. If present on the control host they will be uploaded to the target host during bootstrapping. """ # allow overwrites from the commandline packages = set( env.instance.config.get('bootstrap-packages...
def function[fetch_assets, parameter[self]]: constant[ download bootstrap assets to control host. If present on the control host they will be uploaded to the target host during bootstrapping. ] variable[packages] assign[=] call[name[set], parameter[call[call[name[env].instance.config.get...
keyword[def] identifier[fetch_assets] ( identifier[self] ): literal[string] identifier[packages] = identifier[set] ( identifier[env] . identifier[instance] . identifier[config] . identifier[get] ( literal[string] , literal[string] ). identifier[split] ()) identifier[packa...
def fetch_assets(self): """ download bootstrap assets to control host. If present on the control host they will be uploaded to the target host during bootstrapping. """ # allow overwrites from the commandline packages = set(env.instance.config.get('bootstrap-packages', '').split()) packa...
def aws_to_unix_id(aws_key_id): """Converts a AWS Key ID into a UID""" uid_bytes = hashlib.sha256(aws_key_id.encode()).digest()[-2:] if USING_PYTHON2: return 2000 + int(from_bytes(uid_bytes) // 2) else: return 2000 + (int.from_bytes(uid_bytes, byteorder=sys.byteorder) // 2)
def function[aws_to_unix_id, parameter[aws_key_id]]: constant[Converts a AWS Key ID into a UID] variable[uid_bytes] assign[=] call[call[call[name[hashlib].sha256, parameter[call[name[aws_key_id].encode, parameter[]]]].digest, parameter[]]][<ast.Slice object at 0x7da1b07ae050>] if name[USING_PYTH...
keyword[def] identifier[aws_to_unix_id] ( identifier[aws_key_id] ): literal[string] identifier[uid_bytes] = identifier[hashlib] . identifier[sha256] ( identifier[aws_key_id] . identifier[encode] ()). identifier[digest] ()[- literal[int] :] keyword[if] identifier[USING_PYTHON2] : keyword[retu...
def aws_to_unix_id(aws_key_id): """Converts a AWS Key ID into a UID""" uid_bytes = hashlib.sha256(aws_key_id.encode()).digest()[-2:] if USING_PYTHON2: return 2000 + int(from_bytes(uid_bytes) // 2) # depends on [control=['if'], data=[]] else: return 2000 + int.from_bytes(uid_bytes, byteo...
def cut_by_plane(self, plane, inverted=False): ''' Like cut_across_axis, but works with an arbitrary plane. Keeps vertices that lie in front of the plane (i.e. in the direction of the plane normal). inverted: When `True`, invert the logic, to keep the vertices that lie...
def function[cut_by_plane, parameter[self, plane, inverted]]: constant[ Like cut_across_axis, but works with an arbitrary plane. Keeps vertices that lie in front of the plane (i.e. in the direction of the plane normal). inverted: When `True`, invert the logic, to keep the vertic...
keyword[def] identifier[cut_by_plane] ( identifier[self] , identifier[plane] , identifier[inverted] = keyword[False] ): literal[string] identifier[vertices_to_keep] = identifier[plane] . identifier[points_in_front] ( identifier[self] . identifier[v] , identifier[inverted] = identifier[inverted] , i...
def cut_by_plane(self, plane, inverted=False): """ Like cut_across_axis, but works with an arbitrary plane. Keeps vertices that lie in front of the plane (i.e. in the direction of the plane normal). inverted: When `True`, invert the logic, to keep the vertices that lie beh...
def call(self): """ call: ['mut'] ID ['(' parameters ')'] """ is_mutable = False if self.token.nature == Nature.MUT: is_mutable = True self._process(Nature.MUT) identifier = Identifier(name=self.token.value) self._process(Nature.ID) ...
def function[call, parameter[self]]: constant[ call: ['mut'] ID ['(' parameters ')'] ] variable[is_mutable] assign[=] constant[False] if compare[name[self].token.nature equal[==] name[Nature].MUT] begin[:] variable[is_mutable] assign[=] constant[True] ...
keyword[def] identifier[call] ( identifier[self] ): literal[string] identifier[is_mutable] = keyword[False] keyword[if] identifier[self] . identifier[token] . identifier[nature] == identifier[Nature] . identifier[MUT] : identifier[is_mutable] = keyword[True] id...
def call(self): """ call: ['mut'] ID ['(' parameters ')'] """ is_mutable = False if self.token.nature == Nature.MUT: is_mutable = True self._process(Nature.MUT) # depends on [control=['if'], data=[]] identifier = Identifier(name=self.token.value) self._process(Nature...
def _search_in_bases(type_): """Implementation detail.""" found = False for base_type in type_.declaration.bases: try: found = internal_type_traits.get_by_name( base_type.related_class, "element_type") except runtime_errors.declaration_not_found_t: pas...
def function[_search_in_bases, parameter[type_]]: constant[Implementation detail.] variable[found] assign[=] constant[False] for taget[name[base_type]] in starred[name[type_].declaration.bases] begin[:] <ast.Try object at 0x7da2041d8c70> if name[found] begin[:] ...
keyword[def] identifier[_search_in_bases] ( identifier[type_] ): literal[string] identifier[found] = keyword[False] keyword[for] identifier[base_type] keyword[in] identifier[type_] . identifier[declaration] . identifier[bases] : keyword[try] : identifier[found] = identifier[i...
def _search_in_bases(type_): """Implementation detail.""" found = False for base_type in type_.declaration.bases: try: found = internal_type_traits.get_by_name(base_type.related_class, 'element_type') # depends on [control=['try'], data=[]] except runtime_errors.declaration_not_...
def density(args): """ %prog density test.clm Estimate link density of contigs. """ p = OptionParser(density.__doc__) p.add_option("--save", default=False, action="store_true", help="Write log densitites of contigs to file") p.set_cpus() opts, args = p.parse_args(args) ...
def function[density, parameter[args]]: constant[ %prog density test.clm Estimate link density of contigs. ] variable[p] assign[=] call[name[OptionParser], parameter[name[density].__doc__]] call[name[p].add_option, parameter[constant[--save]]] call[name[p].set_cpus, paramete...
keyword[def] identifier[density] ( identifier[args] ): literal[string] identifier[p] = identifier[OptionParser] ( identifier[density] . identifier[__doc__] ) identifier[p] . identifier[add_option] ( literal[string] , identifier[default] = keyword[False] , identifier[action] = literal[string] , id...
def density(args): """ %prog density test.clm Estimate link density of contigs. """ p = OptionParser(density.__doc__) p.add_option('--save', default=False, action='store_true', help='Write log densitites of contigs to file') p.set_cpus() (opts, args) = p.parse_args(args) if len(args...
def download( self, file_name: str = "", block: bool = True, progress: callable = None, progress_args: tuple = () ) -> "Message": """Bound method *download* of :obj:`Message <pyrogram.Message>`. Use as a shortcut for: .. code-block:: python ...
def function[download, parameter[self, file_name, block, progress, progress_args]]: constant[Bound method *download* of :obj:`Message <pyrogram.Message>`. Use as a shortcut for: .. code-block:: python client.download_media(message) Example: .. code-block:: pyt...
keyword[def] identifier[download] ( identifier[self] , identifier[file_name] : identifier[str] = literal[string] , identifier[block] : identifier[bool] = keyword[True] , identifier[progress] : identifier[callable] = keyword[None] , identifier[progress_args] : identifier[tuple] =() )-> literal[string] : ...
def download(self, file_name: str='', block: bool=True, progress: callable=None, progress_args: tuple=()) -> 'Message': """Bound method *download* of :obj:`Message <pyrogram.Message>`. Use as a shortcut for: .. code-block:: python client.download_media(message) Example: ...
def ap_adc_encode(self, adc1, adc2, adc3, adc4, adc5, adc6): ''' raw ADC output adc1 : ADC output 1 (uint16_t) adc2 : ADC output 2 (uint16_t) adc3 : ADC output 3 (uint16_t) ...
def function[ap_adc_encode, parameter[self, adc1, adc2, adc3, adc4, adc5, adc6]]: constant[ raw ADC output adc1 : ADC output 1 (uint16_t) adc2 : ADC output 2 (uint16_t) adc3 : ADC outp...
keyword[def] identifier[ap_adc_encode] ( identifier[self] , identifier[adc1] , identifier[adc2] , identifier[adc3] , identifier[adc4] , identifier[adc5] , identifier[adc6] ): literal[string] keyword[return] identifier[MAVLink_ap_adc_message] ( identifier[adc1] , identifier[adc2] , ...
def ap_adc_encode(self, adc1, adc2, adc3, adc4, adc5, adc6): """ raw ADC output adc1 : ADC output 1 (uint16_t) adc2 : ADC output 2 (uint16_t) adc3 : ADC output 3 (uint16_t) ...
def percentage_progress(self): """ Returns a float between 0 and 1, representing the current job's progress in its task. If total_progress is not given or 0, just return self.progress. :return: float corresponding to the total percentage progress of the job. """ if self...
def function[percentage_progress, parameter[self]]: constant[ Returns a float between 0 and 1, representing the current job's progress in its task. If total_progress is not given or 0, just return self.progress. :return: float corresponding to the total percentage progress of the job. ...
keyword[def] identifier[percentage_progress] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[total_progress] != literal[int] : keyword[return] identifier[float] ( identifier[self] . identifier[progress] )/ identifier[self] . identifier[total_progress]...
def percentage_progress(self): """ Returns a float between 0 and 1, representing the current job's progress in its task. If total_progress is not given or 0, just return self.progress. :return: float corresponding to the total percentage progress of the job. """ if self.total_pr...
def encode(self, entity): """ Generate string of cwr format for all possible combinations of fields, accumulate and then elect the best. The best string it is who used most of all fields :param entity: :return: """ possible_results = [] entity_dict = self....
def function[encode, parameter[self, entity]]: constant[ Generate string of cwr format for all possible combinations of fields, accumulate and then elect the best. The best string it is who used most of all fields :param entity: :return: ] variable[possible_result...
keyword[def] identifier[encode] ( identifier[self] , identifier[entity] ): literal[string] identifier[possible_results] =[] identifier[entity_dict] = identifier[self] . identifier[get_entity_dict] ( identifier[entity] ) identifier[record_field_encoders] = identifier[self] . identi...
def encode(self, entity): """ Generate string of cwr format for all possible combinations of fields, accumulate and then elect the best. The best string it is who used most of all fields :param entity: :return: """ possible_results = [] entity_dict = self.get_entity_d...
def cache_penalty_model(penalty_model, database=None): """Caching function for penaltymodel_cache. Args: penalty_model (:class:`penaltymodel.PenaltyModel`): Penalty model to be cached. database (str, optional): The path to the desired sqlite database file. If None, will ...
def function[cache_penalty_model, parameter[penalty_model, database]]: constant[Caching function for penaltymodel_cache. Args: penalty_model (:class:`penaltymodel.PenaltyModel`): Penalty model to be cached. database (str, optional): The path to the desired sqlite database ...
keyword[def] identifier[cache_penalty_model] ( identifier[penalty_model] , identifier[database] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[_is_index_labelled] ( identifier[penalty_model] . identifier[graph] ): identifier[mapping] , identifier[__] = identifier[_g...
def cache_penalty_model(penalty_model, database=None): """Caching function for penaltymodel_cache. Args: penalty_model (:class:`penaltymodel.PenaltyModel`): Penalty model to be cached. database (str, optional): The path to the desired sqlite database file. If None, will ...
def fmt_data(text, data_formating = None, data_type = None): """ Format given text according to given data formating pattern or data type. """ if data_type: return DATA_TYPES[data_type](text) elif data_formating: return str(data_formating).format(text) ...
def function[fmt_data, parameter[text, data_formating, data_type]]: constant[ Format given text according to given data formating pattern or data type. ] if name[data_type] begin[:] return[call[call[name[DATA_TYPES]][name[data_type]], parameter[name[text]]]] return[call[name[...
keyword[def] identifier[fmt_data] ( identifier[text] , identifier[data_formating] = keyword[None] , identifier[data_type] = keyword[None] ): literal[string] keyword[if] identifier[data_type] : keyword[return] identifier[DATA_TYPES] [ identifier[data_type] ]( identifier[text] ) ...
def fmt_data(text, data_formating=None, data_type=None): """ Format given text according to given data formating pattern or data type. """ if data_type: return DATA_TYPES[data_type](text) # depends on [control=['if'], data=[]] elif data_formating: return str(data_formating)....
def edit_txt(filename, substitutions, newname=None): """Primitive text file stream editor. This function can be used to edit free-form text files such as the topology file. By default it does an **in-place edit** of *filename*. If *newname* is supplied then the edited file is written to *newname*. ...
def function[edit_txt, parameter[filename, substitutions, newname]]: constant[Primitive text file stream editor. This function can be used to edit free-form text files such as the topology file. By default it does an **in-place edit** of *filename*. If *newname* is supplied then the edited file...
keyword[def] identifier[edit_txt] ( identifier[filename] , identifier[substitutions] , identifier[newname] = keyword[None] ): literal[string] keyword[if] identifier[newname] keyword[is] keyword[None] : identifier[newname] = identifier[filename] identifier[_substitutions...
def edit_txt(filename, substitutions, newname=None): """Primitive text file stream editor. This function can be used to edit free-form text files such as the topology file. By default it does an **in-place edit** of *filename*. If *newname* is supplied then the edited file is written to *newname*. ...
def weights_concatenated(labels): """Assign weight 1.0 to the "target" part of the concatenated labels. The labels look like: source English I love you . ID1 target French Je t'aime . ID1 source English the cat ID1 target French le chat ID1 source English ... We want to assign weight 1.0 to all words ...
def function[weights_concatenated, parameter[labels]]: constant[Assign weight 1.0 to the "target" part of the concatenated labels. The labels look like: source English I love you . ID1 target French Je t'aime . ID1 source English the cat ID1 target French le chat ID1 source English ... We want t...
keyword[def] identifier[weights_concatenated] ( identifier[labels] ): literal[string] identifier[eos_mask] = identifier[tf] . identifier[to_int32] ( identifier[tf] . identifier[equal] ( identifier[labels] , literal[int] )) identifier[sentence_num] = identifier[tf] . identifier[cumsum] ( identifier[eos_mask]...
def weights_concatenated(labels): """Assign weight 1.0 to the "target" part of the concatenated labels. The labels look like: source English I love you . ID1 target French Je t'aime . ID1 source English the cat ID1 target French le chat ID1 source English ... We want to assign weight 1.0 to all word...
def consume(self, key, default=None, current=None, print_on_success=False): """ Consume a key from the configuration. When a key is consumed, it is removed from the configuration. If not found, the default is returned. If the current value is not None, it will be returned instea...
def function[consume, parameter[self, key, default, current, print_on_success]]: constant[ Consume a key from the configuration. When a key is consumed, it is removed from the configuration. If not found, the default is returned. If the current value is not None, it will be retu...
keyword[def] identifier[consume] ( identifier[self] , identifier[key] , identifier[default] = keyword[None] , identifier[current] = keyword[None] , identifier[print_on_success] = keyword[False] ): literal[string] identifier[value] = identifier[self] . identifier[_configuration] . identifier[pop] (...
def consume(self, key, default=None, current=None, print_on_success=False): """ Consume a key from the configuration. When a key is consumed, it is removed from the configuration. If not found, the default is returned. If the current value is not None, it will be returned instead, b...
def getHostCaPath(self, name): ''' Gets the path to the CA certificate that issued a given host keypair. Args: name (str): The name of the host keypair. Examples: Get the path to the CA cert which issue the cert for "myhost": mypath = cdir.getHo...
def function[getHostCaPath, parameter[self, name]]: constant[ Gets the path to the CA certificate that issued a given host keypair. Args: name (str): The name of the host keypair. Examples: Get the path to the CA cert which issue the cert for "myhost": ...
keyword[def] identifier[getHostCaPath] ( identifier[self] , identifier[name] ): literal[string] identifier[cert] = identifier[self] . identifier[getHostCert] ( identifier[name] ) keyword[if] identifier[cert] keyword[is] keyword[None] : keyword[return] keyword[None] ...
def getHostCaPath(self, name): """ Gets the path to the CA certificate that issued a given host keypair. Args: name (str): The name of the host keypair. Examples: Get the path to the CA cert which issue the cert for "myhost": mypath = cdir.getHostCa...
def make_zip(folder_path, output_filename): """将目录中除zip之外的文件打包成zip文件(包括子文件夹) 空文件夹不会被打包 example ---------------- make_zip('results','zips//招标信息结果_2017-05-09.zip') """ cwd = os.getcwd() # 获取需要打包的文件列表 file_lists = [] for root, dirs, files in os.walk(folder_path): for file ...
def function[make_zip, parameter[folder_path, output_filename]]: constant[将目录中除zip之外的文件打包成zip文件(包括子文件夹) 空文件夹不会被打包 example ---------------- make_zip('results','zips//招标信息结果_2017-05-09.zip') ] variable[cwd] assign[=] call[name[os].getcwd, parameter[]] variable[file_lists] assi...
keyword[def] identifier[make_zip] ( identifier[folder_path] , identifier[output_filename] ): literal[string] identifier[cwd] = identifier[os] . identifier[getcwd] () identifier[file_lists] =[] keyword[for] identifier[root] , identifier[dirs] , identifier[files] keyword[in] identifier[os]...
def make_zip(folder_path, output_filename): """将目录中除zip之外的文件打包成zip文件(包括子文件夹) 空文件夹不会被打包 example ---------------- make_zip('results','zips//招标信息结果_2017-05-09.zip') """ cwd = os.getcwd() # 获取需要打包的文件列表 file_lists = [] for (root, dirs, files) in os.walk(folder_path): for file...
def get_urls(self): """ Add a preview URL. """ from django.conf.urls import patterns, url urls = super(RecurrenceRuleAdmin, self).get_urls() my_urls = patterns( '', url( r'^preview/$', self.admin_site.admin_view(self...
def function[get_urls, parameter[self]]: constant[ Add a preview URL. ] from relative_module[django.conf.urls] import module[patterns], module[url] variable[urls] assign[=] call[call[name[super], parameter[name[RecurrenceRuleAdmin], name[self]]].get_urls, parameter[]] variabl...
keyword[def] identifier[get_urls] ( identifier[self] ): literal[string] keyword[from] identifier[django] . identifier[conf] . identifier[urls] keyword[import] identifier[patterns] , identifier[url] identifier[urls] = identifier[super] ( identifier[RecurrenceRuleAdmin] , identifier[self...
def get_urls(self): """ Add a preview URL. """ from django.conf.urls import patterns, url urls = super(RecurrenceRuleAdmin, self).get_urls() my_urls = patterns('', url('^preview/$', self.admin_site.admin_view(self.preview), name='icekit_events_recurrencerule_preview')) return my_urls...
def make_gym_env(name, rl_env_max_episode_steps=-1, maxskip_env=False, rendered_env=False, rendered_env_resize_to=None, sticky_actions=False): """Create a gym env optionally with a time limit and maxskip wrapper. NOTE: The returne...
def function[make_gym_env, parameter[name, rl_env_max_episode_steps, maxskip_env, rendered_env, rendered_env_resize_to, sticky_actions]]: constant[Create a gym env optionally with a time limit and maxskip wrapper. NOTE: The returned env may already be wrapped with TimeLimit! Args: name: `str` - base n...
keyword[def] identifier[make_gym_env] ( identifier[name] , identifier[rl_env_max_episode_steps] =- literal[int] , identifier[maxskip_env] = keyword[False] , identifier[rendered_env] = keyword[False] , identifier[rendered_env_resize_to] = keyword[None] , identifier[sticky_actions] = keyword[False] ): literal[s...
def make_gym_env(name, rl_env_max_episode_steps=-1, maxskip_env=False, rendered_env=False, rendered_env_resize_to=None, sticky_actions=False): """Create a gym env optionally with a time limit and maxskip wrapper. NOTE: The returned env may already be wrapped with TimeLimit! Args: name: `str` - base name o...
def create(gandi, datacenter, bandwidth, ip_version, vlan, ip, attach, background): """Create a public or private ip """ if ip_version != 4 and vlan: gandi.echo('You must have an --ip-version to 4 when having a vlan.') return if ip and not vlan: gandi.echo('You must h...
def function[create, parameter[gandi, datacenter, bandwidth, ip_version, vlan, ip, attach, background]]: constant[Create a public or private ip ] if <ast.BoolOp object at 0x7da20c6e6b60> begin[:] call[name[gandi].echo, parameter[constant[You must have an --ip-version to 4 when having...
keyword[def] identifier[create] ( identifier[gandi] , identifier[datacenter] , identifier[bandwidth] , identifier[ip_version] , identifier[vlan] , identifier[ip] , identifier[attach] , identifier[background] ): literal[string] keyword[if] identifier[ip_version] != literal[int] keyword[and] identifier[v...
def create(gandi, datacenter, bandwidth, ip_version, vlan, ip, attach, background): """Create a public or private ip """ if ip_version != 4 and vlan: gandi.echo('You must have an --ip-version to 4 when having a vlan.') return # depends on [control=['if'], data=[]] if ip and (not vlan): ...