code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def call_heat(tstat): """ Adjusts the temperature setpoints in order to call for heating. Returns a handler to call when you want to reset the thermostat """ current_hsp, current_csp = tstat.heating_setpoint, tstat.cooling_setpoint current_temp = tstat.temperature tstat.write({ 'heat...
def function[call_heat, parameter[tstat]]: constant[ Adjusts the temperature setpoints in order to call for heating. Returns a handler to call when you want to reset the thermostat ] <ast.Tuple object at 0x7da18fe93df0> assign[=] tuple[[<ast.Attribute object at 0x7da20cabd6c0>, <ast.Attribut...
keyword[def] identifier[call_heat] ( identifier[tstat] ): literal[string] identifier[current_hsp] , identifier[current_csp] = identifier[tstat] . identifier[heating_setpoint] , identifier[tstat] . identifier[cooling_setpoint] identifier[current_temp] = identifier[tstat] . identifier[temperature] ...
def call_heat(tstat): """ Adjusts the temperature setpoints in order to call for heating. Returns a handler to call when you want to reset the thermostat """ (current_hsp, current_csp) = (tstat.heating_setpoint, tstat.cooling_setpoint) current_temp = tstat.temperature tstat.write({'heating_s...
def _report_exc_info(exc_info, request, extra_data, payload_data, level=None): """ Called by report_exc_info() wrapper """ if not _check_config(): return filtered_level = _filtered_level(exc_info[1]) if level is None: level = filtered_level filtered_exc_info = events.on_ex...
def function[_report_exc_info, parameter[exc_info, request, extra_data, payload_data, level]]: constant[ Called by report_exc_info() wrapper ] if <ast.UnaryOp object at 0x7da1b0297220> begin[:] return[None] variable[filtered_level] assign[=] call[name[_filtered_level], parameter[...
keyword[def] identifier[_report_exc_info] ( identifier[exc_info] , identifier[request] , identifier[extra_data] , identifier[payload_data] , identifier[level] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[_check_config] (): keyword[return] identifier[filtered_lev...
def _report_exc_info(exc_info, request, extra_data, payload_data, level=None): """ Called by report_exc_info() wrapper """ if not _check_config(): return # depends on [control=['if'], data=[]] filtered_level = _filtered_level(exc_info[1]) if level is None: level = filtered_level...
def isempty(self, tables=None): """ Return whether a table or the entire database is empty. A database is empty is if it has no tables. A table is empty if it has no rows. Arguments: tables (sequence of str, optional): If provided, check that the name...
def function[isempty, parameter[self, tables]]: constant[ Return whether a table or the entire database is empty. A database is empty is if it has no tables. A table is empty if it has no rows. Arguments: tables (sequence of str, optional): If provided, check ...
keyword[def] identifier[isempty] ( identifier[self] , identifier[tables] = keyword[None] ): literal[string] identifier[tables] = identifier[tables] keyword[or] identifier[self] . identifier[tables] keyword[for] identifier[table] keyword[in] identifier[tables] : keyword[...
def isempty(self, tables=None): """ Return whether a table or the entire database is empty. A database is empty is if it has no tables. A table is empty if it has no rows. Arguments: tables (sequence of str, optional): If provided, check that the named ta...
def create(context, name, team_id, data, active): """create(context, name, team_id, data, active) Create a Remote CI >>> dcictl remoteci-create [OPTIONS] :param string name: Name of the Remote CI [required] :param string team_id: ID of the team to associate this remote CI with [required] ...
def function[create, parameter[context, name, team_id, data, active]]: constant[create(context, name, team_id, data, active) Create a Remote CI >>> dcictl remoteci-create [OPTIONS] :param string name: Name of the Remote CI [required] :param string team_id: ID of the team to associate this rem...
keyword[def] identifier[create] ( identifier[context] , identifier[name] , identifier[team_id] , identifier[data] , identifier[active] ): literal[string] identifier[state] = identifier[utils] . identifier[active_string] ( identifier[active] ) identifier[team_id] = identifier[team_id] keyword[or] id...
def create(context, name, team_id, data, active): """create(context, name, team_id, data, active) Create a Remote CI >>> dcictl remoteci-create [OPTIONS] :param string name: Name of the Remote CI [required] :param string team_id: ID of the team to associate this remote CI with [required] ...
def get(self, start, end): """ used in unittests """ return [self.read_byte(addr) for addr in range(start, end)]
def function[get, parameter[self, start, end]]: constant[ used in unittests ] return[<ast.ListComp object at 0x7da1b255d600>]
keyword[def] identifier[get] ( identifier[self] , identifier[start] , identifier[end] ): literal[string] keyword[return] [ identifier[self] . identifier[read_byte] ( identifier[addr] ) keyword[for] identifier[addr] keyword[in] identifier[range] ( identifier[start] , identifier[end] )]
def get(self, start, end): """ used in unittests """ return [self.read_byte(addr) for addr in range(start, end)]
def mexican(lb, ub, n): r"""Generate the mexican hat wavelet The Mexican wavelet is: .. math:: w[x] = \cos{5x} \exp^{-x^2/2} :param lb: lower bound :param ub: upper bound :param int n: waveform data samples :return: the waveform .. plot:: :include-source: :width: 80%...
def function[mexican, parameter[lb, ub, n]]: constant[Generate the mexican hat wavelet The Mexican wavelet is: .. math:: w[x] = \cos{5x} \exp^{-x^2/2} :param lb: lower bound :param ub: upper bound :param int n: waveform data samples :return: the waveform .. plot:: :inclu...
keyword[def] identifier[mexican] ( identifier[lb] , identifier[ub] , identifier[n] ): literal[string] keyword[if] identifier[n] <= literal[int] : keyword[raise] identifier[ValueError] ( literal[string] ) identifier[x] = identifier[numpy] . identifier[linspace] ( identifier[lb] , identifier...
def mexican(lb, ub, n): """Generate the mexican hat wavelet The Mexican wavelet is: .. math:: w[x] = \\cos{5x} \\exp^{-x^2/2} :param lb: lower bound :param ub: upper bound :param int n: waveform data samples :return: the waveform .. plot:: :include-source: :width: 80...
def filter_batched_data(data, mapping): """ Iterates over the data and mapping for a ColumnDataSource and replaces columns with repeating values with a scalar. This is purely and optimization for scalar types. """ for k, v in list(mapping.items()): if isinstance(v, dict) and 'field' in v...
def function[filter_batched_data, parameter[data, mapping]]: constant[ Iterates over the data and mapping for a ColumnDataSource and replaces columns with repeating values with a scalar. This is purely and optimization for scalar types. ] for taget[tuple[[<ast.Name object at 0x7da1b1c8b0...
keyword[def] identifier[filter_batched_data] ( identifier[data] , identifier[mapping] ): literal[string] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[list] ( identifier[mapping] . identifier[items] ()): keyword[if] identifier[isinstance] ( identifier[v] , identifier[dict] ...
def filter_batched_data(data, mapping): """ Iterates over the data and mapping for a ColumnDataSource and replaces columns with repeating values with a scalar. This is purely and optimization for scalar types. """ for (k, v) in list(mapping.items()): if isinstance(v, dict) and 'field' in...
async def create_room(self, alias: Optional[str] = None, is_public: bool = False, name: Optional[str] = None, topic: Optional[str] = None, is_direct: bool = False, invitees: Optional[List[str]] = None, initial_state: Optional[List[dict]] = No...
<ast.AsyncFunctionDef object at 0x7da20e9b19c0>
keyword[async] keyword[def] identifier[create_room] ( identifier[self] , identifier[alias] : identifier[Optional] [ identifier[str] ]= keyword[None] , identifier[is_public] : identifier[bool] = keyword[False] , identifier[name] : identifier[Optional] [ identifier[str] ]= keyword[None] , identifier[topic] : identifi...
async def create_room(self, alias: Optional[str]=None, is_public: bool=False, name: Optional[str]=None, topic: Optional[str]=None, is_direct: bool=False, invitees: Optional[List[str]]=None, initial_state: Optional[List[dict]]=None) -> str: """ Create a new room. See also: `API reference`_ Args: ...
def loadable(self, src, dst): """ Determines if there's enough space to load the target database. """ from fabric import state from fabric.task_utils import crawl src_task = crawl(src, state.commands) assert src_task, 'Unknown source role: %s' % src dst_...
def function[loadable, parameter[self, src, dst]]: constant[ Determines if there's enough space to load the target database. ] from relative_module[fabric] import module[state] from relative_module[fabric.task_utils] import module[crawl] variable[src_task] assign[=] call[name[cra...
keyword[def] identifier[loadable] ( identifier[self] , identifier[src] , identifier[dst] ): literal[string] keyword[from] identifier[fabric] keyword[import] identifier[state] keyword[from] identifier[fabric] . identifier[task_utils] keyword[import] identifier[crawl] ident...
def loadable(self, src, dst): """ Determines if there's enough space to load the target database. """ from fabric import state from fabric.task_utils import crawl src_task = crawl(src, state.commands) assert src_task, 'Unknown source role: %s' % src dst_task = crawl(dst, state.co...
def _get_ignore_from_manifest(filename): """Gather the various ignore patterns from a MANIFEST.in. Returns a list of standard ignore patterns and a list of regular expressions to ignore. """ class MyTextFile(TextFile): def error(self, msg, line=None): # pragma: nocover # (this...
def function[_get_ignore_from_manifest, parameter[filename]]: constant[Gather the various ignore patterns from a MANIFEST.in. Returns a list of standard ignore patterns and a list of regular expressions to ignore. ] class class[MyTextFile, parameter[]] begin[:] def function[...
keyword[def] identifier[_get_ignore_from_manifest] ( identifier[filename] ): literal[string] keyword[class] identifier[MyTextFile] ( identifier[TextFile] ): keyword[def] identifier[error] ( identifier[self] , identifier[msg] , identifier[line] = keyword[None] ): keyword[ra...
def _get_ignore_from_manifest(filename): """Gather the various ignore patterns from a MANIFEST.in. Returns a list of standard ignore patterns and a list of regular expressions to ignore. """ class MyTextFile(TextFile): def error(self, msg, line=None): # pragma: nocover # (thi...
def create_alias(self, userid, data): """Create alias address""" return self.api_call( ENDPOINTS['aliases']['new'], dict(userid=userid), body=data)
def function[create_alias, parameter[self, userid, data]]: constant[Create alias address] return[call[name[self].api_call, parameter[call[call[name[ENDPOINTS]][constant[aliases]]][constant[new]], call[name[dict], parameter[]]]]]
keyword[def] identifier[create_alias] ( identifier[self] , identifier[userid] , identifier[data] ): literal[string] keyword[return] identifier[self] . identifier[api_call] ( identifier[ENDPOINTS] [ literal[string] ][ literal[string] ], identifier[dict] ( identifier[userid] = iden...
def create_alias(self, userid, data): """Create alias address""" return self.api_call(ENDPOINTS['aliases']['new'], dict(userid=userid), body=data)
def load_plugin(): """Adds EV3 buttons on toolbar and commands under Run and Tools menu. Add EV3 configuration window.""" # Add EV3 configuration window workbench=get_workbench() workbench.set_default("ev3.ip", "192.168.0.1") workbench.set_default("ev3.username", "robot") workbench.set_default(...
def function[load_plugin, parameter[]]: constant[Adds EV3 buttons on toolbar and commands under Run and Tools menu. Add EV3 configuration window.] variable[workbench] assign[=] call[name[get_workbench], parameter[]] call[name[workbench].set_default, parameter[constant[ev3.ip], constant[192.168.0...
keyword[def] identifier[load_plugin] (): literal[string] identifier[workbench] = identifier[get_workbench] () identifier[workbench] . identifier[set_default] ( literal[string] , literal[string] ) identifier[workbench] . identifier[set_default] ( literal[string] , literal[string] ) iden...
def load_plugin(): """Adds EV3 buttons on toolbar and commands under Run and Tools menu. Add EV3 configuration window.""" # Add EV3 configuration window workbench = get_workbench() workbench.set_default('ev3.ip', '192.168.0.1') workbench.set_default('ev3.username', 'robot') workbench.set_default...
def parse_logs(log_list, date, machine_name, log_type): """ Parse log file lines in log_type format. """ output = [] count = fail = skip = updated = 0 # Check things are setup correctly try: machine = Machine.objects.get(name=machine_name) except Machine.DoesNotExist: re...
def function[parse_logs, parameter[log_list, date, machine_name, log_type]]: constant[ Parse log file lines in log_type format. ] variable[output] assign[=] list[[]] variable[count] assign[=] constant[0] <ast.Try object at 0x7da20c795660> if compare[name[log_type] equal[==] c...
keyword[def] identifier[parse_logs] ( identifier[log_list] , identifier[date] , identifier[machine_name] , identifier[log_type] ): literal[string] identifier[output] =[] identifier[count] = identifier[fail] = identifier[skip] = identifier[updated] = literal[int] keyword[try] : ide...
def parse_logs(log_list, date, machine_name, log_type): """ Parse log file lines in log_type format. """ output = [] count = fail = skip = updated = 0 # Check things are setup correctly try: machine = Machine.objects.get(name=machine_name) # depends on [control=['try'], data=[]] ...
def from_csv(cls, path, folder, csv_fname, bs=64, tfms=(None,None), val_idxs=None, suffix='', test_name=None, continuous=False, skip_header=True, num_workers=8, cat_separator=' '): """ Read in images and their labels given as a CSV file. This method should be used when training image lab...
def function[from_csv, parameter[cls, path, folder, csv_fname, bs, tfms, val_idxs, suffix, test_name, continuous, skip_header, num_workers, cat_separator]]: constant[ Read in images and their labels given as a CSV file. This method should be used when training image labels are given in an CSV file as o...
keyword[def] identifier[from_csv] ( identifier[cls] , identifier[path] , identifier[folder] , identifier[csv_fname] , identifier[bs] = literal[int] , identifier[tfms] =( keyword[None] , keyword[None] ), identifier[val_idxs] = keyword[None] , identifier[suffix] = literal[string] , identifier[test_name] = keyword[None...
def from_csv(cls, path, folder, csv_fname, bs=64, tfms=(None, None), val_idxs=None, suffix='', test_name=None, continuous=False, skip_header=True, num_workers=8, cat_separator=' '): """ Read in images and their labels given as a CSV file. This method should be used when training image labels are given in a...
def _render_dendrogram(dnd, ax, displacement): '''Renders dendrogram''' # set of unique colors that reflect the set of types of the neurites colors = set() for n, (indices, ctype) in enumerate(zip(dnd.groups, dnd.types)): # slice rectangles array for the current neurite group = dnd.dat...
def function[_render_dendrogram, parameter[dnd, ax, displacement]]: constant[Renders dendrogram] variable[colors] assign[=] call[name[set], parameter[]] for taget[tuple[[<ast.Name object at 0x7da18fe93c40>, <ast.Tuple object at 0x7da18fe93fa0>]]] in starred[call[name[enumerate], parameter[call[n...
keyword[def] identifier[_render_dendrogram] ( identifier[dnd] , identifier[ax] , identifier[displacement] ): literal[string] identifier[colors] = identifier[set] () keyword[for] identifier[n] ,( identifier[indices] , identifier[ctype] ) keyword[in] identifier[enumerate] ( identifier[zip] ( ide...
def _render_dendrogram(dnd, ax, displacement): """Renders dendrogram""" # set of unique colors that reflect the set of types of the neurites colors = set() for (n, (indices, ctype)) in enumerate(zip(dnd.groups, dnd.types)): # slice rectangles array for the current neurite group = dnd.dat...
def clean(self, value): """Cleans and returns the given value, or raises a ParameterNotValidError exception""" if isinstance(value, numbers.Number): return value elif isinstance(value, six.string_types): try: value = float(value) return in...
def function[clean, parameter[self, value]]: constant[Cleans and returns the given value, or raises a ParameterNotValidError exception] if call[name[isinstance], parameter[name[value], name[numbers].Number]] begin[:] return[name[value]] <ast.Raise object at 0x7da2054a73a0>
keyword[def] identifier[clean] ( identifier[self] , identifier[value] ): literal[string] keyword[if] identifier[isinstance] ( identifier[value] , identifier[numbers] . identifier[Number] ): keyword[return] identifier[value] keyword[elif] identifier[isinstance] ( identifie...
def clean(self, value): """Cleans and returns the given value, or raises a ParameterNotValidError exception""" if isinstance(value, numbers.Number): return value # depends on [control=['if'], data=[]] elif isinstance(value, six.string_types): try: value = float(value) ...
def get_rec_column_descr(self, colnum, vstorage): """ Get a descriptor entry for the specified column. parameters ---------- colnum: integer The column number, 0 offset vstorage: string See docs in read_columns """ npy_type, isvar,...
def function[get_rec_column_descr, parameter[self, colnum, vstorage]]: constant[ Get a descriptor entry for the specified column. parameters ---------- colnum: integer The column number, 0 offset vstorage: string See docs in read_columns ]...
keyword[def] identifier[get_rec_column_descr] ( identifier[self] , identifier[colnum] , identifier[vstorage] ): literal[string] identifier[npy_type] , identifier[isvar] , identifier[istbit] = identifier[self] . identifier[_get_tbl_numpy_dtype] ( identifier[colnum] ) identifier[name] = iden...
def get_rec_column_descr(self, colnum, vstorage): """ Get a descriptor entry for the specified column. parameters ---------- colnum: integer The column number, 0 offset vstorage: string See docs in read_columns """ (npy_type, isvar, istbit...
def mdprint(*values, plain=None, **options): """ Convert HTML to VTML and then print it. Follows same semantics as vtmlprint. """ print(*[mdrender(x, plain=plain) for x in values], **options)
def function[mdprint, parameter[]]: constant[ Convert HTML to VTML and then print it. Follows same semantics as vtmlprint. ] call[name[print], parameter[<ast.Starred object at 0x7da1b143f5e0>]]
keyword[def] identifier[mdprint] (* identifier[values] , identifier[plain] = keyword[None] ,** identifier[options] ): literal[string] identifier[print] (*[ identifier[mdrender] ( identifier[x] , identifier[plain] = identifier[plain] ) keyword[for] identifier[x] keyword[in] identifier[values] ],** identi...
def mdprint(*values, plain=None, **options): """ Convert HTML to VTML and then print it. Follows same semantics as vtmlprint. """ print(*[mdrender(x, plain=plain) for x in values], **options)
def take_home_pay(gross_pay, employer_match, taxes_and_fees, numtype='float'): """ Calculate net take-home pay including employer retirement savings match using the formula laid out by Mr. Money Mustache: http://www.mrmoneymustache.com/2015/01/26/calculating-net-worth/ Args: gross_pay: floa...
def function[take_home_pay, parameter[gross_pay, employer_match, taxes_and_fees, numtype]]: constant[ Calculate net take-home pay including employer retirement savings match using the formula laid out by Mr. Money Mustache: http://www.mrmoneymustache.com/2015/01/26/calculating-net-worth/ Args: ...
keyword[def] identifier[take_home_pay] ( identifier[gross_pay] , identifier[employer_match] , identifier[taxes_and_fees] , identifier[numtype] = literal[string] ): literal[string] keyword[if] identifier[numtype] == literal[string] : keyword[return] ( identifier[Decimal] ( identifier[gross_pay] )+...
def take_home_pay(gross_pay, employer_match, taxes_and_fees, numtype='float'): """ Calculate net take-home pay including employer retirement savings match using the formula laid out by Mr. Money Mustache: http://www.mrmoneymustache.com/2015/01/26/calculating-net-worth/ Args: gross_pay: floa...
def parse_chars(bels: list, errors: Errors) -> Tuple[CharLocs, Errors]: """Scan BEL string to map parens, quotes, commas Args: bels: bel string as an array of characters errors: list of error tuples ('<type>', '<msg>') Returns: (char_locs, errors): character locations and errors ...
def function[parse_chars, parameter[bels, errors]]: constant[Scan BEL string to map parens, quotes, commas Args: bels: bel string as an array of characters errors: list of error tuples ('<type>', '<msg>') Returns: (char_locs, errors): character locations and errors ] ...
keyword[def] identifier[parse_chars] ( identifier[bels] : identifier[list] , identifier[errors] : identifier[Errors] )-> identifier[Tuple] [ identifier[CharLocs] , identifier[Errors] ]: literal[string] identifier[pstack] , identifier[qstack] , identifier[nested_pstack] =[],[],[] identifier[parens] , i...
def parse_chars(bels: list, errors: Errors) -> Tuple[CharLocs, Errors]: """Scan BEL string to map parens, quotes, commas Args: bels: bel string as an array of characters errors: list of error tuples ('<type>', '<msg>') Returns: (char_locs, errors): character locations and errors ...
def get_wrapped_instance(self, instance=None): """Returns a wrapped model instance. """ if instance._meta.label_lower not in self.registry: raise ModelNotRegistered(f"{repr(instance)} is not registered with {self}.") wrapper_cls = self.registry.get(instance._meta.label_lower)...
def function[get_wrapped_instance, parameter[self, instance]]: constant[Returns a wrapped model instance. ] if compare[name[instance]._meta.label_lower <ast.NotIn object at 0x7da2590d7190> name[self].registry] begin[:] <ast.Raise object at 0x7da2054a41c0> variable[wrapper_cls] as...
keyword[def] identifier[get_wrapped_instance] ( identifier[self] , identifier[instance] = keyword[None] ): literal[string] keyword[if] identifier[instance] . identifier[_meta] . identifier[label_lower] keyword[not] keyword[in] identifier[self] . identifier[registry] : keyword[raise...
def get_wrapped_instance(self, instance=None): """Returns a wrapped model instance. """ if instance._meta.label_lower not in self.registry: raise ModelNotRegistered(f'{repr(instance)} is not registered with {self}.') # depends on [control=['if'], data=[]] wrapper_cls = self.registry.get(ins...
def clear(self): """ Clear screen and go to 0,0 """ # Erase current output first. self.erase() # Send "Erase Screen" command and go to (0, 0). output = self.output output.erase_screen() output.cursor_goto(0, 0) output.flush() sel...
def function[clear, parameter[self]]: constant[ Clear screen and go to 0,0 ] call[name[self].erase, parameter[]] variable[output] assign[=] name[self].output call[name[output].erase_screen, parameter[]] call[name[output].cursor_goto, parameter[constant[0], constan...
keyword[def] identifier[clear] ( identifier[self] ): literal[string] identifier[self] . identifier[erase] () identifier[output] = identifier[self] . identifier[output] identifier[output] . identifier[erase_screen] () identifier[output] . identifier[cu...
def clear(self): """ Clear screen and go to 0,0 """ # Erase current output first. self.erase() # Send "Erase Screen" command and go to (0, 0). output = self.output output.erase_screen() output.cursor_goto(0, 0) output.flush() self.request_absolute_cursor_position()
def makeQ(r1, r2, r3, r4=0): """ matrix involved in quaternion rotation """ Q = np.asarray([ [r4, -r3, r2, r1], [r3, r4, -r1, r2], [-r2, r1, r4, r3], [-r1, -r2, -r3, r4]]) return Q
def function[makeQ, parameter[r1, r2, r3, r4]]: constant[ matrix involved in quaternion rotation ] variable[Q] assign[=] call[name[np].asarray, parameter[list[[<ast.List object at 0x7da1b0721f00>, <ast.List object at 0x7da1b0720be0>, <ast.List object at 0x7da1b0720970>, <ast.List object at 0x7da...
keyword[def] identifier[makeQ] ( identifier[r1] , identifier[r2] , identifier[r3] , identifier[r4] = literal[int] ): literal[string] identifier[Q] = identifier[np] . identifier[asarray] ([ [ identifier[r4] ,- identifier[r3] , identifier[r2] , identifier[r1] ], [ identifier[r3] , identifier[r4] ,- i...
def makeQ(r1, r2, r3, r4=0): """ matrix involved in quaternion rotation """ Q = np.asarray([[r4, -r3, r2, r1], [r3, r4, -r1, r2], [-r2, r1, r4, r3], [-r1, -r2, -r3, r4]]) return Q
def manage(group_id): """Manage your group.""" group = Group.query.get_or_404(group_id) form = GroupForm(request.form, obj=group) if form.validate_on_submit(): if group.can_edit(current_user): try: group.update(**form.data) flash(_('Group "%(name)s" w...
def function[manage, parameter[group_id]]: constant[Manage your group.] variable[group] assign[=] call[name[Group].query.get_or_404, parameter[name[group_id]]] variable[form] assign[=] call[name[GroupForm], parameter[name[request].form]] if call[name[form].validate_on_submit, parameter[]...
keyword[def] identifier[manage] ( identifier[group_id] ): literal[string] identifier[group] = identifier[Group] . identifier[query] . identifier[get_or_404] ( identifier[group_id] ) identifier[form] = identifier[GroupForm] ( identifier[request] . identifier[form] , identifier[obj] = identifier[group] ...
def manage(group_id): """Manage your group.""" group = Group.query.get_or_404(group_id) form = GroupForm(request.form, obj=group) if form.validate_on_submit(): if group.can_edit(current_user): try: group.update(**form.data) flash(_('Group "%(name)s" wa...
def ret_glob_minions(self): ''' Return minions that match via glob ''' fnfilter = functools.partial(fnmatch.filter, pat=self.tgt) return self._ret_minions(fnfilter)
def function[ret_glob_minions, parameter[self]]: constant[ Return minions that match via glob ] variable[fnfilter] assign[=] call[name[functools].partial, parameter[name[fnmatch].filter]] return[call[name[self]._ret_minions, parameter[name[fnfilter]]]]
keyword[def] identifier[ret_glob_minions] ( identifier[self] ): literal[string] identifier[fnfilter] = identifier[functools] . identifier[partial] ( identifier[fnmatch] . identifier[filter] , identifier[pat] = identifier[self] . identifier[tgt] ) keyword[return] identifier[self] . identif...
def ret_glob_minions(self): """ Return minions that match via glob """ fnfilter = functools.partial(fnmatch.filter, pat=self.tgt) return self._ret_minions(fnfilter)
def get(self, request, *args, **kwargs): """Override default get function to use token if there is one to retrieve object. If a subclass should use their own GET implementation, token_from_kwargs should be called if that detail view should be accessible via token.""" self.object = self....
def function[get, parameter[self, request]]: constant[Override default get function to use token if there is one to retrieve object. If a subclass should use their own GET implementation, token_from_kwargs should be called if that detail view should be accessible via token.] name[self].o...
keyword[def] identifier[get] ( identifier[self] , identifier[request] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[self] . identifier[object] = identifier[self] . identifier[get_object] () identifier[allow_anonymous] = identifier[kwargs] . identifier[get] ( li...
def get(self, request, *args, **kwargs): """Override default get function to use token if there is one to retrieve object. If a subclass should use their own GET implementation, token_from_kwargs should be called if that detail view should be accessible via token.""" self.object = self.get_objec...
def encode_metadata_request(cls, topics=(), payloads=None): """ Encode a MetadataRequest Arguments: topics: list of strings """ if payloads is not None: topics = payloads return kafka.protocol.metadata.MetadataRequest[0](topics)
def function[encode_metadata_request, parameter[cls, topics, payloads]]: constant[ Encode a MetadataRequest Arguments: topics: list of strings ] if compare[name[payloads] is_not constant[None]] begin[:] variable[topics] assign[=] name[payloads] re...
keyword[def] identifier[encode_metadata_request] ( identifier[cls] , identifier[topics] =(), identifier[payloads] = keyword[None] ): literal[string] keyword[if] identifier[payloads] keyword[is] keyword[not] keyword[None] : identifier[topics] = identifier[payloads] keywor...
def encode_metadata_request(cls, topics=(), payloads=None): """ Encode a MetadataRequest Arguments: topics: list of strings """ if payloads is not None: topics = payloads # depends on [control=['if'], data=['payloads']] return kafka.protocol.metadata.MetadataReq...
def froze_it(cls): """ Decorator to prevent from creating attributes in the object ouside __init__(). This decorator must be applied to the final class (doesn't work if a decorated class is inherited). Yoann's answer at http://stackoverflow.com/questions/3603502 """ cls._frozen = ...
def function[froze_it, parameter[cls]]: constant[ Decorator to prevent from creating attributes in the object ouside __init__(). This decorator must be applied to the final class (doesn't work if a decorated class is inherited). Yoann's answer at http://stackoverflow.com/questions/3603502 ...
keyword[def] identifier[froze_it] ( identifier[cls] ): literal[string] identifier[cls] . identifier[_frozen] = keyword[False] keyword[def] identifier[frozensetattr] ( identifier[self] , identifier[key] , identifier[value] ): keyword[if] identifier[self] . identifier[_frozen] keyword...
def froze_it(cls): """ Decorator to prevent from creating attributes in the object ouside __init__(). This decorator must be applied to the final class (doesn't work if a decorated class is inherited). Yoann's answer at http://stackoverflow.com/questions/3603502 """ cls._frozen = False ...
def API520_W(Pset, Pback): r'''Calculates capacity correction due to backpressure on balanced spring-loaded PRVs in liquid service. For pilot operated valves, this is always 1. Applicable up to 50% of the percent gauge backpressure, For use in API 520 relief valve sizing. 1D interpolation among a table ...
def function[API520_W, parameter[Pset, Pback]]: constant[Calculates capacity correction due to backpressure on balanced spring-loaded PRVs in liquid service. For pilot operated valves, this is always 1. Applicable up to 50% of the percent gauge backpressure, For use in API 520 relief valve sizing. 1...
keyword[def] identifier[API520_W] ( identifier[Pset] , identifier[Pback] ): literal[string] identifier[gauge_backpressure] =( identifier[Pback] - identifier[atm] )/( identifier[Pset] - identifier[atm] )* literal[int] keyword[if] identifier[gauge_backpressure] < literal[int] : keyword[return...
def API520_W(Pset, Pback): """Calculates capacity correction due to backpressure on balanced spring-loaded PRVs in liquid service. For pilot operated valves, this is always 1. Applicable up to 50% of the percent gauge backpressure, For use in API 520 relief valve sizing. 1D interpolation among a table w...
def fitlin(imgarr,refarr): """ Compute the least-squares fit between two arrays. A Python translation of 'FITLIN' from 'drutil.f' (Drizzle V2.9). """ # Initialize variables _mat = np.zeros((3,3),dtype=np.float64) _xorg = imgarr[0][0] _yorg = imgarr[0][1] _xoorg = refarr[0][0] _yo...
def function[fitlin, parameter[imgarr, refarr]]: constant[ Compute the least-squares fit between two arrays. A Python translation of 'FITLIN' from 'drutil.f' (Drizzle V2.9). ] variable[_mat] assign[=] call[name[np].zeros, parameter[tuple[[<ast.Constant object at 0x7da1b1bcbd90>, <ast.Constan...
keyword[def] identifier[fitlin] ( identifier[imgarr] , identifier[refarr] ): literal[string] identifier[_mat] = identifier[np] . identifier[zeros] (( literal[int] , literal[int] ), identifier[dtype] = identifier[np] . identifier[float64] ) identifier[_xorg] = identifier[imgarr] [ literal[int] ][ ...
def fitlin(imgarr, refarr): """ Compute the least-squares fit between two arrays. A Python translation of 'FITLIN' from 'drutil.f' (Drizzle V2.9). """ # Initialize variables _mat = np.zeros((3, 3), dtype=np.float64) _xorg = imgarr[0][0] _yorg = imgarr[0][1] _xoorg = refarr[0][0] ...
def get_default_config_help(self): """ Return help text for collector configuration. """ config_help = super(MemoryLxcCollector, self).get_default_config_help() config_help.update({ "sys_path": "Defaults to '/sys/fs/cgroup/lxc'", }) return config_help
def function[get_default_config_help, parameter[self]]: constant[ Return help text for collector configuration. ] variable[config_help] assign[=] call[call[name[super], parameter[name[MemoryLxcCollector], name[self]]].get_default_config_help, parameter[]] call[name[config_help].u...
keyword[def] identifier[get_default_config_help] ( identifier[self] ): literal[string] identifier[config_help] = identifier[super] ( identifier[MemoryLxcCollector] , identifier[self] ). identifier[get_default_config_help] () identifier[config_help] . identifier[update] ({ literal[...
def get_default_config_help(self): """ Return help text for collector configuration. """ config_help = super(MemoryLxcCollector, self).get_default_config_help() config_help.update({'sys_path': "Defaults to '/sys/fs/cgroup/lxc'"}) return config_help
def parse_xhtml_reaction_notes(entry): """Return reaction properties defined in the XHTML notes. Older SBML models often define additional properties in the XHTML notes section because structured methods for defining properties had not been developed. This will try to parse the following properties: ``...
def function[parse_xhtml_reaction_notes, parameter[entry]]: constant[Return reaction properties defined in the XHTML notes. Older SBML models often define additional properties in the XHTML notes section because structured methods for defining properties had not been developed. This will try to par...
keyword[def] identifier[parse_xhtml_reaction_notes] ( identifier[entry] ): literal[string] identifier[properties] ={} keyword[if] identifier[entry] . identifier[xml_notes] keyword[is] keyword[not] keyword[None] : identifier[cobra_notes] = identifier[dict] ( identifier[parse_xhtml_notes] (...
def parse_xhtml_reaction_notes(entry): """Return reaction properties defined in the XHTML notes. Older SBML models often define additional properties in the XHTML notes section because structured methods for defining properties had not been developed. This will try to parse the following properties: ``...
def setActionManifestPath(self, pchActionManifestPath): """ Sets the path to the action manifest JSON file that is used by this application. If this information was set on the Steam partner site, calls to this function are ignored. If the Steam partner site setting and the path provided ...
def function[setActionManifestPath, parameter[self, pchActionManifestPath]]: constant[ Sets the path to the action manifest JSON file that is used by this application. If this information was set on the Steam partner site, calls to this function are ignored. If the Steam partner site set...
keyword[def] identifier[setActionManifestPath] ( identifier[self] , identifier[pchActionManifestPath] ): literal[string] identifier[fn] = identifier[self] . identifier[function_table] . identifier[setActionManifestPath] identifier[result] = identifier[fn] ( identifier[pchActionManifestPa...
def setActionManifestPath(self, pchActionManifestPath): """ Sets the path to the action manifest JSON file that is used by this application. If this information was set on the Steam partner site, calls to this function are ignored. If the Steam partner site setting and the path provided by t...
def valid_hotp(self, code, last=0, trials=100): """Valid a HOTP code. :param code: A number that is less than 6 characters. :param last: Guess HOTP code from last + 1 range. :param trials: Guest HOTP code end at last + trials + 1. """ if not valid_code(code): ...
def function[valid_hotp, parameter[self, code, last, trials]]: constant[Valid a HOTP code. :param code: A number that is less than 6 characters. :param last: Guess HOTP code from last + 1 range. :param trials: Guest HOTP code end at last + trials + 1. ] if <ast.UnaryOp o...
keyword[def] identifier[valid_hotp] ( identifier[self] , identifier[code] , identifier[last] = literal[int] , identifier[trials] = literal[int] ): literal[string] keyword[if] keyword[not] identifier[valid_code] ( identifier[code] ): keyword[return] keyword[False] identifi...
def valid_hotp(self, code, last=0, trials=100): """Valid a HOTP code. :param code: A number that is less than 6 characters. :param last: Guess HOTP code from last + 1 range. :param trials: Guest HOTP code end at last + trials + 1. """ if not valid_code(code): return Fals...
def process_results(self, paragraph): """Routes Zeppelin output types to corresponding handlers.""" if 'editorMode' in paragraph['config']: mode = paragraph['config']['editorMode'].split('/')[-1] if 'results' in paragraph and paragraph['results']['msg']: msg = par...
def function[process_results, parameter[self, paragraph]]: constant[Routes Zeppelin output types to corresponding handlers.] if compare[constant[editorMode] in call[name[paragraph]][constant[config]]] begin[:] variable[mode] assign[=] call[call[call[call[name[paragraph]][constant[config]...
keyword[def] identifier[process_results] ( identifier[self] , identifier[paragraph] ): literal[string] keyword[if] literal[string] keyword[in] identifier[paragraph] [ literal[string] ]: identifier[mode] = identifier[paragraph] [ literal[string] ][ literal[string] ]. identifier[split...
def process_results(self, paragraph): """Routes Zeppelin output types to corresponding handlers.""" if 'editorMode' in paragraph['config']: mode = paragraph['config']['editorMode'].split('/')[-1] if 'results' in paragraph and paragraph['results']['msg']: msg = paragraph['results']['m...
def get_wfsmat(l): ''' l = ['v_7', 'v_3', 'v_1', 'v_4', ['v_4', 'v_2'], 'v_5', 'v_6', 'v_1', 'v_6', 'v_7', 'v_5', ['v_4', ['v_1', 'v_8', 'v_3', 'v_4', 'v_2', 'v_7', [['v_3', 'v_2'], 'v_4', 'v_5', 'v_1', 'v_3', 'v_1', 'v_2', 'v_5', 'v_8', 'v_8', 'v_7'], 'v_5', 'v_8', 'v_7', 'v_1', 'v_5'], 'v_6'], 'v_4', 'v_5'...
def function[get_wfsmat, parameter[l]]: constant[ l = ['v_7', 'v_3', 'v_1', 'v_4', ['v_4', 'v_2'], 'v_5', 'v_6', 'v_1', 'v_6', 'v_7', 'v_5', ['v_4', ['v_1', 'v_8', 'v_3', 'v_4', 'v_2', 'v_7', [['v_3', 'v_2'], 'v_4', 'v_5', 'v_1', 'v_3', 'v_1', 'v_2', 'v_5', 'v_8', 'v_8', 'v_7'], 'v_5', 'v_8', 'v_7', 'v_1...
keyword[def] identifier[get_wfsmat] ( identifier[l] ): literal[string] identifier[ltree] = identifier[ListTree] ( identifier[l] ) identifier[vdescmat] = identifier[ltree] . identifier[desc] identifier[wfsmat] = identifier[matrix_map] ( identifier[vdescmat] , keyword[lambda] identifier[v] , iden...
def get_wfsmat(l): """ l = ['v_7', 'v_3', 'v_1', 'v_4', ['v_4', 'v_2'], 'v_5', 'v_6', 'v_1', 'v_6', 'v_7', 'v_5', ['v_4', ['v_1', 'v_8', 'v_3', 'v_4', 'v_2', 'v_7', [['v_3', 'v_2'], 'v_4', 'v_5', 'v_1', 'v_3', 'v_1', 'v_2', 'v_5', 'v_8', 'v_8', 'v_7'], 'v_5', 'v_8', 'v_7', 'v_1', 'v_5'], 'v_6'], 'v_4', 'v_5'...
def workspace_cli(ctx, directory, mets_basename, backup): """ Working with workspace """ ctx.obj = WorkspaceCtx(os.path.abspath(directory), mets_basename, automatic_backup=backup)
def function[workspace_cli, parameter[ctx, directory, mets_basename, backup]]: constant[ Working with workspace ] name[ctx].obj assign[=] call[name[WorkspaceCtx], parameter[call[name[os].path.abspath, parameter[name[directory]]], name[mets_basename]]]
keyword[def] identifier[workspace_cli] ( identifier[ctx] , identifier[directory] , identifier[mets_basename] , identifier[backup] ): literal[string] identifier[ctx] . identifier[obj] = identifier[WorkspaceCtx] ( identifier[os] . identifier[path] . identifier[abspath] ( identifier[directory] ), identifier[m...
def workspace_cli(ctx, directory, mets_basename, backup): """ Working with workspace """ ctx.obj = WorkspaceCtx(os.path.abspath(directory), mets_basename, automatic_backup=backup)
def update(self, entry_id, new_label): """ Updates an entry with entry_id with the given label Parameters ---------- entry_id : int entry id of the sample to update. label : {int, None} Label of the sample to be update. """ self.d...
def function[update, parameter[self, entry_id, new_label]]: constant[ Updates an entry with entry_id with the given label Parameters ---------- entry_id : int entry id of the sample to update. label : {int, None} Label of the sample to be update....
keyword[def] identifier[update] ( identifier[self] , identifier[entry_id] , identifier[new_label] ): literal[string] identifier[self] . identifier[data] [ identifier[entry_id] ]=( identifier[self] . identifier[data] [ identifier[entry_id] ][ literal[int] ], identifier[new_label] ) identifi...
def update(self, entry_id, new_label): """ Updates an entry with entry_id with the given label Parameters ---------- entry_id : int entry id of the sample to update. label : {int, None} Label of the sample to be update. """ self.data[entr...
def main(): """ Reports stats on the workflow, use with --stats option to toil. """ parser = getBasicOptionParser() initializeOptions(parser) options = parseBasicOptions(parser) checkOptions(options, parser) config = Config() config.setOptions(options) jobStore = Toil.resumeJobStore(...
def function[main, parameter[]]: constant[ Reports stats on the workflow, use with --stats option to toil. ] variable[parser] assign[=] call[name[getBasicOptionParser], parameter[]] call[name[initializeOptions], parameter[name[parser]]] variable[options] assign[=] call[name[parseBasi...
keyword[def] identifier[main] (): literal[string] identifier[parser] = identifier[getBasicOptionParser] () identifier[initializeOptions] ( identifier[parser] ) identifier[options] = identifier[parseBasicOptions] ( identifier[parser] ) identifier[checkOptions] ( identifier[options] , identifi...
def main(): """ Reports stats on the workflow, use with --stats option to toil. """ parser = getBasicOptionParser() initializeOptions(parser) options = parseBasicOptions(parser) checkOptions(options, parser) config = Config() config.setOptions(options) jobStore = Toil.resumeJobStore(...
def numpy_binning(data, bins=10, range=None, *args, **kwargs) -> NumpyBinning: """Construct binning schema compatible with numpy.histogram Parameters ---------- data: array_like, optional This is optional if both bins and range are set bins: int or array_like range: Optional[tuple] ...
def function[numpy_binning, parameter[data, bins, range]]: constant[Construct binning schema compatible with numpy.histogram Parameters ---------- data: array_like, optional This is optional if both bins and range are set bins: int or array_like range: Optional[tuple] (min, ...
keyword[def] identifier[numpy_binning] ( identifier[data] , identifier[bins] = literal[int] , identifier[range] = keyword[None] ,* identifier[args] ,** identifier[kwargs] )-> identifier[NumpyBinning] : literal[string] keyword[if] identifier[isinstance] ( identifier[bins] , identifier[int] ): keyw...
def numpy_binning(data, bins=10, range=None, *args, **kwargs) -> NumpyBinning: """Construct binning schema compatible with numpy.histogram Parameters ---------- data: array_like, optional This is optional if both bins and range are set bins: int or array_like range: Optional[tuple] ...
def scalars_route(self, request): """Given a tag and single run, return array of ScalarEvents.""" # TODO: return HTTP status code for malformed requests tag = request.args.get('tag') run = request.args.get('run') experiment = request.args.get('experiment') output_format = request.args.get('forma...
def function[scalars_route, parameter[self, request]]: constant[Given a tag and single run, return array of ScalarEvents.] variable[tag] assign[=] call[name[request].args.get, parameter[constant[tag]]] variable[run] assign[=] call[name[request].args.get, parameter[constant[run]]] variabl...
keyword[def] identifier[scalars_route] ( identifier[self] , identifier[request] ): literal[string] identifier[tag] = identifier[request] . identifier[args] . identifier[get] ( literal[string] ) identifier[run] = identifier[request] . identifier[args] . identifier[get] ( literal[string] ) ide...
def scalars_route(self, request): """Given a tag and single run, return array of ScalarEvents.""" # TODO: return HTTP status code for malformed requests tag = request.args.get('tag') run = request.args.get('run') experiment = request.args.get('experiment') output_format = request.args.get('forma...
def lazy_elemwise_func(array, func, dtype): """Lazily apply an element-wise function to an array. Parameters ---------- array : any valid value of Variable._data func : callable Function to apply to indexed slices of an array. For use with dask, this should be a pickle-able object. ...
def function[lazy_elemwise_func, parameter[array, func, dtype]]: constant[Lazily apply an element-wise function to an array. Parameters ---------- array : any valid value of Variable._data func : callable Function to apply to indexed slices of an array. For use with dask, this s...
keyword[def] identifier[lazy_elemwise_func] ( identifier[array] , identifier[func] , identifier[dtype] ): literal[string] keyword[if] identifier[isinstance] ( identifier[array] , identifier[dask_array_type] ): keyword[return] identifier[array] . identifier[map_blocks] ( identifier[func] , identi...
def lazy_elemwise_func(array, func, dtype): """Lazily apply an element-wise function to an array. Parameters ---------- array : any valid value of Variable._data func : callable Function to apply to indexed slices of an array. For use with dask, this should be a pickle-able object. ...
def get_logfile_name(tags): """Formulates a log file name that incorporates the provided tags. The log file will be located in ``scgpm_seqresults_dnanexus.LOG_DIR``. Args: tags: `list` of tags to append to the log file name. Each tag will be '_' delimited. Each tag will be added in the same or...
def function[get_logfile_name, parameter[tags]]: constant[Formulates a log file name that incorporates the provided tags. The log file will be located in ``scgpm_seqresults_dnanexus.LOG_DIR``. Args: tags: `list` of tags to append to the log file name. Each tag will be '_' delimited. Each tag ...
keyword[def] identifier[get_logfile_name] ( identifier[tags] ): literal[string] keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[exists] ( identifier[sd] . identifier[LOG_DIR] ): identifier[os] . identifier[mkdir] ( identifier[sd] . identifier[LOG_DIR] ) identifier[filename] = ...
def get_logfile_name(tags): """Formulates a log file name that incorporates the provided tags. The log file will be located in ``scgpm_seqresults_dnanexus.LOG_DIR``. Args: tags: `list` of tags to append to the log file name. Each tag will be '_' delimited. Each tag will be added in the same ...
def delete(self, bundleId): """ Delete a device management extension package It accepts bundleId (string) as parameters In case of failure it throws APIException """ url = "api/v0002/mgmt/custom/bundle/%s" % (bundleId) r = self._apiClient.delete(url) if r...
def function[delete, parameter[self, bundleId]]: constant[ Delete a device management extension package It accepts bundleId (string) as parameters In case of failure it throws APIException ] variable[url] assign[=] binary_operation[constant[api/v0002/mgmt/custom/bundle/%s...
keyword[def] identifier[delete] ( identifier[self] , identifier[bundleId] ): literal[string] identifier[url] = literal[string] %( identifier[bundleId] ) identifier[r] = identifier[self] . identifier[_apiClient] . identifier[delete] ( identifier[url] ) keyword[if] identifier[r] ....
def delete(self, bundleId): """ Delete a device management extension package It accepts bundleId (string) as parameters In case of failure it throws APIException """ url = 'api/v0002/mgmt/custom/bundle/%s' % bundleId r = self._apiClient.delete(url) if r.status_code == 204...
def _get_platform_name(ncattr): """Determine name of the platform""" match = re.match(r'G-(\d+)', ncattr) if match: return SPACECRAFTS.get(int(match.groups()[0])) return None
def function[_get_platform_name, parameter[ncattr]]: constant[Determine name of the platform] variable[match] assign[=] call[name[re].match, parameter[constant[G-(\d+)], name[ncattr]]] if name[match] begin[:] return[call[name[SPACECRAFTS].get, parameter[call[name[int], parameter[call[cal...
keyword[def] identifier[_get_platform_name] ( identifier[ncattr] ): literal[string] identifier[match] = identifier[re] . identifier[match] ( literal[string] , identifier[ncattr] ) keyword[if] identifier[match] : keyword[return] identifier[SPACECRAFTS] . identifier[get] ( ide...
def _get_platform_name(ncattr): """Determine name of the platform""" match = re.match('G-(\\d+)', ncattr) if match: return SPACECRAFTS.get(int(match.groups()[0])) # depends on [control=['if'], data=[]] return None
def _variants_dtype(fields, dtypes, arities, filter_ids, flatten_filter, info_types): """Utility function to build a numpy dtype for a variants array, given user arguments and information available from VCF header.""" dtype = list() for f, n, vcf_type in zip(fields, arities, info_typ...
def function[_variants_dtype, parameter[fields, dtypes, arities, filter_ids, flatten_filter, info_types]]: constant[Utility function to build a numpy dtype for a variants array, given user arguments and information available from VCF header.] variable[dtype] assign[=] call[name[list], parameter[]] ...
keyword[def] identifier[_variants_dtype] ( identifier[fields] , identifier[dtypes] , identifier[arities] , identifier[filter_ids] , identifier[flatten_filter] , identifier[info_types] ): literal[string] identifier[dtype] = identifier[list] () keyword[for] identifier[f] , identifier[n] , identifier[v...
def _variants_dtype(fields, dtypes, arities, filter_ids, flatten_filter, info_types): """Utility function to build a numpy dtype for a variants array, given user arguments and information available from VCF header.""" dtype = list() for (f, n, vcf_type) in zip(fields, arities, info_types): if f ...
def plot(self, sizescale=10, color=None, alpha=0.5, label=None, edgecolor='none', **kw): ''' Plot the ra and dec of the coordinates, at a given epoch, scaled by their magnitude. (This does *not* create a new empty figure.) Parameters ---------- sizescale : (opti...
def function[plot, parameter[self, sizescale, color, alpha, label, edgecolor]]: constant[ Plot the ra and dec of the coordinates, at a given epoch, scaled by their magnitude. (This does *not* create a new empty figure.) Parameters ---------- sizescale : (optiona...
keyword[def] identifier[plot] ( identifier[self] , identifier[sizescale] = literal[int] , identifier[color] = keyword[None] , identifier[alpha] = literal[int] , identifier[label] = keyword[None] , identifier[edgecolor] = literal[string] ,** identifier[kw] ): literal[string] identifier[size...
def plot(self, sizescale=10, color=None, alpha=0.5, label=None, edgecolor='none', **kw): """ Plot the ra and dec of the coordinates, at a given epoch, scaled by their magnitude. (This does *not* create a new empty figure.) Parameters ---------- sizescale : (optional...
def _cursor(self, *args, **kwargs): """A "tough" version of the method cursor().""" # The args and kwargs are not part of the standard, # but some database modules seem to use these. transaction = self._transaction if not transaction: self._ping_check(2) try: ...
def function[_cursor, parameter[self]]: constant[A "tough" version of the method cursor().] variable[transaction] assign[=] name[self]._transaction if <ast.UnaryOp object at 0x7da20c993820> begin[:] call[name[self]._ping_check, parameter[constant[2]]] <ast.Try object at 0x7da...
keyword[def] identifier[_cursor] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[transaction] = identifier[self] . identifier[_transaction] keyword[if] keyword[not] identifier[transaction] : identifier[self] . id...
def _cursor(self, *args, **kwargs): """A "tough" version of the method cursor().""" # The args and kwargs are not part of the standard, # but some database modules seem to use these. transaction = self._transaction if not transaction: self._ping_check(2) # depends on [control=['if'], data=[...
def save(self, name, content, *args, **kwargs): """ Save the file, also saving a reference to the thumbnail cache Source model. """ super(ThumbnailerFieldFile, self).save(name, content, *args, **kwargs) self.get_source_cache(create=True, update=True)
def function[save, parameter[self, name, content]]: constant[ Save the file, also saving a reference to the thumbnail cache Source model. ] call[call[name[super], parameter[name[ThumbnailerFieldFile], name[self]]].save, parameter[name[name], name[content], <ast.Starred object at ...
keyword[def] identifier[save] ( identifier[self] , identifier[name] , identifier[content] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[super] ( identifier[ThumbnailerFieldFile] , identifier[self] ). identifier[save] ( identifier[name] , identifier[content] ,* identifier[...
def save(self, name, content, *args, **kwargs): """ Save the file, also saving a reference to the thumbnail cache Source model. """ super(ThumbnailerFieldFile, self).save(name, content, *args, **kwargs) self.get_source_cache(create=True, update=True)
def get_sdb_id(self, sdb): """ Return the ID for the given safe deposit box. Keyword arguments: sdb -- This is the name of the safe deposit box, not the path""" json_resp = self.get_sdbs() for r in json_resp: if r['name'] == sdb: return str(r['id']) ...
def function[get_sdb_id, parameter[self, sdb]]: constant[ Return the ID for the given safe deposit box. Keyword arguments: sdb -- This is the name of the safe deposit box, not the path] variable[json_resp] assign[=] call[name[self].get_sdbs, parameter[]] for taget[name[r]] in st...
keyword[def] identifier[get_sdb_id] ( identifier[self] , identifier[sdb] ): literal[string] identifier[json_resp] = identifier[self] . identifier[get_sdbs] () keyword[for] identifier[r] keyword[in] identifier[json_resp] : keyword[if] identifier[r] [ literal[string] ]== ide...
def get_sdb_id(self, sdb): """ Return the ID for the given safe deposit box. Keyword arguments: sdb -- This is the name of the safe deposit box, not the path""" json_resp = self.get_sdbs() for r in json_resp: if r['name'] == sdb: return str(r['id']) # depends on [contro...
def hexdigest(self, data=None): """ Returns digest in the hexadecimal form. For compatibility with hashlib """ from base64 import b16encode if pyver == 2: return b16encode(self.digest(data)) else: return b16encode(self.digest(data))...
def function[hexdigest, parameter[self, data]]: constant[ Returns digest in the hexadecimal form. For compatibility with hashlib ] from relative_module[base64] import module[b16encode] if compare[name[pyver] equal[==] constant[2]] begin[:] return[call[name[b16...
keyword[def] identifier[hexdigest] ( identifier[self] , identifier[data] = keyword[None] ): literal[string] keyword[from] identifier[base64] keyword[import] identifier[b16encode] keyword[if] identifier[pyver] == literal[int] : keyword[return] identifier[b16encode] ( iden...
def hexdigest(self, data=None): """ Returns digest in the hexadecimal form. For compatibility with hashlib """ from base64 import b16encode if pyver == 2: return b16encode(self.digest(data)) # depends on [control=['if'], data=[]] else: return b16encode(se...
def pretty_print(self, objlist): '''Pretty print the result of s3walk. Here we calculate the maximum width of each column and align them. ''' def normalize_time(timestamp): '''Normalize the timestamp format for pretty print.''' if timestamp is None: return ' ' * 16 return ...
def function[pretty_print, parameter[self, objlist]]: constant[Pretty print the result of s3walk. Here we calculate the maximum width of each column and align them. ] def function[normalize_time, parameter[timestamp]]: constant[Normalize the timestamp format for pretty print.]...
keyword[def] identifier[pretty_print] ( identifier[self] , identifier[objlist] ): literal[string] keyword[def] identifier[normalize_time] ( identifier[timestamp] ): literal[string] keyword[if] identifier[timestamp] keyword[is] keyword[None] : keyword[return] literal[string] * ...
def pretty_print(self, objlist): """Pretty print the result of s3walk. Here we calculate the maximum width of each column and align them. """ def normalize_time(timestamp): """Normalize the timestamp format for pretty print.""" if timestamp is None: return ' ' * 16 # dep...
def do_reset(self, line): """reset Set all session variables to their default values.""" self._split_args(line, 0, 0) self._command_processor.get_session().reset() self._print_info_if_verbose("Successfully reset session variables")
def function[do_reset, parameter[self, line]]: constant[reset Set all session variables to their default values.] call[name[self]._split_args, parameter[name[line], constant[0], constant[0]]] call[call[name[self]._command_processor.get_session, parameter[]].reset, parameter[]] call[name[...
keyword[def] identifier[do_reset] ( identifier[self] , identifier[line] ): literal[string] identifier[self] . identifier[_split_args] ( identifier[line] , literal[int] , literal[int] ) identifier[self] . identifier[_command_processor] . identifier[get_session] (). identifier[reset] () ...
def do_reset(self, line): """reset Set all session variables to their default values.""" self._split_args(line, 0, 0) self._command_processor.get_session().reset() self._print_info_if_verbose('Successfully reset session variables')
def prompt_choices(name, choices, default=None, no_choice=('none',)): """ Grabs user input from command line from set of provided choices. :param name: prompt text :param choices: list or tuple of available choices. :param default: default value if no input provided. :param no_choice: acceptabl...
def function[prompt_choices, parameter[name, choices, default, no_choice]]: constant[ Grabs user input from command line from set of provided choices. :param name: prompt text :param choices: list or tuple of available choices. :param default: default value if no input provided. :param no_c...
keyword[def] identifier[prompt_choices] ( identifier[name] , identifier[choices] , identifier[default] = keyword[None] , identifier[no_choice] =( literal[string] ,)): literal[string] identifier[_choices] =[] identifier[options] =[] keyword[for] identifier[choice] keyword[in] identifier[choic...
def prompt_choices(name, choices, default=None, no_choice=('none',)): """ Grabs user input from command line from set of provided choices. :param name: prompt text :param choices: list or tuple of available choices. :param default: default value if no input provided. :param no_choice: acceptabl...
def cleanup(self, sched, coro): """Remove this coro from the waiting for signal queue.""" try: sched.sigwait[self.name].remove((self, coro)) except ValueError: pass return True
def function[cleanup, parameter[self, sched, coro]]: constant[Remove this coro from the waiting for signal queue.] <ast.Try object at 0x7da204623580> return[constant[True]]
keyword[def] identifier[cleanup] ( identifier[self] , identifier[sched] , identifier[coro] ): literal[string] keyword[try] : identifier[sched] . identifier[sigwait] [ identifier[self] . identifier[name] ]. identifier[remove] (( identifier[self] , identifier[coro] )) keywor...
def cleanup(self, sched, coro): """Remove this coro from the waiting for signal queue.""" try: sched.sigwait[self.name].remove((self, coro)) # depends on [control=['try'], data=[]] except ValueError: pass # depends on [control=['except'], data=[]] return True
def generate_pymol_session(self, pymol_executable = 'pymol', settings = {}): ''' Generates the PyMOL session for the scaffold, model, and design structures. Returns this session and the script which generated it.''' b = BatchBuilder(pymol_executable = pymol_executable) if self.scaff...
def function[generate_pymol_session, parameter[self, pymol_executable, settings]]: constant[ Generates the PyMOL session for the scaffold, model, and design structures. Returns this session and the script which generated it.] variable[b] assign[=] call[name[BatchBuilder], parameter[]] ...
keyword[def] identifier[generate_pymol_session] ( identifier[self] , identifier[pymol_executable] = literal[string] , identifier[settings] ={}): literal[string] identifier[b] = identifier[BatchBuilder] ( identifier[pymol_executable] = identifier[pymol_executable] ) keyword[if] identifier...
def generate_pymol_session(self, pymol_executable='pymol', settings={}): """ Generates the PyMOL session for the scaffold, model, and design structures. Returns this session and the script which generated it.""" b = BatchBuilder(pymol_executable=pymol_executable) if self.scaffold_pdb: st...
def _trigger_event(self, event, *args, **kwargs): """Invoke an event handler.""" run_async = kwargs.pop('run_async', False) if event in self.handlers: if run_async: return self.start_background_task(self.handlers[event], *args) else: try: ...
def function[_trigger_event, parameter[self, event]]: constant[Invoke an event handler.] variable[run_async] assign[=] call[name[kwargs].pop, parameter[constant[run_async], constant[False]]] if compare[name[event] in name[self].handlers] begin[:] if name[run_async] begin[:] ...
keyword[def] identifier[_trigger_event] ( identifier[self] , identifier[event] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[run_async] = identifier[kwargs] . identifier[pop] ( literal[string] , keyword[False] ) keyword[if] identifier[event] keyword[in] identi...
def _trigger_event(self, event, *args, **kwargs): """Invoke an event handler.""" run_async = kwargs.pop('run_async', False) if event in self.handlers: if run_async: return self.start_background_task(self.handlers[event], *args) # depends on [control=['if'], data=[]] else: ...
def dump(self): """Dump parsed environment variables to a dictionary of simple data types (numbers and strings). """ schema = _dict2schema(self._fields)() dump_result = schema.dump(self._values) return dump_result.data if MARSHMALLOW_VERSION_INFO[0] < 3 else dump_result
def function[dump, parameter[self]]: constant[Dump parsed environment variables to a dictionary of simple data types (numbers and strings). ] variable[schema] assign[=] call[call[name[_dict2schema], parameter[name[self]._fields]], parameter[]] variable[dump_result] assign[=] call...
keyword[def] identifier[dump] ( identifier[self] ): literal[string] identifier[schema] = identifier[_dict2schema] ( identifier[self] . identifier[_fields] )() identifier[dump_result] = identifier[schema] . identifier[dump] ( identifier[self] . identifier[_values] ) keyword[return]...
def dump(self): """Dump parsed environment variables to a dictionary of simple data types (numbers and strings). """ schema = _dict2schema(self._fields)() dump_result = schema.dump(self._values) return dump_result.data if MARSHMALLOW_VERSION_INFO[0] < 3 else dump_result
def as_dict(self): """ Return the contents as dictionary, for client-side export. The dictionary contains the fields: * ``slot`` * ``title`` * ``role`` * ``fallback_language`` * ``allowed_plugins`` """ plugins = self.get_allowed_plugins() ...
def function[as_dict, parameter[self]]: constant[ Return the contents as dictionary, for client-side export. The dictionary contains the fields: * ``slot`` * ``title`` * ``role`` * ``fallback_language`` * ``allowed_plugins`` ] variable[plu...
keyword[def] identifier[as_dict] ( identifier[self] ): literal[string] identifier[plugins] = identifier[self] . identifier[get_allowed_plugins] () keyword[return] { literal[string] : identifier[self] . identifier[slot] , literal[string] : identifier[self] . identifier[tit...
def as_dict(self): """ Return the contents as dictionary, for client-side export. The dictionary contains the fields: * ``slot`` * ``title`` * ``role`` * ``fallback_language`` * ``allowed_plugins`` """ plugins = self.get_allowed_plugins() retu...
def create_token( self, registry_address, initial_alloc=10 ** 6, name='raidentester', symbol='RDT', decimals=2, timeout=60, auto_register=True, ): """ Create a proxy for a new HumanStandardToken (ERC20), that is ...
def function[create_token, parameter[self, registry_address, initial_alloc, name, symbol, decimals, timeout, auto_register]]: constant[ Create a proxy for a new HumanStandardToken (ERC20), that is initialized with Args(below). Per default it will be registered with 'raiden'. Args: ...
keyword[def] identifier[create_token] ( identifier[self] , identifier[registry_address] , identifier[initial_alloc] = literal[int] ** literal[int] , identifier[name] = literal[string] , identifier[symbol] = literal[string] , identifier[decimals] = literal[int] , identifier[timeout] = literal[int] , identifier...
def create_token(self, registry_address, initial_alloc=10 ** 6, name='raidentester', symbol='RDT', decimals=2, timeout=60, auto_register=True): """ Create a proxy for a new HumanStandardToken (ERC20), that is initialized with Args(below). Per default it will be registered with 'raiden'. Arg...
def validate_binary_sign(signed_query, signature, cert=None, algorithm=OneLogin_Saml2_Constants.RSA_SHA1, debug=False): """ Validates signed binary data (Used to validate GET Signature). :param signed_query: The element we should validate :type: string :param signature: The si...
def function[validate_binary_sign, parameter[signed_query, signature, cert, algorithm, debug]]: constant[ Validates signed binary data (Used to validate GET Signature). :param signed_query: The element we should validate :type: string :param signature: The signature that will ...
keyword[def] identifier[validate_binary_sign] ( identifier[signed_query] , identifier[signature] , identifier[cert] = keyword[None] , identifier[algorithm] = identifier[OneLogin_Saml2_Constants] . identifier[RSA_SHA1] , identifier[debug] = keyword[False] ): literal[string] identifier[error_callback...
def validate_binary_sign(signed_query, signature, cert=None, algorithm=OneLogin_Saml2_Constants.RSA_SHA1, debug=False): """ Validates signed binary data (Used to validate GET Signature). :param signed_query: The element we should validate :type: string :param signature: The signat...
def get_offset(target): """ returns a location's time zone offset from UTC in minutes. """ from pytz import timezone import pytz from datetime import datetime utc = pytz.utc today = datetime.now() tz_target = timezone(tf.certain_timezone_at(lat=target['lat'], lng=target['lng'])) ...
def function[get_offset, parameter[target]]: constant[ returns a location's time zone offset from UTC in minutes. ] from relative_module[pytz] import module[timezone] import module[pytz] from relative_module[datetime] import module[datetime] variable[utc] assign[=] name[pytz].utc ...
keyword[def] identifier[get_offset] ( identifier[target] ): literal[string] keyword[from] identifier[pytz] keyword[import] identifier[timezone] keyword[import] identifier[pytz] keyword[from] identifier[datetime] keyword[import] identifier[datetime] identifier[utc] = identifier[pyt...
def get_offset(target): """ returns a location's time zone offset from UTC in minutes. """ from pytz import timezone import pytz from datetime import datetime utc = pytz.utc today = datetime.now() tz_target = timezone(tf.certain_timezone_at(lat=target['lat'], lng=target['lng'])) ...
def _update(self, **kwargs): """ Update the mutable field `value`. :rtype: bool """ if 'value' in kwargs and self.protocol_agent_values.get('value') != \ kwargs.get('value'): self.protocol_agent_values.update(value=kwargs['value']) ret...
def function[_update, parameter[self]]: constant[ Update the mutable field `value`. :rtype: bool ] if <ast.BoolOp object at 0x7da1b1a2ceb0> begin[:] call[name[self].protocol_agent_values.update, parameter[]] return[constant[True]] return[const...
keyword[def] identifier[_update] ( identifier[self] ,** identifier[kwargs] ): literal[string] keyword[if] literal[string] keyword[in] identifier[kwargs] keyword[and] identifier[self] . identifier[protocol_agent_values] . identifier[get] ( literal[string] )!= identifier[kwargs] . identifier[get...
def _update(self, **kwargs): """ Update the mutable field `value`. :rtype: bool """ if 'value' in kwargs and self.protocol_agent_values.get('value') != kwargs.get('value'): self.protocol_agent_values.update(value=kwargs['value']) return True # depends on [contro...
def remove_item(self, item): """ Remove (and un-index) an object :param item: object to remove :type item: alignak.objects.item.Item :return: None """ self.unindex_item(item) self.items.pop(item.uuid, None)
def function[remove_item, parameter[self, item]]: constant[ Remove (and un-index) an object :param item: object to remove :type item: alignak.objects.item.Item :return: None ] call[name[self].unindex_item, parameter[name[item]]] call[name[self].items.pop,...
keyword[def] identifier[remove_item] ( identifier[self] , identifier[item] ): literal[string] identifier[self] . identifier[unindex_item] ( identifier[item] ) identifier[self] . identifier[items] . identifier[pop] ( identifier[item] . identifier[uuid] , keyword[None] )
def remove_item(self, item): """ Remove (and un-index) an object :param item: object to remove :type item: alignak.objects.item.Item :return: None """ self.unindex_item(item) self.items.pop(item.uuid, None)
def separate_string(string): """ >>> separate_string("test <2>") (['test ', ''], ['2']) """ string_list = regex.split(r'<(?![!=])', regex.sub(r'>', '<', string)) return string_list[::2], string_list[1::2]
def function[separate_string, parameter[string]]: constant[ >>> separate_string("test <2>") (['test ', ''], ['2']) ] variable[string_list] assign[=] call[name[regex].split, parameter[constant[<(?![!=])], call[name[regex].sub, parameter[constant[>], constant[<], name[string]]]]] return[tu...
keyword[def] identifier[separate_string] ( identifier[string] ): literal[string] identifier[string_list] = identifier[regex] . identifier[split] ( literal[string] , identifier[regex] . identifier[sub] ( literal[string] , literal[string] , identifier[string] )) keyword[return] identifier[string_list] ...
def separate_string(string): """ >>> separate_string("test <2>") (['test ', ''], ['2']) """ string_list = regex.split('<(?![!=])', regex.sub('>', '<', string)) return (string_list[::2], string_list[1::2])
def randchoice(seq: Union[str, list, tuple, dict, set]) -> any: """Return a randomly chosen element from the given sequence. Raises TypeError if *seq* is not str, list, tuple, dict, set and an IndexError if it is empty. >>> randchoice((1, 2, 'a', 'b')) #doctest:+SKIP 'a' """ if not isins...
def function[randchoice, parameter[seq]]: constant[Return a randomly chosen element from the given sequence. Raises TypeError if *seq* is not str, list, tuple, dict, set and an IndexError if it is empty. >>> randchoice((1, 2, 'a', 'b')) #doctest:+SKIP 'a' ] if <ast.UnaryOp object...
keyword[def] identifier[randchoice] ( identifier[seq] : identifier[Union] [ identifier[str] , identifier[list] , identifier[tuple] , identifier[dict] , identifier[set] ])-> identifier[any] : literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[seq] ,( identifier[str] , identifier[...
def randchoice(seq: Union[str, list, tuple, dict, set]) -> any: """Return a randomly chosen element from the given sequence. Raises TypeError if *seq* is not str, list, tuple, dict, set and an IndexError if it is empty. >>> randchoice((1, 2, 'a', 'b')) #doctest:+SKIP 'a' """ if not isins...
def _getJson(url, token='', version=''): '''for backwards compat, accepting token and version but ignoring''' if token: return _getJsonIEXCloud(url, token, version) return _getJsonOrig(url)
def function[_getJson, parameter[url, token, version]]: constant[for backwards compat, accepting token and version but ignoring] if name[token] begin[:] return[call[name[_getJsonIEXCloud], parameter[name[url], name[token], name[version]]]] return[call[name[_getJsonOrig], parameter[name[url]]...
keyword[def] identifier[_getJson] ( identifier[url] , identifier[token] = literal[string] , identifier[version] = literal[string] ): literal[string] keyword[if] identifier[token] : keyword[return] identifier[_getJsonIEXCloud] ( identifier[url] , identifier[token] , identifier[version] ) key...
def _getJson(url, token='', version=''): """for backwards compat, accepting token and version but ignoring""" if token: return _getJsonIEXCloud(url, token, version) # depends on [control=['if'], data=[]] return _getJsonOrig(url)
def _repr_html_(self): """ Return a html representation for a particular DataFrame. Mainly for IPython notebook. """ if self._info_repr(): buf = StringIO("") self.info(buf=buf) # need to escape the <class>, should be the first line. ...
def function[_repr_html_, parameter[self]]: constant[ Return a html representation for a particular DataFrame. Mainly for IPython notebook. ] if call[name[self]._info_repr, parameter[]] begin[:] variable[buf] assign[=] call[name[StringIO], parameter[constant[]]] ...
keyword[def] identifier[_repr_html_] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_info_repr] (): identifier[buf] = identifier[StringIO] ( literal[string] ) identifier[self] . identifier[info] ( identifier[buf] = identifier[buf] ) ...
def _repr_html_(self): """ Return a html representation for a particular DataFrame. Mainly for IPython notebook. """ if self._info_repr(): buf = StringIO('') self.info(buf=buf) # need to escape the <class>, should be the first line. val = buf.getvalue().r...
def queries(self, request): '''Multiple Database Queries''' queries = self.get_queries(request) worlds = [] with self.mapper.begin() as session: for _ in range(queries): world = session.query(World).get(randint(1, MAXINT)) worlds.append(self.ge...
def function[queries, parameter[self, request]]: constant[Multiple Database Queries] variable[queries] assign[=] call[name[self].get_queries, parameter[name[request]]] variable[worlds] assign[=] list[[]] with call[name[self].mapper.begin, parameter[]] begin[:] for taget[n...
keyword[def] identifier[queries] ( identifier[self] , identifier[request] ): literal[string] identifier[queries] = identifier[self] . identifier[get_queries] ( identifier[request] ) identifier[worlds] =[] keyword[with] identifier[self] . identifier[mapper] . identifier[begin] () ...
def queries(self, request): """Multiple Database Queries""" queries = self.get_queries(request) worlds = [] with self.mapper.begin() as session: for _ in range(queries): world = session.query(World).get(randint(1, MAXINT)) worlds.append(self.get_json(world)) # depends on...
async def start_pipe_server( client_connected_cb, *, path, loop=None, limit=DEFAULT_LIMIT ): """ Start listening for connection using Windows named pipes. """ path = path.replace('/', '\\') loop = loop or asyncio.get_event_loop() def factory(): reader = asyncio.Strea...
<ast.AsyncFunctionDef object at 0x7da1b0aa5510>
keyword[async] keyword[def] identifier[start_pipe_server] ( identifier[client_connected_cb] , *, identifier[path] , identifier[loop] = keyword[None] , identifier[limit] = identifier[DEFAULT_LIMIT] ): literal[string] identifier[path] = identifier[path] . identifier[replace] ( literal[string] , literal...
async def start_pipe_server(client_connected_cb, *, path, loop=None, limit=DEFAULT_LIMIT): """ Start listening for connection using Windows named pipes. """ path = path.replace('/', '\\') loop = loop or asyncio.get_event_loop() def factory(): reader = asyncio.StreamReader(limit=limit, l...
def send_post(self, mri, method_name, **params): """Abstract method to dispatch a Post to the server Args: mri (str): The mri of the Block method_name (str): The name of the Method within the Block params: The parameters to send Returns: The retu...
def function[send_post, parameter[self, mri, method_name]]: constant[Abstract method to dispatch a Post to the server Args: mri (str): The mri of the Block method_name (str): The name of the Method within the Block params: The parameters to send Returns: ...
keyword[def] identifier[send_post] ( identifier[self] , identifier[mri] , identifier[method_name] ,** identifier[params] ): literal[string] identifier[typ] , identifier[parameters] = identifier[convert_to_type_tuple_value] ( identifier[serialize_object] ( identifier[params] )) identifier[u...
def send_post(self, mri, method_name, **params): """Abstract method to dispatch a Post to the server Args: mri (str): The mri of the Block method_name (str): The name of the Method within the Block params: The parameters to send Returns: The return r...
def to_dict(self, fields=None): """Convert context to dict containing only builtin types. Args: fields (list of str): If present, only write these fields into the dict. This can be used to avoid constructing expensive fields (such as 'graph') for some cases. ...
def function[to_dict, parameter[self, fields]]: constant[Convert context to dict containing only builtin types. Args: fields (list of str): If present, only write these fields into the dict. This can be used to avoid constructing expensive fields (such as 'gr...
keyword[def] identifier[to_dict] ( identifier[self] , identifier[fields] = keyword[None] ): literal[string] identifier[data] ={} keyword[def] identifier[_add] ( identifier[field] ): keyword[return] ( identifier[fields] keyword[is] keyword[None] keyword[or] identifier[fie...
def to_dict(self, fields=None): """Convert context to dict containing only builtin types. Args: fields (list of str): If present, only write these fields into the dict. This can be used to avoid constructing expensive fields (such as 'graph') for some cases. ...
def set_features(self, features): """Set features in the disco#info object. All existing features are removed from `self`. :Parameters: - `features`: list of features. :Types: - `features`: sequence of `unicode` """ for var in self.features: ...
def function[set_features, parameter[self, features]]: constant[Set features in the disco#info object. All existing features are removed from `self`. :Parameters: - `features`: list of features. :Types: - `features`: sequence of `unicode` ] for t...
keyword[def] identifier[set_features] ( identifier[self] , identifier[features] ): literal[string] keyword[for] identifier[var] keyword[in] identifier[self] . identifier[features] : identifier[self] . identifier[remove_feature] ( identifier[var] ) keyword[for] identifier[...
def set_features(self, features): """Set features in the disco#info object. All existing features are removed from `self`. :Parameters: - `features`: list of features. :Types: - `features`: sequence of `unicode` """ for var in self.features: self...
def stmt2enum(enum_type, declare=True, assign=True, wrap=True): """Returns a dzn enum declaration from an enum type. Parameters ---------- enum_type : Enum The enum to serialize. declare : bool Whether to include the ``enum`` declatation keyword in the statement or just the ...
def function[stmt2enum, parameter[enum_type, declare, assign, wrap]]: constant[Returns a dzn enum declaration from an enum type. Parameters ---------- enum_type : Enum The enum to serialize. declare : bool Whether to include the ``enum`` declatation keyword in the statement or ...
keyword[def] identifier[stmt2enum] ( identifier[enum_type] , identifier[declare] = keyword[True] , identifier[assign] = keyword[True] , identifier[wrap] = keyword[True] ): literal[string] keyword[if] keyword[not] ( identifier[declare] keyword[or] identifier[assign] ): keyword[raise] identifie...
def stmt2enum(enum_type, declare=True, assign=True, wrap=True): """Returns a dzn enum declaration from an enum type. Parameters ---------- enum_type : Enum The enum to serialize. declare : bool Whether to include the ``enum`` declatation keyword in the statement or just the ...
def as_dict(self): """ Serializes the object necessary data in a dictionary. :returns: Serialized data in a dictionary. :rtype: dict """ result_dict = super(Profile, self).as_dict() statuses = list() version = None titles = list() descri...
def function[as_dict, parameter[self]]: constant[ Serializes the object necessary data in a dictionary. :returns: Serialized data in a dictionary. :rtype: dict ] variable[result_dict] assign[=] call[call[name[super], parameter[name[Profile], name[self]]].as_dict, paramet...
keyword[def] identifier[as_dict] ( identifier[self] ): literal[string] identifier[result_dict] = identifier[super] ( identifier[Profile] , identifier[self] ). identifier[as_dict] () identifier[statuses] = identifier[list] () identifier[version] = keyword[None] identifi...
def as_dict(self): """ Serializes the object necessary data in a dictionary. :returns: Serialized data in a dictionary. :rtype: dict """ result_dict = super(Profile, self).as_dict() statuses = list() version = None titles = list() descriptions = list() platfo...
def import_by_path(path): """ Import functions or class by their path. Should be of the form: path.to.module.func """ if not isinstance(path, str): return path module_path, *name = path.rsplit('.', 1) func = import_module(module_path) if name: func = getattr(func, name[0]...
def function[import_by_path, parameter[path]]: constant[ Import functions or class by their path. Should be of the form: path.to.module.func ] if <ast.UnaryOp object at 0x7da1b0399000> begin[:] return[name[path]] <ast.Tuple object at 0x7da1b039ace0> assign[=] call[name[path]....
keyword[def] identifier[import_by_path] ( identifier[path] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[path] , identifier[str] ): keyword[return] identifier[path] identifier[module_path] ,* identifier[name] = identifier[path] . identifier[rsplit] ( lite...
def import_by_path(path): """ Import functions or class by their path. Should be of the form: path.to.module.func """ if not isinstance(path, str): return path # depends on [control=['if'], data=[]] (module_path, *name) = path.rsplit('.', 1) func = import_module(module_path) if ...
def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, **kw): """Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON document) to a Python object. If ``s`` is a ``str`` instance and is encoded with an ASCII based encoding ...
def function[loads, parameter[s, encoding, cls, object_hook, parse_float, parse_int, parse_constant]]: constant[Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON document) to a Python object. If ``s`` is a ``str`` instance and is encoded with an ASCII based encoding other than ...
keyword[def] identifier[loads] ( identifier[s] , identifier[encoding] = keyword[None] , identifier[cls] = keyword[None] , identifier[object_hook] = keyword[None] , identifier[parse_float] = keyword[None] , identifier[parse_int] = keyword[None] , identifier[parse_constant] = keyword[None] ,** identifier[kw] ): l...
def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, **kw): """Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON document) to a Python object. If ``s`` is a ``str`` instance and is encoded with an ASCII based encoding other ...
def content_type(self, response): """ Ensures the response is of type :param obj response: The scrapy response :return bool: Determines wether the response is of the correct type """ if not re_html.match(response.headers.get('Content-Type').decode('utf-8')): ...
def function[content_type, parameter[self, response]]: constant[ Ensures the response is of type :param obj response: The scrapy response :return bool: Determines wether the response is of the correct type ] if <ast.UnaryOp object at 0x7da20c992830> begin[:] ...
keyword[def] identifier[content_type] ( identifier[self] , identifier[response] ): literal[string] keyword[if] keyword[not] identifier[re_html] . identifier[match] ( identifier[response] . identifier[headers] . identifier[get] ( literal[string] ). identifier[decode] ( literal[string] )): ...
def content_type(self, response): """ Ensures the response is of type :param obj response: The scrapy response :return bool: Determines wether the response is of the correct type """ if not re_html.match(response.headers.get('Content-Type').decode('utf-8')): self.log.war...
def xhdr(self, header, msgid_range=None): """XHDR command. """ args = header if range is not None: args += " " + utils.unparse_msgid_range(msgid_range) code, message = self.command("XHDR", args) if code != 221: raise NNTPReplyError(code, message) ...
def function[xhdr, parameter[self, header, msgid_range]]: constant[XHDR command. ] variable[args] assign[=] name[header] if compare[name[range] is_not constant[None]] begin[:] <ast.AugAssign object at 0x7da1b013d8a0> <ast.Tuple object at 0x7da1b013c8b0> assign[=] call[nam...
keyword[def] identifier[xhdr] ( identifier[self] , identifier[header] , identifier[msgid_range] = keyword[None] ): literal[string] identifier[args] = identifier[header] keyword[if] identifier[range] keyword[is] keyword[not] keyword[None] : identifier[args] += literal[stri...
def xhdr(self, header, msgid_range=None): """XHDR command. """ args = header if range is not None: args += ' ' + utils.unparse_msgid_range(msgid_range) # depends on [control=['if'], data=[]] (code, message) = self.command('XHDR', args) if code != 221: raise NNTPReplyError(co...
def say(self, message=None, voice=None, loop=None, language=None, **kwargs): """ Create a <Say> element :param message: Message to say :param voice: Voice to use :param loop: Times to loop message :param language: Message langauge :param kwargs: additional attrib...
def function[say, parameter[self, message, voice, loop, language]]: constant[ Create a <Say> element :param message: Message to say :param voice: Voice to use :param loop: Times to loop message :param language: Message langauge :param kwargs: additional attribute...
keyword[def] identifier[say] ( identifier[self] , identifier[message] = keyword[None] , identifier[voice] = keyword[None] , identifier[loop] = keyword[None] , identifier[language] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[self] . identifier[nest] ( identi...
def say(self, message=None, voice=None, loop=None, language=None, **kwargs): """ Create a <Say> element :param message: Message to say :param voice: Voice to use :param loop: Times to loop message :param language: Message langauge :param kwargs: additional attributes...
def calc_wind_chill(t, windspeed, windspeed10min=None): ''' calculates the wind chill value based upon the temperature (F) and wind. returns the wind chill in degrees F. ''' w = max(windspeed10min, windspeed) return 35.74 + 0.6215 * t - 35.75 * (w ** 0.16) + 0.4275 * t * (w ** 0.16);
def function[calc_wind_chill, parameter[t, windspeed, windspeed10min]]: constant[ calculates the wind chill value based upon the temperature (F) and wind. returns the wind chill in degrees F. ] variable[w] assign[=] call[name[max], parameter[name[windspeed10min], name[windspeed]]] r...
keyword[def] identifier[calc_wind_chill] ( identifier[t] , identifier[windspeed] , identifier[windspeed10min] = keyword[None] ): literal[string] identifier[w] = identifier[max] ( identifier[windspeed10min] , identifier[windspeed] ) keyword[return] literal[int] + literal[int] * identifier[t] - litera...
def calc_wind_chill(t, windspeed, windspeed10min=None): """ calculates the wind chill value based upon the temperature (F) and wind. returns the wind chill in degrees F. """ w = max(windspeed10min, windspeed) return 35.74 + 0.6215 * t - 35.75 * w ** 0.16 + 0.4275 * t * w ** 0.16
def forward(self, ploc, plabel, gloc, glabel): """ ploc, plabel: Nx4x8732, Nxlabel_numx8732 predicted location and labels gloc, glabel: Nx4x8732, Nx8732 ground truth location and labels """ mask = glabel > 0 pos_num = mask.sum(dim...
def function[forward, parameter[self, ploc, plabel, gloc, glabel]]: constant[ ploc, plabel: Nx4x8732, Nxlabel_numx8732 predicted location and labels gloc, glabel: Nx4x8732, Nx8732 ground truth location and labels ] variable[mask] assign[=]...
keyword[def] identifier[forward] ( identifier[self] , identifier[ploc] , identifier[plabel] , identifier[gloc] , identifier[glabel] ): literal[string] identifier[mask] = identifier[glabel] > literal[int] identifier[pos_num] = identifier[mask] . identifier[sum] ( identifier[dim] = literal...
def forward(self, ploc, plabel, gloc, glabel): """ ploc, plabel: Nx4x8732, Nxlabel_numx8732 predicted location and labels gloc, glabel: Nx4x8732, Nx8732 ground truth location and labels """ mask = glabel > 0 pos_num = mask.sum(dim=1) vec_g...
def do_debug(self, args): """Implementation of 'coverage debug'.""" if not args: self.help_fn("What information would you like: data, sys?") return ERR for info in args: if info == 'sys': print("-- sys ----------------------------------------"...
def function[do_debug, parameter[self, args]]: constant[Implementation of 'coverage debug'.] if <ast.UnaryOp object at 0x7da18ede6f80> begin[:] call[name[self].help_fn, parameter[constant[What information would you like: data, sys?]]] return[name[ERR]] for taget[name[info...
keyword[def] identifier[do_debug] ( identifier[self] , identifier[args] ): literal[string] keyword[if] keyword[not] identifier[args] : identifier[self] . identifier[help_fn] ( literal[string] ) keyword[return] identifier[ERR] keyword[for] identifier[info] k...
def do_debug(self, args): """Implementation of 'coverage debug'.""" if not args: self.help_fn('What information would you like: data, sys?') return ERR # depends on [control=['if'], data=[]] for info in args: if info == 'sys': print('-- sys ------------------------------...
def load_rdkit_mol(self, mol): """ Return molecular data from :class:`rdkit.Chem.rdchem.Mol` object. Parameters ---------- mol : :class:`rdkit.Chem.rdchem.Mol` A molecule object from RDKit. Returns ------- :class:`dict` A dictiona...
def function[load_rdkit_mol, parameter[self, mol]]: constant[ Return molecular data from :class:`rdkit.Chem.rdchem.Mol` object. Parameters ---------- mol : :class:`rdkit.Chem.rdchem.Mol` A molecule object from RDKit. Returns ------- :class:`d...
keyword[def] identifier[load_rdkit_mol] ( identifier[self] , identifier[mol] ): literal[string] identifier[self] . identifier[system] ={ literal[string] : identifier[np] . identifier[empty] ( identifier[mol] . identifier[GetNumAtoms] (), identifier[dtype] = identifier[str] ), ...
def load_rdkit_mol(self, mol): """ Return molecular data from :class:`rdkit.Chem.rdchem.Mol` object. Parameters ---------- mol : :class:`rdkit.Chem.rdchem.Mol` A molecule object from RDKit. Returns ------- :class:`dict` A dictionary w...
def update(self): """Update CPU stats using the input method.""" # Grab stats into self.stats if self.input_method == 'local': stats = self.update_local() elif self.input_method == 'snmp': stats = self.update_snmp() else: stats = self.get_init...
def function[update, parameter[self]]: constant[Update CPU stats using the input method.] if compare[name[self].input_method equal[==] constant[local]] begin[:] variable[stats] assign[=] call[name[self].update_local, parameter[]] name[self].stats assign[=] name[stats] return[...
keyword[def] identifier[update] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[input_method] == literal[string] : identifier[stats] = identifier[self] . identifier[update_local] () keyword[elif] identifier[self] . identifier[input_m...
def update(self): """Update CPU stats using the input method.""" # Grab stats into self.stats if self.input_method == 'local': stats = self.update_local() # depends on [control=['if'], data=[]] elif self.input_method == 'snmp': stats = self.update_snmp() # depends on [control=['if'], d...
def _updateKW(image, filename, exten, skyKW, Value): """update the header with the kw,value""" # Update the value in memory image.header[skyKW] = Value # Now update the value on disk if isinstance(exten,tuple): strexten = '[%s,%s]'%(exten[0],str(exten[1])) else: strexten = '[%s]...
def function[_updateKW, parameter[image, filename, exten, skyKW, Value]]: constant[update the header with the kw,value] call[name[image].header][name[skyKW]] assign[=] name[Value] if call[name[isinstance], parameter[name[exten], name[tuple]]] begin[:] variable[strexten] assign[=]...
keyword[def] identifier[_updateKW] ( identifier[image] , identifier[filename] , identifier[exten] , identifier[skyKW] , identifier[Value] ): literal[string] identifier[image] . identifier[header] [ identifier[skyKW] ]= identifier[Value] keyword[if] identifier[isinstance] ( identifier[exte...
def _updateKW(image, filename, exten, skyKW, Value): """update the header with the kw,value""" # Update the value in memory image.header[skyKW] = Value # Now update the value on disk if isinstance(exten, tuple): strexten = '[%s,%s]' % (exten[0], str(exten[1])) # depends on [control=['if'], ...
def CreateServiceProto(job): """Create the Service protobuf. Args: job: Launchdjobdict from servicemanagement framework. Returns: sysinfo_pb2.OSXServiceInformation proto """ service = rdf_client.OSXServiceInformation( label=job.get("Label"), program=job.get("Program"), sessiontype=...
def function[CreateServiceProto, parameter[job]]: constant[Create the Service protobuf. Args: job: Launchdjobdict from servicemanagement framework. Returns: sysinfo_pb2.OSXServiceInformation proto ] variable[service] assign[=] call[name[rdf_client].OSXServiceInformation, parameter[]] ...
keyword[def] identifier[CreateServiceProto] ( identifier[job] ): literal[string] identifier[service] = identifier[rdf_client] . identifier[OSXServiceInformation] ( identifier[label] = identifier[job] . identifier[get] ( literal[string] ), identifier[program] = identifier[job] . identifier[get] ( literal[...
def CreateServiceProto(job): """Create the Service protobuf. Args: job: Launchdjobdict from servicemanagement framework. Returns: sysinfo_pb2.OSXServiceInformation proto """ service = rdf_client.OSXServiceInformation(label=job.get('Label'), program=job.get('Program'), sessiontype=job.get('LimitL...
def get_file_info_by_id(self, id): """ Given an id, get the corresponding file info as the following:\n (relative path joined with file name, file info dict) Parameters: #. id (string): The file unique id string. :Returns: #. relativePath (string): The f...
def function[get_file_info_by_id, parameter[self, id]]: constant[ Given an id, get the corresponding file info as the following: (relative path joined with file name, file info dict) Parameters: #. id (string): The file unique id string. :Returns: #. re...
keyword[def] identifier[get_file_info_by_id] ( identifier[self] , identifier[id] ): literal[string] keyword[for] identifier[path] , identifier[info] keyword[in] identifier[self] . identifier[walk_files_info] (): keyword[if] identifier[info] [ literal[string] ]== identifier[id] : ...
def get_file_info_by_id(self, id): """ Given an id, get the corresponding file info as the following: (relative path joined with file name, file info dict) Parameters: #. id (string): The file unique id string. :Returns: #. relativePath (string): The file r...
def configure(self): """ Applies one-time settings changes to the host, usually to initialize the service. """ print('env.services:', self.genv.services) for service in list(self.genv.services): service = service.strip().upper() funcs = common.service_conf...
def function[configure, parameter[self]]: constant[ Applies one-time settings changes to the host, usually to initialize the service. ] call[name[print], parameter[constant[env.services:], name[self].genv.services]] for taget[name[service]] in starred[call[name[list], parameter[n...
keyword[def] identifier[configure] ( identifier[self] ): literal[string] identifier[print] ( literal[string] , identifier[self] . identifier[genv] . identifier[services] ) keyword[for] identifier[service] keyword[in] identifier[list] ( identifier[self] . identifier[genv] . identifier[se...
def configure(self): """ Applies one-time settings changes to the host, usually to initialize the service. """ print('env.services:', self.genv.services) for service in list(self.genv.services): service = service.strip().upper() funcs = common.service_configurators.get(servic...
def get_work_unit_status(self, work_spec_name, work_unit_key): '''Get a high-level status for some work unit. The return value is a dictionary. The only required key is ``status``, which could be any of: ``missing`` The work unit does not exist anywhere ``available``...
def function[get_work_unit_status, parameter[self, work_spec_name, work_unit_key]]: constant[Get a high-level status for some work unit. The return value is a dictionary. The only required key is ``status``, which could be any of: ``missing`` The work unit does not exist any...
keyword[def] identifier[get_work_unit_status] ( identifier[self] , identifier[work_spec_name] , identifier[work_unit_key] ): literal[string] keyword[with] identifier[self] . identifier[registry] . identifier[lock] ( identifier[identifier] = identifier[self] . identifier[worker_id] ) keyword[as] i...
def get_work_unit_status(self, work_spec_name, work_unit_key): """Get a high-level status for some work unit. The return value is a dictionary. The only required key is ``status``, which could be any of: ``missing`` The work unit does not exist anywhere ``available`` ...
def setStop(self, vehID, edgeID, pos=1., laneIndex=0, duration=2**31 - 1, flags=tc.STOP_DEFAULT, startPos=tc.INVALID_DOUBLE_VALUE, until=-1): """setStop(string, string, double, integer, integer, integer, double, integer) -> None Adds or modifies a stop with the given parameters. The dur...
def function[setStop, parameter[self, vehID, edgeID, pos, laneIndex, duration, flags, startPos, until]]: constant[setStop(string, string, double, integer, integer, integer, double, integer) -> None Adds or modifies a stop with the given parameters. The duration and the until attribute are in mi...
keyword[def] identifier[setStop] ( identifier[self] , identifier[vehID] , identifier[edgeID] , identifier[pos] = literal[int] , identifier[laneIndex] = literal[int] , identifier[duration] = literal[int] ** literal[int] - literal[int] , identifier[flags] = identifier[tc] . identifier[STOP_DEFAULT] , identifier[startP...
def setStop(self, vehID, edgeID, pos=1.0, laneIndex=0, duration=2 ** 31 - 1, flags=tc.STOP_DEFAULT, startPos=tc.INVALID_DOUBLE_VALUE, until=-1): """setStop(string, string, double, integer, integer, integer, double, integer) -> None Adds or modifies a stop with the given parameters. The duration and the unt...
def beforeRender(self, ctx): """ Call the C{beforeRender} implementations on L{MantissaLivePage} and L{_FragmentWrapperMixin}. """ MantissaLivePage.beforeRender(self, ctx) return _FragmentWrapperMixin.beforeRender(self, ctx)
def function[beforeRender, parameter[self, ctx]]: constant[ Call the C{beforeRender} implementations on L{MantissaLivePage} and L{_FragmentWrapperMixin}. ] call[name[MantissaLivePage].beforeRender, parameter[name[self], name[ctx]]] return[call[name[_FragmentWrapperMixin].befo...
keyword[def] identifier[beforeRender] ( identifier[self] , identifier[ctx] ): literal[string] identifier[MantissaLivePage] . identifier[beforeRender] ( identifier[self] , identifier[ctx] ) keyword[return] identifier[_FragmentWrapperMixin] . identifier[beforeRender] ( identifier[self] , id...
def beforeRender(self, ctx): """ Call the C{beforeRender} implementations on L{MantissaLivePage} and L{_FragmentWrapperMixin}. """ MantissaLivePage.beforeRender(self, ctx) return _FragmentWrapperMixin.beforeRender(self, ctx)
def gen_fibonacci(): """Yield the next Fibonacci number. Based on https://www.python-course.eu/generators.php Starts at Fibonacci number 3 (the second 1) Yields ------ int The next Fibonacci number """ num_a, num_b = 1, 2 while True:...
def function[gen_fibonacci, parameter[]]: constant[Yield the next Fibonacci number. Based on https://www.python-course.eu/generators.php Starts at Fibonacci number 3 (the second 1) Yields ------ int The next Fibonacci number ] <ast.Tuple obj...
keyword[def] identifier[gen_fibonacci] (): literal[string] identifier[num_a] , identifier[num_b] = literal[int] , literal[int] keyword[while] keyword[True] : keyword[yield] identifier[num_a] identifier[num_a] , identifier[num_b] = identifier[num_b] , identifie...
def gen_fibonacci(): """Yield the next Fibonacci number. Based on https://www.python-course.eu/generators.php Starts at Fibonacci number 3 (the second 1) Yields ------ int The next Fibonacci number """ (num_a, num_b) = (1, 2) while True: ...
def from_rep(u): """Given a string, return a UUID object.""" if isinstance(u, pyversion.string_types): return uuid.UUID(u) # hack to remove signs a = ctypes.c_ulong(u[0]) b = ctypes.c_ulong(u[1]) combined = a.value << 64 | b.value return uuid.UUID(int...
def function[from_rep, parameter[u]]: constant[Given a string, return a UUID object.] if call[name[isinstance], parameter[name[u], name[pyversion].string_types]] begin[:] return[call[name[uuid].UUID, parameter[name[u]]]] variable[a] assign[=] call[name[ctypes].c_ulong, parameter[call[nam...
keyword[def] identifier[from_rep] ( identifier[u] ): literal[string] keyword[if] identifier[isinstance] ( identifier[u] , identifier[pyversion] . identifier[string_types] ): keyword[return] identifier[uuid] . identifier[UUID] ( identifier[u] ) identifier[a] = i...
def from_rep(u): """Given a string, return a UUID object.""" if isinstance(u, pyversion.string_types): return uuid.UUID(u) # depends on [control=['if'], data=[]] # hack to remove signs a = ctypes.c_ulong(u[0]) b = ctypes.c_ulong(u[1]) combined = a.value << 64 | b.value return uuid.U...
def get_alias_func(self): """The get_alias function is set by a few different things: - if there is a 'generate_alias_name' macro in the root project, it will be used. - if that does not exist but there is a 'generate_alias_name' macro in the 'dbt' interna...
def function[get_alias_func, parameter[self]]: constant[The get_alias function is set by a few different things: - if there is a 'generate_alias_name' macro in the root project, it will be used. - if that does not exist but there is a 'generate_alias_name' ...
keyword[def] identifier[get_alias_func] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_get_alias_func] keyword[is] keyword[not] keyword[None] : keyword[return] identifier[self] . identifier[_get_alias_func] identifier[get_alias_macro] =...
def get_alias_func(self): """The get_alias function is set by a few different things: - if there is a 'generate_alias_name' macro in the root project, it will be used. - if that does not exist but there is a 'generate_alias_name' macro in the 'dbt' internal pr...
def set_cors_headers(resp, options): """ Performs the actual evaluation of Flas-CORS options and actually modifies the response object. This function is used both in the decorator and the after_request callback """ # If CORS has already been evaluated via the decorator, skip if hasattr...
def function[set_cors_headers, parameter[resp, options]]: constant[ Performs the actual evaluation of Flas-CORS options and actually modifies the response object. This function is used both in the decorator and the after_request callback ] if call[name[hasattr], parameter[name[resp]...
keyword[def] identifier[set_cors_headers] ( identifier[resp] , identifier[options] ): literal[string] keyword[if] identifier[hasattr] ( identifier[resp] , identifier[FLASK_CORS_EVALUATED] ): identifier[LOG] . identifier[debug] ( literal[string] ) keyword[return] identifier[resp] ...
def set_cors_headers(resp, options): """ Performs the actual evaluation of Flas-CORS options and actually modifies the response object. This function is used both in the decorator and the after_request callback """ # If CORS has already been evaluated via the decorator, skip if hasattr(...
def backward_inference(self, variables, evidence=None): """ Backward inference method using belief propagation. Parameters: ---------- variables: list list of variables for which you want to compute the probability evidence: dict a dict key, value...
def function[backward_inference, parameter[self, variables, evidence]]: constant[ Backward inference method using belief propagation. Parameters: ---------- variables: list list of variables for which you want to compute the probability evidence: dict ...
keyword[def] identifier[backward_inference] ( identifier[self] , identifier[variables] , identifier[evidence] = keyword[None] ): literal[string] identifier[variable_dict] = identifier[defaultdict] ( identifier[list] ) keyword[for] identifier[var] keyword[in] identifier[variables] : ...
def backward_inference(self, variables, evidence=None): """ Backward inference method using belief propagation. Parameters: ---------- variables: list list of variables for which you want to compute the probability evidence: dict a dict key, value pai...
def main(command_line=True, **kwargs): """ NAME jr6_txt_magic.py DESCRIPTION converts JR6 .txt format files to magic_measurements format files SYNTAX jr6_txt_magic.py [command line options] OPTIONS -h: prints the help message and quits. -f FILE: specify i...
def function[main, parameter[command_line]]: constant[ NAME jr6_txt_magic.py DESCRIPTION converts JR6 .txt format files to magic_measurements format files SYNTAX jr6_txt_magic.py [command line options] OPTIONS -h: prints the help message and quits. -f ...
keyword[def] identifier[main] ( identifier[command_line] = keyword[True] ,** identifier[kwargs] ): literal[string] identifier[noave] = literal[int] identifier[volume] = literal[int] * literal[int] identifier[inst] = literal[string] identifier[samp_con] , identifier[Z] = literal[strin...
def main(command_line=True, **kwargs): """ NAME jr6_txt_magic.py DESCRIPTION converts JR6 .txt format files to magic_measurements format files SYNTAX jr6_txt_magic.py [command line options] OPTIONS -h: prints the help message and quits. -f FILE: specify i...
def parse_responsive_length(responsive_length): """ Takes a string containing a length definition in pixels or percent and parses it to obtain a computational length. It returns a tuple where the first element is the length in pixels and the second element is its length in percent divided by 100. No...
def function[parse_responsive_length, parameter[responsive_length]]: constant[ Takes a string containing a length definition in pixels or percent and parses it to obtain a computational length. It returns a tuple where the first element is the length in pixels and the second element is its length in...
keyword[def] identifier[parse_responsive_length] ( identifier[responsive_length] ): literal[string] identifier[responsive_length] = identifier[responsive_length] . identifier[strip] () keyword[if] identifier[responsive_length] . identifier[endswith] ( literal[string] ): keyword[return] ( ide...
def parse_responsive_length(responsive_length): """ Takes a string containing a length definition in pixels or percent and parses it to obtain a computational length. It returns a tuple where the first element is the length in pixels and the second element is its length in percent divided by 100. No...
async def result_continuation(task): """A preliminary result processor we'll chain on to the original task This will get executed wherever the source task was executed, in this case one of the threads in the ThreadPoolExecutor""" await asyncio.sleep(0.1) num, res = task.result() return num...
<ast.AsyncFunctionDef object at 0x7da18c4ccb80>
keyword[async] keyword[def] identifier[result_continuation] ( identifier[task] ): literal[string] keyword[await] identifier[asyncio] . identifier[sleep] ( literal[int] ) identifier[num] , identifier[res] = identifier[task] . identifier[result] () keyword[return] identifier[num] , identifier[re...
async def result_continuation(task): """A preliminary result processor we'll chain on to the original task This will get executed wherever the source task was executed, in this case one of the threads in the ThreadPoolExecutor""" await asyncio.sleep(0.1) (num, res) = task.result() return (...