code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def compilearg(self): """This method compiles the parameter into syntax that can be used on the shell, such as -paramflag=value""" if isinstance(self.value,list): value = self.delimiter.join(self.value) else: value = self.value if value.find(" ") >= 0: ...
def function[compilearg, parameter[self]]: constant[This method compiles the parameter into syntax that can be used on the shell, such as -paramflag=value] if call[name[isinstance], parameter[name[self].value, name[list]]] begin[:] variable[value] assign[=] call[name[self].delimiter.join...
keyword[def] identifier[compilearg] ( identifier[self] ): literal[string] keyword[if] identifier[isinstance] ( identifier[self] . identifier[value] , identifier[list] ): identifier[value] = identifier[self] . identifier[delimiter] . identifier[join] ( identifier[self] . identifier[val...
def compilearg(self): """This method compiles the parameter into syntax that can be used on the shell, such as -paramflag=value""" if isinstance(self.value, list): value = self.delimiter.join(self.value) # depends on [control=['if'], data=[]] else: value = self.value if value.find(' ') ...
def AddAnalogShortIdMsecRecordNoStatus(site_service, tag, time_value, msec, value): """ This function will add an analog value to the specified eDNA service and tag, without an associated point status. :param site_service: The site.service where data will be pushe...
def function[AddAnalogShortIdMsecRecordNoStatus, parameter[site_service, tag, time_value, msec, value]]: constant[ This function will add an analog value to the specified eDNA service and tag, without an associated point status. :param site_service: The site.service where data will be pushed :p...
keyword[def] identifier[AddAnalogShortIdMsecRecordNoStatus] ( identifier[site_service] , identifier[tag] , identifier[time_value] , identifier[msec] , identifier[value] ): literal[string] identifier[szService] = identifier[c_char_p] ( identifier[site_service] . identifier[encode] ( literal[string] ))...
def AddAnalogShortIdMsecRecordNoStatus(site_service, tag, time_value, msec, value): """ This function will add an analog value to the specified eDNA service and tag, without an associated point status. :param site_service: The site.service where data will be pushed :param tag: The eDNA tag to push ...
def __convert(root, tag, values, func): """Converts the tag type found in the root and converts them using the func and appends them to the values. """ elements = root.getElementsByTagName(tag) for element in elements: converted = func(element) # Append to the list __append...
def function[__convert, parameter[root, tag, values, func]]: constant[Converts the tag type found in the root and converts them using the func and appends them to the values. ] variable[elements] assign[=] call[name[root].getElementsByTagName, parameter[name[tag]]] for taget[name[element...
keyword[def] identifier[__convert] ( identifier[root] , identifier[tag] , identifier[values] , identifier[func] ): literal[string] identifier[elements] = identifier[root] . identifier[getElementsByTagName] ( identifier[tag] ) keyword[for] identifier[element] keyword[in] identifier[elements] : ...
def __convert(root, tag, values, func): """Converts the tag type found in the root and converts them using the func and appends them to the values. """ elements = root.getElementsByTagName(tag) for element in elements: converted = func(element) # Append to the list __append_l...
def print_issue(self, service_name, limit, crits, warns): """ :param service_name: the name of the service :type service_name: str :param limit: the Limit this relates to :type limit: :py:class:`~.AwsLimit` :param crits: the specific usage values that crossed the critical...
def function[print_issue, parameter[self, service_name, limit, crits, warns]]: constant[ :param service_name: the name of the service :type service_name: str :param limit: the Limit this relates to :type limit: :py:class:`~.AwsLimit` :param crits: the specific usage value...
keyword[def] identifier[print_issue] ( identifier[self] , identifier[service_name] , identifier[limit] , identifier[crits] , identifier[warns] ): literal[string] identifier[usage_str] = literal[string] keyword[if] identifier[len] ( identifier[crits] )> literal[int] : identif...
def print_issue(self, service_name, limit, crits, warns): """ :param service_name: the name of the service :type service_name: str :param limit: the Limit this relates to :type limit: :py:class:`~.AwsLimit` :param crits: the specific usage values that crossed the critical ...
def watermark_image(image, wtrmrk_path, corner=2): '''Adds a watermark image to an instance of a PIL Image. If the provided watermark image (wtrmrk_path) is larger than the provided base image (image), then the watermark image will be automatically resized to roughly 1/8 the size of the base image...
def function[watermark_image, parameter[image, wtrmrk_path, corner]]: constant[Adds a watermark image to an instance of a PIL Image. If the provided watermark image (wtrmrk_path) is larger than the provided base image (image), then the watermark image will be automatically resized to roughly 1...
keyword[def] identifier[watermark_image] ( identifier[image] , identifier[wtrmrk_path] , identifier[corner] = literal[int] ): literal[string] identifier[padding] = literal[int] identifier[wtrmrk_img] = identifier[Image] . identifier[open] ( identifier[wtrmrk_path] ) keyword[if] ...
def watermark_image(image, wtrmrk_path, corner=2): """Adds a watermark image to an instance of a PIL Image. If the provided watermark image (wtrmrk_path) is larger than the provided base image (image), then the watermark image will be automatically resized to roughly 1/8 the size of the base image...
def clear(self, actors=()): """Delete specified list of actors, by default delete all.""" if not utils.isSequence(actors): actors = [actors] if len(actors): for a in actors: self.removeActor(a) else: for a in settings.collectable_actors...
def function[clear, parameter[self, actors]]: constant[Delete specified list of actors, by default delete all.] if <ast.UnaryOp object at 0x7da1b2345a50> begin[:] variable[actors] assign[=] list[[<ast.Name object at 0x7da1b2345240>]] if call[name[len], parameter[name[actors]]] be...
keyword[def] identifier[clear] ( identifier[self] , identifier[actors] =()): literal[string] keyword[if] keyword[not] identifier[utils] . identifier[isSequence] ( identifier[actors] ): identifier[actors] =[ identifier[actors] ] keyword[if] identifier[len] ( identifier[actor...
def clear(self, actors=()): """Delete specified list of actors, by default delete all.""" if not utils.isSequence(actors): actors = [actors] # depends on [control=['if'], data=[]] if len(actors): for a in actors: self.removeActor(a) # depends on [control=['for'], data=['a']] #...
def activate_absence_with_duration(self, duration: int): """ activates the absence mode for a given time Args: duration(int): the absence duration in minutes """ data = {"duration": duration} return self._restCall( "home/heating/activateAbsenceWit...
def function[activate_absence_with_duration, parameter[self, duration]]: constant[ activates the absence mode for a given time Args: duration(int): the absence duration in minutes ] variable[data] assign[=] dictionary[[<ast.Constant object at 0x7da204565240>], [<ast.Name obj...
keyword[def] identifier[activate_absence_with_duration] ( identifier[self] , identifier[duration] : identifier[int] ): literal[string] identifier[data] ={ literal[string] : identifier[duration] } keyword[return] identifier[self] . identifier[_restCall] ( literal[string] , ide...
def activate_absence_with_duration(self, duration: int): """ activates the absence mode for a given time Args: duration(int): the absence duration in minutes """ data = {'duration': duration} return self._restCall('home/heating/activateAbsenceWithDuration', json.dumps(data))
def shift_left(self, times=1): """ Finds Location shifted left by 1 :rtype: Location """ try: return Location(self._rank, self._file - times) except IndexError as e: raise IndexError(e)
def function[shift_left, parameter[self, times]]: constant[ Finds Location shifted left by 1 :rtype: Location ] <ast.Try object at 0x7da18fe905e0>
keyword[def] identifier[shift_left] ( identifier[self] , identifier[times] = literal[int] ): literal[string] keyword[try] : keyword[return] identifier[Location] ( identifier[self] . identifier[_rank] , identifier[self] . identifier[_file] - identifier[times] ) keyword[except]...
def shift_left(self, times=1): """ Finds Location shifted left by 1 :rtype: Location """ try: return Location(self._rank, self._file - times) # depends on [control=['try'], data=[]] except IndexError as e: raise IndexError(e) # depends on [control=['except'], data=...
def _suffixArrayWithTrace(s, SA, n, K, operations, totalOperations): """ This function is a rewrite in Python of the C implementation proposed in Kärkkäinen and Sanders paper. Find the suffix array SA of s[0..n-1] in {1..K}^n Require s[n]=s[n+1]=s[n+2]=0, n>=2 """ if _trace: _traceSuffi...
def function[_suffixArrayWithTrace, parameter[s, SA, n, K, operations, totalOperations]]: constant[ This function is a rewrite in Python of the C implementation proposed in Kärkkäinen and Sanders paper. Find the suffix array SA of s[0..n-1] in {1..K}^n Require s[n]=s[n+1]=s[n+2]=0, n>=2 ] ...
keyword[def] identifier[_suffixArrayWithTrace] ( identifier[s] , identifier[SA] , identifier[n] , identifier[K] , identifier[operations] , identifier[totalOperations] ): literal[string] keyword[if] identifier[_trace] : identifier[_traceSuffixArray] ( identifier[operations] , identifier[totalOpera...
def _suffixArrayWithTrace(s, SA, n, K, operations, totalOperations): """ This function is a rewrite in Python of the C implementation proposed in Kärkkäinen and Sanders paper. Find the suffix array SA of s[0..n-1] in {1..K}^n Require s[n]=s[n+1]=s[n+2]=0, n>=2 """ if _trace: _traceSuffi...
def get_folder(self, title): """ Retrieve a folder by its title Usage: C{engine.get_folder(title)} Note that if more than one folder has the same title, only the first match will be returned. """ for folder in self.configManager.allFolders: ...
def function[get_folder, parameter[self, title]]: constant[ Retrieve a folder by its title Usage: C{engine.get_folder(title)} Note that if more than one folder has the same title, only the first match will be returned. ] for taget[name[folder]] i...
keyword[def] identifier[get_folder] ( identifier[self] , identifier[title] ): literal[string] keyword[for] identifier[folder] keyword[in] identifier[self] . identifier[configManager] . identifier[allFolders] : keyword[if] identifier[folder] . identifier[title] == identifier[title] ...
def get_folder(self, title): """ Retrieve a folder by its title Usage: C{engine.get_folder(title)} Note that if more than one folder has the same title, only the first match will be returned. """ for folder in self.configManager.allFolders: if fo...
def read_actions(): """Yields actions for pressed keys.""" while True: key = get_key() # Handle arrows, j/k (qwerty), and n/e (colemak) if key in (const.KEY_UP, const.KEY_CTRL_N, 'k', 'e'): yield const.ACTION_PREVIOUS elif key in (const.KEY_DOWN, const.KEY_CTRL_P, 'j...
def function[read_actions, parameter[]]: constant[Yields actions for pressed keys.] while constant[True] begin[:] variable[key] assign[=] call[name[get_key], parameter[]] if compare[name[key] in tuple[[<ast.Attribute object at 0x7da1b1dd9e10>, <ast.Attribute object at 0x7...
keyword[def] identifier[read_actions] (): literal[string] keyword[while] keyword[True] : identifier[key] = identifier[get_key] () keyword[if] identifier[key] keyword[in] ( identifier[const] . identifier[KEY_UP] , identifier[const] . identifier[KEY_CTRL_N] , literal[string] , ...
def read_actions(): """Yields actions for pressed keys.""" while True: key = get_key() # Handle arrows, j/k (qwerty), and n/e (colemak) if key in (const.KEY_UP, const.KEY_CTRL_N, 'k', 'e'): yield const.ACTION_PREVIOUS # depends on [control=['if'], data=[]] elif key i...
def write_to(self, group, append=False): """Writes the properties to a `group`, or append it""" data = self.data if append is True: try: # concatenate original and new properties in a single list original = read_properties(group) data =...
def function[write_to, parameter[self, group, append]]: constant[Writes the properties to a `group`, or append it] variable[data] assign[=] name[self].data if compare[name[append] is constant[True]] begin[:] <ast.Try object at 0x7da1b0e9c790> variable[data] assign[=] call[call[na...
keyword[def] identifier[write_to] ( identifier[self] , identifier[group] , identifier[append] = keyword[False] ): literal[string] identifier[data] = identifier[self] . identifier[data] keyword[if] identifier[append] keyword[is] keyword[True] : keyword[try] : ...
def write_to(self, group, append=False): """Writes the properties to a `group`, or append it""" data = self.data if append is True: try: # concatenate original and new properties in a single list original = read_properties(group) data = original + data # depends ...
def _send_str(self, cmd, args): """ Format: {Command}{args length(little endian)}{str} Length: {4}{4}{str length} """ logger.debug("{} {}".format(cmd, args)) args = args.encode('utf-8') le_args_len = self._little_endian(len(args)) ...
def function[_send_str, parameter[self, cmd, args]]: constant[ Format: {Command}{args length(little endian)}{str} Length: {4}{4}{str length} ] call[name[logger].debug, parameter[call[constant[{} {}].format, parameter[name[cmd], name[args]]]]] varia...
keyword[def] identifier[_send_str] ( identifier[self] , identifier[cmd] , identifier[args] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] . identifier[format] ( identifier[cmd] , identifier[args] )) identifier[args] = identifier[args] . identifier[encode] ( lit...
def _send_str(self, cmd, args): """ Format: {Command}{args length(little endian)}{str} Length: {4}{4}{str length} """ logger.debug('{} {}'.format(cmd, args)) args = args.encode('utf-8') le_args_len = self._little_endian(len(args)) data = cmd.encode() +...
def daemonize(self, log_into, after_app_loading=False): """Daemonize uWSGI. :param str|unicode log_into: Logging destination: * File: /tmp/mylog.log * UPD: 192.168.1.2:1717 .. note:: This will require an UDP server to manage log messages. U...
def function[daemonize, parameter[self, log_into, after_app_loading]]: constant[Daemonize uWSGI. :param str|unicode log_into: Logging destination: * File: /tmp/mylog.log * UPD: 192.168.1.2:1717 .. note:: This will require an UDP server to manage log messages. ...
keyword[def] identifier[daemonize] ( identifier[self] , identifier[log_into] , identifier[after_app_loading] = keyword[False] ): literal[string] identifier[self] . identifier[_set] ( literal[string] keyword[if] identifier[after_app_loading] keyword[else] literal[string] , identifier[log_into] )...
def daemonize(self, log_into, after_app_loading=False): """Daemonize uWSGI. :param str|unicode log_into: Logging destination: * File: /tmp/mylog.log * UPD: 192.168.1.2:1717 .. note:: This will require an UDP server to manage log messages. Use `...
def delete(self, filename): """Remove the metadata from the given filename.""" self._failed_atoms.clear() self.clear() self.save(filename, padding=lambda x: 0)
def function[delete, parameter[self, filename]]: constant[Remove the metadata from the given filename.] call[name[self]._failed_atoms.clear, parameter[]] call[name[self].clear, parameter[]] call[name[self].save, parameter[name[filename]]]
keyword[def] identifier[delete] ( identifier[self] , identifier[filename] ): literal[string] identifier[self] . identifier[_failed_atoms] . identifier[clear] () identifier[self] . identifier[clear] () identifier[self] . identifier[save] ( identifier[filename] , identifier[padding...
def delete(self, filename): """Remove the metadata from the given filename.""" self._failed_atoms.clear() self.clear() self.save(filename, padding=lambda x: 0)
def writable_path(path): """Test whether a path can be written to. """ if os.path.exists(path): return os.access(path, os.W_OK) try: with open(path, 'w'): pass except (OSError, IOError): return False else: os.remove(path) return True
def function[writable_path, parameter[path]]: constant[Test whether a path can be written to. ] if call[name[os].path.exists, parameter[name[path]]] begin[:] return[call[name[os].access, parameter[name[path], name[os].W_OK]]] <ast.Try object at 0x7da1b021f400>
keyword[def] identifier[writable_path] ( identifier[path] ): literal[string] keyword[if] identifier[os] . identifier[path] . identifier[exists] ( identifier[path] ): keyword[return] identifier[os] . identifier[access] ( identifier[path] , identifier[os] . identifier[W_OK] ) keyword[try] : ...
def writable_path(path): """Test whether a path can be written to. """ if os.path.exists(path): return os.access(path, os.W_OK) # depends on [control=['if'], data=[]] try: with open(path, 'w'): pass # depends on [control=['with'], data=[]] # depends on [control=['try'], da...
def get_qualification_score(self, qualification_type_id, worker_id): """TODO: Document.""" params = {'QualificationTypeId' : qualification_type_id, 'SubjectId' : worker_id} return self._process_request('GetQualificationScore', params, [('Qualification', Qual...
def function[get_qualification_score, parameter[self, qualification_type_id, worker_id]]: constant[TODO: Document.] variable[params] assign[=] dictionary[[<ast.Constant object at 0x7da1b265a380>, <ast.Constant object at 0x7da1b2659cc0>], [<ast.Name object at 0x7da1b265a920>, <ast.Name object at 0x7da1b2...
keyword[def] identifier[get_qualification_score] ( identifier[self] , identifier[qualification_type_id] , identifier[worker_id] ): literal[string] identifier[params] ={ literal[string] : identifier[qualification_type_id] , literal[string] : identifier[worker_id] } keyword[return] ...
def get_qualification_score(self, qualification_type_id, worker_id): """TODO: Document.""" params = {'QualificationTypeId': qualification_type_id, 'SubjectId': worker_id} return self._process_request('GetQualificationScore', params, [('Qualification', Qualification)])
def get_data(self, doi_id, idx): """ Resolve DOI and compile all attributes into one dictionary :param str doi_id: :param int idx: Publication index :return dict: Updated publication dictionary """ tmp_dict = self.root_dict['pub'][0].copy() try: ...
def function[get_data, parameter[self, doi_id, idx]]: constant[ Resolve DOI and compile all attributes into one dictionary :param str doi_id: :param int idx: Publication index :return dict: Updated publication dictionary ] variable[tmp_dict] assign[=] call[call[ca...
keyword[def] identifier[get_data] ( identifier[self] , identifier[doi_id] , identifier[idx] ): literal[string] identifier[tmp_dict] = identifier[self] . identifier[root_dict] [ literal[string] ][ literal[int] ]. identifier[copy] () keyword[try] : identifier[url] = li...
def get_data(self, doi_id, idx): """ Resolve DOI and compile all attributes into one dictionary :param str doi_id: :param int idx: Publication index :return dict: Updated publication dictionary """ tmp_dict = self.root_dict['pub'][0].copy() try: # Send request...
def _colorize(self, depth_im, color_im): """Colorize a depth image from the PhoXi using a color image from the webcam. Parameters ---------- depth_im : DepthImage The PhoXi depth image. color_im : ColorImage Corresponding color image. Returns ...
def function[_colorize, parameter[self, depth_im, color_im]]: constant[Colorize a depth image from the PhoXi using a color image from the webcam. Parameters ---------- depth_im : DepthImage The PhoXi depth image. color_im : ColorImage Corresponding color ...
keyword[def] identifier[_colorize] ( identifier[self] , identifier[depth_im] , identifier[color_im] ): literal[string] identifier[target_shape] =( identifier[depth_im] . identifier[data] . identifier[shape] [ literal[int] ], identifier[depth_im] . identifier[data] . identifier[shape] [ lit...
def _colorize(self, depth_im, color_im): """Colorize a depth image from the PhoXi using a color image from the webcam. Parameters ---------- depth_im : DepthImage The PhoXi depth image. color_im : ColorImage Corresponding color image. Returns ...
def _extend_resources_paths(): """ Extend resources paths. """ for path in (os.path.join(umbra.__path__[0], Constants.resources_directory), os.path.join(os.getcwd(), umbra.__name__, Constants.resources_directory)): path = os.path.normpath(path) if foundations.common.pat...
def function[_extend_resources_paths, parameter[]]: constant[ Extend resources paths. ] for taget[name[path]] in starred[tuple[[<ast.Call object at 0x7da1b09b89a0>, <ast.Call object at 0x7da1b09b9930>]]] begin[:] variable[path] assign[=] call[name[os].path.normpath, parameter[nam...
keyword[def] identifier[_extend_resources_paths] (): literal[string] keyword[for] identifier[path] keyword[in] ( identifier[os] . identifier[path] . identifier[join] ( identifier[umbra] . identifier[__path__] [ literal[int] ], identifier[Constants] . identifier[resources_directory] ), identifier[os...
def _extend_resources_paths(): """ Extend resources paths. """ for path in (os.path.join(umbra.__path__[0], Constants.resources_directory), os.path.join(os.getcwd(), umbra.__name__, Constants.resources_directory)): path = os.path.normpath(path) if foundations.common.path_exists(path): ...
def as_uni_field(field): """ Renders a form field like a django-uni-form field:: {% load uni_form_tags %} {{ form.field|as_uni_field }} """ template = get_template('uni_form/field.html') c = Context({'field':field}) return template.render(c)
def function[as_uni_field, parameter[field]]: constant[ Renders a form field like a django-uni-form field:: {% load uni_form_tags %} {{ form.field|as_uni_field }} ] variable[template] assign[=] call[name[get_template], parameter[constant[uni_form/field.html]]] variable[c...
keyword[def] identifier[as_uni_field] ( identifier[field] ): literal[string] identifier[template] = identifier[get_template] ( literal[string] ) identifier[c] = identifier[Context] ({ literal[string] : identifier[field] }) keyword[return] identifier[template] . identifier[render] ( identifier[c]...
def as_uni_field(field): """ Renders a form field like a django-uni-form field:: {% load uni_form_tags %} {{ form.field|as_uni_field }} """ template = get_template('uni_form/field.html') c = Context({'field': field}) return template.render(c)
def install(self, **kwargs): """ Installs the app in the current user's account. """ if self._dxid is not None: return dxpy.api.app_install(self._dxid, **kwargs) else: return dxpy.api.app_install('app-' + self._name, alias=self._alias, **kwargs)
def function[install, parameter[self]]: constant[ Installs the app in the current user's account. ] if compare[name[self]._dxid is_not constant[None]] begin[:] return[call[name[dxpy].api.app_install, parameter[name[self]._dxid]]]
keyword[def] identifier[install] ( identifier[self] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[self] . identifier[_dxid] keyword[is] keyword[not] keyword[None] : keyword[return] identifier[dxpy] . identifier[api] . identifier[app_install] ( identifier[self] ....
def install(self, **kwargs): """ Installs the app in the current user's account. """ if self._dxid is not None: return dxpy.api.app_install(self._dxid, **kwargs) # depends on [control=['if'], data=[]] else: return dxpy.api.app_install('app-' + self._name, alias=self._alias, ...
def global_set(self, key, value): """Set ``key`` to ``value`` globally (not at any particular branch or revision) """ (key, value) = map(self.pack, (key, value)) try: return self.sql('global_insert', key, value) except IntegrityError: return self....
def function[global_set, parameter[self, key, value]]: constant[Set ``key`` to ``value`` globally (not at any particular branch or revision) ] <ast.Tuple object at 0x7da207f022c0> assign[=] call[name[map], parameter[name[self].pack, tuple[[<ast.Name object at 0x7da207f030a0>, <ast.Name ...
keyword[def] identifier[global_set] ( identifier[self] , identifier[key] , identifier[value] ): literal[string] ( identifier[key] , identifier[value] )= identifier[map] ( identifier[self] . identifier[pack] ,( identifier[key] , identifier[value] )) keyword[try] : keyword[return...
def global_set(self, key, value): """Set ``key`` to ``value`` globally (not at any particular branch or revision) """ (key, value) = map(self.pack, (key, value)) try: return self.sql('global_insert', key, value) # depends on [control=['try'], data=[]] except IntegrityError: ...
def subscribe(self, topic, channel): """Subscribe to a nsq `topic` and `channel`.""" self.send(nsq.subscribe(topic, channel))
def function[subscribe, parameter[self, topic, channel]]: constant[Subscribe to a nsq `topic` and `channel`.] call[name[self].send, parameter[call[name[nsq].subscribe, parameter[name[topic], name[channel]]]]]
keyword[def] identifier[subscribe] ( identifier[self] , identifier[topic] , identifier[channel] ): literal[string] identifier[self] . identifier[send] ( identifier[nsq] . identifier[subscribe] ( identifier[topic] , identifier[channel] ))
def subscribe(self, topic, channel): """Subscribe to a nsq `topic` and `channel`.""" self.send(nsq.subscribe(topic, channel))
def truncated_normal_expval(mu, tau, a, b): """Expected value of the truncated normal distribution. .. math:: E(X) =\mu + \frac{\sigma(\varphi_1-\varphi_2)}{T} where .. math:: T & =\Phi\left(\frac{B-\mu}{\sigma}\right)-\Phi \left(\frac{A-\mu}{\sigma}\right)\text \\ \varph...
def function[truncated_normal_expval, parameter[mu, tau, a, b]]: constant[Expected value of the truncated normal distribution. .. math:: E(X) =\mu + rac{\sigma( arphi_1- arphi_2)}{T} where .. math:: T & =\Phi\left( rac{B-\mu}{\sigma} ight)-\Phi \left( rac{A-\mu}{\sigma} igh...
keyword[def] identifier[truncated_normal_expval] ( identifier[mu] , identifier[tau] , identifier[a] , identifier[b] ): literal[string] identifier[phia] = identifier[np] . identifier[exp] ( identifier[normal_like] ( identifier[a] , identifier[mu] , identifier[tau] )) identifier[phib] = identifier[np] ....
def truncated_normal_expval(mu, tau, a, b): """Expected value of the truncated normal distribution. .. math:: E(X) =\\mu + \x0crac{\\sigma(\x0barphi_1-\x0barphi_2)}{T} where .. math:: T & =\\Phi\\left(\x0crac{B-\\mu}{\\sigma}\right)-\\Phi \\left(\x0crac{A-\\mu}{\\sigma}\right) e...
def hash_napiprojekt(video_path): """Compute a hash using NapiProjekt's algorithm. :param str video_path: path of the video. :return: the hash. :rtype: str """ readsize = 1024 * 1024 * 10 with open(video_path, 'rb') as f: data = f.read(readsize) return hashlib.md5(data).hexdige...
def function[hash_napiprojekt, parameter[video_path]]: constant[Compute a hash using NapiProjekt's algorithm. :param str video_path: path of the video. :return: the hash. :rtype: str ] variable[readsize] assign[=] binary_operation[binary_operation[constant[1024] * constant[1024]] * con...
keyword[def] identifier[hash_napiprojekt] ( identifier[video_path] ): literal[string] identifier[readsize] = literal[int] * literal[int] * literal[int] keyword[with] identifier[open] ( identifier[video_path] , literal[string] ) keyword[as] identifier[f] : identifier[data] = identifier[f] ....
def hash_napiprojekt(video_path): """Compute a hash using NapiProjekt's algorithm. :param str video_path: path of the video. :return: the hash. :rtype: str """ readsize = 1024 * 1024 * 10 with open(video_path, 'rb') as f: data = f.read(readsize) # depends on [control=['with'], dat...
def detail( self, participant1: Address, participant2: Address, block_identifier: BlockSpecification, channel_identifier: ChannelID = None, ) -> ChannelDetails: """ Returns a ChannelDetails instance with all the details of the channel a...
def function[detail, parameter[self, participant1, participant2, block_identifier, channel_identifier]]: constant[ Returns a ChannelDetails instance with all the details of the channel and the channel participants. Note: For now one of the participants has to be the node_address...
keyword[def] identifier[detail] ( identifier[self] , identifier[participant1] : identifier[Address] , identifier[participant2] : identifier[Address] , identifier[block_identifier] : identifier[BlockSpecification] , identifier[channel_identifier] : identifier[ChannelID] = keyword[None] , )-> identifier[ChannelDet...
def detail(self, participant1: Address, participant2: Address, block_identifier: BlockSpecification, channel_identifier: ChannelID=None) -> ChannelDetails: """ Returns a ChannelDetails instance with all the details of the channel and the channel participants. Note: For now one of th...
def add_condor_job(self, token, batchmaketaskid, jobdefinitionfilename, outputfilename, errorfilename, logfilename, postfilename): """ Add a Condor DAG job to the Condor DAG associated with this Batchmake task :param token: A valid token for...
def function[add_condor_job, parameter[self, token, batchmaketaskid, jobdefinitionfilename, outputfilename, errorfilename, logfilename, postfilename]]: constant[ Add a Condor DAG job to the Condor DAG associated with this Batchmake task :param token: A valid token for the user in questi...
keyword[def] identifier[add_condor_job] ( identifier[self] , identifier[token] , identifier[batchmaketaskid] , identifier[jobdefinitionfilename] , identifier[outputfilename] , identifier[errorfilename] , identifier[logfilename] , identifier[postfilename] ): literal[string] identifier[parameters] ...
def add_condor_job(self, token, batchmaketaskid, jobdefinitionfilename, outputfilename, errorfilename, logfilename, postfilename): """ Add a Condor DAG job to the Condor DAG associated with this Batchmake task :param token: A valid token for the user in question. :type token: string...
def register_model_converter(model, app): """Add url converter for model Example: class Student(db.model): id = Column(Integer, primary_key=True) name = Column(String(50)) register_model_converter(Student) @route('/classmates/<Student:classmate>') def ...
def function[register_model_converter, parameter[model, app]]: constant[Add url converter for model Example: class Student(db.model): id = Column(Integer, primary_key=True) name = Column(String(50)) register_model_converter(Student) @route('/classmates/<St...
keyword[def] identifier[register_model_converter] ( identifier[model] , identifier[app] ): literal[string] keyword[if] identifier[hasattr] ( identifier[model] , literal[string] ): keyword[class] identifier[Converter] ( identifier[_ModelConverter] ): identifier[_model] = identifier[m...
def register_model_converter(model, app): """Add url converter for model Example: class Student(db.model): id = Column(Integer, primary_key=True) name = Column(String(50)) register_model_converter(Student) @route('/classmates/<Student:classmate>') def ...
def psf_slice(self, zint, size=11, zoffset=0., getextent=False): """ Calculates the 3D psf at a particular z pixel height Parameters ---------- zint : float z pixel height in image coordinates , converted to 1/k by the function using the slab position as ...
def function[psf_slice, parameter[self, zint, size, zoffset, getextent]]: constant[ Calculates the 3D psf at a particular z pixel height Parameters ---------- zint : float z pixel height in image coordinates , converted to 1/k by the function using the sl...
keyword[def] identifier[psf_slice] ( identifier[self] , identifier[zint] , identifier[size] = literal[int] , identifier[zoffset] = literal[int] , identifier[getextent] = keyword[False] ): literal[string] identifier[zint] = identifier[max] ( identifier[self] . identifier[_p2k] ( identifier[...
def psf_slice(self, zint, size=11, zoffset=0.0, getextent=False): """ Calculates the 3D psf at a particular z pixel height Parameters ---------- zint : float z pixel height in image coordinates , converted to 1/k by the function using the slab position as wel...
def update_tool_tip(self): """ Updates the node tooltip. :return: Method success. :rtype: bool """ self.roles[Qt.ToolTipRole] = self.__tool_tip_text.format(self.component.name, self.component.author, ...
def function[update_tool_tip, parameter[self]]: constant[ Updates the node tooltip. :return: Method success. :rtype: bool ] call[name[self].roles][name[Qt].ToolTipRole] assign[=] call[name[self].__tool_tip_text.format, parameter[name[self].component.name, name[self].comp...
keyword[def] identifier[update_tool_tip] ( identifier[self] ): literal[string] identifier[self] . identifier[roles] [ identifier[Qt] . identifier[ToolTipRole] ]= identifier[self] . identifier[__tool_tip_text] . identifier[format] ( identifier[self] . identifier[component] . identifier[name] , ...
def update_tool_tip(self): """ Updates the node tooltip. :return: Method success. :rtype: bool """ self.roles[Qt.ToolTipRole] = self.__tool_tip_text.format(self.component.name, self.component.author, self.component.category, ', '.join(self.component.require), self.component.vers...
def workspace(show_values: bool = True, show_types: bool = True): """ Adds a list of the shared variables currently stored in the project workspace. :param show_values: When true the values for each variable will be shown in addition to their name. :param show_types: When tr...
def function[workspace, parameter[show_values, show_types]]: constant[ Adds a list of the shared variables currently stored in the project workspace. :param show_values: When true the values for each variable will be shown in addition to their name. :param show_types: Wh...
keyword[def] identifier[workspace] ( identifier[show_values] : identifier[bool] = keyword[True] , identifier[show_types] : identifier[bool] = keyword[True] ): literal[string] identifier[r] = identifier[_get_report] () identifier[data] ={} keyword[for] identifier[key] , identifier[value] keywor...
def workspace(show_values: bool=True, show_types: bool=True): """ Adds a list of the shared variables currently stored in the project workspace. :param show_values: When true the values for each variable will be shown in addition to their name. :param show_types: When true t...
def average(old_avg, current_value, count): """ Calculate the average. Count must start with 0 >>> average(None, 3.23, 0) 3.23 >>> average(0, 1, 0) 1.0 >>> average(2.5, 5, 4) 3.0 """ if old_avg is None: return current_value return (float(old_avg) * count + current_va...
def function[average, parameter[old_avg, current_value, count]]: constant[ Calculate the average. Count must start with 0 >>> average(None, 3.23, 0) 3.23 >>> average(0, 1, 0) 1.0 >>> average(2.5, 5, 4) 3.0 ] if compare[name[old_avg] is constant[None]] begin[:] re...
keyword[def] identifier[average] ( identifier[old_avg] , identifier[current_value] , identifier[count] ): literal[string] keyword[if] identifier[old_avg] keyword[is] keyword[None] : keyword[return] identifier[current_value] keyword[return] ( identifier[float] ( identifier[old_avg] )* ide...
def average(old_avg, current_value, count): """ Calculate the average. Count must start with 0 >>> average(None, 3.23, 0) 3.23 >>> average(0, 1, 0) 1.0 >>> average(2.5, 5, 4) 3.0 """ if old_avg is None: return current_value # depends on [control=['if'], data=[]] ret...
def parse_exposure(self, node): """ Parses <Exposure> @param node: Node containing the <Exposure> element @type node: xml.etree.Element @raise ParseError: Raised when the exposure name is not being defined in the context of a component type. """ if self...
def function[parse_exposure, parameter[self, node]]: constant[ Parses <Exposure> @param node: Node containing the <Exposure> element @type node: xml.etree.Element @raise ParseError: Raised when the exposure name is not being defined in the context of a component type. ...
keyword[def] identifier[parse_exposure] ( identifier[self] , identifier[node] ): literal[string] keyword[if] identifier[self] . identifier[current_component_type] == keyword[None] : identifier[self] . identifier[raise_error] ( literal[string] ) keyword[try] : i...
def parse_exposure(self, node): """ Parses <Exposure> @param node: Node containing the <Exposure> element @type node: xml.etree.Element @raise ParseError: Raised when the exposure name is not being defined in the context of a component type. """ if self.current_...
def dist(self, src, tar): """Return the NCD between two strings using LZMA compression. Parameters ---------- src : str Source string for comparison tar : str Target string for comparison Returns ------- float Compress...
def function[dist, parameter[self, src, tar]]: constant[Return the NCD between two strings using LZMA compression. Parameters ---------- src : str Source string for comparison tar : str Target string for comparison Returns ------- ...
keyword[def] identifier[dist] ( identifier[self] , identifier[src] , identifier[tar] ): literal[string] keyword[if] identifier[src] == identifier[tar] : keyword[return] literal[int] identifier[src] = identifier[src] . identifier[encode] ( literal[string] ) identif...
def dist(self, src, tar): """Return the NCD between two strings using LZMA compression. Parameters ---------- src : str Source string for comparison tar : str Target string for comparison Returns ------- float Compression ...
def backward_step(self): """Take a backward step for all active states in the state machine """ logger.debug("Executing backward step ...") self.run_to_states = [] self.set_execution_mode(StateMachineExecutionStatus.BACKWARD)
def function[backward_step, parameter[self]]: constant[Take a backward step for all active states in the state machine ] call[name[logger].debug, parameter[constant[Executing backward step ...]]] name[self].run_to_states assign[=] list[[]] call[name[self].set_execution_mode, para...
keyword[def] identifier[backward_step] ( identifier[self] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] ) identifier[self] . identifier[run_to_states] =[] identifier[self] . identifier[set_execution_mode] ( identifier[StateMachineExecutionStatus] . id...
def backward_step(self): """Take a backward step for all active states in the state machine """ logger.debug('Executing backward step ...') self.run_to_states = [] self.set_execution_mode(StateMachineExecutionStatus.BACKWARD)
def filter_by_label(X, y, ref_label, reverse=False): ''' Select items with label from dataset. :param X: dataset :param y: labels :param ref_label: reference label :param bool reverse: if false selects ref_labels else eliminates ''' check_reference_label(y, ref_label) return list(z...
def function[filter_by_label, parameter[X, y, ref_label, reverse]]: constant[ Select items with label from dataset. :param X: dataset :param y: labels :param ref_label: reference label :param bool reverse: if false selects ref_labels else eliminates ] call[name[check_reference_l...
keyword[def] identifier[filter_by_label] ( identifier[X] , identifier[y] , identifier[ref_label] , identifier[reverse] = keyword[False] ): literal[string] identifier[check_reference_label] ( identifier[y] , identifier[ref_label] ) keyword[return] identifier[list] ( identifier[zip] (* identifier[filt...
def filter_by_label(X, y, ref_label, reverse=False): """ Select items with label from dataset. :param X: dataset :param y: labels :param ref_label: reference label :param bool reverse: if false selects ref_labels else eliminates """ check_reference_label(y, ref_label) return list(zi...
def delete_io( hash ): """ Deletes records associated with a particular hash :param str hash: The hash :rtype int: The number of records deleted """ global CACHE_ load_cache(True) record_used('cache', hash) num_deleted = len(CACHE_['cache'].get(hash, [])) if hash in CACHE_['cac...
def function[delete_io, parameter[hash]]: constant[ Deletes records associated with a particular hash :param str hash: The hash :rtype int: The number of records deleted ] <ast.Global object at 0x7da1b0a49ba0> call[name[load_cache], parameter[constant[True]]] call[name[reco...
keyword[def] identifier[delete_io] ( identifier[hash] ): literal[string] keyword[global] identifier[CACHE_] identifier[load_cache] ( keyword[True] ) identifier[record_used] ( literal[string] , identifier[hash] ) identifier[num_deleted] = identifier[len] ( identifier[CACHE_] [ literal[strin...
def delete_io(hash): """ Deletes records associated with a particular hash :param str hash: The hash :rtype int: The number of records deleted """ global CACHE_ load_cache(True) record_used('cache', hash) num_deleted = len(CACHE_['cache'].get(hash, [])) if hash in CACHE_['cache...
def outputs(ctx, client, revision, paths): r"""Show output files in the repository. <PATHS> Files to show. If no files are given all output files are shown. """ graph = Graph(client) filter = graph.build(paths=paths, revision=revision) output_paths = graph.output_paths click.echo('\n'.j...
def function[outputs, parameter[ctx, client, revision, paths]]: constant[Show output files in the repository. <PATHS> Files to show. If no files are given all output files are shown. ] variable[graph] assign[=] call[name[Graph], parameter[name[client]]] variable[filter] assign[=] cal...
keyword[def] identifier[outputs] ( identifier[ctx] , identifier[client] , identifier[revision] , identifier[paths] ): literal[string] identifier[graph] = identifier[Graph] ( identifier[client] ) identifier[filter] = identifier[graph] . identifier[build] ( identifier[paths] = identifier[paths] , identi...
def outputs(ctx, client, revision, paths): """Show output files in the repository. <PATHS> Files to show. If no files are given all output files are shown. """ graph = Graph(client) filter = graph.build(paths=paths, revision=revision) output_paths = graph.output_paths click.echo('\n'.joi...
def docpie(doc, argv=None, help=True, version=None, stdopt=True, attachopt=True, attachvalue=True, helpstyle='python', auto2dashes=True, name=None, case_sensitive=False, optionsfirst=False, appearedonly=False, namedoptions=False, extra=None): """ Parse `arg...
def function[docpie, parameter[doc, argv, help, version, stdopt, attachopt, attachvalue, helpstyle, auto2dashes, name, case_sensitive, optionsfirst, appearedonly, namedoptions, extra]]: constant[ Parse `argv` based on command-line interface described in `doc`. `docpie` creates your command-line interfa...
keyword[def] identifier[docpie] ( identifier[doc] , identifier[argv] = keyword[None] , identifier[help] = keyword[True] , identifier[version] = keyword[None] , identifier[stdopt] = keyword[True] , identifier[attachopt] = keyword[True] , identifier[attachvalue] = keyword[True] , identifier[helpstyle] = literal[strin...
def docpie(doc, argv=None, help=True, version=None, stdopt=True, attachopt=True, attachvalue=True, helpstyle='python', auto2dashes=True, name=None, case_sensitive=False, optionsfirst=False, appearedonly=False, namedoptions=False, extra=None): """ Parse `argv` based on command-line interface described in `doc`. ...
def describe_all(self, refresh=True): """ Describe all tables in the connected region """ tables = self.connection.list_tables() descs = [] for tablename in tables: descs.append(self.describe(tablename, refresh)) return descs
def function[describe_all, parameter[self, refresh]]: constant[ Describe all tables in the connected region ] variable[tables] assign[=] call[name[self].connection.list_tables, parameter[]] variable[descs] assign[=] list[[]] for taget[name[tablename]] in starred[name[tables]] begin[:] ...
keyword[def] identifier[describe_all] ( identifier[self] , identifier[refresh] = keyword[True] ): literal[string] identifier[tables] = identifier[self] . identifier[connection] . identifier[list_tables] () identifier[descs] =[] keyword[for] identifier[tablename] keyword[in] ide...
def describe_all(self, refresh=True): """ Describe all tables in the connected region """ tables = self.connection.list_tables() descs = [] for tablename in tables: descs.append(self.describe(tablename, refresh)) # depends on [control=['for'], data=['tablename']] return descs
def _series_lsm(self): """Return main and thumbnail series in LSM file.""" lsmi = self.lsm_metadata axes = TIFF.CZ_LSMINFO_SCANTYPE[lsmi['ScanType']] if self.pages[0].photometric == 2: # RGB; more than one channel axes = axes.replace('C', '').replace('XY', 'XYC') if ...
def function[_series_lsm, parameter[self]]: constant[Return main and thumbnail series in LSM file.] variable[lsmi] assign[=] name[self].lsm_metadata variable[axes] assign[=] call[name[TIFF].CZ_LSMINFO_SCANTYPE][call[name[lsmi]][constant[ScanType]]] if compare[call[name[self].pages][const...
keyword[def] identifier[_series_lsm] ( identifier[self] ): literal[string] identifier[lsmi] = identifier[self] . identifier[lsm_metadata] identifier[axes] = identifier[TIFF] . identifier[CZ_LSMINFO_SCANTYPE] [ identifier[lsmi] [ literal[string] ]] keyword[if] identifier[self] . ...
def _series_lsm(self): """Return main and thumbnail series in LSM file.""" lsmi = self.lsm_metadata axes = TIFF.CZ_LSMINFO_SCANTYPE[lsmi['ScanType']] if self.pages[0].photometric == 2: # RGB; more than one channel axes = axes.replace('C', '').replace('XY', 'XYC') # depends on [control=['if'], ...
def stream_filesystem_node(path, recursive=False, patterns='**', chunk_size=default_chunk_size): """Gets a buffered generator for streaming either files or directories. Returns a buffered generator which encodes the file or direct...
def function[stream_filesystem_node, parameter[path, recursive, patterns, chunk_size]]: constant[Gets a buffered generator for streaming either files or directories. Returns a buffered generator which encodes the file or directory at the given path as :mimetype:`multipart/form-data` with the correspond...
keyword[def] identifier[stream_filesystem_node] ( identifier[path] , identifier[recursive] = keyword[False] , identifier[patterns] = literal[string] , identifier[chunk_size] = identifier[default_chunk_size] ): literal[string] identifier[is_dir] = identifier[isinstance] ( identifier[path] , identifier[si...
def stream_filesystem_node(path, recursive=False, patterns='**', chunk_size=default_chunk_size): """Gets a buffered generator for streaming either files or directories. Returns a buffered generator which encodes the file or directory at the given path as :mimetype:`multipart/form-data` with the correspondi...
def start_element (self, tag, attrs): """Search for <title> tag.""" if tag == 'title': data = self.parser.peek(MAX_TITLELEN) data = data.decode(self.parser.encoding, "ignore") self.title = linkname.title_name(data) raise StopParse("found <title> tag") ...
def function[start_element, parameter[self, tag, attrs]]: constant[Search for <title> tag.] if compare[name[tag] equal[==] constant[title]] begin[:] variable[data] assign[=] call[name[self].parser.peek, parameter[name[MAX_TITLELEN]]] variable[data] assign[=] call[name[dat...
keyword[def] identifier[start_element] ( identifier[self] , identifier[tag] , identifier[attrs] ): literal[string] keyword[if] identifier[tag] == literal[string] : identifier[data] = identifier[self] . identifier[parser] . identifier[peek] ( identifier[MAX_TITLELEN] ) ide...
def start_element(self, tag, attrs): """Search for <title> tag.""" if tag == 'title': data = self.parser.peek(MAX_TITLELEN) data = data.decode(self.parser.encoding, 'ignore') self.title = linkname.title_name(data) raise StopParse('found <title> tag') # depends on [control=['if']...
def load(f): """Load audio metadata from filepath or file-like object. Parameters: f (str, os.PathLike, or file-like object): A filepath, path-like object or file-like object of an audio file. Returns: Format: An audio format object. Raises: UnsupportedFormat: If file is not of a supported format. Val...
def function[load, parameter[f]]: constant[Load audio metadata from filepath or file-like object. Parameters: f (str, os.PathLike, or file-like object): A filepath, path-like object or file-like object of an audio file. Returns: Format: An audio format object. Raises: UnsupportedFormat: If file i...
keyword[def] identifier[load] ( identifier[f] ): literal[string] keyword[if] identifier[isinstance] ( identifier[f] ,( identifier[os] . identifier[PathLike] , identifier[str] )): identifier[fileobj] = identifier[open] ( identifier[f] , literal[string] ) keyword[else] : keyword[try] : identifier[f] ...
def load(f): """Load audio metadata from filepath or file-like object. Parameters: f (str, os.PathLike, or file-like object): A filepath, path-like object or file-like object of an audio file. Returns: Format: An audio format object. Raises: UnsupportedFormat: If file is not of a supported format. ...
def parse_http_header(header_line): """Parse an HTTP header from a string, and return an ``HttpHeader``. ``header_line`` should only contain one line. ``BadHttpHeaderError`` is raised if the string is an invalid header line. """ header_line = header_line.decode().strip() col_idx = header_line....
def function[parse_http_header, parameter[header_line]]: constant[Parse an HTTP header from a string, and return an ``HttpHeader``. ``header_line`` should only contain one line. ``BadHttpHeaderError`` is raised if the string is an invalid header line. ] variable[header_line] assign[=] call[...
keyword[def] identifier[parse_http_header] ( identifier[header_line] ): literal[string] identifier[header_line] = identifier[header_line] . identifier[decode] (). identifier[strip] () identifier[col_idx] = identifier[header_line] . identifier[find] ( literal[string] ) keyword[if] identifier[co...
def parse_http_header(header_line): """Parse an HTTP header from a string, and return an ``HttpHeader``. ``header_line`` should only contain one line. ``BadHttpHeaderError`` is raised if the string is an invalid header line. """ header_line = header_line.decode().strip() col_idx = header_line.f...
def select_params_from_section_schema(section_schema, param_class=Param, deep=False): """Selects the parameters of a config section schema. :param section_schema: Configuration file section schema to use. :return: Generator of params """ # pylint: disable=inva...
def function[select_params_from_section_schema, parameter[section_schema, param_class, deep]]: constant[Selects the parameters of a config section schema. :param section_schema: Configuration file section schema to use. :return: Generator of params ] for taget[tuple[[<ast.Name object at 0x...
keyword[def] identifier[select_params_from_section_schema] ( identifier[section_schema] , identifier[param_class] = identifier[Param] , identifier[deep] = keyword[False] ): literal[string] keyword[for] identifier[name] , identifier[value] keyword[in] identifier[inspect] . identifier[getmembers] ( ...
def select_params_from_section_schema(section_schema, param_class=Param, deep=False): """Selects the parameters of a config section schema. :param section_schema: Configuration file section schema to use. :return: Generator of params """ # pylint: disable=invalid-name for (name, value) in insp...
def event_return(events): ''' Return events to Mongodb server ''' conn, mdb = _get_conn(ret=None) if isinstance(events, list): events = events[0] if isinstance(events, dict): log.debug(events) if PYMONGO_VERSION > _LooseVersion('2.3'): mdb.events.insert_one...
def function[event_return, parameter[events]]: constant[ Return events to Mongodb server ] <ast.Tuple object at 0x7da18f810190> assign[=] call[name[_get_conn], parameter[]] if call[name[isinstance], parameter[name[events], name[list]]] begin[:] variable[events] assign[=] ...
keyword[def] identifier[event_return] ( identifier[events] ): literal[string] identifier[conn] , identifier[mdb] = identifier[_get_conn] ( identifier[ret] = keyword[None] ) keyword[if] identifier[isinstance] ( identifier[events] , identifier[list] ): identifier[events] = identifier[events] ...
def event_return(events): """ Return events to Mongodb server """ (conn, mdb) = _get_conn(ret=None) if isinstance(events, list): events = events[0] # depends on [control=['if'], data=[]] if isinstance(events, dict): log.debug(events) if PYMONGO_VERSION > _LooseVersion('2...
def insert_before(self, text): """ Create a new document, with this text inserted before the buffer. It keeps selection ranges and cursor position in sync. """ selection_state = self.selection if selection_state: selection_state = SelectionState( ...
def function[insert_before, parameter[self, text]]: constant[ Create a new document, with this text inserted before the buffer. It keeps selection ranges and cursor position in sync. ] variable[selection_state] assign[=] name[self].selection if name[selection_state] begin...
keyword[def] identifier[insert_before] ( identifier[self] , identifier[text] ): literal[string] identifier[selection_state] = identifier[self] . identifier[selection] keyword[if] identifier[selection_state] : identifier[selection_state] = identifier[SelectionState] ( ...
def insert_before(self, text): """ Create a new document, with this text inserted before the buffer. It keeps selection ranges and cursor position in sync. """ selection_state = self.selection if selection_state: selection_state = SelectionState(original_cursor_position=selec...
def get_file_hexdigest(filename, blocksize=1024*1024*10): '''Get a hex digest of a file.''' if hashlib.__name__ == 'hashlib': m = hashlib.md5() # new - 'hashlib' module else: m = hashlib.new() # old - 'md5' module - remove once py2.4 gone fd = open(filename, 'r') while ...
def function[get_file_hexdigest, parameter[filename, blocksize]]: constant[Get a hex digest of a file.] if compare[name[hashlib].__name__ equal[==] constant[hashlib]] begin[:] variable[m] assign[=] call[name[hashlib].md5, parameter[]] variable[fd] assign[=] call[name[open], param...
keyword[def] identifier[get_file_hexdigest] ( identifier[filename] , identifier[blocksize] = literal[int] * literal[int] * literal[int] ): literal[string] keyword[if] identifier[hashlib] . identifier[__name__] == literal[string] : identifier[m] = identifier[hashlib] . identifier[md5] () key...
def get_file_hexdigest(filename, blocksize=1024 * 1024 * 10): """Get a hex digest of a file.""" if hashlib.__name__ == 'hashlib': m = hashlib.md5() # new - 'hashlib' module # depends on [control=['if'], data=[]] else: m = hashlib.new() # old - 'md5' module - remove once py2.4 gone fd ...
def frequencyRedefinition(CellChannelDescription_presence=0): """Frequency redefinition Section 9.1.13""" a = TpPd(pd=0x6) b = MessageType(mesType=0x14) # 00010100 c = ChannelDescription() d = MobileAllocation() e = StartingTime() packet = a / b / c / d / e if CellChannelDescription_pre...
def function[frequencyRedefinition, parameter[CellChannelDescription_presence]]: constant[Frequency redefinition Section 9.1.13] variable[a] assign[=] call[name[TpPd], parameter[]] variable[b] assign[=] call[name[MessageType], parameter[]] variable[c] assign[=] call[name[ChannelDescripti...
keyword[def] identifier[frequencyRedefinition] ( identifier[CellChannelDescription_presence] = literal[int] ): literal[string] identifier[a] = identifier[TpPd] ( identifier[pd] = literal[int] ) identifier[b] = identifier[MessageType] ( identifier[mesType] = literal[int] ) identifier[c] = identifi...
def frequencyRedefinition(CellChannelDescription_presence=0): """Frequency redefinition Section 9.1.13""" a = TpPd(pd=6) b = MessageType(mesType=20) # 00010100 c = ChannelDescription() d = MobileAllocation() e = StartingTime() packet = a / b / c / d / e if CellChannelDescription_presenc...
def genKw(w,msk,z): """ Generates key Kw using key-selector @w, master secret key @msk, and table value @z. @returns Kw as a BigInt. """ # Hash inputs into a string of bytes b = hmac(msk, z + w, tag="TAG_PYTHIA_KW") # Convert the string into a long value (no larger than the order of Gt)...
def function[genKw, parameter[w, msk, z]]: constant[ Generates key Kw using key-selector @w, master secret key @msk, and table value @z. @returns Kw as a BigInt. ] variable[b] assign[=] call[name[hmac], parameter[name[msk], binary_operation[name[z] + name[w]]]] return[call[name[BigIn...
keyword[def] identifier[genKw] ( identifier[w] , identifier[msk] , identifier[z] ): literal[string] identifier[b] = identifier[hmac] ( identifier[msk] , identifier[z] + identifier[w] , identifier[tag] = literal[string] ) keyword[return] identifier[BigInt] ( identifier[longFromString] ...
def genKw(w, msk, z): """ Generates key Kw using key-selector @w, master secret key @msk, and table value @z. @returns Kw as a BigInt. """ # Hash inputs into a string of bytes b = hmac(msk, z + w, tag='TAG_PYTHIA_KW') # Convert the string into a long value (no larger than the order of Gt...
def list_tables(self, libref, results: str = 'list'): """ This method returns a list of tuples containing MEMNAME, MEMTYPE of members in the library of memtype data or view If you would like a Pandas dataframe returned instead of a list, specify results='pandas' """ if not self...
def function[list_tables, parameter[self, libref, results]]: constant[ This method returns a list of tuples containing MEMNAME, MEMTYPE of members in the library of memtype data or view If you would like a Pandas dataframe returned instead of a list, specify results='pandas' ] i...
keyword[def] identifier[list_tables] ( identifier[self] , identifier[libref] , identifier[results] : identifier[str] = literal[string] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[nosub] : identifier[ll] = identifier[self] . identifier[submit] ( literal[s...
def list_tables(self, libref, results: str='list'): """ This method returns a list of tuples containing MEMNAME, MEMTYPE of members in the library of memtype data or view If you would like a Pandas dataframe returned instead of a list, specify results='pandas' """ if not self.nosub: ...
def load_plugins(self, plugin_path): """ Loads plugins from modules in plugin_path. Looks for the config_name property in each object that's found. If so, adds that to the dictionary with the config_name as the key. config_name should be unique between different plugins. :param ...
def function[load_plugins, parameter[self, plugin_path]]: constant[ Loads plugins from modules in plugin_path. Looks for the config_name property in each object that's found. If so, adds that to the dictionary with the config_name as the key. config_name should be unique between differen...
keyword[def] identifier[load_plugins] ( identifier[self] , identifier[plugin_path] ): literal[string] identifier[self] . identifier[logger] . identifier[debug] ( literal[string] . identifier[format] ( identifier[plugin_path] )) identifier[plugins] ={} identifier[plugin_dir] = iden...
def load_plugins(self, plugin_path): """ Loads plugins from modules in plugin_path. Looks for the config_name property in each object that's found. If so, adds that to the dictionary with the config_name as the key. config_name should be unique between different plugins. :param plug...
def write_contents(self, root_target, reduced_dependencies, chroot): """Write contents of the target.""" def write_target_source(target, src): chroot.copy(os.path.join(get_buildroot(), target.target_base, src), os.path.join(self.SOURCE_ROOT, src)) # check parent __init__.pys to see...
def function[write_contents, parameter[self, root_target, reduced_dependencies, chroot]]: constant[Write contents of the target.] def function[write_target_source, parameter[target, src]]: call[name[chroot].copy, parameter[call[name[os].path.join, parameter[call[name[get_buildroot], para...
keyword[def] identifier[write_contents] ( identifier[self] , identifier[root_target] , identifier[reduced_dependencies] , identifier[chroot] ): literal[string] keyword[def] identifier[write_target_source] ( identifier[target] , identifier[src] ): identifier[chroot] . identifier[copy] ( identifier[o...
def write_contents(self, root_target, reduced_dependencies, chroot): """Write contents of the target.""" def write_target_source(target, src): chroot.copy(os.path.join(get_buildroot(), target.target_base, src), os.path.join(self.SOURCE_ROOT, src)) # check parent __init__.pys to see if they also...
def fill_parentidid2obj_r1(self, id2obj_user, child_obj): """Fill id2obj_user with all parent/relationship key item IDs and their objects.""" for higher_obj in self._getobjs_higher(child_obj): if higher_obj.item_id not in id2obj_user: id2obj_user[higher_obj.item_id] = higher_...
def function[fill_parentidid2obj_r1, parameter[self, id2obj_user, child_obj]]: constant[Fill id2obj_user with all parent/relationship key item IDs and their objects.] for taget[name[higher_obj]] in starred[call[name[self]._getobjs_higher, parameter[name[child_obj]]]] begin[:] if compare[...
keyword[def] identifier[fill_parentidid2obj_r1] ( identifier[self] , identifier[id2obj_user] , identifier[child_obj] ): literal[string] keyword[for] identifier[higher_obj] keyword[in] identifier[self] . identifier[_getobjs_higher] ( identifier[child_obj] ): keyword[if] identifier[h...
def fill_parentidid2obj_r1(self, id2obj_user, child_obj): """Fill id2obj_user with all parent/relationship key item IDs and their objects.""" for higher_obj in self._getobjs_higher(child_obj): if higher_obj.item_id not in id2obj_user: id2obj_user[higher_obj.item_id] = higher_obj ...
def _compute_errors(self): """ Compute parameter errors based on the diagonal of the covariance matrix of the four harmonic coefficients for harmonics n=1 and n=2. """ try: coeffs = fit_first_and_second_harmonics(self.sample.values[0], ...
def function[_compute_errors, parameter[self]]: constant[ Compute parameter errors based on the diagonal of the covariance matrix of the four harmonic coefficients for harmonics n=1 and n=2. ] <ast.Try object at 0x7da20c7c8430>
keyword[def] identifier[_compute_errors] ( identifier[self] ): literal[string] keyword[try] : identifier[coeffs] = identifier[fit_first_and_second_harmonics] ( identifier[self] . identifier[sample] . identifier[values] [ literal[int] ], identifier[self] . identifier[sampl...
def _compute_errors(self): """ Compute parameter errors based on the diagonal of the covariance matrix of the four harmonic coefficients for harmonics n=1 and n=2. """ try: coeffs = fit_first_and_second_harmonics(self.sample.values[0], self.sample.values[2]) covar...
def __get_all_lowpoints(dfs_data): """Calculates the lowpoints for each node in a graph.""" lowpoint_1_lookup = {} lowpoint_2_lookup = {} ordering = dfs_data['ordering'] for node in ordering: low_1, low_2 = __get_lowpoints(node, dfs_data) lowpoint_1_lookup[node] = low_1 low...
def function[__get_all_lowpoints, parameter[dfs_data]]: constant[Calculates the lowpoints for each node in a graph.] variable[lowpoint_1_lookup] assign[=] dictionary[[], []] variable[lowpoint_2_lookup] assign[=] dictionary[[], []] variable[ordering] assign[=] call[name[dfs_data]][constan...
keyword[def] identifier[__get_all_lowpoints] ( identifier[dfs_data] ): literal[string] identifier[lowpoint_1_lookup] ={} identifier[lowpoint_2_lookup] ={} identifier[ordering] = identifier[dfs_data] [ literal[string] ] keyword[for] identifier[node] keyword[in] identifier[ordering] : ...
def __get_all_lowpoints(dfs_data): """Calculates the lowpoints for each node in a graph.""" lowpoint_1_lookup = {} lowpoint_2_lookup = {} ordering = dfs_data['ordering'] for node in ordering: (low_1, low_2) = __get_lowpoints(node, dfs_data) lowpoint_1_lookup[node] = low_1 low...
def new(self, **kwargs): '''Return a new ``Message`` instance. The arguments are passed to the ``marrow.mailer.Message`` constructor.''' app = self.app or current_app mailer = app.extensions['marrowmailer'] msg = mailer.new(**kwargs) msg.__class__ = Message retur...
def function[new, parameter[self]]: constant[Return a new ``Message`` instance. The arguments are passed to the ``marrow.mailer.Message`` constructor.] variable[app] assign[=] <ast.BoolOp object at 0x7da1b2351ab0> variable[mailer] assign[=] call[name[app].extensions][constant[marrowmail...
keyword[def] identifier[new] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[app] = identifier[self] . identifier[app] keyword[or] identifier[current_app] identifier[mailer] = identifier[app] . identifier[extensions] [ literal[string] ] identifier[msg] =...
def new(self, **kwargs): """Return a new ``Message`` instance. The arguments are passed to the ``marrow.mailer.Message`` constructor.""" app = self.app or current_app mailer = app.extensions['marrowmailer'] msg = mailer.new(**kwargs) msg.__class__ = Message return msg
def _matmul_with_relative_keys_2d(x, y, heads_share_relative_embedding): """Helper function for dot_product_unmasked_self_attention_relative_2d.""" if heads_share_relative_embedding: ret = tf.einsum("bhxyd,md->bhxym", x, y) else: ret = tf.einsum("bhxyd,hmd->bhxym", x, y) return ret
def function[_matmul_with_relative_keys_2d, parameter[x, y, heads_share_relative_embedding]]: constant[Helper function for dot_product_unmasked_self_attention_relative_2d.] if name[heads_share_relative_embedding] begin[:] variable[ret] assign[=] call[name[tf].einsum, parameter[constant[b...
keyword[def] identifier[_matmul_with_relative_keys_2d] ( identifier[x] , identifier[y] , identifier[heads_share_relative_embedding] ): literal[string] keyword[if] identifier[heads_share_relative_embedding] : identifier[ret] = identifier[tf] . identifier[einsum] ( literal[string] , identifier[x] , identif...
def _matmul_with_relative_keys_2d(x, y, heads_share_relative_embedding): """Helper function for dot_product_unmasked_self_attention_relative_2d.""" if heads_share_relative_embedding: ret = tf.einsum('bhxyd,md->bhxym', x, y) # depends on [control=['if'], data=[]] else: ret = tf.einsum('bhxyd...
def assemble(self, header_json, metadata_json, content_json): ''' Create a Message instance assembled from json fragments. Args: header_json (``JSON``) : metadata_json (``JSON``) : content_json (``JSON``) : Returns: message ''' ...
def function[assemble, parameter[self, header_json, metadata_json, content_json]]: constant[ Create a Message instance assembled from json fragments. Args: header_json (``JSON``) : metadata_json (``JSON``) : content_json (``JSON``) : Returns: m...
keyword[def] identifier[assemble] ( identifier[self] , identifier[header_json] , identifier[metadata_json] , identifier[content_json] ): literal[string] identifier[header] = identifier[json_decode] ( identifier[header_json] ) keyword[if] literal[string] keyword[not] keyword[in] identif...
def assemble(self, header_json, metadata_json, content_json): """ Create a Message instance assembled from json fragments. Args: header_json (``JSON``) : metadata_json (``JSON``) : content_json (``JSON``) : Returns: message """ header ...
def _merge(self, value): """ Returns a list based on `value`: * missing required value is converted to an empty list; * missing required items are never created; * nested items are merged recursively. """ if not value: return [] if value is not None...
def function[_merge, parameter[self, value]]: constant[ Returns a list based on `value`: * missing required value is converted to an empty list; * missing required items are never created; * nested items are merged recursively. ] if <ast.UnaryOp object at 0x7da1b2427790...
keyword[def] identifier[_merge] ( identifier[self] , identifier[value] ): literal[string] keyword[if] keyword[not] identifier[value] : keyword[return] [] keyword[if] identifier[value] keyword[is] keyword[not] keyword[None] keyword[and] keyword[not] identifier[isinsta...
def _merge(self, value): """ Returns a list based on `value`: * missing required value is converted to an empty list; * missing required items are never created; * nested items are merged recursively. """ if not value: return [] # depends on [control=['if'], data=[]] ...
def valid_backbone_bond_lengths(self, atol=0.1): """True if all backbone bonds are within atol Angstroms of the expected distance. Notes ----- Ideal bond lengths taken from [1]. References ---------- .. [1] Schulz, G. E, and R. Heiner Schirmer. Principles Of ...
def function[valid_backbone_bond_lengths, parameter[self, atol]]: constant[True if all backbone bonds are within atol Angstroms of the expected distance. Notes ----- Ideal bond lengths taken from [1]. References ---------- .. [1] Schulz, G. E, and R. Heiner Schi...
keyword[def] identifier[valid_backbone_bond_lengths] ( identifier[self] , identifier[atol] = literal[int] ): literal[string] identifier[bond_lengths] = identifier[self] . identifier[backbone_bond_lengths] identifier[a1] = identifier[numpy] . identifier[allclose] ( identifier[bond_lengths]...
def valid_backbone_bond_lengths(self, atol=0.1): """True if all backbone bonds are within atol Angstroms of the expected distance. Notes ----- Ideal bond lengths taken from [1]. References ---------- .. [1] Schulz, G. E, and R. Heiner Schirmer. Principles Of ...
def escape(identifier, ansi_quotes, should_quote): """ Escape identifiers. ANSI uses single quotes, but many databases use back quotes. """ if not should_quote(identifier): return identifier quote = '"' if ansi_quotes else '`' identifier = identifier.replace(quote, 2*quote) re...
def function[escape, parameter[identifier, ansi_quotes, should_quote]]: constant[ Escape identifiers. ANSI uses single quotes, but many databases use back quotes. ] if <ast.UnaryOp object at 0x7da1b19edc60> begin[:] return[name[identifier]] variable[quote] assign[=] <ast.If...
keyword[def] identifier[escape] ( identifier[identifier] , identifier[ansi_quotes] , identifier[should_quote] ): literal[string] keyword[if] keyword[not] identifier[should_quote] ( identifier[identifier] ): keyword[return] identifier[identifier] identifier[quote] = literal[string] keywo...
def escape(identifier, ansi_quotes, should_quote): """ Escape identifiers. ANSI uses single quotes, but many databases use back quotes. """ if not should_quote(identifier): return identifier # depends on [control=['if'], data=[]] quote = '"' if ansi_quotes else '`' identifier = id...
def _new_message_properties(self, content_type=None, content_encoding=None, headers=None, delivery_mode=None, priority=None, correlation_id=None, reply_to=None, expiration=None, message_id=None, ...
def function[_new_message_properties, parameter[self, content_type, content_encoding, headers, delivery_mode, priority, correlation_id, reply_to, expiration, message_id, timestamp, message_type, user_id, app_id]]: constant[Create a BasicProperties object, with the properties specified :param str conten...
keyword[def] identifier[_new_message_properties] ( identifier[self] , identifier[content_type] = keyword[None] , identifier[content_encoding] = keyword[None] , identifier[headers] = keyword[None] , identifier[delivery_mode] = keyword[None] , identifier[priority] = keyword[None] , identifier[correlation_id] = keywor...
def _new_message_properties(self, content_type=None, content_encoding=None, headers=None, delivery_mode=None, priority=None, correlation_id=None, reply_to=None, expiration=None, message_id=None, timestamp=None, message_type=None, user_id=None, app_id=None): """Create a BasicProperties object, with the properties sp...
def is_in_this_week(self): """Checks if date is in this week (from sunday to sunday) :return: True iff date is in this week (from sunday to sunday) """ return self.is_date_in_between( Weekday.get_last(self.week_end, including_today=True), Weekday.get_next(self.we...
def function[is_in_this_week, parameter[self]]: constant[Checks if date is in this week (from sunday to sunday) :return: True iff date is in this week (from sunday to sunday) ] return[call[name[self].is_date_in_between, parameter[call[name[Weekday].get_last, parameter[name[self].week_end]],...
keyword[def] identifier[is_in_this_week] ( identifier[self] ): literal[string] keyword[return] identifier[self] . identifier[is_date_in_between] ( identifier[Weekday] . identifier[get_last] ( identifier[self] . identifier[week_end] , identifier[including_today] = keyword[True] ), ...
def is_in_this_week(self): """Checks if date is in this week (from sunday to sunday) :return: True iff date is in this week (from sunday to sunday) """ return self.is_date_in_between(Weekday.get_last(self.week_end, including_today=True), Weekday.get_next(self.week_end), include_end=False)
def get_decomposition_type_property(value, is_bytes=False): """Get `DECOMPOSITION TYPE` property.""" obj = unidata.ascii_decomposition_type if is_bytes else unidata.unicode_decomposition_type if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['decompositionty...
def function[get_decomposition_type_property, parameter[value, is_bytes]]: constant[Get `DECOMPOSITION TYPE` property.] variable[obj] assign[=] <ast.IfExp object at 0x7da1b032f220> if call[name[value].startswith, parameter[constant[^]]] begin[:] variable[negated] assign[=] call[n...
keyword[def] identifier[get_decomposition_type_property] ( identifier[value] , identifier[is_bytes] = keyword[False] ): literal[string] identifier[obj] = identifier[unidata] . identifier[ascii_decomposition_type] keyword[if] identifier[is_bytes] keyword[else] identifier[unidata] . identifier[unicode_d...
def get_decomposition_type_property(value, is_bytes=False): """Get `DECOMPOSITION TYPE` property.""" obj = unidata.ascii_decomposition_type if is_bytes else unidata.unicode_decomposition_type if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['decompositiontype...
def bench(client, n): """ Benchmark n requests """ items = list(range(n)) # Time client publish operations # ------------------------------ started = time.time() for i in items: client.publish('test', i) duration = time.time() - started print('Publisher client stats:') util...
def function[bench, parameter[client, n]]: constant[ Benchmark n requests ] variable[items] assign[=] call[name[list], parameter[call[name[range], parameter[name[n]]]]] variable[started] assign[=] call[name[time].time, parameter[]] for taget[name[i]] in starred[name[items]] begin[:] ...
keyword[def] identifier[bench] ( identifier[client] , identifier[n] ): literal[string] identifier[items] = identifier[list] ( identifier[range] ( identifier[n] )) identifier[started] = identifier[time] . identifier[time] () keyword[for] identifier[i] keyword[in] identifier[items] : ...
def bench(client, n): """ Benchmark n requests """ items = list(range(n)) # Time client publish operations # ------------------------------ started = time.time() for i in items: client.publish('test', i) # depends on [control=['for'], data=['i']] duration = time.time() - started ...
def flat_map(self, flatmap_function): """Return a new Streamlet by applying map_function to each element of this Streamlet and flattening the result """ from heronpy.streamlet.impl.flatmapbolt import FlatMapStreamlet fm_streamlet = FlatMapStreamlet(flatmap_function, self) self._add_child(fm_s...
def function[flat_map, parameter[self, flatmap_function]]: constant[Return a new Streamlet by applying map_function to each element of this Streamlet and flattening the result ] from relative_module[heronpy.streamlet.impl.flatmapbolt] import module[FlatMapStreamlet] variable[fm_streamlet]...
keyword[def] identifier[flat_map] ( identifier[self] , identifier[flatmap_function] ): literal[string] keyword[from] identifier[heronpy] . identifier[streamlet] . identifier[impl] . identifier[flatmapbolt] keyword[import] identifier[FlatMapStreamlet] identifier[fm_streamlet] = identifier[FlatMapSt...
def flat_map(self, flatmap_function): """Return a new Streamlet by applying map_function to each element of this Streamlet and flattening the result """ from heronpy.streamlet.impl.flatmapbolt import FlatMapStreamlet fm_streamlet = FlatMapStreamlet(flatmap_function, self) self._add_child(fm_s...
def create(self): """ Generate the data and figs for the report and fill the LaTeX templates with them to generate a PDF file with the report. :return: """ logger.info("Generating the report from %s to %s", self.start, self.end) self.create_data_figs() s...
def function[create, parameter[self]]: constant[ Generate the data and figs for the report and fill the LaTeX templates with them to generate a PDF file with the report. :return: ] call[name[logger].info, parameter[constant[Generating the report from %s to %s], name[self...
keyword[def] identifier[create] ( identifier[self] ): literal[string] identifier[logger] . identifier[info] ( literal[string] , identifier[self] . identifier[start] , identifier[self] . identifier[end] ) identifier[self] . identifier[create_data_figs] () identifier[self] . identi...
def create(self): """ Generate the data and figs for the report and fill the LaTeX templates with them to generate a PDF file with the report. :return: """ logger.info('Generating the report from %s to %s', self.start, self.end) self.create_data_figs() self.create_pdf() ...
def create(self): """ Create the SSH Key """ input_params = { "name": self.name, "public_key": self.public_key, } data = self.get_data("account/keys/", type=POST, params=input_params) if data: self.id = data['ssh_key']['id...
def function[create, parameter[self]]: constant[ Create the SSH Key ] variable[input_params] assign[=] dictionary[[<ast.Constant object at 0x7da1b016c760>, <ast.Constant object at 0x7da1b016d690>], [<ast.Attribute object at 0x7da1b016c640>, <ast.Attribute object at 0x7da1b016c220>]] ...
keyword[def] identifier[create] ( identifier[self] ): literal[string] identifier[input_params] ={ literal[string] : identifier[self] . identifier[name] , literal[string] : identifier[self] . identifier[public_key] , } identifier[data] = identifier[self] . identif...
def create(self): """ Create the SSH Key """ input_params = {'name': self.name, 'public_key': self.public_key} data = self.get_data('account/keys/', type=POST, params=input_params) if data: self.id = data['ssh_key']['id'] # depends on [control=['if'], data=[]]
def assert_optimal(model, message='optimization failed'): """Assert model solver status is optimal. Do nothing if model solver status is optimal, otherwise throw appropriate exception depending on the status. Parameters ---------- model : cobra.Model The model to check the solver statu...
def function[assert_optimal, parameter[model, message]]: constant[Assert model solver status is optimal. Do nothing if model solver status is optimal, otherwise throw appropriate exception depending on the status. Parameters ---------- model : cobra.Model The model to check the sol...
keyword[def] identifier[assert_optimal] ( identifier[model] , identifier[message] = literal[string] ): literal[string] identifier[status] = identifier[model] . identifier[solver] . identifier[status] keyword[if] identifier[status] != identifier[OPTIMAL] : identifier[exception_cls] = identif...
def assert_optimal(model, message='optimization failed'): """Assert model solver status is optimal. Do nothing if model solver status is optimal, otherwise throw appropriate exception depending on the status. Parameters ---------- model : cobra.Model The model to check the solver statu...
def _check_distributed_corpora_file(self): """Check '~/cltk_data/distributed_corpora.yaml' for any custom, distributed corpora that the user wants to load locally. TODO: write check or try if `cltk_data` dir is not present """ if self.testing: distributed_corpora_fp ...
def function[_check_distributed_corpora_file, parameter[self]]: constant[Check '~/cltk_data/distributed_corpora.yaml' for any custom, distributed corpora that the user wants to load locally. TODO: write check or try if `cltk_data` dir is not present ] if name[self].testing begin...
keyword[def] identifier[_check_distributed_corpora_file] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[testing] : identifier[distributed_corpora_fp] = identifier[os] . identifier[path] . identifier[expanduser] ( literal[string] ) keyword[else...
def _check_distributed_corpora_file(self): """Check '~/cltk_data/distributed_corpora.yaml' for any custom, distributed corpora that the user wants to load locally. TODO: write check or try if `cltk_data` dir is not present """ if self.testing: distributed_corpora_fp = os.path.ex...
def has_duplicates(self): """ Returns ``True`` if the dict contains keys with duplicates. Recurses through any all keys with value that is ``VDFDict``. """ for n in getattr(self.__kcount, _iter_values)(): if n != 1: return True def dict_recurs...
def function[has_duplicates, parameter[self]]: constant[ Returns ``True`` if the dict contains keys with duplicates. Recurses through any all keys with value that is ``VDFDict``. ] for taget[name[n]] in starred[call[call[name[getattr], parameter[name[self].__kcount, name[_iter_va...
keyword[def] identifier[has_duplicates] ( identifier[self] ): literal[string] keyword[for] identifier[n] keyword[in] identifier[getattr] ( identifier[self] . identifier[__kcount] , identifier[_iter_values] )(): keyword[if] identifier[n] != literal[int] : keyword[re...
def has_duplicates(self): """ Returns ``True`` if the dict contains keys with duplicates. Recurses through any all keys with value that is ``VDFDict``. """ for n in getattr(self.__kcount, _iter_values)(): if n != 1: return True # depends on [control=['if'], data=[]] ...
def parse_report_file(input_, nameservers=None, dns_timeout=2.0, strip_attachment_payloads=False, parallel=False): """Parses a DMARC aggregate or forensic file at the given path, a file-like object. or bytes Args: input_: A path to a file, a file like object, or bytes ...
def function[parse_report_file, parameter[input_, nameservers, dns_timeout, strip_attachment_payloads, parallel]]: constant[Parses a DMARC aggregate or forensic file at the given path, a file-like object. or bytes Args: input_: A path to a file, a file like object, or bytes nameservers ...
keyword[def] identifier[parse_report_file] ( identifier[input_] , identifier[nameservers] = keyword[None] , identifier[dns_timeout] = literal[int] , identifier[strip_attachment_payloads] = keyword[False] , identifier[parallel] = keyword[False] ): literal[string] keyword[if] identifier[type] ( identifier[...
def parse_report_file(input_, nameservers=None, dns_timeout=2.0, strip_attachment_payloads=False, parallel=False): """Parses a DMARC aggregate or forensic file at the given path, a file-like object. or bytes Args: input_: A path to a file, a file like object, or bytes nameservers (list): A ...
def createGroup(self, message, user_ids): """ Creates a group with the given ids :param message: The initial message :param user_ids: A list of users to create the group with. :return: ID of the new group :raises: FBchatException if request failed """ dat...
def function[createGroup, parameter[self, message, user_ids]]: constant[ Creates a group with the given ids :param message: The initial message :param user_ids: A list of users to create the group with. :return: ID of the new group :raises: FBchatException if request fai...
keyword[def] identifier[createGroup] ( identifier[self] , identifier[message] , identifier[user_ids] ): literal[string] identifier[data] = identifier[self] . identifier[_getSendData] ( identifier[message] = identifier[self] . identifier[_oldMessage] ( identifier[message] )) keyword[if] i...
def createGroup(self, message, user_ids): """ Creates a group with the given ids :param message: The initial message :param user_ids: A list of users to create the group with. :return: ID of the new group :raises: FBchatException if request failed """ data = self...
def lookup(name, min_similarity_ratio=.75): """ Look up for a Stan function with similar functionality to a Python function (or even an R function, see examples). If the function is not present on the lookup table, then attempts to find similar one and prints the results. This function requires pack...
def function[lookup, parameter[name, min_similarity_ratio]]: constant[ Look up for a Stan function with similar functionality to a Python function (or even an R function, see examples). If the function is not present on the lookup table, then attempts to find similar one and prints the results. ...
keyword[def] identifier[lookup] ( identifier[name] , identifier[min_similarity_ratio] = literal[int] ): literal[string] keyword[if] identifier[lookuptable] keyword[is] keyword[None] : identifier[build] () keyword[if] identifier[name] keyword[not] keyword[in] identifier[lookuptable] . i...
def lookup(name, min_similarity_ratio=0.75): """ Look up for a Stan function with similar functionality to a Python function (or even an R function, see examples). If the function is not present on the lookup table, then attempts to find similar one and prints the results. This function requires pac...
def _get_metadata(self): '''since the user needs a job id and other parameters, save this for them. ''' metadata = {'SREGISTRY_GITLAB_FOLDER': self.artifacts, 'api_base': self.api_base, 'SREGISTRY_GITLAB_BASE': self.base, 'SR...
def function[_get_metadata, parameter[self]]: constant[since the user needs a job id and other parameters, save this for them. ] variable[metadata] assign[=] dictionary[[<ast.Constant object at 0x7da1b03fad70>, <ast.Constant object at 0x7da1b03f8730>, <ast.Constant object at 0x7da1b03...
keyword[def] identifier[_get_metadata] ( identifier[self] ): literal[string] identifier[metadata] ={ literal[string] : identifier[self] . identifier[artifacts] , literal[string] : identifier[self] . identifier[api_base] , literal[string] : identifier[self] . identifier[base] , ...
def _get_metadata(self): """since the user needs a job id and other parameters, save this for them. """ metadata = {'SREGISTRY_GITLAB_FOLDER': self.artifacts, 'api_base': self.api_base, 'SREGISTRY_GITLAB_BASE': self.base, 'SREGISTRY_GITLAB_JOB': self.job} return metadata
def _recurse_find_trace(self, structure, item, trace=[]): """ given a nested structure from _parse_repr and find the trace route to get to item """ try: i = structure.index(item) except ValueError: for j,substructure in enumerate(structure): ...
def function[_recurse_find_trace, parameter[self, structure, item, trace]]: constant[ given a nested structure from _parse_repr and find the trace route to get to item ] <ast.Try object at 0x7da18eb56fb0>
keyword[def] identifier[_recurse_find_trace] ( identifier[self] , identifier[structure] , identifier[item] , identifier[trace] =[]): literal[string] keyword[try] : identifier[i] = identifier[structure] . identifier[index] ( identifier[item] ) keyword[except] identifier[Value...
def _recurse_find_trace(self, structure, item, trace=[]): """ given a nested structure from _parse_repr and find the trace route to get to item """ try: i = structure.index(item) # depends on [control=['try'], data=[]] except ValueError: for (j, substructure) in enumerate(st...
def read(self, size=None): # pylint: disable=invalid-name """Reads from the buffer.""" if size is None or size < 0: raise exceptions.NotYetImplementedError( 'Illegal read of size %s requested on BufferedStream. ' 'Wrapped stream %s is at position %s-%s, ' ...
def function[read, parameter[self, size]]: constant[Reads from the buffer.] if <ast.BoolOp object at 0x7da1b08454e0> begin[:] <ast.Raise object at 0x7da1b0847d60> variable[data] assign[=] constant[] if name[self]._bytes_remaining begin[:] variable[size] assign[=] ...
keyword[def] identifier[read] ( identifier[self] , identifier[size] = keyword[None] ): literal[string] keyword[if] identifier[size] keyword[is] keyword[None] keyword[or] identifier[size] < literal[int] : keyword[raise] identifier[exceptions] . identifier[NotYetImplementedError] (...
def read(self, size=None): # pylint: disable=invalid-name 'Reads from the buffer.' if size is None or size < 0: raise exceptions.NotYetImplementedError('Illegal read of size %s requested on BufferedStream. Wrapped stream %s is at position %s-%s, %s bytes remaining.' % (size, self.__stream, self.__start...
def remove_range(self, start, end, callback=None): '''Remove a range by rank. This is equivalent to perform:: del l[start:end] on a python list. It returns the number of element removed. ''' N = len(self) if start < 0: start = max(N + st...
def function[remove_range, parameter[self, start, end, callback]]: constant[Remove a range by rank. This is equivalent to perform:: del l[start:end] on a python list. It returns the number of element removed. ] variable[N] assign[=] call[name[len], paramete...
keyword[def] identifier[remove_range] ( identifier[self] , identifier[start] , identifier[end] , identifier[callback] = keyword[None] ): literal[string] identifier[N] = identifier[len] ( identifier[self] ) keyword[if] identifier[start] < literal[int] : identifier[start] = ide...
def remove_range(self, start, end, callback=None): """Remove a range by rank. This is equivalent to perform:: del l[start:end] on a python list. It returns the number of element removed. """ N = len(self) if start < 0: start = max(N + start, 0) # depen...
def _raise_redirect_exceptions(response): """Return the new url or None if there are no redirects. Raise exceptions if appropriate. """ if response.status_code not in [301, 302, 307]: return None new_url = urljoin(response.url, response.headers['location']) if 'reddits/search' in new_u...
def function[_raise_redirect_exceptions, parameter[response]]: constant[Return the new url or None if there are no redirects. Raise exceptions if appropriate. ] if compare[name[response].status_code <ast.NotIn object at 0x7da2590d7190> list[[<ast.Constant object at 0x7da18fe91660>, <ast.Consta...
keyword[def] identifier[_raise_redirect_exceptions] ( identifier[response] ): literal[string] keyword[if] identifier[response] . identifier[status_code] keyword[not] keyword[in] [ literal[int] , literal[int] , literal[int] ]: keyword[return] keyword[None] identifier[new_url] = identifier...
def _raise_redirect_exceptions(response): """Return the new url or None if there are no redirects. Raise exceptions if appropriate. """ if response.status_code not in [301, 302, 307]: return None # depends on [control=['if'], data=[]] new_url = urljoin(response.url, response.headers['loca...
def dump(self, fh, value, context=None): """Attempt to transform and write a string-based foreign value to the given file-like object. Returns the length written. """ value = self.dumps(value) fh.write(value) return len(value)
def function[dump, parameter[self, fh, value, context]]: constant[Attempt to transform and write a string-based foreign value to the given file-like object. Returns the length written. ] variable[value] assign[=] call[name[self].dumps, parameter[name[value]]] call[name[fh].write, paramete...
keyword[def] identifier[dump] ( identifier[self] , identifier[fh] , identifier[value] , identifier[context] = keyword[None] ): literal[string] identifier[value] = identifier[self] . identifier[dumps] ( identifier[value] ) identifier[fh] . identifier[write] ( identifier[value] ) keyword[return] identifi...
def dump(self, fh, value, context=None): """Attempt to transform and write a string-based foreign value to the given file-like object. Returns the length written. """ value = self.dumps(value) fh.write(value) return len(value)
def remove_list_member(self, list_id, user_id): """ Remove a user from a list :param list_id: list ID number :param user_id: user ID number :return: :class:`~responsebot.models.List` object """ return List(tweepy_list_to_json(self._client.remove_list_member(list_...
def function[remove_list_member, parameter[self, list_id, user_id]]: constant[ Remove a user from a list :param list_id: list ID number :param user_id: user ID number :return: :class:`~responsebot.models.List` object ] return[call[name[List], parameter[call[name[twee...
keyword[def] identifier[remove_list_member] ( identifier[self] , identifier[list_id] , identifier[user_id] ): literal[string] keyword[return] identifier[List] ( identifier[tweepy_list_to_json] ( identifier[self] . identifier[_client] . identifier[remove_list_member] ( identifier[list_id] = identif...
def remove_list_member(self, list_id, user_id): """ Remove a user from a list :param list_id: list ID number :param user_id: user ID number :return: :class:`~responsebot.models.List` object """ return List(tweepy_list_to_json(self._client.remove_list_member(list_id=list_...
def parse_date(date_str): """Parse elastic datetime string.""" if not date_str: return None try: date = ciso8601.parse_datetime(date_str) if not date: date = arrow.get(date_str).datetime except TypeError: date = arrow.get(date_str[0]).datetime return date
def function[parse_date, parameter[date_str]]: constant[Parse elastic datetime string.] if <ast.UnaryOp object at 0x7da1b26c8ac0> begin[:] return[constant[None]] <ast.Try object at 0x7da1b26c8a90> return[name[date]]
keyword[def] identifier[parse_date] ( identifier[date_str] ): literal[string] keyword[if] keyword[not] identifier[date_str] : keyword[return] keyword[None] keyword[try] : identifier[date] = identifier[ciso8601] . identifier[parse_datetime] ( identifier[date_str] ) keywo...
def parse_date(date_str): """Parse elastic datetime string.""" if not date_str: return None # depends on [control=['if'], data=[]] try: date = ciso8601.parse_datetime(date_str) if not date: date = arrow.get(date_str).datetime # depends on [control=['if'], data=[]] # de...
def lock_file(filename): """Locks the file by writing a '.lock' file. Returns True when the file is locked and False when the file was locked already""" lockfile = "%s.lock"%filename if isfile(lockfile): return False else: with open(lockfile, "w"): pass ret...
def function[lock_file, parameter[filename]]: constant[Locks the file by writing a '.lock' file. Returns True when the file is locked and False when the file was locked already] variable[lockfile] assign[=] binary_operation[constant[%s.lock] <ast.Mod object at 0x7da2590d6920> name[filename...
keyword[def] identifier[lock_file] ( identifier[filename] ): literal[string] identifier[lockfile] = literal[string] % identifier[filename] keyword[if] identifier[isfile] ( identifier[lockfile] ): keyword[return] keyword[False] keyword[else] : keyword[with] identifier[open]...
def lock_file(filename): """Locks the file by writing a '.lock' file. Returns True when the file is locked and False when the file was locked already""" lockfile = '%s.lock' % filename if isfile(lockfile): return False # depends on [control=['if'], data=[]] else: with open...
def plot (data, headers=None, pconfig=None): """ Helper HTML for a beeswarm plot. :param data: A list of data dicts :param headers: A list of Dicts / OrderedDicts with information for the series, such as colour scales, min and max values etc. :return: HTML string ...
def function[plot, parameter[data, headers, pconfig]]: constant[ Helper HTML for a beeswarm plot. :param data: A list of data dicts :param headers: A list of Dicts / OrderedDicts with information for the series, such as colour scales, min and max values etc. :...
keyword[def] identifier[plot] ( identifier[data] , identifier[headers] = keyword[None] , identifier[pconfig] = keyword[None] ): literal[string] keyword[if] identifier[headers] keyword[is] keyword[None] : identifier[headers] =[] keyword[if] identifier[pconfig] keyword[is] keyword[None] :...
def plot(data, headers=None, pconfig=None): """ Helper HTML for a beeswarm plot. :param data: A list of data dicts :param headers: A list of Dicts / OrderedDicts with information for the series, such as colour scales, min and max values etc. :return: HTML string ...
def set_dial(self, json_value, index, timezone=None): """ :param json_value: The value to set :param index: The dials index :param timezone: The time zone to use for a time dial :return: """ values = self.json_state values["nonce"] = str(random.r...
def function[set_dial, parameter[self, json_value, index, timezone]]: constant[ :param json_value: The value to set :param index: The dials index :param timezone: The time zone to use for a time dial :return: ] variable[values] assign[=] name[self].json_state ...
keyword[def] identifier[set_dial] ( identifier[self] , identifier[json_value] , identifier[index] , identifier[timezone] = keyword[None] ): literal[string] identifier[values] = identifier[self] . identifier[json_state] identifier[values] [ literal[string] ]= identifier[str] ( identif...
def set_dial(self, json_value, index, timezone=None): """ :param json_value: The value to set :param index: The dials index :param timezone: The time zone to use for a time dial :return: """ values = self.json_state values['nonce'] = str(random.randint(0, 1000000000))...
def _m2crypto_validate(message, ssldir=None, **config): """ Return true or false if the message is signed appropriately. Four things must be true: 1) The X509 cert must be signed by our CA 2) The cert must not be in our CRL. 3) We must be able to verify the signature using the RSA public key...
def function[_m2crypto_validate, parameter[message, ssldir]]: constant[ Return true or false if the message is signed appropriately. Four things must be true: 1) The X509 cert must be signed by our CA 2) The cert must not be in our CRL. 3) We must be able to verify the signature using th...
keyword[def] identifier[_m2crypto_validate] ( identifier[message] , identifier[ssldir] = keyword[None] ,** identifier[config] ): literal[string] keyword[if] identifier[ssldir] keyword[is] keyword[None] : keyword[raise] identifier[ValueError] ( literal[string] ) keyword[def] identifier[...
def _m2crypto_validate(message, ssldir=None, **config): """ Return true or false if the message is signed appropriately. Four things must be true: 1) The X509 cert must be signed by our CA 2) The cert must not be in our CRL. 3) We must be able to verify the signature using the RSA public key...
def _float(self, string): """Convert string to float Take care of numbers in exponential format """ string = self._denoise(string) exp_match = re.match(r'^[-.\d]+x10-(\d)$', string) if exp_match: exp = int(exp_match.groups()[0]) fac = 10 ** -exp ...
def function[_float, parameter[self, string]]: constant[Convert string to float Take care of numbers in exponential format ] variable[string] assign[=] call[name[self]._denoise, parameter[name[string]]] variable[exp_match] assign[=] call[name[re].match, parameter[constant[^[-.\d...
keyword[def] identifier[_float] ( identifier[self] , identifier[string] ): literal[string] identifier[string] = identifier[self] . identifier[_denoise] ( identifier[string] ) identifier[exp_match] = identifier[re] . identifier[match] ( literal[string] , identifier[string] ) keywor...
def _float(self, string): """Convert string to float Take care of numbers in exponential format """ string = self._denoise(string) exp_match = re.match('^[-.\\d]+x10-(\\d)$', string) if exp_match: exp = int(exp_match.groups()[0]) fac = 10 ** (-exp) string = strin...
def _recomputeRecordFromKNN(self, record): """ returns the classified labeling of record """ inputs = { "categoryIn": [None], "bottomUpIn": self._getStateAnomalyVector(record), } outputs = {"categoriesOut": numpy.zeros((1,)), "bestPrototypeIndices":numpy.zeros((1,)), ...
def function[_recomputeRecordFromKNN, parameter[self, record]]: constant[ returns the classified labeling of record ] variable[inputs] assign[=] dictionary[[<ast.Constant object at 0x7da2047eb8e0>, <ast.Constant object at 0x7da2047ea560>], [<ast.List object at 0x7da2047e9f60>, <ast.Call object a...
keyword[def] identifier[_recomputeRecordFromKNN] ( identifier[self] , identifier[record] ): literal[string] identifier[inputs] ={ literal[string] :[ keyword[None] ], literal[string] : identifier[self] . identifier[_getStateAnomalyVector] ( identifier[record] ), } identifier[outputs] ={ ...
def _recomputeRecordFromKNN(self, record): """ returns the classified labeling of record """ inputs = {'categoryIn': [None], 'bottomUpIn': self._getStateAnomalyVector(record)} outputs = {'categoriesOut': numpy.zeros((1,)), 'bestPrototypeIndices': numpy.zeros((1,)), 'categoryProbabilitiesOut': numpy....
async def message_from_token(self, token: Text, payload: Any) \ -> Tuple[Optional[BaseMessage], Optional[Platform]]: """ Given an authentication token, find the right platform that can recognize this token and create a message for this platform. The payload will be inserted ...
<ast.AsyncFunctionDef object at 0x7da18ede7760>
keyword[async] keyword[def] identifier[message_from_token] ( identifier[self] , identifier[token] : identifier[Text] , identifier[payload] : identifier[Any] )-> identifier[Tuple] [ identifier[Optional] [ identifier[BaseMessage] ], identifier[Optional] [ identifier[Platform] ]]: literal[string] ke...
async def message_from_token(self, token: Text, payload: Any) -> Tuple[Optional[BaseMessage], Optional[Platform]]: """ Given an authentication token, find the right platform that can recognize this token and create a message for this platform. The payload will be inserted into a Postback la...
def delay(self, params, now=None): """Determine delay until next request.""" if now is None: now = time.time() # Initialize last... if not self.last: self.last = now elif now < self.last: now = self.last # How much has leaked out? ...
def function[delay, parameter[self, params, now]]: constant[Determine delay until next request.] if compare[name[now] is constant[None]] begin[:] variable[now] assign[=] call[name[time].time, parameter[]] if <ast.UnaryOp object at 0x7da2041daef0> begin[:] name[sel...
keyword[def] identifier[delay] ( identifier[self] , identifier[params] , identifier[now] = keyword[None] ): literal[string] keyword[if] identifier[now] keyword[is] keyword[None] : identifier[now] = identifier[time] . identifier[time] () keyword[if] keyword[n...
def delay(self, params, now=None): """Determine delay until next request.""" if now is None: now = time.time() # depends on [control=['if'], data=['now']] # Initialize last... if not self.last: self.last = now # depends on [control=['if'], data=[]] elif now < self.last: now...
def settargets(self): """Set the targets to be used in the analyses. Involves the path of the database files, the database files to use, and the level of classification for the analysis""" # Define the set targets call. Include the path to the script, the database path and files, as well ...
def function[settargets, parameter[self]]: constant[Set the targets to be used in the analyses. Involves the path of the database files, the database files to use, and the level of classification for the analysis] call[name[logging].info, parameter[constant[Setting up database]]] name[s...
keyword[def] identifier[settargets] ( identifier[self] ): literal[string] identifier[logging] . identifier[info] ( literal[string] ) identifier[self] . identifier[targetcall] = literal[string] . identifier[format] ( identifier[self] . identifier[clarkpath] , identifier[se...
def settargets(self): """Set the targets to be used in the analyses. Involves the path of the database files, the database files to use, and the level of classification for the analysis""" # Define the set targets call. Include the path to the script, the database path and files, as well # as the t...
def validate(self): """Validates the URL object. The URL object is invalid if it does not represent an absolute URL. Returns True or False based on this. """ if (self.scheme is None or self.scheme != '') \ and (self.host is None or self.host == ''): return False ...
def function[validate, parameter[self]]: constant[Validates the URL object. The URL object is invalid if it does not represent an absolute URL. Returns True or False based on this. ] if <ast.BoolOp object at 0x7da2054a6350> begin[:] return[constant[False]] return[constant[Tru...
keyword[def] identifier[validate] ( identifier[self] ): literal[string] keyword[if] ( identifier[self] . identifier[scheme] keyword[is] keyword[None] keyword[or] identifier[self] . identifier[scheme] != literal[string] ) keyword[and] ( identifier[self] . identifier[host] keyword[is] keyword[N...
def validate(self): """Validates the URL object. The URL object is invalid if it does not represent an absolute URL. Returns True or False based on this. """ if (self.scheme is None or self.scheme != '') and (self.host is None or self.host == ''): return False # depends on [control=['if...
def run(self): """ Run the pipeline queue. The pipeline queue will run forever. """ while True: self._event.clear() self._queue.get().run(self._event)
def function[run, parameter[self]]: constant[ Run the pipeline queue. The pipeline queue will run forever. ] while constant[True] begin[:] call[name[self]._event.clear, parameter[]] call[call[name[self]._queue.get, parameter[]].run, parameter[name[self]._...
keyword[def] identifier[run] ( identifier[self] ): literal[string] keyword[while] keyword[True] : identifier[self] . identifier[_event] . identifier[clear] () identifier[self] . identifier[_queue] . identifier[get] (). identifier[run] ( identifier[self] . identifier[_even...
def run(self): """ Run the pipeline queue. The pipeline queue will run forever. """ while True: self._event.clear() self._queue.get().run(self._event) # depends on [control=['while'], data=[]]
def kml_master(): """KML master document for loading all maps in Google Earth""" kml_doc = KMLMaster(app.config["url_formatter"], app.config["mapsources"].values()) return kml_response(kml_doc)
def function[kml_master, parameter[]]: constant[KML master document for loading all maps in Google Earth] variable[kml_doc] assign[=] call[name[KMLMaster], parameter[call[name[app].config][constant[url_formatter]], call[call[name[app].config][constant[mapsources]].values, parameter[]]]] return[call[...
keyword[def] identifier[kml_master] (): literal[string] identifier[kml_doc] = identifier[KMLMaster] ( identifier[app] . identifier[config] [ literal[string] ], identifier[app] . identifier[config] [ literal[string] ]. identifier[values] ()) keyword[return] identifier[kml_response] ( identifier[kml_do...
def kml_master(): """KML master document for loading all maps in Google Earth""" kml_doc = KMLMaster(app.config['url_formatter'], app.config['mapsources'].values()) return kml_response(kml_doc)
def from_esri_code(code): """ Load crs object from esri code, via spatialreference.org. Parses based on the proj4 representation. Arguments: - *code*: The ESRI code as an integer. Returns: - A CS instance of the indicated type. """ # must go online (or look up local table) to ge...
def function[from_esri_code, parameter[code]]: constant[ Load crs object from esri code, via spatialreference.org. Parses based on the proj4 representation. Arguments: - *code*: The ESRI code as an integer. Returns: - A CS instance of the indicated type. ] variable[code]...
keyword[def] identifier[from_esri_code] ( identifier[code] ): literal[string] identifier[code] = identifier[str] ( identifier[code] ) identifier[proj4] = identifier[utils] . identifier[crscode_to_string] ( literal[string] , identifier[code] , literal[string] ) identifier[crs] = identifier[fr...
def from_esri_code(code): """ Load crs object from esri code, via spatialreference.org. Parses based on the proj4 representation. Arguments: - *code*: The ESRI code as an integer. Returns: - A CS instance of the indicated type. """ # must go online (or look up local table) to ge...
def insert(self, index, filename): """Insert a new subclass with filename at index, mockup __module__.""" base = self._base dct = {'__module__': base.__module__, 'filename': filename, '_stack': self} cls = type(base.__name__, (base,), dct) self._map[cls.filename] = cls s...
def function[insert, parameter[self, index, filename]]: constant[Insert a new subclass with filename at index, mockup __module__.] variable[base] assign[=] name[self]._base variable[dct] assign[=] dictionary[[<ast.Constant object at 0x7da20cabf910>, <ast.Constant object at 0x7da20cabfb20>, <ast....
keyword[def] identifier[insert] ( identifier[self] , identifier[index] , identifier[filename] ): literal[string] identifier[base] = identifier[self] . identifier[_base] identifier[dct] ={ literal[string] : identifier[base] . identifier[__module__] , literal[string] : identifier[filename] ...
def insert(self, index, filename): """Insert a new subclass with filename at index, mockup __module__.""" base = self._base dct = {'__module__': base.__module__, 'filename': filename, '_stack': self} cls = type(base.__name__, (base,), dct) self._map[cls.filename] = cls self._classes.insert(index...
def tau0_from_mtotal_eta(mtotal, eta, f_lower): r"""Returns :math:`\tau_0` from the total mass, symmetric mass ratio, and the given frequency. """ # convert to seconds mtotal = mtotal * lal.MTSUN_SI # formulae from arxiv.org:0706.4437 return _a0(f_lower) / (mtotal**(5./3.) * eta)
def function[tau0_from_mtotal_eta, parameter[mtotal, eta, f_lower]]: constant[Returns :math:`\tau_0` from the total mass, symmetric mass ratio, and the given frequency. ] variable[mtotal] assign[=] binary_operation[name[mtotal] * name[lal].MTSUN_SI] return[binary_operation[call[name[_a0], pa...
keyword[def] identifier[tau0_from_mtotal_eta] ( identifier[mtotal] , identifier[eta] , identifier[f_lower] ): literal[string] identifier[mtotal] = identifier[mtotal] * identifier[lal] . identifier[MTSUN_SI] keyword[return] identifier[_a0] ( identifier[f_lower] )/( identifier[mtotal] **( li...
def tau0_from_mtotal_eta(mtotal, eta, f_lower): """Returns :math:`\\tau_0` from the total mass, symmetric mass ratio, and the given frequency. """ # convert to seconds mtotal = mtotal * lal.MTSUN_SI # formulae from arxiv.org:0706.4437 return _a0(f_lower) / (mtotal ** (5.0 / 3.0) * eta)