text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def _get_req_rem_geo(self, ds_info):
"""Find out which geolocation files are needed."""
if ds_info['dataset_groups'][0].startswith('GM'):
if self.use_tc is False:
req_geo = 'GMODO'
rem_geo = 'GMTCO'
else:
req_geo = 'GMTCO'
... | 0.004115 |
def get_asset_admin_session_for_repository(self, repository_id=None, proxy=None):
"""Gets an asset administration session for the given repository.
arg: repository_id (osid.id.Id): the ``Id`` of the repository
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.repository.AssetAd... | 0.004688 |
def available(software=True,
drivers=True,
summary=False,
skip_installed=True,
skip_hidden=True,
skip_mandatory=False,
skip_reboot=False,
categories=None,
severities=None,):
'''
.. versionadded:: 2017... | 0.001002 |
def embed(inp, n_inputs, n_features, initializer=None,
fix_parameters=False, apply_w=None):
""" Embed.
Embed slices a matrix/tensor with indexing array/tensor. Weights are initialized with :obj:`nnabla.initializer.UniformInitializer` within the range of :math:`-\\sqrt{3}` and :math:`\\sqrt{3}`.
... | 0.004413 |
def __bayesian_information_criterion(self, clusters, centers):
"""!
@brief Calculates splitting criterion for input clusters using bayesian information criterion.
@param[in] clusters (list): Clusters for which splitting criterion should be calculated.
@param[in] centers (li... | 0.009671 |
def diagnostics(self, **kwds):
"""
Endpoint: /system/diagnostics.json
Runs a set of diagnostic tests on the server.
Returns a dictionary containing the results.
"""
# Don't process the result automatically, since this raises an exception
# on failure, which doesn... | 0.005725 |
def skills_name_show(self, name, **kwargs):
"https://developer.zendesk.com/rest_api/docs/chat/skills#get-skill-by-name"
api_path = "/api/v2/skills/name/{name}"
api_path = api_path.format(name=name)
return self.call(api_path, **kwargs) | 0.011278 |
def silhouette_score(self, data, metric='euclidean', sample_size=None, random_state=None, **kwds):
"""
Computes the mean Silhouette Coefficient of all samples (implicit evaluation)
:param data: The data that the clusters are generated from
:param metric: the pairwise distance metric
... | 0.01039 |
def orient(args):
"""
%prog orient in.gff3 features.fasta > out.gff3
Change the feature orientations based on translation. This script is often
needed in fixing the strand information after mapping RNA-seq transcripts.
You can generate the features.fasta similar to this command:
$ %prog load ... | 0.000777 |
def install_script(self, dist, script_name, script_text, dev_path=None):
"""Generate a legacy script wrapper and install it"""
spec = str(dist.as_requirement())
is_script = is_python_script(script_text, script_name)
if is_script:
script_text = (ScriptWriter.get_header(script... | 0.004301 |
def init_from_acceptor(self, acceptor):
"""
Adds a sink state
Args:
alphabet (list): The input alphabet
Returns:
None
"""
self.states = copy.deepcopy(acceptor.states)
self.alphabet = copy.deepcopy(acceptor.alphabet)
self.osyms = cop... | 0.005038 |
def get_object(self):
"""
If a single object has been requested, will set
`self.object` and return the object.
"""
queryset = None
slug = self.kwargs.get(self.slug_url_kwarg, None)
if slug is not None:
queryset = self.get_queryset()
slug_f... | 0.003534 |
def _ns_query(self, session):
"""
Return a SQLAlchemy query that is already namespaced by the app and namespace given to this backend
during initialization.
Returns: a SQLAlchemy query object
"""
return session.query(ORMJob).filter(ORMJob.app == self.app,
... | 0.007813 |
def release_job(self, job_id, pri=65536, delay=0):
"""Put a job back on the queue to be processed (indicating that you've aborted it)
You can only release a job which you have reserved using :func:`reserve_job()` or :func:`reserve_iter()`.
:param job_id: Job ID to return
:param pri: Ne... | 0.00646 |
def applyIndex(self, lst, right):
"""Apply a list to something else."""
if len(right) != 1:
raise exceptions.EvaluationError('%r can only be applied to one argument, got %r' % (self.left, self.right))
right = right[0]
if isinstance(right, int):
return lst[right]
raise exceptions.Evalua... | 0.01182 |
def add_file(self, f):
"""Add a partition identity as a child of a dataset identity."""
if not self.files:
self.files = set()
self.files.add(f)
self.locations.set(f.type_) | 0.009174 |
def gen_goal(self, y_des):
"""Generate the goal for path imitation.
For rhythmic DMPs the goal is the average of the
desired trajectory.
y_des np.array: the desired trajectory to follow
"""
goal = np.zeros(self.dmps)
for n in range(self.dmps):
... | 0.023301 |
def new(arg_name, annotated_with=None):
"""Creates a BindingKey.
Args:
arg_name: the name of the bound arg
annotation: an Annotation, or None to create an unannotated binding key
Returns:
a new BindingKey
"""
if annotated_with is not None:
annotation = annotations.Annotati... | 0.002278 |
def __get_switch_arr(work_sheet, row_num):
'''
if valud of the column of the row is `1`, it will be added to the array.
'''
u_dic = []
for col_idx in FILTER_COLUMNS:
cell_val = work_sheet['{0}{1}'.format(col_idx, row_num)].value
if cell_val in [1, '1']:
# Appending the ... | 0.004425 |
def get_or_connect(cls, **kwargs):
"""
Try to retrieve an object in db, and create it if it does not exist.
"""
try:
inst = cls.get(**kwargs)
created = False
except DoesNotExist:
inst = cls(**kwargs)
created = True
except Ex... | 0.005333 |
def get_collections(self, username="", calculate_size=False, ext_preload=False, offset=0, limit=10):
"""Fetch collection folders
:param username: The user to list folders for, if omitted the authenticated user is used
:param calculate_size: The option to include the content count per each coll... | 0.008845 |
def get_context_data(self, **kwargs):
'''
Adds a 'base_template' attribute to context for the page_detail to
extend from
'''
context = super(PageList, self).get_context_data(**kwargs)
page_base_template = "nupages/base.html"
# if MultiTenantMiddleware is used, us... | 0.008559 |
def Network_getCertificate(self, origin):
"""
Function path: Network.getCertificate
Domain: Network
Method name: getCertificate
WARNING: This function is marked 'Experimental'!
Parameters:
Required arguments:
'origin' (type: string) -> Origin to get certificate for.
Returns:
'table... | 0.049624 |
def get_input_location(location):
"""
Similar to :meth:`get_input_peer`, but for input messages.
Note that this returns a tuple ``(dc_id, location)``, the
``dc_id`` being present if known.
"""
try:
if location.SUBCLASS_OF_ID == 0x1523d462:
return None, location # crc32(b'In... | 0.000673 |
def _gh(self, x):
""" Evaluates the constraint function values.
"""
Pgen = x[self._Pg.i1:self._Pg.iN + 1] # Active generation in p.u.
Qgen = x[self._Qg.i1:self._Qg.iN + 1] # Reactive generation in p.u.
for i, gen in enumerate(self._gn):
gen.p = Pgen[i] * self._base_m... | 0.003815 |
def listener(self, acceptor, wrapper):
"""
Listens for new connections to the manager's endpoint. Once a
new connection is received, a TCPTendril object is generated
for it and it is passed to the acceptor, which must initialize
the state of the connection. If no acceptor is gi... | 0.000694 |
def getCol(self, x):
"""return the x-th column, starting at 0"""
return [self.getCell(x, i) for i in self.__size_range] | 0.014815 |
def addAction(self, action):
"""
Adds the inputed action to this toolbar.
:param action | <QAction>
"""
super(XDockToolbar, self).addAction(action)
label = XDockActionLabel(action, self.minimumPixmapSize(), self)
label.setPosition(s... | 0.011547 |
def evict(cls, urls):
"""Remove items from cache matching URLs.
Return the number of items removed.
"""
if isinstance(urls, text_type):
urls = [urls]
urls = set(normalize_url(url) for url in urls)
retval = 0
with cls.ca_lock:
for key in l... | 0.00396 |
def set_guest_access(self, allow_guests):
"""Set whether guests can join the room and return True if successful."""
guest_access = "can_join" if allow_guests else "forbidden"
try:
self.client.api.set_guest_access(self.room_id, guest_access)
self.guest_access = allow_guest... | 0.007407 |
def add_handler(self, handler):
''' Add an additional handler
Args:
handler:
A dictionary of handler configuration for the handler
that should be added. See :func:`__init__` for details
on valid parameters.
'''
handler['logger'... | 0.004367 |
def _apply_conv(self, inputs, w):
"""Apply a `separable_conv2d` operation on `inputs` using `w`.
Args:
inputs: A Tensor of shape `data_format` and of type `tf.float16`,
`tf.bfloat16` or `tf.float32`.
w: A tuple of weight matrices of the same type as `inputs`, the first
being the d... | 0.001101 |
def parse_only_extr_license(self, extr_lic):
"""
Return an ExtractedLicense object to represent a license object.
But does not add it to the SPDXDocument model.
Return None if failed.
"""
# Grab all possible values
ident = self.get_extr_license_ident(extr_lic)
... | 0.001982 |
def fingerprint(self, word, n_bits=16, most_common=MOST_COMMON_LETTERS_CG):
"""Return the occurrence halved fingerprint.
Based on the occurrence halved fingerprint from :cite:`Cislak:2017`.
Parameters
----------
word : str
The word to fingerprint
n_bits : in... | 0.001256 |
def is_compliant(self, path):
"""Checks if the directory is compliant.
Used to determine if the path specified and all of its children
directories are in compliance with the check itself.
:param path: the directory path to check
:returns: True if the directory tree is compliant... | 0.002172 |
def store_api_url(self):
"""Returns the API url for storing events."""
return "%s://%s%sapi/%s/store/" % (
self.scheme,
self.host,
self.path,
self.project_id,
) | 0.008621 |
def lookup_field_help(self, field, default=None):
"""
Looks up the help text for the passed in field.
"""
help = None
# is there a label specified for this field
if field in self.field_config and 'help' in self.field_config[field]:
help = self.field_config[fi... | 0.002759 |
def set_save_directory(base, source):
"""Sets the root save directory for saving screenshots.
Screenshots will be saved in subdirectories under this directory by
browser window size. """
root = os.path.join(base, source)
if not os.path.isdir(root):
os.makedirs(root)
world.screensho... | 0.006006 |
def indices_outside_segments(times, segment_files, ifo=None, segment_name=None):
""" Return the list of indices that are outside the segments in the
list of segment files.
Parameters
----------
times: numpy.ndarray of integer type
Array of gps start times
segment_files: string or list o... | 0.002973 |
def displayResponse(request, openid_response):
"""
Display an OpenID response. Errors will be displayed directly to
the user; successful responses and other protocol-level messages
will be sent using the proper mechanism (i.e., direct response,
redirection, etc.).
"""
s = getServer(request)... | 0.001031 |
def query_tag_values(self, metric_type=None, **tags):
"""
Query for possible tag values.
:param metric_type: A MetricType to be queried. If left to None, matches all the MetricTypes
:param tags: A dict of tag key/value pairs. Uses Hawkular-Metrics tag query language for syntax
"... | 0.010616 |
def sync(self, sync_set, force=0, site=None, role=None):
"""
Uploads media to an Amazon S3 bucket using s3sync.
Requires s3cmd. Install with:
pip install s3cmd
"""
from burlap.dj import dj
force = int(force)
r = self.local_renderer
r.env.s... | 0.00485 |
def enums():
"""
Return the dictionary of H₂O enums, retrieved from data in schemas(). For each entry in the dictionary its key is
the name of the enum, and the value is the set of all enum values.
"""
enumset = defaultdict(set)
for schema in schemas():
for field in schema["fields"]:
... | 0.004494 |
def _connect(self):
"""
Retrieve token from USMA API and create an authenticated session
:returns OAuth2Session: authenticated client session
"""
oauth_client = BackendApplicationClient(client_id=self.client_id)
oauth_session = OAuth2Session(client=oauth_client)
t... | 0.010014 |
def tree(path, depth=2, topdown=True, followlinks=False, showhidden=False):
"""A generator return a tuple with three elements (root, dirs, files)."""
rt = []
for root, dirs, files in os.walk(path, topdown=topdown, followlinks=followlinks):
if not showhidden and File.is_hidden(root):
cont... | 0.00418 |
def search(self, q, field=None, page=None, per_page=None):
"""Search across all (without field) or in specific field
(valid fields at http://www.loc.gov/standards/mods/mods-outline.html)"""
def picker(results):
if type(results['result']) == list:
return results['resu... | 0.008333 |
def get_framebuffer_size(window):
"""
Retrieves the size of the framebuffer of the specified window.
Wrapper for:
void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height);
"""
width_value = ctypes.c_int(0)
width = ctypes.pointer(width_value)
height_value = ctypes.c_i... | 0.004237 |
def set_flat(self, new_weights):
"""Sets the weights to new_weights, converting from a flat array.
Note:
You can only set all weights in the network using this function,
i.e., the length of the array must match get_flat_size.
Args:
new_weights (np.ndarray): ... | 0.002688 |
def _ordered_struct_start_handler(handler, ctx):
"""Handles the special case of ordered structs, specified by the type ID 0xD1.
This coroutine's only purpose is to ensure that the struct in question declares at least one field name/value pair,
as required by the spec.
"""
_, self = yield
self_h... | 0.006527 |
def Cpu():
""" Get number of available CPUs """
cpu = 'Unknown'
try:
cpu = str(multiprocessing.cpu_count())
except Exception as e: # pragma: no cover
logger.error("Can't access CPU count' " + str(e))
return cpu | 0.004032 |
def asbaseline(self, pos):
"""Convert a position measure into a baseline measure. No actual
baseline is calculated, since operations can be done on positions,
with subtractions to obtain baselines at a later stage.
:param pos: a position measure
:returns: a baseline measure
... | 0.003003 |
def kernel_integrity(attrs=None, where=None):
'''
Return kernel_integrity information from osquery
CLI Example:
.. code-block:: bash
salt '*' osquery.kernel_integrity
'''
if __grains__['os_family'] in ['RedHat', 'Debian']:
return _osquery_cmd(table='kernel_integrity', attrs=at... | 0.00464 |
def container_present(name, profile):
'''
Ensures a container is present.
:param name: Container name
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
'''
containers = __salt__['libcloud_storage.list_containers'](profile)
match = [z for z in containers i... | 0.001704 |
def mark_day(self, day, month=None, year=None):
"""Marks the specified month day with a visual marker
(typically by making the number bold).
If only day is specified and the calendar month and year
are changed, the marked day remain marked.
You can be more specific setting month ... | 0.004854 |
def get_field_reduced_index(self, index):
"""
reduced index: modulo of extensible has been applied
"""
# return index if not extensible
if self.extensible_info is None:
return index
# manage extensible
cycle_start, cycle_len, _ = self.extensib... | 0.009709 |
def read(self, **keys):
"""
read data from this HDU
By default, all data are read.
send columns= and rows= to select subsets of the data.
Table data are read into a recarray; use read_column() to get a single
column as an ordinary array. You can alternatively use slice... | 0.001255 |
def get_device_by_ain(self, ain):
"""Returns a device specified by the AIN."""
devices = self.get_devices()
for device in devices:
if device.ain == ain:
return device | 0.009174 |
def kalman_filter(kalman_state, old_indices, coordinates, q, r):
'''Return the kalman filter for the features in the new frame
kalman_state - state from last frame
old_indices - the index per feature in the last frame or -1 for new
coordinates - Coordinates of the features in the new frame.
q - ... | 0.0039 |
def perturbed_contents(self):
"""Perturb the given animal."""
animal = json.loads(self.contents)
for prop, prop_range in self.properties.items():
range = prop_range[1] - prop_range[0]
jittered = animal[prop] + random.gauss(0, 0.1 * range)
animal[prop] = max(m... | 0.005025 |
def get_instance(self, payload):
"""
Build an instance of InviteInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.chat.v2.service.channel.invite.InviteInstance
:rtype: twilio.rest.chat.v2.service.channel.invite.InviteInstance
"""
... | 0.003922 |
def create(cls, train_ds, valid_ds, test_ds=None, path:PathOrStr='.', no_check:bool=False, bs=64, val_bs:int=None,
num_workers:int=0, device:torch.device=None, collate_fn:Callable=data_collate,
dl_tfms:Optional[Collection[Callable]]=None, bptt:int=70, backwards:bool=False, **dl_kwargs) -> ... | 0.045226 |
def t_less_variable(self, t):
r'@@?[\w-]+|@\{[^@\}]+\}'
v = t.value.lower()
if v in reserved.tokens:
t.type = reserved.tokens[v]
if t.type == "css_media":
t.lexer.push_state("mediaquery")
elif t.type == "css_import":
t.lexer.pus... | 0.00565 |
def files(self, entity_id, manifest=None, filename=None,
read_file=False, channel=None):
'''
Get the files or file contents of a file for an entity.
If all files are requested, a dictionary of filenames and urls for the
files in the archive are returned.
If filena... | 0.001565 |
def get_mailbox(value):
""" mailbox = name-addr / addr-spec
"""
# The only way to figure out if we are dealing with a name-addr or an
# addr-spec is to try parsing each one.
mailbox = Mailbox()
try:
token, value = get_name_addr(value)
except errors.HeaderParseError:
try:
... | 0.002793 |
def onLiveLocation(
self,
mid=None,
location=None,
author_id=None,
thread_id=None,
thread_type=None,
ts=None,
msg=None,
):
"""
Called when the client is listening and somebody sends live location info
:param mid: The action ID
... | 0.007597 |
def set_special(index, color, iterm_name="h", alpha=100):
"""Convert a hex color to a special sequence."""
if OS == "Darwin" and iterm_name:
return "\033]P%s%s\033\\" % (iterm_name, color.strip("#"))
if index in [11, 708] and alpha != "100":
return "\033]%s;[%s]%s\033\\" % (index, alpha, co... | 0.002688 |
def kpoints(self):
"""
Generate gamma center k-points mesh grid for GW calc,
which is requested by GW calculation.
"""
return Kpoints.automatic_density_by_vol(self.structure,
self.reciprocal_density,
... | 0.005666 |
def process_topojson(self, name, layer, input_path):
"""
Process layer using topojson.
"""
output_path = os.path.join(TEMP_DIRECTORY, '%s.topojson' % name)
# Use local topojson binary
topojson_binary = 'node_modules/bin/topojson'
if not os.path.exists(topojson_b... | 0.001642 |
def _snapshot_to_data(snapshot):
'''
Returns snapshot data from a D-Bus response.
A snapshot D-Bus response is a dbus.Struct containing the
information related to a snapshot:
[id, type, pre_snapshot, timestamp, user, description,
cleanup_algorithm, userdata]
id: dbus.UInt32
type: dbu... | 0.000963 |
def make_embedded_push(value):
"""Returns a closure that pushed the given value onto a Machine's stack.
We use this to embed stack pushes in the VM code, so that the interpreter
can assume that all instructions are callable Python functions. This makes
dispatching much faster than checking if an instru... | 0.004158 |
def cli(ctx, board, scons, project_dir, sayyes):
"""Manage apio projects."""
if scons:
Project().create_sconstruct(project_dir, sayyes)
elif board:
Project().create_ini(board, project_dir, sayyes)
else:
click.secho(ctx.get_help()) | 0.00369 |
def get_user(self, username, *, mode=OsuMode.osu, event_days=31):
"""Get a user profile.
Parameters
----------
username : str or int
A `str` representing the user's username, or an `int` representing the user's id.
mode : :class:`osuapi.enums.OsuMode`
The... | 0.005355 |
def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'from_') and self.from_ is not None:
_dict['from'] = self.from_
if hasattr(self, 'to') and self.to is not None:
_dict['to'] = self.to
if hasattr(self, '... | 0.002976 |
def security_iter(nodearr):
""" provide a security data iterator by returning a tuple of (Element, SecurityError) which are mutually exclusive """
assert nodearr.Name == 'securityData' and nodearr.IsArray
for i in range(nodearr.NumValues):
node = nodearr.GetValue(i)
err =... | 0.006849 |
def get_randomness_stream(self, decision_point: str, for_initialization: bool=False) -> RandomnessStream:
"""Provides a new source of random numbers for the given decision point.
Parameters
----------
decision_point :
A unique identifier for a stream of random numbers. Typi... | 0.010356 |
def sync(self):
"""Keep the repository in sync.
This method will synchronize the repository with its 'origin',
fetching newest objects and updating references. It uses low
level commands which allow to keep track of which things
have changed in the repository.
The metho... | 0.001951 |
def init_widget(self):
""" Initialize the widget with the source. """
d = self.declaration
if d.source:
self.set_source(d.source)
else:
super(RawComponent, self).init_widget() | 0.008658 |
def create(cls, settings):
"""Create a :class:`BluetoothConnection`:
.. sourcecode:: python
from escpos import BluetoothConnection
from escpos.impl.epson import GenericESCPOS
conn = BluetoothConnection.create('00:01:02:03:04:05')
printer = GenericESCPOS... | 0.00216 |
def union(self, other, left_name="LEFT", right_name="RIGHT"):
"""
*Wrapper of* ``UNION``
The UNION operation is used to integrate homogeneous or heterogeneous samples of two
datasets within a single dataset; for each sample of either one of the input datasets, a
sample is create... | 0.005405 |
def print_headers(head, outfile=None, silent=False):
"""
Print the vcf headers.
If a result file is provided headers will be printed here, otherwise
they are printed to stdout.
Args:
head (HeaderParser): A vcf header object
outfile (FileHandle): A file handle
silent... | 0.008636 |
def sendToLogbook(self, fileName, logType, location=None):
'''Process log information and push to selected logbooks.'''
import subprocess
success = True
if logType == "MCC":
fileString = ""
if not self.imagePixmap.isNull():
fileString = fi... | 0.005517 |
def get_as_list(self, tag_name):
"""
Return the value of a tag, making sure that it's a list. Absent
tags are returned as an empty-list; single tags are returned as a
one-element list.
The returned list is a copy, and modifications do not affect the
original object.
... | 0.00431 |
def count_consonants(text):
"""Count number of occurrences of consonants in a given string"""
count = 0
for i in text:
if i.lower() in config.AVRO_CONSONANTS:
count += 1
return count | 0.004587 |
def addNoise(self, nlf_coeff, date=None, info='', error=None):
'''
Args:
nlf_coeff (list)
error (float): absolute
info (str): additional information
date (str): "DD Mon YY" e.g. "30 Nov 16"
'''
date = _toDate(date)
d = self... | 0.004843 |
def steppify(x, y):
"""
Steppify a curve (x, y). This is useful for filling histograms manually.
"""
dx = 0.5 * (x[1:] + x[:-1])
xx = numpy.zeros(2 * len(dx), dtype=float)
yy = numpy.zeros(2 * len(y), dtype=float)
xx[0::2], xx[1::2] = dx, dx
yy[0::2], yy[1::2] = y, y
xx = numpy.con... | 0.002299 |
def run_blast_commands(ncbicommandline_method, **keywords):
"""Runs blastplus/tblastn search, collects result and pass as a xml temporary file. """
# temporary files for output
blast_out_tmp = tempfile.NamedTemporaryFile(mode="w+",delete=False)
keywords['out'] = blast_out_tmp.name
# unpack query ... | 0.003405 |
def get_hash(fName, readSize, dire=pDir()):
"""
creates the required hash
"""
if not fileExists(fName, dire):
return -1
readSize = readSize * 1024 # bytes to be read
fName = os.path.join(dire, fName) # name coupled with path
with open(fName, 'rb') as f:
size = os.path.getsize... | 0.005792 |
def get_instance_id():
"""Gets the instance ID of this EC2 instance
:return: String instance ID or None
"""
log = logging.getLogger(mod_logger + '.get_instance_id')
# Exit if not running on AWS
if not is_aws():
log.info('This machine is not running in AWS, exiting...')
return
... | 0.002134 |
def stats(self, date=None):
'''Return the current statistics for a given queue on a given date.
The results are returned are a JSON blob::
{
'total' : ...,
'mean' : ...,
'variance' : ...,
'histogram': [
... | 0.002484 |
def connectionLost(self, reason):
"""
Tells the box receiver to stop receiving boxes.
"""
self._remote.boxReceiver.stopReceivingBoxes(reason)
return basic.NetstringReceiver.connectionLost(self, reason) | 0.008299 |
def describe_events(ApplicationName=None, VersionLabel=None, TemplateName=None, EnvironmentId=None, EnvironmentName=None, PlatformArn=None, RequestId=None, Severity=None, StartTime=None, EndTime=None, MaxRecords=None, NextToken=None):
"""
Returns list of event descriptions matching criteria up to the last 6 wee... | 0.005683 |
def _assert(self, expression: Bool):
"""Auxiliary method to send an assert"""
assert isinstance(expression, Bool)
smtlib = translate_to_smtlib(expression)
self._send('(assert %s)' % smtlib) | 0.00905 |
def link_bus(self, bus_idx):
"""
Return the indices of elements linking the given buses
:param bus_idx:
:return:
"""
ret = []
if not self._config['is_series']:
self.log(
'link_bus function is not valid for non-series model <{}>'.
... | 0.001684 |
def _validate(cls, message):
"""Confirm the validitiy of a given dict as an OpenXC message.
Returns:
``True`` if the message contains at least a ``name`` and ``value``.
"""
valid = False
if(('name' in message and 'value' in message) or
('id' in messag... | 0.005102 |
def listpid(toggle='basic'): # Add method to exclude elements from list
'''list pids'''
proc=psutil.process_iter()# evalute if its better to keep one instance of this or generate here?
if toggle=='basic':
host=gethostname()
host2=os.getenv('HOME').split(sep='/' )[-1]
for row in pro... | 0.019211 |
def upload_create(self, tags, rating, file_=None, source=None,
parent_id=None):
"""Function to create a new upload (Requires login).
Parameters:
tags (str):
rating (str): Can be: `s`, `q`, or `e`. Alternatively, you can
specify `ra... | 0.002532 |
def convert_to_id(s, id_set):
""" Some parts of .wxs need an Id attribute (for example: The File and
Directory directives. The charset is limited to A-Z, a-z, digits,
underscores, periods. Each Id must begin with a letter or with a
underscore. Google for "CNDL0015" for information about this.
Requi... | 0.004096 |
def contract_from_file(fname):
"""
Loads a Barrister IDL JSON from the given file and returns a Contract class
:Parameters:
fname
Filename containing Barrister IDL JSON to load
"""
f = open(fname)
j = f.read()
f.close()
return Contract(json.loads(j)) | 0.003367 |
def OSIncludes(self):
"""
Microsoft Windows SDK Include
"""
include = os.path.join(self.si.WindowsSdkDir, 'include')
if self.vc_ver <= 10.0:
return [include, os.path.join(include, 'gl')]
else:
if self.vc_ver >= 14.0:
sdkver = self... | 0.00354 |
def list_roles(self, mount_point=DEFAULT_MOUNT_POINT):
"""List all the roles that are registered with the plugin.
Supported methods:
LIST: /auth/{mount_point}/roles. Produces: 200 application/json
:param mount_point: The "path" the azure auth method was mounted on.
:type m... | 0.00463 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.