code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def reportProgress(self, state, action, text=None, tick=None): """ If we want to keep other code updated about our progress. state: 'prep' reading sources 'generate' making instances 'done' wrapping up 'error' ...
def function[reportProgress, parameter[self, state, action, text, tick]]: constant[ If we want to keep other code updated about our progress. state: 'prep' reading sources 'generate' making instances 'done' wrapping up ...
keyword[def] identifier[reportProgress] ( identifier[self] , identifier[state] , identifier[action] , identifier[text] = keyword[None] , identifier[tick] = keyword[None] ): literal[string] keyword[if] identifier[self] . identifier[progressFunc] keyword[is] keyword[not] keyword[None] : ...
def reportProgress(self, state, action, text=None, tick=None): """ If we want to keep other code updated about our progress. state: 'prep' reading sources 'generate' making instances 'done' wrapping up 'error' r...
def detectWebOSTV(self): """Return detection of a WebOS smart TV Detects if the current browser is on a WebOS smart TV. """ return UAgentInfo.deviceWebOStv in self.__userAgent \ and UAgentInfo.smartTV2 in self.__userAgent
def function[detectWebOSTV, parameter[self]]: constant[Return detection of a WebOS smart TV Detects if the current browser is on a WebOS smart TV. ] return[<ast.BoolOp object at 0x7da1b0af81f0>]
keyword[def] identifier[detectWebOSTV] ( identifier[self] ): literal[string] keyword[return] identifier[UAgentInfo] . identifier[deviceWebOStv] keyword[in] identifier[self] . identifier[__userAgent] keyword[and] identifier[UAgentInfo] . identifier[smartTV2] keyword[in] identifier[self] . ide...
def detectWebOSTV(self): """Return detection of a WebOS smart TV Detects if the current browser is on a WebOS smart TV. """ return UAgentInfo.deviceWebOStv in self.__userAgent and UAgentInfo.smartTV2 in self.__userAgent
def getDigitalID(self,num): """ Reads the COMTRADE ID of a given channel number. The number to be given is the same of the COMTRADE header. """ listidx = self.Dn.index(num) # Get the position of the channel number. return self.Dch_id[listidx]
def function[getDigitalID, parameter[self, num]]: constant[ Reads the COMTRADE ID of a given channel number. The number to be given is the same of the COMTRADE header. ] variable[listidx] assign[=] call[name[self].Dn.index, parameter[name[num]]] return[call[name[self].Dch_id]...
keyword[def] identifier[getDigitalID] ( identifier[self] , identifier[num] ): literal[string] identifier[listidx] = identifier[self] . identifier[Dn] . identifier[index] ( identifier[num] ) keyword[return] identifier[self] . identifier[Dch_id] [ identifier[listidx] ]
def getDigitalID(self, num): """ Reads the COMTRADE ID of a given channel number. The number to be given is the same of the COMTRADE header. """ listidx = self.Dn.index(num) # Get the position of the channel number. return self.Dch_id[listidx]
def on_error(self, error, items): """ Handles error callbacks when using Segment with segment_debug_mode set to True """ self.log.error('Encountered Segment error: {segment_error} with ' 'items: {with_items}'.format(segment_error=error, ...
def function[on_error, parameter[self, error, items]]: constant[ Handles error callbacks when using Segment with segment_debug_mode set to True ] call[name[self].log.error, parameter[call[constant[Encountered Segment error: {segment_error} with items: {with_items}].format, parameter[]]]]...
keyword[def] identifier[on_error] ( identifier[self] , identifier[error] , identifier[items] ): literal[string] identifier[self] . identifier[log] . identifier[error] ( literal[string] literal[string] . identifier[format] ( identifier[segment_error] = identifier[error] , identifi...
def on_error(self, error, items): """ Handles error callbacks when using Segment with segment_debug_mode set to True """ self.log.error('Encountered Segment error: {segment_error} with items: {with_items}'.format(segment_error=error, with_items=items)) raise AirflowException('Segment error: ...
def add_available_action(self, name, metadata, cls): """ Add an available action. name -- name of the action metadata -- action metadata, i.e. type, description, etc., as a dict cls -- class to instantiate for this action """ if metadata is None: meta...
def function[add_available_action, parameter[self, name, metadata, cls]]: constant[ Add an available action. name -- name of the action metadata -- action metadata, i.e. type, description, etc., as a dict cls -- class to instantiate for this action ] if compare[n...
keyword[def] identifier[add_available_action] ( identifier[self] , identifier[name] , identifier[metadata] , identifier[cls] ): literal[string] keyword[if] identifier[metadata] keyword[is] keyword[None] : identifier[metadata] ={} identifier[self] . identifier[available_act...
def add_available_action(self, name, metadata, cls): """ Add an available action. name -- name of the action metadata -- action metadata, i.e. type, description, etc., as a dict cls -- class to instantiate for this action """ if metadata is None: metadata = {} #...
def new_message(self, recipient=None, *, recipient_type=RecipientType.TO): """ This method returns a new draft Message instance with contacts first email as a recipient :param Recipient recipient: a Recipient instance where to send this message. If None first email of this contact will...
def function[new_message, parameter[self, recipient]]: constant[ This method returns a new draft Message instance with contacts first email as a recipient :param Recipient recipient: a Recipient instance where to send this message. If None first email of this contact will be used ...
keyword[def] identifier[new_message] ( identifier[self] , identifier[recipient] = keyword[None] ,*, identifier[recipient_type] = identifier[RecipientType] . identifier[TO] ): literal[string] keyword[if] identifier[self] . identifier[main_resource] == identifier[GAL_MAIN_RESOURCE] : ...
def new_message(self, recipient=None, *, recipient_type=RecipientType.TO): """ This method returns a new draft Message instance with contacts first email as a recipient :param Recipient recipient: a Recipient instance where to send this message. If None first email of this contact will be ...
def peek(quantity, min_type=EventType.firstevent, max_type=EventType.lastevent): """Return events at the front of the event queue, within the specified minimum and maximum type, and do not remove them from the queue. Args: quantity (int): The maximum number of events to return. min_type (in...
def function[peek, parameter[quantity, min_type, max_type]]: constant[Return events at the front of the event queue, within the specified minimum and maximum type, and do not remove them from the queue. Args: quantity (int): The maximum number of events to return. min_type (int): The mi...
keyword[def] identifier[peek] ( identifier[quantity] , identifier[min_type] = identifier[EventType] . identifier[firstevent] , identifier[max_type] = identifier[EventType] . identifier[lastevent] ): literal[string] keyword[return] identifier[_peep] ( identifier[quantity] , identifier[lib] . identifier[SD...
def peek(quantity, min_type=EventType.firstevent, max_type=EventType.lastevent): """Return events at the front of the event queue, within the specified minimum and maximum type, and do not remove them from the queue. Args: quantity (int): The maximum number of events to return. min_type (in...
def web_task(f): """ Checks if the task is called through the web interface. Task return value should be in format {'data': ...}. """ @wraps(f) def web_task_decorator(*args, **kwargs): jc = JobContext.get_current_context() if not isinstance(jc, WebJobContext): raise ...
def function[web_task, parameter[f]]: constant[ Checks if the task is called through the web interface. Task return value should be in format {'data': ...}. ] def function[web_task_decorator, parameter[]]: variable[jc] assign[=] call[name[JobContext].get_current_context, para...
keyword[def] identifier[web_task] ( identifier[f] ): literal[string] @ identifier[wraps] ( identifier[f] ) keyword[def] identifier[web_task_decorator] (* identifier[args] ,** identifier[kwargs] ): identifier[jc] = identifier[JobContext] . identifier[get_current_context] () keyword[i...
def web_task(f): """ Checks if the task is called through the web interface. Task return value should be in format {'data': ...}. """ @wraps(f) def web_task_decorator(*args, **kwargs): jc = JobContext.get_current_context() if not isinstance(jc, WebJobContext): raise ...
def getRejectionReasonsItems(self): """Return the list of predefined rejection reasons """ reasons = self.getRejectionReasons() if not reasons: return [] reasons = reasons[0] keys = filter(lambda key: key != "checkbox", reasons.keys()) return map(lambd...
def function[getRejectionReasonsItems, parameter[self]]: constant[Return the list of predefined rejection reasons ] variable[reasons] assign[=] call[name[self].getRejectionReasons, parameter[]] if <ast.UnaryOp object at 0x7da1b1d49a50> begin[:] return[list[[]]] variable[r...
keyword[def] identifier[getRejectionReasonsItems] ( identifier[self] ): literal[string] identifier[reasons] = identifier[self] . identifier[getRejectionReasons] () keyword[if] keyword[not] identifier[reasons] : keyword[return] [] identifier[reasons] = identifier[rea...
def getRejectionReasonsItems(self): """Return the list of predefined rejection reasons """ reasons = self.getRejectionReasons() if not reasons: return [] # depends on [control=['if'], data=[]] reasons = reasons[0] keys = filter(lambda key: key != 'checkbox', reasons.keys()) retu...
def resolve(self, parameters): """ Resolve given variable """ if self.default_value == DUMMY_VALUE: if self.name in parameters: return parameters[self.name] else: raise VelException(f"Undefined parameter: {self.name}") else: ret...
def function[resolve, parameter[self, parameters]]: constant[ Resolve given variable ] if compare[name[self].default_value equal[==] name[DUMMY_VALUE]] begin[:] if compare[name[self].name in name[parameters]] begin[:] return[call[name[parameters]][name[self].name]]
keyword[def] identifier[resolve] ( identifier[self] , identifier[parameters] ): literal[string] keyword[if] identifier[self] . identifier[default_value] == identifier[DUMMY_VALUE] : keyword[if] identifier[self] . identifier[name] keyword[in] identifier[parameters] : ...
def resolve(self, parameters): """ Resolve given variable """ if self.default_value == DUMMY_VALUE: if self.name in parameters: return parameters[self.name] # depends on [control=['if'], data=['parameters']] else: raise VelException(f'Undefined parameter: {self.name}') ...
def get_instance(cls, instance_or_pk): """Return a model instance in ``db.session``. :param instance_or_pk: An instance of this model class, or a primary key. A composite primary key can be passed as a tuple. Example:: @db.atomic def increase_account_ba...
def function[get_instance, parameter[cls, instance_or_pk]]: constant[Return a model instance in ``db.session``. :param instance_or_pk: An instance of this model class, or a primary key. A composite primary key can be passed as a tuple. Example:: @db.atomic ...
keyword[def] identifier[get_instance] ( identifier[cls] , identifier[instance_or_pk] ): literal[string] keyword[if] identifier[isinstance] ( identifier[instance_or_pk] , identifier[cls] ): keyword[if] identifier[instance_or_pk] keyword[in] identifier[cls] . identifier[_flask_signa...
def get_instance(cls, instance_or_pk): """Return a model instance in ``db.session``. :param instance_or_pk: An instance of this model class, or a primary key. A composite primary key can be passed as a tuple. Example:: @db.atomic def increase_account_balanc...
def t384(args): """ %prog t384 Print out a table converting between 96 well to 384 well """ p = OptionParser(t384.__doc__) opts, args = p.parse_args(args) plate, splate = get_plate() fw = sys.stdout for i in plate: for j, p in enumerate(i): if j != 0: ...
def function[t384, parameter[args]]: constant[ %prog t384 Print out a table converting between 96 well to 384 well ] variable[p] assign[=] call[name[OptionParser], parameter[name[t384].__doc__]] <ast.Tuple object at 0x7da1b077d840> assign[=] call[name[p].parse_args, parameter[name[a...
keyword[def] identifier[t384] ( identifier[args] ): literal[string] identifier[p] = identifier[OptionParser] ( identifier[t384] . identifier[__doc__] ) identifier[opts] , identifier[args] = identifier[p] . identifier[parse_args] ( identifier[args] ) identifier[plate] , identifier[splate] = ident...
def t384(args): """ %prog t384 Print out a table converting between 96 well to 384 well """ p = OptionParser(t384.__doc__) (opts, args) = p.parse_args(args) (plate, splate) = get_plate() fw = sys.stdout for i in plate: for (j, p) in enumerate(i): if j != 0: ...
def create( name, attributes=None, region=None, key=None, keyid=None, profile=None, ): ''' Create an SQS queue. CLI Example: .. code-block:: bash salt myminion boto_sqs.create myqueue region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, pr...
def function[create, parameter[name, attributes, region, key, keyid, profile]]: constant[ Create an SQS queue. CLI Example: .. code-block:: bash salt myminion boto_sqs.create myqueue region=us-east-1 ] variable[conn] assign[=] call[name[_get_conn], parameter[]] if comp...
keyword[def] identifier[create] ( identifier[name] , identifier[attributes] = keyword[None] , identifier[region] = keyword[None] , identifier[key] = keyword[None] , identifier[keyid] = keyword[None] , identifier[profile] = keyword[None] , ): literal[string] identifier[conn] = identifier[_get_conn] ( ...
def create(name, attributes=None, region=None, key=None, keyid=None, profile=None): """ Create an SQS queue. CLI Example: .. code-block:: bash salt myminion boto_sqs.create myqueue region=us-east-1 """ conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) if attri...
def import_from_json(self, data): """ Replace the current roster with the :meth:`export_as_json`-compatible dictionary in `data`. No events are fired during this activity. After this method completes, the whole roster contents are exchanged with the contents from `data`. ...
def function[import_from_json, parameter[self, data]]: constant[ Replace the current roster with the :meth:`export_as_json`-compatible dictionary in `data`. No events are fired during this activity. After this method completes, the whole roster contents are exchanged with the co...
keyword[def] identifier[import_from_json] ( identifier[self] , identifier[data] ): literal[string] identifier[self] . identifier[version] = identifier[data] . identifier[get] ( literal[string] , keyword[None] ) identifier[self] . identifier[items] . identifier[clear] () identifie...
def import_from_json(self, data): """ Replace the current roster with the :meth:`export_as_json`-compatible dictionary in `data`. No events are fired during this activity. After this method completes, the whole roster contents are exchanged with the contents from `data`. Al...
def remove(self, decoration): """ Removes a text decoration from the editor. :param decoration: Text decoration to remove :type decoration: spyder.api.TextDecoration """ try: self._decorations.remove(decoration) self.update() return Tr...
def function[remove, parameter[self, decoration]]: constant[ Removes a text decoration from the editor. :param decoration: Text decoration to remove :type decoration: spyder.api.TextDecoration ] <ast.Try object at 0x7da2041d9360>
keyword[def] identifier[remove] ( identifier[self] , identifier[decoration] ): literal[string] keyword[try] : identifier[self] . identifier[_decorations] . identifier[remove] ( identifier[decoration] ) identifier[self] . identifier[update] () keyword[return] ...
def remove(self, decoration): """ Removes a text decoration from the editor. :param decoration: Text decoration to remove :type decoration: spyder.api.TextDecoration """ try: self._decorations.remove(decoration) self.update() return True # depends on [co...
def create(self): """Create a single instance of notebook.""" # Point to chart repo. out = helm( "repo", "add", "jupyterhub", self.helm_repo ) out = helm("repo", "update") # Get token to secure Jupyterhub secret_yam...
def function[create, parameter[self]]: constant[Create a single instance of notebook.] variable[out] assign[=] call[name[helm], parameter[constant[repo], constant[add], constant[jupyterhub], name[self].helm_repo]] variable[out] assign[=] call[name[helm], parameter[constant[repo], constant[update...
keyword[def] identifier[create] ( identifier[self] ): literal[string] identifier[out] = identifier[helm] ( literal[string] , literal[string] , literal[string] , identifier[self] . identifier[helm_repo] ) identifier[out] = identifier[hel...
def create(self): """Create a single instance of notebook.""" # Point to chart repo. out = helm('repo', 'add', 'jupyterhub', self.helm_repo) out = helm('repo', 'update') # Get token to secure Jupyterhub secret_yaml = self.get_security_yaml() # Get Jupyterhub. out = helm('upgrade', '--ins...
def audio_interfaces(): """ Extracts audio interfaces data :return list[AudioInterface]: Audio interfaces data """ p = pyaudio.PyAudio() interfaces = [] for i in range(p.get_device_count()): data = p.get_device_info_by_index(i) if 'hw' no...
def function[audio_interfaces, parameter[]]: constant[ Extracts audio interfaces data :return list[AudioInterface]: Audio interfaces data ] variable[p] assign[=] call[name[pyaudio].PyAudio, parameter[]] variable[interfaces] assign[=] list[[]] for taget[name[i]] i...
keyword[def] identifier[audio_interfaces] (): literal[string] identifier[p] = identifier[pyaudio] . identifier[PyAudio] () identifier[interfaces] =[] keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[p] . identifier[get_device_count] ()): ident...
def audio_interfaces(): """ Extracts audio interfaces data :return list[AudioInterface]: Audio interfaces data """ p = pyaudio.PyAudio() interfaces = [] for i in range(p.get_device_count()): data = p.get_device_info_by_index(i) if 'hw' not in data['name']: ...
def get_history(self): """get all msg_ids, ordered by time submitted.""" cursor = self._records.find({},{'msg_id':1}).sort('submitted') return [ rec['msg_id'] for rec in cursor ]
def function[get_history, parameter[self]]: constant[get all msg_ids, ordered by time submitted.] variable[cursor] assign[=] call[call[name[self]._records.find, parameter[dictionary[[], []], dictionary[[<ast.Constant object at 0x7da2045668c0>], [<ast.Constant object at 0x7da204564340>]]]].sort, paramete...
keyword[def] identifier[get_history] ( identifier[self] ): literal[string] identifier[cursor] = identifier[self] . identifier[_records] . identifier[find] ({},{ literal[string] : literal[int] }). identifier[sort] ( literal[string] ) keyword[return] [ identifier[rec] [ literal[string] ] key...
def get_history(self): """get all msg_ids, ordered by time submitted.""" cursor = self._records.find({}, {'msg_id': 1}).sort('submitted') return [rec['msg_id'] for rec in cursor]
def height(self, height=None): """Returns or sets (if a value is provided) the chart's height. :param height: If given, the chart's height will be set to this.""" if height is None: return self._height else: if not is_numeric(height): raise TypeE...
def function[height, parameter[self, height]]: constant[Returns or sets (if a value is provided) the chart's height. :param height: If given, the chart's height will be set to this.] if compare[name[height] is constant[None]] begin[:] return[name[self]._height]
keyword[def] identifier[height] ( identifier[self] , identifier[height] = keyword[None] ): literal[string] keyword[if] identifier[height] keyword[is] keyword[None] : keyword[return] identifier[self] . identifier[_height] keyword[else] : keyword[if] keyword[...
def height(self, height=None): """Returns or sets (if a value is provided) the chart's height. :param height: If given, the chart's height will be set to this.""" if height is None: return self._height # depends on [control=['if'], data=[]] else: if not is_numeric(height): ...
def run(self): """Run.""" self.count += 1 message = Paragraph('IF2 run %i - running' % self.count) dispatcher.send( signal=DYNAMIC_MESSAGE_SIGNAL, sender=self, message=message)
def function[run, parameter[self]]: constant[Run.] <ast.AugAssign object at 0x7da18dc06200> variable[message] assign[=] call[name[Paragraph], parameter[binary_operation[constant[IF2 run %i - running] <ast.Mod object at 0x7da2590d6920> name[self].count]]] call[name[dispatcher].send, parameter...
keyword[def] identifier[run] ( identifier[self] ): literal[string] identifier[self] . identifier[count] += literal[int] identifier[message] = identifier[Paragraph] ( literal[string] % identifier[self] . identifier[count] ) identifier[dispatcher] . identifier[send] ( iden...
def run(self): """Run.""" self.count += 1 message = Paragraph('IF2 run %i - running' % self.count) dispatcher.send(signal=DYNAMIC_MESSAGE_SIGNAL, sender=self, message=message)
def loop(self): """ check for mails and send them """ for mail in Mail.objects.filter(done=False, send_fail_count__lt=3): # send all emails that are not already send or failed to send less # then three times mail.send_mail() for mail in Mail.o...
def function[loop, parameter[self]]: constant[ check for mails and send them ] for taget[name[mail]] in starred[call[name[Mail].objects.filter, parameter[]]] begin[:] call[name[mail].send_mail, parameter[]] for taget[name[mail]] in starred[call[name[Mail].objects....
keyword[def] identifier[loop] ( identifier[self] ): literal[string] keyword[for] identifier[mail] keyword[in] identifier[Mail] . identifier[objects] . identifier[filter] ( identifier[done] = keyword[False] , identifier[send_fail_count__lt] = literal[int] ): identif...
def loop(self): """ check for mails and send them """ for mail in Mail.objects.filter(done=False, send_fail_count__lt=3): # send all emails that are not already send or failed to send less # then three times mail.send_mail() # depends on [control=['for'], data=['mail']] ...
def get_empty_dimension(**kwargs): """ Returns a dimension object initialized with empty values """ dimension = JSONObject(Dimension()) dimension.id = None dimension.name = '' dimension.description = '' dimension.project_id = None dimension.units = [] return dimension
def function[get_empty_dimension, parameter[]]: constant[ Returns a dimension object initialized with empty values ] variable[dimension] assign[=] call[name[JSONObject], parameter[call[name[Dimension], parameter[]]]] name[dimension].id assign[=] constant[None] name[dimension]...
keyword[def] identifier[get_empty_dimension] (** identifier[kwargs] ): literal[string] identifier[dimension] = identifier[JSONObject] ( identifier[Dimension] ()) identifier[dimension] . identifier[id] = keyword[None] identifier[dimension] . identifier[name] = literal[string] identifier[dim...
def get_empty_dimension(**kwargs): """ Returns a dimension object initialized with empty values """ dimension = JSONObject(Dimension()) dimension.id = None dimension.name = '' dimension.description = '' dimension.project_id = None dimension.units = [] return dimension
def convertShpToExtend(pathToShp): """ reprojette en WGS84 et recupere l'extend """ driver = ogr.GetDriverByName('ESRI Shapefile') dataset = driver.Open(pathToShp) if dataset is not None: # from Layer layer = dataset.GetLayer() spatialRef = layer.GetSpatialRef() ...
def function[convertShpToExtend, parameter[pathToShp]]: constant[ reprojette en WGS84 et recupere l'extend ] variable[driver] assign[=] call[name[ogr].GetDriverByName, parameter[constant[ESRI Shapefile]]] variable[dataset] assign[=] call[name[driver].Open, parameter[name[pathToShp]]] ...
keyword[def] identifier[convertShpToExtend] ( identifier[pathToShp] ): literal[string] identifier[driver] = identifier[ogr] . identifier[GetDriverByName] ( literal[string] ) identifier[dataset] = identifier[driver] . identifier[Open] ( identifier[pathToShp] ) keyword[if] identifier[dataset] ke...
def convertShpToExtend(pathToShp): """ reprojette en WGS84 et recupere l'extend """ driver = ogr.GetDriverByName('ESRI Shapefile') dataset = driver.Open(pathToShp) if dataset is not None: # from Layer layer = dataset.GetLayer() spatialRef = layer.GetSpatialRef() #...
def create_translation(self, language_code, **fields): """ Add a translation to the model. The :func:`save_translations` function is called afterwards. The object will be saved immediately, similar to calling :func:`~django.db.models.manager.Manager.create` or :func:`~d...
def function[create_translation, parameter[self, language_code]]: constant[ Add a translation to the model. The :func:`save_translations` function is called afterwards. The object will be saved immediately, similar to calling :func:`~django.db.models.manager.Manager.create` ...
keyword[def] identifier[create_translation] ( identifier[self] , identifier[language_code] ,** identifier[fields] ): literal[string] keyword[if] identifier[language_code] keyword[is] keyword[None] : keyword[raise] identifier[ValueError] ( identifier[get_null_language_error] ()) ...
def create_translation(self, language_code, **fields): """ Add a translation to the model. The :func:`save_translations` function is called afterwards. The object will be saved immediately, similar to calling :func:`~django.db.models.manager.Manager.create` or :func:`~djang...
def set_names(self, names): """ Change names of all columns in the frame. :param List[str] names: The list of new names for every column in the frame. """ assert_is_type(names, [str]) assert_satisfies(names, len(names) == self.ncol) self._ex = ExprNode("colnames=...
def function[set_names, parameter[self, names]]: constant[ Change names of all columns in the frame. :param List[str] names: The list of new names for every column in the frame. ] call[name[assert_is_type], parameter[name[names], list[[<ast.Name object at 0x7da204345e70>]]]] ...
keyword[def] identifier[set_names] ( identifier[self] , identifier[names] ): literal[string] identifier[assert_is_type] ( identifier[names] ,[ identifier[str] ]) identifier[assert_satisfies] ( identifier[names] , identifier[len] ( identifier[names] )== identifier[self] . identifier[ncol] )...
def set_names(self, names): """ Change names of all columns in the frame. :param List[str] names: The list of new names for every column in the frame. """ assert_is_type(names, [str]) assert_satisfies(names, len(names) == self.ncol) self._ex = ExprNode('colnames=', self, range(s...
def _validate_cert_chain(self, cert_chain): # type: (Certificate) -> None """Validate the certificate chain. This method checks if the passed in certificate chain is valid, i.e it is not expired and the Alexa domain is present in the SAN extensions of the certificate chain. A ...
def function[_validate_cert_chain, parameter[self, cert_chain]]: constant[Validate the certificate chain. This method checks if the passed in certificate chain is valid, i.e it is not expired and the Alexa domain is present in the SAN extensions of the certificate chain. A :py:c...
keyword[def] identifier[_validate_cert_chain] ( identifier[self] , identifier[cert_chain] ): literal[string] identifier[now] = identifier[datetime] . identifier[utcnow] () keyword[if] keyword[not] ( identifier[cert_chain] . identifier[not_valid_before] <= identifier[now] <= iden...
def _validate_cert_chain(self, cert_chain): # type: (Certificate) -> None 'Validate the certificate chain.\n\n This method checks if the passed in certificate chain is valid,\n i.e it is not expired and the Alexa domain is present in the\n SAN extensions of the certificate chain. A\n ...
def check_file_for_aws_keys(filenames, keys): # type: (Sequence[str], Set[str]) -> List[Dict[str, str]] """Check if files contain AWS secrets. Return a list of all files containing AWS secrets and keys found, with all but the first four characters obfuscated to ease debugging. """ bad_files = [...
def function[check_file_for_aws_keys, parameter[filenames, keys]]: constant[Check if files contain AWS secrets. Return a list of all files containing AWS secrets and keys found, with all but the first four characters obfuscated to ease debugging. ] variable[bad_files] assign[=] list[[]] ...
keyword[def] identifier[check_file_for_aws_keys] ( identifier[filenames] , identifier[keys] ): literal[string] identifier[bad_files] =[] keyword[for] identifier[filename] keyword[in] identifier[filenames] : keyword[with] identifier[open] ( identifier[filename] , literal[string] ) keywor...
def check_file_for_aws_keys(filenames, keys): # type: (Sequence[str], Set[str]) -> List[Dict[str, str]] 'Check if files contain AWS secrets.\n\n Return a list of all files containing AWS secrets and keys found, with all\n but the first four characters obfuscated to ease debugging.\n ' bad_files = [...
def subscribe(self, obj, handler): """Subscribes to status updates of the requested object. DEPRECATED The handler will be invoked when the controller sends a notification regarding changed state. The user can then further query the object for the state itself.""" if not isinstance(obj, Lutron...
def function[subscribe, parameter[self, obj, handler]]: constant[Subscribes to status updates of the requested object. DEPRECATED The handler will be invoked when the controller sends a notification regarding changed state. The user can then further query the object for the state itself.] ...
keyword[def] identifier[subscribe] ( identifier[self] , identifier[obj] , identifier[handler] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[obj] , identifier[LutronEntity] ): keyword[raise] identifier[InvalidSubscription] ( literal[string] ) identifier[_LOGG...
def subscribe(self, obj, handler): """Subscribes to status updates of the requested object. DEPRECATED The handler will be invoked when the controller sends a notification regarding changed state. The user can then further query the object for the state itself.""" if not isinstance(obj, Lutron...
def split_input(cls, mapper_spec): """Returns a list of input readers for the given input specification. Args: mapper_spec: The MapperSpec for this InputReader. Returns: A list of InputReaders. """ params = _get_params(mapper_spec) shard_count = mapper_spec.shard_count # Pick ...
def function[split_input, parameter[cls, mapper_spec]]: constant[Returns a list of input readers for the given input specification. Args: mapper_spec: The MapperSpec for this InputReader. Returns: A list of InputReaders. ] variable[params] assign[=] call[name[_get_params], para...
keyword[def] identifier[split_input] ( identifier[cls] , identifier[mapper_spec] ): literal[string] identifier[params] = identifier[_get_params] ( identifier[mapper_spec] ) identifier[shard_count] = identifier[mapper_spec] . identifier[shard_count] identifier[start_time] = identifier[param...
def split_input(cls, mapper_spec): """Returns a list of input readers for the given input specification. Args: mapper_spec: The MapperSpec for this InputReader. Returns: A list of InputReaders. """ params = _get_params(mapper_spec) shard_count = mapper_spec.shard_count # Pick o...
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types): """ See :meth:`superclass method <.base.GroundShakingIntensityModel.get_mean_and_stddevs>` for spec of input and result values. """ # extracting dictionary of coefficients specific to required #...
def function[get_mean_and_stddevs, parameter[self, sites, rup, dists, imt, stddev_types]]: constant[ See :meth:`superclass method <.base.GroundShakingIntensityModel.get_mean_and_stddevs>` for spec of input and result values. ] variable[C] assign[=] call[name[self].COEFFS]...
keyword[def] identifier[get_mean_and_stddevs] ( identifier[self] , identifier[sites] , identifier[rup] , identifier[dists] , identifier[imt] , identifier[stddev_types] ): literal[string] identifier[C] = identifier[self] . identifier[COEFFS] [ identifier[imt] ] identifier[...
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types): """ See :meth:`superclass method <.base.GroundShakingIntensityModel.get_mean_and_stddevs>` for spec of input and result values. """ # extracting dictionary of coefficients specific to required # intensity m...
def index(args): """ %prog index database.fasta ` Wrapper for `gmap_build`. Same interface. """ p = OptionParser(index.__doc__) p.add_option("--supercat", default=False, action="store_true", help="Concatenate reference to speed up alignment") opts, args = p.parse_args(args) ...
def function[index, parameter[args]]: constant[ %prog index database.fasta ` Wrapper for `gmap_build`. Same interface. ] variable[p] assign[=] call[name[OptionParser], parameter[name[index].__doc__]] call[name[p].add_option, parameter[constant[--supercat]]] <ast.Tuple object ...
keyword[def] identifier[index] ( identifier[args] ): literal[string] identifier[p] = identifier[OptionParser] ( identifier[index] . identifier[__doc__] ) identifier[p] . identifier[add_option] ( literal[string] , identifier[default] = keyword[False] , identifier[action] = literal[string] , identi...
def index(args): """ %prog index database.fasta ` Wrapper for `gmap_build`. Same interface. """ p = OptionParser(index.__doc__) p.add_option('--supercat', default=False, action='store_true', help='Concatenate reference to speed up alignment') (opts, args) = p.parse_args(args) if len(args...
def complete_handle(self) -> Generator[Any, None, None]: """ 完成回调 """ if self._request is None: return self._response = Response( self._loop, cast(asyncio.Transport, self._transport), self._request.version or DEFAULT_HTTP_VERSION, ...
def function[complete_handle, parameter[self]]: constant[ 完成回调 ] if compare[name[self]._request is constant[None]] begin[:] return[None] name[self]._response assign[=] call[name[Response], parameter[name[self]._loop, call[name[cast], parameter[name[asyncio].Transport, nam...
keyword[def] identifier[complete_handle] ( identifier[self] )-> identifier[Generator] [ identifier[Any] , keyword[None] , keyword[None] ]: literal[string] keyword[if] identifier[self] . identifier[_request] keyword[is] keyword[None] : keyword[return] identifier[self] . ide...
def complete_handle(self) -> Generator[Any, None, None]: """ 完成回调 """ if self._request is None: return # depends on [control=['if'], data=[]] self._response = Response(self._loop, cast(asyncio.Transport, self._transport), self._request.version or DEFAULT_HTTP_VERSION, self._response...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type retur...
def function[_to_dict, parameter[self]]: constant[Return a json dictionary representing this model.] variable[_dict] assign[=] dictionary[[], []] if <ast.BoolOp object at 0x7da18f09fbb0> begin[:] call[name[_dict]][constant[status]] assign[=] name[self].status if <ast.Bool...
keyword[def] identifier[_to_dict] ( identifier[self] ): literal[string] identifier[_dict] ={} keyword[if] identifier[hasattr] ( identifier[self] , literal[string] ) keyword[and] identifier[self] . identifier[status] keyword[is] keyword[not] keyword[None] : identifier[_dic...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status # depends on [control=['if'], data=[]] if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.ty...
def data_to_sys_base(self): """ Converts parameters to system base. Stores a copy in ``self._store``. Sets the flag ``self.flag['sysbase']`` to True. :return: None """ if (not self.n) or self._flags['sysbase']: return Sb = self.system.mva Vb =...
def function[data_to_sys_base, parameter[self]]: constant[ Converts parameters to system base. Stores a copy in ``self._store``. Sets the flag ``self.flag['sysbase']`` to True. :return: None ] if <ast.BoolOp object at 0x7da18f58fe50> begin[:] return[None] ...
keyword[def] identifier[data_to_sys_base] ( identifier[self] ): literal[string] keyword[if] ( keyword[not] identifier[self] . identifier[n] ) keyword[or] identifier[self] . identifier[_flags] [ literal[string] ]: keyword[return] identifier[Sb] = identifier[self] . identifie...
def data_to_sys_base(self): """ Converts parameters to system base. Stores a copy in ``self._store``. Sets the flag ``self.flag['sysbase']`` to True. :return: None """ if not self.n or self._flags['sysbase']: return # depends on [control=['if'], data=[]] Sb = self.s...
def set_http_application_url_output_status_string(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") set_http_application_url = ET.Element("set_http_application_url") config = set_http_application_url output = ET.SubElement(set_http_application_url,...
def function[set_http_application_url_output_status_string, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[set_http_application_url] assign[=] call[name[ET].Element, parameter[constant[set_http_appl...
keyword[def] identifier[set_http_application_url_output_status_string] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[set_http_application_url] = identifier[ET] . identifier[Element] ( li...
def set_http_application_url_output_status_string(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') set_http_application_url = ET.Element('set_http_application_url') config = set_http_application_url output = ET.SubElement(set_http_application_url, 'output') statu...
def gap_to_sorl(time_gap): """ P1D to +1DAY :param time_gap: :return: solr's format duration. """ quantity, unit = parse_ISO8601(time_gap) if unit[0] == "WEEKS": return "+{0}DAYS".format(quantity * 7) else: return "+{0}{1}".format(quantity, unit[0])
def function[gap_to_sorl, parameter[time_gap]]: constant[ P1D to +1DAY :param time_gap: :return: solr's format duration. ] <ast.Tuple object at 0x7da18dc99f90> assign[=] call[name[parse_ISO8601], parameter[name[time_gap]]] if compare[call[name[unit]][constant[0]] equal[==] consta...
keyword[def] identifier[gap_to_sorl] ( identifier[time_gap] ): literal[string] identifier[quantity] , identifier[unit] = identifier[parse_ISO8601] ( identifier[time_gap] ) keyword[if] identifier[unit] [ literal[int] ]== literal[string] : keyword[return] literal[string] . identifier[format] ...
def gap_to_sorl(time_gap): """ P1D to +1DAY :param time_gap: :return: solr's format duration. """ (quantity, unit) = parse_ISO8601(time_gap) if unit[0] == 'WEEKS': return '+{0}DAYS'.format(quantity * 7) # depends on [control=['if'], data=[]] else: return '+{0}{1}'.format...
def utcnow_ts(): """Timestamp version of our utcnow function.""" if utcnow.override_time is None: # NOTE(kgriffs): This is several times faster # than going through calendar.timegm(...) return int(time.time()) return calendar.timegm(utcnow().timetuple())
def function[utcnow_ts, parameter[]]: constant[Timestamp version of our utcnow function.] if compare[name[utcnow].override_time is constant[None]] begin[:] return[call[name[int], parameter[call[name[time].time, parameter[]]]]] return[call[name[calendar].timegm, parameter[call[call[name[utcno...
keyword[def] identifier[utcnow_ts] (): literal[string] keyword[if] identifier[utcnow] . identifier[override_time] keyword[is] keyword[None] : keyword[return] identifier[int] ( identifier[time] . identifier[time] ()) keyword[return] identifier[calendar] . identifier[timegm] ( i...
def utcnow_ts(): """Timestamp version of our utcnow function.""" if utcnow.override_time is None: # NOTE(kgriffs): This is several times faster # than going through calendar.timegm(...) return int(time.time()) # depends on [control=['if'], data=[]] return calendar.timegm(utcnow().ti...
def element_or_none(self, using, value): """Check if an element in the current element. Support: Android iOS Web(WebView) Args: using(str): The element location strategy. value(str): The value of the location strategy. Returns: Return El...
def function[element_or_none, parameter[self, using, value]]: constant[Check if an element in the current element. Support: Android iOS Web(WebView) Args: using(str): The element location strategy. value(str): The value of the location strategy. Ret...
keyword[def] identifier[element_or_none] ( identifier[self] , identifier[using] , identifier[value] ): literal[string] keyword[try] : keyword[return] identifier[self] . identifier[_execute] ( identifier[Command] . identifier[FIND_CHILD_ELEMENT] ,{ literal[string] : identi...
def element_or_none(self, using, value): """Check if an element in the current element. Support: Android iOS Web(WebView) Args: using(str): The element location strategy. value(str): The value of the location strategy. Returns: Return Elemen...
def code_div(self): """The string for creating a code example for the gallery""" code_example = self.code_example if code_example is None: return None return self.CODE_TEMPLATE.format( snippet=self.get_description()[1], code=code_example, ref_name=self...
def function[code_div, parameter[self]]: constant[The string for creating a code example for the gallery] variable[code_example] assign[=] name[self].code_example if compare[name[code_example] is constant[None]] begin[:] return[constant[None]] return[call[name[self].CODE_TEMPLATE.for...
keyword[def] identifier[code_div] ( identifier[self] ): literal[string] identifier[code_example] = identifier[self] . identifier[code_example] keyword[if] identifier[code_example] keyword[is] keyword[None] : keyword[return] keyword[None] keyword[return] identif...
def code_div(self): """The string for creating a code example for the gallery""" code_example = self.code_example if code_example is None: return None # depends on [control=['if'], data=[]] return self.CODE_TEMPLATE.format(snippet=self.get_description()[1], code=code_example, ref_name=self.refe...
def open_submission(self): """ Open the full submission and comment tree for the selected comment. """ url = self.get_selected_item().get('submission_permalink') if url: self.selected_page = self.open_submission_page(url)
def function[open_submission, parameter[self]]: constant[ Open the full submission and comment tree for the selected comment. ] variable[url] assign[=] call[call[name[self].get_selected_item, parameter[]].get, parameter[constant[submission_permalink]]] if name[url] begin[:] ...
keyword[def] identifier[open_submission] ( identifier[self] ): literal[string] identifier[url] = identifier[self] . identifier[get_selected_item] (). identifier[get] ( literal[string] ) keyword[if] identifier[url] : identifier[self] . identifier[selected_page] = identifier[se...
def open_submission(self): """ Open the full submission and comment tree for the selected comment. """ url = self.get_selected_item().get('submission_permalink') if url: self.selected_page = self.open_submission_page(url) # depends on [control=['if'], data=[]]
def chgid(name, gid): ''' Change the gid for a named group CLI Example: .. code-block:: bash salt '*' group.chgid foo 4376 ''' if not isinstance(gid, int): raise SaltInvocationError('gid must be an integer') pre_gid = __salt__['file.group_to_gid'](name) pre_info = info...
def function[chgid, parameter[name, gid]]: constant[ Change the gid for a named group CLI Example: .. code-block:: bash salt '*' group.chgid foo 4376 ] if <ast.UnaryOp object at 0x7da20c7c8f70> begin[:] <ast.Raise object at 0x7da20c7cab00> variable[pre_gid] ass...
keyword[def] identifier[chgid] ( identifier[name] , identifier[gid] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[gid] , identifier[int] ): keyword[raise] identifier[SaltInvocationError] ( literal[string] ) identifier[pre_gid] = identifier[__salt__] [ lite...
def chgid(name, gid): """ Change the gid for a named group CLI Example: .. code-block:: bash salt '*' group.chgid foo 4376 """ if not isinstance(gid, int): raise SaltInvocationError('gid must be an integer') # depends on [control=['if'], data=[]] pre_gid = __salt__['file....
def run(self, calc_bleu=True, epoch=None, iteration=None, eval_path=None, summary=False, reference_path=None): """ Runs translation on test dataset. :param calc_bleu: if True compares results with reference and computes BLEU score :param epoch: index of the curre...
def function[run, parameter[self, calc_bleu, epoch, iteration, eval_path, summary, reference_path]]: constant[ Runs translation on test dataset. :param calc_bleu: if True compares results with reference and computes BLEU score :param epoch: index of the current epoch ...
keyword[def] identifier[run] ( identifier[self] , identifier[calc_bleu] = keyword[True] , identifier[epoch] = keyword[None] , identifier[iteration] = keyword[None] , identifier[eval_path] = keyword[None] , identifier[summary] = keyword[False] , identifier[reference_path] = keyword[None] ): literal[string] ...
def run(self, calc_bleu=True, epoch=None, iteration=None, eval_path=None, summary=False, reference_path=None): """ Runs translation on test dataset. :param calc_bleu: if True compares results with reference and computes BLEU score :param epoch: index of the current epoch ...
def set_state(self, state, *, index=0): """Set state of a light.""" return self.set_values({ ATTR_DEVICE_STATE: int(state) }, index=index)
def function[set_state, parameter[self, state]]: constant[Set state of a light.] return[call[name[self].set_values, parameter[dictionary[[<ast.Name object at 0x7da18ede5090>], [<ast.Call object at 0x7da18ede6290>]]]]]
keyword[def] identifier[set_state] ( identifier[self] , identifier[state] ,*, identifier[index] = literal[int] ): literal[string] keyword[return] identifier[self] . identifier[set_values] ({ identifier[ATTR_DEVICE_STATE] : identifier[int] ( identifier[state] ) }, identifier[index]...
def set_state(self, state, *, index=0): """Set state of a light.""" return self.set_values({ATTR_DEVICE_STATE: int(state)}, index=index)
def find_creation_date(path): """ Try to get the date that a file was created, falling back to when it was last modified if that's not possible. Parameters ---------- path : str File's path. Returns ---------- creation_date : str Time of file creation. Example ...
def function[find_creation_date, parameter[path]]: constant[ Try to get the date that a file was created, falling back to when it was last modified if that's not possible. Parameters ---------- path : str File's path. Returns ---------- creation_date : str Time of fi...
keyword[def] identifier[find_creation_date] ( identifier[path] ): literal[string] keyword[if] identifier[platform] . identifier[system] ()== literal[string] : keyword[return] ( identifier[os] . identifier[path] . identifier[getctime] ( identifier[path] )) keyword[else] : identifier[...
def find_creation_date(path): """ Try to get the date that a file was created, falling back to when it was last modified if that's not possible. Parameters ---------- path : str File's path. Returns ---------- creation_date : str Time of file creation. Example ...
def report(self, simulation, state): """Generate a report. Parameters ---------- simulation : Simulation The Simulation to generate a report for state : State The current state of the simulation """ if not self._initialized: se...
def function[report, parameter[self, simulation, state]]: constant[Generate a report. Parameters ---------- simulation : Simulation The Simulation to generate a report for state : State The current state of the simulation ] if <ast.UnaryOp...
keyword[def] identifier[report] ( identifier[self] , identifier[simulation] , identifier[state] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_initialized] : identifier[self] . identifier[_initial_clock_time] = identifier[datetime] . identifier[now] () ...
def report(self, simulation, state): """Generate a report. Parameters ---------- simulation : Simulation The Simulation to generate a report for state : State The current state of the simulation """ if not self._initialized: self._initial_...
def generate(self, x, **kwargs): """ Return a tensor that constructs adversarial examples for the given input. Generate uses tf.py_func in order to operate over tensors. :param x: A tensor with the inputs. :param kwargs: See `parse_params` """ self.parse_params(**kwargs) shape = [int(i) ...
def function[generate, parameter[self, x]]: constant[ Return a tensor that constructs adversarial examples for the given input. Generate uses tf.py_func in order to operate over tensors. :param x: A tensor with the inputs. :param kwargs: See `parse_params` ] call[name[self].parse_par...
keyword[def] identifier[generate] ( identifier[self] , identifier[x] ,** identifier[kwargs] ): literal[string] identifier[self] . identifier[parse_params] (** identifier[kwargs] ) identifier[shape] =[ identifier[int] ( identifier[i] ) keyword[for] identifier[i] keyword[in] identifier[x] . identifie...
def generate(self, x, **kwargs): """ Return a tensor that constructs adversarial examples for the given input. Generate uses tf.py_func in order to operate over tensors. :param x: A tensor with the inputs. :param kwargs: See `parse_params` """ self.parse_params(**kwargs) shape = [int(i) ...
def set(self, column, value, useMethod=True, **context): """ Sets the value for this record at the inputted column name. If the columnName provided doesn't exist within the schema, then the ColumnNotFound error will be raised. :param columnName | <str> ...
def function[set, parameter[self, column, value, useMethod]]: constant[ Sets the value for this record at the inputted column name. If the columnName provided doesn't exist within the schema, then the ColumnNotFound error will be raised. :param columnName | <s...
keyword[def] identifier[set] ( identifier[self] , identifier[column] , identifier[value] , identifier[useMethod] = keyword[True] ,** identifier[context] ): literal[string] identifier[col] = identifier[self] . identifier[schema] (). identifier[column] ( identifier[column] , identifier[raise_] = keyw...
def set(self, column, value, useMethod=True, **context): """ Sets the value for this record at the inputted column name. If the columnName provided doesn't exist within the schema, then the ColumnNotFound error will be raised. :param columnName | <str> ...
def to_numpy_matrix(self, variable_order=None): """Convert a binary quadratic model to NumPy 2D array. Args: variable_order (list, optional): If provided, indexes the rows/columns of the NumPy array. If `variable_order` includes any variables not in the binar...
def function[to_numpy_matrix, parameter[self, variable_order]]: constant[Convert a binary quadratic model to NumPy 2D array. Args: variable_order (list, optional): If provided, indexes the rows/columns of the NumPy array. If `variable_order` includes any vari...
keyword[def] identifier[to_numpy_matrix] ( identifier[self] , identifier[variable_order] = keyword[None] ): literal[string] keyword[import] identifier[numpy] keyword[as] identifier[np] keyword[if] identifier[variable_order] keyword[is] keyword[None] : identifi...
def to_numpy_matrix(self, variable_order=None): """Convert a binary quadratic model to NumPy 2D array. Args: variable_order (list, optional): If provided, indexes the rows/columns of the NumPy array. If `variable_order` includes any variables not in the binary qu...
def start_output (self): """Write start of checking info.""" super(HtmlLogger, self).start_output() header = { "encoding": self.get_charset_encoding(), "title": configuration.App, "body": self.colorbackground, "link": self.colorlink, "v...
def function[start_output, parameter[self]]: constant[Write start of checking info.] call[call[name[super], parameter[name[HtmlLogger], name[self]]].start_output, parameter[]] variable[header] assign[=] dictionary[[<ast.Constant object at 0x7da18c4ce320>, <ast.Constant object at 0x7da18c4cf820>,...
keyword[def] identifier[start_output] ( identifier[self] ): literal[string] identifier[super] ( identifier[HtmlLogger] , identifier[self] ). identifier[start_output] () identifier[header] ={ literal[string] : identifier[self] . identifier[get_charset_encoding] (), literal...
def start_output(self): """Write start of checking info.""" super(HtmlLogger, self).start_output() header = {'encoding': self.get_charset_encoding(), 'title': configuration.App, 'body': self.colorbackground, 'link': self.colorlink, 'vlink': self.colorlink, 'alink': self.colorlink, 'url': self.colorurl, 'err...
def requestFields(self, field_names, required=False, strict=False): """Add the given list of fields to the request @param field_names: The simple registration data fields to request @type field_names: [str] @param required: Whether these values should be presented to the us...
def function[requestFields, parameter[self, field_names, required, strict]]: constant[Add the given list of fields to the request @param field_names: The simple registration data fields to request @type field_names: [str] @param required: Whether these values should be presented to ...
keyword[def] identifier[requestFields] ( identifier[self] , identifier[field_names] , identifier[required] = keyword[False] , identifier[strict] = keyword[False] ): literal[string] keyword[if] identifier[isinstance] ( identifier[field_names] , identifier[basestring] ): keyword[raise] ...
def requestFields(self, field_names, required=False, strict=False): """Add the given list of fields to the request @param field_names: The simple registration data fields to request @type field_names: [str] @param required: Whether these values should be presented to the user a...
def next_child(self, child_pid): """Get the next child PID in the PID relation.""" relation = self._get_child_relation(child_pid) if relation.index is not None: return self.children.filter( PIDRelation.index > relation.index ).ordered(ord='asc').first() ...
def function[next_child, parameter[self, child_pid]]: constant[Get the next child PID in the PID relation.] variable[relation] assign[=] call[name[self]._get_child_relation, parameter[name[child_pid]]] if compare[name[relation].index is_not constant[None]] begin[:] return[call[call[call[...
keyword[def] identifier[next_child] ( identifier[self] , identifier[child_pid] ): literal[string] identifier[relation] = identifier[self] . identifier[_get_child_relation] ( identifier[child_pid] ) keyword[if] identifier[relation] . identifier[index] keyword[is] keyword[not] keyword[No...
def next_child(self, child_pid): """Get the next child PID in the PID relation.""" relation = self._get_child_relation(child_pid) if relation.index is not None: return self.children.filter(PIDRelation.index > relation.index).ordered(ord='asc').first() # depends on [control=['if'], data=[]] else...
def flush(self, file=str()): """ Flushes the updated file content to the given *file*. .. note:: Overwrites an existing file. :param str file: name and location of the file. Default is the original file. """ if file: Path(file).write_bytes(self._cache) ...
def function[flush, parameter[self, file]]: constant[ Flushes the updated file content to the given *file*. .. note:: Overwrites an existing file. :param str file: name and location of the file. Default is the original file. ] if name[file] begin[:] ...
keyword[def] identifier[flush] ( identifier[self] , identifier[file] = identifier[str] ()): literal[string] keyword[if] identifier[file] : identifier[Path] ( identifier[file] ). identifier[write_bytes] ( identifier[self] . identifier[_cache] ) keyword[else] : ide...
def flush(self, file=str()): """ Flushes the updated file content to the given *file*. .. note:: Overwrites an existing file. :param str file: name and location of the file. Default is the original file. """ if file: Path(file).write_bytes(self._cache) # depends o...
def mktempfile(self, data=None, prefix='ipython_edit_'): """Make a new tempfile and return its filename. This makes a call to tempfile.mktemp, but it registers the created filename internally so ipython cleans it up at exit time. Optional inputs: - data(None): if data is giv...
def function[mktempfile, parameter[self, data, prefix]]: constant[Make a new tempfile and return its filename. This makes a call to tempfile.mktemp, but it registers the created filename internally so ipython cleans it up at exit time. Optional inputs: - data(None): if data ...
keyword[def] identifier[mktempfile] ( identifier[self] , identifier[data] = keyword[None] , identifier[prefix] = literal[string] ): literal[string] identifier[filename] = identifier[tempfile] . identifier[mktemp] ( literal[string] , identifier[prefix] ) identifier[self] . identifier[tempf...
def mktempfile(self, data=None, prefix='ipython_edit_'): """Make a new tempfile and return its filename. This makes a call to tempfile.mktemp, but it registers the created filename internally so ipython cleans it up at exit time. Optional inputs: - data(None): if data is given, ...
def ext_pillar(minion_id, # pylint: disable=W0613 pillar, # pylint: disable=W0613 config_file): ''' Execute LDAP searches and return the aggregated data ''' config_template = None try: config_template = _render_template(config_file) except jinja2.exception...
def function[ext_pillar, parameter[minion_id, pillar, config_file]]: constant[ Execute LDAP searches and return the aggregated data ] variable[config_template] assign[=] constant[None] <ast.Try object at 0x7da1b2139510> if <ast.UnaryOp object at 0x7da1b21398a0> begin[:] retur...
keyword[def] identifier[ext_pillar] ( identifier[minion_id] , identifier[pillar] , identifier[config_file] ): literal[string] identifier[config_template] = keyword[None] keyword[try] : identifier[config_template] = identifier[_render_template] ( identifier[config_file] ) keyword[excep...
def ext_pillar(minion_id, pillar, config_file): # pylint: disable=W0613 # pylint: disable=W0613 '\n Execute LDAP searches and return the aggregated data\n ' config_template = None try: config_template = _render_template(config_file) # depends on [control=['try'], data=[]] except jinj...
def fetch_organization_courses(organization): """ Retrieves the set of courses currently linked to the specified organization """ organization_obj = serializers.deserialize_organization(organization) queryset = internal.OrganizationCourse.objects.filter( organization=organization_obj, ...
def function[fetch_organization_courses, parameter[organization]]: constant[ Retrieves the set of courses currently linked to the specified organization ] variable[organization_obj] assign[=] call[name[serializers].deserialize_organization, parameter[name[organization]]] variable[queryse...
keyword[def] identifier[fetch_organization_courses] ( identifier[organization] ): literal[string] identifier[organization_obj] = identifier[serializers] . identifier[deserialize_organization] ( identifier[organization] ) identifier[queryset] = identifier[internal] . identifier[OrganizationCourse] . id...
def fetch_organization_courses(organization): """ Retrieves the set of courses currently linked to the specified organization """ organization_obj = serializers.deserialize_organization(organization) queryset = internal.OrganizationCourse.objects.filter(organization=organization_obj, active=True).se...
def getSizes(self): """ Get all the available sizes of the current image, and all available data about them. Returns: A list of dicts with the size data. """ method = 'flickr.photos.getSizes' data = _doget(method, photo_id=self.id) ret = [] # The g...
def function[getSizes, parameter[self]]: constant[ Get all the available sizes of the current image, and all available data about them. Returns: A list of dicts with the size data. ] variable[method] assign[=] constant[flickr.photos.getSizes] variable[data] assign...
keyword[def] identifier[getSizes] ( identifier[self] ): literal[string] identifier[method] = literal[string] identifier[data] = identifier[_doget] ( identifier[method] , identifier[photo_id] = identifier[self] . identifier[id] ) identifier[ret] =[] ...
def getSizes(self): """ Get all the available sizes of the current image, and all available data about them. Returns: A list of dicts with the size data. """ method = 'flickr.photos.getSizes' data = _doget(method, photo_id=self.id) ret = [] # The given props are those...
def p_action_blocks(p): """ action_blocks : action_blocks action_block """ if isinstance(p[1], list): if isinstance(p[1][0], list): p[0] = p[1][0] + [p[2]] else: p[0] = p[1] + p[2] else: p[0] = [p[1], p[2]]
def function[p_action_blocks, parameter[p]]: constant[ action_blocks : action_blocks action_block ] if call[name[isinstance], parameter[call[name[p]][constant[1]], name[list]]] begin[:] if call[name[isinstance], parameter[call[call[name[p]][constant[1]]][constant[0]], name[list]]...
keyword[def] identifier[p_action_blocks] ( identifier[p] ): literal[string] keyword[if] identifier[isinstance] ( identifier[p] [ literal[int] ], identifier[list] ): keyword[if] identifier[isinstance] ( identifier[p] [ literal[int] ][ literal[int] ], identifier[list] ): identifier[p]...
def p_action_blocks(p): """ action_blocks : action_blocks action_block """ if isinstance(p[1], list): if isinstance(p[1][0], list): p[0] = p[1][0] + [p[2]] # depends on [control=['if'], data=[]] else: p[0] = p[1] + p[2] # depends on [control=['if'], data=[]] ...
def getmlsthelper(referencefilepath, start, organism, update): """Prepares to run the getmlst.py script provided in SRST2""" from accessoryFunctions.accessoryFunctions import GenObject # Initialise a set to for the organism(s) for which new alleles and profiles are desired organismset = set() # Allo...
def function[getmlsthelper, parameter[referencefilepath, start, organism, update]]: constant[Prepares to run the getmlst.py script provided in SRST2] from relative_module[accessoryFunctions.accessoryFunctions] import module[GenObject] variable[organismset] assign[=] call[name[set], parameter[]] ...
keyword[def] identifier[getmlsthelper] ( identifier[referencefilepath] , identifier[start] , identifier[organism] , identifier[update] ): literal[string] keyword[from] identifier[accessoryFunctions] . identifier[accessoryFunctions] keyword[import] identifier[GenObject] identifier[organismset]...
def getmlsthelper(referencefilepath, start, organism, update): """Prepares to run the getmlst.py script provided in SRST2""" from accessoryFunctions.accessoryFunctions import GenObject # Initialise a set to for the organism(s) for which new alleles and profiles are desired organismset = set() # Allo...
def validate_list_of_identical_dicts(self, list_of_dicts): """Check that all dicts within a list are identical.""" hashes = [] for _dict in list_of_dicts: hashes.append(hash(frozenset(_dict.items()))) self.log.debug('Hashes: {}'.format(hashes)) if len(set(hashes)) ==...
def function[validate_list_of_identical_dicts, parameter[self, list_of_dicts]]: constant[Check that all dicts within a list are identical.] variable[hashes] assign[=] list[[]] for taget[name[_dict]] in starred[name[list_of_dicts]] begin[:] call[name[hashes].append, parameter[call...
keyword[def] identifier[validate_list_of_identical_dicts] ( identifier[self] , identifier[list_of_dicts] ): literal[string] identifier[hashes] =[] keyword[for] identifier[_dict] keyword[in] identifier[list_of_dicts] : identifier[hashes] . identifier[append] ( identifier[has...
def validate_list_of_identical_dicts(self, list_of_dicts): """Check that all dicts within a list are identical.""" hashes = [] for _dict in list_of_dicts: hashes.append(hash(frozenset(_dict.items()))) # depends on [control=['for'], data=['_dict']] self.log.debug('Hashes: {}'.format(hashes)) ...
def renew_close_to_expiration(self, margin_in_seconds=A_DAY): """Automatically renew subscriptions that are close to expiring, or have already expired. margin_in_seconds determines if a subscription is in fact close to expiring. By default, said margin is set to be a single day (24 hours...
def function[renew_close_to_expiration, parameter[self, margin_in_seconds]]: constant[Automatically renew subscriptions that are close to expiring, or have already expired. margin_in_seconds determines if a subscription is in fact close to expiring. By default, said margin is set to be a ...
keyword[def] identifier[renew_close_to_expiration] ( identifier[self] , identifier[margin_in_seconds] = identifier[A_DAY] ): literal[string] identifier[subscriptions] = identifier[self] . identifier[storage] . identifier[close_to_expiration] ( identifier[margin_in_seconds] ) keyword[for] ...
def renew_close_to_expiration(self, margin_in_seconds=A_DAY): """Automatically renew subscriptions that are close to expiring, or have already expired. margin_in_seconds determines if a subscription is in fact close to expiring. By default, said margin is set to be a single day (24 hours). ...
def from_(self, pct_pts): """Reverse of :meth:`to_`.""" pct_pts = np.asarray(pct_pts, dtype=np.float) has_z = (pct_pts.shape[-1] > 2) max_pt = list(self.viewer.get_window_size()) if has_z: max_pt.append(0.0) win_pts = np.multiply(pct_pts, max_pt) # ...
def function[from_, parameter[self, pct_pts]]: constant[Reverse of :meth:`to_`.] variable[pct_pts] assign[=] call[name[np].asarray, parameter[name[pct_pts]]] variable[has_z] assign[=] compare[call[name[pct_pts].shape][<ast.UnaryOp object at 0x7da1b0dbd030>] greater[>] constant[2]] variab...
keyword[def] identifier[from_] ( identifier[self] , identifier[pct_pts] ): literal[string] identifier[pct_pts] = identifier[np] . identifier[asarray] ( identifier[pct_pts] , identifier[dtype] = identifier[np] . identifier[float] ) identifier[has_z] =( identifier[pct_pts] . identifier[shape...
def from_(self, pct_pts): """Reverse of :meth:`to_`.""" pct_pts = np.asarray(pct_pts, dtype=np.float) has_z = pct_pts.shape[-1] > 2 max_pt = list(self.viewer.get_window_size()) if has_z: max_pt.append(0.0) # depends on [control=['if'], data=[]] win_pts = np.multiply(pct_pts, max_pt) ...
def add_result(self, key, result): """Add result object to cache with given key. The request is ignored when the cache is already full or the key is None. """ if len(self.cache) > self.max_size: return if key is not None: self.cache[key] = result
def function[add_result, parameter[self, key, result]]: constant[Add result object to cache with given key. The request is ignored when the cache is already full or the key is None. ] if compare[call[name[len], parameter[name[self].cache]] greater[>] name[self].max_size] begin[:]...
keyword[def] identifier[add_result] ( identifier[self] , identifier[key] , identifier[result] ): literal[string] keyword[if] identifier[len] ( identifier[self] . identifier[cache] )> identifier[self] . identifier[max_size] : keyword[return] keyword[if] identifier[key] keyw...
def add_result(self, key, result): """Add result object to cache with given key. The request is ignored when the cache is already full or the key is None. """ if len(self.cache) > self.max_size: return # depends on [control=['if'], data=[]] if key is not None: self.c...
def query_bitmap_info(self): """Information about the screen bitmap. out address of type str out width of type int out height of type int out bits_per_pixel of type int out bytes_per_line of type int out bitmap_format of type :class:`BitmapFormat` "...
def function[query_bitmap_info, parameter[self]]: constant[Information about the screen bitmap. out address of type str out width of type int out height of type int out bits_per_pixel of type int out bytes_per_line of type int out bitmap_format of type :clas...
keyword[def] identifier[query_bitmap_info] ( identifier[self] ): literal[string] ( identifier[address] , identifier[width] , identifier[height] , identifier[bits_per_pixel] , identifier[bytes_per_line] , identifier[bitmap_format] )= identifier[self] . identifier[_call] ( literal[string] ) i...
def query_bitmap_info(self): """Information about the screen bitmap. out address of type str out width of type int out height of type int out bits_per_pixel of type int out bytes_per_line of type int out bitmap_format of type :class:`BitmapFormat` """ ...
def getSubdirectories(d): '''Returns a list of subdirectories in a directory. This function performed three times better for me than "for root, dirs, files in os.walk(d): return dirs" ''' return [f for f in os.listdir(d) if os.path.isdir(os.path.join(d, f)) ]
def function[getSubdirectories, parameter[d]]: constant[Returns a list of subdirectories in a directory. This function performed three times better for me than "for root, dirs, files in os.walk(d): return dirs" ] return[<ast.ListComp object at 0x7da18bc734c0>]
keyword[def] identifier[getSubdirectories] ( identifier[d] ): literal[string] keyword[return] [ identifier[f] keyword[for] identifier[f] keyword[in] identifier[os] . identifier[listdir] ( identifier[d] ) keyword[if] identifier[os] . identifier[path] . identifier[isdir] ( identifier[os] . identifier[path] . ...
def getSubdirectories(d): """Returns a list of subdirectories in a directory. This function performed three times better for me than "for root, dirs, files in os.walk(d): return dirs" """ return [f for f in os.listdir(d) if os.path.isdir(os.path.join(d, f))]
def authenticate_redirect(self, callback_uri=None, cancel_uri=None, extended_permissions=None): """Authenticates/installs this app for the current user.""" self.require_setting("facebook_api_key", "Facebook Connect") callback_uri = callback_uri or self.request.uri ...
def function[authenticate_redirect, parameter[self, callback_uri, cancel_uri, extended_permissions]]: constant[Authenticates/installs this app for the current user.] call[name[self].require_setting, parameter[constant[facebook_api_key], constant[Facebook Connect]]] variable[callback_uri] assign[...
keyword[def] identifier[authenticate_redirect] ( identifier[self] , identifier[callback_uri] = keyword[None] , identifier[cancel_uri] = keyword[None] , identifier[extended_permissions] = keyword[None] ): literal[string] identifier[self] . identifier[require_setting] ( literal[string] , literal[str...
def authenticate_redirect(self, callback_uri=None, cancel_uri=None, extended_permissions=None): """Authenticates/installs this app for the current user.""" self.require_setting('facebook_api_key', 'Facebook Connect') callback_uri = callback_uri or self.request.uri args = {'api_key': self.settings['faceb...
def vagalume(song): """ Returns the lyrics found in vagalume.com.br for the specified mp3 file or an empty string if not found. """ translate = { '@': 'a', URLESCAPE: '', ' ': '-' } artist = song.artist.lower() artist = normalize(artist, translate) artist = re...
def function[vagalume, parameter[song]]: constant[ Returns the lyrics found in vagalume.com.br for the specified mp3 file or an empty string if not found. ] variable[translate] assign[=] dictionary[[<ast.Constant object at 0x7da20c6c7280>, <ast.Name object at 0x7da20c6c5270>, <ast.Constant o...
keyword[def] identifier[vagalume] ( identifier[song] ): literal[string] identifier[translate] ={ literal[string] : literal[string] , identifier[URLESCAPE] : literal[string] , literal[string] : literal[string] } identifier[artist] = identifier[song] . identifier[artist] . identifier...
def vagalume(song): """ Returns the lyrics found in vagalume.com.br for the specified mp3 file or an empty string if not found. """ translate = {'@': 'a', URLESCAPE: '', ' ': '-'} artist = song.artist.lower() artist = normalize(artist, translate) artist = re.sub('\\-{2,}', '-', artist) ...
def add_buffer(self, buf_header, buf_payload): ''' Associate a buffer header and payload with this message. Args: buf_header (``JSON``) : a buffer header buf_payload (``JSON`` or bytes) : a buffer payload Returns: None Raises: MessageErr...
def function[add_buffer, parameter[self, buf_header, buf_payload]]: constant[ Associate a buffer header and payload with this message. Args: buf_header (``JSON``) : a buffer header buf_payload (``JSON`` or bytes) : a buffer payload Returns: None Rai...
keyword[def] identifier[add_buffer] ( identifier[self] , identifier[buf_header] , identifier[buf_payload] ): literal[string] keyword[if] literal[string] keyword[in] identifier[self] . identifier[_header] : identifier[self] . identifier[_header] [ literal[string] ]+= literal[int] ...
def add_buffer(self, buf_header, buf_payload): """ Associate a buffer header and payload with this message. Args: buf_header (``JSON``) : a buffer header buf_payload (``JSON`` or bytes) : a buffer payload Returns: None Raises: MessageError ...
def ok(self): """ Returns True if OK to use, else False """ try: v = int(self._value) chunk = self.mfac.value() if v < self.imin or v > self.imax or (v % chunk != 0): return False else: return True ex...
def function[ok, parameter[self]]: constant[ Returns True if OK to use, else False ] <ast.Try object at 0x7da20c6ab7f0>
keyword[def] identifier[ok] ( identifier[self] ): literal[string] keyword[try] : identifier[v] = identifier[int] ( identifier[self] . identifier[_value] ) identifier[chunk] = identifier[self] . identifier[mfac] . identifier[value] () keyword[if] identifier[v]...
def ok(self): """ Returns True if OK to use, else False """ try: v = int(self._value) chunk = self.mfac.value() if v < self.imin or v > self.imax or v % chunk != 0: return False # depends on [control=['if'], data=[]] else: return True # d...
def _to_args(x): """Convert to args representation""" if not isinstance(x, (list, tuple, np.ndarray)): x = [x] return x
def function[_to_args, parameter[x]]: constant[Convert to args representation] if <ast.UnaryOp object at 0x7da1b0e92a10> begin[:] variable[x] assign[=] list[[<ast.Name object at 0x7da1b0e91150>]] return[name[x]]
keyword[def] identifier[_to_args] ( identifier[x] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[x] ,( identifier[list] , identifier[tuple] , identifier[np] . identifier[ndarray] )): identifier[x] =[ identifier[x] ] keyword[return] identifier[x]
def _to_args(x): """Convert to args representation""" if not isinstance(x, (list, tuple, np.ndarray)): x = [x] # depends on [control=['if'], data=[]] return x
def activities_list(self, since=None, **kwargs): "https://developer.zendesk.com/rest_api/docs/core/activity_stream#list-activities" api_path = "/api/v2/activities.json" api_query = {} if "query" in kwargs.keys(): api_query.update(kwargs["query"]) del kwargs["query...
def function[activities_list, parameter[self, since]]: constant[https://developer.zendesk.com/rest_api/docs/core/activity_stream#list-activities] variable[api_path] assign[=] constant[/api/v2/activities.json] variable[api_query] assign[=] dictionary[[], []] if compare[constant[query] in ...
keyword[def] identifier[activities_list] ( identifier[self] , identifier[since] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[api_path] = literal[string] identifier[api_query] ={} keyword[if] literal[string] keyword[in] identifier[kwargs] . identifier[ke...
def activities_list(self, since=None, **kwargs): """https://developer.zendesk.com/rest_api/docs/core/activity_stream#list-activities""" api_path = '/api/v2/activities.json' api_query = {} if 'query' in kwargs.keys(): api_query.update(kwargs['query']) del kwargs['query'] # depends on [co...
def contains(this, that, axis=semantics.axis_default): """Returns bool for each element of `that`, indicating if it is contained in `this` Parameters ---------- this : indexable key sequence sequence of items to test against that : indexable key sequence sequence of items to test fo...
def function[contains, parameter[this, that, axis]]: constant[Returns bool for each element of `that`, indicating if it is contained in `this` Parameters ---------- this : indexable key sequence sequence of items to test against that : indexable key sequence sequence of items to...
keyword[def] identifier[contains] ( identifier[this] , identifier[that] , identifier[axis] = identifier[semantics] . identifier[axis_default] ): literal[string] identifier[this] = identifier[as_index] ( identifier[this] , identifier[axis] = identifier[axis] , identifier[lex_as_struct] = keyword[True] , ide...
def contains(this, that, axis=semantics.axis_default): """Returns bool for each element of `that`, indicating if it is contained in `this` Parameters ---------- this : indexable key sequence sequence of items to test against that : indexable key sequence sequence of items to test fo...
def show(self, block=None, warn=True): """Display the current figure (if possible). If blocking, this method replicates the behaviour of :func:`matplotlib.pyplot.show()`, otherwise it just calls up to :meth:`~matplotlib.figure.Figure.show`. This method also supports repeatedly ...
def function[show, parameter[self, block, warn]]: constant[Display the current figure (if possible). If blocking, this method replicates the behaviour of :func:`matplotlib.pyplot.show()`, otherwise it just calls up to :meth:`~matplotlib.figure.Figure.show`. This method also sup...
keyword[def] identifier[show] ( identifier[self] , identifier[block] = keyword[None] , identifier[warn] = keyword[True] ): literal[string] keyword[import] identifier[inspect] keyword[try] : identifier[ca...
def show(self, block=None, warn=True): """Display the current figure (if possible). If blocking, this method replicates the behaviour of :func:`matplotlib.pyplot.show()`, otherwise it just calls up to :meth:`~matplotlib.figure.Figure.show`. This method also supports repeatedly show...
def grab_java_message(node_list, curr_testname): """scan through the java output text and extract the java messages related to running test specified in curr_testname. Parameters ---------- :param node_list: list of H2O nodes List of H2o nodes associated with an H2OCloud (cluster) that are pe...
def function[grab_java_message, parameter[node_list, curr_testname]]: constant[scan through the java output text and extract the java messages related to running test specified in curr_testname. Parameters ---------- :param node_list: list of H2O nodes List of H2o nodes associated with an...
keyword[def] identifier[grab_java_message] ( identifier[node_list] , identifier[curr_testname] ): literal[string] keyword[global] identifier[g_java_start_text] identifier[java_messages] = literal[string] identifier[start_test] = keyword[False] keyword[for] identifier[each_node] ...
def grab_java_message(node_list, curr_testname): """scan through the java output text and extract the java messages related to running test specified in curr_testname. Parameters ---------- :param node_list: list of H2O nodes List of H2o nodes associated with an H2OCloud (cluster) that are pe...
def resize(self, image, size): """ Resizes the image :param image: The image object :param size: size is PIL tuple (width, heigth, force) ex: (200,100,True) """ (width, height, force) = size if image.size[0] > width or image.size[1] > height: ...
def function[resize, parameter[self, image, size]]: constant[ Resizes the image :param image: The image object :param size: size is PIL tuple (width, heigth, force) ex: (200,100,True) ] <ast.Tuple object at 0x7da20e955d50> assign[=] name[size] if <ast...
keyword[def] identifier[resize] ( identifier[self] , identifier[image] , identifier[size] ): literal[string] ( identifier[width] , identifier[height] , identifier[force] )= identifier[size] keyword[if] identifier[image] . identifier[size] [ literal[int] ]> identifier[width] keyword[or] ...
def resize(self, image, size): """ Resizes the image :param image: The image object :param size: size is PIL tuple (width, heigth, force) ex: (200,100,True) """ (width, height, force) = size if image.size[0] > width or image.size[1] > height: if force: ...
def limits(self, clip_negative=True): """Return intensity limits, i.e. (min, max) tuple, of the dtype. Args: clip_negative : bool, optional If True, clip the negative range (i.e. return 0 for min intensity) even if the image dtype allows negative values. Ret...
def function[limits, parameter[self, clip_negative]]: constant[Return intensity limits, i.e. (min, max) tuple, of the dtype. Args: clip_negative : bool, optional If True, clip the negative range (i.e. return 0 for min intensity) even if the image dtype allows negati...
keyword[def] identifier[limits] ( identifier[self] , identifier[clip_negative] = keyword[True] ): literal[string] identifier[min] , identifier[max] = identifier[dtype_range] [ identifier[self] . identifier[as_numpy_dtype] ] keyword[if] identifier[clip_negative] : identifier[m...
def limits(self, clip_negative=True): """Return intensity limits, i.e. (min, max) tuple, of the dtype. Args: clip_negative : bool, optional If True, clip the negative range (i.e. return 0 for min intensity) even if the image dtype allows negative values. Returns...
def add_env(self, key, value): """ Add an environemnt variable For Ubuntu, the best place is /etc/environment. Values placed here do not need to be exported. """ boto.log.info('Adding env variable: %s=%s' % (key, value)) if not os.path.exists("/etc/environment.or...
def function[add_env, parameter[self, key, value]]: constant[ Add an environemnt variable For Ubuntu, the best place is /etc/environment. Values placed here do not need to be exported. ] call[name[boto].log.info, parameter[binary_operation[constant[Adding env variable: %...
keyword[def] identifier[add_env] ( identifier[self] , identifier[key] , identifier[value] ): literal[string] identifier[boto] . identifier[log] . identifier[info] ( literal[string] %( identifier[key] , identifier[value] )) keyword[if] keyword[not] identifier[os] . identifier[path] . iden...
def add_env(self, key, value): """ Add an environemnt variable For Ubuntu, the best place is /etc/environment. Values placed here do not need to be exported. """ boto.log.info('Adding env variable: %s=%s' % (key, value)) if not os.path.exists('/etc/environment.orig'): ...
def iterqueue(self, limit=None, infinite=False): """Infinite iterator yielding pending messages, by using synchronous direct access to the queue (``basic_get``). :meth:`iterqueue` is used where synchronous functionality is more important than performance. If you can, use :meth:`itercons...
def function[iterqueue, parameter[self, limit, infinite]]: constant[Infinite iterator yielding pending messages, by using synchronous direct access to the queue (``basic_get``). :meth:`iterqueue` is used where synchronous functionality is more important than performance. If you can, use...
keyword[def] identifier[iterqueue] ( identifier[self] , identifier[limit] = keyword[None] , identifier[infinite] = keyword[False] ): literal[string] keyword[for] identifier[items_since_start] keyword[in] identifier[count] (): identifier[item] = identifier[self] . identifier[fetch] (...
def iterqueue(self, limit=None, infinite=False): """Infinite iterator yielding pending messages, by using synchronous direct access to the queue (``basic_get``). :meth:`iterqueue` is used where synchronous functionality is more important than performance. If you can, use :meth:`iterconsume`...
def raise_302(instance, location): """Abort the current request with a 302 (Found) response code. Sets the Location header correctly. If the location does not start with a slash, the path of the current request is prepended. :param instance: Resource instance (used to access the response) :type ins...
def function[raise_302, parameter[instance, location]]: constant[Abort the current request with a 302 (Found) response code. Sets the Location header correctly. If the location does not start with a slash, the path of the current request is prepended. :param instance: Resource instance (used to acc...
keyword[def] identifier[raise_302] ( identifier[instance] , identifier[location] ): literal[string] identifier[_set_location] ( identifier[instance] , identifier[location] ) identifier[instance] . identifier[response] . identifier[status] = literal[int] keyword[raise] identifier[ResponseExcepti...
def raise_302(instance, location): """Abort the current request with a 302 (Found) response code. Sets the Location header correctly. If the location does not start with a slash, the path of the current request is prepended. :param instance: Resource instance (used to access the response) :type ins...
def determine_file_type(filename): """ :param filename: str :rtype: FileType """ if filename.endswith('.cls'): return FileType.CLS elif filename.endswith('.go'): return FileType.GO elif filename.endswith('.java'): return FileType.JAVA elif filename.endswith('.js'...
def function[determine_file_type, parameter[filename]]: constant[ :param filename: str :rtype: FileType ] if call[name[filename].endswith, parameter[constant[.cls]]] begin[:] return[name[FileType].CLS] return[name[FileType].OTHER]
keyword[def] identifier[determine_file_type] ( identifier[filename] ): literal[string] keyword[if] identifier[filename] . identifier[endswith] ( literal[string] ): keyword[return] identifier[FileType] . identifier[CLS] keyword[elif] identifier[filename] . identifier[endswith] ( literal[st...
def determine_file_type(filename): """ :param filename: str :rtype: FileType """ if filename.endswith('.cls'): return FileType.CLS # depends on [control=['if'], data=[]] elif filename.endswith('.go'): return FileType.GO # depends on [control=['if'], data=[]] elif filename....
def complete_opt_format(self, text, *_): """ Autocomplete for format option """ return [t + " " for t in FORMATTERS if t.startswith(text)]
def function[complete_opt_format, parameter[self, text]]: constant[ Autocomplete for format option ] return[<ast.ListComp object at 0x7da1b0ccba30>]
keyword[def] identifier[complete_opt_format] ( identifier[self] , identifier[text] ,* identifier[_] ): literal[string] keyword[return] [ identifier[t] + literal[string] keyword[for] identifier[t] keyword[in] identifier[FORMATTERS] keyword[if] identifier[t] . identifier[startswith] ( identifie...
def complete_opt_format(self, text, *_): """ Autocomplete for format option """ return [t + ' ' for t in FORMATTERS if t.startswith(text)]
def getCorner(index,top,left,expand=0,y=206): ''' Return part of the XML string that defines the requested corner''' x = str(-(expand+old_div(ARENA_WIDTH,2))) if left else str(expand+old_div(ARENA_WIDTH,2)) z = str(-(expand+old_div(ARENA_BREADTH,2))) if top else str(expand+old_div(ARENA_BREADTH,2)) retu...
def function[getCorner, parameter[index, top, left, expand, y]]: constant[ Return part of the XML string that defines the requested corner] variable[x] assign[=] <ast.IfExp object at 0x7da1b1b13940> variable[z] assign[=] <ast.IfExp object at 0x7da1b1a436d0> return[binary_operation[binary_ope...
keyword[def] identifier[getCorner] ( identifier[index] , identifier[top] , identifier[left] , identifier[expand] = literal[int] , identifier[y] = literal[int] ): literal[string] identifier[x] = identifier[str] (-( identifier[expand] + identifier[old_div] ( identifier[ARENA_WIDTH] , literal[int] ))) keyword...
def getCorner(index, top, left, expand=0, y=206): """ Return part of the XML string that defines the requested corner""" x = str(-(expand + old_div(ARENA_WIDTH, 2))) if left else str(expand + old_div(ARENA_WIDTH, 2)) z = str(-(expand + old_div(ARENA_BREADTH, 2))) if top else str(expand + old_div(ARENA_BREAD...
def remove_positive_resample(X, y, model_generator, method_name, num_fcounts=11): """ Remove Positive (resample) xlabel = "Max fraction of features removed" ylabel = "Negative mean model output" transform = "negate" sort_order = 13 """ return __run_measure(measures.remove_resample, X, y, mod...
def function[remove_positive_resample, parameter[X, y, model_generator, method_name, num_fcounts]]: constant[ Remove Positive (resample) xlabel = "Max fraction of features removed" ylabel = "Negative mean model output" transform = "negate" sort_order = 13 ] return[call[name[__run_measure...
keyword[def] identifier[remove_positive_resample] ( identifier[X] , identifier[y] , identifier[model_generator] , identifier[method_name] , identifier[num_fcounts] = literal[int] ): literal[string] keyword[return] identifier[__run_measure] ( identifier[measures] . identifier[remove_resample] , identifier[...
def remove_positive_resample(X, y, model_generator, method_name, num_fcounts=11): """ Remove Positive (resample) xlabel = "Max fraction of features removed" ylabel = "Negative mean model output" transform = "negate" sort_order = 13 """ return __run_measure(measures.remove_resample, X, y, mod...
def get_node_type(dgtree): """Returns the type of the root node of a DGParentedTree.""" if is_leaf(dgtree): return TreeNodeTypes.leaf_node root_label = dgtree.label() if root_label == '': assert dgtree == DGParentedTree('', []), \ "The tree has no root label, but isn't empty...
def function[get_node_type, parameter[dgtree]]: constant[Returns the type of the root node of a DGParentedTree.] if call[name[is_leaf], parameter[name[dgtree]]] begin[:] return[name[TreeNodeTypes].leaf_node] variable[root_label] assign[=] call[name[dgtree].label, parameter[]] if ...
keyword[def] identifier[get_node_type] ( identifier[dgtree] ): literal[string] keyword[if] identifier[is_leaf] ( identifier[dgtree] ): keyword[return] identifier[TreeNodeTypes] . identifier[leaf_node] identifier[root_label] = identifier[dgtree] . identifier[label] () keyword[if] ide...
def get_node_type(dgtree): """Returns the type of the root node of a DGParentedTree.""" if is_leaf(dgtree): return TreeNodeTypes.leaf_node # depends on [control=['if'], data=[]] root_label = dgtree.label() if root_label == '': assert dgtree == DGParentedTree('', []), "The tree has no ro...
def _chunks(iterable, n): """ Splits an iterable into chunks of size n. """ iterable = iter(iterable) while True: # store one line in memory, # chain it to an iterator on the rest of the chunk yield chain([next(iterable)], islice(iterable, n-1))
def function[_chunks, parameter[iterable, n]]: constant[ Splits an iterable into chunks of size n. ] variable[iterable] assign[=] call[name[iter], parameter[name[iterable]]] while constant[True] begin[:] <ast.Yield object at 0x7da204623e50>
keyword[def] identifier[_chunks] ( identifier[iterable] , identifier[n] ): literal[string] identifier[iterable] = identifier[iter] ( identifier[iterable] ) keyword[while] keyword[True] : keyword[yield] identifier[chain] ([ identifier[next] ( identifier[iterable] )], identifier[isl...
def _chunks(iterable, n): """ Splits an iterable into chunks of size n. """ iterable = iter(iterable) while True: # store one line in memory, # chain it to an iterator on the rest of the chunk yield chain([next(iterable)], islice(iterable, n - 1)) # depends on [control=['whi...
def trigger_show_by_trigger_name(self, trigger_name, **kwargs): "https://developer.zendesk.com/rest_api/docs/chat/triggers#get-a-trigger" api_path = "/api/v2/triggers/{trigger_name}" api_path = api_path.format(trigger_name=trigger_name) return self.call(api_path, **kwargs)
def function[trigger_show_by_trigger_name, parameter[self, trigger_name]]: constant[https://developer.zendesk.com/rest_api/docs/chat/triggers#get-a-trigger] variable[api_path] assign[=] constant[/api/v2/triggers/{trigger_name}] variable[api_path] assign[=] call[name[api_path].format, parameter[]...
keyword[def] identifier[trigger_show_by_trigger_name] ( identifier[self] , identifier[trigger_name] ,** identifier[kwargs] ): literal[string] identifier[api_path] = literal[string] identifier[api_path] = identifier[api_path] . identifier[format] ( identifier[trigger_name] = identifier[tri...
def trigger_show_by_trigger_name(self, trigger_name, **kwargs): """https://developer.zendesk.com/rest_api/docs/chat/triggers#get-a-trigger""" api_path = '/api/v2/triggers/{trigger_name}' api_path = api_path.format(trigger_name=trigger_name) return self.call(api_path, **kwargs)
def compile(pattern, flags=0, sep=None, split_prefix=False): ''' Converts a glob-matching pattern (using Apache Cocoon style rules) to a regular expression, which basically means that the following characters have special meanings: * ``?``: matches any single character excluding the separator character ...
def function[compile, parameter[pattern, flags, sep, split_prefix]]: constant[ Converts a glob-matching pattern (using Apache Cocoon style rules) to a regular expression, which basically means that the following characters have special meanings: * ``?``: matches any single character excluding the s...
keyword[def] identifier[compile] ( identifier[pattern] , identifier[flags] = literal[int] , identifier[sep] = keyword[None] , identifier[split_prefix] = keyword[False] ): literal[string] identifier[prefix] = keyword[None] identifier[expr] = literal[string] keyword[if] identifier[sep] keyword[is] k...
def compile(pattern, flags=0, sep=None, split_prefix=False): """ Converts a glob-matching pattern (using Apache Cocoon style rules) to a regular expression, which basically means that the following characters have special meanings: * ``?``: matches any single character excluding the separator character...
def search_users(self): """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-search :allowed_param:'q', 'count', 'page' """ return bind_api( api=self, path='/users/search.json', pa...
def function[search_users, parameter[self]]: constant[ :reference: https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-search :allowed_param:'q', 'count', 'page' ] return[call[name[bind_api], parameter[]]]
keyword[def] identifier[search_users] ( identifier[self] ): literal[string] keyword[return] identifier[bind_api] ( identifier[api] = identifier[self] , identifier[path] = literal[string] , identifier[payload_type] = literal[string] , identifier[payload_list] = keyword[Tr...
def search_users(self): """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-search :allowed_param:'q', 'count', 'page' """ return bind_api(api=self, path='/users/search.json', payload_type='user', payload_list=True, require...
def get_tunnel_info_output_tunnel_oper_state(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") get_tunnel_info = ET.Element("get_tunnel_info") config = get_tunnel_info output = ET.SubElement(get_tunnel_info, "output") tunnel = ET.SubElement...
def function[get_tunnel_info_output_tunnel_oper_state, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[get_tunnel_info] assign[=] call[name[ET].Element, parameter[constant[get_tunnel_info]]] ...
keyword[def] identifier[get_tunnel_info_output_tunnel_oper_state] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[get_tunnel_info] = identifier[ET] . identifier[Element] ( literal[string] ...
def get_tunnel_info_output_tunnel_oper_state(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') get_tunnel_info = ET.Element('get_tunnel_info') config = get_tunnel_info output = ET.SubElement(get_tunnel_info, 'output') tunnel = ET.SubElement(output, 'tunnel') o...
def get_accessibility(self, plugin_override=True): """ Return the AccessibleTime object associated with the accessibility of this course """ vals = self._hook_manager.call_hook('course_accessibility', course=self, default=self._accessible) return vals[0] if len(vals) and plugin_override else sel...
def function[get_accessibility, parameter[self, plugin_override]]: constant[ Return the AccessibleTime object associated with the accessibility of this course ] variable[vals] assign[=] call[name[self]._hook_manager.call_hook, parameter[constant[course_accessibility]]] return[<ast.IfExp object at 0x...
keyword[def] identifier[get_accessibility] ( identifier[self] , identifier[plugin_override] = keyword[True] ): literal[string] identifier[vals] = identifier[self] . identifier[_hook_manager] . identifier[call_hook] ( literal[string] , identifier[course] = identifier[self] , identifier[default] = id...
def get_accessibility(self, plugin_override=True): """ Return the AccessibleTime object associated with the accessibility of this course """ vals = self._hook_manager.call_hook('course_accessibility', course=self, default=self._accessible) return vals[0] if len(vals) and plugin_override else self._accessibl...
def _get_tables(self, base_dir): """Load the contents of meta_file and the corresponding data. If fields containing Personally Identifiable Information are detected in the metadata they are anonymized before asign them into `table_dict`. Args: base_dir(str): Root folder of ...
def function[_get_tables, parameter[self, base_dir]]: constant[Load the contents of meta_file and the corresponding data. If fields containing Personally Identifiable Information are detected in the metadata they are anonymized before asign them into `table_dict`. Args: bas...
keyword[def] identifier[_get_tables] ( identifier[self] , identifier[base_dir] ): literal[string] identifier[table_dict] ={} keyword[for] identifier[table] keyword[in] identifier[self] . identifier[metadata] [ literal[string] ]: keyword[if] identifier[table] [ literal[str...
def _get_tables(self, base_dir): """Load the contents of meta_file and the corresponding data. If fields containing Personally Identifiable Information are detected in the metadata they are anonymized before asign them into `table_dict`. Args: base_dir(str): Root folder of the ...
def quaternion_inverse(quaternion): """Return inverse of quaternion. >>> q0 = random_quaternion() >>> q1 = quaternion_inverse(q0) >>> np.allclose(quaternion_multiply(q0, q1), [1, 0, 0, 0]) True """ q = np.array(quaternion, dtype=np.float64, copy=True) np.negative(q[1:], q[1:]) retu...
def function[quaternion_inverse, parameter[quaternion]]: constant[Return inverse of quaternion. >>> q0 = random_quaternion() >>> q1 = quaternion_inverse(q0) >>> np.allclose(quaternion_multiply(q0, q1), [1, 0, 0, 0]) True ] variable[q] assign[=] call[name[np].array, parameter[name[q...
keyword[def] identifier[quaternion_inverse] ( identifier[quaternion] ): literal[string] identifier[q] = identifier[np] . identifier[array] ( identifier[quaternion] , identifier[dtype] = identifier[np] . identifier[float64] , identifier[copy] = keyword[True] ) identifier[np] . identifier[negative] ( id...
def quaternion_inverse(quaternion): """Return inverse of quaternion. >>> q0 = random_quaternion() >>> q1 = quaternion_inverse(q0) >>> np.allclose(quaternion_multiply(q0, q1), [1, 0, 0, 0]) True """ q = np.array(quaternion, dtype=np.float64, copy=True) np.negative(q[1:], q[1:]) retu...
def load_patt(filename): """Loads a file that was saved with the save_patt routine.""" with open(filename) as f: lines = f.readlines() lst = lines[0].split(',') patt = np.zeros([int(lst[0]), int(lst[1])], dtype=np.complex128) lines.pop(0) for...
def function[load_patt, parameter[filename]]: constant[Loads a file that was saved with the save_patt routine.] with call[name[open], parameter[name[filename]]] begin[:] variable[lines] assign[=] call[name[f].readlines, parameter[]] variable[lst] assign[=] call[call[name[...
keyword[def] identifier[load_patt] ( identifier[filename] ): literal[string] keyword[with] identifier[open] ( identifier[filename] ) keyword[as] identifier[f] : identifier[lines] = identifier[f] . identifier[readlines] () identifier[lst] = identifier[lines] [ literal[int] ]. identifie...
def load_patt(filename): """Loads a file that was saved with the save_patt routine.""" with open(filename) as f: lines = f.readlines() lst = lines[0].split(',') patt = np.zeros([int(lst[0]), int(lst[1])], dtype=np.complex128) lines.pop(0) for line in lines: ls...
def get_occurrences(self, start, end, *, limit=None, query=None, order_by=None, batch=None): """ Returns all the occurrences of a seriesMaster event for a specified time range. :type start: datetime :param start: the start of the time range :type end: datetime :param end:...
def function[get_occurrences, parameter[self, start, end]]: constant[ Returns all the occurrences of a seriesMaster event for a specified time range. :type start: datetime :param start: the start of the time range :type end: datetime :param end: the end of the time range ...
keyword[def] identifier[get_occurrences] ( identifier[self] , identifier[start] , identifier[end] ,*, identifier[limit] = keyword[None] , identifier[query] = keyword[None] , identifier[order_by] = keyword[None] , identifier[batch] = keyword[None] ): literal[string] keyword[if] identifier[self] . i...
def get_occurrences(self, start, end, *, limit=None, query=None, order_by=None, batch=None): """ Returns all the occurrences of a seriesMaster event for a specified time range. :type start: datetime :param start: the start of the time range :type end: datetime :param end: the...
def tt(self, key, locale=None, locale2=None, default=I18n.DFT): """ |tt| means text transform. key: tt key. locale: main locale key into |self.tt_dd|. Default to |self.locale| locale2: fallback locale key into |self.tt_dd|. Default to |self.locale2| default: a de...
def function[tt, parameter[self, key, locale, locale2, default]]: constant[ |tt| means text transform. key: tt key. locale: main locale key into |self.tt_dd|. Default to |self.locale| locale2: fallback locale key into |self.tt_dd|. Default to |self.locale2| defau...
keyword[def] identifier[tt] ( identifier[self] , identifier[key] , identifier[locale] = keyword[None] , identifier[locale2] = keyword[None] , identifier[default] = identifier[I18n] . identifier[DFT] ): literal[string] identifier[locale] = identifier[locale] keyword[or] identifier[self] ...
def tt(self, key, locale=None, locale2=None, default=I18n.DFT): """ |tt| means text transform. key: tt key. locale: main locale key into |self.tt_dd|. Default to |self.locale| locale2: fallback locale key into |self.tt_dd|. Default to |self.locale2| default: a defaul...
def read_next_line(self): """Read another line from the file.""" next_line = self.file.readline() if not next_line or next_line[-1:] != '\n': # no newline on last line of file self.file = None else: # trim newline characters next_line = n...
def function[read_next_line, parameter[self]]: constant[Read another line from the file.] variable[next_line] assign[=] call[name[self].file.readline, parameter[]] if <ast.BoolOp object at 0x7da18f09fac0> begin[:] name[self].file assign[=] constant[None] variable[expanded...
keyword[def] identifier[read_next_line] ( identifier[self] ): literal[string] identifier[next_line] = identifier[self] . identifier[file] . identifier[readline] () keyword[if] keyword[not] identifier[next_line] keyword[or] identifier[next_line] [- literal[int] :]!= literal[string] : ...
def read_next_line(self): """Read another line from the file.""" next_line = self.file.readline() if not next_line or next_line[-1:] != '\n': # no newline on last line of file self.file = None # depends on [control=['if'], data=[]] else: # trim newline characters next_li...
def difference(self, other): """ Compute the difference between this and a given range. >>> intrange(1, 10).difference(intrange(10, 15)) intrange([1,10)) >>> intrange(1, 10).difference(intrange(5, 10)) intrange([1,5)) >>> intrange(1, 5).differ...
def function[difference, parameter[self, other]]: constant[ Compute the difference between this and a given range. >>> intrange(1, 10).difference(intrange(10, 15)) intrange([1,10)) >>> intrange(1, 10).difference(intrange(5, 10)) intrange([1,5)) ...
keyword[def] identifier[difference] ( identifier[self] , identifier[other] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[is_valid_range] ( identifier[other] ): identifier[msg] = literal[string] keyword[raise] identifier[TypeError] ( identif...
def difference(self, other): """ Compute the difference between this and a given range. >>> intrange(1, 10).difference(intrange(10, 15)) intrange([1,10)) >>> intrange(1, 10).difference(intrange(5, 10)) intrange([1,5)) >>> intrange(1, 5).difference...
def reply(self, status=200, new_response=False, **kw): """ Defines the mock response. Arguments: status (int, optional): response status code. Defaults to ``200``. **kw (dict): optional keyword arguments passed to ``pook.Response`` constructor. R...
def function[reply, parameter[self, status, new_response]]: constant[ Defines the mock response. Arguments: status (int, optional): response status code. Defaults to ``200``. **kw (dict): optional keyword arguments passed to ``pook.Response`` constructor....
keyword[def] identifier[reply] ( identifier[self] , identifier[status] = literal[int] , identifier[new_response] = keyword[False] ,** identifier[kw] ): literal[string] identifier[res] = identifier[Response] (** identifier[kw] ) keyword[if] identifier[new_response] keyword[else] identifi...
def reply(self, status=200, new_response=False, **kw): """ Defines the mock response. Arguments: status (int, optional): response status code. Defaults to ``200``. **kw (dict): optional keyword arguments passed to ``pook.Response`` constructor. Retur...
def is_resource_protected(self, request, **kwargs): """ Determines if a resource should be protected. Returns true if and only if the resource's access_state matches an entry in the return value of get_protected_states(). """ access_state = self._get_resource_access_stat...
def function[is_resource_protected, parameter[self, request]]: constant[ Determines if a resource should be protected. Returns true if and only if the resource's access_state matches an entry in the return value of get_protected_states(). ] variable[access_state] assign[...
keyword[def] identifier[is_resource_protected] ( identifier[self] , identifier[request] ,** identifier[kwargs] ): literal[string] identifier[access_state] = identifier[self] . identifier[_get_resource_access_state] ( identifier[request] ) identifier[protected_states] = identifier[self] . i...
def is_resource_protected(self, request, **kwargs): """ Determines if a resource should be protected. Returns true if and only if the resource's access_state matches an entry in the return value of get_protected_states(). """ access_state = self._get_resource_access_state(reques...
def set_image(self, image, filename=None, resize=False): """ Set the poster or thumbnail of a this Vidoe. """ if self.id: data = self.connection.post('add_image', filename, video_id=self.id, image=image.to_dict(), resize=resize) if data: ...
def function[set_image, parameter[self, image, filename, resize]]: constant[ Set the poster or thumbnail of a this Vidoe. ] if name[self].id begin[:] variable[data] assign[=] call[name[self].connection.post, parameter[constant[add_image], name[filename]]] ...
keyword[def] identifier[set_image] ( identifier[self] , identifier[image] , identifier[filename] = keyword[None] , identifier[resize] = keyword[False] ): literal[string] keyword[if] identifier[self] . identifier[id] : identifier[data] = identifier[self] . identifier[connection] . iden...
def set_image(self, image, filename=None, resize=False): """ Set the poster or thumbnail of a this Vidoe. """ if self.id: data = self.connection.post('add_image', filename, video_id=self.id, image=image.to_dict(), resize=resize) if data: self.image = Image(data=data) ...
def iter(self, columnnames, order='', sort=True): """Return a tableiter object. :class:`tableiter` lets one iterate over a table by returning in each iteration step a reference table containing equal values for the given columns. By default a sort is done on the given columns to...
def function[iter, parameter[self, columnnames, order, sort]]: constant[Return a tableiter object. :class:`tableiter` lets one iterate over a table by returning in each iteration step a reference table containing equal values for the given columns. By default a sort is done on t...
keyword[def] identifier[iter] ( identifier[self] , identifier[columnnames] , identifier[order] = literal[string] , identifier[sort] = keyword[True] ): literal[string] keyword[from] . identifier[tableiter] keyword[import] identifier[tableiter] keyword[return] identifier[tableiter] ( ide...
def iter(self, columnnames, order='', sort=True): """Return a tableiter object. :class:`tableiter` lets one iterate over a table by returning in each iteration step a reference table containing equal values for the given columns. By default a sort is done on the given columns to get...