text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def create(self, max_wait=300, allocated_storage=None,
encryption_at_rest=None, restore_to_time=None, **kwargs):
"""
Create an instance of the PostgreSQL service with the typical starting
settings.
:param max_wait: service is created asynchronously, so will only wait
... | 0.002408 |
def run(self, records):
"""Runs the batch upload
:param records: an iterable containing queue entries
"""
self_name = type(self).__name__
for i, batch in enumerate(grouper(records, self.BATCH_SIZE, skip_missing=True), 1):
self.logger.info('%s processing batch %d', se... | 0.006154 |
def get_acmg(acmg_terms):
"""Use the algorithm described in ACMG paper to get a ACMG calssification
Args:
acmg_terms(set(str)): A collection of prediction terms
Returns:
prediction(int):
0 - Uncertain Significanse
1 - Benign
2 - Likely Benign... | 0.000463 |
def _ancestors_or_self(
self, qname: Union[QualName, bool] = None) -> List[InstanceNode]:
"""XPath - return the list of receiver's ancestors including itself."""
res = [] if qname and self.qual_name != qname else [self]
return res + self.up()._ancestors(qname) | 0.006757 |
def iterator_chain(variables: VarType, parent: str = None) -> Iterable[VarMatrix]:
"""This successively appends each element of an array to a single list of values.
This takes a list of values and puts all the values generated for each element in
the list into a single list of values. It uses the :func:`it... | 0.007143 |
def _render_batch(self,
non_fluents: NonFluents,
states: Fluents, actions: Fluents, interms: Fluents,
rewards: np.array,
horizon: Optional[int] = None) -> None:
'''Prints `non_fluents`, `states`, `actions`, `interms` and `rewards`
for given `horizon`.
... | 0.006029 |
def load_name(self, load):
'''
Return the primary name associate with the load, if an empty string
is returned then the load does not match the function
'''
if 'eauth' not in load:
return ''
fstr = '{0}.auth'.format(load['eauth'])
if fstr not in self.a... | 0.003831 |
def zpk(self, zeros, poles, gain, analog=True, **kwargs):
"""Filter this `TimeSeries` by applying a zero-pole-gain filter
Parameters
----------
zeros : `array-like`
list of zero frequencies (in Hertz)
poles : `array-like`
list of pole frequencies (in Her... | 0.00182 |
def _has_x(self, kwargs):
'''Returns True if x is explicitly defined in kwargs'''
return (('x' in kwargs) or (self._element_x in kwargs) or
(self._type == 3 and self._element_1mx in kwargs)) | 0.009009 |
def record_xml_output(rec, tags=None, order_fn=None):
"""Generate the XML for record 'rec'.
:param rec: record
:param tags: list of tags to be printed
:return: string
"""
if tags is None:
tags = []
if isinstance(tags, str):
tags = [tags]
if tags and '001' not in tags:
... | 0.00106 |
def _create_reference_value_options(self, keys, finished_keys):
"""this method steps through the option definitions looking for
alt paths. On finding one, it creates the 'reference_value_from' links
within the option definitions and populates it with copied options."""
# a set of known ... | 0.002426 |
def add_changes_markup(dom, ins_nodes, del_nodes):
"""
Add <ins> and <del> tags to the dom to show changes.
"""
# add markup for inserted and deleted sections
for node in reversed(del_nodes):
# diff algorithm deletes nodes in reverse order, so un-reverse the
# order for this iteratio... | 0.001495 |
def rename(self, old_table, new_table):
"""
Rename a table.
You must have ALTER and DROP privileges for the original table,
and CREATE and INSERT privileges for the new table.
"""
try:
command = 'RENAME TABLE {0} TO {1}'.format(wrap(old_table), wrap(new_table... | 0.010327 |
def grind_hash_for_weapon(hashcode):
""" Grinds the given hashcode for a weapon to draw on
the pixelmap. Utilizes the second six characters from the
hashcode."""
weaponlist = init_weapon_list()
# The second six characters of the hash
# control the weapon decision.
weapon_control = hashcode[... | 0.003384 |
def format_string(m, l, capture, is_bytes):
"""Perform a string format."""
for fmt_type, value in capture[1:]:
if fmt_type == FMT_ATTR:
# Attribute
l = getattr(l, value)
elif fmt_type == FMT_INDEX:
# Index
l = l[value]
elif fmt_type == FMT... | 0.008039 |
def to_xdr_object(self):
"""Creates an XDR Operation object that represents this
:class:`CreateAccount`.
"""
destination = account_xdr_object(self.destination)
create_account_op = Xdr.types.CreateAccountOp(
destination, Operation.to_xdr_amount(self.starting_balance)... | 0.004141 |
def _input_as_lines(self,data):
"""Writes data to tempfile and sets -infile parameter
data -- list of lines, ready to be written to file
"""
if data:
self.Parameters['--in']\
.on(super(Clearcut,self)._input_as_lines(data))
return '' | 0.013289 |
def _update_file(self, seek_to_end=True):
"""Open the file for tailing"""
try:
self.close()
self._file = self.open()
except IOError:
pass
else:
if not self._file:
return
self.active = True
try:
... | 0.002472 |
def close(self):
"""Close a port on dummy_serial."""
if VERBOSE:
_print_out('\nDummy_serial: Closing port\n')
if not self._isOpen:
raise IOError('Dummy_serial: The port is already closed')
self._isOpen = False
self.port = None | 0.009868 |
def compose(self, bbox=None, **kwargs):
"""
Compose the artboard.
See :py:func:`~psd_tools.compose` for available extra arguments.
:param bbox: Viewport tuple (left, top, right, bottom).
:return: :py:class:`PIL.Image`, or `None` if there is no pixel.
"""
from ps... | 0.004785 |
def patch_namespaced_stateful_set_scale(self, name, namespace, body, **kwargs): # noqa: E501
"""patch_namespaced_stateful_set_scale # noqa: E501
partially update scale of the specified StatefulSet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynch... | 0.001255 |
def dict2resource(raw, top=None, options=None, session=None):
"""Convert a dictionary into a Jira Resource object.
Recursively walks a dict structure, transforming the properties into attributes
on a new ``Resource`` object of the appropriate type (if a ``self`` link is present)
or a ``PropertyHolder``... | 0.002513 |
def save(self):
"""Update the configuration file on disk with the current contents of self.contents.
Previous contents are overwritten.
"""
try:
with open(self.path, "w") as f:
f.writelines(self.contents)
except IOError as e:
raise Interna... | 0.009639 |
def _isValidTrigger(block, ch):
"""check if the trigger characters are in the right context,
otherwise running the indenter might be annoying to the user
"""
if ch == "" or ch == "\n":
return True # Explicit align or new line
match = rxUnindent.match(block.text())
... | 0.010204 |
def queue(self):
"""
Get a queue of notifications
Use it with Python with
"""
queue = NotificationQueue()
self._listeners.add(queue)
yield queue
self._listeners.remove(queue) | 0.008368 |
def addMPCandHumanWealth(self,solution):
'''
Take a solution and add human wealth and the bounding MPCs to it.
Parameters
----------
solution : ConsumerSolution
The solution to this period's consumption-saving problem.
Returns:
----------
sol... | 0.006329 |
def is_directory(value, **kwargs):
"""Indicate whether ``value`` is a directory that exists on the local filesystem.
:param value: The value to evaluate.
:returns: ``True`` if ``value`` is valid, ``False`` if it is not.
:rtype: :class:`bool <python:bool>`
:raises SyntaxError: if ``kwargs`` contai... | 0.004862 |
def create_extraction_file(bim_filename, out_prefix):
"""Creates an extraction file (keeping only markers on autosomes).
:param bim_filename: the name of the BIM file.
:param out_prefix: the prefix for the output file.
:type bim_filename: str
:type out_prefix: str
"""
o_file = None
tr... | 0.000886 |
def decode_chain_list(in_bytes):
"""Convert a list of bytes to a list of strings. Each string is of length mmtf.CHAIN_LEN
:param in_bytes: the input bytes
:return the decoded list of strings"""
bstrings = numpy.frombuffer(in_bytes, numpy.dtype('S' + str(mmtf.utils.constants.CHAIN_LEN)))
return [s.d... | 0.01023 |
def build_parser_for_fileobject_and_desiredtype(self, obj_on_filesystem: PersistedObject, object_type: Type[T],
logger: Logger = None) -> Parser:
"""
Returns the most appropriate parser to use to parse object obj_on_filesystem as an object of type obje... | 0.012868 |
def top(num_processes=5, interval=3):
'''
Return a list of top CPU consuming processes during the interval.
num_processes = return the top N CPU consuming processes
interval = the number of seconds to sample CPU usage over
CLI Examples:
.. code-block:: bash
salt '*' ps.top
sa... | 0.001025 |
def columbus_day(year, country='usa'):
'''in USA: 2nd Monday in Oct
Elsewhere: Oct 12'''
if country == 'usa':
return nth_day_of_month(2, MON, OCT, year)
else:
return (year, OCT, 12) | 0.00463 |
def load_dialect_impl(self, dialect): # type: (DefaultDialect) -> TypeEngine
"""Select impl by dialect."""
if self.__use_json(dialect):
return dialect.type_descriptor(self.__json_type)
return dialect.type_descriptor(sqlalchemy.UnicodeText) | 0.007246 |
def AddLogFileOptions(self, argument_group):
"""Adds the log file option to the argument group.
Args:
argument_group (argparse._ArgumentGroup): argparse argument group.
"""
argument_group.add_argument(
'--logfile', '--log_file', '--log-file', action='store',
metavar='FILENAME', de... | 0.00159 |
def gaussian1d_moments(data, mask=None):
"""
Estimate 1D Gaussian parameters from the moments of 1D data.
This function can be useful for providing initial parameter values
when fitting a 1D Gaussian to the ``data``.
Parameters
----------
data : array_like (1D)
The 1D array.
m... | 0.000717 |
def plot_gaussian_2D(mu, lmbda, color='b', centermarker=True,label='',alpha=1.,ax=None,artists=None):
'''
Plots mean and cov ellipsoid into current axes. Must be 2D. lmbda is a covariance matrix.
'''
assert len(mu) == 2
ax = ax if ax else plt.gca()
# TODO use artists!
t = np.hstack([np.ara... | 0.027158 |
def eagerload_includes(self, query, qs):
"""Use eagerload feature of sqlalchemy to optimize data retrieval for include querystring parameter
:param Query query: sqlalchemy queryset
:param QueryStringManager qs: a querystring manager to retrieve information from url
:return Query: the qu... | 0.00355 |
def pad_repeat_border(data, padwidth):
"""
Similar to `pad`, except the border value from ``data`` is used to pad.
Parameters
----------
data : ndarray
Numpy array of any dimension and type.
padwidth : int or tuple
If int, it will pad using this amount at the beginning and end o... | 0.000513 |
def sort_dictionary_list(dict_list, sort_key):
"""
sorts a list of dictionaries based on the value of the sort_key
dict_list - a list of dictionaries
sort_key - a string that identifies the key to sort the dictionaries with.
Test sorting a list of dictionaries:
>>> sort_dictionary_list([{... | 0.003231 |
def _atomicModification(func):
"""Decorator
Make document modification atomic
"""
def wrapper(*args, **kwargs):
self = args[0]
with self._qpart:
func(*args, **kwargs)
return wrapper | 0.007663 |
def stop_NoteContainer(self, nc, channel=1):
"""Stop playing the notes in NoteContainer nc."""
self.notify_listeners(self.MSG_PLAY_NC, {'notes': nc,
'channel': channel})
if nc is None:
return True
for note in nc:
if not self.stop_Note(note, channel):
... | 0.008174 |
def less_naive(gold_schemes):
"""find 'less naive' baseline (most common scheme of a given length in subcorpus)"""
best_schemes = defaultdict(lambda: defaultdict(int))
for g in gold_schemes:
best_schemes[len(g)][tuple(g)] += 1
for i in best_schemes:
best_schemes[i] = tuple(max(best_sche... | 0.006173 |
def update_metadata_queue(self, agent: BaseAgent):
"""
Adds a new instance of AgentMetadata into the `agent_metadata_queue` using `agent` data.
:param agent: An instance of an agent.
"""
pids = {os.getpid(), *agent.get_extra_pids()}
helper_process_request = agent.get_hel... | 0.008715 |
def end(self):
"""End access to the SD interface and close the HDF file.
Args::
no argument
Returns::
None
The instance should not be used afterwards.
The 'end()' method is implicitly called when the
SD instance is deleted.
C library ... | 0.003937 |
def getPythonVarName(name):
"""Get the python variable name
"""
return SUB_REGEX.sub('', name.replace('+', '_').replace('-', '_').replace('.', '_').replace(' ', '').replace('/', '_')).upper() | 0.009852 |
def bury(self, priority=None):
"""Bury this job."""
if self.reserved:
self.conn.bury(self.jid, priority or self._priority())
self.reserved = False | 0.010753 |
def get_consensus_at(self, block_id):
"""
Get the consensus hash at a given block.
Return the consensus hash if we have one for this block.
Return None if we don't
"""
query = 'SELECT consensus_hash FROM snapshots WHERE block_id = ?;'
args = (block_id,)
c... | 0.003591 |
def generate_code_challenge(verifier):
"""
source: https://github.com/openstack/deb-python-oauth2client
Creates a 'code_challenge' as described in section 4.2 of RFC 7636
by taking the sha256 hash of the verifier and then urlsafe
base64-encoding it.
Args:
verifier: bytestring, representi... | 0.001515 |
def encode_sentence(obj):
"""Encode a single sentence."""
warnings.warn("deprecated. Please use bioc.biocxml.encoder.encode_sentence", DeprecationWarning)
return bioc.biocxml.encoder.encode_sentence(obj) | 0.009174 |
def read_raster_no_crs(input_file, indexes=None, gdal_opts=None):
"""
Wrapper function around rasterio.open().read().
Parameters
----------
input_file : str
Path to file
indexes : int or list
Band index or list of band indexes to be read.
Returns
-------
MaskedArray... | 0.001885 |
def get_privkey(self, address: AddressHex, password: str) -> PrivateKey:
"""Find the keystore file for an account, unlock it and get the private key
Args:
address: The Ethereum address for which to find the keyfile in the system
password: Mostly for testing purposes. A password ... | 0.004329 |
def native(self):
"""
The native Python datatype representation of this value
:return:
An integer or None
"""
if self.contents is None:
return None
if self._native is None:
self._native = self.__int__()
if self._map is no... | 0.004545 |
def get_remainder_set(self, j):
"""Return the set of children with indices less than j of all ancestors
of j. The set C from (arXiv:1701.07072).
:param int j: fermionic site index
:return: children of j-ancestors, with indices less than j
:rtype: list(FenwickNode)
"""
... | 0.003295 |
def parse_expression(val, acceptable_types, name=None, raise_type=ValueError):
"""Attempts to parse the given `val` as a python expression of the specified `acceptable_types`.
:param string val: A string containing a python expression.
:param acceptable_types: The acceptable types of the parsed object.
:type a... | 0.008494 |
def _eval_wrapper(self, fit_key, q, chiA, chiB, **kwargs):
"""Evaluates the surfinBH7dq2 model.
"""
chiA = np.array(chiA)
chiB = np.array(chiB)
# Warn/Exit if extrapolating
allow_extrap = kwargs.pop('allow_extrap', False)
self._check_param_limits(q, chiA, chiB, a... | 0.003019 |
def random_string(length=8, charset=None):
'''
Generates a string with random characters. If no charset is specified, only
letters and digits are used.
Args:
length (int) length of the returned string
charset (string) list of characters to choose from
Returns:
(str) with ran... | 0.001712 |
def subscribe_sns_topic_to_sqs(self, region):
"""Subscribe SQS to the SNS topic. Returns the ARN of the SNS Topic subscribed
Args:
region (`str`): Name of the AWS region
Returns:
`str`
"""
sns = self.session.resource('sns', region_name=region)
to... | 0.005222 |
def maskQuality(self, umi, umi_quals):
'''mask low quality bases and return masked umi'''
masked_umi = mask_umi(umi, umi_quals,
self.quality_encoding,
self.quality_filter_mask)
if masked_umi != umi:
self.read_counts['UMI mas... | 0.005038 |
def tree(self):
"""Tree with branch lengths in codon substitutions per site.
The tree is a `Bio.Phylo.BaseTree.Tree` object.
This is the current tree after whatever optimizations have
been performed so far.
"""
bs = self.model.branchScale
for node in self._tree.... | 0.004175 |
def PCO_protocol_dispatcher(s):
"""Choose the correct PCO element."""
proto_num = orb(s[0]) * 256 + orb(s[1])
cls = PCO_PROTOCOL_CLASSES.get(proto_num, Raw)
return cls(s) | 0.005376 |
def append_line(filename, **line):
"""Safely (i.e. with locking) append a line to
the given file, serialized as JSON.
"""
global lock
data = json.dumps(line, separators=(',', ':')) + '\n'
with lock:
with file(filename, 'a') as fp:
fp.seek(0, SEEK_END)
fp.write(da... | 0.003096 |
def prt_results(self, goea_results):
"""Print GOEA results to the screen or to a file."""
# objaart = self.prepgrp.get_objaart(goea_results) if self.prepgrp is not None else None
if self.args.outfile is None:
self._prt_results(goea_results)
else:
# Users can print... | 0.007407 |
def preprocess_incoming_content(content, encrypt_func, max_size_bytes):
"""
Apply preprocessing steps to file/notebook content that we're going to
write to the database.
Applies ``encrypt_func`` to ``content`` and checks that the result is
smaller than ``max_size_bytes``.
"""
encrypted = en... | 0.002169 |
def delete(self, request, *args, **kwargs):
"""Delete auth token when `delete` request was issued."""
# Logic repeated from DRF because one cannot easily reuse it
auth = get_authorization_header(request).split()
if not auth or auth[0].lower() != b'token':
return response.Res... | 0.002708 |
def _confirm_pos(self, pos):
"""look up widget for pos and default to None"""
candidate = None
if self._get_node(self._treelist, pos) is not None:
candidate = pos
return candidate | 0.008969 |
async def _quit(self):
"""Quits the bot."""
await self.bot.responses.failure(message="Bot shutting down")
await self.bot.logout() | 0.013072 |
def setOverlayAlpha(self, ulOverlayHandle, fAlpha):
"""Sets the alpha of the overlay quad. Use 1.0 for 100 percent opacity to 0.0 for 0 percent opacity."""
fn = self.function_table.setOverlayAlpha
result = fn(ulOverlayHandle, fAlpha)
return result | 0.010714 |
def publish(self, topic="/controller", qos=0, payload=None):
"""
publish(self, topic, payload=None, qos=0, retain=False)
Returns a tuple (result, mid), where result is MQTT_ERR_SUCCESS to
indicate success or MQTT_ERR_NO_CONN if the client is not currently
connected. mid is the m... | 0.002509 |
def runSearchFeatures(self, request):
"""
Returns a SearchFeaturesResponse for the specified
SearchFeaturesRequest object.
:param request: JSON string representing searchFeaturesRequest
:return: JSON string representing searchFeatureResponse
"""
return self.runSe... | 0.004292 |
def random_string(length):
"""
Return a pseudo-random string of specified length.
"""
valid_chars = string_ascii_letters + string_digits
return ''.join(random.choice(valid_chars) for i in range(length)) | 0.004484 |
def _cancel_send_messages(self, d):
"""Cancel a `send_messages` request
First check if the request is in a waiting batch, of so, great, remove
it from the batch. If it's not found, we errback() the deferred and
the downstream processing steps take care of aborting further
process... | 0.001294 |
def convert_padding(builder, layer, input_names, output_names, keras_layer):
"""
Convert padding layer from keras to coreml.
Keras only supports zero padding at this time.
Parameters
----------
keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural n... | 0.008448 |
def revcomp(sequence):
"returns reverse complement of a string"
sequence = sequence[::-1].strip()\
.replace("A", "t")\
.replace("T", "a")\
.replace("C", "g")\
.replace("G", "c").upper()
return... | 0.00304 |
def filter(args):
"""
%prog filter gffile > filtered.gff
Filter the gff file based on criteria below:
(1) feature attribute values: [Identity, Coverage].
You can get this type of gff by using gmap
$ gmap -f 2 ....
(2) Total bp length of child features
"""
p = OptionParser(filter.__... | 0.002895 |
def aside_view_declaration(self, view_name):
"""
Find and return a function object if one is an aside_view for the given view_name
Aside methods declare their view provision via @XBlockAside.aside_for(view_name)
This function finds those declarations for a block.
Arguments:
... | 0.008683 |
def ls(dataset_uri):
"""
List the overlays in the dataset.
"""
dataset = dtoolcore.DataSet.from_uri(dataset_uri)
for overlay_name in dataset.list_overlay_names():
click.secho(overlay_name) | 0.00463 |
def get_shape(self, ds_id, ds_info):
"""Return data array shape for item specified.
"""
var_path = ds_info.get('file_key', '{}'.format(ds_id.name))
if var_path + '/shape' not in self:
# loading a scalar value
shape = 1
else:
shape = self[var_pa... | 0.003976 |
def _get(self, end_point, params=None, **kwargs):
"""Send a HTTP GET request to a Todoist API end-point.
:param end_point: The Todoist API end-point.
:type end_point: str
:param params: The required request parameters.
:type params: dict
:param kwargs: Any optional param... | 0.003766 |
def categorize_by_attr(self, attribute):
'''
Function to categorize a FileList by a File object
attribute (eg. 'segment', 'ifo', 'description').
Parameters
-----------
attribute : string
File object attribute to categorize FileList
Returns
---... | 0.001996 |
def _make_input(self, action, old_quat):
"""
Helper function that returns a dictionary with keys dpos, rotation from a raw input
array. The first three elements are taken to be displacement in position, and a
quaternion indicating the change in rotation with respect to @old_quat.
... | 0.007449 |
def _create_select_window_handler(self, window):
" Return a mouse handler that selects the given window when clicking. "
def handler(mouse_event):
if mouse_event.event_type == MouseEventType.MOUSE_DOWN:
self.pymux.arrangement.set_active_window(window)
self.pym... | 0.004535 |
def service(self, service):
"""
Sets the service of this TrustedCertificateInternalResp.
Service name where the certificate is to be used.
:param service: The service of this TrustedCertificateInternalResp.
:type: str
"""
if service is None:
raise Val... | 0.003003 |
def get_stp_mst_detail_output_msti_port_auto_edge(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_stp_mst_detail = ET.Element("get_stp_mst_detail")
config = get_stp_mst_detail
output = ET.SubElement(get_stp_mst_detail, "output")
msti ... | 0.002837 |
def kp_pan_set(self, viewer, event, data_x, data_y, msg=True):
"""Sets the pan position under the cursor."""
if self.canpan:
self._panset(viewer, data_x, data_y, msg=msg)
return True | 0.009174 |
def com_google_fonts_check_metadata_match_name_familyname(family_metadata, font_metadata):
"""METADATA.pb: Check font name is the same as family name."""
if font_metadata.name != family_metadata.name:
yield FAIL, ("METADATA.pb: {}: Family name \"{}\""
" does not match"
" font n... | 0.008897 |
def getCountry(self, default=None):
"""Return the Country from the Physical or Postal Address
"""
physical_address = self.getPhysicalAddress().get("country", default)
postal_address = self.getPostalAddress().get("country", default)
return physical_address or postal_address | 0.00639 |
def _read_hdr_file(ktlx_file):
"""Reads header of one KTLX file.
Parameters
----------
ktlx_file : Path
name of one of the ktlx files inside the directory (absolute path)
Returns
-------
dict
dict with information about the file
Notes
-----
p.3: says long, but ... | 0.000359 |
def urlparse(url, scheme='', allow_fragments=True):
"""Parse a URL into 6 components:
<scheme>://<netloc>/<path>;<params>?<query>#<fragment>
Return a 6-tuple: (scheme, netloc, path, params, query, fragment).
Note that we don't break the components up in smaller bits
(e.g. netloc is a single string) ... | 0.001342 |
def _get_url(url):
"""Retrieve requested URL"""
try:
data = HTTP_SESSION.get(url, stream=True)
data.raise_for_status()
except requests.exceptions.RequestException as exc:
raise FetcherException(exc)
return data | 0.003984 |
def _contentful_user_agent(self):
"""
Sets the X-Contentful-User-Agent header.
"""
header = {}
from . import __version__
header['sdk'] = {
'name': 'contentful-management.py',
'version': __version__
}
header['app'] = {
'n... | 0.001338 |
def launch_shell(username, hostname, password, port=22):
"""
Launches an ssh shell
"""
if not username or not hostname or not password:
return False
with tempfile.NamedTemporaryFile() as tmpFile:
os.system(sshCmdLine.format(password, tmpFile.name, username, hostname,
... | 0.002755 |
def _ensure_array_list(arrays):
"""Ensures that every element in a list is an instance of a numpy array."""
# Note: the isinstance test is needed below so that instances of FieldArray
# are not converted to numpy arrays
return [numpy.array(arr, ndmin=1) if not isinstance(arr, numpy.ndarray)
... | 0.002882 |
def characters(self, numberOfCharacters):
"""Returns characters at index + number of characters"""
return self.code[self.index:self.index + numberOfCharacters] | 0.011429 |
def search_all(self):
'''a "show all" search that doesn't require a query'''
# This should be your apis url for a search
url = '...'
# paginte get is what it sounds like, and what you want for multiple
# pages of results
results = self._paginate_get(url)
if len(results) == 0:
b... | 0.004866 |
def _filterByPaddingNum(cls, iterable, num):
"""
Yield only path elements from iterable which have a frame
padding that matches the given target padding number
Args:
iterable (collections.Iterable):
num (int):
Yields:
str:
"""
... | 0.001256 |
def _parser_options():
"""Parses the options and arguments from the command line."""
#We have two options: get some of the details from the config file,
import argparse
from acorn import base
pdescr = "ACORN setup and custom configuration"
parser = argparse.ArgumentParser(parents=[base.bparser],... | 0.007435 |
def params(self, **kwargs):
"""
Specify query params to be used when executing the search. All the
keyword arguments will override the current values. See
https://elasticsearch-py.readthedocs.io/en/master/api.html#elasticsearch.Elasticsearch.search
for all available parameters.
... | 0.003891 |
def setup_service(api_name, api_version, credentials=None):
"""Configures genomics API client.
Args:
api_name: Name of the Google API (for example: "genomics")
api_version: Version of the API (for example: "v2alpha1")
credentials: Credentials to be used for the gcloud API calls.
Returns:
A confi... | 0.008518 |
def visible_devices(self):
"""Unify all visible devices across all connected adapters
Returns:
dict: A dictionary mapping UUIDs to device information dictionaries
"""
devs = {}
for device_id, adapters in self._devices.items():
dev = None
max... | 0.003115 |
def query(self, query='', name='', sortlist='', columns='',
limit=0, offset=0, style='Python'):
"""Query the table and return the result as a reference table.
This method queries the table. It forms a
`TaQL <../../doc/199.html>`_
command from the given arguments and execut... | 0.001198 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.