code
stringlengths
75
104k
docstring
stringlengths
1
46.9k
text
stringlengths
164
112k
def credit_notes(request, form): ''' Shows all of the credit notes in the system. ''' notes = commerce.CreditNote.objects.all().select_related( "creditnoterefund", "creditnoteapplication", "invoice", "invoice__user__attendee__attendeeprofilebase", ) return QuerysetRepor...
Shows all of the credit notes in the system.
Below is the the instruction that describes the task: ### Input: Shows all of the credit notes in the system. ### Response: def credit_notes(request, form): ''' Shows all of the credit notes in the system. ''' notes = commerce.CreditNote.objects.all().select_related( "creditnoterefund", "c...
def main(argv=None): """Generates documentation for signature generation pipeline""" parser = argparse.ArgumentParser(description=DESCRIPTION) parser.add_argument( 'pipeline', help='Python dotted path to rules pipeline to document' ) parser.add_argument('output', help='output file') ...
Generates documentation for signature generation pipeline
Below is the the instruction that describes the task: ### Input: Generates documentation for signature generation pipeline ### Response: def main(argv=None): """Generates documentation for signature generation pipeline""" parser = argparse.ArgumentParser(description=DESCRIPTION) parser.add_argument( ...
def get_rlz(self, rlzstr): r""" Get a Realization instance for a string of the form 'rlz-\d+' """ mo = re.match(r'rlz-(\d+)', rlzstr) if not mo: return return self.realizations[int(mo.group(1))]
r""" Get a Realization instance for a string of the form 'rlz-\d+'
Below is the the instruction that describes the task: ### Input: r""" Get a Realization instance for a string of the form 'rlz-\d+' ### Response: def get_rlz(self, rlzstr): r""" Get a Realization instance for a string of the form 'rlz-\d+' """ mo = re.match(r'rlz-(\d+)', rlz...
def which(program, win_allow_cross_arch=True): """Identify the location of an executable file.""" def is_exe(path): return os.path.isfile(path) and os.access(path, os.X_OK) def _get_path_list(): return os.environ['PATH'].split(os.pathsep) if os.name == 'nt': def find_exe(progra...
Identify the location of an executable file.
Below is the the instruction that describes the task: ### Input: Identify the location of an executable file. ### Response: def which(program, win_allow_cross_arch=True): """Identify the location of an executable file.""" def is_exe(path): return os.path.isfile(path) and os.access(path, os.X_OK) ...
def create_data_and_metadata_from_data(self, data: numpy.ndarray, intensity_calibration: Calibration.Calibration=None, dimensional_calibrations: typing.List[Calibration.Calibration]=None, metadata: dict=None, timestamp: str=None) -> DataAndMetadata.DataAndMetadata: """Create a data_and_metadata object from data...
Create a data_and_metadata object from data. .. versionadded:: 1.0 .. deprecated:: 1.1 Use :py:meth:`~nion.swift.Facade.DataItem.create_data_and_metadata` instead. Scriptable: No
Below is the the instruction that describes the task: ### Input: Create a data_and_metadata object from data. .. versionadded:: 1.0 .. deprecated:: 1.1 Use :py:meth:`~nion.swift.Facade.DataItem.create_data_and_metadata` instead. Scriptable: No ### Response: def create_data_and_...
def _ensure_file_path(self): """ Ensure the storage path exists. If it doesn't, create it with "go-rwx" permissions. """ storage_root = os.path.dirname(self.file_path) needs_storage_root = storage_root and not os.path.isdir(storage_root) if needs_storage_root: # ...
Ensure the storage path exists. If it doesn't, create it with "go-rwx" permissions.
Below is the the instruction that describes the task: ### Input: Ensure the storage path exists. If it doesn't, create it with "go-rwx" permissions. ### Response: def _ensure_file_path(self): """ Ensure the storage path exists. If it doesn't, create it with "go-rwx" permissions. ...
def parents(self): """ Returns a list of all the current category's parents.""" parents = [] if self.parent is None: return [] category = self while category.parent is not None: parents.append(category.parent) category = category.parent ...
Returns a list of all the current category's parents.
Below is the the instruction that describes the task: ### Input: Returns a list of all the current category's parents. ### Response: def parents(self): """ Returns a list of all the current category's parents.""" parents = [] if self.parent is None: return [] category ...
def set_power_state(self, is_on, bulb=ALL_BULBS, timeout=None): """ Sets the power state of one or more bulbs. """ with _blocking(self.lock, self.power_state, self.light_state_event, timeout): self.send(REQ_SET_POWER_STATE, bulb, '...
Sets the power state of one or more bulbs.
Below is the the instruction that describes the task: ### Input: Sets the power state of one or more bulbs. ### Response: def set_power_state(self, is_on, bulb=ALL_BULBS, timeout=None): """ Sets the power state of one or more bulbs. """ with _blocking(self.lock, self.power_state, se...
def _fold_line(self, line): """Write string line as one or more folded lines.""" if len(line) <= self._cols: self._output_file.write(line) self._output_file.write(self._line_sep) else: pos = self._cols self._output_file.write(line[0:self._cols]) ...
Write string line as one or more folded lines.
Below is the the instruction that describes the task: ### Input: Write string line as one or more folded lines. ### Response: def _fold_line(self, line): """Write string line as one or more folded lines.""" if len(line) <= self._cols: self._output_file.write(line) self._outp...
def profit_construct(self): """利润构成 Returns: dict -- 利润构成表 """ return { 'total_buyandsell': round( self.profit_money - self.total_commission - self.total_tax, 2 ), 'total_tax': self....
利润构成 Returns: dict -- 利润构成表
Below is the the instruction that describes the task: ### Input: 利润构成 Returns: dict -- 利润构成表 ### Response: def profit_construct(self): """利润构成 Returns: dict -- 利润构成表 """ return { 'total_buyandsell': round( se...
def resume(self): """Resume tracing after a `pause`.""" for tracer in self.tracers: tracer.start() threading.settrace(self._installation_trace)
Resume tracing after a `pause`.
Below is the the instruction that describes the task: ### Input: Resume tracing after a `pause`. ### Response: def resume(self): """Resume tracing after a `pause`.""" for tracer in self.tracers: tracer.start() threading.settrace(self._installation_trace)
def systemSettings(self): """ Returns the settings associated with this application for all users. :return <projexui.xsettings.XSettings> """ if not self._systemSettings: if self.isCompiled(): settings = QtCore.QSettings(XSettings....
Returns the settings associated with this application for all users. :return <projexui.xsettings.XSettings>
Below is the the instruction that describes the task: ### Input: Returns the settings associated with this application for all users. :return <projexui.xsettings.XSettings> ### Response: def systemSettings(self): """ Returns the settings associated with this application for...
def _weight_by_hue(self): """ Returns a list of (hue, ranges, total weight, normalized total weight)-tuples. ColorTheme is made up out of (color, range, weight) tuples. For consistency with XML-output in the old Prism format (i.e. <color>s made up of <shade>s) we need a group ...
Returns a list of (hue, ranges, total weight, normalized total weight)-tuples. ColorTheme is made up out of (color, range, weight) tuples. For consistency with XML-output in the old Prism format (i.e. <color>s made up of <shade>s) we need a group weight per different hue. The s...
Below is the the instruction that describes the task: ### Input: Returns a list of (hue, ranges, total weight, normalized total weight)-tuples. ColorTheme is made up out of (color, range, weight) tuples. For consistency with XML-output in the old Prism format (i.e. <color>s made up of <shad...
def TIF_to_jpg(fnameTiff, overwrite=False, saveAs=""): """ given a TIF taken by our cameras, make it a pretty labeled JPG. if the filename contains "f10" or "f20", add appropraite scale bars. automatic contrast adjustment is different depending on if its a DIC image or fluorescent image (which is ...
given a TIF taken by our cameras, make it a pretty labeled JPG. if the filename contains "f10" or "f20", add appropraite scale bars. automatic contrast adjustment is different depending on if its a DIC image or fluorescent image (which is detected automatically).
Below is the the instruction that describes the task: ### Input: given a TIF taken by our cameras, make it a pretty labeled JPG. if the filename contains "f10" or "f20", add appropraite scale bars. automatic contrast adjustment is different depending on if its a DIC image or fluorescent image (which i...
def getNameByPosition(self, idx): """Return field name by its position in fields set. Parameters ---------- idx: :py:class:`idx` Field index Returns ------- : :py:class:`str` Field name Raises ------ : :class:`~py...
Return field name by its position in fields set. Parameters ---------- idx: :py:class:`idx` Field index Returns ------- : :py:class:`str` Field name Raises ------ : :class:`~pyasn1.error.PyAsn1Error` If given ...
Below is the the instruction that describes the task: ### Input: Return field name by its position in fields set. Parameters ---------- idx: :py:class:`idx` Field index Returns ------- : :py:class:`str` Field name Raises ----...
def _messageFromSender(self, sender, messageID): """ Locate a previously queued message by a given sender and messageID. """ return self.store.findUnique( _QueuedMessage, AND(_QueuedMessage.senderUsername == sender.localpart, _QueuedMessage.senderD...
Locate a previously queued message by a given sender and messageID.
Below is the the instruction that describes the task: ### Input: Locate a previously queued message by a given sender and messageID. ### Response: def _messageFromSender(self, sender, messageID): """ Locate a previously queued message by a given sender and messageID. """ return self...
def connect(self, host, port): """Connect to a host on a given port. If the hostname ends with a colon (`:') followed by a number, and there is no port specified, that suffix will be stripped off and the number interpreted as the port number to use. """ if not port and (h...
Connect to a host on a given port. If the hostname ends with a colon (`:') followed by a number, and there is no port specified, that suffix will be stripped off and the number interpreted as the port number to use.
Below is the the instruction that describes the task: ### Input: Connect to a host on a given port. If the hostname ends with a colon (`:') followed by a number, and there is no port specified, that suffix will be stripped off and the number interpreted as the port number to use. ### Respons...
def _detect(self): """ Detect un-indexed ERC20 event parameters in all contracts. """ results = [] for c in self.contracts: unindexed_params = self.detect_erc20_unindexed_event_params(c) if unindexed_params: info = "{} ({}) does not mark im...
Detect un-indexed ERC20 event parameters in all contracts.
Below is the the instruction that describes the task: ### Input: Detect un-indexed ERC20 event parameters in all contracts. ### Response: def _detect(self): """ Detect un-indexed ERC20 event parameters in all contracts. """ results = [] for c in self.contracts: u...
def reverse_point(self, latitude, longitude, **kwargs): """ Method for identifying an address from a geographic point """ fields = ",".join(kwargs.pop("fields", [])) point_param = "{0},{1}".format(latitude, longitude) response = self._req( verb="reverse", para...
Method for identifying an address from a geographic point
Below is the the instruction that describes the task: ### Input: Method for identifying an address from a geographic point ### Response: def reverse_point(self, latitude, longitude, **kwargs): """ Method for identifying an address from a geographic point """ fields = ",".join(kwargs...
def move(self, partition, source, dest): """Return a new state that is the result of moving a single partition. :param partition: The partition index of the partition to move. :param source: The broker index of the broker to move the partition from. :param dest: The broker i...
Return a new state that is the result of moving a single partition. :param partition: The partition index of the partition to move. :param source: The broker index of the broker to move the partition from. :param dest: The broker index of the broker to move the partition to.
Below is the the instruction that describes the task: ### Input: Return a new state that is the result of moving a single partition. :param partition: The partition index of the partition to move. :param source: The broker index of the broker to move the partition from. :param d...
def change_status(self, status): """ Change the user's status :param user: :param email: :return: """ def cb(): self.user.update(status=status) return status return signals.user_update(self, ACTIONS["STATUS"], cb, ...
Change the user's status :param user: :param email: :return:
Below is the the instruction that describes the task: ### Input: Change the user's status :param user: :param email: :return: ### Response: def change_status(self, status): """ Change the user's status :param user: :param email: :return: """ ...
def setMaxSpeedLat(self, typeID, speed): """setMaxSpeedLat(string, double) -> None Sets the maximum lateral speed of this type. """ self._connection._sendDoubleCmd( tc.CMD_SET_VEHICLETYPE_VARIABLE, tc.VAR_MAXSPEED_LAT, typeID, speed)
setMaxSpeedLat(string, double) -> None Sets the maximum lateral speed of this type.
Below is the the instruction that describes the task: ### Input: setMaxSpeedLat(string, double) -> None Sets the maximum lateral speed of this type. ### Response: def setMaxSpeedLat(self, typeID, speed): """setMaxSpeedLat(string, double) -> None Sets the maximum lateral speed of this type...
def cast_primitive(state, value, to_type): """ Cast the value of primtive types. :param value: Bitvector storing the primitive value. :param to_type: Name of the targeted type. :return: Resized value. """ if to_type in ['float', 'double']: ...
Cast the value of primtive types. :param value: Bitvector storing the primitive value. :param to_type: Name of the targeted type. :return: Resized value.
Below is the the instruction that describes the task: ### Input: Cast the value of primtive types. :param value: Bitvector storing the primitive value. :param to_type: Name of the targeted type. :return: Resized value. ### Response: def cast_primitive(state, value, to_...
def get_services(self): """Returns a list of FritzService-objects.""" result = [] nodes = self.root.iterfind( './/ns:service', namespaces={'ns': self.namespace}) for node in nodes: result.append(FritzService( node.find(self.nodename('serviceType'))...
Returns a list of FritzService-objects.
Below is the the instruction that describes the task: ### Input: Returns a list of FritzService-objects. ### Response: def get_services(self): """Returns a list of FritzService-objects.""" result = [] nodes = self.root.iterfind( './/ns:service', namespaces={'ns': self.namespace}...
def log_metrics(self, metrics_by_name, info): """Store new measurements into metrics.json. """ try: metrics_path = os.path.join(self.dir, "metrics.json") with open(metrics_path, 'r') as f: saved_metrics = json.load(f) except IOError: # ...
Store new measurements into metrics.json.
Below is the the instruction that describes the task: ### Input: Store new measurements into metrics.json. ### Response: def log_metrics(self, metrics_by_name, info): """Store new measurements into metrics.json. """ try: metrics_path = os.path.join(self.dir, "metrics.json") ...
def RegisterRecordType(cls, record_class): """Register a known record type in KNOWN_CLASSES. Args: record_class (UpdateRecord): An update record subclass. """ record_type = record_class.MatchType() if record_type not in UpdateRecord.KNOWN_CLASSES: Update...
Register a known record type in KNOWN_CLASSES. Args: record_class (UpdateRecord): An update record subclass.
Below is the the instruction that describes the task: ### Input: Register a known record type in KNOWN_CLASSES. Args: record_class (UpdateRecord): An update record subclass. ### Response: def RegisterRecordType(cls, record_class): """Register a known record type in KNOWN_CLASSES. ...
def edges(self): """ Return the edge characters of this node. """ edge_str = ctypes.create_string_buffer(MAX_CHARS) cgaddag.gdg_edges(self.gdg, self.node, edge_str) return [char for char in edge_str.value.decode("ascii")]
Return the edge characters of this node.
Below is the the instruction that describes the task: ### Input: Return the edge characters of this node. ### Response: def edges(self): """ Return the edge characters of this node. """ edge_str = ctypes.create_string_buffer(MAX_CHARS) cgaddag.gdg_edges(self.gdg, self.node,...
def docstring_to_markdown(docstring): """Convert a Python object's docstring to markdown Parameters ---------- docstring : str The docstring body. Returns ---------- clean_lst : list The markdown formatted docstring as lines (str) in a Python list. """ new_docstrin...
Convert a Python object's docstring to markdown Parameters ---------- docstring : str The docstring body. Returns ---------- clean_lst : list The markdown formatted docstring as lines (str) in a Python list.
Below is the the instruction that describes the task: ### Input: Convert a Python object's docstring to markdown Parameters ---------- docstring : str The docstring body. Returns ---------- clean_lst : list The markdown formatted docstring as lines (str) in a Python list. #...
def search( self, base=False, trim=False, objects=False, **kwargs ): """ Returns matching entries for search in ldap structured as [(dn, {attributes})] UNLESS searching by dn, in which case the first match is returned """ scope = pyldap.SCOPE_SUBTREE i...
Returns matching entries for search in ldap structured as [(dn, {attributes})] UNLESS searching by dn, in which case the first match is returned
Below is the the instruction that describes the task: ### Input: Returns matching entries for search in ldap structured as [(dn, {attributes})] UNLESS searching by dn, in which case the first match is returned ### Response: def search( self, base=False, trim=False, objects=False...
def _loadData(self, data): """ Load attribute values from Plex XML response. """ self._data = data self.fastKey = data.attrib.get('fastKey') self.key = data.attrib.get('key') self.thumb = data.attrib.get('thumb') self.title = data.attrib.get('title') self.type = d...
Load attribute values from Plex XML response.
Below is the the instruction that describes the task: ### Input: Load attribute values from Plex XML response. ### Response: def _loadData(self, data): """ Load attribute values from Plex XML response. """ self._data = data self.fastKey = data.attrib.get('fastKey') self.key = data.a...
def transcribe_word(self, word): ''' The heart of the transcription process. Similar to the system in in cltk.phonology.utils, the algorithm: 1) Applies digraphs and diphthongs to the text of the word. 2) Carries out a naive ("greedy", per @clemsciences) substitution of letters to phonemes, according ...
The heart of the transcription process. Similar to the system in in cltk.phonology.utils, the algorithm: 1) Applies digraphs and diphthongs to the text of the word. 2) Carries out a naive ("greedy", per @clemsciences) substitution of letters to phonemes, according to the alphabet. 3) Applies the conditio...
Below is the the instruction that describes the task: ### Input: The heart of the transcription process. Similar to the system in in cltk.phonology.utils, the algorithm: 1) Applies digraphs and diphthongs to the text of the word. 2) Carries out a naive ("greedy", per @clemsciences) substitution of letters ...
def csv_dump(request, uid): """ Returns a CSV dump of all of the specified metric's counts and cumulative counts. """ metric = Metric.objects.get(uid=uid) frequency = request.GET.get('frequency', settings.STATISTIC_FREQUENCY_DAILY) response = HttpResponse(mimetype='text/csv') response[...
Returns a CSV dump of all of the specified metric's counts and cumulative counts.
Below is the the instruction that describes the task: ### Input: Returns a CSV dump of all of the specified metric's counts and cumulative counts. ### Response: def csv_dump(request, uid): """ Returns a CSV dump of all of the specified metric's counts and cumulative counts. """ metric = Me...
def deserialize_iso(attr): """Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. :rtype: Datetime :raises: DeserializationError if string format invalid. """ if isinstance(attr, ET.Element): attr =...
Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. :rtype: Datetime :raises: DeserializationError if string format invalid.
Below is the the instruction that describes the task: ### Input: Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. :rtype: Datetime :raises: DeserializationError if string format invalid. ### Response: def deserialize_iso(attr)...
def get_search_result(self, ddoc_id, index_name, **query_params): """ Retrieves the raw JSON content from the remote database based on the search index on the server, using the query_params provided as query parameters. A ``query`` parameter containing the Lucene query syntax is ...
Retrieves the raw JSON content from the remote database based on the search index on the server, using the query_params provided as query parameters. A ``query`` parameter containing the Lucene query syntax is mandatory. Example for search queries: .. code-block:: python ...
Below is the the instruction that describes the task: ### Input: Retrieves the raw JSON content from the remote database based on the search index on the server, using the query_params provided as query parameters. A ``query`` parameter containing the Lucene query syntax is mandatory. ...
def _select_date_range(self, lines): """Identify lines containing headers within the range begin_date to end_date. Parameters ----- lines: list list of lines from the IGRA2 data file. """ headers = [] num_lev = [] dates = [] # Get in...
Identify lines containing headers within the range begin_date to end_date. Parameters ----- lines: list list of lines from the IGRA2 data file.
Below is the the instruction that describes the task: ### Input: Identify lines containing headers within the range begin_date to end_date. Parameters ----- lines: list list of lines from the IGRA2 data file. ### Response: def _select_date_range(self, lines): """Identif...
def JsonResponseModel(self): """In this context, return raw JSON instead of proto.""" old_model = self.response_type_model self.__response_type_model = 'json' yield self.__response_type_model = old_model
In this context, return raw JSON instead of proto.
Below is the the instruction that describes the task: ### Input: In this context, return raw JSON instead of proto. ### Response: def JsonResponseModel(self): """In this context, return raw JSON instead of proto.""" old_model = self.response_type_model self.__response_type_model = 'json' ...
def initialize(self, request, response): """Initialize. 1. call webapp init. 2. check request is indeed from taskqueue. 3. check the task has not been retried too many times. 4. run handler specific processing logic. 5. run error handling logic if precessing failed. Args: request: a ...
Initialize. 1. call webapp init. 2. check request is indeed from taskqueue. 3. check the task has not been retried too many times. 4. run handler specific processing logic. 5. run error handling logic if precessing failed. Args: request: a webapp.Request instance. response: a webap...
Below is the the instruction that describes the task: ### Input: Initialize. 1. call webapp init. 2. check request is indeed from taskqueue. 3. check the task has not been retried too many times. 4. run handler specific processing logic. 5. run error handling logic if precessing failed. Ar...
def _treat_star_format(self,arg_format_list,args): """ Deal with "*" format if specified. """ num_stars = len([a for a in arg_format_list if a == "*"]) if num_stars > 0: # Make sure the repeated format argument only occurs once, is last, # and that there...
Deal with "*" format if specified.
Below is the the instruction that describes the task: ### Input: Deal with "*" format if specified. ### Response: def _treat_star_format(self,arg_format_list,args): """ Deal with "*" format if specified. """ num_stars = len([a for a in arg_format_list if a == "*"]) if num_s...
def gradient(self): r"""Gradient of the KL functional. The gradient of `KullbackLeibler` with ``prior`` :math:`g` is given as .. math:: \nabla F(x) = 1 - \frac{g}{x}. The gradient is not defined in points where one or more components are non-positive. ...
r"""Gradient of the KL functional. The gradient of `KullbackLeibler` with ``prior`` :math:`g` is given as .. math:: \nabla F(x) = 1 - \frac{g}{x}. The gradient is not defined in points where one or more components are non-positive.
Below is the the instruction that describes the task: ### Input: r"""Gradient of the KL functional. The gradient of `KullbackLeibler` with ``prior`` :math:`g` is given as .. math:: \nabla F(x) = 1 - \frac{g}{x}. The gradient is not defined in points where one or more c...
def createFieldDescription(self): """ Provides a field description dict for swarm description. :return: (dict) """ return { "fieldName": self.getName(), "fieldType": self._dataType, "minValue": self._min, "maxValue": self._max }
Provides a field description dict for swarm description. :return: (dict)
Below is the the instruction that describes the task: ### Input: Provides a field description dict for swarm description. :return: (dict) ### Response: def createFieldDescription(self): """ Provides a field description dict for swarm description. :return: (dict) """ return { "fieldNam...
def start_push_sync(self): """ Starts the detection of unsynced Git data. """ self.active_thread = True self.active_push = True self.thread_push_instance = Thread(target=self.thread_push) self.thread_push_instance.daemon = True self.thread_push_instance.s...
Starts the detection of unsynced Git data.
Below is the the instruction that describes the task: ### Input: Starts the detection of unsynced Git data. ### Response: def start_push_sync(self): """ Starts the detection of unsynced Git data. """ self.active_thread = True self.active_push = True self.thread_push...
def path(self, which=None): """Extend ``nailgun.entity_mixins.Entity.path``. The format of the returned path depends on the value of ``which``: available_repositories /repository_sets/<id>/available_repositories enable /repository_sets/<id>/enable disabl...
Extend ``nailgun.entity_mixins.Entity.path``. The format of the returned path depends on the value of ``which``: available_repositories /repository_sets/<id>/available_repositories enable /repository_sets/<id>/enable disable /repository_sets/<id>/dis...
Below is the the instruction that describes the task: ### Input: Extend ``nailgun.entity_mixins.Entity.path``. The format of the returned path depends on the value of ``which``: available_repositories /repository_sets/<id>/available_repositories enable /repository_s...
def cov(self, ddof=None, bias=0): '''The covariance matrix from the aggregate sample. It accepts an optional parameter for the degree of freedoms. :parameter ddof: If not ``None`` normalization is by (N - ddof), where N is the number of observations; this overrides the value im...
The covariance matrix from the aggregate sample. It accepts an optional parameter for the degree of freedoms. :parameter ddof: If not ``None`` normalization is by (N - ddof), where N is the number of observations; this overrides the value implied by bias. The default value ...
Below is the the instruction that describes the task: ### Input: The covariance matrix from the aggregate sample. It accepts an optional parameter for the degree of freedoms. :parameter ddof: If not ``None`` normalization is by (N - ddof), where N is the number of observations; this...
def setOverlayTransformTrackedDeviceComponent(self, ulOverlayHandle, unDeviceIndex, pchComponentName): """ Sets the transform to draw the overlay on a rendermodel component mesh instead of a quad. This will only draw when the system is drawing the device. Overlays with this transform type cannot...
Sets the transform to draw the overlay on a rendermodel component mesh instead of a quad. This will only draw when the system is drawing the device. Overlays with this transform type cannot receive mouse events.
Below is the the instruction that describes the task: ### Input: Sets the transform to draw the overlay on a rendermodel component mesh instead of a quad. This will only draw when the system is drawing the device. Overlays with this transform type cannot receive mouse events. ### Response: def setOverlayTr...
def new_from_bundle_config(self, config): """ Create a new bundle, or link to an existing one, based on the identity in config data. :param config: A Dict form of a bundle.yaml file :return: """ identity = Identity.from_dict(config['identity']) ds = self._db.dat...
Create a new bundle, or link to an existing one, based on the identity in config data. :param config: A Dict form of a bundle.yaml file :return:
Below is the the instruction that describes the task: ### Input: Create a new bundle, or link to an existing one, based on the identity in config data. :param config: A Dict form of a bundle.yaml file :return: ### Response: def new_from_bundle_config(self, config): """ Create a new...
def enable_category_lists_editor(self, request, editor_init_kwargs=None, additional_parents_aliases=None, lists_init_kwargs=None, handler_init_kwargs=None): """Enables editor functionality for categories of this object. :param Request request: Django request object ...
Enables editor functionality for categories of this object. :param Request request: Django request object :param dict editor_init_kwargs: Keyword args to initialize category lists editor with. See CategoryList.enable_editor() :param list additional_parents_aliases: Aliases of catego...
Below is the the instruction that describes the task: ### Input: Enables editor functionality for categories of this object. :param Request request: Django request object :param dict editor_init_kwargs: Keyword args to initialize category lists editor with. See CategoryList.enable_edito...
def has_port_by_ref(self, port_ref): '''Check if this component has a port by the given reference to a CORBA PortService object. ''' with self._mutex: if self.get_port_by_ref(self, port_ref): return True return False
Check if this component has a port by the given reference to a CORBA PortService object.
Below is the the instruction that describes the task: ### Input: Check if this component has a port by the given reference to a CORBA PortService object. ### Response: def has_port_by_ref(self, port_ref): '''Check if this component has a port by the given reference to a CORBA PortService ob...
def cublasDtpsv(handle, uplo, trans, diag, n, AP, x, incx): """ Solve real triangular-packed system with one right-hand side. """ status = _libcublas.cublasDtpsv_v2(handle, _CUBLAS_FILL_MODE[uplo], _CUBLAS_OP[trans], ...
Solve real triangular-packed system with one right-hand side.
Below is the the instruction that describes the task: ### Input: Solve real triangular-packed system with one right-hand side. ### Response: def cublasDtpsv(handle, uplo, trans, diag, n, AP, x, incx): """ Solve real triangular-packed system with one right-hand side. """ status = _libcublas.cublas...
def create_ctm_miohandler(fileobj, title=None, comment=None, register_prefixes=True, register_templates=True, detect_prefixes=False): """\ """ handler = CTMHandler(fileobj) handler.title = title handler.comment = comment handler.detect_prefixes = detect_prefixes if register_prefixes: ...
\
Below is the the instruction that describes the task: ### Input: \ ### Response: def create_ctm_miohandler(fileobj, title=None, comment=None, register_prefixes=True, register_templates=True, detect_prefixes=False): """\ """ handler = CTMHandler(fileobj) handler.title = title handler.comment = ...
def describe_field(field_definition): """Build descriptor for Field instance. Args: field_definition: Field instance to provide descriptor for. Returns: Initialized FieldDescriptor instance describing the Field instance. """ field_descriptor = FieldDescriptor() field_descriptor.nam...
Build descriptor for Field instance. Args: field_definition: Field instance to provide descriptor for. Returns: Initialized FieldDescriptor instance describing the Field instance.
Below is the the instruction that describes the task: ### Input: Build descriptor for Field instance. Args: field_definition: Field instance to provide descriptor for. Returns: Initialized FieldDescriptor instance describing the Field instance. ### Response: def describe_field(field_definitio...
def _interpret_contents(contentstream, initial_shorthand=UNIT_SQUARE): """Interpret the PDF content stream. The stack represents the state of the PDF graphics stack. We are only interested in the current transformation matrix (CTM) so we only track this object; a full implementation would need to trac...
Interpret the PDF content stream. The stack represents the state of the PDF graphics stack. We are only interested in the current transformation matrix (CTM) so we only track this object; a full implementation would need to track many other items. The CTM is initialized to the mapping from user space...
Below is the the instruction that describes the task: ### Input: Interpret the PDF content stream. The stack represents the state of the PDF graphics stack. We are only interested in the current transformation matrix (CTM) so we only track this object; a full implementation would need to track many ot...
def gate(self, gate, apply_now=True): ''' Apply given gate and return new gated sample (with assigned data). Parameters ---------- gate : {_gate_available_classes} Returns ------- FCMeasurement Sample with data that passes gates ''' ...
Apply given gate and return new gated sample (with assigned data). Parameters ---------- gate : {_gate_available_classes} Returns ------- FCMeasurement Sample with data that passes gates
Below is the the instruction that describes the task: ### Input: Apply given gate and return new gated sample (with assigned data). Parameters ---------- gate : {_gate_available_classes} Returns ------- FCMeasurement Sample with data that passes gates #...
def set_settings(instance=None): """Pick correct settings instance and set it to a global variable.""" global settings settings = None if instance: settings = import_settings(instance) elif "INSTANCE_FOR_DYNACONF" in os.environ: settings = import_settings(os.environ["INSTANCE_FOR...
Pick correct settings instance and set it to a global variable.
Below is the the instruction that describes the task: ### Input: Pick correct settings instance and set it to a global variable. ### Response: def set_settings(instance=None): """Pick correct settings instance and set it to a global variable.""" global settings settings = None if instance: ...
def remove_network(self, net_id): """ Remove a network. Similar to the ``docker network rm`` command. Args: net_id (str): The network's id """ url = self._url("/networks/{0}", net_id) res = self._delete(url) self._raise_for_status(res)
Remove a network. Similar to the ``docker network rm`` command. Args: net_id (str): The network's id
Below is the the instruction that describes the task: ### Input: Remove a network. Similar to the ``docker network rm`` command. Args: net_id (str): The network's id ### Response: def remove_network(self, net_id): """ Remove a network. Similar to the ``docker network rm`` comma...
def _has_only_files(local_folder): """ Return whether a folder contains only files. This will be False if the folder contains any subdirectories. :param local_folder: full path to the local folder :type local_folder: string :returns: True if the folder contains only files :rtype: bool "...
Return whether a folder contains only files. This will be False if the folder contains any subdirectories. :param local_folder: full path to the local folder :type local_folder: string :returns: True if the folder contains only files :rtype: bool
Below is the the instruction that describes the task: ### Input: Return whether a folder contains only files. This will be False if the folder contains any subdirectories. :param local_folder: full path to the local folder :type local_folder: string :returns: True if the folder contains only files ...
def _run(name, cmd, exec_driver=None, output=None, stdin=None, python_shell=True, output_loglevel='debug', ignore_retcode=False, use_vt=False, keep_env=None): ''' Common logic for docker.run functions ''' if exec_driver is ...
Common logic for docker.run functions
Below is the the instruction that describes the task: ### Input: Common logic for docker.run functions ### Response: def _run(name, cmd, exec_driver=None, output=None, stdin=None, python_shell=True, output_loglevel='debug', ignore_retcode=False, ...
def addPygletListener(self,event_type,handler): """ Registers an event handler. The specified callable handler will be called every time an event with the same ``event_type`` is encountered. All event arguments are passed as positional arguments. This m...
Registers an event handler. The specified callable handler will be called every time an event with the same ``event_type`` is encountered. All event arguments are passed as positional arguments. This method should be used to listen for pyglet events. For new co...
Below is the the instruction that describes the task: ### Input: Registers an event handler. The specified callable handler will be called every time an event with the same ``event_type`` is encountered. All event arguments are passed as positional arguments. This ...
def add_settings_parser(subparsers, parent_parser): """Creates the args parser needed for the settings command and its subcommands. """ # The following parser is for the settings subsection of commands. These # commands display information about the currently applied on-chain # settings. s...
Creates the args parser needed for the settings command and its subcommands.
Below is the the instruction that describes the task: ### Input: Creates the args parser needed for the settings command and its subcommands. ### Response: def add_settings_parser(subparsers, parent_parser): """Creates the args parser needed for the settings command and its subcommands. """ # T...
def formatter(self, api_client, data, newval): """Get audio-related fields Try to find fields for the audio url for specified preferred quality level, or next-lowest available quality url otherwise. """ url_map = data.get("audioUrlMap") audio_url = data.get("audioUrl") ...
Get audio-related fields Try to find fields for the audio url for specified preferred quality level, or next-lowest available quality url otherwise.
Below is the the instruction that describes the task: ### Input: Get audio-related fields Try to find fields for the audio url for specified preferred quality level, or next-lowest available quality url otherwise. ### Response: def formatter(self, api_client, data, newval): """Get audio-re...
def window_handles(self): """ Returns the handles of all windows within the current session. :Usage: :: driver.window_handles """ if self.w3c: return self.execute(Command.W3C_GET_WINDOW_HANDLES)['value'] else: return s...
Returns the handles of all windows within the current session. :Usage: :: driver.window_handles
Below is the the instruction that describes the task: ### Input: Returns the handles of all windows within the current session. :Usage: :: driver.window_handles ### Response: def window_handles(self): """ Returns the handles of all windows within the current se...
def ParseMessage(self, parser_mediator, key, date_time, tokens): """Produces an event from a syslog body that matched one of the grammars. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. key (str): name of the ...
Produces an event from a syslog body that matched one of the grammars. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. key (str): name of the matching grammar. date_time (dfdatetime.DateTimeValues): date and ...
Below is the the instruction that describes the task: ### Input: Produces an event from a syslog body that matched one of the grammars. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. key (str): name of the mat...
def get_children(self, tree_alias, item): """Returns item's children. :param str|unicode tree_alias: :param TreeItemBase|None item: :rtype: list """ if not self.current_app_is_admin(): # We do not need i18n for a tree rendered in Admin dropdown. t...
Returns item's children. :param str|unicode tree_alias: :param TreeItemBase|None item: :rtype: list
Below is the the instruction that describes the task: ### Input: Returns item's children. :param str|unicode tree_alias: :param TreeItemBase|None item: :rtype: list ### Response: def get_children(self, tree_alias, item): """Returns item's children. :param str|unicode tree_...
def determine_coords(list_of_variable_dicts): # type: (List[Dict]) -> Tuple[Set, Set] """Given a list of dicts with xarray object values, identify coordinates. Parameters ---------- list_of_variable_dicts : list of dict or Dataset objects Of the same form as the arguments to expand_variable...
Given a list of dicts with xarray object values, identify coordinates. Parameters ---------- list_of_variable_dicts : list of dict or Dataset objects Of the same form as the arguments to expand_variable_dicts. Returns ------- coord_names : set of variable names noncoord_names : set...
Below is the the instruction that describes the task: ### Input: Given a list of dicts with xarray object values, identify coordinates. Parameters ---------- list_of_variable_dicts : list of dict or Dataset objects Of the same form as the arguments to expand_variable_dicts. Returns ---...
def data_find_all(data, path, dyn_cls=False): """Find and return all element-as-tuples in tuple ``data`` using simplified XPath ``path``. """ path_parts = path.split("/") try: sub_elms = tuple( el for el in data if isinstance(el, (tuple, list)) and el[0] =...
Find and return all element-as-tuples in tuple ``data`` using simplified XPath ``path``.
Below is the the instruction that describes the task: ### Input: Find and return all element-as-tuples in tuple ``data`` using simplified XPath ``path``. ### Response: def data_find_all(data, path, dyn_cls=False): """Find and return all element-as-tuples in tuple ``data`` using simplified XPath ``path`...
def register_hooked(self, hooks, # type: Union[Type[Hook], Sequence[Type[Hook]]] func, # type: Hooked args_gen=None # type: Optional[ArgsGen] ): # type: (Type[Hook], Callable, Optional[Callable]) -> None "...
Register func to be run when any of the hooks are run by parent Args: hooks: A Hook class or list of Hook classes of interest func: The callable that should be run on that Hook args_gen: Optionally specify the argument names that should be passed to func. If ...
Below is the the instruction that describes the task: ### Input: Register func to be run when any of the hooks are run by parent Args: hooks: A Hook class or list of Hook classes of interest func: The callable that should be run on that Hook args_gen: Optionally specify ...
def getProcessDatabase(self): """Returns number of processes discriminated by database name. @return: Dictionary mapping database name to number of processes. """ info_dict = {} cur = self._conn.cursor() cur.execute("""SHOW FULL PROCESSLIST;""") ...
Returns number of processes discriminated by database name. @return: Dictionary mapping database name to number of processes.
Below is the the instruction that describes the task: ### Input: Returns number of processes discriminated by database name. @return: Dictionary mapping database name to number of processes. ### Response: def getProcessDatabase(self): """Returns number of processes discriminated by databas...
def _match_objects_against_atlas_footprint( self, orbfitEph, ra, dec): """*match the orbfit generated object positions against atlas exposure footprint* **Key Arguments:** - ``orbfitEph`` -- the orbfit ephemerides - ``ra`` -- the A...
*match the orbfit generated object positions against atlas exposure footprint* **Key Arguments:** - ``orbfitEph`` -- the orbfit ephemerides - ``ra`` -- the ATLAS exposure RA (degrees) - ``dec`` -- the ATLAS exposure DEC (degrees) **Return:** - ``matchedE...
Below is the the instruction that describes the task: ### Input: *match the orbfit generated object positions against atlas exposure footprint* **Key Arguments:** - ``orbfitEph`` -- the orbfit ephemerides - ``ra`` -- the ATLAS exposure RA (degrees) - ``dec`` -- the ATLAS...
def create(vm_): ''' To create a single VM in the VMware environment. Sample profile and arguments that can be specified in it can be found :ref:`here. <vmware-cloud-profile>` CLI Example: .. code-block:: bash salt-cloud -p vmware-centos6.5 vmname ''' try: # Check for...
To create a single VM in the VMware environment. Sample profile and arguments that can be specified in it can be found :ref:`here. <vmware-cloud-profile>` CLI Example: .. code-block:: bash salt-cloud -p vmware-centos6.5 vmname
Below is the the instruction that describes the task: ### Input: To create a single VM in the VMware environment. Sample profile and arguments that can be specified in it can be found :ref:`here. <vmware-cloud-profile>` CLI Example: .. code-block:: bash salt-cloud -p vmware-centos6.5 vmn...
def _validate_config(): ''' Validate azurefs config, return False if it doesn't validate ''' if not isinstance(__opts__['azurefs'], list): log.error('azurefs configuration is not formed as a list, skipping azurefs') return False for container in __opts__['azurefs']: if not is...
Validate azurefs config, return False if it doesn't validate
Below is the the instruction that describes the task: ### Input: Validate azurefs config, return False if it doesn't validate ### Response: def _validate_config(): ''' Validate azurefs config, return False if it doesn't validate ''' if not isinstance(__opts__['azurefs'], list): log.error('a...
def user_agent_info(sdk_version, custom_user_agent): # type: (str, str) -> str """Return the user agent info along with the SDK and Python Version information. :param sdk_version: Version of the SDK being used. :type sdk_version: str :param custom_user_agent: Custom User Agent string provided b...
Return the user agent info along with the SDK and Python Version information. :param sdk_version: Version of the SDK being used. :type sdk_version: str :param custom_user_agent: Custom User Agent string provided by the developer. :type custom_user_agent: str :return: User Agent Info str...
Below is the the instruction that describes the task: ### Input: Return the user agent info along with the SDK and Python Version information. :param sdk_version: Version of the SDK being used. :type sdk_version: str :param custom_user_agent: Custom User Agent string provided by the develop...
def t_LITERAL(self, t): r'(\"([^\\\n]|(\\.))*?\")|\'([^\\\n]|(\\.))*?\'' s = t.value[1:-1] maps = { 't': '\t', 'r': '\r', 'n': '\n', '\\': '\\', '\'': '\'', '"': '\"' } i = 0 length = len(s) v...
r'(\"([^\\\n]|(\\.))*?\")|\'([^\\\n]|(\\.))*?\
Below is the the instruction that describes the task: ### Input: r'(\"([^\\\n]|(\\.))*?\")|\'([^\\\n]|(\\.))*?\ ### Response: def t_LITERAL(self, t): r'(\"([^\\\n]|(\\.))*?\")|\'([^\\\n]|(\\.))*?\'' s = t.value[1:-1] maps = { 't': '\t', 'r': '\r', 'n': '\...
def medial_axis(self, resolution=None, clip=None): """ Find the approximate medial axis based on a voronoi diagram of evenly spaced points on the boundary of the polygon. Parameters ---------- resolution : None or float Distance between each sample on t...
Find the approximate medial axis based on a voronoi diagram of evenly spaced points on the boundary of the polygon. Parameters ---------- resolution : None or float Distance between each sample on the polygon boundary clip : None, or (2,) float Min, m...
Below is the the instruction that describes the task: ### Input: Find the approximate medial axis based on a voronoi diagram of evenly spaced points on the boundary of the polygon. Parameters ---------- resolution : None or float Distance between each sample on the...
def mixedToUnder(s): # pragma: no cover """ Sample: >>> mixedToUnder("FooBarBaz") 'foo_bar_baz' Special case for ID: >>> mixedToUnder("FooBarID") 'foo_bar_id' """ if s.endswith('ID'): return mixedToUnder(s[:-2] + "_id") trans = _mixedToUnderRE.sub(mixedT...
Sample: >>> mixedToUnder("FooBarBaz") 'foo_bar_baz' Special case for ID: >>> mixedToUnder("FooBarID") 'foo_bar_id'
Below is the the instruction that describes the task: ### Input: Sample: >>> mixedToUnder("FooBarBaz") 'foo_bar_baz' Special case for ID: >>> mixedToUnder("FooBarID") 'foo_bar_id' ### Response: def mixedToUnder(s): # pragma: no cover """ Sample: >>> mixedToUnde...
def get_val(dataset, timestamp=None): """ Turn the string value of a dataset into an appropriate value, be it a decimal value, array or time series. If a timestamp is passed to this function, return the values appropriate to the requested times. If the timestamp is *before*...
Turn the string value of a dataset into an appropriate value, be it a decimal value, array or time series. If a timestamp is passed to this function, return the values appropriate to the requested times. If the timestamp is *before* the start of the timeseries data, return None ...
Below is the the instruction that describes the task: ### Input: Turn the string value of a dataset into an appropriate value, be it a decimal value, array or time series. If a timestamp is passed to this function, return the values appropriate to the requested times. If the timest...
def event(self, interface_id, address, value_key, value): """If a device emits some sort event, we will handle it here.""" LOG.debug("RPCFunctions.event: interface_id = %s, address = %s, value_key = %s, value = %s" % ( interface_id, address, value_key.upper(), str(value))) self.devic...
If a device emits some sort event, we will handle it here.
Below is the the instruction that describes the task: ### Input: If a device emits some sort event, we will handle it here. ### Response: def event(self, interface_id, address, value_key, value): """If a device emits some sort event, we will handle it here.""" LOG.debug("RPCFunctions.event: interfa...
def txn_useNonce(self, server_url, timestamp, salt): """Return whether this nonce is present, and if it is, then remove it from the set. str -> bool""" if abs(timestamp - time.time()) > nonce.SKEW: return False try: self.db_add_nonce(server_url, timestam...
Return whether this nonce is present, and if it is, then remove it from the set. str -> bool
Below is the the instruction that describes the task: ### Input: Return whether this nonce is present, and if it is, then remove it from the set. str -> bool ### Response: def txn_useNonce(self, server_url, timestamp, salt): """Return whether this nonce is present, and if it is, then ...
def arg_string_from_dict(arg_dict, **kwds): """ This function takes a series of ditionaries and creates an argument string for a graphql query """ # the filters dictionary filters = { **arg_dict, **kwds, } # return the correctly formed string return ", ".join(...
This function takes a series of ditionaries and creates an argument string for a graphql query
Below is the the instruction that describes the task: ### Input: This function takes a series of ditionaries and creates an argument string for a graphql query ### Response: def arg_string_from_dict(arg_dict, **kwds): """ This function takes a series of ditionaries and creates an argument ...
def cmd(self, command, args, prefix=None): """ Sends a command to the server. :param command: IRC code to send. :type command: unicode :param args: arguments to pass with the command. :type args: basestring :param prefix: optional prefix to prepend to the command...
Sends a command to the server. :param command: IRC code to send. :type command: unicode :param args: arguments to pass with the command. :type args: basestring :param prefix: optional prefix to prepend to the command. :type prefix: str or None
Below is the the instruction that describes the task: ### Input: Sends a command to the server. :param command: IRC code to send. :type command: unicode :param args: arguments to pass with the command. :type args: basestring :param prefix: optional prefix to prepend to the c...
def array_metadata_to_n5(array_metadata): '''Convert array metadata from zarr to N5 format.''' for f, t in zarr_to_n5_keys: array_metadata[t] = array_metadata[f] del array_metadata[f] del array_metadata['zarr_format'] try: dtype = np.dtype(array_metadata['dataType']) except...
Convert array metadata from zarr to N5 format.
Below is the the instruction that describes the task: ### Input: Convert array metadata from zarr to N5 format. ### Response: def array_metadata_to_n5(array_metadata): '''Convert array metadata from zarr to N5 format.''' for f, t in zarr_to_n5_keys: array_metadata[t] = array_metadata[f] de...
def sbd_to_steem(self, sbd=0, price=0, account=None): ''' Uses the ticker to get the lowest ask and moves the sbd at that price. ''' if not account: account = self.mainaccount if self.check_balances(account): if sbd == 0: sbd = self.sbdbal ...
Uses the ticker to get the lowest ask and moves the sbd at that price.
Below is the the instruction that describes the task: ### Input: Uses the ticker to get the lowest ask and moves the sbd at that price. ### Response: def sbd_to_steem(self, sbd=0, price=0, account=None): ''' Uses the ticker to get the lowest ask and moves the sbd at that price. ''' ...
def load_params(self, filename, ctx=None, allow_missing=False, ignore_extra=False): """[Deprecated] Please use load_parameters. Load parameters from file. filename : str Path to parameter file. ctx : Context or list of Context, default cpu() ...
[Deprecated] Please use load_parameters. Load parameters from file. filename : str Path to parameter file. ctx : Context or list of Context, default cpu() Context(s) to initialize loaded parameters on. allow_missing : bool, default False Whether to s...
Below is the the instruction that describes the task: ### Input: [Deprecated] Please use load_parameters. Load parameters from file. filename : str Path to parameter file. ctx : Context or list of Context, default cpu() Context(s) to initialize loaded parameters on....
def create_from_response_pdu(resp_pdu, req_pdu): """ Create instance from response PDU. Response PDU is required together with the number of registers read. :param resp_pdu: Byte array with request PDU. :param quantity: Number of coils read. :return: Instance of :class:`ReadCoi...
Create instance from response PDU. Response PDU is required together with the number of registers read. :param resp_pdu: Byte array with request PDU. :param quantity: Number of coils read. :return: Instance of :class:`ReadCoils`.
Below is the the instruction that describes the task: ### Input: Create instance from response PDU. Response PDU is required together with the number of registers read. :param resp_pdu: Byte array with request PDU. :param quantity: Number of coils read. :return: Instance of :class:...
def replace_payment_transaction_by_id(cls, payment_transaction_id, payment_transaction, **kwargs): """Replace PaymentTransaction Replace all attributes of PaymentTransaction This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=...
Replace PaymentTransaction Replace all attributes of PaymentTransaction This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.replace_payment_transaction_by_id(payment_transaction_id, payment_transaction, a...
Below is the the instruction that describes the task: ### Input: Replace PaymentTransaction Replace all attributes of PaymentTransaction This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.replace_pay...
def timeline(ctx, pager, limit, twtfile, sorting, timeout, porcelain, source, cache, force_update): """Retrieve your personal timeline.""" if source: source_obj = ctx.obj["conf"].get_source_by_nick(source) if not source_obj: logger.debug("Not following {0}, trying as URL".format(sour...
Retrieve your personal timeline.
Below is the the instruction that describes the task: ### Input: Retrieve your personal timeline. ### Response: def timeline(ctx, pager, limit, twtfile, sorting, timeout, porcelain, source, cache, force_update): """Retrieve your personal timeline.""" if source: source_obj = ctx.obj["conf"].get_sour...
def request(self, method, url, bearer_auth=True, **req_kwargs): ''' A loose wrapper around Requests' :class:`~requests.sessions.Session` which injects OAuth 2.0 parameters. :param method: A string representation of the HTTP method to be used. :type method: str :param url...
A loose wrapper around Requests' :class:`~requests.sessions.Session` which injects OAuth 2.0 parameters. :param method: A string representation of the HTTP method to be used. :type method: str :param url: The resource to be requested. :type url: str :param bearer_auth: W...
Below is the the instruction that describes the task: ### Input: A loose wrapper around Requests' :class:`~requests.sessions.Session` which injects OAuth 2.0 parameters. :param method: A string representation of the HTTP method to be used. :type method: str :param url: The resource ...
def get_what_txt(self): """ Overrides the base behaviour defined in ValidationError in order to add details about the function. :return: """ return 'input [{var}] for function [{func}]'.format(var=self.get_variable_str(), ...
Overrides the base behaviour defined in ValidationError in order to add details about the function. :return:
Below is the the instruction that describes the task: ### Input: Overrides the base behaviour defined in ValidationError in order to add details about the function. :return: ### Response: def get_what_txt(self): """ Overrides the base behaviour defined in ValidationError in order to add det...
def run(data): """Quantitaive isoforms expression by eXpress""" name = dd.get_sample_name(data) in_bam = dd.get_transcriptome_bam(data) config = data['config'] if not in_bam: logger.info("Transcriptome-mapped BAM file not found, skipping eXpress.") return data out_dir = os.path.j...
Quantitaive isoforms expression by eXpress
Below is the the instruction that describes the task: ### Input: Quantitaive isoforms expression by eXpress ### Response: def run(data): """Quantitaive isoforms expression by eXpress""" name = dd.get_sample_name(data) in_bam = dd.get_transcriptome_bam(data) config = data['config'] if not in_bam...
def new(cls, access_token, environment='prod'): '''Create new storage service client. Arguments: environment(str): The service environment to be used for the client. 'prod' or 'dev'. access_token(str): The access token used to authenticate with th...
Create new storage service client. Arguments: environment(str): The service environment to be used for the client. 'prod' or 'dev'. access_token(str): The access token used to authenticate with the service Returns: ...
Below is the the instruction that describes the task: ### Input: Create new storage service client. Arguments: environment(str): The service environment to be used for the client. 'prod' or 'dev'. access_token(str): The access token used to authentica...
def flush_template(context, declaration=None, reconstruct=True): """Emit the code needed to flush the buffer. Will only emit the yield and clear if the buffer is known to be dirty. """ if declaration is None: declaration = Line(0, '') if {'text', 'dirty'}.issubset(context.flag): yield declaration.clone(...
Emit the code needed to flush the buffer. Will only emit the yield and clear if the buffer is known to be dirty.
Below is the the instruction that describes the task: ### Input: Emit the code needed to flush the buffer. Will only emit the yield and clear if the buffer is known to be dirty. ### Response: def flush_template(context, declaration=None, reconstruct=True): """Emit the code needed to flush the buffer. Will...
def uppass(tree, feature): """ UPPASS traverses the tree starting from the tips and going up till the root, and assigns to each parent node a state based on the states of its child nodes. if N is a tip: S(N) <- state of N else: L, R <- left and right children of N UPPASS(L) UP...
UPPASS traverses the tree starting from the tips and going up till the root, and assigns to each parent node a state based on the states of its child nodes. if N is a tip: S(N) <- state of N else: L, R <- left and right children of N UPPASS(L) UPPASS(R) if S(L) intersects with S...
Below is the the instruction that describes the task: ### Input: UPPASS traverses the tree starting from the tips and going up till the root, and assigns to each parent node a state based on the states of its child nodes. if N is a tip: S(N) <- state of N else: L, R <- left and right children...
def saltenviron(environ): ''' Make Salt's opts dict and the APIClient available in the WSGI environ ''' if '__opts__' not in locals(): import salt.config __opts__ = salt.config.client_config( os.environ.get('SALT_MASTER_CONFIG', '/etc/salt/master')) environ['SALT_OPT...
Make Salt's opts dict and the APIClient available in the WSGI environ
Below is the the instruction that describes the task: ### Input: Make Salt's opts dict and the APIClient available in the WSGI environ ### Response: def saltenviron(environ): ''' Make Salt's opts dict and the APIClient available in the WSGI environ ''' if '__opts__' not in locals(): import ...
def op_paths(self, path_base): # type: (Union[str, UrlPath]) -> Generator[Tuple[UrlPath, Operation]] """ Return all operations stored in containers. """ path_base += self.path_prefix for operation in self._operations: for op_path in operation.op_paths(path_ba...
Return all operations stored in containers.
Below is the the instruction that describes the task: ### Input: Return all operations stored in containers. ### Response: def op_paths(self, path_base): # type: (Union[str, UrlPath]) -> Generator[Tuple[UrlPath, Operation]] """ Return all operations stored in containers. """ ...
def add_html_link(app, pagename, templatename, context, doctree): """As each page is built, collect page names for the sitemap""" app.sitemap_links.append(pagename + ".html")
As each page is built, collect page names for the sitemap
Below is the the instruction that describes the task: ### Input: As each page is built, collect page names for the sitemap ### Response: def add_html_link(app, pagename, templatename, context, doctree): """As each page is built, collect page names for the sitemap""" app.sitemap_links.append(pagename + ".ht...
def result(self, timeout=None): """Return the result of the call that the future represents. Args: timeout: The number of seconds to wait for the result if the future isn't done. If None, then there is no limit on the wait time. Returns: The result of th...
Return the result of the call that the future represents. Args: timeout: The number of seconds to wait for the result if the future isn't done. If None, then there is no limit on the wait time. Returns: The result of the call that the future represents. ...
Below is the the instruction that describes the task: ### Input: Return the result of the call that the future represents. Args: timeout: The number of seconds to wait for the result if the future isn't done. If None, then there is no limit on the wait time. Returns: ...
def midi_outputs(self): """ :return: A list of MIDI output :class:`Ports`. """ return self.client.get_ports(is_midi=True, is_physical=True, is_output=True)
:return: A list of MIDI output :class:`Ports`.
Below is the the instruction that describes the task: ### Input: :return: A list of MIDI output :class:`Ports`. ### Response: def midi_outputs(self): """ :return: A list of MIDI output :class:`Ports`. """ return self.client.get_ports(is_midi=True, is_physical=True, is_output=True)
def unregister(self): """ Unregister this system from the insights service """ machine_id = generate_machine_id() try: logger.debug("Unregistering %s", machine_id) url = self.api_url + "/v1/systems/" + machine_id net_logger.info("DELETE %s", ur...
Unregister this system from the insights service
Below is the the instruction that describes the task: ### Input: Unregister this system from the insights service ### Response: def unregister(self): """ Unregister this system from the insights service """ machine_id = generate_machine_id() try: logger.debug("Un...
def set_transform(self, type_, *args, **kwargs): """ Create a new transform of *type* and assign it to this node. All extra arguments are used in the construction of the transform. Parameters ---------- type_ : str The transform type. *args : tuple ...
Create a new transform of *type* and assign it to this node. All extra arguments are used in the construction of the transform. Parameters ---------- type_ : str The transform type. *args : tuple Arguments. **kwargs : dict Keywoard ar...
Below is the the instruction that describes the task: ### Input: Create a new transform of *type* and assign it to this node. All extra arguments are used in the construction of the transform. Parameters ---------- type_ : str The transform type. *args : tuple ...
def get_image(image_id, flags=FLAGS.ALL, **conn): """ Orchestrates all the calls required to fully build out an EC2 Image (AMI, AKI, ARI) { "Architecture": "x86_64", "Arn": "arn:aws:ec2:us-east-1::image/ami-11111111", "BlockDeviceMappings": [], "CreationDate": "2013-07-11...
Orchestrates all the calls required to fully build out an EC2 Image (AMI, AKI, ARI) { "Architecture": "x86_64", "Arn": "arn:aws:ec2:us-east-1::image/ami-11111111", "BlockDeviceMappings": [], "CreationDate": "2013-07-11T16:04:06.000Z", "Description": "...", "Hype...
Below is the the instruction that describes the task: ### Input: Orchestrates all the calls required to fully build out an EC2 Image (AMI, AKI, ARI) { "Architecture": "x86_64", "Arn": "arn:aws:ec2:us-east-1::image/ami-11111111", "BlockDeviceMappings": [], "CreationDate": "201...
def feincms_breadcrumbs(page, include_self=True): """ Generate a list of the page's ancestors suitable for use as breadcrumb navigation. By default, generates an unordered list with the id "breadcrumbs" - override breadcrumbs.html to change this. :: {% feincms_breadcrumbs feincms_page %} ...
Generate a list of the page's ancestors suitable for use as breadcrumb navigation. By default, generates an unordered list with the id "breadcrumbs" - override breadcrumbs.html to change this. :: {% feincms_breadcrumbs feincms_page %}
Below is the the instruction that describes the task: ### Input: Generate a list of the page's ancestors suitable for use as breadcrumb navigation. By default, generates an unordered list with the id "breadcrumbs" - override breadcrumbs.html to change this. :: {% feincms_breadcrumbs feincms_p...
def append(self, data): """Append data to a file.""" data_length = len(data) if self._size + data_length > self._flush_size: self.flush() if not self._exclusive and data_length > _FILE_POOL_MAX_SIZE: raise errors.Error( "Too big input %s (%s)." % (data_length, _FILE_POOL_MAX_SIZE...
Append data to a file.
Below is the the instruction that describes the task: ### Input: Append data to a file. ### Response: def append(self, data): """Append data to a file.""" data_length = len(data) if self._size + data_length > self._flush_size: self.flush() if not self._exclusive and data_length > _FILE_POOL_...