content stringlengths 22 815k | id int64 0 4.91M |
|---|---|
def get_default_selection():
"""Retrieve the last response file updated."""
try:
if not os.path.exists(defaultresp_path):
return None
with open(defaultresp_path, 'r') as file_ptr:
default_selection = file_ptr.readline()
if default_selection is None:
... | 70,300 |
def kmer_gen(k, reference, output_filename):
"""
inputs - k (int), reference transcriptome file, output k-mer dataset filename
kmer_gene generates the k-mer fasta formatted dataset and saves the reads as output_filename
"""
# import and parse fasta file with transcripts. returns seqs: list of sequen... | 70,301 |
def mfi(high, low, close, volume, length=None, drift=None, offset=None, **kwargs):
"""Indicator: Money Flow Index (MFI)"""
# Validate arguments
length = int(length) if length and length > 0 else 14
high = verify_series(high, length)
low = verify_series(low, length)
close = verify_series(close, l... | 70,302 |
def print_list_results(iframe, total_cdis, total_cerr, total_gint, total_hitr,
total_obji, total_cert, total_hitt, objects_processed):
""" Print the results obtained in a single frame. """
norm_total_cdis = total_cdis
norm_total_cerr = total_cerr
norm_total_gint = total_gint
n... | 70,303 |
def load(filename):
"""
"""
with open(filename, "rb") as file_:
data = read(file_)
return data | 70,304 |
def caf_L05burst2(CFR, lMmax, t0, burstamp, ltbegin, ltend):
"""
Generate age distribution (CAF) following L05 & add a starburst
"""
# Assume CIMF is a -2 power-law powerlaw
# Follow the evolve MF notation in Gieles 2009, MNRAS
# Fixed model parameters:
lMlim = 2 # minimum mass of mass fun... | 70,305 |
def Y_tester():
"""
>>> tmp = Y_tester()
>>> tmp(1)
1
>>> tmp(5)
120
>>> tmp(2)
2
"""
"*** YOUR CODE HERE ***"
return Y(lambda f: lambda x: 1 if x == 1 else x * f(x - 1)) | 70,306 |
def test_create_caches_instance():
"""Verify create() adds the object to the cache."""
AppSettings.create()
assert get_cache_entry() is not None | 70,307 |
def segment_arm(frame: np.ndarray, abs_depth_dev: int = 14) -> np.ndarray:
"""Segments arm region
This method accepts a single-channel depth image of an arm and
hand region and extracts the segmented arm region.
It is assumed that the hand is placed in the center of the image.
:para... | 70,308 |
def test_graphs_threshold_global_cost_efficiency():
"""Test for graph threshlding using global cost efficiency (GCE)."""
# Groundtruth
expected = np.load("groundtruth/graphs_threshold/gce.npy")
# Data
graph = np.load("sample_data/graphs_threshold/graph.npy")
# Run
iterations = 50
bina... | 70,309 |
def files_to_list(folder_directory: str) -> list:
"""Read the files in the folder with .txt to a list
Args:
directory (str): the directory to find files
Returns:
list: list with all the files turned into str
"""
dataset = []
directory... | 70,310 |
def tiploc_record(records):
"""return CIF file TIPLOC object from 80-character line string"""
this_array = [[line[0:2],line[2:9],line[9:11],line[11:17],line[17:18],line[18:44],line[44:49],line[49:53],line[53:56],line[56:72],line[72:79]] for line in records]
this_frame = pd.DataFrame(data=this_array, columns... | 70,311 |
def recoverer(sess, model_path, meta_graph_path=None):
"""
Recovery parameters from a pretrained model.
Args:
sess: The tensorflow session instance.
model_path: Checkpoint file path.
Returns:
Nothing
"""
if meta_graph_path is None:
restore_var = tf.global_variable... | 70,312 |
def test_bad_filename(random_string_fx):
"""
Intentionally insert a bad filename to ensure FileNotFoundError
is thrown, when passed to config.setup.
"""
filename = random_string_fx
with pytest.raises(FileNotFoundError):
src.config.setup(filename) | 70,313 |
def sort(args) -> list:
"""Performs a sort based on the given args.
Args is of the format (dist, auc, n0, n1) and is one tuple/list.
Throws an error if the array did not sort correctly.
Returns the results."""
dist, auc, n0, n1 = args
results = list()
data, D0, D1 = continuousScale(n0, n1)
comp = Comparator(dat... | 70,314 |
def test_creates_choice_property(mocker: MockerFixture) -> None:
"""Test that choice properties are correctly created."""
identifier = "identifier"
title = {None: "title"}
description = {None: "description"}
min_occurs = "1"
max_occurs = "2"
one_of_uri = "one_of"
one_of = [one_of_uri]
... | 70,315 |
def glEvalCoord2fv(v):
"""
v - seq( GLfloat, 2)
"""
if 2 != len(v):
raise TypeError(len(v), "2-array expected")
_gllib.glEvalCoord2fv(v) | 70,316 |
def needs_rebuild(source, target):
"""Checks if the source file needs to be rebuilt.
Args:
source: The source file to be compared.
target: The target file which we may need to rebuild.
Returns:
True if the source file is newer than the target, or if the target file
does not exist.
... | 70,317 |
def http_request(url, post=None, headers=None):
"""request data from the HTTP API, returns the response a string. If a
http error occurs it will *not* raise an exception, instead it will
return the content of the error document. This is because we get
sent 5xx http status codes even if application level... | 70,318 |
def org_new(input_params={}, always_retry=True, **kwargs):
"""
Invokes the /org/new API method.
For more info, see: https://documentation.dnanexus.com/developer/api/organizations#api-method-org-new
"""
input_params_cp = Nonce.update_nonce(input_params)
return DXHTTPRequest('/org/new', input_par... | 70,319 |
def get_log_path(subfolder=None, filename=None, create=True):
"""
Returns the default log path for the platform. This will be:
- macOS: '~/Library/Logs/SUBFOLDER/FILENAME'
- Linux: '$XDG_CACHE_HOME/SUBFOLDER/FILENAME'
- fallback: '$HOME/.cache/SUBFOLDER/FILENAME'
:param str subfold... | 70,320 |
def save_dependence_grid(dirname, kendalls, bounds_tau, grid_type):
"""Save a grid of kendall's into a csv ifile.
The grid is always saved in Kendall's Tau measures.
Parameters
----------
dirname : str
The directory path.
kendalls : list or array
The kendall's tau of each pair.
... | 70,321 |
def frozen_after_init(cls: C) -> C:
"""Class decorator to freeze any modifications to the object after __init__() is done.
The primary use case is for @dataclasses who cannot use frozen=True due to the need for a custom
__init__(), but who still want to remain as immutable as possible (e.g. for safety with... | 70,322 |
def testMMDTools_CheckCF(monkeypatch):
"""Test the check_cf function."""
chkMMD = CheckMMD()
ok, err, n = chkMMD.check_cf(etree.ElementTree(etree.XML(
"<root>"
" <keywords vocabulary='Climate and Forecast Standard Names'>"
" <keyword>sea_surface_temperature</keyword>"
" ... | 70,323 |
async def async_get_trigger_capabilities(
hass: HomeAssistant, config: ConfigType
) -> dict[str, vol.Schema]:
"""List trigger capabilities."""
return {
"extra_fields": vol.Schema(
{vol.Optional(CONF_FOR): cv.positive_time_period_dict}
)
} | 70,324 |
def check_key_expired(key, node, url):
"""check if key expired if is return url with args so it will push status message
else return url
:param str key: the private link key passed in
:param Node node: the node object wants to access
:param str url: the url redirect to
:retur... | 70,325 |
def set_entity_props(entity, args):
""" 设置实体对象属性 """
for column in entity.__table__.columns:
value = args[column.name]
if value is None:
continue
if type(column.type) == db.DateTime:
if value is None:
value = 0
else:
v... | 70,326 |
def adsSyncReadByNameEx(
port: int,
address: AmsAddr,
data_name: str,
data_type: Type,
return_ctypes: bool = False,
handle: int = None,
check_length: bool = True,
) -> Any:
"""Read data synchronous from an ADS-device from data name.
:param int port: local AMS port as returned by ads... | 70,327 |
def test_instantiate():
"""Test whether VariablesBase instantiates."""
if sys.version[0] == 2:
b = VariablesBase()
else:
# abstract base class type error not raised
# in python 3.
raise (TypeError) | 70,328 |
def regularize_occults(events, occults, init_state, stoichiometry):
"""Regularizes an occult matrix such that counting
processes are valid
:param events: a [M, T, X] events tensor
:param occults: a [M, T, X] occults tensor
:param init_state: a [M, S] initial state tensor
:param stoichiometry: a... | 70,329 |
def calc_hist_by_group(
df: dd.DataFrame, bins: int, ngroups: int, largest: bool
) -> Tuple[pd.DataFrame, Dict[str, int]]:
"""
Compute a histogram over the values corresponding to the groups in another column
Parameters
----------
df
Dataframe with one categorical and one numerical colu... | 70,330 |
def play_file(path, start=None):
"""Play media."""
# gain = get_gain(path)
def my_log(loglevel, component, message):
print('[{}] {}: {}'.format(loglevel, component, message))
player = mpv.MPV(log_handler=my_log, ytdl=True,
input_default_bindings=True, input_vo_keyboard=True... | 70,331 |
def _get_filename(step: base_layer.JTensorOrPartitionSpec) -> str:
"""Returns a filename for the given step."""
step_num = _get_step(step)
return f'decoder_out_{step_num}_shard_{jax.process_index()}' | 70,332 |
def add_ticket_submit(request):
"""
Ajax submit ticket form.
"""
ticketform = AddTicketForm(request, request.POST)
dc_settings = request.dc.settings
if ticketform.is_valid():
# Send mail to SUPPORT_EMAIL
sendmail(None, 'gui/support/add_ticket_subject.txt', 'gui/support/add_ticke... | 70,333 |
def signal_handler_ignore(signum, frame):
"""
Log and ignore all signals.
"""
logging.warning('Received signal %d, ignoring it' % signum) | 70,334 |
def order_genes(genes, species, genomes):
"""Returns a list of ordered genes for the specified species, on a given
strand of a given chromosome.
:param genes: list of genes for species (on a given strand of a given
chromosome)
:param species: KEGG organism code
:param genomes: dict of dicts... | 70,335 |
def celery_worker_arguments(parser):
""" Handle exe arguments when celery worker start. """
parser.add_argument('--exe-conf',
action="store",
required=True,
default="",
help="path to config file of exed service, " +
... | 70,336 |
def _array_api_unique_values(x):
"""
Returns the unique elements of an input array `x`.
"""
pass | 70,337 |
def perform_search(query):
"""
The perform_serach function takes the query entered by a user and presents the list of documents
that best match the search words entered sorted by their rank results
Args:
query (str): A string containing the query terms entered by the user
Returs:
... | 70,338 |
def test_fileCopyIn(createClient, pull_docker_image):
"""File Copy into container from image.
Create a new test container and copy tarfile into container.
"""
newContainer = createClient.create_container(image=pull_docker_image,
command="/bin/sh", tty=Tr... | 70,339 |
def _download_tarball_by_url_v2(
sr_path, staging_path, image_id, glance_endpoint, extra_headers):
"""Download the tarball image from Glance v2 and extract it into the
staging area. Retry if there is any failure.
"""
url = "%(glance_endpoint)s/v2/images/%(image_id)s/file" % {
'glance_en... | 70,340 |
def load_image(fname, enforce=None):
"""**[Deprecated]** Imports an image file as an SDL surface.
This function uses either the SDL_image library or the Pillow Python package
for importing images, using SDL2's built-in BMP loader as a fall-back if
neither are available.
.. warning::
Due to ... | 70,341 |
def get_cpu(os: str, line: List, value: str, key: str):
"""
Append the CPU info from the given neofetch line to the CPU list
Parameters
----------
os :
OS type
line : List
Component line
value : str
Neofetch extracted line
key : str
Component key
"""
... | 70,342 |
def report_this_test_run(suite, make_benchmarks, note, update_time,
test_list, test_file):
""" generate the master page for a single run of the test suite """
# get the current directory
current_dir = os.getcwd()
# switch to the web directory and open the report file
... | 70,343 |
def test_docker_blacklist3(client):
"""Test removing from blacklist a docker server"""
docker_host = "{domain}:{port}".format(
domain=str(uuid4()).replace("-", "."),
port=int(randrange(10, 99999)) # nosec
)
data = {"host": docker_host}
response = client.post(
"/docker-execu... | 70,344 |
def xent(pred, label):
""" Calculates Cross Entropy Loss
Args:
pred: Tensor of label predictions
label: Tensor of golden labels (True values)
returns:
Mean Squared Error of predictions and labels
"""
# Note - with tf version <=0.12, this loss has incorrect 2nd deriva... | 70,345 |
def _purge_db_stale_jobs():
"""due to bugs/crashes the db table may contain jobs with status 'running'
This will cause the server to refuse more jobs (since it believes it is full).
When starting the server we know for sure there are now running jobs, so purge them"""
from .job_status import Job
_jo... | 70,346 |
def scale_image(img: np.ndarray)->np.ndarray:
"""
Return a copy of the array where all non-zero values have been scaled
between 0 and 1
:param img: img to be scaled
"""
mn = np.min(img)
mx = np.max(img)
return ((img-mn)/(-mn+mx))*(img != 0) | 70,347 |
def sync(
ctx,
localdir,
remotedir,
encrypt_password,
encrypt_type,
max_workers,
no_show_progress,
check_md5,
):
"""同步本地目录到远端"""
# Keyboard listener start
keyboard_listener_start()
api = _recent_api(ctx)
if not api:
return
pwd = _pwd(ctx)
remotedir ... | 70,348 |
def set_default_logger_level(level):
"""Set the verbosity level of the default logger."""
logging.basicConfig(handlers=[RichHandler()])
logging.getLogger().setLevel(level) | 70,349 |
def get_dependencies(pom):
"""
Return a list of Dependent package objects found in a MavenPom `pom` object.
"""
dependencies = []
for scope, deps in pom.dependencies.items():
if TRACE:
logger.debug('parse: dependencies.deps: {}'.format(deps))
if scope:
scope =... | 70,350 |
def format_m_year_execute(input_string:str, match_pattern:Tuple[Pattern, str]) -> str:
"""
Core of loop for format_m_year_strings
"""
return_string = str(input_string) # type:str
search_pattern, month_number = match_pattern # type: Pattern, str
search_result = search_pattern.search(return_string... | 70,351 |
def create_accurat_request(article, request_id, text, src, tgt):
"""This method creates a translation request for MT-Serverland."""
shortname = "accurat_%s_%s" % (request_id,
datetime.datetime.now().isoformat())
# submit a new translation request: multipart/form-data
... | 70,352 |
def load_yaml_into_dict(file_path: str) -> Dict:
"""
This loads yaml files into a dictionary to be used in API calls.
"""
with open(file_path, "r") as yaml_file:
loaded = yaml.safe_load(yaml_file)
if isinstance(loaded, dict):
return loaded
print(f"Failed to parse invalid... | 70,353 |
def test_service_configuration(host):
"""Test that the automatic upgrade service is configured as expected."""
distribution = host.system_info.distribution
if distribution in ["debian", "kali"]:
filename = "/etc/apt/apt.conf.d/50unattended-upgrades"
f = host.file(filename)
assert f.e... | 70,354 |
def rechunk(x, target_chunks, out):
"""Rechunk data to specification
Parameters
----------
x : str
Storage URL to input data.
target_chunks : dict
Mapping {coordinate_name: chunk_size} showing how data is
to be rechunked.
out : str
Storage URL to write rechunked ... | 70,355 |
def assert_allclose(actual: numpy.ndarray, desired: Tuple[int, int, int]):
"""
usage.scipy: 1
"""
... | 70,356 |
def get_by(session, model, primary_key_value, primary_key=None):
"""Returns the first instance of `model` whose primary key has the value
`primary_key_value`, or ``None`` if no such instance exists.
If `primary_key` is specified, the column specified by that string is used
as the primary key colum... | 70,357 |
def test_batch_timeout_error(s3_client):
"""Batch reports job killed due to excessive runtime. No retry"""
error_wo_retry("batch-event-timeout-error.yaml") | 70,358 |
def group(name: t.Optional[str] = None,
**attrs: t.Any) -> t.Callable[[F], TaskioGroup]:
"""Creates a new :class:`Group` with a function as callback. This
works otherwise the same as :func:`command` just that the `cls`
parameter is set to :class:`Group`.
"""
attrs.setdefault("cls", Taskio... | 70,359 |
def compute_adiabatic_tf(ds, base_var):
"""Compute adiabatic tendencies as in Pierre's TF version
Args:
ds: xarray dataset
base_var: Base variable to be computed
Returns:
adiabatic: xarray dataarray
"""
adiab = (ds[base_var].diff(dim='time', n=1) / dt_sec - ds[phy_dict[base... | 70,360 |
def options(subparser):
"""
Specifies the options for the 'messer configure' command. Arguments that call the set_defaults method, will call a
function with the specified name and pass the parsed args to it. Anything that the method returns is assigned to
the property 'command'.
:param subparser: A... | 70,361 |
def _get_reception_time_from_scene_dir_second(scene_dir_second: str) -> Union[str, None]:
"""If there is time datum inside `scene_dir_second` string, then return it.
Otherwise, return None."""
# second part of scene dir, it can be: `13_53_00`,
# `13_53_00_ETC2`, `14_35_23_CB11_SIR18`, etc.
second_p... | 70,362 |
def test_index(builddir):
"""
Test that index works with a build
"""
runner = CliRunner()
result = runner.invoke(main.cli, ["--path", builddir, "index"])
assert result.exit_code == 0, result.stdout | 70,363 |
def _reparseMessages5(msg):
"""
Reparse messages from schema version 5 that did not have all child parts of
message/rfc822 parts.
"""
#placed here to avoid circular import
from xquotient.mimestorage import Part, Header, ExistingMessageMIMEStorer
#some tests don't have complete messages in th... | 70,364 |
def get_arc_servicedict(url):
"""Returns a dict of service information for an ArcGIS REST service URL
Arguments
url (String): An ArcGIS REST service URL,
e.g. 'http://services.slip.wa.gov.au/arcgis/rest/services/QC/MRWA_Public_Services/MapServer'
"""
res = json.loads(requests.g... | 70,365 |
def custom_calculate_flow_task(task_id, language="en"):
"""
@param task_id:
@param language:
@return:
"""
set_local_param("request_language_code", language)
BkLanguage.set_language("en")
translation.activate("en")
task = FlowCustomCalculateHandler(id=task_id)
task.execute() | 70,366 |
def clear_lambda_running(context, dbname, lambda_suffix=None, dynamodb_handler=None):
"""
This is a convenience method to clear a lambda from the list of running lambdas
:param context:
:param string dbname:
:param string lambda_suffix: the name of the lambda handler
:param dynamodb_handler:
... | 70,367 |
def fast_fitting_predicate(
page_width, # Ignored.
ribbon_frac, # Ignored.
min_nesting_level, # Ignored.
max_width,
triplestack
):
"""
One element lookahead. Fast, but not the prettiest.
"""
chars_left = max_width
while chars_left >= 0:
if not triplestack:
... | 70,368 |
def test_advanced_phenotypes_POST(app, user_obj, institute_obj):
"""Test the view showing the available phenotype models for an institute, after sending POST request with new phenotype model data"""
# GIVEN an initialized app
# GIVEN a valid user and institute
with app.test_client() as client:
... | 70,369 |
def fallout_rate(y_true, y_pred, sample_weight=None):
"""
The fallout rate is also known as the False Positive Rate.
At the present time, this routine only supports binary
classifiers with labels taken from {0, 1}.
By definition, this is the complement of the
Specificity, and so uses :any:`speci... | 70,370 |
def generate_potcar(args):
"""
Generate POTCAR.
Args:
args (dict): Args from argparse.
"""
if args.recursive:
proc_dir(args.recursive, gen_potcar)
elif args.symbols:
try:
p = Potcar(args.symbols, functional=args.functional)
p.write_file("POTCAR")
... | 70,371 |
def get_side_operator(side, invert=False) -> Callable:
"""
generic operator selection when comparing odds
- if side is 'BACK', returns gt (greater than)
- if side is 'LAY', returns lt (less than)
- set invert=True to return the other operator
"""
if side == 'BACK':
greater_than = Tru... | 70,372 |
def search_dag(G,edge_a,edge_b):
"""Operador de reparo: Verfica se o grafo possui ciclo, se tiver um ciclo
ele retira uma aresta do circulo que não seja a ultima que foi adicionada.
Entrada: G=Grafo
edge_a e edge_b= nós da ultima aresta adicionada, sendo a->b.
Saída: Gráfo com DAG
... | 70,373 |
def collapse_namespace(namespaces, cell):
"""TODO"""
uf_link = """<a href=\"{}" target=\"_blank\">{}</a>"""
or_statement = "|".join([uri for _, uri in namespaces])
pattern = f"({or_statement}).*"
quick_check = re.match(pattern, str(cell))
if quick_check:
for term, uri in namespaces:
... | 70,374 |
def check_coordinate_system(
coordinate_system, valid_coord_systems=("cartesian", "spherical")
):
"""
Check if the coordinate system is a valid one.
Parameters
----------
coordinate_system : str
Coordinate system to be checked.
valid_coord_system : tuple or list (optional)
T... | 70,375 |
def gen_p_y_pred(model, X_cntxt, Y_cntxt, X_trgt, n_samples):
"""Get the estimated (conditional) posterior predictive from a model."""
if X_cntxt is None:
X_cntxt = torch.zeros(1, 0, model.x_dim)
Y_cntxt = torch.zeros(1, 0, model.y_dim)
if isinstance(model, LatentNeuralProcessFamily):
... | 70,376 |
def test_define_clash():
""" Try defining a value that already exists """
for _x in range(100):
define = Define.directive(None)
# Check initial state
assert define.name == None
assert define.value == None
# Invoke with a random define name
# NOTE: All defines are... | 70,377 |
def check() -> None:
"""
Check if the docker component is available.
"""
DockerComponent.is_available()
user.inform(f"The `docker` component is {styles.green('available')}.") | 70,378 |
def read_ids(filename):
"""
Read record IDs from a file.
Parameters
----------
filename : str
Filename containing record IDs.
"""
if filename.endswith('.gz'):
f = gzip.open(filename)
else:
f = open(filename)
ids = [line.strip() for line in f]
f.close()
... | 70,379 |
def dumps(obj):
"""
Serialize ``obj`` to a JSON formatted ``str``.
序列化对象
"""
return json.dumps(obj) | 70,380 |
def _layout_figure(params, platform=None):
"""Aux function for setting figure layout"""
size = params['fig'].get_size_inches()
scroll_width = 0.33
if platform is None or platform == "linux" or platform == "linux2":
hscroll_dist = 0.33
else:
hscroll_dist = 0.8
vscroll_dist = 0.1
... | 70,381 |
def delete_existing_paper(paper_id: int) -> None:
"""delete an existing paper
- do not allow if the paper does not exist"""
global DATABASE_PATH
with connect(DATABASE_PATH) as connection:
# check if the paper exists
if not connection.execute(
"SELECT EXISTS (SELECT... | 70,382 |
async def test_discovery_exception(opp, mock_entry):
"""Test platform setup."""
await setup.async_setup_component(opp, "persistent_notification", {})
mock_entry.add_to_opp(opp)
with patch(
"openpeerpower.components.zerproc.light.pyzerproc.discover",
side_effect=pyzerproc.ZerprocExcepti... | 70,383 |
def from_grid_range(x):
"""from [-1,1] to [0,1]"""
return (x + 1) / 2.0 | 70,384 |
def ddpg(
# Common settings
device="cuda",
discount_factor=0.98,
last_frame=2e6,
# Adam optimizer settings
lr_q=1e-3,
lr_pi=1e-3,
# Training settings
minibatch_size=100,
update_frequency=1,
polyak_rate=0.005,
# Replay Buffer... | 70,385 |
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the Smappee sensor."""
smappee_base = hass.data[DOMAIN][config_entry.entry_id]
entities = []
for service_location in smappee_base.smappee.service_locati... | 70,386 |
def escaped_split(inp_str, split_char):
"""
Split inp_str on character split_char but ignore if escaped.
Since, return value is used to write back to the intermediate
data file, any escape characters in the input are retained in the
output.
:param inp_str: String to split
:param split_char:... | 70,387 |
def dataloader_msrvtt_train(args, tokenizer):
"""return dataloader for training msrvtt-9k
Args:
args: hyper-parameters
tokenizer: tokenizer
Returns:
dataloader: dataloader
len(msrvtt_train_set): length
train_sampler: sampler for distributed training
"""
msrvt... | 70,388 |
def read_num_axm(input_string):
"""
"""
pattern = ('NumAXM' +
one_or_more(SPACE) + capturing(one_or_more(INTEGER)) +
one_or_more(SPACE) + capturing(one_or_more(INTEGER)) +
one_or_more(SPACE) + capturing(one_or_more(INTEGER)))
block = _get_system_info_section... | 70,389 |
def ids_filter(doc_ids):
"""Create a filter for documents with the given ids.
Parameters
----------
doc_ids : |list| of |str|
The document ids to match.
Returns
-------
dict
A query for documents matching the given `doc_ids`.
"""
return {'filter': [ids_selector(doc... | 70,390 |
def email_approved_registrar_user(request, user):
"""
Send email to newly approved registrar accounts for folks requesting library accounts
"""
host = request.get_host() if settings.DEBUG else settings.HOST
content = '''Your request for a Perma.cc library account has been approved and your p... | 70,391 |
def dup_div(f, g, K):
"""Polynomial division with remainder in `K[x]`. """
if K.has_Field or not K.is_Exact:
return dup_ff_div(f, g, K)
else:
return dup_rr_div(f, g, K) | 70,392 |
def load_english():
"""
Load and return a collection of english words from the DICTIONARY_FILE.
"""
pass | 70,393 |
def serve_multiple(server_settings, workers):
"""Start multiple server processes simultaneously. Stop on interrupt
and terminate signals, and drain connections when complete.
:param server_settings: kw arguments to be passed to the serve function
:param workers: number of workers to launch
:param ... | 70,394 |
def unhook_irc_pv():
"""Remove irc_pv hook."""
global irc_pv_hook
if irc_pv_hook:
weechat.unhook(irc_pv_hook)
irc_pv_hook = '' | 70,395 |
def bdf_merge(bdf_filenames, bdf_filename_out=None, renumber=True, encoding=None, size=8,
is_double=False, cards_to_skip=None, log=None, skip_case_control_deck=False):
"""
Merges multiple BDF into one file
Parameters
----------
bdf_filenames : List[str]
list of bdf filenames
... | 70,396 |
def font(text,x,y,transcolor=-1,w=9,h=8,fixed=False,scale=1):
"""
Usage:
font text, x, y, [transcolor], [char width], [char height], [fixed=False], [scale=1] -> text width
Parameters:
text : the string to be printed
x : x coordinate of print position
y : y coo... | 70,397 |
def decoding_layer(dec_embed_input, dec_embeddings, encoder_state, vocab_size, sequence_length, rnn_size,
num_layers, target_vocab_to_int, keep_prob):
"""
Create decoding layer
:param dec_embed_input: Decoder embedded input
:param dec_embeddings: Decoder embeddings
:param encoder_... | 70,398 |
def login(username, password, group):
"""Login to NTC Meet."""
driver = webdriver.Firefox()
driver.get("http://www.meet.net.np/meet/")
driver.find_element_by_class_name("elgg-input-text").send_keys(username)
driver.find_element_by_class_name(
"elgg-input-password").send_keys(password)
dr... | 70,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.