code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def _invalid_triple_quote(self, quote, row, col=None): """Add a message for an invalid triple quote. Args: quote: The quote characters that were found. row: The row number the quote characters were found on. col: The column the quote characters were found on. ...
def function[_invalid_triple_quote, parameter[self, quote, row, col]]: constant[Add a message for an invalid triple quote. Args: quote: The quote characters that were found. row: The row number the quote characters were found on. col: The column the quote characters ...
keyword[def] identifier[_invalid_triple_quote] ( identifier[self] , identifier[quote] , identifier[row] , identifier[col] = keyword[None] ): literal[string] identifier[self] . identifier[add_message] ( literal[string] , identifier[line] = identifier[row] , identifier[args...
def _invalid_triple_quote(self, quote, row, col=None): """Add a message for an invalid triple quote. Args: quote: The quote characters that were found. row: The row number the quote characters were found on. col: The column the quote characters were found on. """...
def air_range(self) -> Union[int, float]: """ Does not include upgrades """ if self._weapons: weapon = next( (weapon for weapon in self._weapons if weapon.type in {TargetType.Air.value, TargetType.Any.value}), None, ) if weapon: ...
def function[air_range, parameter[self]]: constant[ Does not include upgrades ] if name[self]._weapons begin[:] variable[weapon] assign[=] call[name[next], parameter[<ast.GeneratorExp object at 0x7da20c7c8a30>, constant[None]]] if name[weapon] begin[:] return[...
keyword[def] identifier[air_range] ( identifier[self] )-> identifier[Union] [ identifier[int] , identifier[float] ]: literal[string] keyword[if] identifier[self] . identifier[_weapons] : identifier[weapon] = identifier[next] ( ( identifier[weapon] keyword[for] identifier...
def air_range(self) -> Union[int, float]: """ Does not include upgrades """ if self._weapons: weapon = next((weapon for weapon in self._weapons if weapon.type in {TargetType.Air.value, TargetType.Any.value}), None) if weapon: return weapon.range # depends on [control=['if'], data=[]...
def read_string(self, advance=True): """ Read a string terminated by null byte '\0'. The returned string object is ASCII decoded, and will not include the terminating null byte. """ target = self._blob.find(b'\0', self.pos) assert target >= self._pos data = self._...
def function[read_string, parameter[self, advance]]: constant[ Read a string terminated by null byte ''. The returned string object is ASCII decoded, and will not include the terminating null byte. ] variable[target] assign[=] call[name[self]._blob.find, parameter[constant[b'\x0...
keyword[def] identifier[read_string] ( identifier[self] , identifier[advance] = keyword[True] ): literal[string] identifier[target] = identifier[self] . identifier[_blob] . identifier[find] ( literal[string] , identifier[self] . identifier[pos] ) keyword[assert] identifier[target] >= iden...
def read_string(self, advance=True): """ Read a string terminated by null byte '\x00'. The returned string object is ASCII decoded, and will not include the terminating null byte. """ target = self._blob.find(b'\x00', self.pos) assert target >= self._pos data = self._blob[self._p...
def punctuate(current_text, new_text, add_punctuation): """ Add punctuation as needed """ if add_punctuation and current_text and not current_text[-1] in string.punctuation: current_text += '. ' spacer = ' ' if not current_text or (not current_text[-1].isspace() and not new_text[0].isspace()) else '...
def function[punctuate, parameter[current_text, new_text, add_punctuation]]: constant[ Add punctuation as needed ] if <ast.BoolOp object at 0x7da1b15f3eb0> begin[:] <ast.AugAssign object at 0x7da2047e89a0> variable[spacer] assign[=] <ast.IfExp object at 0x7da2047e98a0> return[binary_...
keyword[def] identifier[punctuate] ( identifier[current_text] , identifier[new_text] , identifier[add_punctuation] ): literal[string] keyword[if] identifier[add_punctuation] keyword[and] identifier[current_text] keyword[and] keyword[not] identifier[current_text] [- literal[int] ] keyword[in] identif...
def punctuate(current_text, new_text, add_punctuation): """ Add punctuation as needed """ if add_punctuation and current_text and (not current_text[-1] in string.punctuation): current_text += '. ' # depends on [control=['if'], data=[]] spacer = ' ' if not current_text or (not current_text[-1].isspa...
def for_each(self, action, filter=None): """! @brief Apply an action to every component defined in the ROM table and child tables. This method iterates over every entry in the ROM table. For each entry it calls the filter function if provided. If the filter passes (returns True or was n...
def function[for_each, parameter[self, action, filter]]: constant[! @brief Apply an action to every component defined in the ROM table and child tables. This method iterates over every entry in the ROM table. For each entry it calls the filter function if provided. If the filter passes ...
keyword[def] identifier[for_each] ( identifier[self] , identifier[action] , identifier[filter] = keyword[None] ): literal[string] keyword[for] identifier[component] keyword[in] identifier[self] . identifier[components] : keyword[if] identifier[isinstance] ( identifier[comp...
def for_each(self, action, filter=None): """! @brief Apply an action to every component defined in the ROM table and child tables. This method iterates over every entry in the ROM table. For each entry it calls the filter function if provided. If the filter passes (returns True or was not p...
def photo_infos(self): """ :returns: list of :class:`~okcupyd.photo.Info` instances for each photo displayed on okcupid. """ from . import photo pics_request = self._session.okc_get( u'profile/{0}/album/0'.format(self.username), ) pic...
def function[photo_infos, parameter[self]]: constant[ :returns: list of :class:`~okcupyd.photo.Info` instances for each photo displayed on okcupid. ] from relative_module[None] import module[photo] variable[pics_request] assign[=] call[name[self]._session.okc_get, p...
keyword[def] identifier[photo_infos] ( identifier[self] ): literal[string] keyword[from] . keyword[import] identifier[photo] identifier[pics_request] = identifier[self] . identifier[_session] . identifier[okc_get] ( literal[string] . identifier[format] ( identifier[self] . ident...
def photo_infos(self): """ :returns: list of :class:`~okcupyd.photo.Info` instances for each photo displayed on okcupid. """ from . import photo pics_request = self._session.okc_get(u'profile/{0}/album/0'.format(self.username)) pics_tree = html.fromstring(u'{0}{1}{2}'.f...
def get_system_config_dirs(app_name, app_author, force_xdg=True): r"""Returns a list of system-wide config folders for the application. For an example application called ``"My App"`` by ``"Acme"``, something like the following folders could be returned: macOS (non-XDG): ``['/Library/Application ...
def function[get_system_config_dirs, parameter[app_name, app_author, force_xdg]]: constant[Returns a list of system-wide config folders for the application. For an example application called ``"My App"`` by ``"Acme"``, something like the following folders could be returned: macOS (non-XDG): ...
keyword[def] identifier[get_system_config_dirs] ( identifier[app_name] , identifier[app_author] , identifier[force_xdg] = keyword[True] ): literal[string] keyword[if] identifier[WIN] : identifier[folder] = identifier[os] . identifier[environ] . identifier[get] ( literal[string] ) keyword...
def get_system_config_dirs(app_name, app_author, force_xdg=True): """Returns a list of system-wide config folders for the application. For an example application called ``"My App"`` by ``"Acme"``, something like the following folders could be returned: macOS (non-XDG): ``['/Library/Application S...
def cli(ctx, url=None, api_key=None, admin=False, **kwds): """Help initialize global configuration (in home directory) """ # TODO: prompt for values someday. click.echo("""Welcome to Apollo's Arrow!""") if os.path.exists(config.global_config_path()): info("Your arrow configuration already ex...
def function[cli, parameter[ctx, url, api_key, admin]]: constant[Help initialize global configuration (in home directory) ] call[name[click].echo, parameter[constant[Welcome to Apollo's Arrow!]]] if call[name[os].path.exists, parameter[call[name[config].global_config_path, parameter[]]]] beg...
keyword[def] identifier[cli] ( identifier[ctx] , identifier[url] = keyword[None] , identifier[api_key] = keyword[None] , identifier[admin] = keyword[False] ,** identifier[kwds] ): literal[string] identifier[click] . identifier[echo] ( literal[string] ) keyword[if] identifier[os] . identifier[pat...
def cli(ctx, url=None, api_key=None, admin=False, **kwds): """Help initialize global configuration (in home directory) """ # TODO: prompt for values someday. click.echo("Welcome to Apollo's Arrow!") if os.path.exists(config.global_config_path()): info('Your arrow configuration already exists...
def follow_user(self, user, delegate): """Follow the given user. Returns the user info back to the given delegate """ parser = txml.Users(delegate) return self.__postPage('/friendships/create/%s.xml' % (user), parser)
def function[follow_user, parameter[self, user, delegate]]: constant[Follow the given user. Returns the user info back to the given delegate ] variable[parser] assign[=] call[name[txml].Users, parameter[name[delegate]]] return[call[name[self].__postPage, parameter[binary_operation[c...
keyword[def] identifier[follow_user] ( identifier[self] , identifier[user] , identifier[delegate] ): literal[string] identifier[parser] = identifier[txml] . identifier[Users] ( identifier[delegate] ) keyword[return] identifier[self] . identifier[__postPage] ( literal[string] %( identifier...
def follow_user(self, user, delegate): """Follow the given user. Returns the user info back to the given delegate """ parser = txml.Users(delegate) return self.__postPage('/friendships/create/%s.xml' % user, parser)
def get_all_specs(self): """Returns a dict mapping kernel names and resource directories. """ # This is new in 4.1 -> https://github.com/jupyter/jupyter_client/pull/93 specs = self.get_all_kernel_specs_for_envs() specs.update(super(EnvironmentKernelSpecManager, self).get_all_spec...
def function[get_all_specs, parameter[self]]: constant[Returns a dict mapping kernel names and resource directories. ] variable[specs] assign[=] call[name[self].get_all_kernel_specs_for_envs, parameter[]] call[name[specs].update, parameter[call[call[name[super], parameter[name[Environmen...
keyword[def] identifier[get_all_specs] ( identifier[self] ): literal[string] identifier[specs] = identifier[self] . identifier[get_all_kernel_specs_for_envs] () identifier[specs] . identifier[update] ( identifier[super] ( identifier[EnvironmentKernelSpecManager] , identifier[self]...
def get_all_specs(self): """Returns a dict mapping kernel names and resource directories. """ # This is new in 4.1 -> https://github.com/jupyter/jupyter_client/pull/93 specs = self.get_all_kernel_specs_for_envs() specs.update(super(EnvironmentKernelSpecManager, self).get_all_specs()) return ...
def ewsformat(self): """ ISO 8601 format to satisfy xs:datetime as interpreted by EWS. Examples: 2009-01-15T13:45:56Z 2009-01-15T13:45:56+01:00 """ if not self.tzinfo: raise ValueError('EWSDateTime must be timezone-aware') if self.tzinfo.zone =...
def function[ewsformat, parameter[self]]: constant[ ISO 8601 format to satisfy xs:datetime as interpreted by EWS. Examples: 2009-01-15T13:45:56Z 2009-01-15T13:45:56+01:00 ] if <ast.UnaryOp object at 0x7da20c6aa0b0> begin[:] <ast.Raise object at 0x7da20c6aa...
keyword[def] identifier[ewsformat] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[tzinfo] : keyword[raise] identifier[ValueError] ( literal[string] ) keyword[if] identifier[self] . identifier[tzinfo] . identifier[zone] == liter...
def ewsformat(self): """ ISO 8601 format to satisfy xs:datetime as interpreted by EWS. Examples: 2009-01-15T13:45:56Z 2009-01-15T13:45:56+01:00 """ if not self.tzinfo: raise ValueError('EWSDateTime must be timezone-aware') # depends on [control=['if'], data=[]] ...
def alerts(self): """Query for alerts attached to this incident.""" endpoint = '/'.join((self.endpoint, self.id, 'alerts')) return self.alertFactory.find( endpoint=endpoint, api_key=self.api_key, )
def function[alerts, parameter[self]]: constant[Query for alerts attached to this incident.] variable[endpoint] assign[=] call[constant[/].join, parameter[tuple[[<ast.Attribute object at 0x7da1b06fd660>, <ast.Attribute object at 0x7da1b06fcac0>, <ast.Constant object at 0x7da1b06fc2b0>]]]] return[cal...
keyword[def] identifier[alerts] ( identifier[self] ): literal[string] identifier[endpoint] = literal[string] . identifier[join] (( identifier[self] . identifier[endpoint] , identifier[self] . identifier[id] , literal[string] )) keyword[return] identifier[self] . identifier[alertFactory] ....
def alerts(self): """Query for alerts attached to this incident.""" endpoint = '/'.join((self.endpoint, self.id, 'alerts')) return self.alertFactory.find(endpoint=endpoint, api_key=self.api_key)
def get_defaults_file(*a, **kw): """Get a file object with YAML data of configuration defaults. Arguments are passed through to :func:`get_defaults_str`. """ fd = StringIO() fd.write(get_defaults_str(*a, **kw)) fd.seek(0) return fd
def function[get_defaults_file, parameter[]]: constant[Get a file object with YAML data of configuration defaults. Arguments are passed through to :func:`get_defaults_str`. ] variable[fd] assign[=] call[name[StringIO], parameter[]] call[name[fd].write, parameter[call[name[get_defaults_s...
keyword[def] identifier[get_defaults_file] (* identifier[a] ,** identifier[kw] ): literal[string] identifier[fd] = identifier[StringIO] () identifier[fd] . identifier[write] ( identifier[get_defaults_str] (* identifier[a] ,** identifier[kw] )) identifier[fd] . identifier[seek] ( literal[int] ) ...
def get_defaults_file(*a, **kw): """Get a file object with YAML data of configuration defaults. Arguments are passed through to :func:`get_defaults_str`. """ fd = StringIO() fd.write(get_defaults_str(*a, **kw)) fd.seek(0) return fd
def get_all(self, start=0, count=-1, sort=''): """ Gets a list of logical interconnects based on optional sorting and filtering and is constrained by start and count parameters. Args: start: The first item to return, using 0-based indexing. If...
def function[get_all, parameter[self, start, count, sort]]: constant[ Gets a list of logical interconnects based on optional sorting and filtering and is constrained by start and count parameters. Args: start: The first item to return, using 0-based indexing....
keyword[def] identifier[get_all] ( identifier[self] , identifier[start] = literal[int] , identifier[count] =- literal[int] , identifier[sort] = literal[string] ): literal[string] keyword[return] identifier[self] . identifier[_helper] . identifier[get_all] ( identifier[start] , identifier[count] , ...
def get_all(self, start=0, count=-1, sort=''): """ Gets a list of logical interconnects based on optional sorting and filtering and is constrained by start and count parameters. Args: start: The first item to return, using 0-based indexing. If not...
def using_config(_func=None): """ This allows a function to use Summernote configuration as a global variable, temporarily. """ def decorator(func): @wraps(func) def inner_dec(*args, **kwargs): g = func.__globals__ var_name = 'config' sentinel = ob...
def function[using_config, parameter[_func]]: constant[ This allows a function to use Summernote configuration as a global variable, temporarily. ] def function[decorator, parameter[func]]: def function[inner_dec, parameter[]]: variable[g] assign[=] na...
keyword[def] identifier[using_config] ( identifier[_func] = keyword[None] ): literal[string] keyword[def] identifier[decorator] ( identifier[func] ): @ identifier[wraps] ( identifier[func] ) keyword[def] identifier[inner_dec] (* identifier[args] ,** identifier[kwargs] ): ide...
def using_config(_func=None): """ This allows a function to use Summernote configuration as a global variable, temporarily. """ def decorator(func): @wraps(func) def inner_dec(*args, **kwargs): g = func.__globals__ var_name = 'config' sentinel = ...
def calibrate_cameras(self): """Calibrate cameras based on found chessboard corners.""" criteria = (cv2.TERM_CRITERIA_MAX_ITER + cv2.TERM_CRITERIA_EPS, 100, 1e-5) flags = (cv2.CALIB_FIX_ASPECT_RATIO + cv2.CALIB_ZERO_TANGENT_DIST + cv2.CALIB_SAME_FOCAL_LENGTH)...
def function[calibrate_cameras, parameter[self]]: constant[Calibrate cameras based on found chessboard corners.] variable[criteria] assign[=] tuple[[<ast.BinOp object at 0x7da2043443d0>, <ast.Constant object at 0x7da204347fa0>, <ast.Constant object at 0x7da204344bb0>]] variable[flags] assign[=] ...
keyword[def] identifier[calibrate_cameras] ( identifier[self] ): literal[string] identifier[criteria] =( identifier[cv2] . identifier[TERM_CRITERIA_MAX_ITER] + identifier[cv2] . identifier[TERM_CRITERIA_EPS] , literal[int] , literal[int] ) identifier[flags] =( identifier[cv2] . id...
def calibrate_cameras(self): """Calibrate cameras based on found chessboard corners.""" criteria = (cv2.TERM_CRITERIA_MAX_ITER + cv2.TERM_CRITERIA_EPS, 100, 1e-05) flags = cv2.CALIB_FIX_ASPECT_RATIO + cv2.CALIB_ZERO_TANGENT_DIST + cv2.CALIB_SAME_FOCAL_LENGTH calib = StereoCalibration() (calib.cam_ma...
def release(self): """Release the lock. This method should only be called in the locked state; it changes the state to unlocked and returns immediately. If an attempt is made to release an unlocked lock, a RuntimeError will be raised. """ if self._local.locked: ...
def function[release, parameter[self]]: constant[Release the lock. This method should only be called in the locked state; it changes the state to unlocked and returns immediately. If an attempt is made to release an unlocked lock, a RuntimeError will be raised. ] ...
keyword[def] identifier[release] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_local] . identifier[locked] : keyword[while] identifier[self] . identifier[_queue] : identifier[future] = identifier[self] . identifier[_queue] . identif...
def release(self): """Release the lock. This method should only be called in the locked state; it changes the state to unlocked and returns immediately. If an attempt is made to release an unlocked lock, a RuntimeError will be raised. """ if self._local.locked: w...
def parallel_evaluation_pp(candidates, args): """Evaluate the candidates in parallel using Parallel Python. This function allows parallel evaluation of candidate solutions. It uses the `Parallel Python <http://www.parallelpython.com>`_ (pp) library to accomplish the parallelization. This library must ...
def function[parallel_evaluation_pp, parameter[candidates, args]]: constant[Evaluate the candidates in parallel using Parallel Python. This function allows parallel evaluation of candidate solutions. It uses the `Parallel Python <http://www.parallelpython.com>`_ (pp) library to accomplish the para...
keyword[def] identifier[parallel_evaluation_pp] ( identifier[candidates] , identifier[args] ): literal[string] keyword[import] identifier[pp] identifier[logger] = identifier[args] [ literal[string] ]. identifier[logger] keyword[try] : identifier[evaluator] = identifier[args] [ litera...
def parallel_evaluation_pp(candidates, args): """Evaluate the candidates in parallel using Parallel Python. This function allows parallel evaluation of candidate solutions. It uses the `Parallel Python <http://www.parallelpython.com>`_ (pp) library to accomplish the parallelization. This library must ...
def dump(self, msg, fn_): ''' Serialize the correct data into the named file object ''' if six.PY2: fn_.write(self.dumps(msg)) else: # When using Python 3, write files in such a way # that the 'bytes' and 'str' types are distinguishable ...
def function[dump, parameter[self, msg, fn_]]: constant[ Serialize the correct data into the named file object ] if name[six].PY2 begin[:] call[name[fn_].write, parameter[call[name[self].dumps, parameter[name[msg]]]]] call[name[fn_].close, parameter[]]
keyword[def] identifier[dump] ( identifier[self] , identifier[msg] , identifier[fn_] ): literal[string] keyword[if] identifier[six] . identifier[PY2] : identifier[fn_] . identifier[write] ( identifier[self] . identifier[dumps] ( identifier[msg] )) keyword[else] : ...
def dump(self, msg, fn_): """ Serialize the correct data into the named file object """ if six.PY2: fn_.write(self.dumps(msg)) # depends on [control=['if'], data=[]] else: # When using Python 3, write files in such a way # that the 'bytes' and 'str' types are disting...
def exec(self, operand1, operand2): """ Uses two operands and performs a function on their content.:: operand1 = function(operand1, operand2) """ in1 = self.register_interface.read(operand1) in2 = self.register_interface.read(operand2) out = self.function(in1, in2) self.register_interface.write(operan...
def function[exec, parameter[self, operand1, operand2]]: constant[ Uses two operands and performs a function on their content.:: operand1 = function(operand1, operand2) ] variable[in1] assign[=] call[name[self].register_interface.read, parameter[name[operand1]]] variable[in2] assign[=] c...
keyword[def] identifier[exec] ( identifier[self] , identifier[operand1] , identifier[operand2] ): literal[string] identifier[in1] = identifier[self] . identifier[register_interface] . identifier[read] ( identifier[operand1] ) identifier[in2] = identifier[self] . identifier[register_interface] . identifier[r...
def exec(self, operand1, operand2): """ Uses two operands and performs a function on their content.:: operand1 = function(operand1, operand2) """ in1 = self.register_interface.read(operand1) in2 = self.register_interface.read(operand2) out = self.function(in1, in2) self.register_interface.wr...
def history(self, storage_version): """Get reminder changes. """ params = { "storageVersion": storage_version, "includeSnoozePresetUpdates": True, } params.update(self.static_params) return self.send( url=self._base_url + 'history', ...
def function[history, parameter[self, storage_version]]: constant[Get reminder changes. ] variable[params] assign[=] dictionary[[<ast.Constant object at 0x7da18f00fdc0>, <ast.Constant object at 0x7da18f00cb20>], [<ast.Name object at 0x7da18f00ffd0>, <ast.Constant object at 0x7da18f00d7e0>]] ...
keyword[def] identifier[history] ( identifier[self] , identifier[storage_version] ): literal[string] identifier[params] ={ literal[string] : identifier[storage_version] , literal[string] : keyword[True] , } identifier[params] . identifier[update] ( identifier[self...
def history(self, storage_version): """Get reminder changes. """ params = {'storageVersion': storage_version, 'includeSnoozePresetUpdates': True} params.update(self.static_params) return self.send(url=self._base_url + 'history', method='POST', json=params)
def gen_ordered_statistics(transaction_manager, record): """ Returns a generator of ordered statistics as OrderedStatistic instances. Arguments: transaction_manager -- Transactions as a TransactionManager instance. record -- A support record as a SupportRecord instance. """ items = ...
def function[gen_ordered_statistics, parameter[transaction_manager, record]]: constant[ Returns a generator of ordered statistics as OrderedStatistic instances. Arguments: transaction_manager -- Transactions as a TransactionManager instance. record -- A support record as a SupportRecord...
keyword[def] identifier[gen_ordered_statistics] ( identifier[transaction_manager] , identifier[record] ): literal[string] identifier[items] = identifier[record] . identifier[items] keyword[for] identifier[combination_set] keyword[in] identifier[combinations] ( identifier[sorted] ( identifier[items...
def gen_ordered_statistics(transaction_manager, record): """ Returns a generator of ordered statistics as OrderedStatistic instances. Arguments: transaction_manager -- Transactions as a TransactionManager instance. record -- A support record as a SupportRecord instance. """ items = ...
def _message(status, content): """Send message interface. Parameters ---------- status : str The type of message content : str """ event = f'message.{status}' if flask.has_request_context(): emit(event, dict(data=pack(content))) else: sio = flask.current_app...
def function[_message, parameter[status, content]]: constant[Send message interface. Parameters ---------- status : str The type of message content : str ] variable[event] assign[=] <ast.JoinedStr object at 0x7da18eb562c0> if call[name[flask].has_request_context, pa...
keyword[def] identifier[_message] ( identifier[status] , identifier[content] ): literal[string] identifier[event] = literal[string] keyword[if] identifier[flask] . identifier[has_request_context] (): identifier[emit] ( identifier[event] , identifier[dict] ( identifier[data] = identifier[pac...
def _message(status, content): """Send message interface. Parameters ---------- status : str The type of message content : str """ event = f'message.{status}' if flask.has_request_context(): emit(event, dict(data=pack(content))) # depends on [control=['if'], data=[]] ...
def get_attachment( self, attachment, headers=None, write_to=None, attachment_type=None): """ Retrieves a document's attachment and optionally writes it to a file. If the content_type of the attachment is 'application/json' then the ...
def function[get_attachment, parameter[self, attachment, headers, write_to, attachment_type]]: constant[ Retrieves a document's attachment and optionally writes it to a file. If the content_type of the attachment is 'application/json' then the data returned will be in JSON format otherwi...
keyword[def] identifier[get_attachment] ( identifier[self] , identifier[attachment] , identifier[headers] = keyword[None] , identifier[write_to] = keyword[None] , identifier[attachment_type] = keyword[None] ): literal[string] identifier[self] . identifier[fetch] () identifier...
def get_attachment(self, attachment, headers=None, write_to=None, attachment_type=None): """ Retrieves a document's attachment and optionally writes it to a file. If the content_type of the attachment is 'application/json' then the data returned will be in JSON format otherwise the response ...
def audio_send_stream(self, httptype=None, channel=None, path_file=None, encode=None): """ Params: path_file - path to audio file channel: - integer httptype - type string (singlepart or multipart) singlepart: HTTP content i...
def function[audio_send_stream, parameter[self, httptype, channel, path_file, encode]]: constant[ Params: path_file - path to audio file channel: - integer httptype - type string (singlepart or multipart) singlepart: HTTP content is a continuos flow ...
keyword[def] identifier[audio_send_stream] ( identifier[self] , identifier[httptype] = keyword[None] , identifier[channel] = keyword[None] , identifier[path_file] = keyword[None] , identifier[encode] = keyword[None] ): literal[string] keyword[if] identifier[httptype] keyword[is] keyword[None] ...
def audio_send_stream(self, httptype=None, channel=None, path_file=None, encode=None): """ Params: path_file - path to audio file channel: - integer httptype - type string (singlepart or multipart) singlepart: HTTP content is a continuos flow of audio pa...
def plot_shapes(df_shapes, shape_i_columns, axis=None, autoxlim=True, autoylim=True, **kwargs): ''' Plot shapes from table/data-frame where each row corresponds to a vertex of a shape. Shape vertices are grouped by `shape_i_columns`. For example, consider the following dataframe: ...
def function[plot_shapes, parameter[df_shapes, shape_i_columns, axis, autoxlim, autoylim]]: constant[ Plot shapes from table/data-frame where each row corresponds to a vertex of a shape. Shape vertices are grouped by `shape_i_columns`. For example, consider the following dataframe: sh...
keyword[def] identifier[plot_shapes] ( identifier[df_shapes] , identifier[shape_i_columns] , identifier[axis] = keyword[None] , identifier[autoxlim] = keyword[True] , identifier[autoylim] = keyword[True] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[axis] keyword[is] keyword[None] : ...
def plot_shapes(df_shapes, shape_i_columns, axis=None, autoxlim=True, autoylim=True, **kwargs): """ Plot shapes from table/data-frame where each row corresponds to a vertex of a shape. Shape vertices are grouped by `shape_i_columns`. For example, consider the following dataframe: shape_i ...
def sign_digest(sock, keygrip, digest, sp=subprocess, environ=None): """Sign a digest using specified key using GPG agent.""" hash_algo = 8 # SHA256 assert len(digest) == 32 assert communicate(sock, 'RESET').startswith(b'OK') ttyname = check_output(args=['tty'], sp=sp).strip() options = ['tty...
def function[sign_digest, parameter[sock, keygrip, digest, sp, environ]]: constant[Sign a digest using specified key using GPG agent.] variable[hash_algo] assign[=] constant[8] assert[compare[call[name[len], parameter[name[digest]]] equal[==] constant[32]]] assert[call[call[name[communicate], pa...
keyword[def] identifier[sign_digest] ( identifier[sock] , identifier[keygrip] , identifier[digest] , identifier[sp] = identifier[subprocess] , identifier[environ] = keyword[None] ): literal[string] identifier[hash_algo] = literal[int] keyword[assert] identifier[len] ( identifier[digest] )== literal[...
def sign_digest(sock, keygrip, digest, sp=subprocess, environ=None): """Sign a digest using specified key using GPG agent.""" hash_algo = 8 # SHA256 assert len(digest) == 32 assert communicate(sock, 'RESET').startswith(b'OK') ttyname = check_output(args=['tty'], sp=sp).strip() options = ['ttyna...
def get_product_order_book(self, product_id, level=1): """Get a list of open orders for a product. The amount of detail shown can be customized with the `level` parameter: * 1: Only the best bid and ask * 2: Top 50 bids and asks (aggregated) * 3: Full order book (non agg...
def function[get_product_order_book, parameter[self, product_id, level]]: constant[Get a list of open orders for a product. The amount of detail shown can be customized with the `level` parameter: * 1: Only the best bid and ask * 2: Top 50 bids and asks (aggregated) * 3:...
keyword[def] identifier[get_product_order_book] ( identifier[self] , identifier[product_id] , identifier[level] = literal[int] ): literal[string] identifier[params] ={ literal[string] : identifier[level] } keyword[return] identifier[self] . identifier[_send_message] ( literal[string] , ...
def get_product_order_book(self, product_id, level=1): """Get a list of open orders for a product. The amount of detail shown can be customized with the `level` parameter: * 1: Only the best bid and ask * 2: Top 50 bids and asks (aggregated) * 3: Full order book (non aggrega...
def show(self, brief=False): """ Show metadata for each path given """ output = [] for path in self.options.paths or ["."]: if self.options.verbose: utils.info("Checking {0} for metadata.".format(path)) tree = fmf.Tree(path) for node in tree.pr...
def function[show, parameter[self, brief]]: constant[ Show metadata for each path given ] variable[output] assign[=] list[[]] for taget[name[path]] in starred[<ast.BoolOp object at 0x7da18f58d4b0>] begin[:] if name[self].options.verbose begin[:] call[name[...
keyword[def] identifier[show] ( identifier[self] , identifier[brief] = keyword[False] ): literal[string] identifier[output] =[] keyword[for] identifier[path] keyword[in] identifier[self] . identifier[options] . identifier[paths] keyword[or] [ literal[string] ]: keyword[if]...
def show(self, brief=False): """ Show metadata for each path given """ output = [] for path in self.options.paths or ['.']: if self.options.verbose: utils.info('Checking {0} for metadata.'.format(path)) # depends on [control=['if'], data=[]] tree = fmf.Tree(path) for nod...
def to_property(obj, prop=None, dtype=Ellipsis, outliers=None, data_range=None, clipped=np.inf, weights=None, weight_min=0, weight_transform=Ellipsis, mask=None, valid_range=None, null=np.nan, transform=None, yield_weight...
def function[to_property, parameter[obj, prop, dtype, outliers, data_range, clipped, weights, weight_min, weight_transform, mask, valid_range, null, transform, yield_weight]]: constant[ to_property(obj, prop) yields the given property from obj after performing a set of filters on the property, as spec...
keyword[def] identifier[to_property] ( identifier[obj] , identifier[prop] = keyword[None] , identifier[dtype] = identifier[Ellipsis] , identifier[outliers] = keyword[None] , identifier[data_range] = keyword[None] , identifier[clipped] = identifier[np] . identifier[inf] , identifier[weights] = keyword[None] , ident...
def to_property(obj, prop=None, dtype=Ellipsis, outliers=None, data_range=None, clipped=np.inf, weights=None, weight_min=0, weight_transform=Ellipsis, mask=None, valid_range=None, null=np.nan, transform=None, yield_weight=False): """ to_property(obj, prop) yields the given property from obj after performing a s...
def _bson_to_dict(data, opts): """Decode a BSON string to document_class.""" try: if _raw_document_class(opts.document_class): return opts.document_class(data, opts) _, end = _get_object_size(data, 0, len(data)) return _elements_to_dict(data, 4, end, opts) except InvalidB...
def function[_bson_to_dict, parameter[data, opts]]: constant[Decode a BSON string to document_class.] <ast.Try object at 0x7da18bc71f60>
keyword[def] identifier[_bson_to_dict] ( identifier[data] , identifier[opts] ): literal[string] keyword[try] : keyword[if] identifier[_raw_document_class] ( identifier[opts] . identifier[document_class] ): keyword[return] identifier[opts] . identifier[document_class] ( identifier[da...
def _bson_to_dict(data, opts): """Decode a BSON string to document_class.""" try: if _raw_document_class(opts.document_class): return opts.document_class(data, opts) # depends on [control=['if'], data=[]] (_, end) = _get_object_size(data, 0, len(data)) return _elements_to_di...
def get(self, property): """ Gets the value of the given property. First checks client config properties, then environment variables and lastly fall backs to the default value of the property. :param property: (:class:`~hazelcast.config.ClientProperty`), Property to get value from ...
def function[get, parameter[self, property]]: constant[ Gets the value of the given property. First checks client config properties, then environment variables and lastly fall backs to the default value of the property. :param property: (:class:`~hazelcast.config.ClientProperty`), Prope...
keyword[def] identifier[get] ( identifier[self] , identifier[property] ): literal[string] keyword[return] identifier[self] . identifier[_properties] . identifier[get] ( identifier[property] . identifier[name] ) keyword[or] identifier[os] . identifier[getenv] ( identifier[property] . identifier[na...
def get(self, property): """ Gets the value of the given property. First checks client config properties, then environment variables and lastly fall backs to the default value of the property. :param property: (:class:`~hazelcast.config.ClientProperty`), Property to get value from :...
def slave_open(tty_name): """slave_open(tty_name) -> slave_fd Open the pty slave and acquire the controlling terminal, returning opened filedescriptor. Deprecated, use openpty() instead.""" result = os.open(tty_name, os.O_RDWR) try: from fcntl import ioctl, I_PUSH except ImportError...
def function[slave_open, parameter[tty_name]]: constant[slave_open(tty_name) -> slave_fd Open the pty slave and acquire the controlling terminal, returning opened filedescriptor. Deprecated, use openpty() instead.] variable[result] assign[=] call[name[os].open, parameter[name[tty_name], name...
keyword[def] identifier[slave_open] ( identifier[tty_name] ): literal[string] identifier[result] = identifier[os] . identifier[open] ( identifier[tty_name] , identifier[os] . identifier[O_RDWR] ) keyword[try] : keyword[from] identifier[fcntl] keyword[import] identifier[ioctl] , identifier...
def slave_open(tty_name): """slave_open(tty_name) -> slave_fd Open the pty slave and acquire the controlling terminal, returning opened filedescriptor. Deprecated, use openpty() instead.""" result = os.open(tty_name, os.O_RDWR) try: from fcntl import ioctl, I_PUSH # depends on [control=...
def scale_columns(A, v, copy=True): """Scale the sparse columns of a matrix. Parameters ---------- A : sparse matrix Sparse matrix with N rows v : array_like Array of N scales copy : {True,False} - If copy=True, then the matrix is copied to a new and different return ...
def function[scale_columns, parameter[A, v, copy]]: constant[Scale the sparse columns of a matrix. Parameters ---------- A : sparse matrix Sparse matrix with N rows v : array_like Array of N scales copy : {True,False} - If copy=True, then the matrix is copied to a ne...
keyword[def] identifier[scale_columns] ( identifier[A] , identifier[v] , identifier[copy] = keyword[True] ): literal[string] identifier[v] = identifier[np] . identifier[ravel] ( identifier[v] ) identifier[M] , identifier[N] = identifier[A] . identifier[shape] keyword[if] keyword[not] identif...
def scale_columns(A, v, copy=True): """Scale the sparse columns of a matrix. Parameters ---------- A : sparse matrix Sparse matrix with N rows v : array_like Array of N scales copy : {True,False} - If copy=True, then the matrix is copied to a new and different return ...
def score_meaning(text): """ Returns a score in [0,1] range if the text makes any sense in English. """ #all_characters = re.findall('[ -~]', text) # match 32-126 in ASCII table all_characters = re.findall('[a-zA-Z ]', text) # match 32-126 in ASCII table if len(all_characters) == 0: re...
def function[score_meaning, parameter[text]]: constant[ Returns a score in [0,1] range if the text makes any sense in English. ] variable[all_characters] assign[=] call[name[re].findall, parameter[constant[[a-zA-Z ]], name[text]]] if compare[call[name[len], parameter[name[all_characters]...
keyword[def] identifier[score_meaning] ( identifier[text] ): literal[string] identifier[all_characters] = identifier[re] . identifier[findall] ( literal[string] , identifier[text] ) keyword[if] identifier[len] ( identifier[all_characters] )== literal[int] : keyword[return] literal[int]...
def score_meaning(text): """ Returns a score in [0,1] range if the text makes any sense in English. """ #all_characters = re.findall('[ -~]', text) # match 32-126 in ASCII table all_characters = re.findall('[a-zA-Z ]', text) # match 32-126 in ASCII table if len(all_characters) == 0: re...
def start_proc_mask_signal(proc): """ Start process(es) with SIGINT ignored. Args: proc: (mp.Process or list) Note: The signal mask is only applied when called from main thread. """ if not isinstance(proc, list): proc = [proc] with mask_sigint(): for p in p...
def function[start_proc_mask_signal, parameter[proc]]: constant[ Start process(es) with SIGINT ignored. Args: proc: (mp.Process or list) Note: The signal mask is only applied when called from main thread. ] if <ast.UnaryOp object at 0x7da2046203a0> begin[:] ...
keyword[def] identifier[start_proc_mask_signal] ( identifier[proc] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[proc] , identifier[list] ): identifier[proc] =[ identifier[proc] ] keyword[with] identifier[mask_sigint] (): keyword[for] identifier...
def start_proc_mask_signal(proc): """ Start process(es) with SIGINT ignored. Args: proc: (mp.Process or list) Note: The signal mask is only applied when called from main thread. """ if not isinstance(proc, list): proc = [proc] # depends on [control=['if'], data=[]] ...
def download_file(self, url, download_dir, sceneName): """ Downloads large files in pieces """ try: # Log logger.info('\nStarting download..') print('\n Starting download..\n') # Request req = urllib.request.urlopen(url) try: ...
def function[download_file, parameter[self, url, download_dir, sceneName]]: constant[ Downloads large files in pieces ] <ast.Try object at 0x7da1b0210f70> variable[percent] assign[=] <ast.BoolOp object at 0x7da1b01fd060> if compare[name[percent] not_equal[!=] constant[100]] begin[:] ...
keyword[def] identifier[download_file] ( identifier[self] , identifier[url] , identifier[download_dir] , identifier[sceneName] ): literal[string] keyword[try] : identifier[logger] . identifier[info] ( literal[string] ) identifier[print] ( literal[string] ) ...
def download_file(self, url, download_dir, sceneName): """ Downloads large files in pieces """ try: # Log logger.info('\nStarting download..') print('\n Starting download..\n') # Request req = urllib.request.urlopen(url) try: if req.info().get_conten...
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return Frame(key) if key not in Frame._member_map_: extend_enum(Frame, key, default) return Frame[key]
def function[get, parameter[key, default]]: constant[Backport support for original codes.] if call[name[isinstance], parameter[name[key], name[int]]] begin[:] return[call[name[Frame], parameter[name[key]]]] if compare[name[key] <ast.NotIn object at 0x7da2590d7190> name[Frame]._member_map...
keyword[def] identifier[get] ( identifier[key] , identifier[default] =- literal[int] ): literal[string] keyword[if] identifier[isinstance] ( identifier[key] , identifier[int] ): keyword[return] identifier[Frame] ( identifier[key] ) keyword[if] identifier[key] keyword[not] ...
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return Frame(key) # depends on [control=['if'], data=[]] if key not in Frame._member_map_: extend_enum(Frame, key, default) # depends on [control=['if'], data=['key']] return Frame[key]
def heterogzygote_counts(paired): """Provide tumor/normal counts at population heterozyogte sites with CollectAllelicCounts. """ work_dir = utils.safe_makedir(os.path.join(dd.get_work_dir(paired.tumor_data), "structural", "counts")) key = "germline_het_pon" het_bed = tz.get_in(["genome_resources", "...
def function[heterogzygote_counts, parameter[paired]]: constant[Provide tumor/normal counts at population heterozyogte sites with CollectAllelicCounts. ] variable[work_dir] assign[=] call[name[utils].safe_makedir, parameter[call[name[os].path.join, parameter[call[name[dd].get_work_dir, parameter[nam...
keyword[def] identifier[heterogzygote_counts] ( identifier[paired] ): literal[string] identifier[work_dir] = identifier[utils] . identifier[safe_makedir] ( identifier[os] . identifier[path] . identifier[join] ( identifier[dd] . identifier[get_work_dir] ( identifier[paired] . identifier[tumor_data] ), liter...
def heterogzygote_counts(paired): """Provide tumor/normal counts at population heterozyogte sites with CollectAllelicCounts. """ work_dir = utils.safe_makedir(os.path.join(dd.get_work_dir(paired.tumor_data), 'structural', 'counts')) key = 'germline_het_pon' het_bed = tz.get_in(['genome_resources', '...
def encode(self, lname, max_length=4, german=False): """Calculate the PSHP Soundex/Viewex Coding of a last name. Parameters ---------- lname : str The last name to encode max_length : int The length of the code returned (defaults to 4) german : bo...
def function[encode, parameter[self, lname, max_length, german]]: constant[Calculate the PSHP Soundex/Viewex Coding of a last name. Parameters ---------- lname : str The last name to encode max_length : int The length of the code returned (defaults to 4) ...
keyword[def] identifier[encode] ( identifier[self] , identifier[lname] , identifier[max_length] = literal[int] , identifier[german] = keyword[False] ): literal[string] identifier[lname] = identifier[unicode_normalize] ( literal[string] , identifier[text_type] ( identifier[lname] . identifier[upper]...
def encode(self, lname, max_length=4, german=False): """Calculate the PSHP Soundex/Viewex Coding of a last name. Parameters ---------- lname : str The last name to encode max_length : int The length of the code returned (defaults to 4) german : bool ...
def concat(a, b): "Same as a + b, for a and b sequences." if not hasattr(a, '__getitem__'): msg = "'%s' object can't be concatenated" % type(a).__name__ raise TypeError(msg) return a + b
def function[concat, parameter[a, b]]: constant[Same as a + b, for a and b sequences.] if <ast.UnaryOp object at 0x7da18dc98250> begin[:] variable[msg] assign[=] binary_operation[constant['%s' object can't be concatenated] <ast.Mod object at 0x7da2590d6920> call[name[type], parameter[nam...
keyword[def] identifier[concat] ( identifier[a] , identifier[b] ): literal[string] keyword[if] keyword[not] identifier[hasattr] ( identifier[a] , literal[string] ): identifier[msg] = literal[string] % identifier[type] ( identifier[a] ). identifier[__name__] keyword[raise] identifier[T...
def concat(a, b): """Same as a + b, for a and b sequences.""" if not hasattr(a, '__getitem__'): msg = "'%s' object can't be concatenated" % type(a).__name__ raise TypeError(msg) # depends on [control=['if'], data=[]] return a + b
def get_samples_live_last(self, sensor_id): """Get the last sample recorded by the sensor. Args: sensor_id (string): hexadecimal id of the sensor to query, e.g. ``0x0013A20040B65FAD`` Returns: list: dictionary objects containing sample data """ url = "https://api.neur.io/v1/sam...
def function[get_samples_live_last, parameter[self, sensor_id]]: constant[Get the last sample recorded by the sensor. Args: sensor_id (string): hexadecimal id of the sensor to query, e.g. ``0x0013A20040B65FAD`` Returns: list: dictionary objects containing sample data ] ...
keyword[def] identifier[get_samples_live_last] ( identifier[self] , identifier[sensor_id] ): literal[string] identifier[url] = literal[string] identifier[headers] = identifier[self] . identifier[__gen_headers] () identifier[headers] [ literal[string] ]= literal[string] identifier[params]...
def get_samples_live_last(self, sensor_id): """Get the last sample recorded by the sensor. Args: sensor_id (string): hexadecimal id of the sensor to query, e.g. ``0x0013A20040B65FAD`` Returns: list: dictionary objects containing sample data """ url = 'https://api.neur.io/v1/sam...
def _validate_iss(claims, issuer=None): """Validates that the 'iss' claim is valid. The "iss" (issuer) claim identifies the principal that issued the JWT. The processing of this claim is generally application specific. The "iss" value is a case-sensitive string containing a StringOrURI value. Use...
def function[_validate_iss, parameter[claims, issuer]]: constant[Validates that the 'iss' claim is valid. The "iss" (issuer) claim identifies the principal that issued the JWT. The processing of this claim is generally application specific. The "iss" value is a case-sensitive string containing a S...
keyword[def] identifier[_validate_iss] ( identifier[claims] , identifier[issuer] = keyword[None] ): literal[string] keyword[if] identifier[issuer] keyword[is] keyword[not] keyword[None] : keyword[if] identifier[isinstance] ( identifier[issuer] , identifier[string_types] ): ident...
def _validate_iss(claims, issuer=None): """Validates that the 'iss' claim is valid. The "iss" (issuer) claim identifies the principal that issued the JWT. The processing of this claim is generally application specific. The "iss" value is a case-sensitive string containing a StringOrURI value. Use...
def flatten_and_batch_shift_indices(indices: torch.Tensor, sequence_length: int) -> torch.Tensor: """ This is a subroutine for :func:`~batched_index_select`. The given ``indices`` of size ``(batch_size, d_1, ..., d_n)`` indexes into dimension 2 of a target tensor, which h...
def function[flatten_and_batch_shift_indices, parameter[indices, sequence_length]]: constant[ This is a subroutine for :func:`~batched_index_select`. The given ``indices`` of size ``(batch_size, d_1, ..., d_n)`` indexes into dimension 2 of a target tensor, which has size ``(batch_size, sequence_leng...
keyword[def] identifier[flatten_and_batch_shift_indices] ( identifier[indices] : identifier[torch] . identifier[Tensor] , identifier[sequence_length] : identifier[int] )-> identifier[torch] . identifier[Tensor] : literal[string] identifier[offsets] = identifier[get_range_vector] ( identifier[indices]...
def flatten_and_batch_shift_indices(indices: torch.Tensor, sequence_length: int) -> torch.Tensor: """ This is a subroutine for :func:`~batched_index_select`. The given ``indices`` of size ``(batch_size, d_1, ..., d_n)`` indexes into dimension 2 of a target tensor, which has size ``(batch_size, sequence_...
def removedIssuesEstimateSum(self, board_id, sprint_id): """Return the total incompleted points this sprint.""" return self._get_json('rapid/charts/sprintreport?rapidViewId=%s&sprintId=%s' % (board_id, sprint_id), base=self.AGILE_BASE_URL)['contents']['puntedIssuesEstimateS...
def function[removedIssuesEstimateSum, parameter[self, board_id, sprint_id]]: constant[Return the total incompleted points this sprint.] return[call[call[call[call[name[self]._get_json, parameter[binary_operation[constant[rapid/charts/sprintreport?rapidViewId=%s&sprintId=%s] <ast.Mod object at 0x7da2590d692...
keyword[def] identifier[removedIssuesEstimateSum] ( identifier[self] , identifier[board_id] , identifier[sprint_id] ): literal[string] keyword[return] identifier[self] . identifier[_get_json] ( literal[string] %( identifier[board_id] , identifier[sprint_id] ), identifier[base] = identifie...
def removedIssuesEstimateSum(self, board_id, sprint_id): """Return the total incompleted points this sprint.""" return self._get_json('rapid/charts/sprintreport?rapidViewId=%s&sprintId=%s' % (board_id, sprint_id), base=self.AGILE_BASE_URL)['contents']['puntedIssuesEstimateSum']['value']
def min_var_portfolio(cov_mat, allow_short=False): """ Computes the minimum variance portfolio. Note: As the variance is not invariant with respect to leverage, it is not possible to construct non-trivial market neutral minimum variance portfolios. This is because the variance approaches zero w...
def function[min_var_portfolio, parameter[cov_mat, allow_short]]: constant[ Computes the minimum variance portfolio. Note: As the variance is not invariant with respect to leverage, it is not possible to construct non-trivial market neutral minimum variance portfolios. This is because the v...
keyword[def] identifier[min_var_portfolio] ( identifier[cov_mat] , identifier[allow_short] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[cov_mat] , identifier[pd] . identifier[DataFrame] ): keyword[raise] identifier[ValueError] ( literal[string...
def min_var_portfolio(cov_mat, allow_short=False): """ Computes the minimum variance portfolio. Note: As the variance is not invariant with respect to leverage, it is not possible to construct non-trivial market neutral minimum variance portfolios. This is because the variance approaches zero w...
def update_unnamed_class(decls): """ Adds name to class_t declarations. If CastXML is being used, the type definitions with an unnamed class/struct are split across two nodes in the XML tree. For example, typedef struct {} cls; produces <Struct id="_7" name="" context="_1" .../> ...
def function[update_unnamed_class, parameter[decls]]: constant[ Adds name to class_t declarations. If CastXML is being used, the type definitions with an unnamed class/struct are split across two nodes in the XML tree. For example, typedef struct {} cls; produces <Struct id="...
keyword[def] identifier[update_unnamed_class] ( identifier[decls] ): literal[string] keyword[for] identifier[decl] keyword[in] identifier[decls] : keyword[if] identifier[isinstance] ( identifier[decl] , identifier[declarations] . identifier[typedef_t] ): identifier[referent] = id...
def update_unnamed_class(decls): """ Adds name to class_t declarations. If CastXML is being used, the type definitions with an unnamed class/struct are split across two nodes in the XML tree. For example, typedef struct {} cls; produces <Struct id="_7" name="" context="_1" .../> ...
def get_token_details(self, show_listing_details=False, show_inactive=False): """ Function to fetch the available tokens available to trade on the Switcheo exchange. Execution of this function is as follows:: get_token_details() get_token_details(show_listing_details=Tru...
def function[get_token_details, parameter[self, show_listing_details, show_inactive]]: constant[ Function to fetch the available tokens available to trade on the Switcheo exchange. Execution of this function is as follows:: get_token_details() get_token_details(show_list...
keyword[def] identifier[get_token_details] ( identifier[self] , identifier[show_listing_details] = keyword[False] , identifier[show_inactive] = keyword[False] ): literal[string] identifier[api_params] ={ literal[string] : identifier[show_listing_details] , literal[string] : identi...
def get_token_details(self, show_listing_details=False, show_inactive=False): """ Function to fetch the available tokens available to trade on the Switcheo exchange. Execution of this function is as follows:: get_token_details() get_token_details(show_listing_details=True) ...
def as_xyz_string(self): """ Returns a string of the form 'x, y, z', '-x, -y, z', '-y+1/2, x+1/2, z+1/2', etc. Only works for integer rotation matrices """ xyz = ['x', 'y', 'z'] strings = [] # test for invalid rotation matrix if not np.all(np.isclose(self...
def function[as_xyz_string, parameter[self]]: constant[ Returns a string of the form 'x, y, z', '-x, -y, z', '-y+1/2, x+1/2, z+1/2', etc. Only works for integer rotation matrices ] variable[xyz] assign[=] list[[<ast.Constant object at 0x7da207f00d00>, <ast.Constant object at 0x7d...
keyword[def] identifier[as_xyz_string] ( identifier[self] ): literal[string] identifier[xyz] =[ literal[string] , literal[string] , literal[string] ] identifier[strings] =[] keyword[if] keyword[not] identifier[np] . identifier[all] ( identifier[np] . identifier[isclose...
def as_xyz_string(self): """ Returns a string of the form 'x, y, z', '-x, -y, z', '-y+1/2, x+1/2, z+1/2', etc. Only works for integer rotation matrices """ xyz = ['x', 'y', 'z'] strings = [] # test for invalid rotation matrix if not np.all(np.isclose(self.rotation_matrix, np....
def _handleSmsStatusReport(self, notificationLine): """ Handler for SMS status reports """ self.log.debug('SMS status report received') cdsiMatch = self.CDSI_REGEX.match(notificationLine) if cdsiMatch: msgMemory = cdsiMatch.group(1) msgIndex = cdsiMatch.group(2) ...
def function[_handleSmsStatusReport, parameter[self, notificationLine]]: constant[ Handler for SMS status reports ] call[name[self].log.debug, parameter[constant[SMS status report received]]] variable[cdsiMatch] assign[=] call[name[self].CDSI_REGEX.match, parameter[name[notificationLine]]] ...
keyword[def] identifier[_handleSmsStatusReport] ( identifier[self] , identifier[notificationLine] ): literal[string] identifier[self] . identifier[log] . identifier[debug] ( literal[string] ) identifier[cdsiMatch] = identifier[self] . identifier[CDSI_REGEX] . identifier[match] ( identifier...
def _handleSmsStatusReport(self, notificationLine): """ Handler for SMS status reports """ self.log.debug('SMS status report received') cdsiMatch = self.CDSI_REGEX.match(notificationLine) if cdsiMatch: msgMemory = cdsiMatch.group(1) msgIndex = cdsiMatch.group(2) report = self.rea...
def lines_iter(self): ''' Returns contents of the Dockerfile as an array, where each line in the file is an element in the array. :return: list ''' # Convert unicode chars to string byte_to_string = lambda x: x.strip().decode(u'utf-8') if isinstance(x, bytes) else x.strip...
def function[lines_iter, parameter[self]]: constant[ Returns contents of the Dockerfile as an array, where each line in the file is an element in the array. :return: list ] variable[byte_to_string] assign[=] <ast.Lambda object at 0x7da1b16ab070> with call[name[open], para...
keyword[def] identifier[lines_iter] ( identifier[self] ): literal[string] identifier[byte_to_string] = keyword[lambda] identifier[x] : identifier[x] . identifier[strip] (). identifier[decode] ( literal[string] ) keyword[if] identifier[isinstance] ( identifier[x] , identifier[bytes] ) key...
def lines_iter(self): """ Returns contents of the Dockerfile as an array, where each line in the file is an element in the array. :return: list """ # Convert unicode chars to string byte_to_string = lambda x: x.strip().decode(u'utf-8') if isinstance(x, bytes) else x.strip() # Rea...
def cmp_pkgrevno(package, revno, pkgcache=None): """Compare supplied revno with the revno of the installed package. * 1 => Installed revno is greater than supplied arg * 0 => Installed revno is the same as supplied arg * -1 => Installed revno is less than supplied arg This function imports apt_c...
def function[cmp_pkgrevno, parameter[package, revno, pkgcache]]: constant[Compare supplied revno with the revno of the installed package. * 1 => Installed revno is greater than supplied arg * 0 => Installed revno is the same as supplied arg * -1 => Installed revno is less than supplied arg T...
keyword[def] identifier[cmp_pkgrevno] ( identifier[package] , identifier[revno] , identifier[pkgcache] = keyword[None] ): literal[string] keyword[import] identifier[apt_pkg] keyword[if] keyword[not] identifier[pkgcache] : keyword[from] identifier[charmhelpers] . identifier[fetch] keywor...
def cmp_pkgrevno(package, revno, pkgcache=None): """Compare supplied revno with the revno of the installed package. * 1 => Installed revno is greater than supplied arg * 0 => Installed revno is the same as supplied arg * -1 => Installed revno is less than supplied arg This function imports apt_c...
def add_disk(self, path, force_disk_indexes=True, **args): """Adds a disk specified by the path to the ImageParser. :param path: The path to the disk volume :param force_disk_indexes: If true, always uses disk indexes. If False, only uses disk indexes if this is the ...
def function[add_disk, parameter[self, path, force_disk_indexes]]: constant[Adds a disk specified by the path to the ImageParser. :param path: The path to the disk volume :param force_disk_indexes: If true, always uses disk indexes. If False, only uses disk indexes if this is the ...
keyword[def] identifier[add_disk] ( identifier[self] , identifier[path] , identifier[force_disk_indexes] = keyword[True] ,** identifier[args] ): literal[string] keyword[if] identifier[self] . identifier[disks] keyword[and] identifier[self] . identifier[disks] [ literal[int] ]. identifier[index] ...
def add_disk(self, path, force_disk_indexes=True, **args): """Adds a disk specified by the path to the ImageParser. :param path: The path to the disk volume :param force_disk_indexes: If true, always uses disk indexes. If False, only uses disk indexes if this is the ...
def _render_context(self, template, block, **context): """ Render a block to a string with its context """ return u''.join(block(template.new_context(context)))
def function[_render_context, parameter[self, template, block]]: constant[ Render a block to a string with its context ] return[call[constant[].join, parameter[call[name[block], parameter[call[name[template].new_context, parameter[name[context]]]]]]]]
keyword[def] identifier[_render_context] ( identifier[self] , identifier[template] , identifier[block] ,** identifier[context] ): literal[string] keyword[return] literal[string] . identifier[join] ( identifier[block] ( identifier[template] . identifier[new_context] ( identifier[context] )))
def _render_context(self, template, block, **context): """ Render a block to a string with its context """ return u''.join(block(template.new_context(context)))
def fail_to(future): """A decorator for function callbacks to catch uncaught non-async exceptions and forward them to the given future. The primary use for this is to catch exceptions in async callbacks and propagate them to futures. For example, consider, .. code-block:: python answer = ...
def function[fail_to, parameter[future]]: constant[A decorator for function callbacks to catch uncaught non-async exceptions and forward them to the given future. The primary use for this is to catch exceptions in async callbacks and propagate them to futures. For example, consider, .. code-bl...
keyword[def] identifier[fail_to] ( identifier[future] ): literal[string] keyword[assert] identifier[is_future] ( identifier[future] ), literal[string] keyword[def] identifier[decorator] ( identifier[f] ): @ identifier[wraps] ( identifier[f] ) keyword[def] identifier[new_f] (* id...
def fail_to(future): """A decorator for function callbacks to catch uncaught non-async exceptions and forward them to the given future. The primary use for this is to catch exceptions in async callbacks and propagate them to futures. For example, consider, .. code-block:: python answer = ...
def dict_to_instance(self, content): """ transforms the content to a new instace of object self.schema['title'] :param content: valid response :returns new instance of current class """ klass = self.schema['title'] cls = get_model_class(klass, api=self.__a...
def function[dict_to_instance, parameter[self, content]]: constant[ transforms the content to a new instace of object self.schema['title'] :param content: valid response :returns new instance of current class ] variable[klass] assign[=] call[name[self].schema][con...
keyword[def] identifier[dict_to_instance] ( identifier[self] , identifier[content] ): literal[string] identifier[klass] = identifier[self] . identifier[schema] [ literal[string] ] identifier[cls] = identifier[get_model_class] ( identifier[klass] , identifier[api] = identifier[self] . ident...
def dict_to_instance(self, content): """ transforms the content to a new instace of object self.schema['title'] :param content: valid response :returns new instance of current class """ klass = self.schema['title'] cls = get_model_class(klass, api=self.__api__) # ...
def _readfloat(self, length, start): """Read bits and interpret as a float.""" if not (start + self._offset) % 8: startbyte = (start + self._offset) // 8 if length == 32: f, = struct.unpack('>f', bytes(self._datastore.getbyteslice(startbyte, startbyte + 4))) ...
def function[_readfloat, parameter[self, length, start]]: constant[Read bits and interpret as a float.] if <ast.UnaryOp object at 0x7da1b101ac20> begin[:] variable[startbyte] assign[=] binary_operation[binary_operation[name[start] + name[self]._offset] <ast.FloorDiv object at 0x7da2590d6...
keyword[def] identifier[_readfloat] ( identifier[self] , identifier[length] , identifier[start] ): literal[string] keyword[if] keyword[not] ( identifier[start] + identifier[self] . identifier[_offset] )% literal[int] : identifier[startbyte] =( identifier[start] + identifier[self] . id...
def _readfloat(self, length, start): """Read bits and interpret as a float.""" if not (start + self._offset) % 8: startbyte = (start + self._offset) // 8 if length == 32: (f,) = struct.unpack('>f', bytes(self._datastore.getbyteslice(startbyte, startbyte + 4))) # depends on [control=...
def solve(self, x0, params=(), internal_x0=None, solver=None, conditional_maxiter=20, initial_conditions=None, **kwargs): """ Solve the problem (systems of equations) Parameters ---------- x0 : array Guess. params : array See :meth:`NeqSys.s...
def function[solve, parameter[self, x0, params, internal_x0, solver, conditional_maxiter, initial_conditions]]: constant[ Solve the problem (systems of equations) Parameters ---------- x0 : array Guess. params : array See :meth:`NeqSys.solve`. int...
keyword[def] identifier[solve] ( identifier[self] , identifier[x0] , identifier[params] =(), identifier[internal_x0] = keyword[None] , identifier[solver] = keyword[None] , identifier[conditional_maxiter] = literal[int] , identifier[initial_conditions] = keyword[None] ,** identifier[kwargs] ): literal[string...
def solve(self, x0, params=(), internal_x0=None, solver=None, conditional_maxiter=20, initial_conditions=None, **kwargs): """ Solve the problem (systems of equations) Parameters ---------- x0 : array Guess. params : array See :meth:`NeqSys.solve`. int...
def _delly_count_evidence_filter(in_file, data): """Filter delly outputs based on read support (DV) and evidence (split and paired). We require DV > 4 and either both paired end and split read evidence or 5 or more evidence for either individually. """ filtname = "DVSupport" filtdoc = "FMT/DV <...
def function[_delly_count_evidence_filter, parameter[in_file, data]]: constant[Filter delly outputs based on read support (DV) and evidence (split and paired). We require DV > 4 and either both paired end and split read evidence or 5 or more evidence for either individually. ] variable[filt...
keyword[def] identifier[_delly_count_evidence_filter] ( identifier[in_file] , identifier[data] ): literal[string] identifier[filtname] = literal[string] identifier[filtdoc] = literal[string] identifier[out_file] = literal[string] % identifier[utils] . identifier[splitext_plus] ( identifier[in_f...
def _delly_count_evidence_filter(in_file, data): """Filter delly outputs based on read support (DV) and evidence (split and paired). We require DV > 4 and either both paired end and split read evidence or 5 or more evidence for either individually. """ filtname = 'DVSupport' filtdoc = 'FMT/DV <...
def ip_frag(packet): ''' Not fragments: ip_frag(packet) == 0 not ip_frag(packet) First packet of fragments: ip_frag(packet) == IP_FRAG_ANY Not first packet of fragments: ip_frag(packet) & IP_FRAG_LATER All fragments: ip_frag(packet) & IP_FRA...
def function[ip_frag, parameter[packet]]: constant[ Not fragments: ip_frag(packet) == 0 not ip_frag(packet) First packet of fragments: ip_frag(packet) == IP_FRAG_ANY Not first packet of fragments: ip_frag(packet) & IP_FRAG_LATER All fragments: ...
keyword[def] identifier[ip_frag] ( identifier[packet] ): literal[string] keyword[return] (( identifier[packet] . identifier[frag_off] & identifier[IP_OFFMASK] ) keyword[and] identifier[IP_FRAG_LATER] )|(( identifier[packet] . identifier[frag_off] &( identifier[IP_OFFMASK] | identifier[IP_MF] )) keyword[an...
def ip_frag(packet): """ Not fragments: ip_frag(packet) == 0 not ip_frag(packet) First packet of fragments: ip_frag(packet) == IP_FRAG_ANY Not first packet of fragments: ip_frag(packet) & IP_FRAG_LATER All fragments: ip_frag(packet) & IP_FRA...
def send(self, event): """Insert the event in to the Mongo collection""" try: self.collection.insert(event, manipulate=False) except (PyMongoError, BSONError): # The event will be lost in case of a connection error or any error # that occurs when trying to ins...
def function[send, parameter[self, event]]: constant[Insert the event in to the Mongo collection] <ast.Try object at 0x7da207f01db0>
keyword[def] identifier[send] ( identifier[self] , identifier[event] ): literal[string] keyword[try] : identifier[self] . identifier[collection] . identifier[insert] ( identifier[event] , identifier[manipulate] = keyword[False] ) keyword[except] ( identifier[PyMongoError] , id...
def send(self, event): """Insert the event in to the Mongo collection""" try: self.collection.insert(event, manipulate=False) # depends on [control=['try'], data=[]] except (PyMongoError, BSONError): # The event will be lost in case of a connection error or any error # that occurs w...
def set_option(self, key, value): """Sets a option for this session. For a detailed list of available options see the librtmp(3) man page. :param key: str, A valid option key. :param value: A value, anything that can be converted to str is valid. Raises :exc:`ValueError` if a ...
def function[set_option, parameter[self, key, value]]: constant[Sets a option for this session. For a detailed list of available options see the librtmp(3) man page. :param key: str, A valid option key. :param value: A value, anything that can be converted to str is valid. Rai...
keyword[def] identifier[set_option] ( identifier[self] , identifier[key] , identifier[value] ): literal[string] identifier[akey] = identifier[AVal] ( identifier[key] ) identifier[aval] = identifier[AVal] ( identifier[value] ) identifier[res] = identifier[librtmp] . identifier[RT...
def set_option(self, key, value): """Sets a option for this session. For a detailed list of available options see the librtmp(3) man page. :param key: str, A valid option key. :param value: A value, anything that can be converted to str is valid. Raises :exc:`ValueError` if a inva...
def pause(self): """Pause tracing, but be prepared to `resume`.""" for tracer in self.tracers: tracer.stop() stats = tracer.get_stats() if stats: print("\nCoverage.py tracer stats:") for k in sorted(stats.keys()): pr...
def function[pause, parameter[self]]: constant[Pause tracing, but be prepared to `resume`.] for taget[name[tracer]] in starred[name[self].tracers] begin[:] call[name[tracer].stop, parameter[]] variable[stats] assign[=] call[name[tracer].get_stats, parameter[]] ...
keyword[def] identifier[pause] ( identifier[self] ): literal[string] keyword[for] identifier[tracer] keyword[in] identifier[self] . identifier[tracers] : identifier[tracer] . identifier[stop] () identifier[stats] = identifier[tracer] . identifier[get_stats] () ...
def pause(self): """Pause tracing, but be prepared to `resume`.""" for tracer in self.tracers: tracer.stop() stats = tracer.get_stats() if stats: print('\nCoverage.py tracer stats:') for k in sorted(stats.keys()): print('%16s: %s' % (k, stats[k])) ...
def validate_generations(self): ''' Make sure that the descendent depth is valid. ''' nodes = self.arc_root_node.get_descendants() for node in nodes: logger.debug("Checking parent for node of type %s" % node.arc_element_type) parent = ArcElementNode.object...
def function[validate_generations, parameter[self]]: constant[ Make sure that the descendent depth is valid. ] variable[nodes] assign[=] call[name[self].arc_root_node.get_descendants, parameter[]] for taget[name[node]] in starred[name[nodes]] begin[:] call[name[lo...
keyword[def] identifier[validate_generations] ( identifier[self] ): literal[string] identifier[nodes] = identifier[self] . identifier[arc_root_node] . identifier[get_descendants] () keyword[for] identifier[node] keyword[in] identifier[nodes] : identifier[logger] . identifie...
def validate_generations(self): """ Make sure that the descendent depth is valid. """ nodes = self.arc_root_node.get_descendants() for node in nodes: logger.debug('Checking parent for node of type %s' % node.arc_element_type) parent = ArcElementNode.objects.get(pk=node.pk).ge...
def stats_add_duration(self, key, duration): """Add a duration to the per-message measurements .. versionadded:: 3.19.0 .. note:: If this method is called when there is not a message being processed, a message will be logged at the ``warning`` level to indicate the valu...
def function[stats_add_duration, parameter[self, key, duration]]: constant[Add a duration to the per-message measurements .. versionadded:: 3.19.0 .. note:: If this method is called when there is not a message being processed, a message will be logged at the ``warning`` level to ...
keyword[def] identifier[stats_add_duration] ( identifier[self] , identifier[key] , identifier[duration] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_measurement] : keyword[if] keyword[not] identifier[self] . identifier[IGNORE_OOB_STATS] : ...
def stats_add_duration(self, key, duration): """Add a duration to the per-message measurements .. versionadded:: 3.19.0 .. note:: If this method is called when there is not a message being processed, a message will be logged at the ``warning`` level to indicate the value is...
def _initSymbols(ptc): """ Initialize symbols and single character constants. """ # build am and pm lists to contain # original case, lowercase, first-char and dotted # versions of the meridian text ptc.am = ['', ''] ptc.pm = ['', ''] for idx, xm in enumerate(ptc.locale.meridian[:2])...
def function[_initSymbols, parameter[ptc]]: constant[ Initialize symbols and single character constants. ] name[ptc].am assign[=] list[[<ast.Constant object at 0x7da18dc04ac0>, <ast.Constant object at 0x7da18dc06320>]] name[ptc].pm assign[=] list[[<ast.Constant object at 0x7da18dc06bf0>,...
keyword[def] identifier[_initSymbols] ( identifier[ptc] ): literal[string] identifier[ptc] . identifier[am] =[ literal[string] , literal[string] ] identifier[ptc] . identifier[pm] =[ literal[string] , literal[string] ] keyword[for] identifier[idx] , identifier[xm] keyword[in] id...
def _initSymbols(ptc): """ Initialize symbols and single character constants. """ # build am and pm lists to contain # original case, lowercase, first-char and dotted # versions of the meridian text ptc.am = ['', ''] ptc.pm = ['', ''] for (idx, xm) in enumerate(ptc.locale.meridian[:2...
def request_token(): """ 通过帐号,密码请求token,返回一个dict { "user_info": { "ck": "-VQY", "play_record": { "fav_chls_count": 4, "liked": 802, "banned": 162, "played": 28368 }, "is_new_user": 0, "uid": "taizilongxu", "t...
def function[request_token, parameter[]]: constant[ 通过帐号,密码请求token,返回一个dict { "user_info": { "ck": "-VQY", "play_record": { "fav_chls_count": 4, "liked": 802, "banned": 162, "played": 28368 }, "is_new_user": 0, "...
keyword[def] identifier[request_token] (): literal[string] keyword[while] keyword[True] : identifier[email] , identifier[password] , identifier[captcha_solution] , identifier[captcha_id] = identifier[win_login] () identifier[options] ={ literal[string] : literal[string] , ...
def request_token(): """ 通过帐号,密码请求token,返回一个dict { "user_info": { "ck": "-VQY", "play_record": { "fav_chls_count": 4, "liked": 802, "banned": 162, "played": 28368 }, "is_new_user": 0, "uid": "taizilongxu", "t...
def start_tpot(automated_run, session, path): """Starts a TPOT automated run that exports directly to base learner setup Args: automated_run (xcessiv.models.AutomatedRun): Automated run object session: Valid SQLAlchemy session path (str, unicode): Path to project folder """ mo...
def function[start_tpot, parameter[automated_run, session, path]]: constant[Starts a TPOT automated run that exports directly to base learner setup Args: automated_run (xcessiv.models.AutomatedRun): Automated run object session: Valid SQLAlchemy session path (str, unicode): Path t...
keyword[def] identifier[start_tpot] ( identifier[automated_run] , identifier[session] , identifier[path] ): literal[string] identifier[module] = identifier[functions] . identifier[import_string_code_as_module] ( identifier[automated_run] . identifier[source] ) identifier[extraction] = identifier[sessi...
def start_tpot(automated_run, session, path): """Starts a TPOT automated run that exports directly to base learner setup Args: automated_run (xcessiv.models.AutomatedRun): Automated run object session: Valid SQLAlchemy session path (str, unicode): Path to project folder """ mo...
def tryDynLocal(name): ''' Dynamically import a module and return a module local or raise an exception. ''' if name.find('.') == -1: raise s_exc.NoSuchDyn(name=name) modname, objname = name.rsplit('.', 1) mod = tryDynMod(modname) item = getattr(mod, objname, s_common.novalu) if ...
def function[tryDynLocal, parameter[name]]: constant[ Dynamically import a module and return a module local or raise an exception. ] if compare[call[name[name].find, parameter[constant[.]]] equal[==] <ast.UnaryOp object at 0x7da20c76cd90>] begin[:] <ast.Raise object at 0x7da20c76c190> ...
keyword[def] identifier[tryDynLocal] ( identifier[name] ): literal[string] keyword[if] identifier[name] . identifier[find] ( literal[string] )==- literal[int] : keyword[raise] identifier[s_exc] . identifier[NoSuchDyn] ( identifier[name] = identifier[name] ) identifier[modname] , identifier...
def tryDynLocal(name): """ Dynamically import a module and return a module local or raise an exception. """ if name.find('.') == -1: raise s_exc.NoSuchDyn(name=name) # depends on [control=['if'], data=[]] (modname, objname) = name.rsplit('.', 1) mod = tryDynMod(modname) item = getat...
def load_module(self, path, squash=True): """Load values from a Python module. Example modue ``config.py``:: DEBUG = True SQLITE = { "db": ":memory:" } >>> c = ConfigDict() >>> c.load_module('config') ...
def function[load_module, parameter[self, path, squash]]: constant[Load values from a Python module. Example modue ``config.py``:: DEBUG = True SQLITE = { "db": ":memory:" } >>> c = ConfigDict() >>> c.load_m...
keyword[def] identifier[load_module] ( identifier[self] , identifier[path] , identifier[squash] = keyword[True] ): literal[string] identifier[config_obj] = identifier[load] ( identifier[path] ) identifier[obj] ={ identifier[key] : identifier[getattr] ( identifier[config_obj] , identifier[k...
def load_module(self, path, squash=True): """Load values from a Python module. Example modue ``config.py``:: DEBUG = True SQLITE = { "db": ":memory:" } >>> c = ConfigDict() >>> c.load_module('config') ...
def hash_name(name, script_pubkey, register_addr=None): """ Generate the hash over a name and hex-string script pubkey """ bin_name = b40_to_bin(name) name_and_pubkey = bin_name + unhexlify(script_pubkey) if register_addr is not None: name_and_pubkey += str(register_addr) return hex_has...
def function[hash_name, parameter[name, script_pubkey, register_addr]]: constant[ Generate the hash over a name and hex-string script pubkey ] variable[bin_name] assign[=] call[name[b40_to_bin], parameter[name[name]]] variable[name_and_pubkey] assign[=] binary_operation[name[bin_name] + ca...
keyword[def] identifier[hash_name] ( identifier[name] , identifier[script_pubkey] , identifier[register_addr] = keyword[None] ): literal[string] identifier[bin_name] = identifier[b40_to_bin] ( identifier[name] ) identifier[name_and_pubkey] = identifier[bin_name] + identifier[unhexlify] ( identifier[scrip...
def hash_name(name, script_pubkey, register_addr=None): """ Generate the hash over a name and hex-string script pubkey """ bin_name = b40_to_bin(name) name_and_pubkey = bin_name + unhexlify(script_pubkey) if register_addr is not None: name_and_pubkey += str(register_addr) # depends on [co...
def ungroup(grouped_items, groupxs, maxval=None, fill=None): """ Ungroups items Args: grouped_items (list): groupxs (list): maxval (int): (default = None) Returns: list: ungrouped_items SeeAlso: vt.invert_apply_grouping CommandLine: python -m u...
def function[ungroup, parameter[grouped_items, groupxs, maxval, fill]]: constant[ Ungroups items Args: grouped_items (list): groupxs (list): maxval (int): (default = None) Returns: list: ungrouped_items SeeAlso: vt.invert_apply_grouping CommandLine...
keyword[def] identifier[ungroup] ( identifier[grouped_items] , identifier[groupxs] , identifier[maxval] = keyword[None] , identifier[fill] = keyword[None] ): literal[string] keyword[if] identifier[maxval] keyword[is] keyword[None] : identifier[maxpergroup] =[ identifier[max] ( identifier[x...
def ungroup(grouped_items, groupxs, maxval=None, fill=None): """ Ungroups items Args: grouped_items (list): groupxs (list): maxval (int): (default = None) Returns: list: ungrouped_items SeeAlso: vt.invert_apply_grouping CommandLine: python -m u...
def indexOf(self, action): """ Returns the index of the inputed action. :param action | <QAction> || None :return <int> """ for i, act in enumerate(self.actionGroup().actions()): if action in (act, act.objectName(), act.text...
def function[indexOf, parameter[self, action]]: constant[ Returns the index of the inputed action. :param action | <QAction> || None :return <int> ] for taget[tuple[[<ast.Name object at 0x7da18f09dea0>, <ast.Name object at 0x7da18f09c310>]]] in ...
keyword[def] identifier[indexOf] ( identifier[self] , identifier[action] ): literal[string] keyword[for] identifier[i] , identifier[act] keyword[in] identifier[enumerate] ( identifier[self] . identifier[actionGroup] (). identifier[actions] ()): keyword[if] identifier[action] ke...
def indexOf(self, action): """ Returns the index of the inputed action. :param action | <QAction> || None :return <int> """ for (i, act) in enumerate(self.actionGroup().actions()): if action in (act, act.objectName(), act.text()): re...
def main(): """ NAME change_case_magic.py DESCRIPTION picks out key and converts to upper or lower case SYNTAX change_case_magic.py [command line options] OPTIONS -h prints help message and quits -f FILE: specify input magic format file -F FILE: s...
def function[main, parameter[]]: constant[ NAME change_case_magic.py DESCRIPTION picks out key and converts to upper or lower case SYNTAX change_case_magic.py [command line options] OPTIONS -h prints help message and quits -f FILE: specify input magic ...
keyword[def] identifier[main] (): literal[string] identifier[dir_path] = literal[string] identifier[change] = literal[string] keyword[if] literal[string] keyword[in] identifier[sys] . identifier[argv] : identifier[ind] = identifier[sys] . identifier[argv] . identifier[index] ( liter...
def main(): """ NAME change_case_magic.py DESCRIPTION picks out key and converts to upper or lower case SYNTAX change_case_magic.py [command line options] OPTIONS -h prints help message and quits -f FILE: specify input magic format file -F FILE: s...
def create(self, check, notification_plan, criteria=None, disabled=False, label=None, name=None, metadata=None): """ Creates an alarm that binds the check on the given entity with a notification plan. Note that the 'criteria' parameter, if supplied, should be a string ...
def function[create, parameter[self, check, notification_plan, criteria, disabled, label, name, metadata]]: constant[ Creates an alarm that binds the check on the given entity with a notification plan. Note that the 'criteria' parameter, if supplied, should be a string represent...
keyword[def] identifier[create] ( identifier[self] , identifier[check] , identifier[notification_plan] , identifier[criteria] = keyword[None] , identifier[disabled] = keyword[False] , identifier[label] = keyword[None] , identifier[name] = keyword[None] , identifier[metadata] = keyword[None] ): literal[strin...
def create(self, check, notification_plan, criteria=None, disabled=False, label=None, name=None, metadata=None): """ Creates an alarm that binds the check on the given entity with a notification plan. Note that the 'criteria' parameter, if supplied, should be a string representing t...
def get_partition_names(self, db_name, tbl_name, max_parts): """ Parameters: - db_name - tbl_name - max_parts """ self.send_get_partition_names(db_name, tbl_name, max_parts) return self.recv_get_partition_names()
def function[get_partition_names, parameter[self, db_name, tbl_name, max_parts]]: constant[ Parameters: - db_name - tbl_name - max_parts ] call[name[self].send_get_partition_names, parameter[name[db_name], name[tbl_name], name[max_parts]]] return[call[name[self].recv_get_parti...
keyword[def] identifier[get_partition_names] ( identifier[self] , identifier[db_name] , identifier[tbl_name] , identifier[max_parts] ): literal[string] identifier[self] . identifier[send_get_partition_names] ( identifier[db_name] , identifier[tbl_name] , identifier[max_parts] ) keyword[return] identi...
def get_partition_names(self, db_name, tbl_name, max_parts): """ Parameters: - db_name - tbl_name - max_parts """ self.send_get_partition_names(db_name, tbl_name, max_parts) return self.recv_get_partition_names()
def confusion_matrix_and_correct_series(self, y_info): ''' Generate confusion matrix from y_info ''' a = deepcopy(y_info['true']) true_count = dict((i, a.count(i)) for i in set(a)) a = deepcopy(y_info['pred']) pred_count = dict((i, a.count(i)) for i in set(a)) sorted_cats = sorte...
def function[confusion_matrix_and_correct_series, parameter[self, y_info]]: constant[ Generate confusion matrix from y_info ] variable[a] assign[=] call[name[deepcopy], parameter[call[name[y_info]][constant[true]]]] variable[true_count] assign[=] call[name[dict], parameter[<ast.GeneratorExp obje...
keyword[def] identifier[confusion_matrix_and_correct_series] ( identifier[self] , identifier[y_info] ): literal[string] identifier[a] = identifier[deepcopy] ( identifier[y_info] [ literal[string] ]) identifier[true_count] = identifier[dict] (( identifier[i] , identifier[a] . identifier[count] ...
def confusion_matrix_and_correct_series(self, y_info): """ Generate confusion matrix from y_info """ a = deepcopy(y_info['true']) true_count = dict(((i, a.count(i)) for i in set(a))) a = deepcopy(y_info['pred']) pred_count = dict(((i, a.count(i)) for i in set(a))) sorted_cats = sorted(list(set(y...
def parse_yaml(self, y): '''Parse a YAML specification of a target execution context into this object. ''' super(TargetExecutionContext, self).parse_yaml(y) if 'id' in y: self.id = y['id'] else: self.id = '' return self
def function[parse_yaml, parameter[self, y]]: constant[Parse a YAML specification of a target execution context into this object. ] call[call[name[super], parameter[name[TargetExecutionContext], name[self]]].parse_yaml, parameter[name[y]]] if compare[constant[id] in name[y]] beg...
keyword[def] identifier[parse_yaml] ( identifier[self] , identifier[y] ): literal[string] identifier[super] ( identifier[TargetExecutionContext] , identifier[self] ). identifier[parse_yaml] ( identifier[y] ) keyword[if] literal[string] keyword[in] identifier[y] : identifier...
def parse_yaml(self, y): """Parse a YAML specification of a target execution context into this object. """ super(TargetExecutionContext, self).parse_yaml(y) if 'id' in y: self.id = y['id'] # depends on [control=['if'], data=['y']] else: self.id = '' return self
def _list_tenants(self, admin): """ Returns either a list of all tenants (admin=True), or the tenant for the currently-authenticated user (admin=False). """ resp, resp_body = self.method_get("tenants", admin=admin) if 200 <= resp.status_code < 300: tenants = r...
def function[_list_tenants, parameter[self, admin]]: constant[ Returns either a list of all tenants (admin=True), or the tenant for the currently-authenticated user (admin=False). ] <ast.Tuple object at 0x7da2054a74f0> assign[=] call[name[self].method_get, parameter[constant[tena...
keyword[def] identifier[_list_tenants] ( identifier[self] , identifier[admin] ): literal[string] identifier[resp] , identifier[resp_body] = identifier[self] . identifier[method_get] ( literal[string] , identifier[admin] = identifier[admin] ) keyword[if] literal[int] <= identifier[resp] . ...
def _list_tenants(self, admin): """ Returns either a list of all tenants (admin=True), or the tenant for the currently-authenticated user (admin=False). """ (resp, resp_body) = self.method_get('tenants', admin=admin) if 200 <= resp.status_code < 300: tenants = resp_body.get('...
def Debugger_setVariableValue(self, scopeNumber, variableName, newValue, callFrameId): """ Function path: Debugger.setVariableValue Domain: Debugger Method name: setVariableValue Parameters: Required arguments: 'scopeNumber' (type: integer) -> 0-based number of scope as was listed in scope...
def function[Debugger_setVariableValue, parameter[self, scopeNumber, variableName, newValue, callFrameId]]: constant[ Function path: Debugger.setVariableValue Domain: Debugger Method name: setVariableValue Parameters: Required arguments: 'scopeNumber' (type: integer) -> 0-based number of ...
keyword[def] identifier[Debugger_setVariableValue] ( identifier[self] , identifier[scopeNumber] , identifier[variableName] , identifier[newValue] , identifier[callFrameId] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[scopeNumber] ,( identifier[int] ,) ), literal[string] % identifi...
def Debugger_setVariableValue(self, scopeNumber, variableName, newValue, callFrameId): """ Function path: Debugger.setVariableValue Domain: Debugger Method name: setVariableValue Parameters: Required arguments: 'scopeNumber' (type: integer) -> 0-based number of scope as was listed in scope ch...
def check_base_required_attributes(self, dataset): ''' Check the global required and highly recommended attributes for 1.1 templates. These go an extra step besides just checking that they exist. :param netCDF4.Dataset dataset: An open netCDF dataset :Conventions = "CF-1.6" ; ...
def function[check_base_required_attributes, parameter[self, dataset]]: constant[ Check the global required and highly recommended attributes for 1.1 templates. These go an extra step besides just checking that they exist. :param netCDF4.Dataset dataset: An open netCDF dataset ...
keyword[def] identifier[check_base_required_attributes] ( identifier[self] , identifier[dataset] ): literal[string] identifier[test_ctx] = identifier[TestCtx] ( identifier[BaseCheck] . identifier[HIGH] , literal[string] ) identifier[conventions] = identifier[getattr] ( identifier[dataset]...
def check_base_required_attributes(self, dataset): """ Check the global required and highly recommended attributes for 1.1 templates. These go an extra step besides just checking that they exist. :param netCDF4.Dataset dataset: An open netCDF dataset :Conventions = "CF-1.6" ; //.....
def canonical_extension(fmt_ext): """ Canonical extension of file format extension Converts the format extension fmt_ext into the canonical extension for that format. For example, ``canonical_extension('tif') == 'tiff'``. Here we agree that the canonical extension for format F is F.value ...
def function[canonical_extension, parameter[fmt_ext]]: constant[ Canonical extension of file format extension Converts the format extension fmt_ext into the canonical extension for that format. For example, ``canonical_extension('tif') == 'tiff'``. Here we agree that the canonical extension for...
keyword[def] identifier[canonical_extension] ( identifier[fmt_ext] ): literal[string] keyword[if] identifier[MimeType] . identifier[has_value] ( identifier[fmt_ext] ): keyword[return] identifier[fmt_ext] keyword[try] : keyword[return] { literal[str...
def canonical_extension(fmt_ext): """ Canonical extension of file format extension Converts the format extension fmt_ext into the canonical extension for that format. For example, ``canonical_extension('tif') == 'tiff'``. Here we agree that the canonical extension for format F is F.value :...
def _get_tls_object(self, ssl_params): """ Return a TLS object to establish a secure connection to a server """ if ssl_params is None: return None if not ssl_params["verify"] and ssl_params["ca_certs"]: self.warning( "Incorrect configurati...
def function[_get_tls_object, parameter[self, ssl_params]]: constant[ Return a TLS object to establish a secure connection to a server ] if compare[name[ssl_params] is constant[None]] begin[:] return[constant[None]] if <ast.BoolOp object at 0x7da18f00de40> begin[:] ...
keyword[def] identifier[_get_tls_object] ( identifier[self] , identifier[ssl_params] ): literal[string] keyword[if] identifier[ssl_params] keyword[is] keyword[None] : keyword[return] keyword[None] keyword[if] keyword[not] identifier[ssl_params] [ literal[string] ] keyw...
def _get_tls_object(self, ssl_params): """ Return a TLS object to establish a secure connection to a server """ if ssl_params is None: return None # depends on [control=['if'], data=[]] if not ssl_params['verify'] and ssl_params['ca_certs']: self.warning('Incorrect configura...
def basename_without_extension(self): """ Get the ``os.path.basename`` of the local file, if any, with extension removed. """ ret = self.basename.rsplit('.', 1)[0] if ret.endswith('.tar'): ret = ret[0:len(ret)-4] return ret
def function[basename_without_extension, parameter[self]]: constant[ Get the ``os.path.basename`` of the local file, if any, with extension removed. ] variable[ret] assign[=] call[call[name[self].basename.rsplit, parameter[constant[.], constant[1]]]][constant[0]] if call[name[ret...
keyword[def] identifier[basename_without_extension] ( identifier[self] ): literal[string] identifier[ret] = identifier[self] . identifier[basename] . identifier[rsplit] ( literal[string] , literal[int] )[ literal[int] ] keyword[if] identifier[ret] . identifier[endswith] ( literal[string] ...
def basename_without_extension(self): """ Get the ``os.path.basename`` of the local file, if any, with extension removed. """ ret = self.basename.rsplit('.', 1)[0] if ret.endswith('.tar'): ret = ret[0:len(ret) - 4] # depends on [control=['if'], data=[]] return ret
def write_data_to_file(data, filepath): ''' Write data to file ''' try: os.makedirs(os.path.dirname(filepath), 0o700) except OSError: pass write_to_disk(filepath, content=data)
def function[write_data_to_file, parameter[data, filepath]]: constant[ Write data to file ] <ast.Try object at 0x7da18dc99b10> call[name[write_to_disk], parameter[name[filepath]]]
keyword[def] identifier[write_data_to_file] ( identifier[data] , identifier[filepath] ): literal[string] keyword[try] : identifier[os] . identifier[makedirs] ( identifier[os] . identifier[path] . identifier[dirname] ( identifier[filepath] ), literal[int] ) keyword[except] identifier[OSError]...
def write_data_to_file(data, filepath): """ Write data to file """ try: os.makedirs(os.path.dirname(filepath), 448) # depends on [control=['try'], data=[]] except OSError: pass # depends on [control=['except'], data=[]] write_to_disk(filepath, content=data)
def add_digital_object( self, information_object_slug, identifier=None, title=None, uri=None, location_of_originals=None, object_type=None, xlink_show="embed", xlink_actuate="onLoad", restricted=False, use_statement="", use_...
def function[add_digital_object, parameter[self, information_object_slug, identifier, title, uri, location_of_originals, object_type, xlink_show, xlink_actuate, restricted, use_statement, use_conditions, access_conditions, size, format_name, format_version, format_registry_key, format_registry_name, file_uuid, aip_uuid...
keyword[def] identifier[add_digital_object] ( identifier[self] , identifier[information_object_slug] , identifier[identifier] = keyword[None] , identifier[title] = keyword[None] , identifier[uri] = keyword[None] , identifier[location_of_originals] = keyword[None] , identifier[object_type] = keyword[None] , id...
def add_digital_object(self, information_object_slug, identifier=None, title=None, uri=None, location_of_originals=None, object_type=None, xlink_show='embed', xlink_actuate='onLoad', restricted=False, use_statement='', use_conditions=None, access_conditions=None, size=None, format_name=None, format_version=None, format...
def get_text_tokenizer(query_string): """ Tokenize the input string and return two lists, exclude list is for words that start with a dash (ex: -word) and include list is for all other words """ # Regex to split on double-quotes, single-quotes, and continuous non-whitespace characters. split_pat...
def function[get_text_tokenizer, parameter[query_string]]: constant[ Tokenize the input string and return two lists, exclude list is for words that start with a dash (ex: -word) and include list is for all other words ] variable[split_pattern] assign[=] call[name[re].compile, parameter[const...
keyword[def] identifier[get_text_tokenizer] ( identifier[query_string] ): literal[string] identifier[split_pattern] = identifier[re] . identifier[compile] ( literal[string] ) identifier[space_cleanup_pattern] = identifier[re] . identifier[compile] ( literal[string] ) identifier[dash_cl...
def get_text_tokenizer(query_string): """ Tokenize the input string and return two lists, exclude list is for words that start with a dash (ex: -word) and include list is for all other words """ # Regex to split on double-quotes, single-quotes, and continuous non-whitespace characters. split_pat...
def animation_card(card: AnimationCard) -> Attachment: """ Returns an attachment for an animation card. Will raise a TypeError if the 'card' argument is not an AnimationCard. :param card: :return: """ if not isinstance(card, AnimationCard): raise TypeE...
def function[animation_card, parameter[card]]: constant[ Returns an attachment for an animation card. Will raise a TypeError if the 'card' argument is not an AnimationCard. :param card: :return: ] if <ast.UnaryOp object at 0x7da20c6e7cd0> begin[:] <ast.Rai...
keyword[def] identifier[animation_card] ( identifier[card] : identifier[AnimationCard] )-> identifier[Attachment] : literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[card] , identifier[AnimationCard] ): keyword[raise] identifier[TypeError] ( literal[string...
def animation_card(card: AnimationCard) -> Attachment: """ Returns an attachment for an animation card. Will raise a TypeError if the 'card' argument is not an AnimationCard. :param card: :return: """ if not isinstance(card, AnimationCard): raise TypeError('CardFa...
def units(self, value): """ Set the units for every model in the scene without converting any units just setting the tag. Parameters ------------ value : str Value to set every geometry unit value to """ for m in self.geometry.values(): ...
def function[units, parameter[self, value]]: constant[ Set the units for every model in the scene without converting any units just setting the tag. Parameters ------------ value : str Value to set every geometry unit value to ] for taget[name[m...
keyword[def] identifier[units] ( identifier[self] , identifier[value] ): literal[string] keyword[for] identifier[m] keyword[in] identifier[self] . identifier[geometry] . identifier[values] (): identifier[m] . identifier[units] = identifier[value]
def units(self, value): """ Set the units for every model in the scene without converting any units just setting the tag. Parameters ------------ value : str Value to set every geometry unit value to """ for m in self.geometry.values(): m.units ...
def watch_logfile(self, logfile_path): """Analyzes queries from the tail of a given log file""" self._run_stats['logSource'] = logfile_path log_parser = LogParser() # For each new line in the logfile ... output_time = time.time() + WATCH_DISPLAY_REFRESH_SECONDS try: ...
def function[watch_logfile, parameter[self, logfile_path]]: constant[Analyzes queries from the tail of a given log file] call[name[self]._run_stats][constant[logSource]] assign[=] name[logfile_path] variable[log_parser] assign[=] call[name[LogParser], parameter[]] variable[output_time] a...
keyword[def] identifier[watch_logfile] ( identifier[self] , identifier[logfile_path] ): literal[string] identifier[self] . identifier[_run_stats] [ literal[string] ]= identifier[logfile_path] identifier[log_parser] = identifier[LogParser] () identifier[output_time] = id...
def watch_logfile(self, logfile_path): """Analyzes queries from the tail of a given log file""" self._run_stats['logSource'] = logfile_path log_parser = LogParser() # For each new line in the logfile ... output_time = time.time() + WATCH_DISPLAY_REFRESH_SECONDS try: firstLine = True ...
def IntGreaterThanOne(n): """If *n* is an integer > 1, returns it, otherwise an error.""" try: n = int(n) except: raise ValueError("%s is not an integer" % n) if n <= 1: raise ValueError("%d is not > 1" % n) else: return n
def function[IntGreaterThanOne, parameter[n]]: constant[If *n* is an integer > 1, returns it, otherwise an error.] <ast.Try object at 0x7da2054a7a90> if compare[name[n] less_or_equal[<=] constant[1]] begin[:] <ast.Raise object at 0x7da1b2347e80>
keyword[def] identifier[IntGreaterThanOne] ( identifier[n] ): literal[string] keyword[try] : identifier[n] = identifier[int] ( identifier[n] ) keyword[except] : keyword[raise] identifier[ValueError] ( literal[string] % identifier[n] ) keyword[if] identifier[n] <= literal[int] ...
def IntGreaterThanOne(n): """If *n* is an integer > 1, returns it, otherwise an error.""" try: n = int(n) # depends on [control=['try'], data=[]] except: raise ValueError('%s is not an integer' % n) # depends on [control=['except'], data=[]] if n <= 1: raise ValueError('%d is n...
def retrieveVals(self): """Retrieve values for graphs.""" name = 'diskspace' if self.hasGraph(name): for fspath in self._fslist: if self._statsSpace.has_key(fspath): self.setGraphVal(name, fspath, self._statsSp...
def function[retrieveVals, parameter[self]]: constant[Retrieve values for graphs.] variable[name] assign[=] constant[diskspace] if call[name[self].hasGraph, parameter[name[name]]] begin[:] for taget[name[fspath]] in starred[name[self]._fslist] begin[:] if ...
keyword[def] identifier[retrieveVals] ( identifier[self] ): literal[string] identifier[name] = literal[string] keyword[if] identifier[self] . identifier[hasGraph] ( identifier[name] ): keyword[for] identifier[fspath] keyword[in] identifier[self] . identifier[_fslist] : ...
def retrieveVals(self): """Retrieve values for graphs.""" name = 'diskspace' if self.hasGraph(name): for fspath in self._fslist: if self._statsSpace.has_key(fspath): self.setGraphVal(name, fspath, self._statsSpace[fspath]['inuse_pcent']) # depends on [control=['if'], dat...
def _walk_omniglot_dir(directory): """Walk an Omniglot directory and yield examples.""" directory = os.path.join(directory, tf.io.gfile.listdir(directory)[0]) alphabets = sorted(tf.io.gfile.listdir(directory)) for alphabet in alphabets: alphabet_dir = os.path.join(directory, alphabet) characters = sorte...
def function[_walk_omniglot_dir, parameter[directory]]: constant[Walk an Omniglot directory and yield examples.] variable[directory] assign[=] call[name[os].path.join, parameter[name[directory], call[call[name[tf].io.gfile.listdir, parameter[name[directory]]]][constant[0]]]] variable[alphabets] ...
keyword[def] identifier[_walk_omniglot_dir] ( identifier[directory] ): literal[string] identifier[directory] = identifier[os] . identifier[path] . identifier[join] ( identifier[directory] , identifier[tf] . identifier[io] . identifier[gfile] . identifier[listdir] ( identifier[directory] )[ literal[int] ]) i...
def _walk_omniglot_dir(directory): """Walk an Omniglot directory and yield examples.""" directory = os.path.join(directory, tf.io.gfile.listdir(directory)[0]) alphabets = sorted(tf.io.gfile.listdir(directory)) for alphabet in alphabets: alphabet_dir = os.path.join(directory, alphabet) ch...
def feasible_ratio(self, solutions): """counts for each coordinate the number of feasible values in ``solutions`` and returns an array of length ``len(solutions[0])`` with the ratios. `solutions` is a list or array of repaired ``Solution`` instances, """ raise N...
def function[feasible_ratio, parameter[self, solutions]]: constant[counts for each coordinate the number of feasible values in ``solutions`` and returns an array of length ``len(solutions[0])`` with the ratios. `solutions` is a list or array of repaired ``Solution`` instances, ...
keyword[def] identifier[feasible_ratio] ( identifier[self] , identifier[solutions] ): literal[string] keyword[raise] identifier[NotImplementedError] ( literal[string] ) identifier[count] = identifier[np] . identifier[zeros] ( identifier[len] ( identifier[solutions] [ literal[int] ])) ...
def feasible_ratio(self, solutions): """counts for each coordinate the number of feasible values in ``solutions`` and returns an array of length ``len(solutions[0])`` with the ratios. `solutions` is a list or array of repaired ``Solution`` instances, """ raise NotImplem...
def write(text, filename, encoding='utf-8', mode='wb'): """ Write 'text' to file ('filename') assuming 'encoding' in an atomic way Return (eventually new) encoding """ text, encoding = encode(text, encoding) if 'a' in mode: with open(filename, mode) as textfile: textf...
def function[write, parameter[text, filename, encoding, mode]]: constant[ Write 'text' to file ('filename') assuming 'encoding' in an atomic way Return (eventually new) encoding ] <ast.Tuple object at 0x7da1b21d6230> assign[=] call[name[encode], parameter[name[text], name[encoding]]] ...
keyword[def] identifier[write] ( identifier[text] , identifier[filename] , identifier[encoding] = literal[string] , identifier[mode] = literal[string] ): literal[string] identifier[text] , identifier[encoding] = identifier[encode] ( identifier[text] , identifier[encoding] ) keyword[if] literal[str...
def write(text, filename, encoding='utf-8', mode='wb'): """ Write 'text' to file ('filename') assuming 'encoding' in an atomic way Return (eventually new) encoding """ (text, encoding) = encode(text, encoding) if 'a' in mode: with open(filename, mode) as textfile: textfile.wr...
def _merge_groups(self, backends_list): """ merge a list backends_groups""" ret = {} for backends in backends_list: for b in backends: if b not in ret: ret[b] = set([]) for group in backends[b]: ret[b].add(group)...
def function[_merge_groups, parameter[self, backends_list]]: constant[ merge a list backends_groups] variable[ret] assign[=] dictionary[[], []] for taget[name[backends]] in starred[name[backends_list]] begin[:] for taget[name[b]] in starred[name[backends]] begin[:] ...
keyword[def] identifier[_merge_groups] ( identifier[self] , identifier[backends_list] ): literal[string] identifier[ret] ={} keyword[for] identifier[backends] keyword[in] identifier[backends_list] : keyword[for] identifier[b] keyword[in] identifier[backends] : ...
def _merge_groups(self, backends_list): """ merge a list backends_groups""" ret = {} for backends in backends_list: for b in backends: if b not in ret: ret[b] = set([]) # depends on [control=['if'], data=['b', 'ret']] for group in backends[b]: ...
def get_port_by_ref(self, port_ref): '''Get a port of this component by reference to a CORBA PortService object. ''' with self._mutex: for p in self.ports: if p.object._is_equivalent(port_ref): return p return None
def function[get_port_by_ref, parameter[self, port_ref]]: constant[Get a port of this component by reference to a CORBA PortService object. ] with name[self]._mutex begin[:] for taget[name[p]] in starred[name[self].ports] begin[:] if call[name[p]....
keyword[def] identifier[get_port_by_ref] ( identifier[self] , identifier[port_ref] ): literal[string] keyword[with] identifier[self] . identifier[_mutex] : keyword[for] identifier[p] keyword[in] identifier[self] . identifier[ports] : keyword[if] identifier[p] . id...
def get_port_by_ref(self, port_ref): """Get a port of this component by reference to a CORBA PortService object. """ with self._mutex: for p in self.ports: if p.object._is_equivalent(port_ref): return p # depends on [control=['if'], data=[]] # depends on [c...
def deep_run(self): """Derive period-based features.""" # Lomb-Scargle period finding. self.get_period_LS(self.date, self.mag, self.n_threads, self.min_period) # Features based on a phase-folded light curve # such as Eta, slope-percentile, etc. # Should be called after t...
def function[deep_run, parameter[self]]: constant[Derive period-based features.] call[name[self].get_period_LS, parameter[name[self].date, name[self].mag, name[self].n_threads, name[self].min_period]] variable[phase_folded_date] assign[=] binary_operation[name[self].date <ast.Mod object at 0x7da...
keyword[def] identifier[deep_run] ( identifier[self] ): literal[string] identifier[self] . identifier[get_period_LS] ( identifier[self] . identifier[date] , identifier[self] . identifier[mag] , identifier[self] . identifier[n_threads] , identifier[self] . identifier[min_period] ) ...
def deep_run(self): """Derive period-based features.""" # Lomb-Scargle period finding. self.get_period_LS(self.date, self.mag, self.n_threads, self.min_period) # Features based on a phase-folded light curve # such as Eta, slope-percentile, etc. # Should be called after the getPeriodLS() is calle...
def put_task_info(self, task_name, key, value): """ Put information into a task. :param task_name: name of the task :param key: key of the information item :param value: value of the information item """ params = OrderedDict([('info', ''), ('taskname', task_name)...
def function[put_task_info, parameter[self, task_name, key, value]]: constant[ Put information into a task. :param task_name: name of the task :param key: key of the information item :param value: value of the information item ] variable[params] assign[=] call[na...
keyword[def] identifier[put_task_info] ( identifier[self] , identifier[task_name] , identifier[key] , identifier[value] ): literal[string] identifier[params] = identifier[OrderedDict] ([( literal[string] , literal[string] ),( literal[string] , identifier[task_name] )]) identifier[headers] ...
def put_task_info(self, task_name, key, value): """ Put information into a task. :param task_name: name of the task :param key: key of the information item :param value: value of the information item """ params = OrderedDict([('info', ''), ('taskname', task_name)]) h...
def __find_source_files(self): """ Searches recursively for all source files in a directory. """ for dir_path, _, files in os.walk(self._source_directory): for name in files: if name.lower().endswith(self._source_file_extension): basename =...
def function[__find_source_files, parameter[self]]: constant[ Searches recursively for all source files in a directory. ] for taget[tuple[[<ast.Name object at 0x7da18f00efb0>, <ast.Name object at 0x7da18f00e500>, <ast.Name object at 0x7da18f00ca90>]]] in starred[call[name[os].walk, param...
keyword[def] identifier[__find_source_files] ( identifier[self] ): literal[string] keyword[for] identifier[dir_path] , identifier[_] , identifier[files] keyword[in] identifier[os] . identifier[walk] ( identifier[self] . identifier[_source_directory] ): keyword[for] identifier[name]...
def __find_source_files(self): """ Searches recursively for all source files in a directory. """ for (dir_path, _, files) in os.walk(self._source_directory): for name in files: if name.lower().endswith(self._source_file_extension): basename = os.path.splitext(...