code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def get_output_fields(self): """ Get field names from output template. """ # Re-engineer list from output format # XXX TODO: Would be better to use a FieldRecorder class to catch the full field names emit_fields = list(i.lower() for i in re.sub(r"[^_A-Z]+", ' ', self.format_item(...
def function[get_output_fields, parameter[self]]: constant[ Get field names from output template. ] variable[emit_fields] assign[=] call[name[list], parameter[<ast.GeneratorExp object at 0x7da18ede63b0>]] variable[result] assign[=] list[[]] for taget[name[name]] in starred[call[n...
keyword[def] identifier[get_output_fields] ( identifier[self] ): literal[string] identifier[emit_fields] = identifier[list] ( identifier[i] . identifier[lower] () keyword[for] identifier[i] keyword[in] identifier[re] . identifier[sub] ( literal[string] , literal[string] , ident...
def get_output_fields(self): """ Get field names from output template. """ # Re-engineer list from output format # XXX TODO: Would be better to use a FieldRecorder class to catch the full field names emit_fields = list((i.lower() for i in re.sub('[^_A-Z]+', ' ', self.format_item(None)).split()))...
def finalize(): """A function that should be called after parsing all Gin config files. Calling this function allows registered "finalize hooks" to inspect (and potentially modify) the Gin config, to provide additional functionality. Hooks should not modify the configuration object they receive directly; inste...
def function[finalize, parameter[]]: constant[A function that should be called after parsing all Gin config files. Calling this function allows registered "finalize hooks" to inspect (and potentially modify) the Gin config, to provide additional functionality. Hooks should not modify the configuration ob...
keyword[def] identifier[finalize] (): literal[string] keyword[if] identifier[config_is_locked] (): keyword[raise] identifier[RuntimeError] ( literal[string] ) identifier[bindings] ={} keyword[for] identifier[hook] keyword[in] identifier[_FINALIZE_HOOKS] : identifier[new_bindings] = identi...
def finalize(): """A function that should be called after parsing all Gin config files. Calling this function allows registered "finalize hooks" to inspect (and potentially modify) the Gin config, to provide additional functionality. Hooks should not modify the configuration object they receive directly; ins...
def OnReorder(self, event): """Given a request to reorder, tell us to reorder""" column = self.columns[event.GetColumn()] return self.ReorderByColumn( column )
def function[OnReorder, parameter[self, event]]: constant[Given a request to reorder, tell us to reorder] variable[column] assign[=] call[name[self].columns][call[name[event].GetColumn, parameter[]]] return[call[name[self].ReorderByColumn, parameter[name[column]]]]
keyword[def] identifier[OnReorder] ( identifier[self] , identifier[event] ): literal[string] identifier[column] = identifier[self] . identifier[columns] [ identifier[event] . identifier[GetColumn] ()] keyword[return] identifier[self] . identifier[ReorderByColumn] ( identifier[column] )
def OnReorder(self, event): """Given a request to reorder, tell us to reorder""" column = self.columns[event.GetColumn()] return self.ReorderByColumn(column)
def feature_analysis(fname="feature_analysis.png"): """ Create figures for feature analysis """ # Create side-by-side axes grid _, axes = plt.subplots(ncols=2, figsize=(18,6)) # Draw RadViz on the left data = load_occupancy(split=False) oz = RadViz(ax=axes[0], classes=["unoccupied", "o...
def function[feature_analysis, parameter[fname]]: constant[ Create figures for feature analysis ] <ast.Tuple object at 0x7da20c6e5cc0> assign[=] call[name[plt].subplots, parameter[]] variable[data] assign[=] call[name[load_occupancy], parameter[]] variable[oz] assign[=] call[name...
keyword[def] identifier[feature_analysis] ( identifier[fname] = literal[string] ): literal[string] identifier[_] , identifier[axes] = identifier[plt] . identifier[subplots] ( identifier[ncols] = literal[int] , identifier[figsize] =( literal[int] , literal[int] )) identifier[data] = identif...
def feature_analysis(fname='feature_analysis.png'): """ Create figures for feature analysis """ # Create side-by-side axes grid (_, axes) = plt.subplots(ncols=2, figsize=(18, 6)) # Draw RadViz on the left data = load_occupancy(split=False) oz = RadViz(ax=axes[0], classes=['unoccupied', '...
def _build_headers(self, method, auth_session): """Create headers for the request. Parameters method (str) HTTP method (e.g. 'POST'). auth_session (Session) The Session object containing OAuth 2.0 credentials. Returns headers (d...
def function[_build_headers, parameter[self, method, auth_session]]: constant[Create headers for the request. Parameters method (str) HTTP method (e.g. 'POST'). auth_session (Session) The Session object containing OAuth 2.0 credentials. Ret...
keyword[def] identifier[_build_headers] ( identifier[self] , identifier[method] , identifier[auth_session] ): literal[string] identifier[token_type] = identifier[auth_session] . identifier[token_type] identifier[token] = identifier[auth_session] . identifier[oauth2credential] . identifie...
def _build_headers(self, method, auth_session): """Create headers for the request. Parameters method (str) HTTP method (e.g. 'POST'). auth_session (Session) The Session object containing OAuth 2.0 credentials. Returns headers (dict)...
def _get_progress(self): """ Get current progress of emerge. Returns a dict containing current and total value. """ input_data = [] ret = {} # traverse emerge.log from bottom up to get latest information last_lines = self.py3.command_output(["tail", "-50"...
def function[_get_progress, parameter[self]]: constant[ Get current progress of emerge. Returns a dict containing current and total value. ] variable[input_data] assign[=] list[[]] variable[ret] assign[=] dictionary[[], []] variable[last_lines] assign[=] call[name...
keyword[def] identifier[_get_progress] ( identifier[self] ): literal[string] identifier[input_data] =[] identifier[ret] ={} identifier[last_lines] = identifier[self] . identifier[py3] . identifier[command_output] ([ literal[string] , literal[string] , identifier[self] . ...
def _get_progress(self): """ Get current progress of emerge. Returns a dict containing current and total value. """ input_data = [] ret = {} # traverse emerge.log from bottom up to get latest information last_lines = self.py3.command_output(['tail', '-50', self.emerge_log_fil...
def draw(self, X, y, **kwargs): """ Called from the fit method, this method creates the radviz canvas and draws each instance as a class or target colored point, whose location is determined by the feature data set. """ # Convert from dataframe if is_dataframe(X):...
def function[draw, parameter[self, X, y]]: constant[ Called from the fit method, this method creates the radviz canvas and draws each instance as a class or target colored point, whose location is determined by the feature data set. ] if call[name[is_dataframe], parameter...
keyword[def] identifier[draw] ( identifier[self] , identifier[X] , identifier[y] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[is_dataframe] ( identifier[X] ): identifier[X] = identifier[X] . identifier[values] identifier[nan_warning...
def draw(self, X, y, **kwargs): """ Called from the fit method, this method creates the radviz canvas and draws each instance as a class or target colored point, whose location is determined by the feature data set. """ # Convert from dataframe if is_dataframe(X): X =...
def add_global(self, globalvalue): """ Add a new global value. """ assert globalvalue.name not in self.globals self.globals[globalvalue.name] = globalvalue
def function[add_global, parameter[self, globalvalue]]: constant[ Add a new global value. ] assert[compare[name[globalvalue].name <ast.NotIn object at 0x7da2590d7190> name[self].globals]] call[name[self].globals][name[globalvalue].name] assign[=] name[globalvalue]
keyword[def] identifier[add_global] ( identifier[self] , identifier[globalvalue] ): literal[string] keyword[assert] identifier[globalvalue] . identifier[name] keyword[not] keyword[in] identifier[self] . identifier[globals] identifier[self] . identifier[globals] [ identifier[globalvalu...
def add_global(self, globalvalue): """ Add a new global value. """ assert globalvalue.name not in self.globals self.globals[globalvalue.name] = globalvalue
def set_errors(self, errors): """Set parameter error estimate """ if errors is None: self.__errors__ = None return self.__errors__ = [asscalar(e) for e in errors]
def function[set_errors, parameter[self, errors]]: constant[Set parameter error estimate ] if compare[name[errors] is constant[None]] begin[:] name[self].__errors__ assign[=] constant[None] return[None] name[self].__errors__ assign[=] <ast.ListComp object at 0x7da1b014701...
keyword[def] identifier[set_errors] ( identifier[self] , identifier[errors] ): literal[string] keyword[if] identifier[errors] keyword[is] keyword[None] : identifier[self] . identifier[__errors__] = keyword[None] keyword[return] identifier[self] . identifier[_...
def set_errors(self, errors): """Set parameter error estimate """ if errors is None: self.__errors__ = None return # depends on [control=['if'], data=[]] self.__errors__ = [asscalar(e) for e in errors]
def assemble_flash_code(self, asm): """ assemble the given code and program the Flash """ stream = StringIO(asm) worker = assembler.Assembler(self.processor, stream) try: result = worker.assemble() except BaseException as e: return e, None self.flash.program(result) return None, result
def function[assemble_flash_code, parameter[self, asm]]: constant[ assemble the given code and program the Flash ] variable[stream] assign[=] call[name[StringIO], parameter[name[asm]]] variable[worker] assign[=] call[name[assembler].Assembler, parameter[name[self].processor, name[stream]]] ...
keyword[def] identifier[assemble_flash_code] ( identifier[self] , identifier[asm] ): literal[string] identifier[stream] = identifier[StringIO] ( identifier[asm] ) identifier[worker] = identifier[assembler] . identifier[Assembler] ( identifier[self] . identifier[processor] , identifier[stream] ) keyword[t...
def assemble_flash_code(self, asm): """ assemble the given code and program the Flash """ stream = StringIO(asm) worker = assembler.Assembler(self.processor, stream) try: result = worker.assemble() # depends on [control=['try'], data=[]] except BaseException as e: return (e, No...
def setup_smtp_factory(**settings): """ expects a dictionary with 'mail.' keys to create an appropriate smtplib.SMTP instance""" return CustomSMTP( host=settings.get('mail.host', 'localhost'), port=int(settings.get('mail.port', 25)), user=settings.get('mail.user'), password=setti...
def function[setup_smtp_factory, parameter[]]: constant[ expects a dictionary with 'mail.' keys to create an appropriate smtplib.SMTP instance] return[call[name[CustomSMTP], parameter[]]]
keyword[def] identifier[setup_smtp_factory] (** identifier[settings] ): literal[string] keyword[return] identifier[CustomSMTP] ( identifier[host] = identifier[settings] . identifier[get] ( literal[string] , literal[string] ), identifier[port] = identifier[int] ( identifier[settings] . identifier...
def setup_smtp_factory(**settings): """ expects a dictionary with 'mail.' keys to create an appropriate smtplib.SMTP instance""" return CustomSMTP(host=settings.get('mail.host', 'localhost'), port=int(settings.get('mail.port', 25)), user=settings.get('mail.user'), password=settings.get('mail.password'), timeout...
def get_item(self, address, state = 'fresh'): """Get an item from the cache. :Parameters: - `address`: its address. - `state`: the worst state that is acceptable. :Types: - `address`: any hashable - `state`: `str` :return: the item or `No...
def function[get_item, parameter[self, address, state]]: constant[Get an item from the cache. :Parameters: - `address`: its address. - `state`: the worst state that is acceptable. :Types: - `address`: any hashable - `state`: `str` :return...
keyword[def] identifier[get_item] ( identifier[self] , identifier[address] , identifier[state] = literal[string] ): literal[string] identifier[self] . identifier[_lock] . identifier[acquire] () keyword[try] : identifier[item] = identifier[self] . identifier[_items] . identifie...
def get_item(self, address, state='fresh'): """Get an item from the cache. :Parameters: - `address`: its address. - `state`: the worst state that is acceptable. :Types: - `address`: any hashable - `state`: `str` :return: the item or `None` if...
def fit(self, data): """Fit VAR model to data. Parameters ---------- data : array, shape (trials, channels, samples) or (channels, samples) Epoched or continuous data set. Returns ------- self : :class:`VAR` The :class...
def function[fit, parameter[self, data]]: constant[Fit VAR model to data. Parameters ---------- data : array, shape (trials, channels, samples) or (channels, samples) Epoched or continuous data set. Returns ------- self : :class:`...
keyword[def] identifier[fit] ( identifier[self] , identifier[data] ): literal[string] identifier[data] = identifier[atleast_3d] ( identifier[data] ) keyword[if] identifier[self] . identifier[delta] == literal[int] keyword[or] identifier[self] . identifier[delta] keyword[is] keyword[N...
def fit(self, data): """Fit VAR model to data. Parameters ---------- data : array, shape (trials, channels, samples) or (channels, samples) Epoched or continuous data set. Returns ------- self : :class:`VAR` The :class:`VA...
def parse_time_range(start_dt, end_dt): """ Convert the start/end datetimes specified by the user, specifically: - truncate any minutes/seconds - for a missing end time, use start + 24 hours - for a missing start time, use end - 24 hours - for missing start and end, use the last 24 hours """...
def function[parse_time_range, parameter[start_dt, end_dt]]: constant[ Convert the start/end datetimes specified by the user, specifically: - truncate any minutes/seconds - for a missing end time, use start + 24 hours - for a missing start time, use end - 24 hours - for missing start and end...
keyword[def] identifier[parse_time_range] ( identifier[start_dt] , identifier[end_dt] ): literal[string] identifier[now] = identifier[datetime] . identifier[now] () keyword[if] identifier[start_dt] keyword[and] keyword[not] identifier[end_dt] : identifier[end_dt] = identifier[now] ...
def parse_time_range(start_dt, end_dt): """ Convert the start/end datetimes specified by the user, specifically: - truncate any minutes/seconds - for a missing end time, use start + 24 hours - for a missing start time, use end - 24 hours - for missing start and end, use the last 24 hours """...
def _build_query(self): """ Build the base query dictionary """ if isinstance(self._query_string, QueryString): self._query_dsl = self._query_string elif isinstance(self._query_string, string_types): self._query_dsl = QueryString(self._query_string) ...
def function[_build_query, parameter[self]]: constant[ Build the base query dictionary ] if call[name[isinstance], parameter[name[self]._query_string, name[QueryString]]] begin[:] name[self]._query_dsl assign[=] name[self]._query_string
keyword[def] identifier[_build_query] ( identifier[self] ): literal[string] keyword[if] identifier[isinstance] ( identifier[self] . identifier[_query_string] , identifier[QueryString] ): identifier[self] . identifier[_query_dsl] = identifier[self] . identifier[_query_string] ...
def _build_query(self): """ Build the base query dictionary """ if isinstance(self._query_string, QueryString): self._query_dsl = self._query_string # depends on [control=['if'], data=[]] elif isinstance(self._query_string, string_types): self._query_dsl = QueryString(self._...
def scalars_for_mapping_ion_drifts(glats, glons, alts, dates, step_size=None, max_steps=None, e_field_scaling_only=False): """ Calculates scalars for translating ion motions at position glat, glon, and alt, for date, to the footpoints of the field line as well as at t...
def function[scalars_for_mapping_ion_drifts, parameter[glats, glons, alts, dates, step_size, max_steps, e_field_scaling_only]]: constant[ Calculates scalars for translating ion motions at position glat, glon, and alt, for date, to the footpoints of the field line as well as at the magnetic equator. ...
keyword[def] identifier[scalars_for_mapping_ion_drifts] ( identifier[glats] , identifier[glons] , identifier[alts] , identifier[dates] , identifier[step_size] = keyword[None] , identifier[max_steps] = keyword[None] , identifier[e_field_scaling_only] = keyword[False] ): literal[string] keyword[if] identi...
def scalars_for_mapping_ion_drifts(glats, glons, alts, dates, step_size=None, max_steps=None, e_field_scaling_only=False): """ Calculates scalars for translating ion motions at position glat, glon, and alt, for date, to the footpoints of the field line as well as at the magnetic equator. All in...
def reset_hba(self): """Remove all records from pg_hba.conf.""" status = self.get_status() if status == 'not-initialized': raise ClusterError( 'cannot modify HBA records: cluster is not initialized') pg_hba = os.path.join(self._data_dir, 'pg_hba.conf') ...
def function[reset_hba, parameter[self]]: constant[Remove all records from pg_hba.conf.] variable[status] assign[=] call[name[self].get_status, parameter[]] if compare[name[status] equal[==] constant[not-initialized]] begin[:] <ast.Raise object at 0x7da204962bc0> variable[pg_hba]...
keyword[def] identifier[reset_hba] ( identifier[self] ): literal[string] identifier[status] = identifier[self] . identifier[get_status] () keyword[if] identifier[status] == literal[string] : keyword[raise] identifier[ClusterError] ( literal[string] ) i...
def reset_hba(self): """Remove all records from pg_hba.conf.""" status = self.get_status() if status == 'not-initialized': raise ClusterError('cannot modify HBA records: cluster is not initialized') # depends on [control=['if'], data=[]] pg_hba = os.path.join(self._data_dir, 'pg_hba.conf') ...
def coordinate(self): """Returns the maven coordinate of this jar. :rtype: :class:`pants.java.jar.M2Coordinate` """ return M2Coordinate(org=self.org, name=self.name, rev=self.rev, classifier=self.classifier, ext=self.ext)
def function[coordinate, parameter[self]]: constant[Returns the maven coordinate of this jar. :rtype: :class:`pants.java.jar.M2Coordinate` ] return[call[name[M2Coordinate], parameter[]]]
keyword[def] identifier[coordinate] ( identifier[self] ): literal[string] keyword[return] identifier[M2Coordinate] ( identifier[org] = identifier[self] . identifier[org] , identifier[name] = identifier[self] . identifier[name] , identifier[rev] = identifier[self] . identifier[rev] , identifier[classifier]...
def coordinate(self): """Returns the maven coordinate of this jar. :rtype: :class:`pants.java.jar.M2Coordinate` """ return M2Coordinate(org=self.org, name=self.name, rev=self.rev, classifier=self.classifier, ext=self.ext)
def string_literal(content): """ Choose a string literal that can wrap our string. If your string contains a ``\'`` the result will be wrapped in ``\"``. If your string contains a ``\"`` the result will be wrapped in ``\'``. Cannot currently handle strings which contain both ``\"`` and ``\'``. ...
def function[string_literal, parameter[content]]: constant[ Choose a string literal that can wrap our string. If your string contains a ``'`` the result will be wrapped in ``"``. If your string contains a ``"`` the result will be wrapped in ``'``. Cannot currently handle strings which contain ...
keyword[def] identifier[string_literal] ( identifier[content] ): literal[string] keyword[if] literal[string] keyword[in] identifier[content] keyword[and] literal[string] keyword[in] identifier[content] : keyword[raise] identifier[ValueError] ( literal[string] ) keyword[if] lit...
def string_literal(content): """ Choose a string literal that can wrap our string. If your string contains a ``'`` the result will be wrapped in ``"``. If your string contains a ``"`` the result will be wrapped in ``'``. Cannot currently handle strings which contain both ``"`` and ``'``. """ ...
def humanized_model_to_dict(instance, readonly_fields, fields=None, exclude=None): """ Returns a dict containing the humanized data in ``instance`` suitable for passing as a Form's ``initial`` keyword argument. ``fields`` is an optional list of field names. If provided, only the named fields will b...
def function[humanized_model_to_dict, parameter[instance, readonly_fields, fields, exclude]]: constant[ Returns a dict containing the humanized data in ``instance`` suitable for passing as a Form's ``initial`` keyword argument. ``fields`` is an optional list of field names. If provided, only the na...
keyword[def] identifier[humanized_model_to_dict] ( identifier[instance] , identifier[readonly_fields] , identifier[fields] = keyword[None] , identifier[exclude] = keyword[None] ): literal[string] identifier[opts] = identifier[instance] . identifier[_meta] identifier[data] ={} keyword[for] ident...
def humanized_model_to_dict(instance, readonly_fields, fields=None, exclude=None): """ Returns a dict containing the humanized data in ``instance`` suitable for passing as a Form's ``initial`` keyword argument. ``fields`` is an optional list of field names. If provided, only the named fields will b...
def read(self, size=None): """Read at most size bytes from this buffer. Bytes read from this buffer are consumed and are permanently removed. Args: size: If provided, read no more than size bytes from the buffer. Otherwise, this reads the entire buffer. Returns: ...
def function[read, parameter[self, size]]: constant[Read at most size bytes from this buffer. Bytes read from this buffer are consumed and are permanently removed. Args: size: If provided, read no more than size bytes from the buffer. Otherwise, this reads the entire buff...
keyword[def] identifier[read] ( identifier[self] , identifier[size] = keyword[None] ): literal[string] keyword[if] identifier[size] keyword[is] keyword[None] : identifier[size] = identifier[self] . identifier[__size] identifier[ret_list] =[] keyword[while] identi...
def read(self, size=None): """Read at most size bytes from this buffer. Bytes read from this buffer are consumed and are permanently removed. Args: size: If provided, read no more than size bytes from the buffer. Otherwise, this reads the entire buffer. Returns: ...
def multiscale_permutation_entropy(time_series, m, delay, scale): """Calculate the Multiscale Permutation Entropy Args: time_series: Time series for analysis m: Order of permutation entropy delay: Time delay scale: Scale factor Returns: Vector containing Multiscale ...
def function[multiscale_permutation_entropy, parameter[time_series, m, delay, scale]]: constant[Calculate the Multiscale Permutation Entropy Args: time_series: Time series for analysis m: Order of permutation entropy delay: Time delay scale: Scale factor Returns: ...
keyword[def] identifier[multiscale_permutation_entropy] ( identifier[time_series] , identifier[m] , identifier[delay] , identifier[scale] ): literal[string] identifier[mspe] =[] keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[scale] ): identifier[coarse_time_series] =...
def multiscale_permutation_entropy(time_series, m, delay, scale): """Calculate the Multiscale Permutation Entropy Args: time_series: Time series for analysis m: Order of permutation entropy delay: Time delay scale: Scale factor Returns: Vector containing Multiscale ...
def splitext(path): """splitext for paths with directories that may contain dots. From https://stackoverflow.com/questions/5930036/separating-file-extensions-using-python-os-path-module""" li = [] path_without_extensions = os.path.join(os.path.dirname(path), os.path.basename(path).split(os.extse...
def function[splitext, parameter[path]]: constant[splitext for paths with directories that may contain dots. From https://stackoverflow.com/questions/5930036/separating-file-extensions-using-python-os-path-module] variable[li] assign[=] list[[]] variable[path_without_extensions] assign[=] ca...
keyword[def] identifier[splitext] ( identifier[path] ): literal[string] identifier[li] =[] identifier[path_without_extensions] = identifier[os] . identifier[path] . identifier[join] ( identifier[os] . identifier[path] . identifier[dirname] ( identifier[path] ), identifier[os] . identifier[path] ....
def splitext(path): """splitext for paths with directories that may contain dots. From https://stackoverflow.com/questions/5930036/separating-file-extensions-using-python-os-path-module""" li = [] path_without_extensions = os.path.join(os.path.dirname(path), os.path.basename(path).split(os.extsep)[0]) ...
def get_withdrawals(self, currency=None, status=None, start=None, end=None, page=None, limit=None): """Get deposit records for a currency https://docs.kucoin.com/#get-withdrawals-list :param currency: Name of currency (optional) :type currency: string :param status: optional - ...
def function[get_withdrawals, parameter[self, currency, status, start, end, page, limit]]: constant[Get deposit records for a currency https://docs.kucoin.com/#get-withdrawals-list :param currency: Name of currency (optional) :type currency: string :param status: optional - Sta...
keyword[def] identifier[get_withdrawals] ( identifier[self] , identifier[currency] = keyword[None] , identifier[status] = keyword[None] , identifier[start] = keyword[None] , identifier[end] = keyword[None] , identifier[page] = keyword[None] , identifier[limit] = keyword[None] ): literal[string] id...
def get_withdrawals(self, currency=None, status=None, start=None, end=None, page=None, limit=None): """Get deposit records for a currency https://docs.kucoin.com/#get-withdrawals-list :param currency: Name of currency (optional) :type currency: string :param status: optional - Stat...
def search(self, **kwargs): """ :param entity_id: location id :param entity_type: location type (city, subzone, zone, lanmark, metro , group) :param q: search keyword :param start: fetch results after offset :param count: max number of results to display :param la...
def function[search, parameter[self]]: constant[ :param entity_id: location id :param entity_type: location type (city, subzone, zone, lanmark, metro , group) :param q: search keyword :param start: fetch results after offset :param count: max number of results to display ...
keyword[def] identifier[search] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[params] ={} identifier[available_params] =[ literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] ...
def search(self, **kwargs): """ :param entity_id: location id :param entity_type: location type (city, subzone, zone, lanmark, metro , group) :param q: search keyword :param start: fetch results after offset :param count: max number of results to display :param lat: l...
def run_run(self, run, conf=None, run_conf=None, use_thread=False, catch_exception=True): '''Runs a run in another thread. Non-blocking. Parameters ---------- run : class, object Run class or object. run_conf : str, dict, file Specific configuration for t...
def function[run_run, parameter[self, run, conf, run_conf, use_thread, catch_exception]]: constant[Runs a run in another thread. Non-blocking. Parameters ---------- run : class, object Run class or object. run_conf : str, dict, file Specific configuration...
keyword[def] identifier[run_run] ( identifier[self] , identifier[run] , identifier[conf] = keyword[None] , identifier[run_conf] = keyword[None] , identifier[use_thread] = keyword[False] , identifier[catch_exception] = keyword[True] ): literal[string] keyword[if] identifier[isinstance] ( identifier...
def run_run(self, run, conf=None, run_conf=None, use_thread=False, catch_exception=True): """Runs a run in another thread. Non-blocking. Parameters ---------- run : class, object Run class or object. run_conf : str, dict, file Specific configuration for the r...
def within_bounds( self, start: timelike, stop: timelike, bounds: Union[BaseGeometry, Tuple[float, float, float, float]], ) -> Optional[pd.DataFrame]: """EXPERIMENTAL.""" start = to_datetime(start) stop = to_datetime(stop) before_hour = round_time(st...
def function[within_bounds, parameter[self, start, stop, bounds]]: constant[EXPERIMENTAL.] variable[start] assign[=] call[name[to_datetime], parameter[name[start]]] variable[stop] assign[=] call[name[to_datetime], parameter[name[stop]]] variable[before_hour] assign[=] call[name[round_tim...
keyword[def] identifier[within_bounds] ( identifier[self] , identifier[start] : identifier[timelike] , identifier[stop] : identifier[timelike] , identifier[bounds] : identifier[Union] [ identifier[BaseGeometry] , identifier[Tuple] [ identifier[float] , identifier[float] , identifier[float] , identifier[float] ]],...
def within_bounds(self, start: timelike, stop: timelike, bounds: Union[BaseGeometry, Tuple[float, float, float, float]]) -> Optional[pd.DataFrame]: """EXPERIMENTAL.""" start = to_datetime(start) stop = to_datetime(stop) before_hour = round_time(start, 'before') after_hour = round_time(stop, 'after')...
def mount_configure_send(self, target_system, target_component, mount_mode, stab_roll, stab_pitch, stab_yaw, force_mavlink1=False): ''' Message to configure a camera mount, directional antenna, etc. target_system : System ID (uint8_t) target_c...
def function[mount_configure_send, parameter[self, target_system, target_component, mount_mode, stab_roll, stab_pitch, stab_yaw, force_mavlink1]]: constant[ Message to configure a camera mount, directional antenna, etc. target_system : System ID (uint8_t) ...
keyword[def] identifier[mount_configure_send] ( identifier[self] , identifier[target_system] , identifier[target_component] , identifier[mount_mode] , identifier[stab_roll] , identifier[stab_pitch] , identifier[stab_yaw] , identifier[force_mavlink1] = keyword[False] ): literal[string] ...
def mount_configure_send(self, target_system, target_component, mount_mode, stab_roll, stab_pitch, stab_yaw, force_mavlink1=False): """ Message to configure a camera mount, directional antenna, etc. target_system : System ID (uint8_t) target_component ...
def __analizar_evento(self, ret): "Comprueba y extrae el wvento informativo si existen en la respuesta XML" evt = ret.get('evento') if evt: self.Eventos = [evt] self.Evento = "%(codigo)s: %(descripcion)s" % evt
def function[__analizar_evento, parameter[self, ret]]: constant[Comprueba y extrae el wvento informativo si existen en la respuesta XML] variable[evt] assign[=] call[name[ret].get, parameter[constant[evento]]] if name[evt] begin[:] name[self].Eventos assign[=] list[[<ast.Name obj...
keyword[def] identifier[__analizar_evento] ( identifier[self] , identifier[ret] ): literal[string] identifier[evt] = identifier[ret] . identifier[get] ( literal[string] ) keyword[if] identifier[evt] : identifier[self] . identifier[Eventos] =[ identifier[evt] ] id...
def __analizar_evento(self, ret): """Comprueba y extrae el wvento informativo si existen en la respuesta XML""" evt = ret.get('evento') if evt: self.Eventos = [evt] self.Evento = '%(codigo)s: %(descripcion)s' % evt # depends on [control=['if'], data=[]]
def get_track_scrobbles(self, artist, track, cacheable=False): """ Get a list of this user's scrobbles of this artist's track, including scrobble time. """ params = self._get_params() params["artist"] = artist params["track"] = track seq = [] for...
def function[get_track_scrobbles, parameter[self, artist, track, cacheable]]: constant[ Get a list of this user's scrobbles of this artist's track, including scrobble time. ] variable[params] assign[=] call[name[self]._get_params, parameter[]] call[name[params]][constant[...
keyword[def] identifier[get_track_scrobbles] ( identifier[self] , identifier[artist] , identifier[track] , identifier[cacheable] = keyword[False] ): literal[string] identifier[params] = identifier[self] . identifier[_get_params] () identifier[params] [ literal[string] ]= identifier[artist...
def get_track_scrobbles(self, artist, track, cacheable=False): """ Get a list of this user's scrobbles of this artist's track, including scrobble time. """ params = self._get_params() params['artist'] = artist params['track'] = track seq = [] for track in _collect_nodes(N...
def setTags(self, tags): """Set the tags for current photo to list tags. (flickr.photos.settags) """ method = 'flickr.photos.setTags' tags = uniq(tags) _dopost(method, auth=True, photo_id=self.id, tags=tags) self._load_properties()
def function[setTags, parameter[self, tags]]: constant[Set the tags for current photo to list tags. (flickr.photos.settags) ] variable[method] assign[=] constant[flickr.photos.setTags] variable[tags] assign[=] call[name[uniq], parameter[name[tags]]] call[name[_dopost], pa...
keyword[def] identifier[setTags] ( identifier[self] , identifier[tags] ): literal[string] identifier[method] = literal[string] identifier[tags] = identifier[uniq] ( identifier[tags] ) identifier[_dopost] ( identifier[method] , identifier[auth] = keyword[True] , identifier[photo_i...
def setTags(self, tags): """Set the tags for current photo to list tags. (flickr.photos.settags) """ method = 'flickr.photos.setTags' tags = uniq(tags) _dopost(method, auth=True, photo_id=self.id, tags=tags) self._load_properties()
def _has_valid_abs_ref(self, i, construction_table): """Checks, if ``i`` uses valid absolute references. Checks for each index from first to third row of the ``construction_table``, if the references are colinear. This case has to be specially treated, because the references are...
def function[_has_valid_abs_ref, parameter[self, i, construction_table]]: constant[Checks, if ``i`` uses valid absolute references. Checks for each index from first to third row of the ``construction_table``, if the references are colinear. This case has to be specially treated, because...
keyword[def] identifier[_has_valid_abs_ref] ( identifier[self] , identifier[i] , identifier[construction_table] ): literal[string] identifier[c_table] = identifier[construction_table] identifier[abs_refs] = identifier[constants] . identifier[absolute_refs] identifier[A] = identi...
def _has_valid_abs_ref(self, i, construction_table): """Checks, if ``i`` uses valid absolute references. Checks for each index from first to third row of the ``construction_table``, if the references are colinear. This case has to be specially treated, because the references are not...
def _generateChildren(self): """Generator which yields all AXChildren of the object.""" try: children = self.AXChildren except _a11y.Error: return if children: for child in children: yield child
def function[_generateChildren, parameter[self]]: constant[Generator which yields all AXChildren of the object.] <ast.Try object at 0x7da18f810ee0> if name[children] begin[:] for taget[name[child]] in starred[name[children]] begin[:] <ast.Yield object at 0x7da...
keyword[def] identifier[_generateChildren] ( identifier[self] ): literal[string] keyword[try] : identifier[children] = identifier[self] . identifier[AXChildren] keyword[except] identifier[_a11y] . identifier[Error] : keyword[return] keyword[if] identi...
def _generateChildren(self): """Generator which yields all AXChildren of the object.""" try: children = self.AXChildren # depends on [control=['try'], data=[]] except _a11y.Error: return # depends on [control=['except'], data=[]] if children: for child in children: ...
def _get_activation(self, F, inputs, activation, **kwargs): """Get activation function. Convert if is string""" func = {'tanh': F.tanh, 'relu': F.relu, 'sigmoid': F.sigmoid, 'softsign': F.softsign}.get(activation) if func: return func(i...
def function[_get_activation, parameter[self, F, inputs, activation]]: constant[Get activation function. Convert if is string] variable[func] assign[=] call[dictionary[[<ast.Constant object at 0x7da1b20f9750>, <ast.Constant object at 0x7da1b1fe3520>, <ast.Constant object at 0x7da1b1fe33a0>, <ast.Constan...
keyword[def] identifier[_get_activation] ( identifier[self] , identifier[F] , identifier[inputs] , identifier[activation] ,** identifier[kwargs] ): literal[string] identifier[func] ={ literal[string] : identifier[F] . identifier[tanh] , literal[string] : identifier[F] . identifier[relu] , ...
def _get_activation(self, F, inputs, activation, **kwargs): """Get activation function. Convert if is string""" func = {'tanh': F.tanh, 'relu': F.relu, 'sigmoid': F.sigmoid, 'softsign': F.softsign}.get(activation) if func: return func(inputs, **kwargs) # depends on [control=['if'], data=[]] eli...
def define_code_breakpoint(self, dwProcessId, address, condition = True, action = None): """ Creates a disabled code breakpoint at the given address. @see: L{has_code_breakpoint}, L{get_code_breakpoint}, ...
def function[define_code_breakpoint, parameter[self, dwProcessId, address, condition, action]]: constant[ Creates a disabled code breakpoint at the given address. @see: L{has_code_breakpoint}, L{get_code_breakpoint}, L{enable_code_breakpoint}, L{e...
keyword[def] identifier[define_code_breakpoint] ( identifier[self] , identifier[dwProcessId] , identifier[address] , identifier[condition] = keyword[True] , identifier[action] = keyword[None] ): literal[string] identifier[process] = identifier[self] . identifier[system] . identifier[get_process] (...
def define_code_breakpoint(self, dwProcessId, address, condition=True, action=None): """ Creates a disabled code breakpoint at the given address. @see: L{has_code_breakpoint}, L{get_code_breakpoint}, L{enable_code_breakpoint}, L{enable_one_shot_code_b...
def find_video_by_url(self, video_url): """doc: http://open.youku.com/docs/doc?id=44 """ url = 'https://openapi.youku.com/v2/videos/show_basic.json' params = { 'client_id': self.client_id, 'video_url': video_url } r = requests.get(url, params=param...
def function[find_video_by_url, parameter[self, video_url]]: constant[doc: http://open.youku.com/docs/doc?id=44 ] variable[url] assign[=] constant[https://openapi.youku.com/v2/videos/show_basic.json] variable[params] assign[=] dictionary[[<ast.Constant object at 0x7da1b255ceb0>, <ast.Con...
keyword[def] identifier[find_video_by_url] ( identifier[self] , identifier[video_url] ): literal[string] identifier[url] = literal[string] identifier[params] ={ literal[string] : identifier[self] . identifier[client_id] , literal[string] : identifier[video_url] ...
def find_video_by_url(self, video_url): """doc: http://open.youku.com/docs/doc?id=44 """ url = 'https://openapi.youku.com/v2/videos/show_basic.json' params = {'client_id': self.client_id, 'video_url': video_url} r = requests.get(url, params=params) check_error(r) return r.json()
def expand_node(loader, node, expand_method): """ Expands paths on a YAML document node. If it is a sequence node (list) items on the first level are expanded. For a mapping node (dict), values are expanded. :param loader: YAML loader. :type loader: yaml.loader.SafeLoader :param node: Document ...
def function[expand_node, parameter[loader, node, expand_method]]: constant[ Expands paths on a YAML document node. If it is a sequence node (list) items on the first level are expanded. For a mapping node (dict), values are expanded. :param loader: YAML loader. :type loader: yaml.loader.SafeLo...
keyword[def] identifier[expand_node] ( identifier[loader] , identifier[node] , identifier[expand_method] ): literal[string] keyword[if] identifier[isinstance] ( identifier[node] , identifier[yaml] . identifier[nodes] . identifier[ScalarNode] ): identifier[val] = identifier[loader] . identifier[co...
def expand_node(loader, node, expand_method): """ Expands paths on a YAML document node. If it is a sequence node (list) items on the first level are expanded. For a mapping node (dict), values are expanded. :param loader: YAML loader. :type loader: yaml.loader.SafeLoader :param node: Document ...
def check_options(options, parser): """ check options requirements, print and return exit value """ if not options.get('release_environment', None): print("release environment is required") parser.print_help() return os.EX_USAGE return 0
def function[check_options, parameter[options, parser]]: constant[ check options requirements, print and return exit value ] if <ast.UnaryOp object at 0x7da18f09f520> begin[:] call[name[print], parameter[constant[release environment is required]]] call[name[parser...
keyword[def] identifier[check_options] ( identifier[options] , identifier[parser] ): literal[string] keyword[if] keyword[not] identifier[options] . identifier[get] ( literal[string] , keyword[None] ): identifier[print] ( literal[string] ) identifier[parser] . identifier[print_help] () ...
def check_options(options, parser): """ check options requirements, print and return exit value """ if not options.get('release_environment', None): print('release environment is required') parser.print_help() return os.EX_USAGE # depends on [control=['if'], data=[]] return ...
def direct_messages_destroy(self, id, include_entities=None): """ Destroys the direct message with the given id. https://dev.twitter.com/docs/api/1.1/post/direct_messages/destroy :param str id: (*required*) The ID of the direct message. :param bool include_entities:...
def function[direct_messages_destroy, parameter[self, id, include_entities]]: constant[ Destroys the direct message with the given id. https://dev.twitter.com/docs/api/1.1/post/direct_messages/destroy :param str id: (*required*) The ID of the direct message. :param ...
keyword[def] identifier[direct_messages_destroy] ( identifier[self] , identifier[id] , identifier[include_entities] = keyword[None] ): literal[string] identifier[params] ={} identifier[set_str_param] ( identifier[params] , literal[string] , identifier[id] ) identifier[set_bool_par...
def direct_messages_destroy(self, id, include_entities=None): """ Destroys the direct message with the given id. https://dev.twitter.com/docs/api/1.1/post/direct_messages/destroy :param str id: (*required*) The ID of the direct message. :param bool include_entities: ...
def create_decompress(codec_format): """Creates a J2K/JP2 decompress structure. Wraps the openjp2 library function opj_create_decompress. Parameters ---------- codec_format : int Specifies codec to select. Should be one of CODEC_J2K or CODEC_JP2. Returns ------- codec : Refer...
def function[create_decompress, parameter[codec_format]]: constant[Creates a J2K/JP2 decompress structure. Wraps the openjp2 library function opj_create_decompress. Parameters ---------- codec_format : int Specifies codec to select. Should be one of CODEC_J2K or CODEC_JP2. Return...
keyword[def] identifier[create_decompress] ( identifier[codec_format] ): literal[string] identifier[OPENJP2] . identifier[opj_create_decompress] . identifier[argtypes] =[ identifier[CODEC_FORMAT_TYPE] ] identifier[OPENJP2] . identifier[opj_create_decompress] . identifier[restype] = identifier[CODEC_TY...
def create_decompress(codec_format): """Creates a J2K/JP2 decompress structure. Wraps the openjp2 library function opj_create_decompress. Parameters ---------- codec_format : int Specifies codec to select. Should be one of CODEC_J2K or CODEC_JP2. Returns ------- codec : Refer...
def GpsSecondsFromPyUTC( pyUTC, leapSecs=14 ): """converts the python epoch to gps seconds pyEpoch = the python epoch from time.time() """ t = t=gpsFromUTC(*ymdhmsFromPyUTC( pyUTC )) return int(t[0] * 60 * 60 * 24 * 7 + t[1])
def function[GpsSecondsFromPyUTC, parameter[pyUTC, leapSecs]]: constant[converts the python epoch to gps seconds pyEpoch = the python epoch from time.time() ] variable[t] assign[=] call[name[gpsFromUTC], parameter[<ast.Starred object at 0x7da18f722e60>]] return[call[name[int], parameter[bin...
keyword[def] identifier[GpsSecondsFromPyUTC] ( identifier[pyUTC] , identifier[leapSecs] = literal[int] ): literal[string] identifier[t] = identifier[t] = identifier[gpsFromUTC] (* identifier[ymdhmsFromPyUTC] ( identifier[pyUTC] )) keyword[return] identifier[int] ( identifier[t] [ literal[int] ]* lite...
def GpsSecondsFromPyUTC(pyUTC, leapSecs=14): """converts the python epoch to gps seconds pyEpoch = the python epoch from time.time() """ t = t = gpsFromUTC(*ymdhmsFromPyUTC(pyUTC)) return int(t[0] * 60 * 60 * 24 * 7 + t[1])
def cookiejar_from_dict(*cookie_dicts): """Returns a CookieJar from a key/value dictionary. :param cookie_dict: Dict of key/values to insert into CookieJar. """ cookie_dicts = tuple((d for d in cookie_dicts if d)) if len(cookie_dicts) == 1 and isinstance(cookie_dicts[0], CookieJar): return ...
def function[cookiejar_from_dict, parameter[]]: constant[Returns a CookieJar from a key/value dictionary. :param cookie_dict: Dict of key/values to insert into CookieJar. ] variable[cookie_dicts] assign[=] call[name[tuple], parameter[<ast.GeneratorExp object at 0x7da18c4cd8d0>]] if <ast...
keyword[def] identifier[cookiejar_from_dict] (* identifier[cookie_dicts] ): literal[string] identifier[cookie_dicts] = identifier[tuple] (( identifier[d] keyword[for] identifier[d] keyword[in] identifier[cookie_dicts] keyword[if] identifier[d] )) keyword[if] identifier[len] ( identifier[cookie_...
def cookiejar_from_dict(*cookie_dicts): """Returns a CookieJar from a key/value dictionary. :param cookie_dict: Dict of key/values to insert into CookieJar. """ cookie_dicts = tuple((d for d in cookie_dicts if d)) if len(cookie_dicts) == 1 and isinstance(cookie_dicts[0], CookieJar): return ...
def check_install_json(self): """Check all install.json files for valid schema.""" if self.install_json_schema is None: return contents = os.listdir(self.app_path) if self.args.install_json is not None: contents = [self.args.install_json] for install_jso...
def function[check_install_json, parameter[self]]: constant[Check all install.json files for valid schema.] if compare[name[self].install_json_schema is constant[None]] begin[:] return[None] variable[contents] assign[=] call[name[os].listdir, parameter[name[self].app_path]] if co...
keyword[def] identifier[check_install_json] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[install_json_schema] keyword[is] keyword[None] : keyword[return] identifier[contents] = identifier[os] . identifier[listdir] ( identifier[self] . id...
def check_install_json(self): """Check all install.json files for valid schema.""" if self.install_json_schema is None: return # depends on [control=['if'], data=[]] contents = os.listdir(self.app_path) if self.args.install_json is not None: contents = [self.args.install_json] # depend...
def replay(self, event, ts=0, end_ts=None, with_ts=False): """Replay events based on timestamp. If you split namespace with ts, the replay will only return events within the same namespace. :param event: event name :param ts: replay events after ts, default from 0. :par...
def function[replay, parameter[self, event, ts, end_ts, with_ts]]: constant[Replay events based on timestamp. If you split namespace with ts, the replay will only return events within the same namespace. :param event: event name :param ts: replay events after ts, default from 0...
keyword[def] identifier[replay] ( identifier[self] , identifier[event] , identifier[ts] = literal[int] , identifier[end_ts] = keyword[None] , identifier[with_ts] = keyword[False] ): literal[string] identifier[key] = identifier[self] . identifier[_keygen] ( identifier[event] , identifier[ts] ) ...
def replay(self, event, ts=0, end_ts=None, with_ts=False): """Replay events based on timestamp. If you split namespace with ts, the replay will only return events within the same namespace. :param event: event name :param ts: replay events after ts, default from 0. :param e...
def get_graph_data(self, graph, benchmark): """ Iterator over graph data sets Yields ------ param_idx Flat index to parameter permutations for parameterized benchmarks. None if benchmark is not parameterized. entry_name Name for the da...
def function[get_graph_data, parameter[self, graph, benchmark]]: constant[ Iterator over graph data sets Yields ------ param_idx Flat index to parameter permutations for parameterized benchmarks. None if benchmark is not parameterized. entry_name ...
keyword[def] identifier[get_graph_data] ( identifier[self] , identifier[graph] , identifier[benchmark] ): literal[string] keyword[if] identifier[benchmark] . identifier[get] ( literal[string] ): identifier[param_iter] = identifier[enumerate] ( identifier[zip] ( identifier[itertools] ....
def get_graph_data(self, graph, benchmark): """ Iterator over graph data sets Yields ------ param_idx Flat index to parameter permutations for parameterized benchmarks. None if benchmark is not parameterized. entry_name Name for the data s...
def _mark_received(self, tsn): """ Mark an incoming data TSN as received. """ # it's a duplicate if uint32_gte(self._last_received_tsn, tsn) or tsn in self._sack_misordered: self._sack_duplicates.append(tsn) return True # consolidate misordered en...
def function[_mark_received, parameter[self, tsn]]: constant[ Mark an incoming data TSN as received. ] if <ast.BoolOp object at 0x7da204963be0> begin[:] call[name[self]._sack_duplicates.append, parameter[name[tsn]]] return[constant[True]] call[name[self]._...
keyword[def] identifier[_mark_received] ( identifier[self] , identifier[tsn] ): literal[string] keyword[if] identifier[uint32_gte] ( identifier[self] . identifier[_last_received_tsn] , identifier[tsn] ) keyword[or] identifier[tsn] keyword[in] identifier[self] . identifier[_sack_misorde...
def _mark_received(self, tsn): """ Mark an incoming data TSN as received. """ # it's a duplicate if uint32_gte(self._last_received_tsn, tsn) or tsn in self._sack_misordered: self._sack_duplicates.append(tsn) return True # depends on [control=['if'], data=[]] # consolidat...
def _moments_central(data, center=None, order=1): """ Calculate the central image moments up to the specified order. Parameters ---------- data : 2D array-like The input 2D array. center : tuple of two floats or `None`, optional The ``(x, y)`` center position. If `None` it wil...
def function[_moments_central, parameter[data, center, order]]: constant[ Calculate the central image moments up to the specified order. Parameters ---------- data : 2D array-like The input 2D array. center : tuple of two floats or `None`, optional The ``(x, y)`` center pos...
keyword[def] identifier[_moments_central] ( identifier[data] , identifier[center] = keyword[None] , identifier[order] = literal[int] ): literal[string] identifier[data] = identifier[np] . identifier[asarray] ( identifier[data] ). identifier[astype] ( identifier[float] ) keyword[if] identifier[data]...
def _moments_central(data, center=None, order=1): """ Calculate the central image moments up to the specified order. Parameters ---------- data : 2D array-like The input 2D array. center : tuple of two floats or `None`, optional The ``(x, y)`` center position. If `None` it wil...
def display_message( self, subject='Find My iPhone Alert', message="This is a note", sounds=False ): """ Send a request to the device to play a sound. It's possible to pass a custom message by changing the `subject`. """ data = json.dumps( { ...
def function[display_message, parameter[self, subject, message, sounds]]: constant[ Send a request to the device to play a sound. It's possible to pass a custom message by changing the `subject`. ] variable[data] assign[=] call[name[json].dumps, parameter[dictionary[[<ast.Constant objec...
keyword[def] identifier[display_message] ( identifier[self] , identifier[subject] = literal[string] , identifier[message] = literal[string] , identifier[sounds] = keyword[False] ): literal[string] identifier[data] = identifier[json] . identifier[dumps] ( { literal[string] : iden...
def display_message(self, subject='Find My iPhone Alert', message='This is a note', sounds=False): """ Send a request to the device to play a sound. It's possible to pass a custom message by changing the `subject`. """ data = json.dumps({'device': self.content['id'], 'subject': subject, 'sound'...
def read(self, size=0): """Read a chunk of bytes from queue. size = 0: Read next chunk (arbitrary length) > 0: Read one chunk of `size` bytes (or less if stream was closed) < 0: Read all bytes as single chunk (i.e. blocks until stream is closed) This method blocks unt...
def function[read, parameter[self, size]]: constant[Read a chunk of bytes from queue. size = 0: Read next chunk (arbitrary length) > 0: Read one chunk of `size` bytes (or less if stream was closed) < 0: Read all bytes as single chunk (i.e. blocks until stream is closed) ...
keyword[def] identifier[read] ( identifier[self] , identifier[size] = literal[int] ): literal[string] identifier[res] = identifier[self] . identifier[unread] identifier[self] . identifier[unread] = literal[string] keyword[while] identifier[res] == literal[string] keyw...
def read(self, size=0): """Read a chunk of bytes from queue. size = 0: Read next chunk (arbitrary length) > 0: Read one chunk of `size` bytes (or less if stream was closed) < 0: Read all bytes as single chunk (i.e. blocks until stream is closed) This method blocks until t...
def present(name, block_icmp=None, prune_block_icmp=False, default=None, masquerade=False, ports=None, prune_ports=False, port_fwd=None, prune_port_fwd=False, services=None, prune_services=False, ...
def function[present, parameter[name, block_icmp, prune_block_icmp, default, masquerade, ports, prune_ports, port_fwd, prune_port_fwd, services, prune_services, interfaces, prune_interfaces, sources, prune_sources, rich_rules, prune_rich_rules]]: constant[ Ensure a zone has specific attributes. name ...
keyword[def] identifier[present] ( identifier[name] , identifier[block_icmp] = keyword[None] , identifier[prune_block_icmp] = keyword[False] , identifier[default] = keyword[None] , identifier[masquerade] = keyword[False] , identifier[ports] = keyword[None] , identifier[prune_ports] = keyword[False] , identifie...
def present(name, block_icmp=None, prune_block_icmp=False, default=None, masquerade=False, ports=None, prune_ports=False, port_fwd=None, prune_port_fwd=False, services=None, prune_services=False, interfaces=None, prune_interfaces=False, sources=None, prune_sources=False, rich_rules=None, prune_rich_rules=False): ""...
def add_io_hook(self, hook): """ Args: hook: This hook will be invoked for every incoming and outgoing CAN frame. Hook arguments: (direction, frame) See FRAME_DIRECTION_*, CANFrame. """ def proxy(*args): hook(*args) ...
def function[add_io_hook, parameter[self, hook]]: constant[ Args: hook: This hook will be invoked for every incoming and outgoing CAN frame. Hook arguments: (direction, frame) See FRAME_DIRECTION_*, CANFrame. ] def function[proxy, par...
keyword[def] identifier[add_io_hook] ( identifier[self] , identifier[hook] ): literal[string] keyword[def] identifier[proxy] (* identifier[args] ): identifier[hook] (* identifier[args] ) identifier[self] . identifier[_io_hooks] . identifier[append] ( identifier[proxy] ) ...
def add_io_hook(self, hook): """ Args: hook: This hook will be invoked for every incoming and outgoing CAN frame. Hook arguments: (direction, frame) See FRAME_DIRECTION_*, CANFrame. """ def proxy(*args): hook(*args) self._io_hook...
def check_homepage(package_info, *args): """ Does the package have a homepage listed? :param package_info: package_info dictionary :return: Tuple (is the condition True or False?, reason if it is False else None) """ reason = "Home page missing" result = False if package_info.get('home_...
def function[check_homepage, parameter[package_info]]: constant[ Does the package have a homepage listed? :param package_info: package_info dictionary :return: Tuple (is the condition True or False?, reason if it is False else None) ] variable[reason] assign[=] constant[Home page missing...
keyword[def] identifier[check_homepage] ( identifier[package_info] ,* identifier[args] ): literal[string] identifier[reason] = literal[string] identifier[result] = keyword[False] keyword[if] identifier[package_info] . identifier[get] ( literal[string] ) keyword[not] keyword[in] identifier[B...
def check_homepage(package_info, *args): """ Does the package have a homepage listed? :param package_info: package_info dictionary :return: Tuple (is the condition True or False?, reason if it is False else None) """ reason = 'Home page missing' result = False if package_info.get('home_p...
def remove_request_init_listener(self, fn, *args, **kwargs): """ Removes a callback and arguments from the list. See :meth:`.Session.add_request_init_listener`. """ self._request_init_callbacks.remove((fn, args, kwargs))
def function[remove_request_init_listener, parameter[self, fn]]: constant[ Removes a callback and arguments from the list. See :meth:`.Session.add_request_init_listener`. ] call[name[self]._request_init_callbacks.remove, parameter[tuple[[<ast.Name object at 0x7da2046227a0>, <ast...
keyword[def] identifier[remove_request_init_listener] ( identifier[self] , identifier[fn] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[self] . identifier[_request_init_callbacks] . identifier[remove] (( identifier[fn] , identifier[args] , identifier[kwargs] ))
def remove_request_init_listener(self, fn, *args, **kwargs): """ Removes a callback and arguments from the list. See :meth:`.Session.add_request_init_listener`. """ self._request_init_callbacks.remove((fn, args, kwargs))
def task_collection_thread_handler(self, results_queue): """Main method for worker to run Pops a chunk of tasks off the collection of pending tasks to be added and submits them to be added. :param collections.deque results_queue: Queue for worker to output results to """ # Add ...
def function[task_collection_thread_handler, parameter[self, results_queue]]: constant[Main method for worker to run Pops a chunk of tasks off the collection of pending tasks to be added and submits them to be added. :param collections.deque results_queue: Queue for worker to output results to...
keyword[def] identifier[task_collection_thread_handler] ( identifier[self] , identifier[results_queue] ): literal[string] keyword[while] identifier[self] . identifier[tasks_to_add] keyword[and] keyword[not] identifier[self] . identifier[errors] : identifier[max_tasks] = id...
def task_collection_thread_handler(self, results_queue): """Main method for worker to run Pops a chunk of tasks off the collection of pending tasks to be added and submits them to be added. :param collections.deque results_queue: Queue for worker to output results to """ # Add tasks un...
def _merge_map(key, values, partial): """A map function used in merge phase. Stores (key, values) into KeyValues proto and yields its serialization. Args: key: values key. values: values themselves. partial: True if more values for this key will follow. False otherwise. Yields: The proto. "...
def function[_merge_map, parameter[key, values, partial]]: constant[A map function used in merge phase. Stores (key, values) into KeyValues proto and yields its serialization. Args: key: values key. values: values themselves. partial: True if more values for this key will follow. False otherwi...
keyword[def] identifier[_merge_map] ( identifier[key] , identifier[values] , identifier[partial] ): literal[string] identifier[proto] = identifier[kv_pb] . identifier[KeyValues] () identifier[proto] . identifier[set_key] ( identifier[key] ) identifier[proto] . identifier[value_list] (). identifier[extend...
def _merge_map(key, values, partial): """A map function used in merge phase. Stores (key, values) into KeyValues proto and yields its serialization. Args: key: values key. values: values themselves. partial: True if more values for this key will follow. False otherwise. Yields: The proto. ...
def get_ad_url(self, ad_id, sandbox): """ get_ad_url: gets ad server thing """ if sandbox: return self.sandbox_ad_server + '/view/' + str(ad_id) else: return self.ad_server + '/view/' + str(ad_id)
def function[get_ad_url, parameter[self, ad_id, sandbox]]: constant[ get_ad_url: gets ad server thing ] if name[sandbox] begin[:] return[binary_operation[binary_operation[name[self].sandbox_ad_server + constant[/view/]] + call[name[str], parameter[name[ad_id]]]]]
keyword[def] identifier[get_ad_url] ( identifier[self] , identifier[ad_id] , identifier[sandbox] ): literal[string] keyword[if] identifier[sandbox] : keyword[return] identifier[self] . identifier[sandbox_ad_server] + literal[string] + identifier[str] ( identifier[ad_id] ) ke...
def get_ad_url(self, ad_id, sandbox): """ get_ad_url: gets ad server thing """ if sandbox: return self.sandbox_ad_server + '/view/' + str(ad_id) # depends on [control=['if'], data=[]] else: return self.ad_server + '/view/' + str(ad_id)
def get_scanner_params_xml(self): """ Returns the OSP Daemon's scanner params in xml format. """ scanner_params = Element('scanner_params') for param_id, param in self.scanner_params.items(): param_xml = SubElement(scanner_params, 'scanner_param') for name, value in [('id...
def function[get_scanner_params_xml, parameter[self]]: constant[ Returns the OSP Daemon's scanner params in xml format. ] variable[scanner_params] assign[=] call[name[Element], parameter[constant[scanner_params]]] for taget[tuple[[<ast.Name object at 0x7da20e957010>, <ast.Name object at 0x7da20e...
keyword[def] identifier[get_scanner_params_xml] ( identifier[self] ): literal[string] identifier[scanner_params] = identifier[Element] ( literal[string] ) keyword[for] identifier[param_id] , identifier[param] keyword[in] identifier[self] . identifier[scanner_params] . identifier[items] ...
def get_scanner_params_xml(self): """ Returns the OSP Daemon's scanner params in xml format. """ scanner_params = Element('scanner_params') for (param_id, param) in self.scanner_params.items(): param_xml = SubElement(scanner_params, 'scanner_param') for (name, value) in [('id', param_id), ('...
def parse_address(self, address_line): """ Parses the given address into it's individual address fields. """ params = {"term": address_line} json = self._make_request('/address/getParsedAddress', params) if json is None: return None return Address.from...
def function[parse_address, parameter[self, address_line]]: constant[ Parses the given address into it's individual address fields. ] variable[params] assign[=] dictionary[[<ast.Constant object at 0x7da1b0b71ea0>], [<ast.Name object at 0x7da1b0b71870>]] variable[json] assign[=] c...
keyword[def] identifier[parse_address] ( identifier[self] , identifier[address_line] ): literal[string] identifier[params] ={ literal[string] : identifier[address_line] } identifier[json] = identifier[self] . identifier[_make_request] ( literal[string] , identifier[params] ) keywo...
def parse_address(self, address_line): """ Parses the given address into it's individual address fields. """ params = {'term': address_line} json = self._make_request('/address/getParsedAddress', params) if json is None: return None # depends on [control=['if'], data=[]] ret...
def importData(directory): """Parse the input files and return two dictionnaries""" dataTask = OrderedDict() dataQueue = OrderedDict() for fichier in sorted(os.listdir(directory)): try: with open("{directory}/{fichier}".format(**locals()), 'rb') as f: fileName, fileTy...
def function[importData, parameter[directory]]: constant[Parse the input files and return two dictionnaries] variable[dataTask] assign[=] call[name[OrderedDict], parameter[]] variable[dataQueue] assign[=] call[name[OrderedDict], parameter[]] for taget[name[fichier]] in starred[call[name[...
keyword[def] identifier[importData] ( identifier[directory] ): literal[string] identifier[dataTask] = identifier[OrderedDict] () identifier[dataQueue] = identifier[OrderedDict] () keyword[for] identifier[fichier] keyword[in] identifier[sorted] ( identifier[os] . identifier[listdir] ( identifie...
def importData(directory): """Parse the input files and return two dictionnaries""" dataTask = OrderedDict() dataQueue = OrderedDict() for fichier in sorted(os.listdir(directory)): try: with open('{directory}/{fichier}'.format(**locals()), 'rb') as f: (fileName, fileT...
def assert_equals(df1, df2, ignore_order=set(), ignore_indices=set(), all_close=False, _return_reason=False): ''' Assert 2 data frames are equal A more verbose form of ``assert equals(df1, df2, ...)``. See `equals` for an explanation of the parameters. Parameters ---------- df1 : ~pandas.DataF...
def function[assert_equals, parameter[df1, df2, ignore_order, ignore_indices, all_close, _return_reason]]: constant[ Assert 2 data frames are equal A more verbose form of ``assert equals(df1, df2, ...)``. See `equals` for an explanation of the parameters. Parameters ---------- df1 : ~panda...
keyword[def] identifier[assert_equals] ( identifier[df1] , identifier[df2] , identifier[ignore_order] = identifier[set] (), identifier[ignore_indices] = identifier[set] (), identifier[all_close] = keyword[False] , identifier[_return_reason] = keyword[False] ): literal[string] identifier[equals_] , identifi...
def assert_equals(df1, df2, ignore_order=set(), ignore_indices=set(), all_close=False, _return_reason=False): """ Assert 2 data frames are equal A more verbose form of ``assert equals(df1, df2, ...)``. See `equals` for an explanation of the parameters. Parameters ---------- df1 : ~pandas.DataF...
def fit_2dgaussian(data, error=None, mask=None): """ Fit a 2D Gaussian plus a constant to a 2D image. Invalid values (e.g. NaNs or infs) in the ``data`` or ``error`` arrays are automatically masked. The mask for invalid values represents the combination of the invalid-value masks for the ``dat...
def function[fit_2dgaussian, parameter[data, error, mask]]: constant[ Fit a 2D Gaussian plus a constant to a 2D image. Invalid values (e.g. NaNs or infs) in the ``data`` or ``error`` arrays are automatically masked. The mask for invalid values represents the combination of the invalid-value ma...
keyword[def] identifier[fit_2dgaussian] ( identifier[data] , identifier[error] = keyword[None] , identifier[mask] = keyword[None] ): literal[string] keyword[from] .. identifier[morphology] keyword[import] identifier[data_properties] identifier[data] = identifier[np] . identifier[ma] . identifier[...
def fit_2dgaussian(data, error=None, mask=None): """ Fit a 2D Gaussian plus a constant to a 2D image. Invalid values (e.g. NaNs or infs) in the ``data`` or ``error`` arrays are automatically masked. The mask for invalid values represents the combination of the invalid-value masks for the ``dat...
def update_vpnservice(vpnservice, desc, profile=None): ''' Updates a VPN service CLI Example: .. code-block:: bash salt '*' neutron.update_vpnservice vpnservice-name desc='VPN Service1' :param vpnservice: ID or name of vpn service to update :param desc: Set a description for the VPN ...
def function[update_vpnservice, parameter[vpnservice, desc, profile]]: constant[ Updates a VPN service CLI Example: .. code-block:: bash salt '*' neutron.update_vpnservice vpnservice-name desc='VPN Service1' :param vpnservice: ID or name of vpn service to update :param desc: Set ...
keyword[def] identifier[update_vpnservice] ( identifier[vpnservice] , identifier[desc] , identifier[profile] = keyword[None] ): literal[string] identifier[conn] = identifier[_auth] ( identifier[profile] ) keyword[return] identifier[conn] . identifier[update_vpnservice] ( identifier[vpnservice] , iden...
def update_vpnservice(vpnservice, desc, profile=None): """ Updates a VPN service CLI Example: .. code-block:: bash salt '*' neutron.update_vpnservice vpnservice-name desc='VPN Service1' :param vpnservice: ID or name of vpn service to update :param desc: Set a description for the VPN ...
def prompt_yes_or_no(message): """ prompt_yes_or_no: Prompt user to reply with a y/n response Args: None Returns: None """ user_input = input("{} [y/n]:".format(message)).lower() if user_input.startswith("y"): return True elif user_input.startswith("n"): return False ...
def function[prompt_yes_or_no, parameter[message]]: constant[ prompt_yes_or_no: Prompt user to reply with a y/n response Args: None Returns: None ] variable[user_input] assign[=] call[call[name[input], parameter[call[constant[{} [y/n]:].format, parameter[name[message]]]]].lower, para...
keyword[def] identifier[prompt_yes_or_no] ( identifier[message] ): literal[string] identifier[user_input] = identifier[input] ( literal[string] . identifier[format] ( identifier[message] )). identifier[lower] () keyword[if] identifier[user_input] . identifier[startswith] ( literal[string] ): ...
def prompt_yes_or_no(message): """ prompt_yes_or_no: Prompt user to reply with a y/n response Args: None Returns: None """ user_input = input('{} [y/n]:'.format(message)).lower() if user_input.startswith('y'): return True # depends on [control=['if'], data=[]] elif user_inpu...
def stylesheet_declarations(string, is_merc=False, scale=1): """ Parse a string representing a stylesheet into a list of declarations. Required boolean is_merc indicates whether the projection should be interpreted as spherical mercator, so we know what to do with zoom/scale-denominator...
def function[stylesheet_declarations, parameter[string, is_merc, scale]]: constant[ Parse a string representing a stylesheet into a list of declarations. Required boolean is_merc indicates whether the projection should be interpreted as spherical mercator, so we know what to do with ...
keyword[def] identifier[stylesheet_declarations] ( identifier[string] , identifier[is_merc] = keyword[False] , identifier[scale] = literal[int] ): literal[string] identifier[display_map] = identifier[Declaration] ( identifier[Selector] ( identifier[SelectorElement] ([ literal[string] ],[])), iden...
def stylesheet_declarations(string, is_merc=False, scale=1): """ Parse a string representing a stylesheet into a list of declarations. Required boolean is_merc indicates whether the projection should be interpreted as spherical mercator, so we know what to do with zoom/scale-denominator...
def _EnsureFileExists(self): """Touches a file; returns False on error, True on success.""" if not os.path.exists(self._filename): old_umask = os.umask(0o177) try: open(self._filename, 'a+b').close() except OSError: return False ...
def function[_EnsureFileExists, parameter[self]]: constant[Touches a file; returns False on error, True on success.] if <ast.UnaryOp object at 0x7da1b07fb8b0> begin[:] variable[old_umask] assign[=] call[name[os].umask, parameter[constant[127]]] <ast.Try object at 0x7da1b07fb5b0> ...
keyword[def] identifier[_EnsureFileExists] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[exists] ( identifier[self] . identifier[_filename] ): identifier[old_umask] = identifier[os] . identifier[umask] ( literal[int] ) ...
def _EnsureFileExists(self): """Touches a file; returns False on error, True on success.""" if not os.path.exists(self._filename): old_umask = os.umask(127) try: open(self._filename, 'a+b').close() # depends on [control=['try'], data=[]] except OSError: return Fa...
def keep_only_fields(self): """Keep only fields listed in field_list.""" for tag in self.record.keys(): if tag not in self.fields_list: record_delete_fields(self.record, tag)
def function[keep_only_fields, parameter[self]]: constant[Keep only fields listed in field_list.] for taget[name[tag]] in starred[call[name[self].record.keys, parameter[]]] begin[:] if compare[name[tag] <ast.NotIn object at 0x7da2590d7190> name[self].fields_list] begin[:] ...
keyword[def] identifier[keep_only_fields] ( identifier[self] ): literal[string] keyword[for] identifier[tag] keyword[in] identifier[self] . identifier[record] . identifier[keys] (): keyword[if] identifier[tag] keyword[not] keyword[in] identifier[self] . identifier[fields_list] :...
def keep_only_fields(self): """Keep only fields listed in field_list.""" for tag in self.record.keys(): if tag not in self.fields_list: record_delete_fields(self.record, tag) # depends on [control=['if'], data=['tag']] # depends on [control=['for'], data=['tag']]
def content_types(self): """ Provides access to content type management methods for content types of an environment. API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types :return: :class:`EnvironmentContentTypesProxy <cont...
def function[content_types, parameter[self]]: constant[ Provides access to content type management methods for content types of an environment. API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types :return: :class:`Environ...
keyword[def] identifier[content_types] ( identifier[self] ): literal[string] keyword[return] identifier[EnvironmentContentTypesProxy] ( identifier[self] . identifier[_client] , identifier[self] . identifier[space] . identifier[id] , identifier[self] . identifier[id] )
def content_types(self): """ Provides access to content type management methods for content types of an environment. API reference: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types :return: :class:`EnvironmentContentTypesProxy <contentf...
def main(argv=sys.argv[1:], loop=None): """Parse argument and setup main program loop.""" args = docopt(__doc__, argv=argv, version=pkg_resources.require('rflink')[0].version) level = logging.ERROR if args['-v']: level = logging.INFO if args['-v'] == 2: level = log...
def function[main, parameter[argv, loop]]: constant[Parse argument and setup main program loop.] variable[args] assign[=] call[name[docopt], parameter[name[__doc__]]] variable[level] assign[=] name[logging].ERROR if call[name[args]][constant[-v]] begin[:] variable[level] ...
keyword[def] identifier[main] ( identifier[argv] = identifier[sys] . identifier[argv] [ literal[int] :], identifier[loop] = keyword[None] ): literal[string] identifier[args] = identifier[docopt] ( identifier[__doc__] , identifier[argv] = identifier[argv] , identifier[version] = identifier[pkg_resource...
def main(argv=sys.argv[1:], loop=None): """Parse argument and setup main program loop.""" args = docopt(__doc__, argv=argv, version=pkg_resources.require('rflink')[0].version) level = logging.ERROR if args['-v']: level = logging.INFO # depends on [control=['if'], data=[]] if args['-v'] == 2...
def async_stats_job_data(klass, account, url, **kwargs): """ Returns the results of the specified async job IDs """ resource = urlparse(url) domain = '{0}://{1}'.format(resource.scheme, resource.netloc) response = Request(account.client, 'get', resource.path, domain=doma...
def function[async_stats_job_data, parameter[klass, account, url]]: constant[ Returns the results of the specified async job IDs ] variable[resource] assign[=] call[name[urlparse], parameter[name[url]]] variable[domain] assign[=] call[constant[{0}://{1}].format, parameter[name[re...
keyword[def] identifier[async_stats_job_data] ( identifier[klass] , identifier[account] , identifier[url] ,** identifier[kwargs] ): literal[string] identifier[resource] = identifier[urlparse] ( identifier[url] ) identifier[domain] = literal[string] . identifier[format] ( identifier[resourc...
def async_stats_job_data(klass, account, url, **kwargs): """ Returns the results of the specified async job IDs """ resource = urlparse(url) domain = '{0}://{1}'.format(resource.scheme, resource.netloc) response = Request(account.client, 'get', resource.path, domain=domain, raw_body=True...
def contains_unquoted_target(x: str, quote: str = '"', target: str = '&') -> bool: """ Checks if ``target`` exists in ``x`` outside quotes (as defined by ``quote``). Principal use: from :func:`contains_unquoted_ampersand_dangerous_to_windows`. """ in_quote = False ...
def function[contains_unquoted_target, parameter[x, quote, target]]: constant[ Checks if ``target`` exists in ``x`` outside quotes (as defined by ``quote``). Principal use: from :func:`contains_unquoted_ampersand_dangerous_to_windows`. ] variable[in_quote] assign[=] constant[False] ...
keyword[def] identifier[contains_unquoted_target] ( identifier[x] : identifier[str] , identifier[quote] : identifier[str] = literal[string] , identifier[target] : identifier[str] = literal[string] )-> identifier[bool] : literal[string] identifier[in_quote] = keyword[False] keyword[for] identifier[c...
def contains_unquoted_target(x: str, quote: str='"', target: str='&') -> bool: """ Checks if ``target`` exists in ``x`` outside quotes (as defined by ``quote``). Principal use: from :func:`contains_unquoted_ampersand_dangerous_to_windows`. """ in_quote = False for c in x: if c == quo...
def _after_indentation(res, options=None, fpath=''): """ _after_indentation(res : dict): Called after the string has been indented appropriately. It takes care of writing the file and checking for unclosed strings or comments. """ fname = os.path.basename(fpath) opts = parse_options(options...
def function[_after_indentation, parameter[res, options, fpath]]: constant[ _after_indentation(res : dict): Called after the string has been indented appropriately. It takes care of writing the file and checking for unclosed strings or comments. ] variable[fname] assign[=] call[name[os]...
keyword[def] identifier[_after_indentation] ( identifier[res] , identifier[options] = keyword[None] , identifier[fpath] = literal[string] ): literal[string] identifier[fname] = identifier[os] . identifier[path] . identifier[basename] ( identifier[fpath] ) identifier[opts] = identifier[parse_options] (...
def _after_indentation(res, options=None, fpath=''): """ _after_indentation(res : dict): Called after the string has been indented appropriately. It takes care of writing the file and checking for unclosed strings or comments. """ fname = os.path.basename(fpath) opts = parse_options(options...
def get_network_settings(): ''' Return the contents of the global network script. CLI Example: .. code-block:: bash salt '*' ip.get_network_settings ''' if __grains__['lsb_distrib_id'] == 'nilrt': raise salt.exceptions.CommandExecutionError('Not supported in this version.') ...
def function[get_network_settings, parameter[]]: constant[ Return the contents of the global network script. CLI Example: .. code-block:: bash salt '*' ip.get_network_settings ] if compare[call[name[__grains__]][constant[lsb_distrib_id]] equal[==] constant[nilrt]] begin[:] ...
keyword[def] identifier[get_network_settings] (): literal[string] keyword[if] identifier[__grains__] [ literal[string] ]== literal[string] : keyword[raise] identifier[salt] . identifier[exceptions] . identifier[CommandExecutionError] ( literal[string] ) identifier[settings] =[] identif...
def get_network_settings(): """ Return the contents of the global network script. CLI Example: .. code-block:: bash salt '*' ip.get_network_settings """ if __grains__['lsb_distrib_id'] == 'nilrt': raise salt.exceptions.CommandExecutionError('Not supported in this version.') #...
def build_db(): """Get a structured dataset out of http://download.geonames.org/export/dump/cities1000.txt """ if not os.path.exists(MISC_PATH): os.makedirs(MISC_PATH) cities_path = os.path.join(MISC_PATH, "cities1000.txt") cities_msgpack = os.path.join(MISC_PATH, "cities1000.bin") ...
def function[build_db, parameter[]]: constant[Get a structured dataset out of http://download.geonames.org/export/dump/cities1000.txt ] if <ast.UnaryOp object at 0x7da1b149c5e0> begin[:] call[name[os].makedirs, parameter[name[MISC_PATH]]] variable[cities_path] assign[=...
keyword[def] identifier[build_db] (): literal[string] keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[exists] ( identifier[MISC_PATH] ): identifier[os] . identifier[makedirs] ( identifier[MISC_PATH] ) identifier[cities_path] = identifier[os] . identifier[path] . iden...
def build_db(): """Get a structured dataset out of http://download.geonames.org/export/dump/cities1000.txt """ if not os.path.exists(MISC_PATH): os.makedirs(MISC_PATH) # depends on [control=['if'], data=[]] cities_path = os.path.join(MISC_PATH, 'cities1000.txt') cities_msgpack = os.p...
def __undo_filter_average(self, scanline): """Undo average filter.""" ai = -self.fu previous = self.prev for i in range(len(scanline)): x = scanline[i] if ai < 0: a = 0 else: a = scanline[ai] # result b = pr...
def function[__undo_filter_average, parameter[self, scanline]]: constant[Undo average filter.] variable[ai] assign[=] <ast.UnaryOp object at 0x7da18f00e5c0> variable[previous] assign[=] name[self].prev for taget[name[i]] in starred[call[name[range], parameter[call[name[len], parameter[na...
keyword[def] identifier[__undo_filter_average] ( identifier[self] , identifier[scanline] ): literal[string] identifier[ai] =- identifier[self] . identifier[fu] identifier[previous] = identifier[self] . identifier[prev] keyword[for] identifier[i] keyword[in] identifier[range] ...
def __undo_filter_average(self, scanline): """Undo average filter.""" ai = -self.fu previous = self.prev for i in range(len(scanline)): x = scanline[i] if ai < 0: a = 0 # depends on [control=['if'], data=[]] else: a = scanline[ai] # result b = pr...
def commit(self): """ Commit transaction which is currently in progress. """ self._assert_open() if self._autocommit: return if not self._conn.tds72_transaction: return self._main_cursor._commit(cont=True, isolation_level=self._isolation_le...
def function[commit, parameter[self]]: constant[ Commit transaction which is currently in progress. ] call[name[self]._assert_open, parameter[]] if name[self]._autocommit begin[:] return[None] if <ast.UnaryOp object at 0x7da1b0579000> begin[:] return[None]...
keyword[def] identifier[commit] ( identifier[self] ): literal[string] identifier[self] . identifier[_assert_open] () keyword[if] identifier[self] . identifier[_autocommit] : keyword[return] keyword[if] keyword[not] identifier[self] . identifier[_conn] . identifier...
def commit(self): """ Commit transaction which is currently in progress. """ self._assert_open() if self._autocommit: return # depends on [control=['if'], data=[]] if not self._conn.tds72_transaction: return # depends on [control=['if'], data=[]] self._main_cursor._...
def _cache(self, func, func_memory_level=1, **kwargs): """ Return a joblib.Memory object. The memory_level determines the level above which the wrapped function output is cached. By specifying a numeric value for this level, the user can to control the amount of cache memory use...
def function[_cache, parameter[self, func, func_memory_level]]: constant[ Return a joblib.Memory object. The memory_level determines the level above which the wrapped function output is cached. By specifying a numeric value for this level, the user can to control the amount of cache mem...
keyword[def] identifier[_cache] ( identifier[self] , identifier[func] , identifier[func_memory_level] = literal[int] ,** identifier[kwargs] ): literal[string] identifier[verbose] = identifier[getattr] ( identifier[self] , literal[string] , literal[int] ) keyword[if] ke...
def _cache(self, func, func_memory_level=1, **kwargs): """ Return a joblib.Memory object. The memory_level determines the level above which the wrapped function output is cached. By specifying a numeric value for this level, the user can to control the amount of cache memory used. T...
def contains(self, other): """ Is the other VariantSequence a subsequence of this one? The two sequences must agree on the alt nucleotides, the prefix of the longer must contain the prefix of the shorter, and the suffix of the longer must contain the suffix of the shorter. ...
def function[contains, parameter[self, other]]: constant[ Is the other VariantSequence a subsequence of this one? The two sequences must agree on the alt nucleotides, the prefix of the longer must contain the prefix of the shorter, and the suffix of the longer must contain the s...
keyword[def] identifier[contains] ( identifier[self] , identifier[other] ): literal[string] keyword[return] ( identifier[self] . identifier[alt] == identifier[other] . identifier[alt] keyword[and] identifier[self] . identifier[prefix] . identifier[endswith] ( identifier[other] . identifi...
def contains(self, other): """ Is the other VariantSequence a subsequence of this one? The two sequences must agree on the alt nucleotides, the prefix of the longer must contain the prefix of the shorter, and the suffix of the longer must contain the suffix of the shorter. "...
def search_people_by_bio(query, limit_results=DEFAULT_LIMIT, index=['onename_people_index']): """ queries lucene index to find a nearest match, output is profile username """ from pyes import QueryStringQuery, ES conn = ES() q = QueryStringQuery(query, ...
def function[search_people_by_bio, parameter[query, limit_results, index]]: constant[ queries lucene index to find a nearest match, output is profile username ] from relative_module[pyes] import module[QueryStringQuery], module[ES] variable[conn] assign[=] call[name[ES], parameter[]] var...
keyword[def] identifier[search_people_by_bio] ( identifier[query] , identifier[limit_results] = identifier[DEFAULT_LIMIT] , identifier[index] =[ literal[string] ]): literal[string] keyword[from] identifier[pyes] keyword[import] identifier[QueryStringQuery] , identifier[ES] identifier[conn] = ide...
def search_people_by_bio(query, limit_results=DEFAULT_LIMIT, index=['onename_people_index']): """ queries lucene index to find a nearest match, output is profile username """ from pyes import QueryStringQuery, ES conn = ES() q = QueryStringQuery(query, search_fields=['username', 'profile_bio'], defa...
def skeleton_to_pdag(skel, separating_sets): """Orients the edges of a graph skeleton based on information from `separating_sets` to form a DAG pattern (DAG). Parameters ---------- skel: UndirectedGraph An undirected graph skeleton as e.g. produced by the ...
def function[skeleton_to_pdag, parameter[skel, separating_sets]]: constant[Orients the edges of a graph skeleton based on information from `separating_sets` to form a DAG pattern (DAG). Parameters ---------- skel: UndirectedGraph An undirected graph skeleton as e.g. ...
keyword[def] identifier[skeleton_to_pdag] ( identifier[skel] , identifier[separating_sets] ): literal[string] identifier[pdag] = identifier[skel] . identifier[to_directed] () identifier[node_pairs] = identifier[combinations] ( identifier[pdag] . identifier[nodes] (), literal[int] ) ...
def skeleton_to_pdag(skel, separating_sets): """Orients the edges of a graph skeleton based on information from `separating_sets` to form a DAG pattern (DAG). Parameters ---------- skel: UndirectedGraph An undirected graph skeleton as e.g. produced by the est...
def update(self, **kwargs): """Update a resource by passing in modifications via keyword arguments. """ data = self._generate_input_dict(**kwargs) url = self.parent.url + '/relationship' self.load(self.client.put(url, data=data)) return self
def function[update, parameter[self]]: constant[Update a resource by passing in modifications via keyword arguments. ] variable[data] assign[=] call[name[self]._generate_input_dict, parameter[]] variable[url] assign[=] binary_operation[name[self].parent.url + constant[/relationship]] ...
keyword[def] identifier[update] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[data] = identifier[self] . identifier[_generate_input_dict] (** identifier[kwargs] ) identifier[url] = identifier[self] . identifier[parent] . identifier[url] + literal[string] ...
def update(self, **kwargs): """Update a resource by passing in modifications via keyword arguments. """ data = self._generate_input_dict(**kwargs) url = self.parent.url + '/relationship' self.load(self.client.put(url, data=data)) return self
def fw_version(self): """ Returns the firmware version of the sensor if available. Currently only I2C/NXT sensors support this. """ (self._fw_version, value) = self.get_cached_attr_string(self._fw_version, 'fw_version') return value
def function[fw_version, parameter[self]]: constant[ Returns the firmware version of the sensor if available. Currently only I2C/NXT sensors support this. ] <ast.Tuple object at 0x7da1b1727730> assign[=] call[name[self].get_cached_attr_string, parameter[name[self]._fw_version, co...
keyword[def] identifier[fw_version] ( identifier[self] ): literal[string] ( identifier[self] . identifier[_fw_version] , identifier[value] )= identifier[self] . identifier[get_cached_attr_string] ( identifier[self] . identifier[_fw_version] , literal[string] ) keyword[return] identifier[va...
def fw_version(self): """ Returns the firmware version of the sensor if available. Currently only I2C/NXT sensors support this. """ (self._fw_version, value) = self.get_cached_attr_string(self._fw_version, 'fw_version') return value
def generate_sections(self): """Return dictionary of source section slugs, name, and counts.""" sources = Dataset.objects.values( 'source', 'source_slug' ).annotate(source_count=Count('source_slug')) return sorted([ { 'slug': source['source_slug']...
def function[generate_sections, parameter[self]]: constant[Return dictionary of source section slugs, name, and counts.] variable[sources] assign[=] call[call[name[Dataset].objects.values, parameter[constant[source], constant[source_slug]]].annotate, parameter[]] return[call[name[sorted], parameter[...
keyword[def] identifier[generate_sections] ( identifier[self] ): literal[string] identifier[sources] = identifier[Dataset] . identifier[objects] . identifier[values] ( literal[string] , literal[string] ). identifier[annotate] ( identifier[source_count] = identifier[Count] ( litera...
def generate_sections(self): """Return dictionary of source section slugs, name, and counts.""" sources = Dataset.objects.values('source', 'source_slug').annotate(source_count=Count('source_slug')) return sorted([{'slug': source['source_slug'], 'name': source['source'], 'count': source['source_count']} for ...
def walk(self, function, raise_errors=True, call_on_sections=False, **keywargs): """ Walk every member and call a function on the keyword and value. Return a dictionary of the return values If the function raises an exception, raise the errror unless ``raise_errors=...
def function[walk, parameter[self, function, raise_errors, call_on_sections]]: constant[ Walk every member and call a function on the keyword and value. Return a dictionary of the return values If the function raises an exception, raise the errror unless ``raise_errors=False``,...
keyword[def] identifier[walk] ( identifier[self] , identifier[function] , identifier[raise_errors] = keyword[True] , identifier[call_on_sections] = keyword[False] ,** identifier[keywargs] ): literal[string] identifier[out] ={} keyword[for] identifier[i] keyword[in] identifier[...
def walk(self, function, raise_errors=True, call_on_sections=False, **keywargs): """ Walk every member and call a function on the keyword and value. Return a dictionary of the return values If the function raises an exception, raise the errror unless ``raise_errors=False``, in whic...
def render_revalidation_failure(self, failed_step, form, **kwargs): """ When a step fails, we have to redirect the user to the first failing step. """ self.storage.current_step = failed_step return redirect(self.url_name, step=failed_step)
def function[render_revalidation_failure, parameter[self, failed_step, form]]: constant[ When a step fails, we have to redirect the user to the first failing step. ] name[self].storage.current_step assign[=] name[failed_step] return[call[name[redirect], parameter[name[self].u...
keyword[def] identifier[render_revalidation_failure] ( identifier[self] , identifier[failed_step] , identifier[form] ,** identifier[kwargs] ): literal[string] identifier[self] . identifier[storage] . identifier[current_step] = identifier[failed_step] keyword[return] identifier[redirect] ...
def render_revalidation_failure(self, failed_step, form, **kwargs): """ When a step fails, we have to redirect the user to the first failing step. """ self.storage.current_step = failed_step return redirect(self.url_name, step=failed_step)
def end_index(self): """Return the 1-based index of the last item on this page.""" paginator = self.paginator # Special case for the last page because there can be orphans. if self.number == paginator.num_pages: return paginator.count return (self.number - 1) * pagina...
def function[end_index, parameter[self]]: constant[Return the 1-based index of the last item on this page.] variable[paginator] assign[=] name[self].paginator if compare[name[self].number equal[==] name[paginator].num_pages] begin[:] return[name[paginator].count] return[binary_operat...
keyword[def] identifier[end_index] ( identifier[self] ): literal[string] identifier[paginator] = identifier[self] . identifier[paginator] keyword[if] identifier[self] . identifier[number] == identifier[paginator] . identifier[num_pages] : keyword[return] identifier...
def end_index(self): """Return the 1-based index of the last item on this page.""" paginator = self.paginator # Special case for the last page because there can be orphans. if self.number == paginator.num_pages: return paginator.count # depends on [control=['if'], data=[]] return (self.numb...
def set_rgb_dim_level_with_time( self, channelIndex: int, rgb: RGBColorState, dimLevel: float, onTime: float, rampTime: float, ): """ sets the color and dimlevel of the lamp Args: channelIndex(int): the channelIndex of the lamp. Use self.t...
def function[set_rgb_dim_level_with_time, parameter[self, channelIndex, rgb, dimLevel, onTime, rampTime]]: constant[ sets the color and dimlevel of the lamp Args: channelIndex(int): the channelIndex of the lamp. Use self.topLightChannelIndex or self.bottomLightChannelIndex rgb(R...
keyword[def] identifier[set_rgb_dim_level_with_time] ( identifier[self] , identifier[channelIndex] : identifier[int] , identifier[rgb] : identifier[RGBColorState] , identifier[dimLevel] : identifier[float] , identifier[onTime] : identifier[float] , identifier[rampTime] : identifier[float] , ): literal[...
def set_rgb_dim_level_with_time(self, channelIndex: int, rgb: RGBColorState, dimLevel: float, onTime: float, rampTime: float): """ sets the color and dimlevel of the lamp Args: channelIndex(int): the channelIndex of the lamp. Use self.topLightChannelIndex or self.bottomLightChannelIndex ...
def createGroup(self, group, vendorSpecific=None): """See Also: createGroupResponse() Args: group: vendorSpecific: Returns: """ response = self.createGroupResponse(group, vendorSpecific) return self._read_boolean_response(response)
def function[createGroup, parameter[self, group, vendorSpecific]]: constant[See Also: createGroupResponse() Args: group: vendorSpecific: Returns: ] variable[response] assign[=] call[name[self].createGroupResponse, parameter[name[group], name[vendorSpecific]...
keyword[def] identifier[createGroup] ( identifier[self] , identifier[group] , identifier[vendorSpecific] = keyword[None] ): literal[string] identifier[response] = identifier[self] . identifier[createGroupResponse] ( identifier[group] , identifier[vendorSpecific] ) keyword[return] identifi...
def createGroup(self, group, vendorSpecific=None): """See Also: createGroupResponse() Args: group: vendorSpecific: Returns: """ response = self.createGroupResponse(group, vendorSpecific) return self._read_boolean_response(response)
def merge(self, from_email, source_incidents): """Merge other incidents into this incident.""" if from_email is None or not isinstance(from_email, six.string_types): raise MissingFromEmail(from_email) add_headers = {'from': from_email, } endpoint = '/'.join((self.endpoint, s...
def function[merge, parameter[self, from_email, source_incidents]]: constant[Merge other incidents into this incident.] if <ast.BoolOp object at 0x7da1b06fd480> begin[:] <ast.Raise object at 0x7da1b06ff940> variable[add_headers] assign[=] dictionary[[<ast.Constant object at 0x7da1b06fc16...
keyword[def] identifier[merge] ( identifier[self] , identifier[from_email] , identifier[source_incidents] ): literal[string] keyword[if] identifier[from_email] keyword[is] keyword[None] keyword[or] keyword[not] identifier[isinstance] ( identifier[from_email] , identifier[six] . identifier[str...
def merge(self, from_email, source_incidents): """Merge other incidents into this incident.""" if from_email is None or not isinstance(from_email, six.string_types): raise MissingFromEmail(from_email) # depends on [control=['if'], data=[]] add_headers = {'from': from_email} endpoint = '/'.join(...
def count_variables_by_type(variables=None): """Returns a dict mapping dtypes to number of variables and scalars. Args: variables: iterable of `tf.Variable`s, or None. If None is passed, then all global and local variables in the current graph are used. Returns: A dict mapping tf.dtype keys to a d...
def function[count_variables_by_type, parameter[variables]]: constant[Returns a dict mapping dtypes to number of variables and scalars. Args: variables: iterable of `tf.Variable`s, or None. If None is passed, then all global and local variables in the current graph are used. Returns: A dict ...
keyword[def] identifier[count_variables_by_type] ( identifier[variables] = keyword[None] ): literal[string] keyword[if] identifier[variables] keyword[is] keyword[None] : identifier[variables] = identifier[tf] . identifier[global_variables] ()+ identifier[tf] . identifier[local_variables] () identifi...
def count_variables_by_type(variables=None): """Returns a dict mapping dtypes to number of variables and scalars. Args: variables: iterable of `tf.Variable`s, or None. If None is passed, then all global and local variables in the current graph are used. Returns: A dict mapping tf.dtype keys to a...
def switch_zeros_of_values(self): """If we are a of: rule, we can get some 0 in of_values, if so, change them with NB sons instead :return: None """ nb_sons = len(self.sons) # Need a list for assignment new_values = list(self.of_values) for i in [0, 1,...
def function[switch_zeros_of_values, parameter[self]]: constant[If we are a of: rule, we can get some 0 in of_values, if so, change them with NB sons instead :return: None ] variable[nb_sons] assign[=] call[name[len], parameter[name[self].sons]] variable[new_values] a...
keyword[def] identifier[switch_zeros_of_values] ( identifier[self] ): literal[string] identifier[nb_sons] = identifier[len] ( identifier[self] . identifier[sons] ) identifier[new_values] = identifier[list] ( identifier[self] . identifier[of_values] ) keyword[for] identif...
def switch_zeros_of_values(self): """If we are a of: rule, we can get some 0 in of_values, if so, change them with NB sons instead :return: None """ nb_sons = len(self.sons) # Need a list for assignment new_values = list(self.of_values) for i in [0, 1, 2]: if new_...
def _cdf(self, xloc, left, right, cache): """ Cumulative distribution function. Example: >>> print(chaospy.Uniform().fwd([-0.5, 0.5, 1.5, 2.5])) [0. 0.5 1. 1. ] >>> print(chaospy.Add(chaospy.Uniform(), 1).fwd([-0.5, 0.5, 1.5, 2.5])) [0. 0. 0.5...
def function[_cdf, parameter[self, xloc, left, right, cache]]: constant[ Cumulative distribution function. Example: >>> print(chaospy.Uniform().fwd([-0.5, 0.5, 1.5, 2.5])) [0. 0.5 1. 1. ] >>> print(chaospy.Add(chaospy.Uniform(), 1).fwd([-0.5, 0.5, 1.5, 2.5]...
keyword[def] identifier[_cdf] ( identifier[self] , identifier[xloc] , identifier[left] , identifier[right] , identifier[cache] ): literal[string] identifier[left] = identifier[evaluation] . identifier[get_forward_cache] ( identifier[left] , identifier[cache] ) identifier[right] = identifie...
def _cdf(self, xloc, left, right, cache): """ Cumulative distribution function. Example: >>> print(chaospy.Uniform().fwd([-0.5, 0.5, 1.5, 2.5])) [0. 0.5 1. 1. ] >>> print(chaospy.Add(chaospy.Uniform(), 1).fwd([-0.5, 0.5, 1.5, 2.5])) [0. 0. 0.5 1. ...
def regon_checksum(digits): """ Calculates and returns a control digit for given list of digits basing on REGON standard. """ weights_for_check_digit = [8, 9, 2, 3, 4, 5, 6, 7] check_digit = 0 for i in range(0, 8): check_digit += weights_for_check_digit[i] * digits[i] check_digit %...
def function[regon_checksum, parameter[digits]]: constant[ Calculates and returns a control digit for given list of digits basing on REGON standard. ] variable[weights_for_check_digit] assign[=] list[[<ast.Constant object at 0x7da207f9b220>, <ast.Constant object at 0x7da207f98520>, <ast.Constant...
keyword[def] identifier[regon_checksum] ( identifier[digits] ): literal[string] identifier[weights_for_check_digit] =[ literal[int] , literal[int] , literal[int] , literal[int] , literal[int] , literal[int] , literal[int] , literal[int] ] identifier[check_digit] = literal[int] keyword[for] ide...
def regon_checksum(digits): """ Calculates and returns a control digit for given list of digits basing on REGON standard. """ weights_for_check_digit = [8, 9, 2, 3, 4, 5, 6, 7] check_digit = 0 for i in range(0, 8): check_digit += weights_for_check_digit[i] * digits[i] # depends on [cont...
def get_auth(self, username, password, authoritative_source, auth_options=None): """ Returns an authentication object. Examines the auth backend given after the '@' in the username and returns a suitable instance of a subclass of the BaseAuth class. * `username` [string...
def function[get_auth, parameter[self, username, password, authoritative_source, auth_options]]: constant[ Returns an authentication object. Examines the auth backend given after the '@' in the username and returns a suitable instance of a subclass of the BaseAuth class. ...
keyword[def] identifier[get_auth] ( identifier[self] , identifier[username] , identifier[password] , identifier[authoritative_source] , identifier[auth_options] = keyword[None] ): literal[string] keyword[if] identifier[auth_options] keyword[is] keyword[None] : identifier[auth_optio...
def get_auth(self, username, password, authoritative_source, auth_options=None): """ Returns an authentication object. Examines the auth backend given after the '@' in the username and returns a suitable instance of a subclass of the BaseAuth class. * `username` [string] ...
def stn(s, length, encoding, errors): """Convert a string to a null-terminated bytes object. """ s = s.encode(encoding, errors) return s[:length] + (length - len(s)) * NUL
def function[stn, parameter[s, length, encoding, errors]]: constant[Convert a string to a null-terminated bytes object. ] variable[s] assign[=] call[name[s].encode, parameter[name[encoding], name[errors]]] return[binary_operation[call[name[s]][<ast.Slice object at 0x7da1b2067670>] + binary_opera...
keyword[def] identifier[stn] ( identifier[s] , identifier[length] , identifier[encoding] , identifier[errors] ): literal[string] identifier[s] = identifier[s] . identifier[encode] ( identifier[encoding] , identifier[errors] ) keyword[return] identifier[s] [: identifier[length] ]+( identifier[length] ...
def stn(s, length, encoding, errors): """Convert a string to a null-terminated bytes object. """ s = s.encode(encoding, errors) return s[:length] + (length - len(s)) * NUL
def adj_nodes_gcp(gcp_nodes): """Adjust details specific to GCP.""" for node in gcp_nodes: node.cloud = "gcp" node.cloud_disp = "GCP" node.private_ips = ip_to_str(node.private_ips) node.public_ips = ip_to_str(node.public_ips) node.zone = node.extra['zone'].name return...
def function[adj_nodes_gcp, parameter[gcp_nodes]]: constant[Adjust details specific to GCP.] for taget[name[node]] in starred[name[gcp_nodes]] begin[:] name[node].cloud assign[=] constant[gcp] name[node].cloud_disp assign[=] constant[GCP] name[node].privat...
keyword[def] identifier[adj_nodes_gcp] ( identifier[gcp_nodes] ): literal[string] keyword[for] identifier[node] keyword[in] identifier[gcp_nodes] : identifier[node] . identifier[cloud] = literal[string] identifier[node] . identifier[cloud_disp] = literal[string] identifier[n...
def adj_nodes_gcp(gcp_nodes): """Adjust details specific to GCP.""" for node in gcp_nodes: node.cloud = 'gcp' node.cloud_disp = 'GCP' node.private_ips = ip_to_str(node.private_ips) node.public_ips = ip_to_str(node.public_ips) node.zone = node.extra['zone'].name # depends...
def redirect(self, url, method=None, **kwargs): """ Create a <Redirect> element :param url: Redirect URL :param method: Redirect URL method :param kwargs: additional attributes :returns: <Redirect> element """ return self.nest(Redirect(url, method=method...
def function[redirect, parameter[self, url, method]]: constant[ Create a <Redirect> element :param url: Redirect URL :param method: Redirect URL method :param kwargs: additional attributes :returns: <Redirect> element ] return[call[name[self].nest, parameter...
keyword[def] identifier[redirect] ( identifier[self] , identifier[url] , identifier[method] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[self] . identifier[nest] ( identifier[Redirect] ( identifier[url] , identifier[method] = identifier[method] ,** identifie...
def redirect(self, url, method=None, **kwargs): """ Create a <Redirect> element :param url: Redirect URL :param method: Redirect URL method :param kwargs: additional attributes :returns: <Redirect> element """ return self.nest(Redirect(url, method=method, **kwar...
def getThirdPartyLibCompilerFlags(self, libs): """ Retrieves the compiler flags for building against the Unreal-bundled versions of the specified third-party libraries """ fmt = PrintingFormat.singleLine() if libs[0] == '--multiline': fmt = PrintingFormat.multiLine() libs = libs[1:] platformDefault...
def function[getThirdPartyLibCompilerFlags, parameter[self, libs]]: constant[ Retrieves the compiler flags for building against the Unreal-bundled versions of the specified third-party libraries ] variable[fmt] assign[=] call[name[PrintingFormat].singleLine, parameter[]] if compare[call[name...
keyword[def] identifier[getThirdPartyLibCompilerFlags] ( identifier[self] , identifier[libs] ): literal[string] identifier[fmt] = identifier[PrintingFormat] . identifier[singleLine] () keyword[if] identifier[libs] [ literal[int] ]== literal[string] : identifier[fmt] = identifier[PrintingFormat] . ident...
def getThirdPartyLibCompilerFlags(self, libs): """ Retrieves the compiler flags for building against the Unreal-bundled versions of the specified third-party libraries """ fmt = PrintingFormat.singleLine() if libs[0] == '--multiline': fmt = PrintingFormat.multiLine() libs = libs[1:] # d...
def _broadcast_transport_message(self, origin, message): """ Broadcasts an event originating from a transport that does not represent a message from the Pebble. :param origin: The type of transport responsible for the message. :type origin: .MessageTarget :param message: The mes...
def function[_broadcast_transport_message, parameter[self, origin, message]]: constant[ Broadcasts an event originating from a transport that does not represent a message from the Pebble. :param origin: The type of transport responsible for the message. :type origin: .MessageTarget ...
keyword[def] identifier[_broadcast_transport_message] ( identifier[self] , identifier[origin] , identifier[message] ): literal[string] identifier[self] . identifier[event_handler] . identifier[broadcast_event] (( identifier[_EventType] . identifier[Transport] , identifier[type] ( identifier[origin]...
def _broadcast_transport_message(self, origin, message): """ Broadcasts an event originating from a transport that does not represent a message from the Pebble. :param origin: The type of transport responsible for the message. :type origin: .MessageTarget :param message: The message...
def save_object(fname, obj): """Pickle a Python object""" fd = gzip.open(fname, "wb") six.moves.cPickle.dump(obj, fd) fd.close()
def function[save_object, parameter[fname, obj]]: constant[Pickle a Python object] variable[fd] assign[=] call[name[gzip].open, parameter[name[fname], constant[wb]]] call[name[six].moves.cPickle.dump, parameter[name[obj], name[fd]]] call[name[fd].close, parameter[]]
keyword[def] identifier[save_object] ( identifier[fname] , identifier[obj] ): literal[string] identifier[fd] = identifier[gzip] . identifier[open] ( identifier[fname] , literal[string] ) identifier[six] . identifier[moves] . identifier[cPickle] . identifier[dump] ( identifier[obj] , identifier[fd] ) ...
def save_object(fname, obj): """Pickle a Python object""" fd = gzip.open(fname, 'wb') six.moves.cPickle.dump(obj, fd) fd.close()
def run(self): """ Continuously retrieve client requests until given "stop" request. """ while True: self._logger.debug('Accepting connection') conn, addr = self._sock.accept() self._talk = SocketTalk(conn, encode=self._encode) self._logge...
def function[run, parameter[self]]: constant[ Continuously retrieve client requests until given "stop" request. ] while constant[True] begin[:] call[name[self]._logger.debug, parameter[constant[Accepting connection]]] <ast.Tuple object at 0x7da18bcc8e80> a...
keyword[def] identifier[run] ( identifier[self] ): literal[string] keyword[while] keyword[True] : identifier[self] . identifier[_logger] . identifier[debug] ( literal[string] ) identifier[conn] , identifier[addr] = identifier[self] . identifier[_sock] . identifier[accept]...
def run(self): """ Continuously retrieve client requests until given "stop" request. """ while True: self._logger.debug('Accepting connection') (conn, addr) = self._sock.accept() self._talk = SocketTalk(conn, encode=self._encode) self._logger.debug('Receiving acti...