content stringlengths 22 815k | id int64 0 4.91M |
|---|---|
def run_cmd(*args):
"""
Run program and capture output in the log file.
"""
for is_error, line in pipe_cmd(*args):
if G.log_file:
if is_error:
s = '[ERROR] %s\n' % line
G.log_file.write(s)
sys.stderr.write(s)
else:
... | 5,309,600 |
def test_audit_files_template_details_success(security_centre):
"""
test audit files template details success
"""
template = security_centre.audit_files.template_details(1,
fields=['id', 'name', 'categoryName', 'categoryId'])
assert isinstance(template,... | 5,309,601 |
def capsules_init(inputs, filter_size, stride, OUT, pose_shape, padding='VALID',
add_reg=False, use_bias=True, name=None):
"""This constructs a primary capsule layer from a regular convolution layer."""
with tf.variable_scope(name):
sum_list = []
num_filters = OUT * pose_shape[... | 5,309,602 |
def secure_erase_key( key_path ):
"""
'Securely' erase a key at key_path.
Fill it with random data first, flush the data,
and then unlink it.
Return True on success
Return False on error.
"""
try:
size = os.stat( key_path ).st_size
except OSError, oe:
log.error("Failed to stat %s"... | 5,309,603 |
def get_chamber_bills(
session, chamber, page_size=None, page=None
) -> ChamberBillList: # noqa: E501
"""get_chamber_bills
Retrieving a list of bills # noqa: E501
:param session: Congress session
:type session: str
:param chamber: The chamber of Congress to query
:type chamber: str
:p... | 5,309,604 |
def from_nested_to_multi_index(X, instance_index=None, time_index=None):
"""Converts nested pandas DataFrame (with time series as pandas Series
or NumPy array in cells) into multi-indexed pandas DataFrame.
Can convert mixed nested and primitive DataFrame to multi-index DataFrame.
Parameters
------... | 5,309,605 |
def lt24lcd_driver(glbl, lcd, cmd, datalen, data,
datasent, datalast, cmd_in_progress, maxlen=76800):
"""
:param glbl:
:param lcd:
:param cmd:
:param datalen: number of data xfer to do
:param data: data to be sent
:param data_sent: one cycle strobe indicating the data xf... | 5,309,606 |
async def craete(*args: Any, **kwargs: Any) -> Page:
"""[Deprecated] miss-spelled function.
This function is undocumented and will be removed in future release.
"""
logger.warning(
'`craete` function is deprecated and will be removed in future. '
'Use `Page.create` instead.'
)
r... | 5,309,607 |
def __get_candidate_set(previous: int, candidates: np.ndarray, visited: np.ndarray) -> int:
""" Рандомный из кандидатов """
candidates = np.array([idx for idx in candidates[previous] if idx != -1 and not visited[idx]])
if len(candidates) != 0:
return np.random.choice(candidates)
return -1 | 5,309,608 |
def download_dataset(download_dir='data/',
url='http://data.csail.mit.edu/places/places365/places365standard_easyformat.tar'):
"""
Download a dataset in format .zip, .tar, .tar.gz or .tgz and extract the data.
Inspired by: https://github.com/Hvass-Labs/TensorFlow-Tutorials/blob/master/d... | 5,309,609 |
def filter_by_period(
obj, start_time, end_time, axis=None, mode=None, verbosity=logging.DEBUG
):
"""
Filter an obj that can be sliced with [start_time:end_time] reporting
stats.
"""
log.log(verbosity, "# Filtering in [%s, %s]", start_time, end_time)
if isinstance(obj, pd.Panel) or isinstanc... | 5,309,610 |
def trim_jumps(sweep, jump_size, trim=1, x_column=None):
"""
Clean up jumps in the data by removing several data points around them.
Remove `trim` datapoints on both sides of jumps if at least `jump_size`.
For multi-column data, `x_column` specifies the columns of interest.
"""
if not isinstanc... | 5,309,611 |
def install_import_hooks():
"""
Install Xonsh import hooks in ``sys.meta_path`` in order for ``.xsh`` files
to be importable and import events to be fired.
Can safely be called many times, will be no-op if xonsh import hooks are
already present.
"""
found_imp = found_event = False
for h... | 5,309,612 |
def load_unknown_sample(sample_file_name, stomp_map, args):
""" Method for loading a set of objects with unknown redshifts into
the-wizz. This function maskes the data and returns a STOMP.iTreeMap object
which is a searchable quad tree where each object stored has a unique
index. If a name of an index c... | 5,309,613 |
def create_status_table(conn):
""" Create the restoration status table if it isn't already there.
Args:
conn: A connection to the master server for this replica set.
Returns:
nothing
"""
try:
cursor = conn.cursor()
cursor.execute(XB_RESTORE_STATUS)
... | 5,309,614 |
def run(
input_video_files: List[str],
log_manager: LogManager,
global_configurations: GlobalConfigurations,
do_adaptiveThreshold_scan: bool
):
"""Runs the observation framework, loads configuration from Test Runner
and reads the recorded video file
"""
observation_framework = None
s... | 5,309,615 |
def _left_to_right_overlap(biluov, sentence):
"""
LEFTMOST TAG MUST BE 'V'
>>> _left_to_right_overlap(['V', 'V', 'O', 'V', 'I', 'L', 'O', 'I', 'L'], range(9))
[[0, 1, 3, 4, 5], [0, 1, 3, 7, 8]]
>>> _left_to_right_overlap(['V', 'O', 'V', 'O'], range(4))
[]
>>> _left_to_right_overlap(['V', 'O... | 5,309,616 |
def terminal_values(rets):
"""
Computes the terminal values from a set of returns supplied as a T x N DataFrame
Return a Series of length N indexed by the columns of rets
"""
return (rets+1).prod() | 5,309,617 |
def get_next_match(result_q, word, collection, signature, cutoff=0.5, max_in_cursor=100):
"""Given a cursor, iterate through matches
Scans a cursor for word matches below a distance threshold.
Exhausts a cursor, possibly enqueuing many matches
Note that placing this function outside the SignatureCollec... | 5,309,618 |
def assemble_batch(folder_list, species="C", descriptor=None):
"""Looks in all folders for results to create a large batch to test the
network on.
Args:
- folder_list <list<str>>: a list of full paths to data base folders
w/ molecule results in them as subfolders.
- species <str>:... | 5,309,619 |
def _wip_embed(parent_locals=None, parent_globals=None, exec_lines=None,
remove_pyqt_hook=True, N=0):
"""
Starts interactive session. Similar to keyboard command in matlab.
Wrapper around IPython.embed
Notes:
#https://github.com/ipython/ipython/wiki/Cookbook%3a-Updating-code-for-... | 5,309,620 |
def stretch_mat_creation(refcc, str_range=0.01, nstr=1001):
""" Matrix of stretched instance of a reference trace.
From the MIIC Development Team (eraldo.pomponi@uni-leipzig.de)
The reference trace is stretched using a cubic spline interpolation
algorithm form ``-str_range`` to ``str_range`` (in %) for... | 5,309,621 |
def clip_matrix(left, right, bottom, top, near, far, perspective=False):
"""Return matrix to obtain normalized device coordinates from frustrum.
"""
if left >= right or bottom >= top or near >= far:
raise ValueError("invalid frustrum")
if perspective:
if near <= _EPS:
raise V... | 5,309,622 |
def flip_horizontal(old_img):
""" flip the image over the y axis """
rows = old_img.shape[0]
cols = old_img.shape[1]
new_img = np.zeros((rows, cols), np.uint8) # create a black grayscale image having same size as original
for c in range(1, cols + 1): # iterate over the image columns (+1 because ra... | 5,309,623 |
def test_kafka_origin_cluster(sdc_builder, sdc_executor, cluster, port):
"""Write simple text messages into Kafka and confirm that Kafka successfully reads them.
Because cluster mode pipelines don't support snapshots, we do this verification using a
second standalone pipeline whose origin is an SDC RPC writ... | 5,309,624 |
def position_delta(trades, price_currency=None, volume_currency='BTC'):
"""
This function calculates our position across a list of trades for both the price
and volume currencies. This is equivalent to calculating the total amount our
balance in the two currencies have changed, and to the difference bet... | 5,309,625 |
def is_grammar_correct(grammar):
"""
This function checks if the grammar "grammar" is correct
Input:
- "grammar" is a grammar
"""
allrules = set(grammar.keys())
for rule_key in grammar:
if isinstance(grammar[rule_key], ConstructorRule):
for parameter in grammar[rule_key].... | 5,309,626 |
def countTransactions(Transaction_list):
""" A list like the following
[
[1,1,1],
[0,0,0],
[1,1,1],
[1,1,0],
[1,1,1]
]
should be converted to a list without any duplicates and
count of each list should be appended to the list items
[
[1, 1, 0, 1],
[0, 0, 0, 1],
[1, 1, 1... | 5,309,627 |
def flatten_tree_depth_first(tree, exclude=None, exclude_children=False, return_only_run_id=False, return_trace=False):
"""
Flatten a run tree in a depth-first manner. May return a list of run ids or runs.
:param tree: dict
The tree to flatten
:param exclude:
A function to exclude nodes... | 5,309,628 |
def michalewicz(x: TensorType, d: int = 2, m: int = 10) -> TensorType:
"""
The Michalewicz function over :math:`[0, \\pi]` for all i=1,...,d. Dimensionality is determined
by the parameter ``d`` and it features steep ridges and drops. It has :math:`d!` local minima,
and it is multimodal. The parameter ``... | 5,309,629 |
def assert_allclose(actual: List[numpy.ndarray], desired: List[Union[int, float]]):
"""
usage.scipy: 2
"""
... | 5,309,630 |
def check_stitching(stitch_file):
"""
Take a stitch log file from MIPWrangler output, return summary datframe.
"""
with open(stitch_file) as infile:
stitch = []
for line in infile:
newline = line.strip()
stitch.append(newline)
sti_sum = []
for l in stitch:... | 5,309,631 |
def levelConditions(state,stage):
"""
This is specifically created for purpose of the game plot. It sets the conditions for when
the game level changes and the plot moves forward. It also updates what music is playing and
can come with a noise as the level changes. If the music is updates it returns Tru... | 5,309,632 |
def test_render_rezume(sample_rezume, theme_name, has_result):
"""Checks that serve command :func:`render_rezume` function can render a rezume for a
specified theme if it exists or return None if theme doesn't exist.
"""
# add path to theme package fixtures to python search path
path = Path(__file__... | 5,309,633 |
def parse_vehicle_type(vehicle, include_number=False):
"""
Takes a vehicle string (BE.NMBS.IC504)
and returns a human-readable
version of its type (e.g. IC, L)
"""
matches = re.match(r'(?:BE.NMBS.)?([A-Z]{1,3})(\d{1,4})', vehicle)
try:
train_type = matches.group(1)
except Attribu... | 5,309,634 |
def connect_and_configure_wlan(router):
"""
configures and starts wlan server.
Also adds routes to server
:type router: userv.routing.Router
"""
# connect
storage.register_leaf(
'wlan',
dict(
ssid=None,
password=None,
static_ip=None
... | 5,309,635 |
def make_train_step(model, optimizer):
"""
Builds function that performs a step in the train loop.
Extracted from:
https://towardsdatascience.com/understanding-pytorch-with-an-example-a-step-by-step-tutorial-81fc5f8c4e8e#58f2
"""
def train_step(xdata, ydata):
# Zeroes gradients
... | 5,309,636 |
def copy_file_to_folder(all_files_name, all_files_path, uid):
"""读取被试文件名以及路径"""
all_folders_name = os.listdir(out_folder_path)
all_folders_path = [
os.path.join(
out_folder_path,
folder_name) for folder_name in all_folders_name]
all_folders_path = pd.Series(all_folders_pa... | 5,309,637 |
def get_writer(settings):
"""
Get a :py:class:`gnsq.Nsqd` instance configured to connect to the nsqd
writer address configured in settings. The writer communicates over the
nsq HTTP API and does not hold a connection open to the nsq instance.
"""
ns = settings.get('nsq.namespace')
addr = set... | 5,309,638 |
def get_names_times(*args, **kwargs):
"""
Wrapper for get_names_dates:
def get_names_dates(ftp, fname=None):
Examples
--------
import ftplib
import os
ftp = ftplib.FTP("ftp.server.de")
ftp.login("user", "password")
ftp.cwd('ftp/directory'... | 5,309,639 |
def load_raw_resource_description(
source: Union[dict, os.PathLike, IO, str, bytes, raw_nodes.URI, RawResourceDescription],
update_to_format: Optional[str] = None,
) -> RawResourceDescription:
"""load a raw python representation from a BioImage.IO resource description.
Use `bioimageio.core.load_resource... | 5,309,640 |
def get_context(template, line, num_lines=5, marker=None):
"""
Returns debugging context around a line in a given string
Returns:: string
"""
template_lines = template.splitlines()
num_template_lines = len(template_lines)
# In test mode, a single line template would return a crazy line num... | 5,309,641 |
def sequence_conv(num_filters,
filter_size=3,
filter_stride=1,
padding=None,
bias_attr=None,
param_attr=None,
act=None,
name=None):
"""
Return a function that creates a paddle.fluid.laye... | 5,309,642 |
def get_designer_path():
""" Get the path of the Designer directory. """
return os.path.dirname(designer.__file__) + '/' | 5,309,643 |
def test_build_functions_code_mid():
"""Test build_functions_code_mid"""
config = {}
config["functions"] = {}
config["functions"]["endpoint"] = {}
config["functions"]["endpoint"]["peel_fruit"] = {}
fruit = config["functions"]["endpoint"]["peel_fruit"]
fruit["name"] = "code_test"
fruit["... | 5,309,644 |
def getColumnNames(hdu):
"""Get names of columns in HDU."""
return [d.name for d in hdu.get_coldefs()] | 5,309,645 |
def Point(robot, focus, manip=None, render=False):
""" Make a robot point at a 3d position.
@param robot The robot performing the point
@param focus The 3-D coordinate in space
@param manip The manipulator to perform the point with.
This must be the right arm
@param render Render t... | 5,309,646 |
def read_bed(bed_path):
"""Reads bed file into a DataFrame."""
bed_cols = [
'chrom', 'chromStart', 'chromEnd', 'name', 'score', 'strand',
'thickStart', 'thickEnd', 'itemRgb', 'blockCount', 'blockSizes',
'blockStarts'
]
data = pd.read_csv(bed_path, sep='\t', header=None)
dat... | 5,309,647 |
def embedding_to_probability(embedding: torch.Tensor, centroids: torch.Tensor, sigma: torch.Tensor) -> torch.Tensor:
"""
Vectorizing this is slower than the loop!!!
# / (e_ix - C_kx)^2 (e_iy - C_ky)^2 (e_iz - C_kz)^2 \
# prob_k(e_i) = exp |-1 * ---------------- -... | 5,309,648 |
def check_if_session_accepted(data):
"""
Check if the session can be accepted given the criteria in config
Note: qualification and setup are skipped as they are checked in JS. Workers cannot continue if they do not pass.
:param data:
:return:
"""
msg = "Make sure you follow the instruction:... | 5,309,649 |
def _get_fingerprint(arg, controller):
"""
Resolves user input into a relay fingerprint. This accepts...
* Fingerprints
* Nicknames
* IPv4 addresses, either with or without an ORPort
* Empty input, which is resolved to ourselves if we're a relay
:param str arg: input to be resolved to a relay fi... | 5,309,650 |
def versions_rank_algorithm(quality, popularity):
"""
Generate a score for this version of an ebook.
The quality score and the popularity score are ratioed together 70:30
Since popularity is a scalar and can grow indefinitely, it's divided by
the number of total system users.
Popularity is set... | 5,309,651 |
def get_colors(colormap, ncol, alpha=1.0, hide_traceback=True):
"""
Get a list of rgb values for a matplotlib colormap
Parameters
----------
colormap : str, default "WORM"
Name of the colormap to color the scatterpoints. Accepts "WORM",
"colorblind", or matplotlib colormaps.
... | 5,309,652 |
def get_url(server_name, listen_port):
"""
Generating URL to get the information
from namenode/namenode
:param server_name:
:param listen_port:
:return:
"""
if listen_port < 0:
print ("Invalid Port")
exit()
if not server_name:
print("Pass valid Host... | 5,309,653 |
def alpha_shape(points, alpha, only_outer=True):
"""
Compute the alpha shape (concave hull) of a set of points.
:param points: np.array of shape (n,2) points.
:param alpha: alpha value.
:param only_outer: boolean value to specify if we keep only the outer border
or also inner edges.
:return: set of (i,j) ... | 5,309,654 |
def _botocore_resolver():
"""Get the DNS suffix for the given region.
Args:
region (str): AWS region name
Returns:
str: the DNS suffix
"""
loader = botocore.loaders.create_loader()
return botocore.regions.EndpointResolver(loader.load_data("endpoints")) | 5,309,655 |
def euler97():
"""Solution for problem 97."""
mod = 10 ** 10
return (1 + 28433 * pow(2, 7830457, mod)) % mod | 5,309,656 |
def verify_model(model_name, input_data=[]):
"""Assert that the output of a compiled model matches with that of its
baseline."""
if len(input_data) == 0:
baseline_model, baseline_input = load_model(model_name)
else:
baseline_model = model_name
baseline_input = input_data
if t... | 5,309,657 |
def getBoundaryBoxes(uint64Img):
"""Extracts boundary boxes from a labelled image.
Args:
uint64Img (1-chan uint64 numpy array): A grayscale image, which contains a specific label for each region.
Returns:
anchors (integer tuple list): A list which contains the anchor points of all valid ... | 5,309,658 |
def reddening(wave, a_v, r_v=3.1, model='od94'):
"""Inverse of flux transmission fraction at given wavelength(s).
Parameters
----------
wave : float or list_like
Wavelength(s) in angstroms at which to evaluate the reddening.
a_v : float
Total V band extinction, in magnitudes. A(V) =... | 5,309,659 |
def PPolnUnwindCube (RMImage, inQImage, inUImage, outQImage, outUImage, err):
"""
Unrotate the Faraday rotation in a set of Q, U cubes.
If the input images are ObitImageMF like images then the first plane
of the output images will be the average of the corrected images.
* RMImage Image with ... | 5,309,660 |
def speed_analysis():
"""Calculate a weighted average speed for OSM features"""
analyze_speed() | 5,309,661 |
def callJenkinsApi(jenkinsApi, jenkinsFolders):
"""
Call the Jenkins API and fetch the JSON response
List jobs: api/json?tree=jobs[name]
"""
targetUrl = ""
folderUrl = ""
responseValue = ""
# Create proper url for folders
if len(jenkinsFolders) > 0 :
folderU... | 5,309,662 |
def frame_shift(array, shift_y, shift_x, lib='opencv', interpolation='bicubic'):
""" Shifts an 2d array by shift_y, shift_x. Boundaries are filled with zeros.
Parameters
----------
array : array_like
Input 2d array.
shift_y, shift_x: float
Shifts in x and y directions.
lib : {'... | 5,309,663 |
def GetMimeMessage(service, user_id, msg_id):
"""Get a Message and use it to create a MIME Message.
Args:
service: Authorized Gmail API service instance.
user_id: User's email address. The special value "me"
can be used to indicate the authenticated user.
msg_id: The ID of the Message required.
... | 5,309,664 |
def is_palindrome_recursive(text, left=None, right=None):
"""
is_palindrome_recursive() checks to see if a given text is a palindrome
meaning its characters flipped would be the same word from the beginning.
Args: text (string)
Returns: is_palindrome (bool)
Time: ... | 5,309,665 |
def latex_code(size):
"""
Get LaTeX code for size
"""
return "\\" + size + " " | 5,309,666 |
def create_inner_out_logp(value_map):
"""Create a log-likelihood inner-output.
This is intended to be use with `get_random_outer_outputs`.
"""
res = []
for old_inner_out_var, new_inner_in_var in value_map.items():
logp = logprob(old_inner_out_var, new_inner_in_var)
if new_inner_in_... | 5,309,667 |
def post_process_results(
cluster_settings_json,
benchmark_settings_json,
experiment_settings_json,
command_pathname):
"""
Post-process the results of executing the benchmark script generated
by the generate_script function
"""
cluster = Cluster(cluster_settings_json)... | 5,309,668 |
def node_name():
"""Implementation of 'node-name' action."""
function_set({'node-name': cloud_utils.service_hostname()}) | 5,309,669 |
def initiate_document_version_upload(Id=None, Name=None, ContentCreatedTimestamp=None, ContentModifiedTimestamp=None, ContentType=None, DocumentSizeInBytes=None, ParentFolderId=None):
"""
Creates a new document object and version object.
The client specifies the parent folder ID and name of the document to ... | 5,309,670 |
def GRUCell(input_size: int, hidden_size: int, bias: bool = False):
"""
Simple wrapper for GRUCell that handles initialization
Args:
input_size – The number of expected features in the input x
hidden_size – The number of features in the hidden state h
bias – If False, then the layer ... | 5,309,671 |
def embedding(x,
vocab_size,
dense_size,
name=None,
reuse=None,
multiplier=1.0,
symbol_dropout_rate=0.0,
embedding_var=None,
dtype=tf.float32):
"""Embed x of type int64 into dense vectors, reducing to max 4... | 5,309,672 |
def has_cycle_visit(visiting, parents, adjacency_list, s):
"""
Check if there is a cycle in a graph starting
at the node s
"""
visiting[s] = True
for u in adjacency_list[s]:
if u in visiting:
return True
if u in parents:
continue
parents[u] = s
if has_cycle_visit(visiting, paren... | 5,309,673 |
def isAbcFilename(filename):
"""None"""
pass | 5,309,674 |
def _show_interactive_menu(test_session):
"""Display an interactive menu based on the current test session state.
This will return when the user invokes one of the exit menu items.
"""
# A menu item for all menus, so that test_session.state is checked again
refresh_test_session_state = FunctionItem... | 5,309,675 |
def check_admin():
"""
Prevent non-admins from accessing the page.
:return:
"""
if not current_user.is_valid and not current_user.is_admin:
abort(403) | 5,309,676 |
def create_lock(objects, lock_name):
"""Create locks for list of objects"""
locks_list = list()
for obj in objects:
if isinstance(obj, dict):
lock = distributedlock(lock_name % obj['id'])
else:
lock = distributedlock(lock_name % obj)
lock.__enter__()
... | 5,309,677 |
def main(list_packed_vars):
"""
Model simulation
Parameters
----------
list_packed_vars : list
list of packed variables that enable the use of parallels
Returns
-------
netcdf files of the simulation output (specific output is dependent on the output option)
"""... | 5,309,678 |
async def _set_trait(session, url):
"""Set some traits via TRAIT_CHUNKS."""
traits = TRAIT_CYCLE.__next__()
data = {
# This use of static generations is perhaps icky
# but it is the result of an expected flow and
# ordering.
'resource_provider_generation': 2,
... | 5,309,679 |
def daemonize():
"""Put the server into daemon mode with the standard trickery."""
if sys.platform == 'win32':
raise UIError("Daemon mode is not supported on win32.")
# This logic is more-or-less verbatim from Stevens's _Advanced
# Programming in the Unix Environment_:
# Fork, to run in th... | 5,309,680 |
def multirun(self, template=False):
""" instantiated multi-stage tuning main function """
self.create_instances() # stage 0 as default
# offline training with default ratio=0.25
td = os.path.join('../', self.args.training_data)
if os.path.isfile(td):
for ins in self._models:
p... | 5,309,681 |
def verify_event_trigger_node(self):
"""
This function verifies the event trigger is present in the database
:param self: server details
:return event_trigger: event trigger's expected details
:rtype event_trigger: dict
"""
try:
connection = get_db_connection(self.db_name,
... | 5,309,682 |
def get_trans_func():
"""
Returns the next status (modifier) based on the current status,
the event on the new modifier (pressed or released) and the new modifier typed.
next_status = f(event, modifier, curr_status)
event can be {'press', release}; modifier is one of the possible modifier in m... | 5,309,683 |
def prometheus_cleanup_worker(pid):
"""Aggregate dead worker's metrics into a single archive file."""
from prometheus_client import multiprocess
multiprocess.mark_process_dead(pid) # this takes care of gauges
prom_dir = os.environ['prometheus_multiproc_dir']
worker_files = [
'histogram_{}.d... | 5,309,684 |
def remove_trailing_whitespace(line):
"""Removes trailing whitespace, but preserves the newline if present.
"""
if line.endswith("\n"):
return "{}\n".format(remove_trailing_whitespace(line[:-1]))
return line.rstrip() | 5,309,685 |
def update_users(users_objects):
""" updates the users json by the new objects values """
with open("users.json", 'w') as users_file:
new_users_json = json.dumps(users_objects, indent=4)
users_file.write(new_users_json) | 5,309,686 |
async def test_delete_run_timeout(mock_get_cluster):
"""assert that run method timeout when end_time > start time"""
mock_get_cluster.side_effect = Exception("Cluster deletion fail")
trigger = DataprocDeleteClusterTrigger(
project_id=TEST_PROJECT_ID,
region=TEST_REGION,
cluster_name... | 5,309,687 |
def process_settings(pelicanobj):
"""Sets user specified Katex settings"""
katex_settings = {}
katex_settings['auto_insert'] = True
katex_settings['process_summary'] = True
return katex_settings | 5,309,688 |
def install(**kwargs):
"""setup entry point"""
return setup(
name="pysachi",
version=__pkginfo__["version"],
packages=[
'pysachi',
'pysachi/rules',
'pysachi/checkers'
],
entry_points={'pysachi.renderers': [
"html = pysachi.r... | 5,309,689 |
def total_infection_rate_60():
"""
Real Name: b'total infection rate 60'
Original Eqn: b'infection rate asymptomatic self 60+infection rate quarantined self 60+infection rate symptomatic self 60 +infection rate asymptomatic 80x60+infection rate symptomatic 80x60 +infection rate asymptomatic 70x60+infection ... | 5,309,690 |
def get_source(source_string: AnyStr) -> Dict:
"""
This method finds the rss feed object based on source string
:param source_string: String acting as key to find RSS feed source
:return:
"""
source = "_".join([word.lower() for word in source_string])
return RSS_FEEDS.get(source) | 5,309,691 |
def main(argv: Optional[Sequence[str]] = None) -> int:
"""Main Function"""
parser = argparse.ArgumentParser()
parser.add_argument("filenames", nargs="*", help="Filenames to fix")
parser.add_argument(
"--textfiles", help="comma separated list of text files to convert"
)
parser.add_argumen... | 5,309,692 |
def run_epoch(session, model, data, is_train=False, verbose=False, sv=None, epoch=None):
"""Runs the model on the given data."""
epoch_size = ((len(data[0]) // model.batch_size) - 1) // model.num_steps
start_time = time.time()
costs = 0.0
iters = 0
state = session.run(model.initial_state)
f... | 5,309,693 |
def gconnect():
"""Log users into their Google accounts and the Web app.
Log users into Google and the Web app if their login
details are correct, and their session state and server states
match (indicating the no 3rd party is attempting to hi-jack
the session). Create new user in the User table of... | 5,309,694 |
def _collect_models(container, json_reference, models, swagger_spec):
"""
Callback used during the swagger spec ingestion to collect all the
tagged models and create appropriate python types for them.
NOTE: this callback creates the model python type only if the container
represents a valid "model"... | 5,309,695 |
def non_usd_ois(asset: Asset, tenor: str = None, *, source: str = None, real_time: bool = False) -> Series:
"""
GS end-of-day non domestic USD ois rate curve for G10 cross currencies.
:param asset: asset object loaded from security master
:param tenor: relative date representation of expiration date e.... | 5,309,696 |
def make_cross(length=20, width=2) -> networkx.Graph:
"""Builds graph which looks like a cross.
Result graph has (2*length-width)*width vertices.
For example, this is a cross of width 3:
...
+++
+++
...+++++++++++...
...+++++++++++...
...+++++++++++...
... | 5,309,697 |
def _send_cmd(obj_session, **kwargs):
"""method to send command based on the type of object """
if isinstance(obj_session, WNetwork.warrior_cli_class.WarriorCli):
result, response = obj_session._send_cmd(**kwargs)
elif isinstance(obj_session, pexpect.spawn):
wc_obj = WNetwork.warrior_cli_cl... | 5,309,698 |
def get_all_versions(appdir,include_partial_installs=False):
"""Get a list of all usable version directories inside the given appdir.
The list will be in order from most-recent to least-recent. The head
of the list will be the same directory as returned by get_best_version.
"""
# Find all potenti... | 5,309,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.