text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def artist_create(self, name, other_names_comma=None, group_name=None,
url_string=None, body=None):
"""Function to create an artist (Requires login) (UNTESTED).
Parameters:
name (str):
other_names_comma (str): List of alternative names for this
... | 0.002907 |
async def handle_frame(self, frame):
"""Handle incoming API frame, return True if this was the expected frame."""
if not isinstance(frame, FrameHouseStatusMonitorDisableConfirmation):
return False
self.success = True
return True | 0.011029 |
def translate(self):
'''Returns a Fasta sequence, translated into amino acids. Starts translating from 'frame', where frame expected to be 0,1 or 2'''
fa = super().translate()
return Fastq(fa.id, fa.seq, 'I'*len(fa.seq)) | 0.012295 |
def MOVS(self, params):
"""
MOVS Ra, Rb
MOVS Ra, #imm8
Move the value of Rb or imm8 into Ra
Ra and Rb must be low registers
"""
Ra, Rb = self.get_two_parameters(self.TWO_PARAMETER_COMMA_SEPARATED, params)
if self.is_immediate(Rb):
self.check_... | 0.004246 |
def run(self):
"""
This function executes planarRad using the batch file.
"""
"""
Error when planarRad start : /bin/sh: 1: ../planarrad.py: not found
"""
print('Executing planarrad')
# If we are not in the reverse_mode :
if self.ui.tabWidget.curre... | 0.005512 |
def getFormattedHTML(self, indent=' '):
'''
getFormattedHTML - Get formatted and xhtml of this document, replacing the original whitespace
with a pretty-printed version
@param indent - space/tab/newline of each level of indent, or integer for how many spaces per level
... | 0.009296 |
def get_relationships_by_genus_type_for_destination(self, destination_id=None, relationship_genus_type=None):
"""Gets a ``RelationshipList`` corresponding to the given peer ``Id`` and relationship genus ``Type.
Relationships`` of any genus derived from the given genus are
returned.
In ... | 0.002173 |
def main(output=None, error=None, verbose=False):
""" The main (cli) interface for the pylint runner. """
runner = Runner(args=["--verbose"] if verbose is not False else None)
runner.run(output, error) | 0.004695 |
def connect_nodes(nodes):
"""Connect the nodes in a list linearly."""
for n, next_node in zip(nodes, nodes[1:]):
if isinstance(n, ControlFlowNode):
_connect_control_flow_node(n, next_node)
elif isinstance(next_node, ControlFlowNode):
n.connect(next_node.test)
elif... | 0.002024 |
def config_status():
""" Check config status in an account.
"""
s = boto3.Session()
client = s.client('config')
channels = client.describe_delivery_channel_status()[
'DeliveryChannelsStatus']
for c in channels:
print(yaml.safe_dump({
c['name']: dict(
s... | 0.001471 |
def verify_certificate_issuer(self, certificate_issuer_id, **kwargs): # noqa: E501
"""Verify certificate issuer. # noqa: E501
A utility API that can be used to validate the user configuration before activating a certificate issuer. Verifies that the certificate issuer is accessible and can be used to... | 0.001172 |
async def purgeQueues(self, *args, **kwargs):
"""
Purge the SQS queues
This method is only for debugging the ec2-manager
This method is ``experimental``
"""
return await self._makeApiCall(self.funcinfo["purgeQueues"], *args, **kwargs) | 0.010526 |
def filtered(w=250):
"""
In this example we filter the image into several channels using gabor filters. L6 activity is used to select
one of those channels. Only activity selected by those channels burst.
"""
# prepare filter bank kernels
kernels = []
for theta in range(4):
theta = theta / 4. * np.pi
... | 0.014988 |
def _represent_undefined(self, data):
"""Raises flag for objects that cannot be represented"""
raise RepresenterError(
_format("Cannot represent an object: {0!A} of type: {1}; "
"yaml_representers: {2!A}, "
"yaml_multi_representers: {3!A}",
data, type(data... | 0.002457 |
def do_rename(argdict):
'''Rename a page.'''
site = make_site_obj(argdict)
slug = argdict['slug']
newtitle = argdict['newtitle']
try:
site.rename_page(slug, newtitle)
print "Renamed page."
except ValueError: # pragma: no cover
print "Cannot rename. A page with the given s... | 0.005571 |
def get_content (self):
"""Precondition: url_connection is an opened URL."""
if self.data is None:
log.debug(LOG_CHECK, "Get content of %r", self.url)
t = time.time()
self.data = self.read_content()
self.size = len(self.data)
self.dltime = time... | 0.00678 |
def permission_required_raise(perm, login_url=None, raise_exception=True):
"""
A permission_required decorator that raises by default.
"""
return permission_required(perm, login_url=login_url, raise_exception=raise_exception) | 0.008299 |
def forms(self, req, tag):
"""
Make and return some forms, using L{self.parameter.getInitialLiveForms}.
@return: some subforms.
@rtype: C{list} of L{LiveForm}
"""
liveForms = self.parameter.getInitialLiveForms()
for liveForm in liveForms:
liveForm.set... | 0.008219 |
def gen_cert_request(filepath, keyfile, config, silent=False):
"""
generate certificate request
:param filepath: file path to the certificate request
:param keyfile: file path to the private key
:param silent: whether to suppress output
"""
message = 'generate ssl certificate request'
cm... | 0.001938 |
def clone_with_new_elements(self, new_elements):
"""
Create another VariantCollection of the same class and with
same state (including metadata) but possibly different entries.
Warning: metadata is a dictionary keyed by variants. This method
leaves that dictionary as-is, which m... | 0.003976 |
def _check_requirements(self):
"""
Check if VPCS is available with the correct version.
"""
path = self._vpcs_path()
if not path:
raise VPCSError("No path to a VPCS executable has been set")
# This raise an error if ubridge is not available
self.ubri... | 0.003252 |
def cluster_reduce(idx, snr, window_size):
""" Reduce the events by clustering over a window
Parameters
-----------
indices: Array
The list of indices of the SNR values
snr: Array
The list of SNR value
window_size: int
The size of the window in integer samples.
Retu... | 0.001795 |
def connect_full_direct(self, config):
""" Create a fully-connected genome, including direct input-output connections. """
for input_id, output_id in self.compute_full_connections(config, True):
connection = self.create_connection(config, input_id, output_id)
self.connections[con... | 0.008696 |
def userdata_to_db(session, method='update', autocommit=False):
"""
Add catchments from a user folder to the database.
The user folder is specified in the ``config.ini`` file like this::
[import]
folder = path/to/import/folder
If this configuration key does not exist this will be sile... | 0.004794 |
def get_log_nodes(self, log_id, ancestor_levels, descendant_levels, include_siblings):
"""Gets a portion of the hierarchy for the given log.
arg: log_id (osid.id.Id): the ``Id`` to query
arg: ancestor_levels (cardinal): the maximum number of
ancestor levels to include. A v... | 0.00278 |
def get_elms(
self,
id_=None, class_name=None, name=None, tag_name=None, text=None, xpath=None,
parent_id=None, parent_class_name=None, parent_name=None, parent_tag_name=None,
css_selector=None
):
"""
Shortcut for :py:meth:`find_element* <selenium.webd... | 0.005769 |
def panel(panel_id):
"""Display (and add pending updates to) a specific gene panel."""
panel_obj = store.gene_panel(panel_id) or store.panel(panel_id)
if request.method == 'POST':
raw_hgnc_id = request.form['hgnc_id']
if '|' in raw_hgnc_id:
raw_hgnc_id = raw_hgnc_id.split(' | ', ... | 0.001773 |
def check(self):
"""Checks whether loaded yaml is well-formed according to syntax defined for
version 0.9.0 and later.
Raises:
YamlError: (containing a meaningful message) when the loaded Yaml
is not well formed
"""
if not isinstance(self.parsed_yaml,... | 0.004334 |
def shell(self, command, *args, environment=None):
"""
Runs a shell command
"""
command += ' ' + ' '.join(args)
command = command.strip()
self.debug(self.yellow_style('$ %s' % command))
env = self.env.copy()
env.update(environment or {})
return sub... | 0.005525 |
def get_account_holds(self, account_id, **kwargs):
""" Get holds on an account.
This method returns a generator which may make multiple HTTP requests
while iterating through it.
Holds are placed on an account for active orders or
pending withdraw requests.
As an order ... | 0.001158 |
def scale_context_and_center(self, cr):
"""
Scale context based on difference between bot size and widget
"""
bot_width, bot_height = self.bot_size
if self.width != bot_width or self.height != bot_height:
# Scale up by largest dimension
if self.width < sel... | 0.002139 |
def makeQ(r1, r2, r3, r4=0):
"""
matrix involved in quaternion rotation
"""
Q = np.asarray([
[r4, -r3, r2, r1],
[r3, r4, -r1, r2],
[-r2, r1, r4, r3],
[-r1, -r2, -r3, r4]])
return Q | 0.00431 |
def num_images_in_dir(path):
"""
returns the number of images in a directory
"""
num_imgs = 0
for root, dirs, files in os.walk(path):
for fname in files:
if fpath_has_imgext(fname):
num_imgs += 1
return num_imgs | 0.00369 |
def action_set(values):
"""Sets the values to be returned after the action finishes"""
cmd = ['action-set']
for k, v in list(values.items()):
cmd.append('{}={}'.format(k, v))
subprocess.check_call(cmd) | 0.004444 |
def tx_schema(self, **kwargs):
""" Builds the data structure edn, and puts it in the db
"""
for s in self.schema.schema:
tx = self.tx(s, **kwargs) | 0.018182 |
def cmd_karma_bulk(infile, jsonout, badonly, verbose):
"""Show which IP addresses are inside blacklists using the Karma online service.
Example:
\b
$ cat /var/log/auth.log | habu.extract.ipv4 | habu.karma.bulk
172.217.162.4 spamhaus_drop,alienvault_spamming
23.52.213.96 CLEAN
190.210.... | 0.003378 |
def point_consensus(self, consensus_type):
"""
Calculate grid-point statistics across ensemble members.
Args:
consensus_type: mean, std, median, max, or percentile_nn
Returns:
EnsembleConsensus containing point statistic
"""
if "mean" in consensu... | 0.00349 |
def watch_active_servings(dk_api, kitchen, period):
"""
returns a string.
:param dk_api: -- api object
:param kitchen: string
:param period: integer
:rtype: string
"""
print 'period', period
# try:
# p = int(period)
# except Va... | 0.005025 |
def specifier_to_db(db_spec):
"""
Return the database string for a database specifier.
The database specifier takes a custom format for specifying local and remote
databases. A local database is specified by the following format:
local:<db_name>
For example, a database cal... | 0.005157 |
def p_static_scalar_namespace_name(p):
'''static_scalar : namespace_name
| NS_SEPARATOR namespace_name
| NAMESPACE NS_SEPARATOR namespace_name'''
if len(p) == 2:
p[0] = ast.Constant(p[1], lineno=p.lineno(1))
elif len(p) == 3:
p[0] = ast.Constant(p[1]... | 0.002347 |
def read_py_file(filename, skip_encoding_cookie=True):
"""Read a Python file, using the encoding declared inside the file.
Parameters
----------
filename : str
The path to the file to read.
skip_encoding_cookie : bool
If True (the default), and the encoding declaration is found in t... | 0.003841 |
def get_OID_field(fs):
"""returns a featureset's object id field"""
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
desc = arcpy.Describe(fs)
if desc.hasOID:
return desc.OIDFieldName
return None | 0.007576 |
def configure_sbi():
"""Configure an SBI using POSTed configuration."""
# Need an ID for the subarray - guessing I just get
# the list of inactive subarrays and use the first
inactive_list = SubarrayList().inactive
request_data = request.data
LOG.debug('request is of type %s', type(request_data)... | 0.001307 |
def post(self):
"""
Post processing for solved systems.
Store load, generation data on buses.
Store reactive power generation on PVs and slack generators.
Calculate series flows and area flows.
Returns
-------
None
"""
if not self.solved:... | 0.002151 |
def before_create(self, context, resource):
"""
When triggered the resource which can either be uploaded or linked
to will be parsed and analysed to see if it possibly is a budget
data package resource (checking if all required headers and any of
the recommended headers exist in ... | 0.002404 |
def read(src):
'Event generator from u2 stream.'
parser, buff_agg = Parser(), ''
while True:
buff = parser.read(src)
if not buff: break # EOF
buff_agg += buff
while True:
buff_agg, ev = parser.process(buff_agg)
if ev is None: break
yield ev | 0.053846 |
def apply_format(var, format_str):
"""Format all non-iterables inside of the iterable var using the format_str
Example:
>>> print apply_format([2, [1, 4], 4, 1], '{:.1f}')
will return ['2.0', ['1.0', '4.0'], '4.0', '1.0']
"""
if isinstance(var, (list, tuple)):
new_var = map(lambda x: a... | 0.001631 |
def to_subject_id(s):
'''
to_subject_id(s) coerces the given string or number into an integer subject id. If s is not a
valid subejct id, raises an exception.
'''
if not pimms.is_number(s) and not pimms.is_str(s):
raise ValueError('invalid type for subject id: %s' % str(type(s)))
if pi... | 0.009868 |
def cloneRecord(self, existing_domain, new_domain, rtype,
zone=None, callback=None, errback=None):
"""
Clone the given record to a new record such that their configs are
identical.
:param str existing_domain: The existing record to clone
:param str new_domain... | 0.001804 |
def disk(self):
"""
Display percent of disk usage.
"""
r = self.local_renderer
r.run(r.env.disk_usage_command) | 0.013333 |
def animate(self, **kwargs):
""" Animates the surface.
This function only animates the triangulated surface. There will be no other elements, such as control points
grid or bounding box.
Keyword arguments:
* ``colormap``: applies colormap to the surface
Colormaps a... | 0.003269 |
def dict_setdiff(dict_, negative_keys):
r"""
returns a copy of dict_ without keys in the negative_keys list
Args:
dict_ (dict):
negative_keys (list):
"""
keys = [key for key in six.iterkeys(dict_)
if key not in set(negative_keys)]
subdict_ = dict_subset(dict_, keys)
... | 0.00295 |
def bvlpdu_contents(self, use_dict=None, as_class=dict):
"""Return the contents of an object as a dict."""
# make/extend the dictionary of content
if use_dict is None:
use_dict = as_class()
# save the content
use_dict.__setitem__('address', str(self.fdAddress))
... | 0.004141 |
def all_downstreams(self, node):
"""Returns a list of all nodes ultimately downstream
of the given node in the dependency graph, in
topological order.
Args:
node (str): The node whose downstream nodes you want to find.
Returns:
list: A list of nodes tha... | 0.002389 |
def minkowski(x, y, p=2):
"""Minkowski distance.
..math::
D(x, y) = \left(\sum_i |x_i - y_i|^p\right)^{\frac{1}{p}}
This is a general distance. For p=1 it is equivalent to
manhattan distance, for p=2 it is Euclidean distance, and
for p=infinity it is Chebyshev distance. In general it is be... | 0.005758 |
def migrate_2_node4():
'''
Migrate existing cozy to node4
'''
helpers.cmd_exec('npm install -g cozy-monitor cozy-controller',
show_output=True)
helpers.cmd_exec('update-cozy-stack', show_output=True)
helpers.cmd_exec('update-all', show_output=True)
helpers.cmd_exec('... | 0.000621 |
def mod_root(a, p):
""" Return a root of `a' modulo p """
if a == 0:
return 0
if not mod_issquare(a, p):
raise ValueError
n = 2
while mod_issquare(n, p):
n += 1
q = p - 1
r = 0
while not q.getbit(r):
r += 1
q = q >> r
y = pow(n, q, p)
h = q >> ... | 0.001456 |
def connectAlt(cls, redisConnectionParams):
'''
connectAlt - Create a class of this model which will use an alternate connection than the one specified by REDIS_CONNECTION_PARAMS on this model.
@param redisConnectionParams <dict> - Dictionary of arguments to redis.Redis, same as REDIS_CONNECTION_PARAMS.
@r... | 0.020134 |
def get_func_name(func):
"""Return a name which includes the module name and function name."""
func_name = getattr(func, '__name__', func.__class__.__name__)
module_name = func.__module__
if module_name is not None:
module_name = func.__module__
return '{}.{}'.format(module_name, func_n... | 0.00289 |
def get_website_configuration(self, headers=None):
"""
Returns the current status of website configuration on the bucket.
:rtype: dict
:returns: A dictionary containing a Python representation
of the XML response from S3. The overall structure is:
* WebsiteCon... | 0.002762 |
def parse_vlan_range_mappings(mappings):
"""Parse vlan range mappings.
Mappings must be a space-delimited list of provider:start:end mappings.
The start:end range is optional and may be omitted.
Returns dict of the form {provider: (start, end)}.
"""
_mappings = parse_mappings(mappings)
if... | 0.002096 |
def uclust_cluster_from_sorted_fasta_filepath(
fasta_filepath,
uc_save_filepath=None,
percent_ID=0.97,
max_accepts=1,
max_rejects=8,
stepwords=8,
word_length=8,
optimal=False,
exact=False,
suppress_sort=False,
enable_rev_strand_matc... | 0.000596 |
def complete_command(self, tokens: List[str], text: str, line: str, begidx: int, endidx: int) -> List[str]:
"""Complete the command using the argparse metadata and provided argument dictionary"""
# Count which positional argument index we're at now. Loop through all tokens on the command line so far
... | 0.004977 |
def filter_nodes(n: Node, query: str) -> CompatNodeIterator:
"""
Utility function. Same as filter() but will only filter for nodes (i. e.
it will exclude scalars and positions).
"""
return CompatNodeIterator(filter(n, query)._nodeit, only_nodes=True) | 0.003704 |
def serialize_acquire_mutex(self, spec):
"""
Serializer for :meth:`SpiffWorkflow.specs.AcquireMutex`.
"""
elem = etree.Element('acquire-mutex')
self.serialize_task_spec(spec, elem)
SubElement(elem, 'mutex').text = spec.mutex
return elem | 0.006849 |
def main():
"""
Welcome to the thellier-thellier experiment automatic chart maker.
Please select desired step interval and upper bound for which it is valid.
e.g.,
50
500
10
600
a blank entry signals the end of data entry.
which would generate steps with 50 degree in... | 0.029188 |
def count_overlap( bits1, bits2 ):
"""
Count the number of bits that overlap between two sets
"""
b = BitSet( bits1.size )
b |= bits1
b &= bits2
return b.count_range( 0, b.size ) | 0.033981 |
def publish_page(page, languages):
"""
Publish a CMS page in all given languages.
"""
for language_code, lang_name in iter_languages(languages):
url = page.get_absolute_url()
if page.publisher_is_draft:
page.publish(language_code)
log.info('page "%s" published in... | 0.001992 |
def scf_compute_coeffs_axi(dens, N, L, a=1.,radial_order=None, costheta_order=None):
"""
NAME:
scf_compute_coeffs_axi
PURPOSE:
Numerically compute the expansion coefficients for a given axi-symmetric density
INPUT:
dens - A density function that take... | 0.021731 |
def dimensions(self):
""" Dimensions of the image.
:rtype: :py:class:`ImageDimensions`
"""
return ImageDimensions(self._info.file.width, self._info.file.height) | 0.010363 |
def create_server(self, datacenter_id, server):
"""
Creates a server within the data center.
:param datacenter_id: The unique ID of the data center.
:type datacenter_id: ``str``
:param server: A dict of the server to be created.
:type server: ``dic... | 0.003472 |
def import_junit(junit_file, **kwargs):
"""Reads the content of the junit-results file produced by pytest and returns imported data."""
xml_root = _get_xml_root(junit_file)
results = []
for test_data in xml_root:
if test_data.tag != "testcase":
continue
verdict, comment, pr... | 0.002676 |
def _verify(leniency, numobj, candidate, matcher):
"""Returns True if number is a verified number according to the
leniency."""
if leniency == Leniency.POSSIBLE:
return is_possible_number(numobj)
elif leniency == Leniency.VALID:
if (not is_valid_number(numobj) or
not _contain... | 0.002632 |
def directed_bipartition_of_one(seq):
"""Generate directed bipartitions where one part is of length 1.
Args:
seq (Iterable): The sequence to partition.
Returns:
list[tuple[tuple]]: A list of tuples containing each of the two
partitions.
Example:
>>> partitions = direct... | 0.00146 |
def with_config(loop=None):
"""
:return: an instance of the txaio API with the given
configuration. This won't affect anything using the 'gloabl'
config nor other instances created using this function.
If you need to customize txaio configuration separately (e.g. to
use multiple event-l... | 0.001613 |
def _to_key(d):
"""Convert dict to str and enable Jinja2 template syntax."""
as_str = json.dumps(d, sort_keys=True)
return as_str.replace('"{{', '{{').replace('}}"', '}}') | 0.010256 |
def status(name):
'''
Check the status of a gluster volume.
name
Volume name
CLI Example:
.. code-block:: bash
salt '*' glusterfs.status myvolume
'''
# Get volume status
root = _gluster_xml('volume status {0}'.format(name))
if not _gluster_ok(root):
# Most... | 0.000611 |
def split_key_string(key):
"""Splits a key string (of the form, e.g. ``'C# major'``), into a tuple of
``(key, mode)`` where ``key`` is is an integer representing the semitone
distance from C.
Parameters
----------
key : str
String representing a key.
Returns
-------
key : i... | 0.002024 |
def round_sig(x, sig):
"""Round the number to the specified number of significant figures"""
return round(x, sig - int(floor(log10(abs(x)))) - 1) | 0.006536 |
def delete(cls):
"""
Returns the delete view that can be specified as the second argument
to url() in urls.py.
"""
class PopupDeleteViewView(PopupDeleteView, cls.parent_class):
model = cls.model
form_class = cls.form_class
permission_required ... | 0.005063 |
def adapt(self, d, x):
"""
Adapt weights according one desired value and its input.
**Args:**
* `d` : desired value (float)
* `x` : input array (1-dimensional array)
"""
y = np.dot(self.w, x)
e = d - y
nu = self.mu / (self.eps + np.dot(x, x))
... | 0.005731 |
def Main():
"""The main program function.
Returns:
bool: True if successful or False if not.
"""
argument_parser = argparse.ArgumentParser(description=(
'Calculates a message digest hash for every file in a directory or '
'storage media image.'))
argument_parser.add_argument(
'--output... | 0.011628 |
def max_range(ranges, combined=True):
"""
Computes the maximal lower and upper bounds from a list bounds.
Args:
ranges (list of tuples): A list of range tuples
combined (boolean, optional): Whether to combine bounds
Whether range should be computed on lower and upper bound
... | 0.003782 |
def define(self):
"""If DFA is empty, create a sink state"""
if len(self.states) == 0:
for char in self.alphabet:
self.add_arc(0, 0, char)
self[0].final = False | 0.009091 |
def remove(self, toRemove):
'''
remove - Remove an item from this tag collection
@param toRemove - an AdvancedTag
'''
list.remove(self, toRemove)
self.uids.remove(toRemove.uid) | 0.008584 |
def _apply_filters_to_first_location_occurrence(match_traversal, location_to_filters,
already_filtered_locations):
"""Apply all filters for a specific location into its first occurrence in a given traversal.
For each location in the given match traversal,
con... | 0.004434 |
def display(self, frame, width, height, reverse=False):
"""
NOTE: this is called from the IISRequestHandler
"""
fb = self.get_frame(frame)
self.current_frame = frame
if reverse:
fb.buffer.reverse()
# frames are indexed from 1 in IRAF
chname ... | 0.002055 |
def is_running(self) -> bool:
"""Return True if ffmpeg is running."""
if self._proc is None or self._proc.returncode is not None:
return False
return True | 0.010526 |
def xml_marshal_bucket_constraint(region):
"""
Marshal's bucket constraint based on *region*.
:param region: Region name of a given bucket.
:return: Marshalled XML data.
"""
root = s3_xml.Element('CreateBucketConfiguration', {'xmlns': _S3_NAMESPACE})
location_constraint = s3_xml.SubElement(... | 0.003883 |
def get_permissions(self):
"""get permissions needed by this policy"""
permissions = set()
permissions.update(self.resource_manager.get_permissions())
for f in self.resource_manager.filters:
permissions.update(f.get_permissions())
for a in self.resource_manager.action... | 0.004988 |
def is_valid_bucket_name(name):
"""
Checks if an S3 bucket name is valid according to https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html#bucketnamingrules
"""
# Bucket names must be at least 3 and no more than 63 characters long.
if (len(name) < 3 or len(name) > 63):
ret... | 0.002901 |
def logical_enclosures(self):
"""
Gets the LogicalEnclosures API client.
Returns:
LogicalEnclosures:
"""
if not self.__logical_enclosures:
self.__logical_enclosures = LogicalEnclosures(self.__connection)
return self.__logical_enclosures | 0.006472 |
def _build_verb_statement_mapping():
"""Build the mapping between ISI verb strings and INDRA statement classes.
Looks up the INDRA statement class name, if any, in a resource file,
and resolves this class name to a class.
Returns
-------
verb_to_statement_type : dict
Dictionary mapping... | 0.000848 |
def cont(self, event = None):
"""
Resumes execution after processing a debug event.
@see: dispatch(), loop(), wait()
@type event: L{Event}
@param event: (Optional) Event object returned by L{wait}.
@raise WindowsError: Raises an exception on error.
"""
... | 0.003041 |
def _execute(self, net):
"""Handle the combinational logic update rules for the given net.
This function, along with edge_update, defined the semantics
of the primitive ops. Function updates self.value accordingly.
"""
if net.op in 'r@':
return # registers and memor... | 0.002104 |
def validate(self, value):
"""Validate value."""
if self.exclusive:
if value >= self.maximum_value:
tpl = "'{val}' is bigger or equal than maximum ('{max}')."
raise ValidationError(
tpl.format(val=value, max=self.maximum_value))
els... | 0.003704 |
def formpivotin(self):
'''
<- * / <- prop
'''
self.ignore(whitespace)
self.nextmust('<-')
self.ignore(whitespace)
if self.nextchar() == '*':
self.offs += 1
return s_ast.PivotIn()
prop = self.absprop()
return s_ast.Pivot... | 0.005882 |
def processOrdered(self, ordered: Ordered):
"""
Execute ordered request
:param ordered: an ordered request
:return: whether executed
"""
if ordered.instId not in self.instances.ids:
logger.warning('{} got ordered request for instance {} which '
... | 0.00365 |
def get_activation(self):
"""Extract INDRA Inhibition/Activation Statements from BEL.
The SPARQL query used to extract Activation Statements looks for
patterns in which the subject is is an ActivityType
(of a ProtainAbundance) or an Abundance (of a small molecule).
The object ha... | 0.000439 |
def miniaturize(self):
''' Tries to scrape the miniaturized version from vandale.nl. '''
element = self._first('NN')
if element:
if re.search('verkleinwoord: (\w+)', element, re.U):
return re.findall('verkleinwoord: (\w+)', element, re.U)
else:
return ['']
return [None] | 0.040956 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.