code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def start(info): """Run the dev server. Uses `django_extensions <http://pypi.python.org/pypi/django-extensions/0.5>`, if available, to provide `runserver_plus`. Set the command to use with `options.paved.django.runserver` Set the port to use with `options.paved.django.runserver_port` """ c...
def function[start, parameter[info]]: constant[Run the dev server. Uses `django_extensions <http://pypi.python.org/pypi/django-extensions/0.5>`, if available, to provide `runserver_plus`. Set the command to use with `options.paved.django.runserver` Set the port to use with `options.paved.djang...
keyword[def] identifier[start] ( identifier[info] ): literal[string] identifier[cmd] = identifier[options] . identifier[paved] . identifier[django] . identifier[runserver] keyword[if] identifier[cmd] == literal[string] : keyword[try] : keyword[import] identifier[django_extens...
def start(info): """Run the dev server. Uses `django_extensions <http://pypi.python.org/pypi/django-extensions/0.5>`, if available, to provide `runserver_plus`. Set the command to use with `options.paved.django.runserver` Set the port to use with `options.paved.django.runserver_port` """ c...
def skill_configuration(self): # type: () -> SkillConfiguration """Create the skill configuration object using the registered components. """ skill_config = super(StandardSkillBuilder, self).skill_configuration skill_config.api_client = DefaultApiClient() if self...
def function[skill_configuration, parameter[self]]: constant[Create the skill configuration object using the registered components. ] variable[skill_config] assign[=] call[name[super], parameter[name[StandardSkillBuilder], name[self]]].skill_configuration name[skill_config].api_c...
keyword[def] identifier[skill_configuration] ( identifier[self] ): literal[string] identifier[skill_config] = identifier[super] ( identifier[StandardSkillBuilder] , identifier[self] ). identifier[skill_configuration] identifier[skill_config] . identifier[api_client] = identifier[DefaultA...
def skill_configuration(self): # type: () -> SkillConfiguration 'Create the skill configuration object using the registered\n components.\n ' skill_config = super(StandardSkillBuilder, self).skill_configuration skill_config.api_client = DefaultApiClient() if self.table_name is not None...
def apply_tfms(self, tfms:TfmList, do_resolve:bool=True, xtra:Optional[Dict[Callable,dict]]=None, size:Optional[Union[int,TensorImageSize]]=None, resize_method:ResizeMethod=None, mult:int=None, padding_mode:str='reflection', mode:str='bilinear', remove_out:bool=True)->TensorImage: ...
def function[apply_tfms, parameter[self, tfms, do_resolve, xtra, size, resize_method, mult, padding_mode, mode, remove_out]]: constant[Apply all `tfms` to the `Image`, if `do_resolve` picks value for random args.] if <ast.UnaryOp object at 0x7da1b1eb4a00> begin[:] return[name[self]] vari...
keyword[def] identifier[apply_tfms] ( identifier[self] , identifier[tfms] : identifier[TfmList] , identifier[do_resolve] : identifier[bool] = keyword[True] , identifier[xtra] : identifier[Optional] [ identifier[Dict] [ identifier[Callable] , identifier[dict] ]]= keyword[None] , identifier[size] : identifier[Optional...
def apply_tfms(self, tfms: TfmList, do_resolve: bool=True, xtra: Optional[Dict[Callable, dict]]=None, size: Optional[Union[int, TensorImageSize]]=None, resize_method: ResizeMethod=None, mult: int=None, padding_mode: str='reflection', mode: str='bilinear', remove_out: bool=True) -> TensorImage: """Apply all `tfms` t...
def set_pwm(self, channel, on, off): """Sets a single PWM channel.""" self.i2c.write8(LED0_ON_L+4*channel, on & 0xFF) self.i2c.write8(LED0_ON_H+4*channel, on >> 8) self.i2c.write8(LED0_OFF_L+4*channel, off & 0xFF) self.i2c.write8(LED0_OFF_H+4*channel, off >> 8)
def function[set_pwm, parameter[self, channel, on, off]]: constant[Sets a single PWM channel.] call[name[self].i2c.write8, parameter[binary_operation[name[LED0_ON_L] + binary_operation[constant[4] * name[channel]]], binary_operation[name[on] <ast.BitAnd object at 0x7da2590d6b60> constant[255]]]] ...
keyword[def] identifier[set_pwm] ( identifier[self] , identifier[channel] , identifier[on] , identifier[off] ): literal[string] identifier[self] . identifier[i2c] . identifier[write8] ( identifier[LED0_ON_L] + literal[int] * identifier[channel] , identifier[on] & literal[int] ) identifier[...
def set_pwm(self, channel, on, off): """Sets a single PWM channel.""" self.i2c.write8(LED0_ON_L + 4 * channel, on & 255) self.i2c.write8(LED0_ON_H + 4 * channel, on >> 8) self.i2c.write8(LED0_OFF_L + 4 * channel, off & 255) self.i2c.write8(LED0_OFF_H + 4 * channel, off >> 8)
def get_variables_path(export_dir): """Returns the path for storing variables checkpoints.""" return os.path.join( tf.compat.as_bytes(export_dir), tf.compat.as_bytes(tf_v1.saved_model.constants.VARIABLES_DIRECTORY), tf.compat.as_bytes(tf_v1.saved_model.constants.VARIABLES_FILENAME))
def function[get_variables_path, parameter[export_dir]]: constant[Returns the path for storing variables checkpoints.] return[call[name[os].path.join, parameter[call[name[tf].compat.as_bytes, parameter[name[export_dir]]], call[name[tf].compat.as_bytes, parameter[name[tf_v1].saved_model.constants.VARIABLES_D...
keyword[def] identifier[get_variables_path] ( identifier[export_dir] ): literal[string] keyword[return] identifier[os] . identifier[path] . identifier[join] ( identifier[tf] . identifier[compat] . identifier[as_bytes] ( identifier[export_dir] ), identifier[tf] . identifier[compat] . identifier[as_bytes]...
def get_variables_path(export_dir): """Returns the path for storing variables checkpoints.""" return os.path.join(tf.compat.as_bytes(export_dir), tf.compat.as_bytes(tf_v1.saved_model.constants.VARIABLES_DIRECTORY), tf.compat.as_bytes(tf_v1.saved_model.constants.VARIABLES_FILENAME))
async def restore_storage_configuration(self): """ Restore machine's storage configuration to its initial state. """ self._data = await self._handler.restore_storage_configuration( system_id=self.system_id)
<ast.AsyncFunctionDef object at 0x7da20c992bc0>
keyword[async] keyword[def] identifier[restore_storage_configuration] ( identifier[self] ): literal[string] identifier[self] . identifier[_data] = keyword[await] identifier[self] . identifier[_handler] . identifier[restore_storage_configuration] ( identifier[system_id] = identifier[self]...
async def restore_storage_configuration(self): """ Restore machine's storage configuration to its initial state. """ self._data = await self._handler.restore_storage_configuration(system_id=self.system_id)
def run_continuously(self, interval=1): """Continuously run, while executing pending jobs at each elapsed time interval. @return cease_continuous_run: threading.Event which can be set to cease continuous run. Please note that it is *intended behavior that run_continuously() ...
def function[run_continuously, parameter[self, interval]]: constant[Continuously run, while executing pending jobs at each elapsed time interval. @return cease_continuous_run: threading.Event which can be set to cease continuous run. Please note that it is *intended behavior th...
keyword[def] identifier[run_continuously] ( identifier[self] , identifier[interval] = literal[int] ): literal[string] identifier[cease_continuous_run] = identifier[threading] . identifier[Event] () keyword[class] identifier[ScheduleThread] ( identifier[threading] . identifier[Thread] ): ...
def run_continuously(self, interval=1): """Continuously run, while executing pending jobs at each elapsed time interval. @return cease_continuous_run: threading.Event which can be set to cease continuous run. Please note that it is *intended behavior that run_continuously() ...
def plot_attention(attention_matrix: np.ndarray, source_tokens: List[str], target_tokens: List[str], filename: str): """ Uses matplotlib for creating a visualization of the attention matrix. :param attention_matrix: The attention matrix. :param source_tokens: A list of source tokens. :param target_...
def function[plot_attention, parameter[attention_matrix, source_tokens, target_tokens, filename]]: constant[ Uses matplotlib for creating a visualization of the attention matrix. :param attention_matrix: The attention matrix. :param source_tokens: A list of source tokens. :param target_tokens: ...
keyword[def] identifier[plot_attention] ( identifier[attention_matrix] : identifier[np] . identifier[ndarray] , identifier[source_tokens] : identifier[List] [ identifier[str] ], identifier[target_tokens] : identifier[List] [ identifier[str] ], identifier[filename] : identifier[str] ): literal[string] keywo...
def plot_attention(attention_matrix: np.ndarray, source_tokens: List[str], target_tokens: List[str], filename: str): """ Uses matplotlib for creating a visualization of the attention matrix. :param attention_matrix: The attention matrix. :param source_tokens: A list of source tokens. :param target_...
def _validate_dt64_dtype(dtype): """ Check that a dtype, if passed, represents either a numpy datetime64[ns] dtype or a pandas DatetimeTZDtype. Parameters ---------- dtype : object Returns ------- dtype : None, numpy.dtype, or DatetimeTZDtype Raises ------ ValueError :...
def function[_validate_dt64_dtype, parameter[dtype]]: constant[ Check that a dtype, if passed, represents either a numpy datetime64[ns] dtype or a pandas DatetimeTZDtype. Parameters ---------- dtype : object Returns ------- dtype : None, numpy.dtype, or DatetimeTZDtype Rai...
keyword[def] identifier[_validate_dt64_dtype] ( identifier[dtype] ): literal[string] keyword[if] identifier[dtype] keyword[is] keyword[not] keyword[None] : identifier[dtype] = identifier[pandas_dtype] ( identifier[dtype] ) keyword[if] identifier[is_dtype_equal] ( identifier[dtype] , ...
def _validate_dt64_dtype(dtype): """ Check that a dtype, if passed, represents either a numpy datetime64[ns] dtype or a pandas DatetimeTZDtype. Parameters ---------- dtype : object Returns ------- dtype : None, numpy.dtype, or DatetimeTZDtype Raises ------ ValueError :...
async def update_current_price_info(self): """Update current price info async.""" query = gql( """ { viewer { home(id: "%s") { currentSubscription { priceInfo { current { energy ...
<ast.AsyncFunctionDef object at 0x7da1affc1a80>
keyword[async] keyword[def] identifier[update_current_price_info] ( identifier[self] ): literal[string] identifier[query] = identifier[gql] ( literal[string] % identifier[self] . identifier[home_id] ) identifier[price_info_temp] = keyword[await] identifier[self...
async def update_current_price_info(self): """Update current price info async.""" query = gql('\n {\n viewer {\n home(id: "%s") {\n currentSubscription {\n priceInfo {\n current {\n energy\n tax\n ...
def update_main_table(self): """Write generator settings to database. """ data = (json.dumps(self.settings),) self.cursor.execute(''' CREATE TABLE IF NOT EXISTS main ( settings TEXT NOT NULL DEFAULT "{}" ) ''') self.cursor.execute('...
def function[update_main_table, parameter[self]]: constant[Write generator settings to database. ] variable[data] assign[=] tuple[[<ast.Call object at 0x7da20cabf640>]] call[name[self].cursor.execute, parameter[constant[ CREATE TABLE IF NOT EXISTS main ( setti...
keyword[def] identifier[update_main_table] ( identifier[self] ): literal[string] identifier[data] =( identifier[json] . identifier[dumps] ( identifier[self] . identifier[settings] ),) identifier[self] . identifier[cursor] . identifier[execute] ( literal[string] ) identifier[self] ...
def update_main_table(self): """Write generator settings to database. """ data = (json.dumps(self.settings),) self.cursor.execute('\n CREATE TABLE IF NOT EXISTS main (\n settings TEXT NOT NULL DEFAULT "{}"\n )\n ') self.cursor.execute('SELECT * FROM ma...
def box(text): r"""Wrap a chunk of text in a box. Example: >>> print(box('line1\nline2')) ┌───────┐ │ line1 │ │ line2 │ └───────┘ """ lines = text.split('\n') width = max(len(l) for l in lines) top_bar = (TOP_LEFT_CORNER + HORIZONTAL_BAR * (2 + width) + ...
def function[box, parameter[text]]: constant[Wrap a chunk of text in a box. Example: >>> print(box('line1\nline2')) ┌───────┐ │ line1 │ │ line2 │ └───────┘ ] variable[lines] assign[=] call[name[text].split, parameter[constant[ ]]] variable[width] ...
keyword[def] identifier[box] ( identifier[text] ): literal[string] identifier[lines] = identifier[text] . identifier[split] ( literal[string] ) identifier[width] = identifier[max] ( identifier[len] ( identifier[l] ) keyword[for] identifier[l] keyword[in] identifier[lines] ) identifier[top_bar...
def box(text): """Wrap a chunk of text in a box. Example: >>> print(box('line1\\nline2')) ┌───────┐ │ line1 │ │ line2 │ └───────┘ """ lines = text.split('\n') width = max((len(l) for l in lines)) top_bar = TOP_LEFT_CORNER + HORIZONTAL_BAR * (2 + width) + ...
def rlmb_tiny_sv2p(): """Tiny setting with a tiny sv2p model.""" hparams = rlmb_ppo_tiny() hparams.generative_model = "next_frame_sv2p" hparams.generative_model_params = "next_frame_sv2p_tiny" hparams.grayscale = False return hparams
def function[rlmb_tiny_sv2p, parameter[]]: constant[Tiny setting with a tiny sv2p model.] variable[hparams] assign[=] call[name[rlmb_ppo_tiny], parameter[]] name[hparams].generative_model assign[=] constant[next_frame_sv2p] name[hparams].generative_model_params assign[=] constant[next_fr...
keyword[def] identifier[rlmb_tiny_sv2p] (): literal[string] identifier[hparams] = identifier[rlmb_ppo_tiny] () identifier[hparams] . identifier[generative_model] = literal[string] identifier[hparams] . identifier[generative_model_params] = literal[string] identifier[hparams] . identifier[grayscale] ...
def rlmb_tiny_sv2p(): """Tiny setting with a tiny sv2p model.""" hparams = rlmb_ppo_tiny() hparams.generative_model = 'next_frame_sv2p' hparams.generative_model_params = 'next_frame_sv2p_tiny' hparams.grayscale = False return hparams
def build_row(self, line): """ Line describes an image or images to show Returns a dict with a list of dicts of image names or text items Examples: # A single image to display >>> x.build_row('foo.png') [{'image': 'foo.png'}] # Two images with text in between:...
def function[build_row, parameter[self, line]]: constant[ Line describes an image or images to show Returns a dict with a list of dicts of image names or text items Examples: # A single image to display >>> x.build_row('foo.png') [{'image': 'foo.png'}] # Two i...
keyword[def] identifier[build_row] ( identifier[self] , identifier[line] ): literal[string] identifier[items] =[] identifier[row] = identifier[dict] ( identifier[items] = identifier[items] ) identifier[fields] = identifier[line] . identifier[split] ( literal[string] ) i...
def build_row(self, line): """ Line describes an image or images to show Returns a dict with a list of dicts of image names or text items Examples: # A single image to display >>> x.build_row('foo.png') [{'image': 'foo.png'}] # Two images with text in between: ...
def run_with_standalone_parser(self): """ Will run the operation as standalone with a new ArgumentParser """ parser = argparse.ArgumentParser(description=self.description()) self.configure_parser(parser) self.run(parser.parse_args())
def function[run_with_standalone_parser, parameter[self]]: constant[ Will run the operation as standalone with a new ArgumentParser ] variable[parser] assign[=] call[name[argparse].ArgumentParser, parameter[]] call[name[self].configure_parser, parameter[name[parser]]] cal...
keyword[def] identifier[run_with_standalone_parser] ( identifier[self] ): literal[string] identifier[parser] = identifier[argparse] . identifier[ArgumentParser] ( identifier[description] = identifier[self] . identifier[description] ()) identifier[self] . identifier[configure_parser] ( iden...
def run_with_standalone_parser(self): """ Will run the operation as standalone with a new ArgumentParser """ parser = argparse.ArgumentParser(description=self.description()) self.configure_parser(parser) self.run(parser.parse_args())
def char_in(string, func_name): '''return current char and step if char is in string, where @test: a python function with one argument, which tests on one char and return True or False @test must be registered with register_function''' function = register_function(func_name, ...
def function[char_in, parameter[string, func_name]]: constant[return current char and step if char is in string, where @test: a python function with one argument, which tests on one char and return True or False @test must be registered with register_function] variable[function] assign[=] ...
keyword[def] identifier[char_in] ( identifier[string] , identifier[func_name] ): literal[string] identifier[function] = identifier[register_function] ( identifier[func_name] , keyword[lambda] identifier[char] : identifier[char] keyword[in] identifier[string] ) keyword[return] identifier[char_on_p...
def char_in(string, func_name): """return current char and step if char is in string, where @test: a python function with one argument, which tests on one char and return True or False @test must be registered with register_function""" function = register_function(func_name, lambda char: char in s...
def interactive_update_profile_vars(self): """ Function to update the `cloudgenix.API` object with profile info. Run after login or client login. **Returns:** Boolean on success/failure, """ profile = self._parent_class.get.profile() if profile.cgx_status: ...
def function[interactive_update_profile_vars, parameter[self]]: constant[ Function to update the `cloudgenix.API` object with profile info. Run after login or client login. **Returns:** Boolean on success/failure, ] variable[profile] assign[=] call[name[self]._parent_class.get.p...
keyword[def] identifier[interactive_update_profile_vars] ( identifier[self] ): literal[string] identifier[profile] = identifier[self] . identifier[_parent_class] . identifier[get] . identifier[profile] () keyword[if] identifier[profile] . identifier[cgx_status] : ...
def interactive_update_profile_vars(self): """ Function to update the `cloudgenix.API` object with profile info. Run after login or client login. **Returns:** Boolean on success/failure, """ profile = self._parent_class.get.profile() if profile.cgx_status: # if successful, s...
def join(args): """ %prog join file1.txt(pivotfile) file2.txt .. Join tabular-like files based on common column. --column specifies the column index to pivot on. Use comma to separate multiple values if the pivot column is different in each file. Maintain the order in the first file. --...
def function[join, parameter[args]]: constant[ %prog join file1.txt(pivotfile) file2.txt .. Join tabular-like files based on common column. --column specifies the column index to pivot on. Use comma to separate multiple values if the pivot column is different in each file. Maintain the ...
keyword[def] identifier[join] ( identifier[args] ): literal[string] identifier[p] = identifier[OptionParser] ( identifier[join] . identifier[__doc__] ) identifier[p] . identifier[add_option] ( literal[string] , identifier[default] = literal[string] , identifier[help] = literal[string] ) iden...
def join(args): """ %prog join file1.txt(pivotfile) file2.txt .. Join tabular-like files based on common column. --column specifies the column index to pivot on. Use comma to separate multiple values if the pivot column is different in each file. Maintain the order in the first file. --...
def _writeWordFromSentenceInBlock(word, blockID, sentenceID, wordID): '''writes the word from a sentence in a block to a file with the id''' with open("wordIDs.txt", "a") as fp: fp.write("wordID: " + str(blockID) + "_" + str(sentenceID) + "_" + str(wordID) + "\n") fp.write("word...
def function[_writeWordFromSentenceInBlock, parameter[word, blockID, sentenceID, wordID]]: constant[writes the word from a sentence in a block to a file with the id] with call[name[open], parameter[constant[wordIDs.txt], constant[a]]] begin[:] call[name[fp].write, parameter[binary_operat...
keyword[def] identifier[_writeWordFromSentenceInBlock] ( identifier[word] , identifier[blockID] , identifier[sentenceID] , identifier[wordID] ): literal[string] keyword[with] identifier[open] ( literal[string] , literal[string] ) keyword[as] identifier[fp] : identifier[fp] . identifier[write] ( ...
def _writeWordFromSentenceInBlock(word, blockID, sentenceID, wordID): """writes the word from a sentence in a block to a file with the id""" with open('wordIDs.txt', 'a') as fp: fp.write('wordID: ' + str(blockID) + '_' + str(sentenceID) + '_' + str(wordID) + '\n') fp.write('wordString: ' + word ...
def get_user(name, profile='github', user_details=False): ''' Get a GitHub user by name. name The user for which to obtain information. profile The name of the profile configuration to use. Defaults to ``github``. user_details Prints user information details. Defaults to `...
def function[get_user, parameter[name, profile, user_details]]: constant[ Get a GitHub user by name. name The user for which to obtain information. profile The name of the profile configuration to use. Defaults to ``github``. user_details Prints user information detail...
keyword[def] identifier[get_user] ( identifier[name] , identifier[profile] = literal[string] , identifier[user_details] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[user_details] keyword[and] identifier[name] keyword[in] identifier[list_users] ( identifier[profile] ): ...
def get_user(name, profile='github', user_details=False): """ Get a GitHub user by name. name The user for which to obtain information. profile The name of the profile configuration to use. Defaults to ``github``. user_details Prints user information details. Defaults to `...
def remove_repeated_comments(node): """Remove comments that repeat themselves. Multiple statements might be annotated with the same comment. This way if one of the statements is deleted during optimization passes, the comment won't be lost. This pass removes sequences of identical comments, leaving only the ...
def function[remove_repeated_comments, parameter[node]]: constant[Remove comments that repeat themselves. Multiple statements might be annotated with the same comment. This way if one of the statements is deleted during optimization passes, the comment won't be lost. This pass removes sequences of identi...
keyword[def] identifier[remove_repeated_comments] ( identifier[node] ): literal[string] identifier[last_comment] ={ literal[string] : keyword[None] } keyword[for] identifier[_node] keyword[in] identifier[gast] . identifier[walk] ( identifier[node] ): keyword[if] identifier[anno] . identifier[hasann...
def remove_repeated_comments(node): """Remove comments that repeat themselves. Multiple statements might be annotated with the same comment. This way if one of the statements is deleted during optimization passes, the comment won't be lost. This pass removes sequences of identical comments, leaving only the ...
def _get_simsuccessors(self, addr, job, current_function_addr=None): """ Create the SimSuccessors instance for a block. :param int addr: Address of the block. :param CFGJob job: The CFG job instance with an input state inside. :param int current_f...
def function[_get_simsuccessors, parameter[self, addr, job, current_function_addr]]: constant[ Create the SimSuccessors instance for a block. :param int addr: Address of the block. :param CFGJob job: The CFG job instance with an input state inside. ...
keyword[def] identifier[_get_simsuccessors] ( identifier[self] , identifier[addr] , identifier[job] , identifier[current_function_addr] = keyword[None] ): literal[string] identifier[exception_info] = keyword[None] identifier[state] = identifier[job] . identifier[state] identifi...
def _get_simsuccessors(self, addr, job, current_function_addr=None): """ Create the SimSuccessors instance for a block. :param int addr: Address of the block. :param CFGJob job: The CFG job instance with an input state inside. :param int current_funct...
def __isValidFilename(self, filename): """Determine whether filename is valid""" if filename and isinstance(filename, string_types): if re.match(r'^[\w\d\_\-\.]+$', filename, re.I): if self.__isValidTGZ(filename) or self.__isValidZIP(filename): return...
def function[__isValidFilename, parameter[self, filename]]: constant[Determine whether filename is valid] if <ast.BoolOp object at 0x7da1b0cba1d0> begin[:] if call[name[re].match, parameter[constant[^[\w\d\_\-\.]+$], name[filename], name[re].I]] begin[:] if <ast.B...
keyword[def] identifier[__isValidFilename] ( identifier[self] , identifier[filename] ): literal[string] keyword[if] identifier[filename] keyword[and] identifier[isinstance] ( identifier[filename] , identifier[string_types] ): keyword[if] identifier[re] . identifier[match] ( lite...
def __isValidFilename(self, filename): """Determine whether filename is valid""" if filename and isinstance(filename, string_types): if re.match('^[\\w\\d\\_\\-\\.]+$', filename, re.I): if self.__isValidTGZ(filename) or self.__isValidZIP(filename): return True # depends on [...
def to_json_data(self): """ Returns ------- A dictionary of serialized data. """ # create data d = collections.OrderedDict((t.get_ref(), t.to_json_data()) for t in self._tables.values()) d["_comment"] = self._comment d.move_to_end("_comment", last=...
def function[to_json_data, parameter[self]]: constant[ Returns ------- A dictionary of serialized data. ] variable[d] assign[=] call[name[collections].OrderedDict, parameter[<ast.GeneratorExp object at 0x7da20c795c90>]] call[name[d]][constant[_comment]] assign[=] ...
keyword[def] identifier[to_json_data] ( identifier[self] ): literal[string] identifier[d] = identifier[collections] . identifier[OrderedDict] (( identifier[t] . identifier[get_ref] (), identifier[t] . identifier[to_json_data] ()) keyword[for] identifier[t] keyword[in] identifier[self] ....
def to_json_data(self): """ Returns ------- A dictionary of serialized data. """ # create data d = collections.OrderedDict(((t.get_ref(), t.to_json_data()) for t in self._tables.values())) d['_comment'] = self._comment d.move_to_end('_comment', last=False) d['_ext...
def activate(self, path, isdirectory): """ Set up a boto connection. """ from .utils import connection_with_anon, connection_with_gs parsed = BotoClient.parse_query(path) scheme = parsed[0] bucket_name = parsed[1] key = parsed[2] if scheme == 's...
def function[activate, parameter[self, path, isdirectory]]: constant[ Set up a boto connection. ] from relative_module[utils] import module[connection_with_anon], module[connection_with_gs] variable[parsed] assign[=] call[name[BotoClient].parse_query, parameter[name[path]]] v...
keyword[def] identifier[activate] ( identifier[self] , identifier[path] , identifier[isdirectory] ): literal[string] keyword[from] . identifier[utils] keyword[import] identifier[connection_with_anon] , identifier[connection_with_gs] identifier[parsed] = identifier[BotoClient] . identif...
def activate(self, path, isdirectory): """ Set up a boto connection. """ from .utils import connection_with_anon, connection_with_gs parsed = BotoClient.parse_query(path) scheme = parsed[0] bucket_name = parsed[1] key = parsed[2] if scheme == 's3' or scheme == 's3n': ...
def Get_rhos(dur, **kwargs): ''' Returns the value of the stellar density for a given transit duration :py:obj:`dur`, given the :py:class:`everest.pysyzygy` transit :py:obj:`kwargs`. ''' if ps is None: raise Exception("Unable to import `pysyzygy`.") assert dur >= 0.01 and dur <...
def function[Get_rhos, parameter[dur]]: constant[ Returns the value of the stellar density for a given transit duration :py:obj:`dur`, given the :py:class:`everest.pysyzygy` transit :py:obj:`kwargs`. ] if compare[name[ps] is constant[None]] begin[:] <ast.Raise object at 0x7da1b0...
keyword[def] identifier[Get_rhos] ( identifier[dur] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[ps] keyword[is] keyword[None] : keyword[raise] identifier[Exception] ( literal[string] ) keyword[assert] identifier[dur] >= literal[int] keyword[and] identifier[dur...
def Get_rhos(dur, **kwargs): """ Returns the value of the stellar density for a given transit duration :py:obj:`dur`, given the :py:class:`everest.pysyzygy` transit :py:obj:`kwargs`. """ if ps is None: raise Exception('Unable to import `pysyzygy`.') # depends on [control=['if'], data=[...
def plot_profile(ribo_counts, transcript_name, transcript_length, start_stops, read_lengths=None, read_offsets=None, rna_counts=None, color_scheme='default', html_file='index.html', output_path='output'): """Plot read counts (in all 3 frames) and RNA coverage if provided for a ...
def function[plot_profile, parameter[ribo_counts, transcript_name, transcript_length, start_stops, read_lengths, read_offsets, rna_counts, color_scheme, html_file, output_path]]: constant[Plot read counts (in all 3 frames) and RNA coverage if provided for a single transcript. ] variable[colors]...
keyword[def] identifier[plot_profile] ( identifier[ribo_counts] , identifier[transcript_name] , identifier[transcript_length] , identifier[start_stops] , identifier[read_lengths] = keyword[None] , identifier[read_offsets] = keyword[None] , identifier[rna_counts] = keyword[None] , identifier[color_scheme] = literal[...
def plot_profile(ribo_counts, transcript_name, transcript_length, start_stops, read_lengths=None, read_offsets=None, rna_counts=None, color_scheme='default', html_file='index.html', output_path='output'): """Plot read counts (in all 3 frames) and RNA coverage if provided for a single transcript. """ co...
def _assert_refspec(self): """Turns out we can't deal with remotes if the refspec is missing""" config = self.config_reader unset = 'placeholder' try: if config.get_value('fetch', default=unset) is unset: msg = "Remote '%s' has no refspec set.\n" ...
def function[_assert_refspec, parameter[self]]: constant[Turns out we can't deal with remotes if the refspec is missing] variable[config] assign[=] name[self].config_reader variable[unset] assign[=] constant[placeholder] <ast.Try object at 0x7da204346b60>
keyword[def] identifier[_assert_refspec] ( identifier[self] ): literal[string] identifier[config] = identifier[self] . identifier[config_reader] identifier[unset] = literal[string] keyword[try] : keyword[if] identifier[config] . identifier[get_value] ( literal[stri...
def _assert_refspec(self): """Turns out we can't deal with remotes if the refspec is missing""" config = self.config_reader unset = 'placeholder' try: if config.get_value('fetch', default=unset) is unset: msg = "Remote '%s' has no refspec set.\n" msg += 'You can set it as...
def tasks_by_tag(self, registry_tag): """ Get tasks from registry by its tag :param registry_tag: any hash-able object :return: Return task (if :attr:`.WTaskRegistryStorage.__multiple_tasks_per_tag__` is not True) or \ list of tasks """ if registry_tag not in self.__registry.keys(): return None tasks ...
def function[tasks_by_tag, parameter[self, registry_tag]]: constant[ Get tasks from registry by its tag :param registry_tag: any hash-able object :return: Return task (if :attr:`.WTaskRegistryStorage.__multiple_tasks_per_tag__` is not True) or list of tasks ] if compare[name[registry_tag] <ast....
keyword[def] identifier[tasks_by_tag] ( identifier[self] , identifier[registry_tag] ): literal[string] keyword[if] identifier[registry_tag] keyword[not] keyword[in] identifier[self] . identifier[__registry] . identifier[keys] (): keyword[return] keyword[None] identifier[tasks] = identifier[self] ....
def tasks_by_tag(self, registry_tag): """ Get tasks from registry by its tag :param registry_tag: any hash-able object :return: Return task (if :attr:`.WTaskRegistryStorage.__multiple_tasks_per_tag__` is not True) or list of tasks """ if registry_tag not in self.__registry.keys(): return None ...
def asset_create_task(self, *args, **kwargs): """Create a new task :returns: None :rtype: None :raises: None """ if not self.cur_asset: return task = self.create_task(element=self.cur_asset) if task: taskdata = djitemdata.TaskItemD...
def function[asset_create_task, parameter[self]]: constant[Create a new task :returns: None :rtype: None :raises: None ] if <ast.UnaryOp object at 0x7da1b141e560> begin[:] return[None] variable[task] assign[=] call[name[self].create_task, parameter[]] ...
keyword[def] identifier[asset_create_task] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[cur_asset] : keyword[return] identifier[task] = identifier[self] . identifier[create_task] ( id...
def asset_create_task(self, *args, **kwargs): """Create a new task :returns: None :rtype: None :raises: None """ if not self.cur_asset: return # depends on [control=['if'], data=[]] task = self.create_task(element=self.cur_asset) if task: taskdata = djit...
def get_bank_name(clabe: str) -> str: """ Regresa el nombre del banco basado en los primeros 3 digitos https://es.wikipedia.org/wiki/CLABE#D.C3.ADgito_control """ code = clabe[:3] try: bank_name = BANK_NAMES[BANKS[code]] except KeyError: raise ValueError(f"Ningún banco tiene ...
def function[get_bank_name, parameter[clabe]]: constant[ Regresa el nombre del banco basado en los primeros 3 digitos https://es.wikipedia.org/wiki/CLABE#D.C3.ADgito_control ] variable[code] assign[=] call[name[clabe]][<ast.Slice object at 0x7da1b2351b40>] <ast.Try object at 0x7da1b23f8a...
keyword[def] identifier[get_bank_name] ( identifier[clabe] : identifier[str] )-> identifier[str] : literal[string] identifier[code] = identifier[clabe] [: literal[int] ] keyword[try] : identifier[bank_name] = identifier[BANK_NAMES] [ identifier[BANKS] [ identifier[code] ]] keyword[except...
def get_bank_name(clabe: str) -> str: """ Regresa el nombre del banco basado en los primeros 3 digitos https://es.wikipedia.org/wiki/CLABE#D.C3.ADgito_control """ code = clabe[:3] try: bank_name = BANK_NAMES[BANKS[code]] # depends on [control=['try'], data=[]] except KeyError: ...
def intersect_exposure_and_aggregate_hazard(self): """This function intersects the exposure with the aggregate hazard. If the the exposure is a continuous raster exposure, this function will set the aggregate hazard layer. However, this function will set the impact layer. ""...
def function[intersect_exposure_and_aggregate_hazard, parameter[self]]: constant[This function intersects the exposure with the aggregate hazard. If the the exposure is a continuous raster exposure, this function will set the aggregate hazard layer. However, this function will set t...
keyword[def] identifier[intersect_exposure_and_aggregate_hazard] ( identifier[self] ): literal[string] identifier[LOGGER] . identifier[info] ( literal[string] ) keyword[if] identifier[is_raster_layer] ( identifier[self] . identifier[exposure] ): identifier[self] . identifier[...
def intersect_exposure_and_aggregate_hazard(self): """This function intersects the exposure with the aggregate hazard. If the the exposure is a continuous raster exposure, this function will set the aggregate hazard layer. However, this function will set the impact layer. """ ...
def main(self): ''' Responsible for calling self.init, initializing self.config.display, and calling self.run. Returns the value returned from self.run. ''' self.status = self.parent.status self.modules = self.parent.executed_modules # A special exception for th...
def function[main, parameter[self]]: constant[ Responsible for calling self.init, initializing self.config.display, and calling self.run. Returns the value returned from self.run. ] name[self].status assign[=] name[self].parent.status name[self].modules assign[=] name[se...
keyword[def] identifier[main] ( identifier[self] ): literal[string] identifier[self] . identifier[status] = identifier[self] . identifier[parent] . identifier[status] identifier[self] . identifier[modules] = identifier[self] . identifier[parent] . identifier[executed_modules] ...
def main(self): """ Responsible for calling self.init, initializing self.config.display, and calling self.run. Returns the value returned from self.run. """ self.status = self.parent.status self.modules = self.parent.executed_modules # A special exception for the extractor modul...
def _get_binop_flow( left, left_type, binary_opnode, right, right_type, context, reverse_context ): """Get the flow for binary operations. The rules are a bit messy: * if left and right have the same type, then only one method will be called, left.__op__(right) * if left and righ...
def function[_get_binop_flow, parameter[left, left_type, binary_opnode, right, right_type, context, reverse_context]]: constant[Get the flow for binary operations. The rules are a bit messy: * if left and right have the same type, then only one method will be called, left.__op__(right) ...
keyword[def] identifier[_get_binop_flow] ( identifier[left] , identifier[left_type] , identifier[binary_opnode] , identifier[right] , identifier[right_type] , identifier[context] , identifier[reverse_context] ): literal[string] identifier[op] = identifier[binary_opnode] . identifier[op] keyword[if]...
def _get_binop_flow(left, left_type, binary_opnode, right, right_type, context, reverse_context): """Get the flow for binary operations. The rules are a bit messy: * if left and right have the same type, then only one method will be called, left.__op__(right) * if left and right are ...
def _ConvertAllTypes(self, allTypes): """ Convert all dynamic types to pyVmomi type definitions """ # Generate lists good for VmomiSupport.CreateXYZType enumTypes = self._Filter(self._ConvertEnumType, allTypes.enumTypeInfo) dataTypes = self._Filter(self._ConvertDataType, allTypes.dataTypeInfo) ...
def function[_ConvertAllTypes, parameter[self, allTypes]]: constant[ Convert all dynamic types to pyVmomi type definitions ] variable[enumTypes] assign[=] call[name[self]._Filter, parameter[name[self]._ConvertEnumType, name[allTypes].enumTypeInfo]] variable[dataTypes] assign[=] call[name[self]._...
keyword[def] identifier[_ConvertAllTypes] ( identifier[self] , identifier[allTypes] ): literal[string] identifier[enumTypes] = identifier[self] . identifier[_Filter] ( identifier[self] . identifier[_ConvertEnumType] , identifier[allTypes] . identifier[enumTypeInfo] ) identifier[dataTypes]...
def _ConvertAllTypes(self, allTypes): """ Convert all dynamic types to pyVmomi type definitions """ # Generate lists good for VmomiSupport.CreateXYZType enumTypes = self._Filter(self._ConvertEnumType, allTypes.enumTypeInfo) dataTypes = self._Filter(self._ConvertDataType, allTypes.dataTypeInfo) manag...
def plot_degbandshalffill(): """Plot of Quasiparticle weight for degenerate half-filled bands, showing the Mott transition""" ulim = [3.45, 5.15, 6.85, 8.55] bands = range(1, 5) for band, u_int in zip(bands, ulim): name = 'Z_half_'+str(band)+'band' dop = [0.5] data = ssplt...
def function[plot_degbandshalffill, parameter[]]: constant[Plot of Quasiparticle weight for degenerate half-filled bands, showing the Mott transition] variable[ulim] assign[=] list[[<ast.Constant object at 0x7da1b27a51e0>, <ast.Constant object at 0x7da1b27a46a0>, <ast.Constant object at 0x7da1b27...
keyword[def] identifier[plot_degbandshalffill] (): literal[string] identifier[ulim] =[ literal[int] , literal[int] , literal[int] , literal[int] ] identifier[bands] = identifier[range] ( literal[int] , literal[int] ) keyword[for] identifier[band] , identifier[u_int] keyword[in] identifier[zip]...
def plot_degbandshalffill(): """Plot of Quasiparticle weight for degenerate half-filled bands, showing the Mott transition""" ulim = [3.45, 5.15, 6.85, 8.55] bands = range(1, 5) for (band, u_int) in zip(bands, ulim): name = 'Z_half_' + str(band) + 'band' dop = [0.5] data =...
def capture(cls, eval_env=0, reference=0): """Capture an execution environment from the stack. If `eval_env` is already an :class:`EvalEnvironment`, it is returned unchanged. Otherwise, we walk up the stack by ``eval_env + reference`` steps and capture that function's evaluation environm...
def function[capture, parameter[cls, eval_env, reference]]: constant[Capture an execution environment from the stack. If `eval_env` is already an :class:`EvalEnvironment`, it is returned unchanged. Otherwise, we walk up the stack by ``eval_env + reference`` steps and capture that functio...
keyword[def] identifier[capture] ( identifier[cls] , identifier[eval_env] = literal[int] , identifier[reference] = literal[int] ): literal[string] keyword[if] identifier[isinstance] ( identifier[eval_env] , identifier[cls] ): keyword[return] identifier[eval_env] keyword[eli...
def capture(cls, eval_env=0, reference=0): """Capture an execution environment from the stack. If `eval_env` is already an :class:`EvalEnvironment`, it is returned unchanged. Otherwise, we walk up the stack by ``eval_env + reference`` steps and capture that function's evaluation environment....
def tokenized(self, delimiter=' ', overlap_threshold=0.1): """ Return a ordered list of tokens based on all labels. Joins all token from all labels (``label.tokenized()```). If the overlapping between two labels is greater than ``overlap_threshold``, an Exception is thrown. ...
def function[tokenized, parameter[self, delimiter, overlap_threshold]]: constant[ Return a ordered list of tokens based on all labels. Joins all token from all labels (``label.tokenized()```). If the overlapping between two labels is greater than ``overlap_threshold``, an Excepti...
keyword[def] identifier[tokenized] ( identifier[self] , identifier[delimiter] = literal[string] , identifier[overlap_threshold] = literal[int] ): literal[string] identifier[sorted_by_start] = identifier[sorted] ( identifier[self] . identifier[labels] ) identifier[tokens] =[] iden...
def tokenized(self, delimiter=' ', overlap_threshold=0.1): """ Return a ordered list of tokens based on all labels. Joins all token from all labels (``label.tokenized()```). If the overlapping between two labels is greater than ``overlap_threshold``, an Exception is thrown. ...
def great_circle_dist(lat1, lon1, lat2, lon2): """ Get the distance (in meters) between two lat/lon points via the Haversine formula. Parameters ---------- lat1, lon1, lat2, lon2 : float Latitude and longitude in degrees. Returns ------- dist : float Distance in met...
def function[great_circle_dist, parameter[lat1, lon1, lat2, lon2]]: constant[ Get the distance (in meters) between two lat/lon points via the Haversine formula. Parameters ---------- lat1, lon1, lat2, lon2 : float Latitude and longitude in degrees. Returns ------- dist ...
keyword[def] identifier[great_circle_dist] ( identifier[lat1] , identifier[lon1] , identifier[lat2] , identifier[lon2] ): literal[string] identifier[radius] = literal[int] identifier[lat1] = identifier[math] . identifier[radians] ( identifier[lat1] ) identifier[lon1] = identifier[math] . identi...
def great_circle_dist(lat1, lon1, lat2, lon2): """ Get the distance (in meters) between two lat/lon points via the Haversine formula. Parameters ---------- lat1, lon1, lat2, lon2 : float Latitude and longitude in degrees. Returns ------- dist : float Distance in met...
def get_user_input(env): """Ask for username, secret (api_key or password) and endpoint_url.""" defaults = config.get_settings_from_client(env.client) # Ask for username username = env.input('Username', default=defaults['username']) # Ask for 'secret' which can be api_key or their password se...
def function[get_user_input, parameter[env]]: constant[Ask for username, secret (api_key or password) and endpoint_url.] variable[defaults] assign[=] call[name[config].get_settings_from_client, parameter[name[env].client]] variable[username] assign[=] call[name[env].input, parameter[constant[Use...
keyword[def] identifier[get_user_input] ( identifier[env] ): literal[string] identifier[defaults] = identifier[config] . identifier[get_settings_from_client] ( identifier[env] . identifier[client] ) identifier[username] = identifier[env] . identifier[input] ( literal[string] , identifier[defaul...
def get_user_input(env): """Ask for username, secret (api_key or password) and endpoint_url.""" defaults = config.get_settings_from_client(env.client) # Ask for username username = env.input('Username', default=defaults['username']) # Ask for 'secret' which can be api_key or their password secre...
def SETPO(cpu, dest): """ Sets byte if parity odd. :param cpu: current CPU. :param dest: destination operand. """ dest.write(Operators.ITEBV(dest.size, cpu.PF == False, 1, 0))
def function[SETPO, parameter[cpu, dest]]: constant[ Sets byte if parity odd. :param cpu: current CPU. :param dest: destination operand. ] call[name[dest].write, parameter[call[name[Operators].ITEBV, parameter[name[dest].size, compare[name[cpu].PF equal[==] constant[Fals...
keyword[def] identifier[SETPO] ( identifier[cpu] , identifier[dest] ): literal[string] identifier[dest] . identifier[write] ( identifier[Operators] . identifier[ITEBV] ( identifier[dest] . identifier[size] , identifier[cpu] . identifier[PF] == keyword[False] , literal[int] , literal[int] ))
def SETPO(cpu, dest): """ Sets byte if parity odd. :param cpu: current CPU. :param dest: destination operand. """ dest.write(Operators.ITEBV(dest.size, cpu.PF == False, 1, 0))
def searche_top_category(self): """doc: http://open.youku.com/docs/doc?id=95 """ url = 'https://openapi.youku.com/v2/schemas/searche/top/category.json' r = requests.get(url) check_error(r) return r.json()
def function[searche_top_category, parameter[self]]: constant[doc: http://open.youku.com/docs/doc?id=95 ] variable[url] assign[=] constant[https://openapi.youku.com/v2/schemas/searche/top/category.json] variable[r] assign[=] call[name[requests].get, parameter[name[url]]] call[nam...
keyword[def] identifier[searche_top_category] ( identifier[self] ): literal[string] identifier[url] = literal[string] identifier[r] = identifier[requests] . identifier[get] ( identifier[url] ) identifier[check_error] ( identifier[r] ) keyword[return] identifier[r] . ide...
def searche_top_category(self): """doc: http://open.youku.com/docs/doc?id=95 """ url = 'https://openapi.youku.com/v2/schemas/searche/top/category.json' r = requests.get(url) check_error(r) return r.json()
def convert_symbol_to_entrezid(self, symbol): """Convert Symbol to Entrez Gene Id""" entrezdict = {} server = "http://rest.genenames.org/fetch/symbol/{0}".format(symbol) r = requests.get(server, headers={"Content-Type": "application/json"}) if not r.ok: r.raise_for_st...
def function[convert_symbol_to_entrezid, parameter[self, symbol]]: constant[Convert Symbol to Entrez Gene Id] variable[entrezdict] assign[=] dictionary[[], []] variable[server] assign[=] call[constant[http://rest.genenames.org/fetch/symbol/{0}].format, parameter[name[symbol]]] variable[r...
keyword[def] identifier[convert_symbol_to_entrezid] ( identifier[self] , identifier[symbol] ): literal[string] identifier[entrezdict] ={} identifier[server] = literal[string] . identifier[format] ( identifier[symbol] ) identifier[r] = identifier[requests] . identifier[get] ( ident...
def convert_symbol_to_entrezid(self, symbol): """Convert Symbol to Entrez Gene Id""" entrezdict = {} server = 'http://rest.genenames.org/fetch/symbol/{0}'.format(symbol) r = requests.get(server, headers={'Content-Type': 'application/json'}) if not r.ok: r.raise_for_status() sys.exit(...
def _add_file(self, key, path): """Copy a file into the reference package.""" filename = os.path.basename(path) base, ext = os.path.splitext(filename) if os.path.exists(self.file_path(filename)): with tempfile.NamedTemporaryFile( dir=self.path, prefix=base...
def function[_add_file, parameter[self, key, path]]: constant[Copy a file into the reference package.] variable[filename] assign[=] call[name[os].path.basename, parameter[name[path]]] <ast.Tuple object at 0x7da1b1b9e530> assign[=] call[name[os].path.splitext, parameter[name[filename]]] i...
keyword[def] identifier[_add_file] ( identifier[self] , identifier[key] , identifier[path] ): literal[string] identifier[filename] = identifier[os] . identifier[path] . identifier[basename] ( identifier[path] ) identifier[base] , identifier[ext] = identifier[os] . identifier[path] . identi...
def _add_file(self, key, path): """Copy a file into the reference package.""" filename = os.path.basename(path) (base, ext) = os.path.splitext(filename) if os.path.exists(self.file_path(filename)): with tempfile.NamedTemporaryFile(dir=self.path, prefix=base, suffix=ext) as tf: filena...
def to_bed12(f, db, child_type='exon', name_field='ID'): """ Given a top-level feature (e.g., transcript), construct a BED12 entry Parameters ---------- f : Feature object or string This is the top-level feature represented by one BED12 line. For a canonical GFF or GTF, this will ge...
def function[to_bed12, parameter[f, db, child_type, name_field]]: constant[ Given a top-level feature (e.g., transcript), construct a BED12 entry Parameters ---------- f : Feature object or string This is the top-level feature represented by one BED12 line. For a canonical GFF o...
keyword[def] identifier[to_bed12] ( identifier[f] , identifier[db] , identifier[child_type] = literal[string] , identifier[name_field] = literal[string] ): literal[string] keyword[if] identifier[isinstance] ( identifier[f] , identifier[six] . identifier[string_types] ): identifier[f] = identifier...
def to_bed12(f, db, child_type='exon', name_field='ID'): """ Given a top-level feature (e.g., transcript), construct a BED12 entry Parameters ---------- f : Feature object or string This is the top-level feature represented by one BED12 line. For a canonical GFF or GTF, this will ge...
def exec_command(attr, cmd): """Runs a subproc to calculate a package attribute. """ import subprocess p = popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() if p.returncode: from rez.exceptions import InvalidPackageError raise InvalidPackageE...
def function[exec_command, parameter[attr, cmd]]: constant[Runs a subproc to calculate a package attribute. ] import module[subprocess] variable[p] assign[=] call[name[popen], parameter[name[cmd]]] <ast.Tuple object at 0x7da1b170ca90> assign[=] call[name[p].communicate, parameter[]] ...
keyword[def] identifier[exec_command] ( identifier[attr] , identifier[cmd] ): literal[string] keyword[import] identifier[subprocess] identifier[p] = identifier[popen] ( identifier[cmd] , identifier[stdout] = identifier[subprocess] . identifier[PIPE] , identifier[stderr] = identifier[subprocess] . i...
def exec_command(attr, cmd): """Runs a subproc to calculate a package attribute. """ import subprocess p = popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (out, err) = p.communicate() if p.returncode: from rez.exceptions import InvalidPackageError raise InvalidPackageE...
def get_prepared_include_exclude(attributes): """Return tuple with prepared __include__ and __exclude__ attributes. :type attributes: dict :rtype: tuple """ attrs = dict() for attr in ('__include__', '__exclude__'): attrs[attr] = tuple([item.name for item in ...
def function[get_prepared_include_exclude, parameter[attributes]]: constant[Return tuple with prepared __include__ and __exclude__ attributes. :type attributes: dict :rtype: tuple ] variable[attrs] assign[=] call[name[dict], parameter[]] for taget[name[attr]] in starred[...
keyword[def] identifier[get_prepared_include_exclude] ( identifier[attributes] ): literal[string] identifier[attrs] = identifier[dict] () keyword[for] identifier[attr] keyword[in] ( literal[string] , literal[string] ): identifier[attrs] [ identifier[attr] ]= identifier[tuple...
def get_prepared_include_exclude(attributes): """Return tuple with prepared __include__ and __exclude__ attributes. :type attributes: dict :rtype: tuple """ attrs = dict() for attr in ('__include__', '__exclude__'): attrs[attr] = tuple([item.name for item in attributes.get(a...
def create(self, alias=None, cache=None, **kwargs): """ Create a new cache. Either alias or cache params are required. You can use kwargs to pass extra parameters to configure the cache. .. deprecated:: 0.11.0 Only creating a cache passing an alias is supported. If you want ...
def function[create, parameter[self, alias, cache]]: constant[ Create a new cache. Either alias or cache params are required. You can use kwargs to pass extra parameters to configure the cache. .. deprecated:: 0.11.0 Only creating a cache passing an alias is supported. If yo...
keyword[def] identifier[create] ( identifier[self] , identifier[alias] = keyword[None] , identifier[cache] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[alias] : identifier[config] = identifier[self] . identifier[get_alias_config] ( identifier[alias]...
def create(self, alias=None, cache=None, **kwargs): """ Create a new cache. Either alias or cache params are required. You can use kwargs to pass extra parameters to configure the cache. .. deprecated:: 0.11.0 Only creating a cache passing an alias is supported. If you want to ...
def create_file(project: str, environment: str, feature: str, state: str) -> None: """ Create file to replay. Create file with ``rc`` command that will be called against the LaunchDarkly API when ``rc playback`` is called from the main CLI. :param project: LaunchDarkly Project :param environme...
def function[create_file, parameter[project, environment, feature, state]]: constant[ Create file to replay. Create file with ``rc`` command that will be called against the LaunchDarkly API when ``rc playback`` is called from the main CLI. :param project: LaunchDarkly Project :param enviro...
keyword[def] identifier[create_file] ( identifier[project] : identifier[str] , identifier[environment] : identifier[str] , identifier[feature] : identifier[str] , identifier[state] : identifier[str] )-> keyword[None] : literal[string] identifier[check_local] () identifier[save_path] = literal[string] ...
def create_file(project: str, environment: str, feature: str, state: str) -> None: """ Create file to replay. Create file with ``rc`` command that will be called against the LaunchDarkly API when ``rc playback`` is called from the main CLI. :param project: LaunchDarkly Project :param environme...
def docx_to_md(input_name, output_name): """ Converts an input docx file to MarkDown file of the given output name. Parameters ========== input_name : String Relative file location of the input file to where this function is being called. output_name : String Relative file location of ...
def function[docx_to_md, parameter[input_name, output_name]]: constant[ Converts an input docx file to MarkDown file of the given output name. Parameters ========== input_name : String Relative file location of the input file to where this function is being called. output_name : String...
keyword[def] identifier[docx_to_md] ( identifier[input_name] , identifier[output_name] ): literal[string] keyword[if] identifier[output_name] [- literal[int] :]== literal[string] : identifier[os] . identifier[system] ( literal[string] + identifier[input_name] + literal[string] + identifier[outpu...
def docx_to_md(input_name, output_name): """ Converts an input docx file to MarkDown file of the given output name. Parameters ========== input_name : String Relative file location of the input file to where this function is being called. output_name : String Relative file location of ...
def salvar(self, destino=None, prefix='tmp', suffix='-sat.log'): """Salva o arquivo de log decodificado. :param str destino: (Opcional) Caminho completo para o arquivo onde os dados dos logs deverão ser salvos. Se não informado, será criado um arquivo temporário via :func:`tempf...
def function[salvar, parameter[self, destino, prefix, suffix]]: constant[Salva o arquivo de log decodificado. :param str destino: (Opcional) Caminho completo para o arquivo onde os dados dos logs deverão ser salvos. Se não informado, será criado um arquivo temporário via :func:`...
keyword[def] identifier[salvar] ( identifier[self] , identifier[destino] = keyword[None] , identifier[prefix] = literal[string] , identifier[suffix] = literal[string] ): literal[string] keyword[if] identifier[destino] : keyword[if] identifier[os] . identifier[path] . identifier[exist...
def salvar(self, destino=None, prefix='tmp', suffix='-sat.log'): """Salva o arquivo de log decodificado. :param str destino: (Opcional) Caminho completo para o arquivo onde os dados dos logs deverão ser salvos. Se não informado, será criado um arquivo temporário via :func:`tempfile....
def get_scalar_arg_dtypes(self): """Get the location and types of the input scalars. Returns: list: for every kernel input element either None if the data is a buffer or the numpy data type if if is a scalar. """ dtypes = [] for name, data in self._ke...
def function[get_scalar_arg_dtypes, parameter[self]]: constant[Get the location and types of the input scalars. Returns: list: for every kernel input element either None if the data is a buffer or the numpy data type if if is a scalar. ] variable[dtypes] assi...
keyword[def] identifier[get_scalar_arg_dtypes] ( identifier[self] ): literal[string] identifier[dtypes] =[] keyword[for] identifier[name] , identifier[data] keyword[in] identifier[self] . identifier[_kernel_data] . identifier[items] (): identifier[dtypes] . identifier[exten...
def get_scalar_arg_dtypes(self): """Get the location and types of the input scalars. Returns: list: for every kernel input element either None if the data is a buffer or the numpy data type if if is a scalar. """ dtypes = [] for (name, data) in self._kernel_data....
def wrap_function(self, func): """ Wrap a function to profile it. """ def f(*args, **kwds): self.enable_by_count() try: result = func(*args, **kwds) finally: self.disable_by_count() return result return f
def function[wrap_function, parameter[self, func]]: constant[ Wrap a function to profile it. ] def function[f, parameter[]]: call[name[self].enable_by_count, parameter[]] <ast.Try object at 0x7da18f00c640> return[name[result]] return[name[f]]
keyword[def] identifier[wrap_function] ( identifier[self] , identifier[func] ): literal[string] keyword[def] identifier[f] (* identifier[args] ,** identifier[kwds] ): identifier[self] . identifier[enable_by_count] () keyword[try] : identifier[result] = i...
def wrap_function(self, func): """ Wrap a function to profile it. """ def f(*args, **kwds): self.enable_by_count() try: result = func(*args, **kwds) # depends on [control=['try'], data=[]] finally: self.disable_by_count() return result return...
def readsegment(d, segment): """ Prepare to read segment of data """ # set requested time range based on given parameters starttime = qa.getvalue(qa.convert(qa.time(qa.quantity(d['segmenttimes'][segment,0],'d'),form=['ymd'], prec=9)[0], 's'))[0] stoptime = qa.getvalue(qa.convert(qa.time(qa.quantity...
def function[readsegment, parameter[d, segment]]: constant[ Prepare to read segment of data ] variable[starttime] assign[=] call[call[name[qa].getvalue, parameter[call[name[qa].convert, parameter[call[call[name[qa].time, parameter[call[name[qa].quantity, parameter[call[call[name[d]][constant[segment...
keyword[def] identifier[readsegment] ( identifier[d] , identifier[segment] ): literal[string] identifier[starttime] = identifier[qa] . identifier[getvalue] ( identifier[qa] . identifier[convert] ( identifier[qa] . identifier[time] ( identifier[qa] . identifier[quantity] ( identifier[d] [ literal[stri...
def readsegment(d, segment): """ Prepare to read segment of data """ # set requested time range based on given parameters starttime = qa.getvalue(qa.convert(qa.time(qa.quantity(d['segmenttimes'][segment, 0], 'd'), form=['ymd'], prec=9)[0], 's'))[0] stoptime = qa.getvalue(qa.convert(qa.time(qa.quanti...
def inspect_config(self, id): """ Retrieve config metadata Args: id (string): Full ID of the config to inspect Returns (dict): A dictionary of metadata Raises: :py:class:`docker.errors.NotFound` if no config w...
def function[inspect_config, parameter[self, id]]: constant[ Retrieve config metadata Args: id (string): Full ID of the config to inspect Returns (dict): A dictionary of metadata Raises: :py:class:`docker.errors.NotFound` ...
keyword[def] identifier[inspect_config] ( identifier[self] , identifier[id] ): literal[string] identifier[url] = identifier[self] . identifier[_url] ( literal[string] , identifier[id] ) keyword[return] identifier[self] . identifier[_result] ( identifier[self] . identifier[_get] ( identifi...
def inspect_config(self, id): """ Retrieve config metadata Args: id (string): Full ID of the config to inspect Returns (dict): A dictionary of metadata Raises: :py:class:`docker.errors.NotFound` if no config with ...
def get_load_balancer(self, id): """ Returns a Load Balancer object by its ID. Args: id (str): Load Balancer ID """ return LoadBalancer.get_object(api_token=self.token, id=id)
def function[get_load_balancer, parameter[self, id]]: constant[ Returns a Load Balancer object by its ID. Args: id (str): Load Balancer ID ] return[call[name[LoadBalancer].get_object, parameter[]]]
keyword[def] identifier[get_load_balancer] ( identifier[self] , identifier[id] ): literal[string] keyword[return] identifier[LoadBalancer] . identifier[get_object] ( identifier[api_token] = identifier[self] . identifier[token] , identifier[id] = identifier[id] )
def get_load_balancer(self, id): """ Returns a Load Balancer object by its ID. Args: id (str): Load Balancer ID """ return LoadBalancer.get_object(api_token=self.token, id=id)
def do_serve(self, repo_name): ''' Serve a local directory over http as a package index (like pypi). Intended for quick package exchanges. ''' self.abort_on_nonexisting_effective_repo(repo_name, 'serve') repo = self.network.get_repo(repo_name) repo.serve()
def function[do_serve, parameter[self, repo_name]]: constant[ Serve a local directory over http as a package index (like pypi). Intended for quick package exchanges. ] call[name[self].abort_on_nonexisting_effective_repo, parameter[name[repo_name], constant[serve]]] variab...
keyword[def] identifier[do_serve] ( identifier[self] , identifier[repo_name] ): literal[string] identifier[self] . identifier[abort_on_nonexisting_effective_repo] ( identifier[repo_name] , literal[string] ) identifier[repo] = identifier[self] . identifier[network] . identifier[get_repo] (...
def do_serve(self, repo_name): """ Serve a local directory over http as a package index (like pypi). Intended for quick package exchanges. """ self.abort_on_nonexisting_effective_repo(repo_name, 'serve') repo = self.network.get_repo(repo_name) repo.serve()
def enhance(self): """Load metadata from a data service to improve naming. :raises tvrenamer.exceptions.ShowNotFound: when unable to find show/series name based on parsed name :raises tvrenamer.exceptions.EpisodeNotFound: when unable to find episode name(s) based on pars...
def function[enhance, parameter[self]]: constant[Load metadata from a data service to improve naming. :raises tvrenamer.exceptions.ShowNotFound: when unable to find show/series name based on parsed name :raises tvrenamer.exceptions.EpisodeNotFound: when unable to find ep...
keyword[def] identifier[enhance] ( identifier[self] ): literal[string] identifier[series] , identifier[error] = identifier[self] . identifier[api] . identifier[get_series_by_name] ( identifier[self] . identifier[series_name] ) keyword[if] identifier[series] keyword[is] keyword[None] :...
def enhance(self): """Load metadata from a data service to improve naming. :raises tvrenamer.exceptions.ShowNotFound: when unable to find show/series name based on parsed name :raises tvrenamer.exceptions.EpisodeNotFound: when unable to find episode name(s) based on parsed d...
def solve_value(self, value, resource): """Solve a resource with a value, without coercing. Arguments --------- value : ? A value to solve in combination with the given resource. The first filter of the resource will be applied on this value (next filters on the ...
def function[solve_value, parameter[self, value, resource]]: constant[Solve a resource with a value, without coercing. Arguments --------- value : ? A value to solve in combination with the given resource. The first filter of the resource will be applied on this ...
keyword[def] identifier[solve_value] ( identifier[self] , identifier[value] , identifier[resource] ): literal[string] identifier[result] = identifier[value] keyword[if] identifier[result] keyword[is] keyword[not] keyword[None] : keyword[for] identifie...
def solve_value(self, value, resource): """Solve a resource with a value, without coercing. Arguments --------- value : ? A value to solve in combination with the given resource. The first filter of the resource will be applied on this value (next filters on the resu...
def fetchUser(self, username, rawResults = False) : """Returns a single user. if rawResults, the result will be a list of python dicts instead of User objects""" url = "%s/%s" % (self.URL, username) r = self.connection.session.get(url) if r.status_code == 200 : data = r.json...
def function[fetchUser, parameter[self, username, rawResults]]: constant[Returns a single user. if rawResults, the result will be a list of python dicts instead of User objects] variable[url] assign[=] binary_operation[constant[%s/%s] <ast.Mod object at 0x7da2590d6920> tuple[[<ast.Attribute object at 0x...
keyword[def] identifier[fetchUser] ( identifier[self] , identifier[username] , identifier[rawResults] = keyword[False] ): literal[string] identifier[url] = literal[string] %( identifier[self] . identifier[URL] , identifier[username] ) identifier[r] = identifier[self] . identifier[connecti...
def fetchUser(self, username, rawResults=False): """Returns a single user. if rawResults, the result will be a list of python dicts instead of User objects""" url = '%s/%s' % (self.URL, username) r = self.connection.session.get(url) if r.status_code == 200: data = r.json() if rawResults:...
def set_data(self, data): """Set data.""" if data != self.editor.model.get_data(): self.editor.set_data(data) self.editor.adjust_columns()
def function[set_data, parameter[self, data]]: constant[Set data.] if compare[name[data] not_equal[!=] call[name[self].editor.model.get_data, parameter[]]] begin[:] call[name[self].editor.set_data, parameter[name[data]]] call[name[self].editor.adjust_columns, parameter[]]
keyword[def] identifier[set_data] ( identifier[self] , identifier[data] ): literal[string] keyword[if] identifier[data] != identifier[self] . identifier[editor] . identifier[model] . identifier[get_data] (): identifier[self] . identifier[editor] . identifier[set_data] ( identifier[...
def set_data(self, data): """Set data.""" if data != self.editor.model.get_data(): self.editor.set_data(data) self.editor.adjust_columns() # depends on [control=['if'], data=['data']]
async def handle_action(self, action: str, request_id: str, **kwargs): """ run the action. """ try: await self.check_permissions(action, **kwargs) if action not in self.available_actions: raise MethodNotAllowed(method=action) method_n...
<ast.AsyncFunctionDef object at 0x7da204621ae0>
keyword[async] keyword[def] identifier[handle_action] ( identifier[self] , identifier[action] : identifier[str] , identifier[request_id] : identifier[str] ,** identifier[kwargs] ): literal[string] keyword[try] : keyword[await] identifier[self] . identifier[check_permissions] ( identi...
async def handle_action(self, action: str, request_id: str, **kwargs): """ run the action. """ try: await self.check_permissions(action, **kwargs) if action not in self.available_actions: raise MethodNotAllowed(method=action) # depends on [control=['if'], data=['acti...
def call_once(func): """Decorate a function to only allow it to be called once. Note that it doesn't make sense to only call a function once if it takes arguments (use @functools.lru_cache for that sort of thing), so this only works on callables that take no args. """ argspec = inspect.getargspec(func) i...
def function[call_once, parameter[func]]: constant[Decorate a function to only allow it to be called once. Note that it doesn't make sense to only call a function once if it takes arguments (use @functools.lru_cache for that sort of thing), so this only works on callables that take no args. ] v...
keyword[def] identifier[call_once] ( identifier[func] ): literal[string] identifier[argspec] = identifier[inspect] . identifier[getargspec] ( identifier[func] ) keyword[if] identifier[argspec] . identifier[args] keyword[or] identifier[argspec] . identifier[varargs] keyword[or] identifier[argspec] . ide...
def call_once(func): """Decorate a function to only allow it to be called once. Note that it doesn't make sense to only call a function once if it takes arguments (use @functools.lru_cache for that sort of thing), so this only works on callables that take no args. """ argspec = inspect.getargspec(func)...
def _ParseTriggerEndTime(self, parser_mediator, trigger): """Parses the end time from a trigger. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. trigger (job_trigger): a trigger. Returns: dfdatetime....
def function[_ParseTriggerEndTime, parameter[self, parser_mediator, trigger]]: constant[Parses the end time from a trigger. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. trigger (job_trigger): a trigger. ...
keyword[def] identifier[_ParseTriggerEndTime] ( identifier[self] , identifier[parser_mediator] , identifier[trigger] ): literal[string] identifier[time_elements_tuple] =( identifier[trigger] . identifier[end_date] . identifier[year] , identifier[trigger] . identifier[end_date] . identifier[month] , ...
def _ParseTriggerEndTime(self, parser_mediator, trigger): """Parses the end time from a trigger. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. trigger (job_trigger): a trigger. Returns: dfdatetime....
def dict_to_source(dict): ''' Transform a dict with key 'citation' into a :class:`Source`. If the argument passed is already a :class:`Source`, this method just returns the argument. ''' if isinstance(dict, Source): return dict return Source( dict['citation'], dict....
def function[dict_to_source, parameter[dict]]: constant[ Transform a dict with key 'citation' into a :class:`Source`. If the argument passed is already a :class:`Source`, this method just returns the argument. ] if call[name[isinstance], parameter[name[dict], name[Source]]] begin[:] ...
keyword[def] identifier[dict_to_source] ( identifier[dict] ): literal[string] keyword[if] identifier[isinstance] ( identifier[dict] , identifier[Source] ): keyword[return] identifier[dict] keyword[return] identifier[Source] ( identifier[dict] [ literal[string] ], identifier[dic...
def dict_to_source(dict): """ Transform a dict with key 'citation' into a :class:`Source`. If the argument passed is already a :class:`Source`, this method just returns the argument. """ if isinstance(dict, Source): return dict # depends on [control=['if'], data=[]] return Source(d...
def groupby(df, *, group_cols: Union[str, List[str]], aggregations: Dict[str, Union[str, List[str]]]): """ Aggregate values by groups. --- ### Parameters *mandatory :* - `group_cols` (*list*): list of columns used to group data - `aggregations` (*dict*): dictionnary of values ...
def function[groupby, parameter[df]]: constant[ Aggregate values by groups. --- ### Parameters *mandatory :* - `group_cols` (*list*): list of columns used to group data - `aggregations` (*dict*): dictionnary of values columns to group as keys and aggregation function to use as v...
keyword[def] identifier[groupby] ( identifier[df] ,*, identifier[group_cols] : identifier[Union] [ identifier[str] , identifier[List] [ identifier[str] ]], identifier[aggregations] : identifier[Dict] [ identifier[str] , identifier[Union] [ identifier[str] , identifier[List] [ identifier[str] ]]]): literal[strin...
def groupby(df, *, group_cols: Union[str, List[str]], aggregations: Dict[str, Union[str, List[str]]]): """ Aggregate values by groups. --- ### Parameters *mandatory :* - `group_cols` (*list*): list of columns used to group data - `aggregations` (*dict*): dictionnary of values columns to g...
def colorize(arr, colors, values): """Colorize a monochromatic array *arr*, based *colors* given for *values*. Interpolation is used. *values* must be in ascending order. """ hcolors = np.array([rgb2hcl(*i[:3]) for i in colors]) # unwrap colormap in hcl space hcolors[:, 0] = np.rad2deg(np.unwrap...
def function[colorize, parameter[arr, colors, values]]: constant[Colorize a monochromatic array *arr*, based *colors* given for *values*. Interpolation is used. *values* must be in ascending order. ] variable[hcolors] assign[=] call[name[np].array, parameter[<ast.ListComp object at 0x7da1b052a95...
keyword[def] identifier[colorize] ( identifier[arr] , identifier[colors] , identifier[values] ): literal[string] identifier[hcolors] = identifier[np] . identifier[array] ([ identifier[rgb2hcl] (* identifier[i] [: literal[int] ]) keyword[for] identifier[i] keyword[in] identifier[colors] ]) iden...
def colorize(arr, colors, values): """Colorize a monochromatic array *arr*, based *colors* given for *values*. Interpolation is used. *values* must be in ascending order. """ hcolors = np.array([rgb2hcl(*i[:3]) for i in colors]) # unwrap colormap in hcl space hcolors[:, 0] = np.rad2deg(np.unwrap...
def convert_sequence_to_motor_units(cycles, unit_converter): """ Converts a move sequence to motor units. Converts a move sequence to motor units using the provied converter. Parameters ---------- cycles : iterable of dicts The iterable of cycles of motion to do one after another. See ...
def function[convert_sequence_to_motor_units, parameter[cycles, unit_converter]]: constant[ Converts a move sequence to motor units. Converts a move sequence to motor units using the provied converter. Parameters ---------- cycles : iterable of dicts The iterable of cycles of motion to...
keyword[def] identifier[convert_sequence_to_motor_units] ( identifier[cycles] , identifier[unit_converter] ): literal[string] identifier[cv_cycles] = identifier[copy] . identifier[deepcopy] ( identifier[cycles] ) keyword[for] identifier[cycle] keyword[in] identifier[cv_cycles] : ...
def convert_sequence_to_motor_units(cycles, unit_converter): """ Converts a move sequence to motor units. Converts a move sequence to motor units using the provied converter. Parameters ---------- cycles : iterable of dicts The iterable of cycles of motion to do one after another. See ...
def normalize_contract_type( contract_type_data: Dict[str, Any] ) -> Iterable[Tuple[str, Any]]: """ Serialize contract_data found in compiler output to the defined fields. """ yield "abi", contract_type_data["abi"] if "evm" in contract_type_data: if "bytecode" in contract_type_data["evm"...
def function[normalize_contract_type, parameter[contract_type_data]]: constant[ Serialize contract_data found in compiler output to the defined fields. ] <ast.Yield object at 0x7da20e960130> if compare[constant[evm] in name[contract_type_data]] begin[:] if compare[constan...
keyword[def] identifier[normalize_contract_type] ( identifier[contract_type_data] : identifier[Dict] [ identifier[str] , identifier[Any] ] )-> identifier[Iterable] [ identifier[Tuple] [ identifier[str] , identifier[Any] ]]: literal[string] keyword[yield] literal[string] , identifier[contract_type_data] [...
def normalize_contract_type(contract_type_data: Dict[str, Any]) -> Iterable[Tuple[str, Any]]: """ Serialize contract_data found in compiler output to the defined fields. """ yield ('abi', contract_type_data['abi']) if 'evm' in contract_type_data: if 'bytecode' in contract_type_data['evm']: ...
def det_refpoint(self, angle): """Return the detector reference point position at ``angle``. For an angle ``phi``, the detector position is given by :: det_ref(phi) = translation + rot_matrix(phi) * (det_rad * src_to_det_init) + (offset...
def function[det_refpoint, parameter[self, angle]]: constant[Return the detector reference point position at ``angle``. For an angle ``phi``, the detector position is given by :: det_ref(phi) = translation + rot_matrix(phi) * (det_rad * src_to_det_init) + ...
keyword[def] identifier[det_refpoint] ( identifier[self] , identifier[angle] ): literal[string] identifier[squeeze_out] =( identifier[np] . identifier[shape] ( identifier[angle] )==()) identifier[angle] = identifier[np] . identifier[array] ( identifier[angle] , identifier[dtype] = identifi...
def det_refpoint(self, angle): """Return the detector reference point position at ``angle``. For an angle ``phi``, the detector position is given by :: det_ref(phi) = translation + rot_matrix(phi) * (det_rad * src_to_det_init) + (offset_alo...
def normalizeKerningKey(value): """ Normalizes kerning key. * **value** must be a ``tuple`` or ``list``. * **value** must contain only two members. * **value** items must be :ref:`type-string`. * **value** items must be at least one character long. * Returned value will be a two member ``tu...
def function[normalizeKerningKey, parameter[value]]: constant[ Normalizes kerning key. * **value** must be a ``tuple`` or ``list``. * **value** must contain only two members. * **value** items must be :ref:`type-string`. * **value** items must be at least one character long. * Returned ...
keyword[def] identifier[normalizeKerningKey] ( identifier[value] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[value] ,( identifier[tuple] , identifier[list] )): keyword[raise] identifier[TypeError] ( literal[string] % identifier[type] ( identifier[val...
def normalizeKerningKey(value): """ Normalizes kerning key. * **value** must be a ``tuple`` or ``list``. * **value** must contain only two members. * **value** items must be :ref:`type-string`. * **value** items must be at least one character long. * Returned value will be a two member ``tu...
def remove_files(filename): # type: (AnyStr) -> None """ Delete all files with same root as fileName, i.e. regardless of suffix, such as ESRI shapefile """ pattern = os.path.splitext(filename)[0] + '.*' for f in glob.iglob(pattern): os.remove(f)
def function[remove_files, parameter[filename]]: constant[ Delete all files with same root as fileName, i.e. regardless of suffix, such as ESRI shapefile ] variable[pattern] assign[=] binary_operation[call[call[name[os].path.splitext, parameter[name[filename]]]][constant[0]] + co...
keyword[def] identifier[remove_files] ( identifier[filename] ): literal[string] identifier[pattern] = identifier[os] . identifier[path] . identifier[splitext] ( identifier[filename] )[ literal[int] ]+ literal[string] keyword[for] identifier[f] keyword[in] identifier[glob] . identifier...
def remove_files(filename): # type: (AnyStr) -> None '\n Delete all files with same root as fileName,\n i.e. regardless of suffix, such as ESRI shapefile\n ' pattern = os.path.splitext(filename)[0] + '.*' for f in glob.iglob(pattern): os.remove(f) # depends on [control=['fo...
def fuzzy_histogram(a, bins=10, range=None, normed=False, membership='triangular', smoothness=None, guarantee=False): r"""Compute a fuzzy histogram. The percentage of a value's membership in a bin is computed using the selected membership function. This functions stays as near as possible to the `numpy.hist...
def function[fuzzy_histogram, parameter[a, bins, range, normed, membership, smoothness, guarantee]]: constant[Compute a fuzzy histogram. The percentage of a value's membership in a bin is computed using the selected membership function. This functions stays as near as possible to the `numpy.histogram` ...
keyword[def] identifier[fuzzy_histogram] ( identifier[a] , identifier[bins] = literal[int] , identifier[range] = keyword[None] , identifier[normed] = keyword[False] , identifier[membership] = literal[string] , identifier[smoothness] = keyword[None] , identifier[guarantee] = keyword[False] ): literal[string] ...
def fuzzy_histogram(a, bins=10, range=None, normed=False, membership='triangular', smoothness=None, guarantee=False): """Compute a fuzzy histogram. The percentage of a value's membership in a bin is computed using the selected membership function. This functions stays as near as possible to the `numpy.histo...
def reset_annotations(self): """Resets the builder's state to allow building new annotations.""" # FIXME: this state does not make sense self.annotation_date_set = False self.annotation_comment_set = False self.annotation_type_set = False self.annotation_spdx_id_set = Fal...
def function[reset_annotations, parameter[self]]: constant[Resets the builder's state to allow building new annotations.] name[self].annotation_date_set assign[=] constant[False] name[self].annotation_comment_set assign[=] constant[False] name[self].annotation_type_set assign[=] constant...
keyword[def] identifier[reset_annotations] ( identifier[self] ): literal[string] identifier[self] . identifier[annotation_date_set] = keyword[False] identifier[self] . identifier[annotation_comment_set] = keyword[False] identifier[self] . identifier[annotation_type_set]...
def reset_annotations(self): """Resets the builder's state to allow building new annotations.""" # FIXME: this state does not make sense self.annotation_date_set = False self.annotation_comment_set = False self.annotation_type_set = False self.annotation_spdx_id_set = False
def __feed_arthur(self): """ Feed Ocean with backend data collected from arthur redis queue""" with self.ARTHUR_FEED_LOCK: # This is a expensive operation so don't do it always if (time.time() - self.ARTHUR_LAST_MEMORY_CHECK) > 5 * self.ARTHUR_LAST_MEMORY_CHECK_TIME: ...
def function[__feed_arthur, parameter[self]]: constant[ Feed Ocean with backend data collected from arthur redis queue] with name[self].ARTHUR_FEED_LOCK begin[:] if compare[binary_operation[call[name[time].time, parameter[]] - name[self].ARTHUR_LAST_MEMORY_CHECK] greater[>] binary_operat...
keyword[def] identifier[__feed_arthur] ( identifier[self] ): literal[string] keyword[with] identifier[self] . identifier[ARTHUR_FEED_LOCK] : keyword[if] ( identifier[time] . identifier[time] ()- identifier[self] . identifier[ARTHUR_LAST_MEMORY_CHECK] )> literal[int] * ident...
def __feed_arthur(self): """ Feed Ocean with backend data collected from arthur redis queue""" with self.ARTHUR_FEED_LOCK: # This is a expensive operation so don't do it always if time.time() - self.ARTHUR_LAST_MEMORY_CHECK > 5 * self.ARTHUR_LAST_MEMORY_CHECK_TIME: self.ARTHUR_LAST_M...
def process(self, blob=None): """Pump the next blob to the modules""" try: blob = self.get_blob(self.index) except IndexError: self.log.info("Got an IndexError, trying the next file") if (self.basename or self.filenames) and self.file_inde...
def function[process, parameter[self, blob]]: constant[Pump the next blob to the modules] <ast.Try object at 0x7da18f811000> <ast.AugAssign object at 0x7da18f811390> return[name[blob]]
keyword[def] identifier[process] ( identifier[self] , identifier[blob] = keyword[None] ): literal[string] keyword[try] : identifier[blob] = identifier[self] . identifier[get_blob] ( identifier[self] . identifier[index] ) keyword[except] identifier[IndexError] : ...
def process(self, blob=None): """Pump the next blob to the modules""" try: blob = self.get_blob(self.index) # depends on [control=['try'], data=[]] except IndexError: self.log.info('Got an IndexError, trying the next file') if (self.basename or self.filenames) and self.file_index < ...
def global_variables(self): """ Return an iterator over this module's global variables. The iterator will yield a ValueRef for each global variable. Note that global variables don't include functions (a function is a "global value" but not a "global variable" in LLVM pa...
def function[global_variables, parameter[self]]: constant[ Return an iterator over this module's global variables. The iterator will yield a ValueRef for each global variable. Note that global variables don't include functions (a function is a "global value" but not a "global va...
keyword[def] identifier[global_variables] ( identifier[self] ): literal[string] identifier[it] = identifier[ffi] . identifier[lib] . identifier[LLVMPY_ModuleGlobalsIter] ( identifier[self] ) keyword[return] identifier[_GlobalsIterator] ( identifier[it] , identifier[dict] ( identifier[modu...
def global_variables(self): """ Return an iterator over this module's global variables. The iterator will yield a ValueRef for each global variable. Note that global variables don't include functions (a function is a "global value" but not a "global variable" in LLVM parlan...
def invalidate_config_var_entry(self, index): """Mark a config variable as invalid.""" if index == 0 or index > len(self.config_database.entries): return [Error.INVALID_ARRAY_KEY, b''] entry = self.config_database.entries[index - 1] if not entry.valid: return [C...
def function[invalidate_config_var_entry, parameter[self, index]]: constant[Mark a config variable as invalid.] if <ast.BoolOp object at 0x7da20c6a8d60> begin[:] return[list[[<ast.Attribute object at 0x7da20c6a8a30>, <ast.Constant object at 0x7da20c6a9ab0>]]] variable[entry] assign[=] ca...
keyword[def] identifier[invalidate_config_var_entry] ( identifier[self] , identifier[index] ): literal[string] keyword[if] identifier[index] == literal[int] keyword[or] identifier[index] > identifier[len] ( identifier[self] . identifier[config_database] . identifier[entries] ): key...
def invalidate_config_var_entry(self, index): """Mark a config variable as invalid.""" if index == 0 or index > len(self.config_database.entries): return [Error.INVALID_ARRAY_KEY, b''] # depends on [control=['if'], data=[]] entry = self.config_database.entries[index - 1] if not entry.valid: ...
def from_row_and_group(row: int, group: int): """ Returns an element from a row and group number. Args: row (int): Row number group (int): Group number .. note:: The 18 group number system is used, i.e., Noble gases are group 18. """ ...
def function[from_row_and_group, parameter[row, group]]: constant[ Returns an element from a row and group number. Args: row (int): Row number group (int): Group number .. note:: The 18 group number system is used, i.e., Noble gases are group 18. ...
keyword[def] identifier[from_row_and_group] ( identifier[row] : identifier[int] , identifier[group] : identifier[int] ): literal[string] keyword[for] identifier[sym] keyword[in] identifier[_pt_data] . identifier[keys] (): identifier[el] = identifier[Element] ( identifier[sym] ) ...
def from_row_and_group(row: int, group: int): """ Returns an element from a row and group number. Args: row (int): Row number group (int): Group number .. note:: The 18 group number system is used, i.e., Noble gases are group 18. """ for sym ...
def virt_conf_from_stream( self, conf_fd, template_repo=None, template_store=None, do_bootstrap=True, do_build=True, ): """ Initializes all the virt infrastructure of the prefix, creating the domains disks, doing any network leases and creating...
def function[virt_conf_from_stream, parameter[self, conf_fd, template_repo, template_store, do_bootstrap, do_build]]: constant[ Initializes all the virt infrastructure of the prefix, creating the domains disks, doing any network leases and creating all the virt related files and dirs ins...
keyword[def] identifier[virt_conf_from_stream] ( identifier[self] , identifier[conf_fd] , identifier[template_repo] = keyword[None] , identifier[template_store] = keyword[None] , identifier[do_bootstrap] = keyword[True] , identifier[do_build] = keyword[True] , ): literal[string] identifier[vi...
def virt_conf_from_stream(self, conf_fd, template_repo=None, template_store=None, do_bootstrap=True, do_build=True): """ Initializes all the virt infrastructure of the prefix, creating the domains disks, doing any network leases and creating all the virt related files and dirs inside this pr...
def data(self, index, role=Qt.DisplayRole): """Override Qt method""" if not index.isValid() or not 0 <= index.row() < len(self._rows): return to_qvariant() row = index.row() column = index.column() name, state = self.row(row) if role == Qt.DisplayRo...
def function[data, parameter[self, index, role]]: constant[Override Qt method] if <ast.BoolOp object at 0x7da1b26aebc0> begin[:] return[call[name[to_qvariant], parameter[]]] variable[row] assign[=] call[name[index].row, parameter[]] variable[column] assign[=] call[name[index].col...
keyword[def] identifier[data] ( identifier[self] , identifier[index] , identifier[role] = identifier[Qt] . identifier[DisplayRole] ): literal[string] keyword[if] keyword[not] identifier[index] . identifier[isValid] () keyword[or] keyword[not] literal[int] <= identifier[index] . identifier[row...
def data(self, index, role=Qt.DisplayRole): """Override Qt method""" if not index.isValid() or not 0 <= index.row() < len(self._rows): return to_qvariant() # depends on [control=['if'], data=[]] row = index.row() column = index.column() (name, state) = self.row(row) if role == Qt.Displa...
def GMSK_bb(N_bits, Ns, MSK = 0,BT = 0.35): """ MSK/GMSK Complex Baseband Modulation x,data = gmsk(N_bits, Ns, BT = 0.35, MSK = 0) Parameters ---------- N_bits : number of symbols processed Ns : the number of samples per bit MSK : 0 for no shaping which is standard MSK, MSK <> 0 --> GMS...
def function[GMSK_bb, parameter[N_bits, Ns, MSK, BT]]: constant[ MSK/GMSK Complex Baseband Modulation x,data = gmsk(N_bits, Ns, BT = 0.35, MSK = 0) Parameters ---------- N_bits : number of symbols processed Ns : the number of samples per bit MSK : 0 for no shaping which is standard ...
keyword[def] identifier[GMSK_bb] ( identifier[N_bits] , identifier[Ns] , identifier[MSK] = literal[int] , identifier[BT] = literal[int] ): literal[string] identifier[x] , identifier[b] , identifier[data] = identifier[NRZ_bits] ( identifier[N_bits] , identifier[Ns] ) identifier[M] = literal[int] ...
def GMSK_bb(N_bits, Ns, MSK=0, BT=0.35): """ MSK/GMSK Complex Baseband Modulation x,data = gmsk(N_bits, Ns, BT = 0.35, MSK = 0) Parameters ---------- N_bits : number of symbols processed Ns : the number of samples per bit MSK : 0 for no shaping which is standard MSK, MSK <> 0 --> GMSK i...
def OnLinkVLCVideo(self, event): """VLC video code event handler""" key = self.grid.actions.cursor if event.videofile: try: video_volume = \ self.grid.code_array.cell_attributes[key]["video_volume"] except KeyError: vi...
def function[OnLinkVLCVideo, parameter[self, event]]: constant[VLC video code event handler] variable[key] assign[=] name[self].grid.actions.cursor if name[event].videofile begin[:] <ast.Try object at 0x7da1b16be0b0> call[name[self].grid.actions.set_attr, parameter[consta...
keyword[def] identifier[OnLinkVLCVideo] ( identifier[self] , identifier[event] ): literal[string] identifier[key] = identifier[self] . identifier[grid] . identifier[actions] . identifier[cursor] keyword[if] identifier[event] . identifier[videofile] : keyword[try] : ...
def OnLinkVLCVideo(self, event): """VLC video code event handler""" key = self.grid.actions.cursor if event.videofile: try: video_volume = self.grid.code_array.cell_attributes[key]['video_volume'] # depends on [control=['try'], data=[]] except KeyError: video_volume ...
def publish_delayed_metric(self, name, value, timestamp, raw_value=None, precision=0, metric_type='GAUGE', instance=None): """ Metrics may not be immediately available when querying cloudwatch. Hence, allow the ability to publish a me...
def function[publish_delayed_metric, parameter[self, name, value, timestamp, raw_value, precision, metric_type, instance]]: constant[ Metrics may not be immediately available when querying cloudwatch. Hence, allow the ability to publish a metric from some the past given its timestamp. ...
keyword[def] identifier[publish_delayed_metric] ( identifier[self] , identifier[name] , identifier[value] , identifier[timestamp] , identifier[raw_value] = keyword[None] , identifier[precision] = literal[int] , identifier[metric_type] = literal[string] , identifier[instance] = keyword[None] ): literal[stri...
def publish_delayed_metric(self, name, value, timestamp, raw_value=None, precision=0, metric_type='GAUGE', instance=None): """ Metrics may not be immediately available when querying cloudwatch. Hence, allow the ability to publish a metric from some the past given its timestamp. """ ...
def worker(): """ Initialize the distributed environment. """ import torch import torch.distributed as dist from torch.multiprocessing import Process import numpy as np print("Initializing distributed pytorch") os.environ['MASTER_ADDR'] = str(args.master_addr) os.environ['MASTER_PORT'] = str(args.mast...
def function[worker, parameter[]]: constant[ Initialize the distributed environment. ] import module[torch] import module[torch.distributed] as alias[dist] from relative_module[torch.multiprocessing] import module[Process] import module[numpy] as alias[np] call[name[print], parameter[con...
keyword[def] identifier[worker] (): literal[string] keyword[import] identifier[torch] keyword[import] identifier[torch] . identifier[distributed] keyword[as] identifier[dist] keyword[from] identifier[torch] . identifier[multiprocessing] keyword[import] identifier[Process] keyword[import] i...
def worker(): """ Initialize the distributed environment. """ import torch import torch.distributed as dist from torch.multiprocessing import Process import numpy as np print('Initializing distributed pytorch') os.environ['MASTER_ADDR'] = str(args.master_addr) os.environ['MASTER_PORT'] =...
def analyse(self, traj, network, current_subrun, subrun_list, network_dict): """Calculates average Fano Factor of a network. :param traj: Trajectory container Expects: `results.monitors.spikes_e`: Data from SpikeMonitor for excitatory neurons Adds: ...
def function[analyse, parameter[self, traj, network, current_subrun, subrun_list, network_dict]]: constant[Calculates average Fano Factor of a network. :param traj: Trajectory container Expects: `results.monitors.spikes_e`: Data from SpikeMonitor for excitatory ne...
keyword[def] identifier[analyse] ( identifier[self] , identifier[traj] , identifier[network] , identifier[current_subrun] , identifier[subrun_list] , identifier[network_dict] ): literal[string] keyword[if] identifier[len] ( identifier[subrun_list] )== literal[int] : identifie...
def analyse(self, traj, network, current_subrun, subrun_list, network_dict): """Calculates average Fano Factor of a network. :param traj: Trajectory container Expects: `results.monitors.spikes_e`: Data from SpikeMonitor for excitatory neurons Adds: ...
def branch_lengths(self, terminal=True, internal=True): '''Generator over the lengths of the selected branches of this ``Tree``. Edges with length ``None`` will be output as 0-length Args: ``terminal`` (``bool``): ``True`` to include terminal branches, otherwise ``False`` ``int...
def function[branch_lengths, parameter[self, terminal, internal]]: constant[Generator over the lengths of the selected branches of this ``Tree``. Edges with length ``None`` will be output as 0-length Args: ``terminal`` (``bool``): ``True`` to include terminal branches, otherwise ``False`` ...
keyword[def] identifier[branch_lengths] ( identifier[self] , identifier[terminal] = keyword[True] , identifier[internal] = keyword[True] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[terminal] , identifier[bool] ): keyword[raise] identifier[TypeErro...
def branch_lengths(self, terminal=True, internal=True): """Generator over the lengths of the selected branches of this ``Tree``. Edges with length ``None`` will be output as 0-length Args: ``terminal`` (``bool``): ``True`` to include terminal branches, otherwise ``False`` ``interna...
def hide_url_password(url): """Replace a password part of a URL with *****. This can be used to scrub URLs before logging them. """ try: parsed = parse.urlsplit(url) if parsed.password: return url.replace(':%s@' % parsed.password, ':*****@') except Exception: # pylint: ...
def function[hide_url_password, parameter[url]]: constant[Replace a password part of a URL with *****. This can be used to scrub URLs before logging them. ] <ast.Try object at 0x7da1b09e80d0> return[name[url]]
keyword[def] identifier[hide_url_password] ( identifier[url] ): literal[string] keyword[try] : identifier[parsed] = identifier[parse] . identifier[urlsplit] ( identifier[url] ) keyword[if] identifier[parsed] . identifier[password] : keyword[return] identifier[url] . identif...
def hide_url_password(url): """Replace a password part of a URL with *****. This can be used to scrub URLs before logging them. """ try: parsed = parse.urlsplit(url) if parsed.password: return url.replace(':%s@' % parsed.password, ':*****@') # depends on [control=['if'], da...
def list_subnets(self, identifier=None, datacenter=None, version=0, subnet_type=None, network_space=None, **kwargs): """Display a list of all subnets on the account. This provides a quick overview of all subnets including information about data center residence and the numb...
def function[list_subnets, parameter[self, identifier, datacenter, version, subnet_type, network_space]]: constant[Display a list of all subnets on the account. This provides a quick overview of all subnets including information about data center residence and the number of devices attached. ...
keyword[def] identifier[list_subnets] ( identifier[self] , identifier[identifier] = keyword[None] , identifier[datacenter] = keyword[None] , identifier[version] = literal[int] , identifier[subnet_type] = keyword[None] , identifier[network_space] = keyword[None] ,** identifier[kwargs] ): literal[string] ...
def list_subnets(self, identifier=None, datacenter=None, version=0, subnet_type=None, network_space=None, **kwargs): """Display a list of all subnets on the account. This provides a quick overview of all subnets including information about data center residence and the number of devices attached. ...
def data_item(data): """ When trying to return a meaningful error about an unexpected data item we cannot just `repr(data)` as that could show a gigantic data struture. This utility should try to get the key of the first item or the single item in the data structure. """ if isinstance(data,...
def function[data_item, parameter[data]]: constant[ When trying to return a meaningful error about an unexpected data item we cannot just `repr(data)` as that could show a gigantic data struture. This utility should try to get the key of the first item or the single item in the data structure. ...
keyword[def] identifier[data_item] ( identifier[data] ): literal[string] keyword[if] identifier[isinstance] ( identifier[data] , identifier[ndict] ): keyword[for] identifier[item] keyword[in] identifier[data] : keyword[return] identifier[repr] ( identifier[data] [ ...
def data_item(data): """ When trying to return a meaningful error about an unexpected data item we cannot just `repr(data)` as that could show a gigantic data struture. This utility should try to get the key of the first item or the single item in the data structure. """ if isinstance(data,...
def haslayer(self, cls): """Specific: NTPHeader().haslayer(NTP) should return True.""" if cls == "NTP": if isinstance(self, NTP): return True elif issubtype(cls, NTP): if isinstance(self, cls): return True return super(NTP, self).ha...
def function[haslayer, parameter[self, cls]]: constant[Specific: NTPHeader().haslayer(NTP) should return True.] if compare[name[cls] equal[==] constant[NTP]] begin[:] if call[name[isinstance], parameter[name[self], name[NTP]]] begin[:] return[constant[True]] return[call[c...
keyword[def] identifier[haslayer] ( identifier[self] , identifier[cls] ): literal[string] keyword[if] identifier[cls] == literal[string] : keyword[if] identifier[isinstance] ( identifier[self] , identifier[NTP] ): keyword[return] keyword[True] keyword[elif...
def haslayer(self, cls): """Specific: NTPHeader().haslayer(NTP) should return True.""" if cls == 'NTP': if isinstance(self, NTP): return True # depends on [control=['if'], data=[]] # depends on [control=['if'], data=[]] elif issubtype(cls, NTP): if isinstance(self, cls): ...
def _maybe_handle_help(self): """Handle requests for `help` information.""" if self._options.help_request: help_printer = HelpPrinter(self._options) result = help_printer.print_help() self._exiter(result)
def function[_maybe_handle_help, parameter[self]]: constant[Handle requests for `help` information.] if name[self]._options.help_request begin[:] variable[help_printer] assign[=] call[name[HelpPrinter], parameter[name[self]._options]] variable[result] assign[=] call[name[...
keyword[def] identifier[_maybe_handle_help] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_options] . identifier[help_request] : identifier[help_printer] = identifier[HelpPrinter] ( identifier[self] . identifier[_options] ) identifier[result] = identifier[he...
def _maybe_handle_help(self): """Handle requests for `help` information.""" if self._options.help_request: help_printer = HelpPrinter(self._options) result = help_printer.print_help() self._exiter(result) # depends on [control=['if'], data=[]]
def getcols(sheetMatch=None,colMatch="Decay"): """find every column in every sheet and put it in a new sheet or book.""" book=BOOK() if sheetMatch is None: matchingSheets=book.sheetNames print('all %d sheets selected '%(len(matchingSheets))) else: matchingSheets=[x for x in book....
def function[getcols, parameter[sheetMatch, colMatch]]: constant[find every column in every sheet and put it in a new sheet or book.] variable[book] assign[=] call[name[BOOK], parameter[]] if compare[name[sheetMatch] is constant[None]] begin[:] variable[matchingSheets] assign[=] ...
keyword[def] identifier[getcols] ( identifier[sheetMatch] = keyword[None] , identifier[colMatch] = literal[string] ): literal[string] identifier[book] = identifier[BOOK] () keyword[if] identifier[sheetMatch] keyword[is] keyword[None] : identifier[matchingSheets] = identifier[book] . identi...
def getcols(sheetMatch=None, colMatch='Decay'): """find every column in every sheet and put it in a new sheet or book.""" book = BOOK() if sheetMatch is None: matchingSheets = book.sheetNames print('all %d sheets selected ' % len(matchingSheets)) # depends on [control=['if'], data=[]] e...
def set_pkg_license_comment(self, doc, text): """Sets the package's license comment. Raises OrderError if no package previously defined. Raises CardinalityError if already set. Raises SPDXValueError if text is not free form text. """ self.assert_package_exists() i...
def function[set_pkg_license_comment, parameter[self, doc, text]]: constant[Sets the package's license comment. Raises OrderError if no package previously defined. Raises CardinalityError if already set. Raises SPDXValueError if text is not free form text. ] call[name[sel...
keyword[def] identifier[set_pkg_license_comment] ( identifier[self] , identifier[doc] , identifier[text] ): literal[string] identifier[self] . identifier[assert_package_exists] () keyword[if] keyword[not] identifier[self] . identifier[package_license_comment_set] : identifie...
def set_pkg_license_comment(self, doc, text): """Sets the package's license comment. Raises OrderError if no package previously defined. Raises CardinalityError if already set. Raises SPDXValueError if text is not free form text. """ self.assert_package_exists() if not self.p...
def mass(self,R,z=None,t=0.,forceint=False): """ NAME: mass PURPOSE: evaluate the mass enclosed INPUT: R - Cylindrical Galactocentric radius (can be Quantity) z= (None) vertical height (can be Quantity) t - time (optional; can...
def function[mass, parameter[self, R, z, t, forceint]]: constant[ NAME: mass PURPOSE: evaluate the mass enclosed INPUT: R - Cylindrical Galactocentric radius (can be Quantity) z= (None) vertical height (can be Quantity) t - ti...
keyword[def] identifier[mass] ( identifier[self] , identifier[R] , identifier[z] = keyword[None] , identifier[t] = literal[int] , identifier[forceint] = keyword[False] ): literal[string] keyword[if] identifier[self] . identifier[isNonAxi] : keyword[raise] identifier[NotImplementedErr...
def mass(self, R, z=None, t=0.0, forceint=False): """ NAME: mass PURPOSE: evaluate the mass enclosed INPUT: R - Cylindrical Galactocentric radius (can be Quantity) z= (None) vertical height (can be Quantity) t - time (optional; ca...
def transform(geom, to_sref): """Returns a transformed Geometry. Arguments: geom -- any coercible Geometry value or Envelope to_sref -- SpatialReference or EPSG ID as int """ # If we have an envelope, assume it's in the target sref. try: geom = getattr(geom, 'polygon', Envelope(geom...
def function[transform, parameter[geom, to_sref]]: constant[Returns a transformed Geometry. Arguments: geom -- any coercible Geometry value or Envelope to_sref -- SpatialReference or EPSG ID as int ] <ast.Try object at 0x7da18f00d420> <ast.Try object at 0x7da18f00cbe0> if compar...
keyword[def] identifier[transform] ( identifier[geom] , identifier[to_sref] ): literal[string] keyword[try] : identifier[geom] = identifier[getattr] ( identifier[geom] , literal[string] , identifier[Envelope] ( identifier[geom] ). identifier[polygon] ) keyword[except] ( identifier[TypeEr...
def transform(geom, to_sref): """Returns a transformed Geometry. Arguments: geom -- any coercible Geometry value or Envelope to_sref -- SpatialReference or EPSG ID as int """ # If we have an envelope, assume it's in the target sref. try: geom = getattr(geom, 'polygon', Envelope(geom...
def upgrade(yes, dry_run, patches): """ Upgrade the datamodel by applying recusively the patches available """ patcher = _get_mongopatcher() if dry_run: patcher.discover_and_apply(directory=patches, dry_run=dry_run) else: if (yes or prompt_bool("Are you sure you want to alter %s"...
def function[upgrade, parameter[yes, dry_run, patches]]: constant[ Upgrade the datamodel by applying recusively the patches available ] variable[patcher] assign[=] call[name[_get_mongopatcher], parameter[]] if name[dry_run] begin[:] call[name[patcher].discover_and_apply, ...
keyword[def] identifier[upgrade] ( identifier[yes] , identifier[dry_run] , identifier[patches] ): literal[string] identifier[patcher] = identifier[_get_mongopatcher] () keyword[if] identifier[dry_run] : identifier[patcher] . identifier[discover_and_apply] ( identifier[directory] = identifier...
def upgrade(yes, dry_run, patches): """ Upgrade the datamodel by applying recusively the patches available """ patcher = _get_mongopatcher() if dry_run: patcher.discover_and_apply(directory=patches, dry_run=dry_run) # depends on [control=['if'], data=[]] elif yes or prompt_bool('Are you...
def order_value(id_or_ins, cash_amount, price=None, style=None): """ 使用想要花费的金钱买入/卖出股票,而不是买入/卖出想要的股数,正数代表买入,负数代表卖出。股票的股数总是会被调整成对应的100的倍数(在A中国A股市场1手是100股)。如果资金不足,该API将不会创建发送订单。 需要注意: 当您提交一个买单时,cash_amount 代表的含义是您希望买入股票消耗的金额(包含税费),最终买入的股数不仅和发单的价格有关,还和税费相关的参数设置有关。 当您提交一个卖单时,cash_amount 代表的意义是您希望卖出股票的总价...
def function[order_value, parameter[id_or_ins, cash_amount, price, style]]: constant[ 使用想要花费的金钱买入/卖出股票,而不是买入/卖出想要的股数,正数代表买入,负数代表卖出。股票的股数总是会被调整成对应的100的倍数(在A中国A股市场1手是100股)。如果资金不足,该API将不会创建发送订单。 需要注意: 当您提交一个买单时,cash_amount 代表的含义是您希望买入股票消耗的金额(包含税费),最终买入的股数不仅和发单的价格有关,还和税费相关的参数设置有关。 当您提交一个卖单时,cash_am...
keyword[def] identifier[order_value] ( identifier[id_or_ins] , identifier[cash_amount] , identifier[price] = keyword[None] , identifier[style] = keyword[None] ): literal[string] identifier[style] = identifier[cal_style] ( identifier[price] , identifier[style] ) keyword[if] identifier[isinstance] ( ...
def order_value(id_or_ins, cash_amount, price=None, style=None): """ 使用想要花费的金钱买入/卖出股票,而不是买入/卖出想要的股数,正数代表买入,负数代表卖出。股票的股数总是会被调整成对应的100的倍数(在A中国A股市场1手是100股)。如果资金不足,该API将不会创建发送订单。 需要注意: 当您提交一个买单时,cash_amount 代表的含义是您希望买入股票消耗的金额(包含税费),最终买入的股数不仅和发单的价格有关,还和税费相关的参数设置有关。 当您提交一个卖单时,cash_amount 代表的意义是您希望卖出股票的总价...
def find_path_BFS(Graph,n,m): """ Breadth first search """ if m not in Graph: return None if n == m: return [m] path = [[n]] searched = [] while True: j = len(path) #k = len(Graph[n]) for i in range(j): node = path[i][-1] fo...
def function[find_path_BFS, parameter[Graph, n, m]]: constant[ Breadth first search ] if compare[name[m] <ast.NotIn object at 0x7da2590d7190> name[Graph]] begin[:] return[constant[None]] if compare[name[n] equal[==] name[m]] begin[:] return[list[[<ast.Name object at 0x7da...
keyword[def] identifier[find_path_BFS] ( identifier[Graph] , identifier[n] , identifier[m] ): literal[string] keyword[if] identifier[m] keyword[not] keyword[in] identifier[Graph] : keyword[return] keyword[None] keyword[if] identifier[n] == identifier[m] : keyword[return] [ ide...
def find_path_BFS(Graph, n, m): """ Breadth first search """ if m not in Graph: return None # depends on [control=['if'], data=[]] if n == m: return [m] # depends on [control=['if'], data=['m']] path = [[n]] searched = [] while True: j = len(path) #k = l...
def remove_state(self, state_id, recursive=True, force=False, destroy=True): """ Overwrite the parent class remove state method by checking if the user tries to delete the decider state :param state_id: the id of the state to remove :param recursive: a flag to indicate a recursive disassembling...
def function[remove_state, parameter[self, state_id, recursive, force, destroy]]: constant[ Overwrite the parent class remove state method by checking if the user tries to delete the decider state :param state_id: the id of the state to remove :param recursive: a flag to indicate a recursive di...
keyword[def] identifier[remove_state] ( identifier[self] , identifier[state_id] , identifier[recursive] = keyword[True] , identifier[force] = keyword[False] , identifier[destroy] = keyword[True] ): literal[string] keyword[if] identifier[state_id] == identifier[UNIQUE_DECIDER_STATE_ID] keyword[and...
def remove_state(self, state_id, recursive=True, force=False, destroy=True): """ Overwrite the parent class remove state method by checking if the user tries to delete the decider state :param state_id: the id of the state to remove :param recursive: a flag to indicate a recursive disassembling of ...