text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def get_tree_members(self):
""" Retrieves all members from this node of the tree down."""
members = []
queue = deque()
queue.appendleft(self)
visited = set()
while len(queue):
node = queue.popleft()
if node not in visited:
... | 0.005236 |
def upgrade(refresh=True, dist_upgrade=False, **kwargs):
'''
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
On minions running systemd>=205, `systemd-run(1)`_ is now used to
isolate commands which modify installed packages from the
``salt-minion`` daemon's control group. This is done t... | 0.001671 |
def get_private_key(platform, service, purpose, key_use, version, private_key, keys_folder):
'''
Loads a private key from the file system and adds it to a dict of keys
:param keys: A dict of keys
:param platform the platform the key is for
:param service the service the key is for
:param key_use... | 0.004739 |
def submissions_between(reddit_session,
subreddit,
lowest_timestamp=None,
highest_timestamp=None,
newest_first=True,
extra_cloudsearch_fields=None,
verbosity=1):
"""Yield s... | 0.000138 |
def download(self, url, filename, relative=False, headers=None, timeout=5):
"""
Download the file from the given url at the current path
"""
request_url = self.base_url + url if relative else url
floyd_logger.debug("Downloading file from url: {}".format(request_url))
# A... | 0.003127 |
def _output_work(self, work, root):
"""Saves the TEI XML document `root` at the path `work`."""
output_filename = os.path.join(self._output_dir, work)
tree = etree.ElementTree(root)
tree.write(output_filename, encoding='utf-8', pretty_print=True) | 0.007194 |
def additions_install(**kwargs):
'''
Install VirtualBox Guest Additions. Uses the CD, connected by VirtualBox.
To connect VirtualBox Guest Additions via VirtualBox graphical interface
press 'Host+D' ('Host' is usually 'Right Ctrl').
See https://www.virtualbox.org/manual/ch04.html#idp52733088 for m... | 0.002904 |
def instance_for_arguments(self, arguments: {Prior: float}):
"""
Create an instance of the associated class for a set of arguments
Parameters
----------
arguments: {Prior: float}
Dictionary mapping_matrix priors to attribute analysis_path and value pairs
Ret... | 0.006567 |
def draggable(self) -> Union[bool, str]:
"""Get ``draggable`` property."""
if not self.hasAttribute('draggable'):
return False
return self.getAttribute('draggable') | 0.01 |
def ParseFileObject(self, parser_mediator, file_object):
"""Parses a text file-like object using a pyparsing definition.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
file_object (dfvfs.FileIO): file-like obj... | 0.008097 |
def _to_proto_sparse_tensor(sparse_tensor, nested_proto,
process_leafs, already_processed):
"""Serializes a `tf.SparseTensor` into `nested_proto`.
Args:
sparse_tensor: An instance of `tf.SparseTensor`.
nested_proto: A `module_pb2.NestedData` instance to be filled from
`spa... | 0.006386 |
def _create_value(self, data, name, spec):
""" Create the value for a field.
:param data: the whole data for the entity (all fields).
:param name: name of the initialized field.
:param spec: spec for the whole entity.
"""
field = getattr(self, 'create_' + name, None)
... | 0.003788 |
def _get_after_tld_chars(self):
"""
Initialize after tld characters
"""
after_tld_chars = set(string.whitespace)
after_tld_chars |= {'/', '\"', '\'', '<', '>', '?', ':', '.', ','}
# get left enclosure characters
_, right_enclosure = zip(*self._enclosure)
#... | 0.003929 |
def import_locations(self, osm_file):
"""Import OSM data files.
``import_locations()`` returns a list of ``Node`` and ``Way`` objects.
It expects data files conforming to the `OpenStreetMap 0.5 DTD`_, which
is XML such as::
<?xml version="1.0" encoding="UTF-8"?>
... | 0.001572 |
def info(message, domain):
"""Log simple info"""
if domain in Logger._ignored_domains:
return
Logger._log(None, message, INFO, domain) | 0.011696 |
def from_json(json_data):
"""
Returns a pyalveo.OAuth2 given a json string built from the oauth.to_json() method.
"""
#If we have a string, then decode it, otherwise assume it's already decoded
if isinstance(json_data, str):
data = json.loads(json_data)
el... | 0.020948 |
def deployment(
*,
block_uri: URI,
contract_instance: str,
contract_type: str,
address: HexStr,
transaction: HexStr = None,
block: HexStr = None,
deployment_bytecode: Dict[str, Any] = None,
runtime_bytecode: Dict[str, Any] = None,
compiler: Dict[str, Any] = None,
) -> Manifest:
... | 0.004779 |
def _AdjustForTimeZoneOffset(
self, year, month, day_of_month, hours, minutes, time_zone_offset):
"""Adjusts the date and time values for a time zone offset.
Args:
year (int): year e.g. 1970.
month (int): month, where 1 represents January.
day_of_month (int): day of the month, where 1 r... | 0.008371 |
def _CalculateHashesFileEntry(
self, file_system, file_entry, parent_full_path, output_writer):
"""Recursive calculates hashes starting with the file entry.
Args:
file_system (dfvfs.FileSystem): file system.
file_entry (dfvfs.FileEntry): file entry.
parent_full_path (str): full path of ... | 0.004529 |
def generate(self):
'''
Generate noise samples.
Returns:
`np.ndarray` of samples.
'''
generated_arr = np.random.uniform(
low=0.1,
high=0.9,
size=((self.__batch_size, self.__seq_len, self.__dim))
)
... | 0.005803 |
def rdfgraph_to_ontol(rg):
"""
Return an Ontology object from an rdflib graph object
Status: Incomplete
"""
digraph = networkx.MultiDiGraph()
from rdflib.namespace import RDF
label_map = {}
for c in rg.subjects(RDF.type, OWL.Class):
cid = contract_uri_wrap(c)
logging.inf... | 0.005297 |
def update_status(self, *args, **kwargs):
""" :reference: https://dev.twitter.com/rest/reference/post/statuses/update
:allowed_param:'status', 'in_reply_to_status_id', 'in_reply_to_status_id_str', 'auto_populate_reply_metadata', 'lat', 'long', 'source', 'place_id', 'display_coordinates', 'media_ids'... | 0.006383 |
def _flatten_projection(cls, projection):
"""
Flatten a structured projection (structure projections support for
projections of (to be) dereferenced fields.
"""
# If `projection` is empty return a full projection
if not projection:
return {'__': False}, {}, {... | 0.001409 |
def commit(jaide, commands, check, sync, comment, confirm, at_time, blank):
""" Execute a commit against the device.
Purpose: This function will send set commands to a device, and commit
| the changes. Options exist for confirming, comments,
| synchronizing, checking, blank commits, or de... | 0.000397 |
def _parse_textgroup(self, cts_file):
""" Parses a textgroup from a cts file
:param cts_file: Path to the CTS File
:type cts_file: str
:return: CtsTextgroupMetadata and Current file
"""
with io.open(cts_file) as __xml__:
return self.classes["textgroup"].parse... | 0.005291 |
def daisy_chains(self, kih, max_path_length=None):
""" Generator for daisy chains (complementary kihs) associated with a knob.
Notes
-----
Daisy chain graph is the directed graph with edges from knob residue to each hole residue for each KnobIntoHole
in self.
Given a Kn... | 0.006284 |
def get_palette(samples, options, return_mask=False, kmeans_iter=40):
'''Extract the palette for the set of sampled RGB values. The first
palette entry is always the background color; the rest are determined
from foreground pixels by running K-means clustering. Returns the
palette, as well as a mask corresponding ... | 0.001222 |
def InitSampCheck(self):
"""make an interactive grid in which users can edit sample names
as well as which site a sample belongs to"""
self.sample_window += 1
self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)
if self.sample_window == 1:
text = """Step 2:
Check that... | 0.007875 |
def _escapeText(text):
""" Adds backslash-escapes to property value characters that need them."""
output = ""
index = 0
match = reCharsToEscape.search(text, index)
while match:
output = output + text[index:match.start()] + '\\' + text[match.start()]
index = match.end()
match = reCharsToEscape.search(text, in... | 0.02965 |
def cached_make_env(make_env):
"""
Only creates a new environment from the provided function if one has not yet already been
created. This is useful here because we need to infer certain properties of the env, e.g.
its observation and action spaces, without any intend of actually using it.
"""
i... | 0.006757 |
def create_qualification_type(self,
name,
description,
status,
keywords=None,
retry_delay=None,
test=None,
... | 0.006514 |
def remove_flag(self, flag):
"""
Remove flag to the flags and memorize this attribute has changed so we
can regenerate it when outputting text.
"""
super(Entry, self).remove_flag(flag)
self._changed_attrs.add('flags') | 0.007547 |
def snapped_speed_limits(client, path):
"""Returns the posted speed limit (in km/h) for given road segments.
The provided points will first be snapped to the most likely roads the
vehicle was traveling along.
:param path: The path of points to be snapped.
:type path: a single location, or a list o... | 0.00545 |
def disable_command(self, command: str, message_to_print: str) -> None:
"""
Disable a command and overwrite its functions
:param command: the command being disabled
:param message_to_print: what to print when this command is run or help is called on it while disabled
... | 0.005607 |
def hierarchy_nav(self, obj):
"""Renders hierarchy navigation elements (folders)."""
result_repr = '' # For items without children.
ch_count = getattr(obj, Hierarchy.CHILD_COUNT_MODEL_ATTR, 0)
is_parent_link = getattr(obj, Hierarchy.UPPER_LEVEL_MODEL_ATTR, False)
if is_parent... | 0.003226 |
def uval(self):
"Accesses :attr:`value` and :attr:`uncert` as a :class:`pwkit.msmt.Uval`."
from .msmt import Uval
return Uval.from_norm(self.value, self.uncert) | 0.016304 |
def _query(action=None,
command=None,
args=None,
method='GET',
header_dict=None,
data=None):
'''
Make a web call to RallyDev.
'''
token = _get_token()
username = __opts__.get('rallydev', {}).get('username', None)
password = __opts__.get('ral... | 0.00067 |
def check_address_has_code(
client: 'JSONRPCClient',
address: Address,
contract_name: str = '',
):
""" Checks that the given address contains code. """
result = client.web3.eth.getCode(to_checksum_address(address), 'latest')
if not result:
if contract_name:
forma... | 0.001595 |
def to_texttree(self, indent=3, func=True, symbol='ascii'):
"""Method returning a text representation of the (sub-)tree
rooted at the current node instance (`self`).
:param indent: the indentation width for each tree level.
:type indent: int
:param func: function returning a s... | 0.015695 |
def _get_cycles(graph_dict, path, visited, result, vertice):
"""recursive function doing the real work for get_cycles"""
if vertice in path:
cycle = [vertice]
for node in path[::-1]:
if node == vertice:
break
cycle.insert(0, node)
# make a canonica... | 0.001111 |
def _decode_length(self, offset, sizeof_char):
"""
Generic Length Decoding at offset of string
The method works for both 8 and 16 bit Strings.
Length checks are enforced:
* 8 bit strings: maximum of 0x7FFF bytes (See
http://androidxref.com/9.0.0_r3/xref/frameworks/base/l... | 0.00334 |
def _create_disks(service_instance, disks, scsi_controllers=None, parent=None):
'''
Returns a list of disk specs representing the disks to be created for a
virtual machine
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
disks
List of... | 0.000602 |
def inception_v3(inputs,
dropout_keep_prob=0.8,
num_classes=1000,
is_training=True,
restore_logits=True,
scope=''):
"""Latest Inception from http://arxiv.org/abs/1512.00567.
"Rethinking the Inception Architecture for Computer Vi... | 0.007303 |
def AutorizarLiquidacion(self):
"Generar o ajustar una liquidación única y obtener del CAE"
# limpio los elementos que no correspondan por estar vacios:
for campo in ["guia", "dte", "gasto", "tributo"]:
if campo in self.solicitud and not self.solicitud[campo]:
del sel... | 0.002049 |
def get_first(self, sql):
"""
Executes the sql and returns the first resulting row.
:param sql: the sql statement to be executed (str) or a list of
sql statements to execute
:type sql: str or list
"""
with self.get_conn() as cur:
cur.execute(sql)
... | 0.005666 |
def draw_hydrogen_bonds(self,color="black"):
"""For each bond that has been determined to be important, a line gets drawn.
"""
self.draw_hbonds=""
if self.hbonds!=None:
for bond in self.hbonds.hbonds_for_drawing:
x = str((self.molecule.x_dim-self.molecule.molsize1)/2)
y = str((self.molecule.y_dim-sel... | 0.017747 |
def render( self, tag, single, between, kwargs ):
"""Append the actual tags to content."""
out = "<%s" % tag
for key, value in list( kwargs.items( ) ):
if value is not None: # when value is None that means stuff like <... checked>
key = key.strip('_') ... | 0.018886 |
def convert_bytes(value):
"""
Reduces bytes to more convenient units (i.e. KiB, GiB, TiB, etc.).
Args:
values (int): Value in Bytes
Returns:
tup (tuple): Tuple of value, unit (e.g. (10, 'MiB'))
"""
n = np.rint(len(str(value))/4).astype(int)
return value/(1024**n), sizes[n] | 0.003135 |
def discover(url, options={}):
"""
Retrieve the API definition from the given URL and construct
a Patchboard to interface with it.
"""
try:
resp = requests.get(url, headers=Patchboard.default_headers)
except Exception as e:
raise PatchboardError("Problem discovering API: {0}".for... | 0.001681 |
def _edit_main(self, request):
"""Adds the link to the new unit testing results on the repo's main wiki page.
"""
self.prefix = "{}_Pull_Request_{}".format(request.repo.name, request.pull.number)
if not self.testmode:
page = site.pages[self.basepage]
text = page.t... | 0.007804 |
def _get_diff(self, cp_file):
"""Get a diff between running config and a proposed file."""
diff = []
self._create_sot_file()
diff_out = self.device.show(
'show diff rollback-patch file {0} file {1}'.format(
'sot_file', self.replace_file.split('/')[-1]), raw_te... | 0.003421 |
def disconnect(self):
"""
diconnect from the connected device
:return: bool
"""
cmd_response = self.__send_command(const.CMD_EXIT)
if cmd_response.get('status'):
self.is_connect = False
if self.__sock:
self.__sock.close()
... | 0.004975 |
def compression_type(self):
"""Return the latest compresion type used in this MAR.
Returns:
One of None, 'bz2', or 'xz'
"""
best_compression = None
for e in self.mardata.index.entries:
self.fileobj.seek(e.offset)
magic = self.fileobj.read(10)... | 0.003279 |
async def write(self, data, eof = False, buffering = True):
"""
Write output to current output stream
"""
if not self.outputstream:
self.outputstream = Stream()
self._startResponse()
elif (not buffering or eof) and not self._sendHeaders:
self._... | 0.013861 |
def sg_summary_gradient(tensor, gradient, prefix=None, name=None):
r"""Register `tensor` to summary report as `gradient`
Args:
tensor: A `Tensor` to log as gradient
gradient: A 0-D `Tensor`. A gradient to log
prefix: A `string`. A prefix to display in the tensor board web UI.
name: A `s... | 0.001344 |
def add_child(self, **kwargs):
"""Creates a new ``Node`` based on the extending class and adds it as
a child to this ``Node``.
:param kwargs:
arguments for constructing the data object associated with this
``Node``
:returns:
extender of the ``Node``... | 0.006745 |
def competitions_data_download_file(self, id, file_name, **kwargs): # noqa: E501
"""Download competition data file # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.competitions_data_... | 0.001961 |
def StrPrefixOf(prefix, input_string):
"""
Return True if the concrete value of the input_string starts with prefix
otherwise false.
:param prefix: prefix we want to check
:param input_string: the string we want to check
:return: True if the input_string starts with prefix else false
"""
... | 0.002558 |
def difference(self, another_moc, *args):
"""
Difference between the MOC instance and other MOCs.
Parameters
----------
another_moc : `~mocpy.moc.MOC`
The MOC used that will be substracted to self.
args : `~mocpy.moc.MOC`
Other additional MOCs to ... | 0.002845 |
def jobs(self, state=None, user=None, queue=None, limit=None,
started_time_begin=None, started_time_end=None,
finished_time_begin=None, finished_time_end=None):
"""
The jobs resource provides a list of the MapReduce jobs that have
finished. It does not currently return ... | 0.002029 |
def trace(fun, *a, **k):
""" define a tracer for a rule function
for log and statistic purposes """
@wraps(fun)
def tracer(*a, **k):
ret = fun(*a, **k)
print('trace:fun: %s\n ret=%s\n a=%s\nk%s\n' %
(str(fun), str(ret), str(a), str(k)))
return ret
return tracer | 0.003135 |
def save_log_entry(self, log_entry_form, *args, **kwargs):
"""Pass through to provider LogEntryAdminSession.update_log_entry"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if log_entry_form.is_for_update():
return self.update... | 0.004435 |
def _remove_trailing_spaces(line):
"""Remove trailing spaces unless they are quoted with a backslash."""
while line.endswith(' ') and not line.endswith('\\ '):
line = line[:-1]
return line.replace('\\ ', ' ') | 0.008197 |
def set_oauth_app_info(self, client_id, client_secret, redirect_uri):
"""Set the app information to use with OAuth2.
This function need only be called if your praw.ini site configuration
does not already contain the necessary information.
Go to https://www.reddit.com/prefs/apps/ to dis... | 0.002837 |
def _populate_audio_file(self):
"""
Create the ``self.audio_file`` object by reading
the audio file at ``self.audio_file_path_absolute``.
"""
self.log(u"Populate audio file...")
if self.audio_file_path_absolute is not None:
self.log([u"audio_file_path_absolute... | 0.004438 |
def handle_exception(self, frame, exc_info):
"""This function is called if an exception occurs,
but only if we are to stop at or just below this level."""
type_, value, tb = exc_info
# Python 3 is broken see http://bugs.python.org/issue17413
_value = value
if not isinstan... | 0.001903 |
def to_dict(self):
'''Dump a feature collection's features to a dictionary.
This does not include additional data, such as whether
or not the collection is read-only. The returned dictionary
is suitable for serialization into JSON, CBOR, or similar
data formats.
'''
... | 0.001753 |
def measure_cost(repeat, scipy_trans_lhs, scipy_dns_lhs, func_name, *args, **kwargs):
"""Measure time cost of running a function
"""
mx.nd.waitall()
args_list = []
for arg in args:
args_list.append(arg)
start = time.time()
if scipy_trans_lhs:
args_list[0] = np.transpose(args_... | 0.005515 |
def authorize(self):
'''
Prepare the master to expect a signing request
'''
with salt.utils.files.fopen(self.path, 'w+') as fp_:
fp_.write(str(int(time.time()))) # future lint: disable=blacklisted-function
return True | 0.011111 |
def find_args(self):
"""Build self.args using all the fields."""
return self.mpi_cmd + ['-n', str(self.n)] + self.mpi_args + \
self.program + self.program_args | 0.015789 |
def get_user_by_email(self, email):
"""
Returns details for user with the given email address.
If there is more than one match will only return the first. Use
get_users() for full result set.
"""
results = self.get_users(filter='email eq "%s"' % (email))
if resu... | 0.004815 |
def require_request_model(cls, validate=True):
"""
Makes a handler require that a request body that map towards the given
model is provided. Unless the ``validate`` option is set to ``False`` the
data will be validated against the model's fields.
The model will be passed to the handler as the last ... | 0.001252 |
def get_project_content_commit_date(root_dir='.', exclusions=None):
"""Get the datetime for the most recent commit to a project that
affected Sphinx content.
*Content* is considered any file with one of these extensions:
- ``rst`` (README.rst and LICENSE.rst are excluded)
- ``ipynb``
- ``png``... | 0.000434 |
def parsed(self):
"""Get the code object which represents the compiled Python file.
This property is cached and only parses the content once.
"""
if not self._parsed:
self._parsed = compile(self.content, self.path, 'exec')
return self._parsed | 0.006734 |
def dvds_current_releases(self, **kwargs):
"""Gets the upcoming movies from the API.
Args:
page_limit (optional): number of movies to show per page, default=16
page (optional): results page number, default=1
country (optional): localized data for selected country, default=... | 0.003396 |
def pull(self, action, image_name, **kwargs):
"""
Pulls an image for a container configuration
:param action: Action configuration.
:type action: dockermap.map.runner.ActionConfig
:param image_name: Image name.
:type image_name: unicode | str
:param kwargs: Addit... | 0.007544 |
def register(self, patterns, obj=None, instances=None, **reg_kwargs):
"""Register one object which can be matched/searched by regex.
:param patterns: a list/tuple/set of regex-pattern.
:param obj: return it while search/match success.
:param instances: instance list will search/match th... | 0.003605 |
def create(Bucket,
ACL=None, LocationConstraint=None,
GrantFullControl=None,
GrantRead=None,
GrantReadACP=None,
GrantWrite=None,
GrantWriteACP=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, create an ... | 0.004059 |
def _pprint(dic):
"""Prints a dictionary with one indentation level"""
for key, value in dic.items():
print(" {0}: {1}".format(key, value)) | 0.006173 |
def to_cloudformation(self):
"""Generates CloudFormation resources from a SAM API resource
:returns: a tuple containing the RestApi, Deployment, and Stage for an empty Api.
:rtype: tuple
"""
rest_api = self._construct_rest_api()
deployment = self._construct_deployment(r... | 0.004237 |
def sign_digest(sock, keygrip, digest, sp=subprocess, environ=None):
"""Sign a digest using specified key using GPG agent."""
hash_algo = 8 # SHA256
assert len(digest) == 32
assert communicate(sock, 'RESET').startswith(b'OK')
ttyname = check_output(args=['tty'], sp=sp).strip()
options = ['tty... | 0.000698 |
def translate_query_params(cls, **kwargs):
"""
Translate an arbirtary keyword argument to the expected query.
TODO: refactor this into something less insane.
XXX: Clean this up. It's *too* flexible.
In the v2 API, many endpoints expect a particular query argument to be
... | 0.000857 |
def live_source_load(self, source):
"""
Send new source code to the bot
:param source:
:param good_cb: callback called if code was good
:param bad_cb: callback called if code was bad (will get contents of exception)
:return:
"""
source = source.rstrip('\n... | 0.005714 |
def appropriate_for(self, usage, alg='HS256'):
"""
Make sure there is a key instance present that can be used for
the specified usage.
"""
try:
_use = USE[usage]
except:
raise ValueError('Unknown key usage')
else:
if not self.us... | 0.005272 |
def _getdevicetuple(iobtdevice):
"""
Returns an (addr, name, COD) device tuple from a IOBluetoothDevice object.
"""
addr = _macutil.formatdevaddr(iobtdevice.getAddressString())
name = iobtdevice.getName()
cod = iobtdevice.getClassOfDevice()
return (addr, name, cod) | 0.003413 |
def print_colors(palette, outfile="Palette.png"):
"""
print color palette (a tuple) to a PNG file for quick check
"""
fig = plt.figure()
ax = fig.add_subplot(111)
xmax = 20 * (len(palette) + 1)
x1s = np.arange(0, xmax, 20)
xintervals = [10] * len(palette)
xx = zip(x1s, xintervals)
... | 0.00216 |
def _double_single_alleles(df, chrom):
""" Double any single alleles in the specified chromosome.
Parameters
----------
df : pandas.DataFrame
SNPs
chrom : str
chromosome of alleles to double
Returns
-------
df : pandas.DataFrame
... | 0.004225 |
def __get_session(self):
""" Opens a db session """
db_path = self.__get_config().get(ConfigKeys.asset_allocation_database_path)
self.session = dal.get_session(db_path)
return self.session | 0.013636 |
def __send_request(self, url, params=None):
"""Send request"""
r = self.fetch(url, payload=params)
return r.text | 0.014599 |
def PushItem(self, item, block=True):
"""Pushes an item onto the queue.
Args:
item (object): item to add.
block (Optional[bool]): True to block the process when the queue is full.
Raises:
QueueFull: if the item could not be pushed the queue because it's full.
"""
try:
self.... | 0.007059 |
def attention_mask_same_segment(
query_segment, memory_segment=None, dtype=tf.float32):
"""Bias for attention where attention between segments is disallowed.
Args:
query_segment: a mtf.Tensor with shape [..., length_dim]
memory_segment: a mtf.Tensor with shape [..., memory_length_dim]
dtype: a tf.d... | 0.008696 |
def get_assessment_part_mdata():
"""Return default mdata map for AssessmentPart"""
return {
'assessment_part': {
'element_label': {
'text': 'assessment part',
'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
'scriptTypeId': str(DEFAULT_SCRIPT_TYPE... | 0.000296 |
def pmap(f, iterable, n=None, dummy=False, p=None):
"""
parallel map of a function to an iterable
if each item in iterable is itself an iterable, then
automatically call f(*item) instead of f(item)
Arguments:
f: function
iterable: any iterable where each item is sent to f
n: numbe... | 0.003165 |
def uninstall(*package_names):
"""
Uninstall one or more packages using the Python equivalent of ``pip uninstall --yes``.
The package(s) to uninstall must be installed, otherwise pip will raise an
``UninstallationError``. You can check for installed packages using
:func:`is_installed()`.
:para... | 0.003802 |
def lessThan(self, left, right):
'''Return ordering of *left* vs *right*.'''
sourceModel = self.sourceModel()
if sourceModel:
leftItem = sourceModel.item(left)
rightItem = sourceModel.item(right)
if (isinstance(leftItem, Directory)
and not isi... | 0.007634 |
def s2n(self, offset, length, signed=0):
"""
Convert slice to integer, based on sign and endian flags.
Usually this offset is assumed to be relative to the beginning of the
start of the EXIF information.
For some cameras that use relative tags, this offset may be relative
... | 0.002717 |
def update_user_info(self, **kwargs):
"""Update user info and settings.
:param \*\*kwargs: settings to be merged with
:func:`User.get_configfile` setings and sent to Filemail.
:rtype: ``bool``
"""
if kwargs:
self.config.update(kwargs)
method, url =... | 0.008032 |
def _secondary_values(self):
"""Getter for secondary series values (flattened)"""
return [
val for serie in self.secondary_series for val in serie.values
if val is not None
] | 0.009009 |
def as_boxes(self, colors=None):
"""
A rough Trimesh representation of the voxels with a box
for each filled voxel.
Parameters
----------
colors : (3,) or (4,) float or uint8
(X, Y, Z, 3) or (X, Y, Z, 4) float or uint8
Where matrix.shape == (X, ... | 0.001691 |
def timed_grep_nodes_for_patterns(self, versions_to_patterns, timeout_seconds, filename="system.log"):
"""
Searches all nodes in the cluster for a specific regular expression based on the node's version.
Params:
@versions_to_patterns : an instance of LogPatternToVersionMap, specifying th... | 0.006527 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.