text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def stack_trace(depth=None):
"""
returns a print friendly stack trace at the current frame,
without aborting the application.
:param depth: The depth of the stack trace. if omitted, the entire
stack will be printed.
usage::
print stack_trace(10)
"""
frames = in... | 0.009272 |
def get_queue_attributes(self, queue, attribute='All', callback=None):
"""
Gets one or all attributes of a Queue
:type queue: A Queue object
:param queue: The SQS queue to be deleted
:type attribute: str
:type attribute: The specific attribute requested. If not... | 0.005479 |
def prompt(name, default=None):
"""
Grab user input from command line.
:param name: prompt text
:param default: default value if no input provided.
"""
prompt = name + (default and ' [%s]' % default or '')
prompt += name.endswith('?') and ' ' or ': '
while True:
rv = raw_input(... | 0.002364 |
def send_keys(self, text: str = 'cerium') -> None:
'''Simulates typing keys.'''
for char in text:
if '\u4e00' <= char <= '\u9fff':
raise CharactersException(
f'Text cannot contain non-English characters, such as {char!r}.')
text = re.escape(text)
... | 0.007212 |
def encrypt(self, mesg):
'''
Wrap a message with a sequence number and encrypt it.
Args:
mesg: The mesg to encrypt.
Returns:
bytes: The encrypted message.
'''
seqn = next(self._tx_sn)
rv = self._tx_tinh.enc(s_msgpack.en((seqn, mesg)))
... | 0.005988 |
def write_py2k_header(file_list):
"""Write Python 2 shebang and add encoding cookie if needed."""
if not isinstance(file_list, list):
file_list = [file_list]
python_re = re.compile(br"^(#!.*\bpython)(.*)([\r\n]+)$")
coding_re = re.compile(br"coding[:=]\s*([-\w.]+)")
new_line_re = re.compile... | 0.000532 |
def sort_pattern(self):
"""Extract query pattern from operations."""
if not self._sort_pattern:
# trigger evaluation of operation
if self.operation in ['query', 'getmore']:
self._sort_pattern = self._find_pattern('orderby: ')
return self._sort_pattern | 0.006309 |
def _delete(self, pk):
"""
Delete function logic, override to implement different logic
deletes the record with primary_key = pk
:param pk:
record primary key to delete
"""
item = self.datamodel.get(pk, self._base_filters)
if not item:... | 0.003165 |
def _get_remote_video_url(self, remote_node, session_id):
"""Get grid-extras url to download videos
:param remote_node: remote node name
:param session_id: test session id
:returns: grid-extras url to download videos
"""
url = '{}/video'.format(self._get_remote_node_url(... | 0.003851 |
def hist2d(h, axes=None, colorbar=False, **kwargs):
"""
Draw a 2D matplotlib histogram plot from a 2D ROOT histogram.
Parameters
----------
h : Hist2D
A rootpy Hist2D
axes : matplotlib Axes instance, optional (default=None)
The axes to plot on. If None then use the global curr... | 0.000843 |
def _get_memmap(self):
"""Get the memory map for the SEVIRI data"""
with open(self.filename) as fp:
data_dtype = self._get_data_dtype()
hdr_size = native_header.itemsize
return np.memmap(fp, dtype=data_dtype,
shape=(self.mda['number_of_... | 0.005181 |
def raw(text):
"""Returns a raw string representation of text"""
new_string = ''
for char in text:
try:
new_string += escape_dict[char]
except KeyError:
new_string += char
return new_string | 0.004082 |
def activate(self):
"""Activate the Router."""
if lib.EnvActivateRouter(self._env, self._name.encode()) == 0:
raise RuntimeError("Unable to activate router %s" % self._name) | 0.00995 |
def time(self, time):
"""Add a request for a specific time to the query.
This modifies the query in-place, but returns `self` so that multiple queries
can be chained together on one line.
This replaces any existing temporal queries that have been set.
Parameters
------... | 0.005042 |
async def genSchema(self, name, version, attrNames) -> Schema:
"""
Generates and submits Schema.
:param name: schema name
:param version: schema version
:param attrNames: a list of attributes the schema contains
:return: submitted Schema
"""
schema = Sche... | 0.004796 |
def first_ipv4(self) -> Optional[AddressInfo]:
'''The first IPv4 address.'''
for info in self._address_infos:
if info.family == socket.AF_INET:
return info | 0.01005 |
def start(self):
"""Create the Interchange process and connect to it.
"""
self.outgoing_q = zmq_pipes.TasksOutgoing(
"127.0.0.1", self.interchange_port_range)
self.incoming_q = zmq_pipes.ResultsIncoming(
"127.0.0.1", self.interchange_port_range)
self.is_a... | 0.001945 |
def compute_rewards(self, scores):
"""Compute the velocity of thte k+1 most recent scores.
The velocity is the average distance between scores. Return a list with those k velocities
padded out with zeros so that the count remains the same.
"""
# take the k + 1 most recent scores... | 0.004367 |
def file(ctx, data_dir, data_file):
"""Use the File SWAG Backend"""
if not ctx.file:
ctx.data_file = data_file
if not ctx.data_dir:
ctx.data_dir = data_dir
ctx.type = 'file' | 0.004831 |
def _create_tables(self):
"""
Set up the subdomain db's tables
"""
cursor = self.conn.cursor()
create_cmd = """CREATE TABLE IF NOT EXISTS {} (
fully_qualified_subdomain TEXT NOT NULL,
domain TEXT NOT NULL,
sequence INTEGER NOT NULL,
owner TEXT NOT... | 0.00209 |
def spread(nodes, n):
"""Distrubute master instances in different nodes
{
"192.168.0.1": [node1, node2],
"192.168.0.2": [node3, node4],
"192.168.0.3": [node5, node6]
} => [node1, node3, node5]
"""
target = []
while len(target) < n and nodes:
for ip, node_group i... | 0.001832 |
def get_best_span(span_start_logits: torch.Tensor, span_end_logits: torch.Tensor) -> torch.Tensor:
"""
This acts the same as the static method ``BidirectionalAttentionFlow.get_best_span()``
in ``allennlp/models/reading_comprehension/bidaf.py``. We keep it here so that users can
directly import this func... | 0.005525 |
def InferUserAndSubjectFromUrn(self):
"""Infers user name and subject urn from self.urn."""
_, cron_str, cron_job_name, user, _ = self.urn.Split(5)
if cron_str != "cron":
raise access_control.UnauthorizedAccess(
"Approval object has invalid urn %s." % self.urn,
requested_access=se... | 0.004866 |
def tables(self, db_id, schema, substr, force_refresh='false'):
"""Endpoint to fetch the list of tables for given database"""
db_id = int(db_id)
force_refresh = force_refresh.lower() == 'true'
schema = utils.js_string_to_python(schema)
substr = utils.js_string_to_python(substr)
... | 0.002519 |
def add_bpmn_xml(self, bpmn, svg=None, filename=None):
"""
Add the given lxml representation of the BPMN file to the parser's set.
:param svg: Optionally, provide the text data for the SVG of the BPMN
file
:param filename: Optionally, provide the source filename.
"""
... | 0.001792 |
def _make_nodes(self, cwd=None):
"""
Cast generated nodes to be Arcana nodes
"""
for i, node in NipypeMapNode._make_nodes(self, cwd=cwd):
# "Cast" NiPype node to a Arcana Node and set Arcana Node
# parameters
node.__class__ = self.node_cls
... | 0.003824 |
def imageinfo(self, files):
"""
Returns imageinfo query string
"""
files = '|'.join([safequote(x) for x in files])
self.set_status('imageinfo', files)
return self.IMAGEINFO.substitute(
WIKI=self.uri,
ENDPOINT=self.endpoint,
FILES=file... | 0.006211 |
def update(self, pop: Union[pd.DataFrame, pd.Series]):
"""Update the simulation's state to match ``pop``
Parameters
----------
pop :
The data which should be copied into the simulation's state. If ``pop`` is a DataFrame only those columns
included in the view... | 0.005096 |
def view_meta_admonition(admonition_name, name=None):
"""List all found admonition from all the rst files found in directory.
view_meta_admonition is called by the 'meta' url: /__XXXXXXX__
where XXXXXXX represents and admonition name, like:
* todo
* warning
* danger
* ...
.. note:: th... | 0.000213 |
def PathList(self, pathlist):
"""
Returns the cached _PathList object for the specified pathlist,
creating and caching a new object as necessary.
"""
pathlist = self._PathList_key(pathlist)
try:
memo_dict = self._memo['PathList']
except KeyError:
... | 0.003273 |
def is_colliding(self, other):
"""Check to see if two circles are colliding."""
if isinstance(other, BoundingCircle):
#Calculate the distance between two circles.
distance = Vector2.distance(self.coords, other.coords)
#Check to see if the sum of thier radi are greate... | 0.016552 |
def pythonize(self, val):
"""If value is a single list element just return the element
does nothing otherwise
:param val: value to convert
:type val:
:return: converted value
:rtype:
"""
if isinstance(val, list) and len(set(val)) == 1:
# If we... | 0.004348 |
def _check_bullets(lines, **kwargs):
"""Check that the bullet point list is well formatted.
Each bullet point shall have one space before and after it. The bullet
character is the "*" and there is no space before it but one after it
meaning the next line are starting with two blanks spaces to respect t... | 0.000891 |
def gettext_lazy(message, domain=DEFAULT_DOMAIN):
"""Mark a message as translatable, but delay the translation until the message is used.
Sometimes, there are some messages that need to be translated, but the translation
can't be done at the point the message itself is written. For example, the names of
... | 0.006351 |
def on_mouse(self, event):
'''handle mouse events'''
state = self.state
pos = event.GetPosition()
if event.Leaving():
self.mouse_pos = None
else:
self.mouse_pos = pos
self.update_position()
if hasattr(event, 'ButtonIsDown'):
an... | 0.001116 |
def setup_options():
"""Sets Streamlink options."""
if args.hls_live_edge:
streamlink.set_option("hls-live-edge", args.hls_live_edge)
if args.hls_segment_attempts:
streamlink.set_option("hls-segment-attempts", args.hls_segment_attempts)
if args.hls_playlist_reload_attempts:
str... | 0.003055 |
def macro_def(self, node, frame):
"""Dump the macro definition for the def created by macro_body."""
arg_tuple = ', '.join(repr(x.name) for x in node.args)
name = getattr(node, 'name', None)
if len(node.args) == 1:
arg_tuple += ','
self.write('Macro(environment, macro... | 0.003096 |
def start(self, io_loop):
"""
Run the ``before_run`` callbacks and queue to ``on_start`` callbacks.
:param tornado.ioloop.IOLoop io_loop: loop to start the app on.
"""
for callback in self.before_run_callbacks:
try:
callback(self.tornado_application,... | 0.00295 |
def ecdsa_sign_compact(msg32, seckey):
"""
Takes the same message and seckey as _ecdsa_sign_recoverable
Returns an unsigned char array of length 65 containing the signed message
"""
# Assign 65 bytes to output
output64 = ffi.new("unsigned char[65]")
# ffi definition of recid
reci... | 0.002985 |
def log_reject( self, block_id, vtxindex, op, op_data ):
"""
Log a rejected operation
"""
debug_op = self.sanitize_op( op_data )
if 'history' in debug_op:
del debug_op['history']
log.debug("REJECT %s at (%s, %s) data: %s", op_get_opcode_name( op ), block_id,... | 0.029545 |
def setLib(self, lib):
""" Copy the lib items into our font. """
for name, item in lib.items():
self.font.lib[name] = item | 0.013333 |
def decimal_default(obj):
"""Properly parse out the Decimal datatypes into proper int/float types."""
if isinstance(obj, decimal.Decimal):
if obj % 1:
return float(obj)
return int(obj)
raise TypeError | 0.004167 |
def compute_threshold(smoothed_errors, error_buffer, sd_limit=12.0):
"""Helper method for `extract_anomalies` method.
Calculates the epsilon (threshold) for anomalies.
"""
mu = np.mean(smoothed_errors)
sigma = np.std(smoothed_errors)
max_epsilon = 0
sd_threshold = sd_limit
# The tresho... | 0.001764 |
def cat(self, i1, i2, format='html'):
"""Display the DataFrame from row i1 till i2
For format, see https://pypi.org/project/tabulate/
:param int i1: Start row
:param int i2: End row.
:param str format: Format to use, e.g. 'html', 'plain', 'latex'
"""
from IPytho... | 0.003552 |
def classifySPoutput(targetOutputColumns, outputColumns):
"""
Classify the SP output
@param targetOutputColumns (list) The target outputs, corresponding to
different classes
@param outputColumns (array) The current output
@return classLabel (int) classification outcome
""... | 0.012389 |
def call_all(sequence, method_name, *args, **kwargs):
"""Call a method on each element of a sequence, in parallel.
Returns:
list of results
"""
kwargs = kwargs.copy()
kwargs['block'] = False
results = []
for obj in sequence:
results.append(methodcall(obj, method_name, *args, **... | 0.002331 |
def translate(term=None, phrase=None, api_key=GIPHY_PUBLIC_KEY, strict=False,
rating=None):
"""
Shorthand for creating a Giphy api wrapper with the given api key
and then calling the translate method.
"""
return Giphy(api_key=api_key, strict=strict).translate(
term=term, phrase... | 0.002915 |
def main(cls):
"""
Command-line entry point for running a PySOA server. The chain of method calls is as follows::
cls.main
|
-> cls.initialize => new_cls
-> new_cls.__init__ => self
-> self.run
|
-> ... | 0.003592 |
def children(self, value):
"""
Setter for **self.__children** attribute.
:param value: Attribute value.
:type value: list
"""
if value is not None:
assert type(value) is list, "'{0}' attribute: '{1}' type is not 'list'!".format("children", value)
... | 0.006579 |
def _get_dbal_column_type(self, type_):
"""
Get the dbal column type.
:param type_: The fluent type
:type type_: str
:rtype: str
"""
type_ = type_.lower()
if type_ == "enum":
return "string"
return super(SQLiteSchemaGrammar, self)._... | 0.005764 |
def populateFromRow(self, peerRecord):
"""
This method accepts a model record and sets class variables.
"""
self.setUrl(peerRecord.url) \
.setAttributesJson(peerRecord.attributes)
return self | 0.00823 |
def _data_scan(self, data_id=None, executor='resolwe.flow.executors.local', **kwargs):
"""Scan for new Data objects and execute them.
:param data_id: Optional id of Data object which (+ its
children) should be scanned. If it is not given, all
resolving objects are processed.
... | 0.004524 |
def replace_ext(file_path, new_ext):
"""
>>> replace_ext('one/two/three.four.doc', '.html')
'one/two/three.four.html'
>>> replace_ext('one/two/three.four.DOC', '.html')
'one/two/three.four.html'
>>> replace_ext('one/two/three.four.DOC', 'html')
'one/two/three.four.html'
"""
if not ne... | 0.002155 |
def validate_groupby_func(name, args, kwargs, allowed=None):
"""
'args' and 'kwargs' should be empty, except for allowed
kwargs because all of
their necessary parameters are explicitly listed in
the function signature
"""
if allowed is None:
allowed = []
kwargs = set(kwargs) - s... | 0.001812 |
def prior_dates(*args, **kwargs):
"""Get the prior distribution of calibrated radiocarbon dates"""
try:
chron = args[0]
except IndexError:
chron = kwargs['coredates']
d_r = np.array(kwargs['d_r'])
d_std = np.array(kwargs['d_std'])
t_a = np.array(k... | 0.0016 |
def getHighOrderSequenceChunk(it, switchover=1000, w=40, n=2048):
"""
Given an iteration index, returns a list of vectors to be appended to the
input stream, as well as a string label identifying the sequence. This
version generates a bunch of high order sequences. The first element always
provides sufficient... | 0.036929 |
def _get_session(self, session):
"""Creates a new session with basic auth, unless one was provided, and sets headers.
:param session: (optional) Session to re-use
:return:
- :class:`requests.Session` object
"""
if not session:
logger.debug('(SESSION_CREA... | 0.003783 |
def mnemonic(self, index, verbose=False):
"""Give mnemonic representation of meaning.
verbose compresses strings of x's
"""
if index<16:
return ['last', '2last', '3last', '4last',
'last-1', 'last+1', 'last-2', 'last+2', 'last-3', 'last+3',
'2la... | 0.018614 |
def walk(textRoot, currentTag, level, prefix=None, postfix=None, unwrapUntilPara=False):
'''
.. note::
This method does not cover all possible input doxygen types! This means that
when an unsupported / unrecognized doxygen tag appears in the xml listing, the
**raw xml will appear on the f... | 0.005154 |
def get_default_config(self):
"""
Returns the default collector settings
"""
config = super(DropwizardCollector, self).get_default_config()
config.update({
'host': '127.0.0.1',
'port': 8081,
'path': 'dropwizard',
})
... | 0.006006 |
def cmd(send, msg, args):
"""Searches tumblr
Syntax: {command} <blogname> <--submit content|--random>
"""
parser = arguments.ArgParser(args['config'])
parser.add_argument('blogname', action=arguments.TumblrParser)
group = parser.add_mutually_exclusive_group()
group.add_argument('--submit', n... | 0.002808 |
def make_quad(points, size_u, size_v):
""" Converts linear sequence of input points into a quad structure.
:param points: list of points to be ordered
:type points: list, tuple
:param size_v: number of elements in a row
:type size_v: int
:param size_u: number of elements in a column
:type s... | 0.002157 |
def _check_for_crypto_done(self):
# type: (Downloader) -> None
"""Check queue for crypto done
:param Downloader self: this
"""
cv = self._crypto_offload.done_cv
while not self.termination_check:
result = None
cv.acquire()
while True:
... | 0.002577 |
def _create_doc(self):
'''
Create document.
:return:
'''
root = etree.Element('image')
root.set('schemaversion', '6.3')
root.set('name', self.name)
return root | 0.008889 |
def multiply(df, new_column, column_1, column_2):
"""
DEPRECATED - use `formula` instead
"""
return _basic_math_operation(df, new_column, column_1, column_2, op='mul') | 0.005435 |
def sortDictList(dictList,**kwargs):
'''
students = [
{'name':'john','class':'A', 'year':15},
{'name':'jane','class':'B', 'year':12},
{'name':'dave','class':'B', 'year':10}
]
rslt = sortDictList(students,cond_keys=['name','class','year'])
... | 0.007274 |
def start_shell(local_ns: Dict=None, banner: str=''):
"""Create and immediately drop into a Python shell.
If IPython version 5 or greater is available it will be used instead
of the built-in python shell.
:param local_ns: An optional dict containing the global namespace of
the n... | 0.006812 |
def build(self, **kwargs):
"""
Build an image and return it. Similar to the ``docker build``
command. Either ``path`` or ``fileobj`` must be set.
If you have a tar file for the Docker build context (including a
Dockerfile) already, pass a readable file-like object to ``fileobj``... | 0.000414 |
def from_conv_part_data(conv_part_data, self_user_id):
"""Construct user from ``ConversationParticipantData`` message.
Args:
conv_part_id: ``ConversationParticipantData`` message.
self_user_id (~hangups.user.UserID or None): The ID of the current
user. If ``None`... | 0.002805 |
def _getLogger(cls, logLevel=None):
""" Gets a logger for the given class in this module
"""
logger = logging.getLogger(
".".join(['com.numenta', _MODULE_NAME, cls.__name__]))
if logLevel is not None:
logger.setLevel(logLevel)
return logger | 0.019231 |
def read_config(config_file=CONFIG_FILE_DEFAULT, override_url=None):
''' Read configuration file, perform sanity check and return configuration
dictionary used by other functions.'''
config = ConfigParser()
config.read_dict(DEFAULT_SETTINGS)
try:
config.readfp(open(config_file))
... | 0.001742 |
def find_link(self, href_pattern, make_absolute=True):
"""
Find link in response body which href value matches ``href_pattern``.
Returns found url or None.
"""
if make_absolute:
self.tree.make_links_absolute(self.doc.url)
if isinstance(href_pattern, six.tex... | 0.003008 |
def _textToTable(self, text, separator='\t'):
"""
format csv, [[...]], ((..)) strings to a 2d table
"""
table = None
if text.startswith('[[') or text.startswith('(('):
try:
# maybe it's already formated as a list e.g. "[['1','2'],[...]]"
... | 0.00365 |
def _output_format_sector(func, override=None):
""" Decorator in charge of giving the output its right format, either
json or pandas (replacing the % for usable floats, range 0-1.0)
Keyword Arguments:
func: The function to be decorated
override: Override the internal for... | 0.001487 |
def save_grade_system(self, grade_system_form, *args, **kwargs):
"""Pass through to provider GradeSystemAdminSession.update_grade_system"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if grade_system_form.is_for_update():
ret... | 0.006276 |
def set_cmd_env_var(value):
"""Decorator that sets the temple command env var to value"""
def func_decorator(function):
@functools.wraps(function)
def wrapper(*args, **kwargs):
previous_cmd_env_var = os.getenv(temple.constants.TEMPLE_ENV_VAR)
os.environ[temple.constants.T... | 0.002721 |
def addToNetwork(grph, nds, count, weighted, nodeType, nodeInfo, fullInfo, coreCitesDict, coreValues, detailedValues, addCR, recordToCite = True, headNd = None):
"""Addeds the citations _nds_ to _grph_, according to the rules give by _nodeType_, _fullInfo_, etc.
_headNd_ is the citation of the Record
"""
... | 0.004577 |
def decode(string, encoding=None, errors=None):
"""Decode from specified encoding.
``encoding`` defaults to the preferred encoding.
``errors`` defaults to the preferred error handler.
"""
if encoding is None:
encoding = getpreferredencoding()
if errors is None:
errors = getprefe... | 0.002667 |
def get(self, path, query, **options):
"""Parses GET request options and dispatches a request."""
api_options = self._parse_api_options(options, query_string=True)
query_options = self._parse_query_options(options)
parameter_options = self._parse_parameter_options(options)
# opt... | 0.004016 |
def sum_of_squares(obs, pred):
"""
Sum of squares between observed and predicted data
Parameters
----------
obs : iterable
Observed data
pred : iterable
Predicted data
Returns
-------
float
Sum of squares
Notes
-----
The length of observed and p... | 0.002427 |
def screenshot(filename="screenshot.png"):
"""
Save a screenshot of the current rendering window.
"""
if not settings.plotter_instance.window:
colors.printc('~bomb screenshot(): Rendering window is not present, skip.', c=1)
return
w2if = vtk.vtkWindowToImageFilter()
w2if.ShouldRe... | 0.003289 |
def derive_ordering(self):
"""
Returns what field should be used for ordering (using a prepended '-' to indicate descending sort).
If the default order of the queryset should be used, returns None
"""
if '_order' in self.request.GET:
return self.request.GET['_order']... | 0.006993 |
def time_to_repeats(self, bins, integration_time):
"""Convert integration time to number of repeats"""
return math.ceil((self.device.sample_rate * integration_time) / bins) | 0.010638 |
def get_current_head(graph):
"""
Get the current database head revision, if any.
"""
session = new_session(graph)
try:
result = session.execute("SELECT version_num FROM alembic_version")
except ProgrammingError:
return None
else:
return result.scalar()
finally:
... | 0.002924 |
def _reduce_datetimes(row):
"""Receives a row, converts datetimes to strings."""
row = list(row)
for i in range(len(row)):
if hasattr(row[i], 'isoformat'):
row[i] = row[i].isoformat()
return tuple(row) | 0.004184 |
def close(self):
"""
Close the pickle file, and the zip archive file. The single zip archive
file can now be shipped around to be loaded by the unpickler.
"""
if self.file is None:
return
# Close the pickle file.
self.file.close()
self.file = ... | 0.006462 |
def add_eval(self, agent, e, fr=None):
"""Add or change agent's evaluation of the artifact with given framing
information.
:param agent: Name of the agent which did the evaluation.
:param float e: Evaluation for the artifact.
:param object fr: Framing information for the evaluat... | 0.004854 |
def prediction(self, input_data='', mode='test_data'):
'''
Make prediction
input test data
output the prediction
'''
prediction = {}
if (self.status != 'train'):
print("Please load train data and init W then train the W first.")
return p... | 0.002466 |
def get_program(self, program_resource_name: str) -> Dict:
"""Returns the previously created quantum program.
Params:
program_resource_name: A string of the form
`projects/project_id/programs/program_id`.
Returns:
A dictionary containing the metadata and... | 0.004444 |
def sourcess_list(self, *args):
"""Display a list of all registered events"""
from pprint import pprint
sources = {}
sources.update(self.authorized_events)
sources.update(self.anonymous_events)
for source in sources:
pprint(source) | 0.006803 |
def cb_histogram(fastq, umi_histogram):
''' Counts the number of reads for each cellular barcode
Expects formatted fastq files.
'''
annotations = detect_fastq_annotations(fastq)
re_string = construct_transformed_regex(annotations)
parser_re = re.compile(re_string)
cb_counter = collections.... | 0.00216 |
def voxel_loop(self):
'''iterator that loops through each voxel and yields the coords and time series as a tuple'''
# Prob not the most efficient, but the best I can do for now:
for x in xrange(len(self.data)):
for y in xrange(len(self.data[x])):
for z in xrange(len(s... | 0.015306 |
def stats(self):
"""Lists some metrics of the capturing system:
Tasks processed: the total number of reentrant tasks processed,
which includes retry attempts.
Events processed: number of events captured and processed.
Tasks stored: actual number of unique tas... | 0.002594 |
def is_same_host(host1, host2):
"""
Returns true if host1 == host2 OR map to the same host (using DNS)
"""
try:
if host1 == host2:
return True
else:
ips1 = get_host_ips(host1)
ips2 = get_host_ips(host2)
return len(set(ips1) & set(ips2)) >... | 0.002532 |
def close(self, code: int = None, reason: str = None) -> None:
"""Closes this Web Socket.
Once the close handshake is successful the socket will be closed.
``code`` may be a numeric status code, taken from the values
defined in `RFC 6455 section 7.4.1
<https://tools.ietf.org/ht... | 0.002577 |
def configure_vlan(self, vid, commands):
""" Configures the specified Vlan using commands
Args:
vid (str): The VLAN ID to configure
commands: The list of commands to configure
Returns:
True if the commands completed successfully
"""
commands ... | 0.004662 |
def xdr(self):
"""Get the base64 encoded XDR string representing this
:class:`TransactionEnvelope`.
"""
te = Xdr.StellarXDRPacker()
te.pack_TransactionEnvelope(self.to_xdr_object())
te = base64.b64encode(te.get_buffer())
return te | 0.006969 |
def get_content(service_instance, obj_type, property_list=None,
container_ref=None, traversal_spec=None,
local_properties=False):
'''
Returns the content of the specified type of object for a Service Instance.
For more information, please see:
http://pubs.vmware.com/vsph... | 0.001274 |
def geckoboard_rag_widget(request):
"""
Searches the GET variables for metric UIDs, and displays
them in a RAG widget.
"""
params = get_gecko_params(request)
print params['uids']
max_date = datetime.now()-timedelta(days=params['days_back'])
metrics = Metric.objects.filter(uid__in=param... | 0.008961 |
def call_inkscape(args_strings, inkscape_binpath=None):
"""Call inkscape CLI with arguments and returns its return value.
Parameters
----------
args_string: list of str
inkscape_binpath: str
Returns
-------
return_value
Inkscape command CLI call return value.
"""
log.d... | 0.001439 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.