code
stringlengths
75
104k
docstring
stringlengths
1
46.9k
text
stringlengths
164
112k
def files(self) -> List[str]: """ Obtain the list of the files (excluding .git directory). :return: List[str], the list of the files """ _all = [] for path, _, files in os.walk(str(self.path)): if '.git' in path: continue for name ...
Obtain the list of the files (excluding .git directory). :return: List[str], the list of the files
Below is the the instruction that describes the task: ### Input: Obtain the list of the files (excluding .git directory). :return: List[str], the list of the files ### Response: def files(self) -> List[str]: """ Obtain the list of the files (excluding .git directory). :return: Lis...
def run(self): """Run command.""" files = self.__zipped_files_data hashes = {} icons = {} # Read icons.json (from the webfont zip download) data = json.loads(files['icons.json']) # Group icons by style, since not all icons exist for all styles: for icon,...
Run command.
Below is the the instruction that describes the task: ### Input: Run command. ### Response: def run(self): """Run command.""" files = self.__zipped_files_data hashes = {} icons = {} # Read icons.json (from the webfont zip download) data = json.loads(files['icons.jso...
def _sortValue_isItalic(font): """ Returns 0 if the font is italic. Returns 1 if the font is not italic. """ info = font.info styleMapStyleName = info.styleMapStyleName if styleMapStyleName is not None and "italic" in styleMapStyleName: return 0 if info.italicAngle not in (None, ...
Returns 0 if the font is italic. Returns 1 if the font is not italic.
Below is the the instruction that describes the task: ### Input: Returns 0 if the font is italic. Returns 1 if the font is not italic. ### Response: def _sortValue_isItalic(font): """ Returns 0 if the font is italic. Returns 1 if the font is not italic. """ info = font.info styleMapStyl...
def load(self): """ Loads the records from the query set linked with this item. """ if self._loaded: return rset = self.recordSet() QApplication.setOverrideCursor(Qt.WaitCursor) self.loadRecords(rset) QApplication.r...
Loads the records from the query set linked with this item.
Below is the the instruction that describes the task: ### Input: Loads the records from the query set linked with this item. ### Response: def load(self): """ Loads the records from the query set linked with this item. """ if self._loaded: return ...
def dump_passes(self): """ Fetches the passes added to this flow controller. Returns (dict): {'options': self.options, 'passes': [passes], 'type': type(self)} """ ret = {'options': self.options, 'passes': [], 'type': type(self)} for pass_ in self._passes: if ...
Fetches the passes added to this flow controller. Returns (dict): {'options': self.options, 'passes': [passes], 'type': type(self)}
Below is the the instruction that describes the task: ### Input: Fetches the passes added to this flow controller. Returns (dict): {'options': self.options, 'passes': [passes], 'type': type(self)} ### Response: def dump_passes(self): """ Fetches the passes added to this flow controller. ...
def collides(self,position,size): '''Returns True if the word collides with another plotted word.''' word_rect = pygame.Rect(position,self.word_size) if word_rect.collidelistall(self.used_pos) == []: return False else: return True
Returns True if the word collides with another plotted word.
Below is the the instruction that describes the task: ### Input: Returns True if the word collides with another plotted word. ### Response: def collides(self,position,size): '''Returns True if the word collides with another plotted word.''' word_rect = pygame.Rect(position,self.word_size) i...
def highlightByAlternate(self): """ Sets the palette highlighting for this tree widget to use a darker version of the alternate color vs. the standard highlighting. """ palette = QtGui.QApplication.palette() palette.setColor(palette.HighlightedText, palette.color(pa...
Sets the palette highlighting for this tree widget to use a darker version of the alternate color vs. the standard highlighting.
Below is the the instruction that describes the task: ### Input: Sets the palette highlighting for this tree widget to use a darker version of the alternate color vs. the standard highlighting. ### Response: def highlightByAlternate(self): """ Sets the palette highlighting for this tree ...
def bm3_big_F(p, v, v0): """ calculate big F for linearlized form not fully tested :param p: :param f: :return: """ f = bm3_small_f(v, v0) return cal_big_F(p, f)
calculate big F for linearlized form not fully tested :param p: :param f: :return:
Below is the the instruction that describes the task: ### Input: calculate big F for linearlized form not fully tested :param p: :param f: :return: ### Response: def bm3_big_F(p, v, v0): """ calculate big F for linearlized form not fully tested :param p: :param f: :return:...
def compute_index_key(self, to_instance): ''' Compute the index key that can be used to identify an instance on the link. ''' kwargs = dict() for attr in self.key_map.values(): if _is_null(to_instance, attr): return None ...
Compute the index key that can be used to identify an instance on the link.
Below is the the instruction that describes the task: ### Input: Compute the index key that can be used to identify an instance on the link. ### Response: def compute_index_key(self, to_instance): ''' Compute the index key that can be used to identify an instance on the link. ...
def get_aids_by_tag(self): """ :returns: dict tag -> asset ordinals """ aids_by_tag = general.AccumDict(accum=set()) for aid, ass in enumerate(self): for tagname in self.tagnames: tag = self.tagcol.get_tag(tagname, ass[tagname]) aids_by...
:returns: dict tag -> asset ordinals
Below is the the instruction that describes the task: ### Input: :returns: dict tag -> asset ordinals ### Response: def get_aids_by_tag(self): """ :returns: dict tag -> asset ordinals """ aids_by_tag = general.AccumDict(accum=set()) for aid, ass in enumerate(self): ...
def _associate_short_long(notices): """ If a notice is type ${1}Short, associate with its Long notice in an attribute called long_notice. """ for notice in notices: if notice.notice_type is not None and\ notice.notice_category == "StudentFinAid" and\ notice.no...
If a notice is type ${1}Short, associate with its Long notice in an attribute called long_notice.
Below is the the instruction that describes the task: ### Input: If a notice is type ${1}Short, associate with its Long notice in an attribute called long_notice. ### Response: def _associate_short_long(notices): """ If a notice is type ${1}Short, associate with its Long notice in an attribute call...
def get_transform_vector(self, resx, resy): """ Given resolution it returns a transformation vector :param resx: Resolution in x direction :type resx: float or int :param resy: Resolution in y direction :type resy: float or int :return: A tuple with 6 numbers representin...
Given resolution it returns a transformation vector :param resx: Resolution in x direction :type resx: float or int :param resy: Resolution in y direction :type resy: float or int :return: A tuple with 6 numbers representing transformation vector :rtype: tuple(float)
Below is the the instruction that describes the task: ### Input: Given resolution it returns a transformation vector :param resx: Resolution in x direction :type resx: float or int :param resy: Resolution in y direction :type resy: float or int :return: A tuple with 6 number...
def _automatic_dims(cls, dims, size): """Check if input dimension corresponds to qubit subsystems.""" if dims is None: dims = size elif np.product(dims) != size: raise QiskitError("dimensions do not match size.") if isinstance(dims, (int, np.integer)): ...
Check if input dimension corresponds to qubit subsystems.
Below is the the instruction that describes the task: ### Input: Check if input dimension corresponds to qubit subsystems. ### Response: def _automatic_dims(cls, dims, size): """Check if input dimension corresponds to qubit subsystems.""" if dims is None: dims = size elif np.pro...
def DbGetDeviceAttributePropertyHist(self, argin): """ Retrieve device attribute property history :param argin: Str[0] = Device name Str[1] = Attribute name Str[2] = Property name :type: tango.DevVarStringArray :return: Str[0] = Attribute name Str[1] = Property n...
Retrieve device attribute property history :param argin: Str[0] = Device name Str[1] = Attribute name Str[2] = Property name :type: tango.DevVarStringArray :return: Str[0] = Attribute name Str[1] = Property name Str[2] = date Str[3] = Property value numbe...
Below is the the instruction that describes the task: ### Input: Retrieve device attribute property history :param argin: Str[0] = Device name Str[1] = Attribute name Str[2] = Property name :type: tango.DevVarStringArray :return: Str[0] = Attribute name Str[1] = Prop...
def sendUssd(self, ussdString, responseTimeout=15): """ Starts a USSD session by dialing the the specified USSD string, or \ sends the specified string in the existing USSD session (if any) :param ussdString: The USSD access number to dial :param responseTimeout: Maximum...
Starts a USSD session by dialing the the specified USSD string, or \ sends the specified string in the existing USSD session (if any) :param ussdString: The USSD access number to dial :param responseTimeout: Maximum time to wait a response, in seconds :raise Tim...
Below is the the instruction that describes the task: ### Input: Starts a USSD session by dialing the the specified USSD string, or \ sends the specified string in the existing USSD session (if any) :param ussdString: The USSD access number to dial :param responseTimeout: Ma...
def get_host_node_state(self, state, problem_has_been_acknowledged, in_scheduled_downtime): """Get host node state, simplest case :: * Handle not value (revert) for host and consider 1 as 2 :return: 0, 1 or 2 :rtype: int """ # Make DOWN look as CRITICAL (2 instead of 1)...
Get host node state, simplest case :: * Handle not value (revert) for host and consider 1 as 2 :return: 0, 1 or 2 :rtype: int
Below is the the instruction that describes the task: ### Input: Get host node state, simplest case :: * Handle not value (revert) for host and consider 1 as 2 :return: 0, 1 or 2 :rtype: int ### Response: def get_host_node_state(self, state, problem_has_been_acknowledged, in_scheduled_dow...
def change_vlan_id(self, original, new): """ Change VLAN ID for a single VLAN, cluster VLAN or inline interface. When changing a single or cluster FW vlan, you can specify the original VLAN and new VLAN as either single int or str value. If modifying an inline interface VLAN when...
Change VLAN ID for a single VLAN, cluster VLAN or inline interface. When changing a single or cluster FW vlan, you can specify the original VLAN and new VLAN as either single int or str value. If modifying an inline interface VLAN when the interface pair has two different VLAN identifier...
Below is the the instruction that describes the task: ### Input: Change VLAN ID for a single VLAN, cluster VLAN or inline interface. When changing a single or cluster FW vlan, you can specify the original VLAN and new VLAN as either single int or str value. If modifying an inline interface V...
def get(self, **kwargs): """ :param texteRecherche: :param numAmend: :param idArticle: :param idAuteur: :param idDossierLegislatif: :param idExamen: :param idExamens: :param periodeParlementaire: :param dateDebut: :param dateFin: ...
:param texteRecherche: :param numAmend: :param idArticle: :param idAuteur: :param idDossierLegislatif: :param idExamen: :param idExamens: :param periodeParlementaire: :param dateDebut: :param dateFin: :param rows: :param start: ...
Below is the the instruction that describes the task: ### Input: :param texteRecherche: :param numAmend: :param idArticle: :param idAuteur: :param idDossierLegislatif: :param idExamen: :param idExamens: :param periodeParlementaire: :param dateDebut: ...
def get_id_for_extra_dim_type(type_str): """ Returns the index of the type as defined in the LAS Specification Parameters ---------- type_str: str Returns ------- int index of the type """ try: return _type_to_extra_dim_id_style_1[type_str] except KeyError: ...
Returns the index of the type as defined in the LAS Specification Parameters ---------- type_str: str Returns ------- int index of the type
Below is the the instruction that describes the task: ### Input: Returns the index of the type as defined in the LAS Specification Parameters ---------- type_str: str Returns ------- int index of the type ### Response: def get_id_for_extra_dim_type(type_str): """ Returns the i...
def value(self, obj): ''' Computes the value of this field to update the index. :param obj: object instance, as a dictionary or as a model instance. ''' if self.template_name: t = loader.select_template([self.template_name]) return t.render(Context({'objec...
Computes the value of this field to update the index. :param obj: object instance, as a dictionary or as a model instance.
Below is the the instruction that describes the task: ### Input: Computes the value of this field to update the index. :param obj: object instance, as a dictionary or as a model instance. ### Response: def value(self, obj): ''' Computes the value of this field to update the index. :...
def query_image_content(self, image, content_type=""): '''**Description** Find the image with the tag <image> and return its content. **Arguments** - image: Input image can be in the following formats: registry/repo:tag - content_type: The content type can be one of ...
**Description** Find the image with the tag <image> and return its content. **Arguments** - image: Input image can be in the following formats: registry/repo:tag - content_type: The content type can be one of the following types: - os: Operating System Packag...
Below is the the instruction that describes the task: ### Input: **Description** Find the image with the tag <image> and return its content. **Arguments** - image: Input image can be in the following formats: registry/repo:tag - content_type: The content type can be one ...
def stream(self, id, offset, origin, path="/"): """ This endpoint streams the contents of a file in an allocation directory. https://www.nomadproject.io/api/client.html#stream-file arguments: - id: (str) allocation_id required - offset: (int) required ...
This endpoint streams the contents of a file in an allocation directory. https://www.nomadproject.io/api/client.html#stream-file arguments: - id: (str) allocation_id required - offset: (int) required - origin: (str) either start|end - pat...
Below is the the instruction that describes the task: ### Input: This endpoint streams the contents of a file in an allocation directory. https://www.nomadproject.io/api/client.html#stream-file arguments: - id: (str) allocation_id required - offset: (int) requir...
def generate_aead_simple(self, nonce, key_handle, data): """ Generate AEAD block from data for a specific key in a single step (without using the YubiHSM internal buffer). @param nonce: The nonce to use when creating the AEAD @param key_handle: The key handle that can encrypt da...
Generate AEAD block from data for a specific key in a single step (without using the YubiHSM internal buffer). @param nonce: The nonce to use when creating the AEAD @param key_handle: The key handle that can encrypt data into an AEAD @param data: Data to put inside the AEAD @typ...
Below is the the instruction that describes the task: ### Input: Generate AEAD block from data for a specific key in a single step (without using the YubiHSM internal buffer). @param nonce: The nonce to use when creating the AEAD @param key_handle: The key handle that can encrypt data into ...
def generate_trajectory(group_membership, num_levels=4): """Return a single trajectory Return a single trajectory of size :math:`(g+1)`-by-:math:`k` where :math:`g` is the number of groups, and :math:`k` is the number of factors, both implied by the dimensions of `group_membership` Arguments ...
Return a single trajectory Return a single trajectory of size :math:`(g+1)`-by-:math:`k` where :math:`g` is the number of groups, and :math:`k` is the number of factors, both implied by the dimensions of `group_membership` Arguments --------- group_membership : np.ndarray a k-by-g ...
Below is the the instruction that describes the task: ### Input: Return a single trajectory Return a single trajectory of size :math:`(g+1)`-by-:math:`k` where :math:`g` is the number of groups, and :math:`k` is the number of factors, both implied by the dimensions of `group_membership` Argume...
def sources_remove(name, ruby=None, user=None): ''' Make sure that a gem source is removed. name The URL of the gem source to be removed ruby: None For RVM or rbenv installations: the ruby version and gemset to target. user: None The user under which to run the ``gem`` com...
Make sure that a gem source is removed. name The URL of the gem source to be removed ruby: None For RVM or rbenv installations: the ruby version and gemset to target. user: None The user under which to run the ``gem`` command .. versionadded:: 0.17.0
Below is the the instruction that describes the task: ### Input: Make sure that a gem source is removed. name The URL of the gem source to be removed ruby: None For RVM or rbenv installations: the ruby version and gemset to target. user: None The user under which to run the ``...
def cortex_plot_2D(the_map, color=None, cmap=None, vmin=None, vmax=None, alpha=None, underlay='curvature', mask=None, axes=None, triangulation=None): ''' cortex_plot_2D(map) yields a plot of the given 2D cortical mesh, map. The following options are accepted: * c...
cortex_plot_2D(map) yields a plot of the given 2D cortical mesh, map. The following options are accepted: * color (default: None) specifies the color to plot for each vertex; this argument may take a number of forms: * None, do not plot a color over the underlay (the default) * a ...
Below is the the instruction that describes the task: ### Input: cortex_plot_2D(map) yields a plot of the given 2D cortical mesh, map. The following options are accepted: * color (default: None) specifies the color to plot for each vertex; this argument may take a number of forms: * Non...
def has_stack(self, s): """Tests whether store `s` is a stack, that is, it never moves from position 0.""" for t in self.transitions: if t.lhs[s].position != 0: return False if t.rhs[s].position != 0: return False return True
Tests whether store `s` is a stack, that is, it never moves from position 0.
Below is the the instruction that describes the task: ### Input: Tests whether store `s` is a stack, that is, it never moves from position 0. ### Response: def has_stack(self, s): """Tests whether store `s` is a stack, that is, it never moves from position 0.""" for t in self.transi...
def _import_warnings(self): """ Add custom warnings found in output files. Warnings in output files are searched for using this method; if a warning is found then it will be appended to the warnings list. """ warnings = ( r"Warning: BMDL computation is at bes...
Add custom warnings found in output files. Warnings in output files are searched for using this method; if a warning is found then it will be appended to the warnings list.
Below is the the instruction that describes the task: ### Input: Add custom warnings found in output files. Warnings in output files are searched for using this method; if a warning is found then it will be appended to the warnings list. ### Response: def _import_warnings(self): """ ...
def _build(self, inputs, keep_prob=None, is_training=None, test_local_stats=True): """Connects the AlexNet module into the graph. The is_training flag only controls the batch norm settings, if `False` it does not force no dropout by overriding any input `keep_prob`. To avoid any confusion ...
Connects the AlexNet module into the graph. The is_training flag only controls the batch norm settings, if `False` it does not force no dropout by overriding any input `keep_prob`. To avoid any confusion this may cause, if `is_training=False` and `keep_prob` would cause dropout to be applied, an error ...
Below is the the instruction that describes the task: ### Input: Connects the AlexNet module into the graph. The is_training flag only controls the batch norm settings, if `False` it does not force no dropout by overriding any input `keep_prob`. To avoid any confusion this may cause, if `is_training=Fa...
def resolve(self, strict=None): """Make the path absolute, resolving all symlinks on the way and also normalizing it (for example turning slashes into backslashes under Windows). Args: strict: If False (default) no exception is raised if the path does not exi...
Make the path absolute, resolving all symlinks on the way and also normalizing it (for example turning slashes into backslashes under Windows). Args: strict: If False (default) no exception is raised if the path does not exist. New in Python 3.6. ...
Below is the the instruction that describes the task: ### Input: Make the path absolute, resolving all symlinks on the way and also normalizing it (for example turning slashes into backslashes under Windows). Args: strict: If False (default) no exception is raised if the path ...
def get_wake_on_network(): ''' Displays whether 'wake on network' is on or off if supported :return: A string value representing the "wake on network" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power.get_wake_on_network ''' ret = salt.utils.mac_utils.e...
Displays whether 'wake on network' is on or off if supported :return: A string value representing the "wake on network" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power.get_wake_on_network
Below is the the instruction that describes the task: ### Input: Displays whether 'wake on network' is on or off if supported :return: A string value representing the "wake on network" settings :rtype: string CLI Example: .. code-block:: bash salt '*' power.get_wake_on_network ### Respon...
def parse_block_scalar_empty_line(indent_token_class, content_token_class): """Process an empty line in a block scalar.""" def callback(lexer, match, context): text = match.group() if (context.block_scalar_indent is None or len(text) <= context.block_scalar_in...
Process an empty line in a block scalar.
Below is the the instruction that describes the task: ### Input: Process an empty line in a block scalar. ### Response: def parse_block_scalar_empty_line(indent_token_class, content_token_class): """Process an empty line in a block scalar.""" def callback(lexer, match, context): text = ...
def insert(self, packet, **kwargs): ''' Insert a packet into the database Arguments packet The :class:`ait.core.tlm.Packet` instance to insert into the database ''' values = [ ] pd = packet._defn for defn in pd.fields: ...
Insert a packet into the database Arguments packet The :class:`ait.core.tlm.Packet` instance to insert into the database
Below is the the instruction that describes the task: ### Input: Insert a packet into the database Arguments packet The :class:`ait.core.tlm.Packet` instance to insert into the database ### Response: def insert(self, packet, **kwargs): ''' Insert a packe...
def nvmlDeviceGetSupportedMemoryClocks(handle): r""" /** * Retrieves the list of possible memory clocks that can be used as an argument for \ref nvmlDeviceSetApplicationsClocks. * * For Kepler &tm; or newer fully supported devices. * * @param device The ide...
r""" /** * Retrieves the list of possible memory clocks that can be used as an argument for \ref nvmlDeviceSetApplicationsClocks. * * For Kepler &tm; or newer fully supported devices. * * @param device The identifier of the target device * @param count ...
Below is the the instruction that describes the task: ### Input: r""" /** * Retrieves the list of possible memory clocks that can be used as an argument for \ref nvmlDeviceSetApplicationsClocks. * * For Kepler &tm; or newer fully supported devices. * * @param device ...
def is_transactional(self, state): ''' Decide if a request should be wrapped in a transaction, based upon the state of the request. By default, wraps all but ``GET`` and ``HEAD`` requests in a transaction, along with respecting the ``transactional`` decorator from :mod:pecan.deco...
Decide if a request should be wrapped in a transaction, based upon the state of the request. By default, wraps all but ``GET`` and ``HEAD`` requests in a transaction, along with respecting the ``transactional`` decorator from :mod:pecan.decorators. :param state: The Pecan state object f...
Below is the the instruction that describes the task: ### Input: Decide if a request should be wrapped in a transaction, based upon the state of the request. By default, wraps all but ``GET`` and ``HEAD`` requests in a transaction, along with respecting the ``transactional`` decorator from :...
def _intercept_dot(w, X): """Computes y * np.dot(X, w). It takes into consideration if the intercept should be fit or not. Parameters ---------- w : ndarray, shape (n_features,) or (n_features + 1,) Coefficient vector. X : {array-like, sparse matrix}, shape (n_samples, n_features) ...
Computes y * np.dot(X, w). It takes into consideration if the intercept should be fit or not. Parameters ---------- w : ndarray, shape (n_features,) or (n_features + 1,) Coefficient vector. X : {array-like, sparse matrix}, shape (n_samples, n_features) Training data.
Below is the the instruction that describes the task: ### Input: Computes y * np.dot(X, w). It takes into consideration if the intercept should be fit or not. Parameters ---------- w : ndarray, shape (n_features,) or (n_features + 1,) Coefficient vector. X : {array-like, sparse matrix...
def _scan(positions): """get the region inside the vector with more expression""" scores = [] for start in range(0, len(positions) - 17, 5): end = start = 17 scores.add(_enrichment(positions[start:end], positions[:start], positions[end:]))
get the region inside the vector with more expression
Below is the the instruction that describes the task: ### Input: get the region inside the vector with more expression ### Response: def _scan(positions): """get the region inside the vector with more expression""" scores = [] for start in range(0, len(positions) - 17, 5): end = start = 17 ...
def fromMessage(klass, message, op_endpoint=UNUSED): """Construct me from an OpenID Message. @param message: The OpenID associate request @type message: openid.message.Message @returntype: L{AssociateRequest} """ if message.isOpenID1(): session_type = messag...
Construct me from an OpenID Message. @param message: The OpenID associate request @type message: openid.message.Message @returntype: L{AssociateRequest}
Below is the the instruction that describes the task: ### Input: Construct me from an OpenID Message. @param message: The OpenID associate request @type message: openid.message.Message @returntype: L{AssociateRequest} ### Response: def fromMessage(klass, message, op_endpoint=UNUSED): ...
def get_correlation_matrix_from_columns(self): """Computes correlation matrix of columns :return: Correlation matrix of columns """ header_to_column = {} # create index of headers for header in self.headers: header_to_column[header] = self.headers.index(header) ...
Computes correlation matrix of columns :return: Correlation matrix of columns
Below is the the instruction that describes the task: ### Input: Computes correlation matrix of columns :return: Correlation matrix of columns ### Response: def get_correlation_matrix_from_columns(self): """Computes correlation matrix of columns :return: Correlation matrix of columns ...
def fetch_from_archive(backend_class, backend_args, manager, category, archived_after): """Fetch items from an archive manager. Generator to get the items of a category (previously fetched by the given backend class) from an archive manager. Only those items archived after the gi...
Fetch items from an archive manager. Generator to get the items of a category (previously fetched by the given backend class) from an archive manager. Only those items archived after the given date will be returned. The parameters needed to initialize `backend` and get the items are given using `b...
Below is the the instruction that describes the task: ### Input: Fetch items from an archive manager. Generator to get the items of a category (previously fetched by the given backend class) from an archive manager. Only those items archived after the given date will be returned. The parameters ne...
def unpack_boolean(self, data): """ Unpack a string value of CIM type 'boolean' and return its CIM data type object, or None. data (unicode string): CIM-XML string value, or None (in which case None is returned). """ if data is None: return None ...
Unpack a string value of CIM type 'boolean' and return its CIM data type object, or None. data (unicode string): CIM-XML string value, or None (in which case None is returned).
Below is the the instruction that describes the task: ### Input: Unpack a string value of CIM type 'boolean' and return its CIM data type object, or None. data (unicode string): CIM-XML string value, or None (in which case None is returned). ### Response: def unpack_boolean(self, data): ...
def clean_text(value, topic=False): """ Replaces "profane" words with more suitable ones. Uses bleach to strip all but whitelisted html. Converts bbcode to Markdown """ for x in PROFANITY_REPLACEMENTS: value = value.replace(x[0], x[1]) for bbset in BBCODE_REPLACEMENTS: p = r...
Replaces "profane" words with more suitable ones. Uses bleach to strip all but whitelisted html. Converts bbcode to Markdown
Below is the the instruction that describes the task: ### Input: Replaces "profane" words with more suitable ones. Uses bleach to strip all but whitelisted html. Converts bbcode to Markdown ### Response: def clean_text(value, topic=False): """ Replaces "profane" words with more suitable ones. U...
def resolve(self, pid): """Get Object Locations for Object.""" client = d1_cli.impl.client.CLICNClient( **self._cn_client_connect_params_from_session() ) object_location_list_pyxb = client.resolve(pid) for location in object_location_list_pyxb.objectLocation: ...
Get Object Locations for Object.
Below is the the instruction that describes the task: ### Input: Get Object Locations for Object. ### Response: def resolve(self, pid): """Get Object Locations for Object.""" client = d1_cli.impl.client.CLICNClient( **self._cn_client_connect_params_from_session() ) objec...
def matching_fpaths(dpath_list, include_patterns, exclude_dirs=[], greater_exclude_dirs=[], exclude_patterns=[], recursive=True): r""" walks dpath lists returning all directories that match the requested pattern. Args: dpath_list (list): inc...
r""" walks dpath lists returning all directories that match the requested pattern. Args: dpath_list (list): include_patterns (str): exclude_dirs (None): recursive (bool): References: # TODO: fix names and behavior of exclude_dirs and greater_exc...
Below is the the instruction that describes the task: ### Input: r""" walks dpath lists returning all directories that match the requested pattern. Args: dpath_list (list): include_patterns (str): exclude_dirs (None): recursive (bool): References: ...
def _merge_fastqc(samples): """ merge all fastqc samples into one by module """ fastqc_list = collections.defaultdict(list) seen = set() for data in samples: name = dd.get_sample_name(data) if name in seen: continue seen.add(name) fns = glob.glob(os.pa...
merge all fastqc samples into one by module
Below is the the instruction that describes the task: ### Input: merge all fastqc samples into one by module ### Response: def _merge_fastqc(samples): """ merge all fastqc samples into one by module """ fastqc_list = collections.defaultdict(list) seen = set() for data in samples: na...
def execute(self, container: Container, test: TestCase, verbose: bool = False ) -> TestOutcome: """ Runs a specified test inside a given container. Returns: the outcome of the test execution. """ bug = s...
Runs a specified test inside a given container. Returns: the outcome of the test execution.
Below is the the instruction that describes the task: ### Input: Runs a specified test inside a given container. Returns: the outcome of the test execution. ### Response: def execute(self, container: Container, test: TestCase, verbose: bool = Fal...
def scale(self, width: int, height: int) -> None: """Scale this Image to the new width and height. Args: width (int): The new width of the Image after scaling. height (int): The new height of the Image after scaling. """ lib.TCOD_image_scale(self.image_c, width, ...
Scale this Image to the new width and height. Args: width (int): The new width of the Image after scaling. height (int): The new height of the Image after scaling.
Below is the the instruction that describes the task: ### Input: Scale this Image to the new width and height. Args: width (int): The new width of the Image after scaling. height (int): The new height of the Image after scaling. ### Response: def scale(self, width: int, height: int...
def resolve_domain(self, pipeline): """Resolve a concrete domain for ``pipeline``. """ domain = pipeline.domain(default=self._default_domain) if domain is GENERIC: raise ValueError( "Unable to determine domain for Pipeline.\n" "Pass domain=<des...
Resolve a concrete domain for ``pipeline``.
Below is the the instruction that describes the task: ### Input: Resolve a concrete domain for ``pipeline``. ### Response: def resolve_domain(self, pipeline): """Resolve a concrete domain for ``pipeline``. """ domain = pipeline.domain(default=self._default_domain) if domain is GENER...
def descriptor_factory(self, type_name, shard=u'lobby', **kwargs): """ Creates and returns a descriptor to pass it later for starting the agent. First parameter is a type_name representing the descirptor. Second parameter is optional (default lobby). Usage: > descriptor_f...
Creates and returns a descriptor to pass it later for starting the agent. First parameter is a type_name representing the descirptor. Second parameter is optional (default lobby). Usage: > descriptor_factory('shard_descriptor', 'some shard')
Below is the the instruction that describes the task: ### Input: Creates and returns a descriptor to pass it later for starting the agent. First parameter is a type_name representing the descirptor. Second parameter is optional (default lobby). Usage: > descriptor_factory('shard_desc...
def _set_vlan(self, v, load=False): """ Setter method for vlan, mapped from YANG variable /interface_vlan/interface/vlan (list) If this variable is read-only (config: false) in the source YANG file, then _set_vlan is considered as a private method. Backends looking to populate this variable should ...
Setter method for vlan, mapped from YANG variable /interface_vlan/interface/vlan (list) If this variable is read-only (config: false) in the source YANG file, then _set_vlan is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_vlan() directl...
Below is the the instruction that describes the task: ### Input: Setter method for vlan, mapped from YANG variable /interface_vlan/interface/vlan (list) If this variable is read-only (config: false) in the source YANG file, then _set_vlan is considered as a private method. Backends looking to populate t...
def _repack(h5file): """ Repack archive to remove freespace. Returns ------- file : h5py File or None If the input is a h5py.File then a h5py File instance of the repacked archive is returned. The input File instance will no longer be useable. """ f1,...
Repack archive to remove freespace. Returns ------- file : h5py File or None If the input is a h5py.File then a h5py File instance of the repacked archive is returned. The input File instance will no longer be useable.
Below is the the instruction that describes the task: ### Input: Repack archive to remove freespace. Returns ------- file : h5py File or None If the input is a h5py.File then a h5py File instance of the repacked archive is returned. The input File instance will no longer ...
def create_vault_ec2_client_configuration(self, access_key, secret_key, endpoint=None, mount_point='aws-ec2'): """POST /auth/<mount_point>/config/client Configure the credentials required to perform API calls to AWS as well as custom endpoints to talk to AWS APIs. The instance identity document...
POST /auth/<mount_point>/config/client Configure the credentials required to perform API calls to AWS as well as custom endpoints to talk to AWS APIs. The instance identity document fetched from the PKCS#7 signature will provide the EC2 instance ID. The credentials configured using this endpoin...
Below is the the instruction that describes the task: ### Input: POST /auth/<mount_point>/config/client Configure the credentials required to perform API calls to AWS as well as custom endpoints to talk to AWS APIs. The instance identity document fetched from the PKCS#7 signature will provide the E...
def create_page(self, space, title, body, parent_id=None, type='page'): """ Create page from scratch :param space: :param title: :param body: :param parent_id: :param type: :return: """ log.info('Creating {type} "{space}" -> "{title}"'.form...
Create page from scratch :param space: :param title: :param body: :param parent_id: :param type: :return:
Below is the the instruction that describes the task: ### Input: Create page from scratch :param space: :param title: :param body: :param parent_id: :param type: :return: ### Response: def create_page(self, space, title, body, parent_id=None, type='page'): ""...
def _get_config_generator(filename): """ A generator which populates and return a dict. :parse filename: A string containing the path to YAML file. :return: dict """ for d in _get_config(filename): repo = d['git'] parsedrepo = giturlparse.parse(repo) name = '{}.{}'.forma...
A generator which populates and return a dict. :parse filename: A string containing the path to YAML file. :return: dict
Below is the the instruction that describes the task: ### Input: A generator which populates and return a dict. :parse filename: A string containing the path to YAML file. :return: dict ### Response: def _get_config_generator(filename): """ A generator which populates and return a dict. :pars...
def get_zcta_metadata(zcta): """ Get metadata about a ZIP Code Tabulation Area (ZCTA). Parameters ---------- zcta : str ID of ZIP Code Tabulation Area Returns ------- metadata : dict Dict of data about the ZCTA, including lat/long coordinates. """ conn = metadata_db...
Get metadata about a ZIP Code Tabulation Area (ZCTA). Parameters ---------- zcta : str ID of ZIP Code Tabulation Area Returns ------- metadata : dict Dict of data about the ZCTA, including lat/long coordinates.
Below is the the instruction that describes the task: ### Input: Get metadata about a ZIP Code Tabulation Area (ZCTA). Parameters ---------- zcta : str ID of ZIP Code Tabulation Area Returns ------- metadata : dict Dict of data about the ZCTA, including lat/long coordinates...
def get_as_nullable_datetime(self, key): """ Converts map element into a Date or returns None if conversion is not possible. :param key: an index of element to get. :return: Date value of the element or None if conversion is not supported. """ value = self.get(key) ...
Converts map element into a Date or returns None if conversion is not possible. :param key: an index of element to get. :return: Date value of the element or None if conversion is not supported.
Below is the the instruction that describes the task: ### Input: Converts map element into a Date or returns None if conversion is not possible. :param key: an index of element to get. :return: Date value of the element or None if conversion is not supported. ### Response: def get_as_nullable_dat...
def rename(self, columns): """Returns a new DataFrame with renamed columns. Currently a simplified version of Pandas' rename. Parameters ---------- columns : dict Old names to new names. Returns ------- DataFrame With columns ren...
Returns a new DataFrame with renamed columns. Currently a simplified version of Pandas' rename. Parameters ---------- columns : dict Old names to new names. Returns ------- DataFrame With columns renamed, if found.
Below is the the instruction that describes the task: ### Input: Returns a new DataFrame with renamed columns. Currently a simplified version of Pandas' rename. Parameters ---------- columns : dict Old names to new names. Returns ------- DataFra...
def _create_graph(self, return_target_sources=None): """ Create a DiGraph out of the existing edge map. :param return_target_sources: Used for making up those missing returns :returns: A networkx.DiGraph() object """ if return_target_sources is None: # We set ...
Create a DiGraph out of the existing edge map. :param return_target_sources: Used for making up those missing returns :returns: A networkx.DiGraph() object
Below is the the instruction that describes the task: ### Input: Create a DiGraph out of the existing edge map. :param return_target_sources: Used for making up those missing returns :returns: A networkx.DiGraph() object ### Response: def _create_graph(self, return_target_sources=None): """...
def commands2tree(self, adapter, session, commands): '''Consumes state.Command commands and converts them to an ET protocol tree''' # todo: trap errors... hdrcmd = commands[0] commands = commands[1:] if hdrcmd.name != constants.CMD_SYNCHDR: raise common.InternalError('unexpected first comma...
Consumes state.Command commands and converts them to an ET protocol tree
Below is the the instruction that describes the task: ### Input: Consumes state.Command commands and converts them to an ET protocol tree ### Response: def commands2tree(self, adapter, session, commands): '''Consumes state.Command commands and converts them to an ET protocol tree''' # todo: trap errors......
def predict(self, X): """Predict the closest cluster each sample in X belongs to. In the vector quantization literature, `cluster_centers_` is called the code book and each value returned by `predict` is the index of the closest code in the code book. Parameters -------...
Predict the closest cluster each sample in X belongs to. In the vector quantization literature, `cluster_centers_` is called the code book and each value returned by `predict` is the index of the closest code in the code book. Parameters ---------- X : array-like, shape...
Below is the the instruction that describes the task: ### Input: Predict the closest cluster each sample in X belongs to. In the vector quantization literature, `cluster_centers_` is called the code book and each value returned by `predict` is the index of the closest code in the code book....
def read_header(self): """ Read header and return a Python dictionary of key:value pairs """ self.header = {} for key, val in self.h5['data'].attrs.items(): if six.PY3: key = bytes(key, 'ascii') if key == b'src_raj': self.header[k...
Read header and return a Python dictionary of key:value pairs
Below is the the instruction that describes the task: ### Input: Read header and return a Python dictionary of key:value pairs ### Response: def read_header(self): """ Read header and return a Python dictionary of key:value pairs """ self.header = {} for key, val in self.h5['data'...
def instance_norm(x): """Instance normalization layer.""" with tf.variable_scope("instance_norm"): epsilon = 1e-5 mean, var = tf.nn.moments(x, [1, 2], keep_dims=True) scale = tf.get_variable( "scale", [x.get_shape()[-1]], initializer=tf.truncated_normal_initializer(mean=1.0, stddev=0.02)...
Instance normalization layer.
Below is the the instruction that describes the task: ### Input: Instance normalization layer. ### Response: def instance_norm(x): """Instance normalization layer.""" with tf.variable_scope("instance_norm"): epsilon = 1e-5 mean, var = tf.nn.moments(x, [1, 2], keep_dims=True) scale = tf.get_variable...
def _on_connection_open(self, connection): """ Callback invoked when the connection is successfully established. Args: connection (pika.connection.SelectConnection): The newly-estabilished connection. """ _log.info("Successfully opened connection to %...
Callback invoked when the connection is successfully established. Args: connection (pika.connection.SelectConnection): The newly-estabilished connection.
Below is the the instruction that describes the task: ### Input: Callback invoked when the connection is successfully established. Args: connection (pika.connection.SelectConnection): The newly-estabilished connection. ### Response: def _on_connection_open(self, connection): ...
def copy(self, name=None): r""" Creates a deep copy of the current project A deep copy means that new, unique versions of all the objects are created but with identical data and properties. Parameters ---------- name : string The name to give to the ...
r""" Creates a deep copy of the current project A deep copy means that new, unique versions of all the objects are created but with identical data and properties. Parameters ---------- name : string The name to give to the new project. If not supplied, a na...
Below is the the instruction that describes the task: ### Input: r""" Creates a deep copy of the current project A deep copy means that new, unique versions of all the objects are created but with identical data and properties. Parameters ---------- name : string ...
def features_for_rank(self, proc, results): """Compute features for ranking results from ES/geonames Parameters ---------- proc : dict One dictionary from the list that comes back from geoparse or from make_country_features (doesn't matter) results : dict ...
Compute features for ranking results from ES/geonames Parameters ---------- proc : dict One dictionary from the list that comes back from geoparse or from make_country_features (doesn't matter) results : dict the response from a geonames query Returns ...
Below is the the instruction that describes the task: ### Input: Compute features for ranking results from ES/geonames Parameters ---------- proc : dict One dictionary from the list that comes back from geoparse or from make_country_features (doesn't matter) results : d...
def BuscarCertConSaldoDisponible(self, cuit_depositante=None, cod_grano=2, campania=1314, coe=None, fecha_emision_des=None, fecha_emision_has=None, ): """Devuelve los certificados de depósito en los que un productor tiene ...
Devuelve los certificados de depósito en los que un productor tiene saldo disponible para Liquidar/Retirar/Transferir
Below is the the instruction that describes the task: ### Input: Devuelve los certificados de depósito en los que un productor tiene saldo disponible para Liquidar/Retirar/Transferir ### Response: def BuscarCertConSaldoDisponible(self, cuit_depositante=None, cod_grano=2, campania=13...
def plot_sampler( sampler, suptitle=None, labels=None, bins=50, plot_samples=False, plot_hist=True, plot_chains=True, burn=0, chain_mask=None, temp_idx=0, weights=None, cutoff_weight=None, cmap='gray_r', hist_color='k', chain_alpha=0.1, points=None, covs=None, colors=None, ci=[0....
Plot the results of MCMC sampler (posterior and chains). Loosely based on triangle.py. Provides extensive options to format the plot. Parameters ---------- sampler : :py:class:`emcee.Sampler` instance or array, (`n_temps`, `n_chains`, `n_samp`, `n_dim`), (`n_chains`, `n_samp`, `n_dim`) or (`n_...
Below is the the instruction that describes the task: ### Input: Plot the results of MCMC sampler (posterior and chains). Loosely based on triangle.py. Provides extensive options to format the plot. Parameters ---------- sampler : :py:class:`emcee.Sampler` instance or array, (`n_temps`, `n...
def compute_residuals(self): """Compute residuals and stopping thresholds.""" r = self.rsdl() adapt_tol = self.opt['RelStopTol'] if self.opt['AutoStop', 'Enabled']: adapt_tol = self.tau0 / (1. + self.k) return r, adapt_tol
Compute residuals and stopping thresholds.
Below is the the instruction that describes the task: ### Input: Compute residuals and stopping thresholds. ### Response: def compute_residuals(self): """Compute residuals and stopping thresholds.""" r = self.rsdl() adapt_tol = self.opt['RelStopTol'] if self.opt['AutoStop', 'Enabl...
def get_api_references(self, api_url=None): """Get set of HATEOAS reference for the given SCO-API. Use the default SCO-API if none is given. References are cached as they are not expected to change. Parameters ---------- Returns ------- """ # Get...
Get set of HATEOAS reference for the given SCO-API. Use the default SCO-API if none is given. References are cached as they are not expected to change. Parameters ---------- Returns -------
Below is the the instruction that describes the task: ### Input: Get set of HATEOAS reference for the given SCO-API. Use the default SCO-API if none is given. References are cached as they are not expected to change. Parameters ---------- Returns ------- ### Respons...
def patch_namespaced_endpoints(self, name, namespace, body, **kwargs): """ partially update the specified Endpoints This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_namespaced_endpoint...
partially update the specified Endpoints This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_namespaced_endpoints(name, namespace, body, async_req=True) >>> result = thread.get() :param ...
Below is the the instruction that describes the task: ### Input: partially update the specified Endpoints This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.patch_namespaced_endpoints(name, namespace, bod...
def check_longitude(self, ds): ''' Check variable(s) that define longitude and are defined correctly according to CF. CF §4.2 Variables representing longitude must always explicitly include the units attribute; there is no default value. The recommended unit of longitude is deg...
Check variable(s) that define longitude and are defined correctly according to CF. CF §4.2 Variables representing longitude must always explicitly include the units attribute; there is no default value. The recommended unit of longitude is degrees_east. Also acceptable are degree_east, ...
Below is the the instruction that describes the task: ### Input: Check variable(s) that define longitude and are defined correctly according to CF. CF §4.2 Variables representing longitude must always explicitly include the units attribute; there is no default value. The recommended unit o...
def function(self, x, y, amp, sigma_x, sigma_y, center_x=0, center_y=0): """ returns Gaussian """ c = amp/(2*np.pi*sigma_x*sigma_y) delta_x = x - center_x delta_y = y - center_y exponent = -((delta_x/sigma_x)**2+(delta_y/sigma_y)**2)/2. return c * np.exp(e...
returns Gaussian
Below is the the instruction that describes the task: ### Input: returns Gaussian ### Response: def function(self, x, y, amp, sigma_x, sigma_y, center_x=0, center_y=0): """ returns Gaussian """ c = amp/(2*np.pi*sigma_x*sigma_y) delta_x = x - center_x delta_y = y - ce...
def emailclients(self, tag=None, fromdate=None, todate=None): """ Gets an overview of the email clients used to open your emails. This is only recorded when open tracking is enabled for that email. """ return self.call("GET", "/stats/outbound/opens/emailclients", tag=tag, fromdat...
Gets an overview of the email clients used to open your emails. This is only recorded when open tracking is enabled for that email.
Below is the the instruction that describes the task: ### Input: Gets an overview of the email clients used to open your emails. This is only recorded when open tracking is enabled for that email. ### Response: def emailclients(self, tag=None, fromdate=None, todate=None): """ Gets an overvi...
def tanh(x, context=None): """ Return the hyperbolic tangent of x. """ return _apply_function_in_current_context( BigFloat, mpfr.mpfr_tanh, (BigFloat._implicit_convert(x),), context, )
Return the hyperbolic tangent of x.
Below is the the instruction that describes the task: ### Input: Return the hyperbolic tangent of x. ### Response: def tanh(x, context=None): """ Return the hyperbolic tangent of x. """ return _apply_function_in_current_context( BigFloat, mpfr.mpfr_tanh, (BigFloat._implicit...
def namedb_get_names_with_value_hash( cur, value_hash, block_number ): """ Get the names with the given value hash. Only includes current, non-revoked names. Return None if there are no names. """ unexpired_query, unexpired_args = namedb_select_where_unexpired_names( block_number ) select_quer...
Get the names with the given value hash. Only includes current, non-revoked names. Return None if there are no names.
Below is the the instruction that describes the task: ### Input: Get the names with the given value hash. Only includes current, non-revoked names. Return None if there are no names. ### Response: def namedb_get_names_with_value_hash( cur, value_hash, block_number ): """ Get the names with the given v...
def _tokenize_wordpiece(self, text): """Tokenizes a piece of text into its word pieces. This uses a greedy longest-match-first algorithm to perform tokenization using the given vocabulary. For example: input = "unaffable" output = ["un", "##aff", "##able"] ...
Tokenizes a piece of text into its word pieces. This uses a greedy longest-match-first algorithm to perform tokenization using the given vocabulary. For example: input = "unaffable" output = ["un", "##aff", "##able"] Args: text: A single token or whitespa...
Below is the the instruction that describes the task: ### Input: Tokenizes a piece of text into its word pieces. This uses a greedy longest-match-first algorithm to perform tokenization using the given vocabulary. For example: input = "unaffable" output = ["un", "##aff"...
def validate_email_with_name(value): """ Validate email address. Both "Recipient Name <email@example.com>" and "email@example.com" are valid. """ value = force_text(value) recipient = value if '<' and '>' in value: start = value.find('<') + 1 end = value.find('>') i...
Validate email address. Both "Recipient Name <email@example.com>" and "email@example.com" are valid.
Below is the the instruction that describes the task: ### Input: Validate email address. Both "Recipient Name <email@example.com>" and "email@example.com" are valid. ### Response: def validate_email_with_name(value): """ Validate email address. Both "Recipient Name <email@example.com>" and "email...
def bam2fastq(bamfile, univ_options, picard_options): """ Split an input bam to paired fastqs. :param str bamfile: Path to a bam file :param dict univ_options: Dict of universal options used by almost all tools :param dict picard_options: Dict of options specific to Picard :return: Path to the ...
Split an input bam to paired fastqs. :param str bamfile: Path to a bam file :param dict univ_options: Dict of universal options used by almost all tools :param dict picard_options: Dict of options specific to Picard :return: Path to the _1.fastq file :rtype: str
Below is the the instruction that describes the task: ### Input: Split an input bam to paired fastqs. :param str bamfile: Path to a bam file :param dict univ_options: Dict of universal options used by almost all tools :param dict picard_options: Dict of options specific to Picard :return: Path to t...
def get_romfile_path(game, inttype=Integrations.DEFAULT): """ Return the path to a given game's romfile """ for extension in EMU_EXTENSIONS.keys(): possible_path = get_file_path(game, "rom" + extension, inttype) if possible_path: return possible_path raise FileNotFoundEr...
Return the path to a given game's romfile
Below is the the instruction that describes the task: ### Input: Return the path to a given game's romfile ### Response: def get_romfile_path(game, inttype=Integrations.DEFAULT): """ Return the path to a given game's romfile """ for extension in EMU_EXTENSIONS.keys(): possible_path = get_fi...
def compile(self, compass): """ Calls the compass script specified in the compass extension with the paths provided by the config.rb. """ try: output = subprocess.check_output( [compass.compass_path, 'compile', '-q'], cwd=self.b...
Calls the compass script specified in the compass extension with the paths provided by the config.rb.
Below is the the instruction that describes the task: ### Input: Calls the compass script specified in the compass extension with the paths provided by the config.rb. ### Response: def compile(self, compass): """ Calls the compass script specified in the compass extension with the p...
def new_linsolver(name,prop): """ Creates a linear solver. Parameters ---------- name : string prop : string Returns ------- solver : :class:`LinSolver <optalg.lin_solver.LinSolver>` """ if name == 'mumps': return LinSolverMUMPS(prop) elif name == 'supe...
Creates a linear solver. Parameters ---------- name : string prop : string Returns ------- solver : :class:`LinSolver <optalg.lin_solver.LinSolver>`
Below is the the instruction that describes the task: ### Input: Creates a linear solver. Parameters ---------- name : string prop : string Returns ------- solver : :class:`LinSolver <optalg.lin_solver.LinSolver>` ### Response: def new_linsolver(name,prop): """ Creates a l...
def interfaces(self): """list[dict]: A list of dictionary items describing the operational state of interfaces. This method currently only lists the Physical Interfaces ( Gigabitethernet, tengigabitethernet, fortygigabitethernet, hundredgigabitethernet) and Loopback interfaces. ...
list[dict]: A list of dictionary items describing the operational state of interfaces. This method currently only lists the Physical Interfaces ( Gigabitethernet, tengigabitethernet, fortygigabitethernet, hundredgigabitethernet) and Loopback interfaces. It currently excludes VLA...
Below is the the instruction that describes the task: ### Input: list[dict]: A list of dictionary items describing the operational state of interfaces. This method currently only lists the Physical Interfaces ( Gigabitethernet, tengigabitethernet, fortygigabitethernet, hundredgigabit...
def new_connection(self, remote_ip, remote_port): """This method is called when a new SMTP session is opened. [PUBLIC API] """ self.state.set_state('new') self._message = Message(Peer(remote_ip, remote_port)) decision, response_sent = self.is_allowed('accept_new_connecti...
This method is called when a new SMTP session is opened. [PUBLIC API]
Below is the the instruction that describes the task: ### Input: This method is called when a new SMTP session is opened. [PUBLIC API] ### Response: def new_connection(self, remote_ip, remote_port): """This method is called when a new SMTP session is opened. [PUBLIC API] """ ...
def save_bed(cls, query, filename=sys.stdout): """ write a bed12 file of the query. Parameters ---------- query : query a table or query to save to file filename : file string or filehandle to write output """ out = _open(filename...
write a bed12 file of the query. Parameters ---------- query : query a table or query to save to file filename : file string or filehandle to write output
Below is the the instruction that describes the task: ### Input: write a bed12 file of the query. Parameters ---------- query : query a table or query to save to file filename : file string or filehandle to write output ### Response: def save_bed(cls, query,...
def AAM(cpu, imm=None): """ ASCII adjust AX after multiply. Adjusts the result of the multiplication of two unpacked BCD values to create a pair of unpacked (base 10) BCD values. The AX register is the implied source and destination operand for this instruction. The AAM ...
ASCII adjust AX after multiply. Adjusts the result of the multiplication of two unpacked BCD values to create a pair of unpacked (base 10) BCD values. The AX register is the implied source and destination operand for this instruction. The AAM instruction is only useful when it follows a...
Below is the the instruction that describes the task: ### Input: ASCII adjust AX after multiply. Adjusts the result of the multiplication of two unpacked BCD values to create a pair of unpacked (base 10) BCD values. The AX register is the implied source and destination operand for this inst...
def plot_cumulative_density(self, **kwargs): """ Plots a pretty figure of {0}.{1} Matplotlib plot arguments can be passed in inside the kwargs, plus Parameters ----------- show_censors: bool place markers at censorship events. Default: False censor_s...
Plots a pretty figure of {0}.{1} Matplotlib plot arguments can be passed in inside the kwargs, plus Parameters ----------- show_censors: bool place markers at censorship events. Default: False censor_styles: bool If show_censors, this dictionary will be ...
Below is the the instruction that describes the task: ### Input: Plots a pretty figure of {0}.{1} Matplotlib plot arguments can be passed in inside the kwargs, plus Parameters ----------- show_censors: bool place markers at censorship events. Default: False cens...
def from_cli(cls, opt): """Create an InjFilterRejector instance from command-line options.""" injection_file = opt.injection_file chirp_time_window = \ opt.injection_filter_rejector_chirp_time_window match_threshold = opt.injection_filter_rejector_match_threshold coar...
Create an InjFilterRejector instance from command-line options.
Below is the the instruction that describes the task: ### Input: Create an InjFilterRejector instance from command-line options. ### Response: def from_cli(cls, opt): """Create an InjFilterRejector instance from command-line options.""" injection_file = opt.injection_file chirp_time_window ...
def root(self, pattern, current): """Start parsing the pattern.""" self.set_after_start() i = util.StringIter(pattern) iter(i) root_specified = False if self.win_drive_detect: m = RE_WIN_PATH.match(pattern) if m: drive = m.group(0)...
Start parsing the pattern.
Below is the the instruction that describes the task: ### Input: Start parsing the pattern. ### Response: def root(self, pattern, current): """Start parsing the pattern.""" self.set_after_start() i = util.StringIter(pattern) iter(i) root_specified = False if self.wi...
def __default(self, ast_token): """Handle tokens inside the list or outside the list.""" if self.list_level == 1: if self.list_entry is None: self.list_entry = ast_token elif not isinstance(ast_token, type(self.list_entry)): self.final_ast_tokens.a...
Handle tokens inside the list or outside the list.
Below is the the instruction that describes the task: ### Input: Handle tokens inside the list or outside the list. ### Response: def __default(self, ast_token): """Handle tokens inside the list or outside the list.""" if self.list_level == 1: if self.list_entry is None: ...
def add_transaction_clause(self, clause): """ Adds a iff clause to this statement :param clause: The clause that will be added to the iff statement :type clause: TransactionClause """ if not isinstance(clause, TransactionClause): raise StatementException('onl...
Adds a iff clause to this statement :param clause: The clause that will be added to the iff statement :type clause: TransactionClause
Below is the the instruction that describes the task: ### Input: Adds a iff clause to this statement :param clause: The clause that will be added to the iff statement :type clause: TransactionClause ### Response: def add_transaction_clause(self, clause): """ Adds a iff clause to th...
def while_stmt(self, while_loc, test, while_colon_loc, body, else_opt): """while_stmt: 'while' test ':' suite ['else' ':' suite]""" stmt = ast.While(test=test, body=body, orelse=[], keyword_loc=while_loc, while_colon_loc=while_colon_loc, else_loc=None, e...
while_stmt: 'while' test ':' suite ['else' ':' suite]
Below is the the instruction that describes the task: ### Input: while_stmt: 'while' test ':' suite ['else' ':' suite] ### Response: def while_stmt(self, while_loc, test, while_colon_loc, body, else_opt): """while_stmt: 'while' test ':' suite ['else' ':' suite]""" stmt = ast.While(test=test, body=b...
def filter_clades(self): "Remove conflicting clades and those < cutoff to get majority rule" passed = [] carrs = np.array([list(i[0]) for i in self.clade_counts], dtype=int) freqs = np.array([i[1] for i in self.clade_counts]) for idx in range(carrs.shape[0]): conflic...
Remove conflicting clades and those < cutoff to get majority rule
Below is the the instruction that describes the task: ### Input: Remove conflicting clades and those < cutoff to get majority rule ### Response: def filter_clades(self): "Remove conflicting clades and those < cutoff to get majority rule" passed = [] carrs = np.array([list(i[0]) for i in sel...
def exec_cmd(self, command, **kwargs): """Normal save and load only need the command. To merge, just supply the merge and file arguments as kwargs like so: exec_cmd('load', merge=True, file='/path/to/file.txt') """ if command == 'load': if kwargs: kw...
Normal save and load only need the command. To merge, just supply the merge and file arguments as kwargs like so: exec_cmd('load', merge=True, file='/path/to/file.txt')
Below is the the instruction that describes the task: ### Input: Normal save and load only need the command. To merge, just supply the merge and file arguments as kwargs like so: exec_cmd('load', merge=True, file='/path/to/file.txt') ### Response: def exec_cmd(self, command, **kwargs): """...
def wait_for_focus(self, title, timeOut=5): """ Wait for window with the given title to have focus Usage: C{window.wait_for_focus(title, timeOut=5)} If the window becomes active, returns True. Otherwise, returns False if the window has not become active by the t...
Wait for window with the given title to have focus Usage: C{window.wait_for_focus(title, timeOut=5)} If the window becomes active, returns True. Otherwise, returns False if the window has not become active by the time the timeout has elapsed. @param title: titl...
Below is the the instruction that describes the task: ### Input: Wait for window with the given title to have focus Usage: C{window.wait_for_focus(title, timeOut=5)} If the window becomes active, returns True. Otherwise, returns False if the window has not become active by ...
def make_python_identifier(string, namespace=None, reserved_words=None, convert='drop', handle='force'): """ Takes an arbitrary string and creates a valid Python identifier. If the input string is in the namespace, return its value. If the python identifier created is alread...
Takes an arbitrary string and creates a valid Python identifier. If the input string is in the namespace, return its value. If the python identifier created is already in the namespace, but the input string is not (ie, two similar strings resolve to the same python identifier) or if the identifie...
Below is the the instruction that describes the task: ### Input: Takes an arbitrary string and creates a valid Python identifier. If the input string is in the namespace, return its value. If the python identifier created is already in the namespace, but the input string is not (ie, two similar string...
def Reset(self): """Reset the camera back to its defaults.""" self.pan = self.world_center self.desired_pan = self.pos
Reset the camera back to its defaults.
Below is the the instruction that describes the task: ### Input: Reset the camera back to its defaults. ### Response: def Reset(self): """Reset the camera back to its defaults.""" self.pan = self.world_center self.desired_pan = self.pos
def median_kneighbour_distance(X, k=5): """ Calculate the median kneighbor distance. Find the distance between a set of random datapoints and their kth nearest neighbours. This is a heuristic for setting the kernel length scale. """ N_all = X.shape[0] k = min(k, N_all) N_subset = mi...
Calculate the median kneighbor distance. Find the distance between a set of random datapoints and their kth nearest neighbours. This is a heuristic for setting the kernel length scale.
Below is the the instruction that describes the task: ### Input: Calculate the median kneighbor distance. Find the distance between a set of random datapoints and their kth nearest neighbours. This is a heuristic for setting the kernel length scale. ### Response: def median_kneighbour_distance(X, k=5)...
def get_color_names(self, format_string): """ Parses the format_string and returns a set of color names. """ names = set() # Tokenize the format string and process them for token in self.tokens(format_string): if token.group("command"): name = ...
Parses the format_string and returns a set of color names.
Below is the the instruction that describes the task: ### Input: Parses the format_string and returns a set of color names. ### Response: def get_color_names(self, format_string): """ Parses the format_string and returns a set of color names. """ names = set() # Tokenize the...
def setCurrentRegItem(self, regItem): """ Sets the current item to the regItem """ check_class(regItem, ClassRegItem, allow_none=True) self.tableView.setCurrentRegItem(regItem)
Sets the current item to the regItem
Below is the the instruction that describes the task: ### Input: Sets the current item to the regItem ### Response: def setCurrentRegItem(self, regItem): """ Sets the current item to the regItem """ check_class(regItem, ClassRegItem, allow_none=True) self.tableView.setCurrentRegItem...
def _set_dense_defaults_and_eval(kwargs): """ Sets default values in kwargs if kwargs are not already given. Evaluates all values using eval Parameters ----------- kwargs : dict Dictionary of dense specific keyword args Returns ------- : dict Default, evaluated dic...
Sets default values in kwargs if kwargs are not already given. Evaluates all values using eval Parameters ----------- kwargs : dict Dictionary of dense specific keyword args Returns ------- : dict Default, evaluated dictionary
Below is the the instruction that describes the task: ### Input: Sets default values in kwargs if kwargs are not already given. Evaluates all values using eval Parameters ----------- kwargs : dict Dictionary of dense specific keyword args Returns ------- : dict Default...