text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def get_term_by_name(self, name):
"""Get the GO term with the given GO term name.
If the given name is not associated with any GO term, the function will
search for it among synonyms.
Parameters
----------
name: str
The name of the GO term.
Returns
... | 0.001727 |
def nacm_rule_list_rule_module_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
nacm = ET.SubElement(config, "nacm", xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-acm")
rule_list = ET.SubElement(nacm, "rule-list")
name_key = ET.SubElement(r... | 0.004172 |
def get_api_key_form(userfilter={}):
"""
userfileter: when binding api key with user, filter some users if necessary
"""
class APIKeyForm(ModelForm):
class Meta:
model = APIKeys
exclude = ("apitree",)
user = forms.ModelChoiceField(queryset=get_user_model().objects... | 0.004785 |
async def _analog_message(self, data):
"""
This is a private message handler method.
It is a message handler for analog messages.
:param data: message data
:returns: None - but saves the data in the pins structure
"""
pin = data[0]
value = (data[PrivateC... | 0.002871 |
def midpoint_refine_triangulation_by_vertices(self, vertices):
"""
return points defining a refined triangulation obtained by bisection of all edges
in the triangulation connected to any of the vertices in the list provided
"""
mlons, mlats = self.segment_midpoints_by_vertices(v... | 0.008247 |
def return_hdr(ts, package):
"""
Hand back the hdr - duh - if the pkg is foobar handback None
Shamelessly stolen from Seth Vidal
http://yum.baseurl.org/download/misc/checksig.py
"""
try:
fdno = os.open(package, os.O_RDONLY)
except OSError:
hdr = None
return hdr
t... | 0.001695 |
def RemoveAllClientLabels(self, client_id):
"""Removes all labels for a given client.
Args:
client_id: The client_id.
"""
labels_to_remove = set(
[l.name for l in data_store.REL_DB.ReadClientLabels(client_id)])
self.RemoveClientLabels(client_id, labels_to_remove) | 0.006711 |
def compare_overlaps(context: list, synsets_signatures: dict,
nbest=False, keepscore=False, normalizescore=False) -> "wn.Synset":
"""
Calculates overlaps between the context sentence and the synset_signture
and returns a ranked list of synsets from highest overlap to lowest.
:param... | 0.006508 |
def _prm_write_dict_as_table(self, key, data_to_store, group, fullname, **kwargs):
"""Stores a python dictionary as pytable
:param key:
Name of data item to store
:param data_to_store:
Dictionary to store
:param group:
Group node where to store d... | 0.00462 |
def _parse_eval_args(self,*args,**kwargs):
"""
NAME:
_parse_eval_args
PURPOSE:
Internal function to parse the arguments given for an action/frequency/angle evaluation
INPUT:
OUTPUT:
HISTORY:
2010-07-11 - Written - Bovy (NYU)
"""
... | 0.027816 |
def rehearse(
folders, references, handler,
repeat=0, roles=1, strict=False,
loop=None
):
"""Cast a set of objects into a sequence of scene scripts. Deliver the performance.
:param folders: A sequence of
:py:class:`turberfield.dialogue.model.SceneScript.Folder` objects.
:param reference... | 0.00171 |
def to_csv(self, datadir=None, sep=None, cycles=False, raw=True,
summary=True, shifted=False,
method=None, shift=0.0,
last_cycle=None):
"""Saves the data as .csv file(s).
Args:
datadir: folder where to save the data (uses current folder if not
... | 0.001408 |
def leave_chat(
self,
chat_id: Union[int, str],
delete: bool = False
):
"""Use this method to leave a group chat or channel.
Args:
chat_id (``int`` | ``str``):
Unique identifier for the target chat or username of the target channel/supergroup
... | 0.004386 |
def parseFASTAEditingCommandLineOptions(args, reads):
"""
Examine parsed FASTA editing command-line options and return information
about kept sites and sequences.
@param args: An argparse namespace, as returned by the argparse
C{parse_args} function.
@param reads: A C{Reads} instance to fil... | 0.000469 |
def master_address(self, name):
"""Returns a (host, port) pair for the given ``name``."""
fut = self.execute(b'get-master-addr-by-name', name, encoding='utf-8')
return wait_convert(fut, parse_address) | 0.008929 |
def addDerivesFrom(self, child_id, parent_id):
"""
We add a derives_from relationship between the child and parent id.
Examples of uses include between:
an allele and a construct or strain here,
a cell line and it's parent genotype. Adding the parent and child to
the gra... | 0.003373 |
def from_epw_file(cls, epwfile, timestep=1):
"""Create a wea object using the solar irradiance values in an epw file.
Args:
epwfile: Full path to epw weather file.
timestep: An optional integer to set the number of time steps per hour.
Default is 1 for one value ... | 0.003989 |
def bounding_box(self, factor=10.0):
"""Tuple defining the default ``bounding_box`` limits,
``(x_low, x_high)``.
.. math::
x_{\\textnormal{low}} = 0
x_{\\textnormal{high}} = \\log(\\lambda_{\\textnormal{max}} \\;\
(1 + \\textnormal{factor}))
Parame... | 0.003984 |
def check_module_usage(modpath_patterns):
"""
FIXME: not fully implmented
Desired behavior is ---
Given a set of modules specified by a list of patterns, returns how the
functions defined in the modules are called: a) with themselves and b) by
other files in the project not in the given set.
... | 0.001967 |
def adj_nodes_ali(ali_nodes):
"""Adjust details specific to AliCloud."""
for node in ali_nodes:
node.cloud = "alicloud"
node.cloud_disp = "AliCloud"
node.private_ips = ip_to_str(node.extra['vpc_attributes']['private_ip_address'])
node.public_ips = ip_to_str(node.public_ips)
... | 0.003891 |
def output(self):
"""!
@brief Returns output dynamic of the network.
"""
if (self.__ccore_legion_dynamic_pointer is not None):
return wrapper.legion_dynamic_get_output(self.__ccore_legion_dynamic_pointer);
return self.__output; | 0.022654 |
def create_issue(project,
summary,
description,
template_engine='jinja',
context=None,
defaults=None,
saltenv='base',
issuetype='Bug',
priority='Normal',
labels=None,
... | 0.002554 |
def format(self, maxline=0, pstyle='v', nline=None, extend=True):
""" Formats fit output details into a string for printing.
The output tabulates the ``chi**2`` per degree of freedom of the fit
(``chi2/dof``), the number of degrees of freedom, the ``Q`` value of
the fit (ie, p-value), ... | 0.003104 |
def disable_pow_check(chain_class: Type[BaseChain]) -> Type[BaseChain]:
"""
Disable the proof of work validation check for each of the chain's vms.
This allows for block mining without generation of the proof of work seal.
.. note::
blocks mined this way will not be importable on any chain tha... | 0.001854 |
def get_access_token_from_cli():
'''Get an Azure authentication token from CLI's cache.
Will only work if CLI local cache has an unexpired auth token (i.e. you ran 'az login'
recently), or if you are running in Azure Cloud Shell (aka cloud console)
Returns:
An Azure authentication token st... | 0.007278 |
def get_duplicates(self):
"""
Extract duplicated index elements.
.. deprecated:: 0.23.0
Use idx[idx.duplicated()].unique() instead
Returns a sorted list of index elements which appear more than once in
the index.
Returns
-------
array-like
... | 0.000964 |
def _check_start_timestamp(self):
"""Check that starting timestamp exists for cumulative metrics."""
if self.descriptor.type in (
metric_descriptor.MetricDescriptorType.CUMULATIVE_INT64,
metric_descriptor.MetricDescriptorType.CUMULATIVE_DOUBLE,
metric_desc... | 0.003268 |
def from_analysis_period(cls, analysis_period, clearness=1,
daylight_savings_indicator='No'):
""""Initialize a OriginalClearSkyCondition from an analysis_period"""
_check_analysis_period(analysis_period)
return cls(analysis_period.st_month, analysis_period.st_day, cl... | 0.008 |
def _get_dvs_portgroup(dvs, portgroup_name):
'''
Return a portgroup object corresponding to the portgroup name on the dvs
:param dvs: DVS object
:param portgroup_name: Name of portgroup to return
:return: Portgroup object
'''
for portgroup in dvs.portgroup:
if portgroup.name == port... | 0.002653 |
def Max(left: vertex_constructor_param_types, right: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
"""
Finds the maximum between two vertices
:param left: one of the vertices to find the maximum of
:param right: one of the vertices to find the maximum of
"""
return D... | 0.014252 |
def _get_containing_contigs(self, hits_dict):
'''Given dictionary of nucmer hits (made by self._load_nucmer_hits()), returns a dictionary.
key=contig name. Value = set of contigs that contain the key.'''
containing = {}
for qry_name in hits_dict:
d = self._containing_cont... | 0.006897 |
def find(self, query=None, func=None, labels=None, colors=None, pinned=None, archived=None, trashed=False): # pylint: disable=too-many-arguments
"""Find Notes based on the specified criteria.
Args:
query (Union[_sre.SRE_Pattern, str, None]): A str or regular expression to match against the ... | 0.009259 |
def apply_order(self):
'''Naively apply query orders.'''
self._ensure_modification_is_safe()
if len(self.query.orders) > 0:
self._iterable = Order.sorted(self._iterable, self.query.orders) | 0.009662 |
def _clean(cls, value, invalid):
"""Deprecated. See BlockUsageLocator._clean"""
cls._deprecation_warning()
return BlockUsageLocator._clean(value, invalid) | 0.011236 |
def main(self, argv=None, exit=True):
"""
Shortcut for running a command.
See :meth:`guacamole.recipes.Recipe.main()` for details.
"""
return CommandRecipe(self).main(argv, exit) | 0.009132 |
def document_iter(self, context):
"""
Iterates over all the elements in an iterparse context
(here: <document> elements) and yields an URMLDocumentGraph instance
for each of them. For efficiency, the elements are removed from the
DOM / main memory after processing them.
... | 0.003018 |
def parse(self, declaration):
"""
Parse sql type declaration, e.g. varchar(10) and return instance of corresponding type class,
e.g. VarCharType(10)
@param declaration: Sql declaration to parse, e.g. varchar(10)
@return: instance of SqlTypeMetaclass
"""
declarati... | 0.005217 |
def log_K(Z, X, t):
"""
Log K
Log of the proposal probability density function for gnm
Inputs :
Z :
proposed to
x :
proposed from
Outputs :
log of the probability density function
"""
m, L = update_params(X, t)
z = Z['x']
retur... | 0.013624 |
def debug_log(
self, no_tail=False, exclude_module=None, include_module=None,
include=None, level=None, limit=0, lines=10, replay=False,
exclude=None):
"""Get log messages for this model.
:param bool no_tail: Stop after returning existing log messages
:param ... | 0.001837 |
def remove(self, iterable, data=None, index=0):
"""Remove an element from the trie
Args
iterable(hashable): key used to find what is to be removed
data(object): data associated with the key
index(int): index of what is to me removed
Returns:
bool:
... | 0.003018 |
def _create_and_send_json_bulk(self, payload, req_url, request_type="POST"):
"""Create a json, do a request to the URL and process the response.
:param list payload: contains the informations necessary for the action.
It's a list of dictionnary.
:param str req_url: URL to request with the payload.
... | 0.006325 |
def parse_vtrgb(path='/etc/vtrgb'):
''' Parse the color table for the Linux console. '''
palette = ()
table = []
try:
with open(path) as infile:
for i, line in enumerate(infile):
row = tuple(int(val) for val in line.split(','))
table.append(row)
... | 0.00188 |
def to_api_repr(self):
"""Construct JSON API representation for the parameter.
:rtype: dict
:returns: JSON mapping
"""
s_types = {}
values = {}
for name, value in self.struct_values.items():
type_ = self.struct_types[name]
if type_ in ("ST... | 0.001741 |
def remove_comments(tokens):
"""
Removes comments from *tokens* which is expected to be a list equivalent of
tokenize.generate_tokens() (so we can update in-place).
.. note::
* If the comment makes up the whole line, the newline will also be removed (so you don't end up with lots of blank line... | 0.006831 |
def run(self, steps=None, ipyclient=None, force=False, quiet=False):
"""
Submits an ordered list of jobs to a load-balancer to complete
the following tasks, and reports a progress bar:
(1) Write nexus files for each locus
(2) Run mrBayes on each locus to get a posterior of gene ... | 0.005671 |
def call_method_async(self, method_name_or_object, params=None):
"""
Calls the ``method_name`` method from the given service asynchronously
and returns a :py:class:`gemstone.client.structs.AsyncMethodCall` instance.
:param method_name_or_object: The name of te called method or a ``Metho... | 0.008724 |
def get_app(opts):
'''
Returns a WSGI app and a configuration dictionary
'''
apiopts = opts.get(__name__.rsplit('.', 2)[-2], {}) # rest_cherrypy opts
# Add Salt and salt-api config options to the main CherryPy config dict
cherrypy.config['saltopts'] = opts
cherrypy.config['apiopts'] = apio... | 0.002257 |
def open(server=None, url=None, ip=None, port=None, name=None, https=None, auth=None, verify_ssl_certificates=True,
proxy=None, cookies=None, verbose=True, _msgs=None):
r"""
Establish connection to an existing H2O server.
The connection is not kept alive, so what this method actual... | 0.006174 |
def load_and_init(self, modules):
"""Import, instantiate & "init" the modules we manage
:param modules: list of the managed modules
:return: True if no errors
"""
self.load(modules)
self.get_instances()
return len(self.configuration_errors) == 0 | 0.006601 |
def walk(self, leavesonly=True, maxdepth=None, _depth = 0):
"""Depth-first search, walking through trie, returning all encounterd nodes (by default only leaves)"""
if self.children:
if not maxdepth or (maxdepth and _depth < maxdepth):
for key, child in self.children.items():
... | 0.011009 |
def sendFMS_same(self, CorpNum, PlusFriendID, Sender, Content, AltContent, AltSendType, SndDT, FilePath, ImageURL,
KakaoMessages, KakaoButtons, AdsYN=False, UserID=None, RequestNum=None):
"""
친구톡 이미지 대량 전송
:param CorpNum: 팝빌회원 사업자번호
:param PlusFriendID: 플러스친구 아이디
... | 0.001994 |
def sim_typo(
src, tar, metric='euclidean', cost=(1, 1, 0.5, 0.5), layout='QWERTY'
):
"""Return the normalized typo similarity between two strings.
This is a wrapper for :py:meth:`Typo.sim`.
Parameters
----------
src : str
Source string for comparison
tar : str
Target strin... | 0.00075 |
def rgb_to_ansi(color):
"""
Converts hex RGB to the 6x6x6 xterm color space
Args:
color (str): RGB color string in the format "#RRGGBB"
Returns:
str: ansi color string in the format "ansi_n", where n
is between 16 and 230
Reference:
... | 0.002519 |
def tz_file(name):
"""
Open a timezone file from the zoneinfo subdir for reading.
:param name: The name of the timezone.
:type name: str
:rtype: file
"""
try:
filepath = tz_path(name)
return open(filepath, 'rb')
except TimezoneNotFound:
# http://bugs.launchpad.... | 0.00123 |
def get_service():
"""Load the configured service."""
global _SERVICE_MANAGER
if _SERVICE_MANAGER is None:
_SERVICE_MANAGER = driver.DriverManager(
namespace='tvrenamer.data.services',
name=cfg.CONF.lookup_service,
invoke_on_load=True)
return _SERVICE_MANAGER... | 0.003058 |
def instantiate(self, params):
"""
Allows you to fetch the map tiles of a created map
:param params: The json with the styling info for the named map
:type params: dict
:return:
:raise: CartoException
"""
try:
self.send(self.Meta.collection_... | 0.004149 |
def indicate_fulfillment_fcp(self, wwpn, lun, host_port):
"""
Indicate completion of :term:`fulfillment` for this FCP storage volume
and provide identifying information (WWPN and LUN) about the actual
storage volume on the storage subsystem.
Manually indicating fulfillment is re... | 0.000695 |
def fork(self,name):
'''
Create fork and store it in current instance
'''
fork=deepcopy(self)
self[name]=fork
return fork | 0.029586 |
def get_db(cls):
"""Return the database for the collection"""
if cls._db:
return getattr(cls._client, cls._db)
return cls._client.get_default_database() | 0.010638 |
def delete(self, story, params={}, **options):
"""Deletes a story. A user can only delete stories they have created. Returns an empty data record.
Parameters
----------
story : {Id} Globally unique identifier for the story.
"""
path = "/stories/%s" % (story)
ret... | 0.010899 |
def start(self, labels=None):
"""Start specified timer(s).
Parameters
----------
labels : string or list, optional (default None)
Specify the label(s) of the timer(s) to be started. If it is
``None``, start the default timer with label specified by the
``df... | 0.002732 |
def delete_knowledge_base(project_id, knowledge_base_id):
"""Deletes a specific Knowledge base.
Args:
project_id: The GCP project linked with the agent.
knowledge_base_id: Id of the Knowledge base."""
import dialogflow_v2beta1 as dialogflow
client = dialogflow.KnowledgeBasesClient()
... | 0.001887 |
def regex_condition(func):
"""
If a condition is given as string instead of a function, it is turned
into a regex-matching function.
"""
@wraps(func)
def regex_condition_wrapper(condition, *args, **kwargs):
if isinstance(condition, string_types):
condition = maybe | partial(r... | 0.00237 |
def _dispatch(self, textgroup, directory):
""" Run the dispatcher over a textgroup.
:param textgroup: Textgroup object that needs to be dispatched
:param directory: Directory in which the textgroup was found
"""
if textgroup.id in self.dispatcher.collection:
self.dis... | 0.003101 |
def handle_parse_result(self, ctx, opts, args):
""" Save value for this option in configuration
if key/value pair doesn't already exist.
Or old value in config was deprecated
it needs to be updated to the new value format
but the value keeps the same "meaning"
"""
... | 0.001994 |
def _config_parser_to_defaultdict(config_parser):
"""Convert a ConfigParser to a defaultdict.
Args:
config_parser (ConfigParser): A ConfigParser.
"""
config = defaultdict(defaultdict)
for section, section_content in config_parser.items():
if section != 'DEFAULT':
for opt... | 0.002283 |
def __loadindcomps(self):
''' import industry comps '''
csv_path = os.path.join(os.path.dirname(__file__), self.stock_no_files)
with open(csv_path) as csv_file:
csv_data = csv.reader(csv_file)
result = {}
check_words = re.compile(r'^[\d]{2,}[\w]?')
... | 0.002778 |
def search_tagged_source_for_facet(self, facet, **kwargs): # noqa: E501
"""Lists the values of a specific facet over the customer's sources # noqa: E501
# noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=... | 0.001919 |
def main():
""" Main entry point of the CLI. """
try:
args = sys.argv[1:]
try:
_, args = getopt.getopt(args, MAIN_OPTS, MAIN_LONG_OPTS)
except getopt.GetoptError as e:
error(str(e))
sys.exit(1)
if args[0] == 'prompt':
try:
... | 0.002387 |
def on_message(self, opcode, message):
"""
The primary dispatch function to handle incoming WebSocket messages.
:param int opcode: The opcode of the message that was received.
:param bytes message: The data contained within the message.
"""
self.logger.debug("processing {0} (opcode: 0x{1:02x}) message".for... | 0.031475 |
def pair_tree_creator(meta_id):
"""Splits string into a pairtree path."""
chunks = []
for x in range(0, len(meta_id)):
if x % 2:
continue
if (len(meta_id) - 1) == x:
chunk = meta_id[x]
else:
chunk = meta_id[x: x + 2]
chunks.append(chunk)
... | 0.002732 |
def rolling_max(self, window_start, window_end, min_observations=None):
"""
Calculate a new SArray of the maximum value of different subsets over
this SArray.
The subset that the maximum is calculated over is defined as an
inclusive range relative to the position to each value i... | 0.001655 |
def post_address_subcommand(search_terms, vcard_list, parsable):
"""Print a contact table. with all postal / mailing addresses
:param search_terms: used as search term to filter the contacts before
printing
:type search_terms: str
:param vcard_list: the vcards to search for matching entries whi... | 0.001937 |
def generate_s3_bucket():
"""Create the blockade bucket if not already there."""
logger.debug("[#] Setting up S3 bucket")
client = boto3.client("s3", region_name=PRIMARY_REGION)
buckets = client.list_buckets()
matches = [x for x in buckets.get('Buckets', list())
if x['Name'].startswit... | 0.001473 |
def selected_objects(self):
"""Filter out objects outside table boundaries"""
return [
obj
for obj in self.text_objects
if contains_or_overlap(self.table_bbox, obj.bbox)
] | 0.008621 |
def add(self, member_name, collection_name='', parent=None, uid='',
**kwargs):
"""
:param member_name: singular name of the resource. It should be the
appropriate singular version of the resource given your locale
and used with members of the collection.
:par... | 0.000648 |
def state_length(state, size):
"""Check that the state is the given size."""
if len(state) != size:
raise ValueError('Invalid state: there must be one entry per '
'node in the network; this state has {} entries, but '
'there are {} nodes.'.format(len(sta... | 0.002882 |
def create_action_token(self, action, expires_in):
"""
Create a url safe action token attached to the user
:param action:
:param expires_in:
:return:
"""
return utils.sign_url_safe(self.user.id,
secret_key=get_jwt_secret(),
... | 0.004762 |
def update(self, E=None, **F):
"""
D.update([E, ]**F) -> None. Update D from dict/iterable E and F.
If E present and has a .keys() method, does: for k in E: D[k] = E[k]
If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
In either case, this is followe... | 0.007533 |
def _publish_metrics(self, name, prev_keys, key, data):
"""Recursively publish keys"""
value = data[key]
keys = prev_keys + [key]
if isinstance(value, dict):
for new_key in value:
self._publish_metrics(name, keys, new_key, value)
elif isinstance(value,... | 0.003086 |
def with_labels(self, selectable, base=None, **mapper_args):
"""Map a selectable directly, wrapping the
selectable in a subquery with labels.
The class and its mapping are not cached and will
be discarded once dereferenced (as of 0.6.6).
:param selectable: an :func:`.expressio... | 0.005061 |
def add_ignored(self, ignored):
"""Add ignored text to the node. This will add the length of the ignored text to the node's
consumed property.
"""
if ignored:
if self.ignored:
self.ignored = ignored + self.ignored
else:
self.ignored = ignored
self.consumed += len(ignored... | 0.012461 |
def parse(readDataInstance, sectionHeadersInstance):
"""
Returns a new L{Sections} object.
@type readDataInstance: L{ReadData}
@param readDataInstance: A L{ReadData} object with data to be parsed as a L{Sections} object.
@type sectionHeadersInstance: instance
... | 0.011229 |
def has_role(self, identifiers, role_s, log_results=True):
"""
:param identifiers: a collection of identifiers
:type identifiers: subject_abcs.IdentifierCollection
:param role_s: a collection of 1..N Role identifiers
:type role_s: Set of String(s)
:param log_results: ... | 0.001465 |
def get_default_config(self):
"""
Returns the default collector settings
"""
config = super(PuppetDBCollector, self).get_default_config()
config.update({
'host': 'localhost',
'port': 8080,
'path': 'PuppetDB',
})
return config | 0.006309 |
def validate(self,
asset,
amount,
portfolio,
algo_datetime,
algo_current_data):
"""
Fail if the given order would cause the magnitude of our position to be
greater in shares than self.max_shares or greater in do... | 0.006108 |
def pop(self, queue_name):
"""
Pops a task off the queue.
:param queue_name: The name of the queue. Usually handled by the
``Gator`` instance.
:type queue_name: string
:returns: The data for the task.
:rtype: string
"""
task_id = self.conn.lp... | 0.004695 |
def endpoint_update(**kwargs):
"""
Executor for `globus endpoint update`
"""
# validate params. Requires a get call to check the endpoint type
client = get_client()
endpoint_id = kwargs.pop("endpoint_id")
get_res = client.get_endpoint(endpoint_id)
if get_res["host_endpoint_id"]:
... | 0.001188 |
def set_pay_mch(self, mchid, s_pappid):
"""
关联商户号与开票平台,设置支付后开票
详情请参考
https://mp.weixin.qq.com/wiki?id=mp1496561731_2Z55U
:param mchid: 微信支付商户号
:param s_pappid: 开票平台在微信的标识号,商户需要找开票平台提供
"""
return self._post(
'setbizattr',
params={
... | 0.00365 |
def notify_txn_invalid(self, txn_id, message=None, extended_data=None):
"""Adds a batch id to the invalid cache along with the id of the
transaction that was rejected and any error message or extended data.
Removes that batch id from the pending set. The cache is only
temporary, and the ... | 0.001517 |
def output(self, context, *args, **kwargs):
"""
Allow all readers to use eventually use output_fields XOR output_type options.
"""
output_fields = self.output_fields
output_type = self.output_type
if output_fields and output_type:
raise UnrecoverableError("... | 0.007042 |
def is_reserved_ip(self, ip):
"""Check if the given ip address is in a reserved ipv4 address space.
:param ip: ip address
:return: boolean
"""
theip = ipaddress(ip)
for res in self._reserved_netmasks:
if theip in ipnetwork(res):
return True
... | 0.005917 |
def set_options(self, option_type, option_dict, force_options=False):
"""set plot options """
if force_options:
self.options[option_type].update(option_dict)
elif (option_type == 'yAxis' or option_type == 'xAxis') and isinstance(option_dict, list):
# For multi-Axis
... | 0.010856 |
def form_valid(self, forms):
"""
If the form is valid, save the associated model.
"""
for key, form in forms.items():
setattr(self, '{}_object'.format(key), form.save())
return super(MultipleModelFormMixin, self).form_valid(forms) | 0.007092 |
def predict_is(self, h=5, fit_once=True, fit_method='MLE', intervals=False, **kwargs):
""" Makes dynamic in-sample predictions with the estimated model
Parameters
----------
h : int (default : 5)
How many steps would you like to forecast?
fit_once : boolean
... | 0.008661 |
def _flush_decoder(self):
"""
Flushes the decoder. Should only be called if the decoder is actually
being used.
"""
if self._decoder:
buf = self._decoder.decompress(b'')
return buf + self._decoder.flush()
return b'' | 0.006944 |
def _fetch_all_error_message(self, response):
"""
:type response: requests.Response
:rtype: list[str]
"""
response_content_string = response.content.decode()
try:
error_dict = converter.json_to_class(dict, response_content_string)
return self._... | 0.004673 |
def get_context_hints_per_source(context_renderers):
"""
Given a list of context renderers, return a dictionary of context hints per source.
"""
# Merge the context render hints for each source as there can be multiple context hints for
# sources depending on the render target. Merging them together... | 0.006633 |
def dim(self):
"""
NAME:
dim
PURPOSE:
return the dimension of the Orbit
INPUT:
(none)
OUTPUT:
dimension
HISTORY:
2011-02-03 - Written - Bovy (NYU)
"""
if len(self._orb.vxvv) == 2:
... | 0.00396 |
def count(self, seqs, nreport=100, scan_rc=True):
"""
count the number of matches above the cutoff
returns an iterator of lists containing integer counts
"""
for matches in self.scan(seqs, nreport, scan_rc):
counts = [len(m) for m in matches]
yield counts | 0.00627 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.