content
stringlengths
35
762k
sha1
stringlengths
40
40
id
int64
0
3.66M
from typing import List from typing import Dict def delete_nodes_list( nodes: List[str], credentials: HTTPBasicCredentials = Depends( check_credentials ), # pylint: disable=unused-argument ) -> Dict[str, str]: """Deletes a list of nodes (that are discoverables with lldp) to the db. Exple...
1b7d4e25e67f1a0d2a5eec23b12b1ca87242a066
3,643,400
def index(): """ Application Home page """ module_name = settings.modules[c].get("name_nice") response.title = module_name return {"module_name": module_name, }
527aa4b19eff87bb5c6fde6c0578ced5e876f59b
3,643,401
import os import requests def download_abstruse_goose(program_abs_path, abstruse_page_num): """Downloads latest Abstruse Goose comics.""" # Create/change appropriate comic folder. comic_folder = os.path.join(program_abs_path, "abstruse") if os.path.exists(comic_folder): os.chdir(comic_folder) ...
06381d566168a997e6ff6deaf8cb55c68a9ea09f
3,643,402
def is_CW_in_extension(G): """ Returns True if G is 'CW in expansion', otherwise it returns False. G: directed graph of type 'networkx.DiGraph' EXAMPLE >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> G=nx.DiGraph() e_list = [(0,1),(0,2),(0,3),(0,4),(1,2),(1,3),(1,4)] G.add_edges_fro...
3a1af65be274d23de16cdc15253185a0bbeda0ec
3,643,403
from typing import Callable from typing import Iterable from typing import List def get_index_where(condition: Callable[..., bool], iterable: Iterable) -> List[int]: """Return index values where `condition` is `True`.""" return [idx for idx, item in enumerate(iterable) if condition(item)]
6f99086730dfc2ab1f87df90632bc637fc6f2b93
3,643,404
def geom_crossbar(mapping=None, *, data=None, stat=None, position=None, show_legend=None, sampling=None, tooltips=None, fatten=None, **other_args): """ Display bars with horizontal median line. Parameters ---------- mapping : `FeatureSpec` Set of aestheti...
27f1faf1dea99b033e9ac5ab4dbc52ea2865934c
3,643,405
from typing import Union def chess_to_coordinate(pos: str) -> Union[Coordinate, Move]: """ Arguments: """ if len(pos) == 2: return Coordinate(int(pos[1]) - 1, file_dict[pos[0]]) else: if len(pos) == 5: if pos[4] == 'n': return Move(Coordinate(...
f55e8c4d349419a5477d5fc3c5390d133b89cdf7
3,643,406
def get_db_session(): """ Get the db session from g. If not exist, create a session and return. :return: """ session = get_g_cache('_flaskz_db_session') if session is None: session = DBSession() set_g_cache('_flaskz_db_session', session) return session
1254a99c3c1dd3fe71f1a9099b9937df46754c33
3,643,407
def make_tril_scale( loc=None, scale_tril=None, scale_diag=None, scale_identity_multiplier=None, shape_hint=None, validate_args=False, assert_positive=False, name=None): """Creates a LinOp representing a lower triangular matrix. Args: loc: Floating-point `Tensor`. This is used f...
137a0ac84e7b2fab71f1630ae1bd1b0b24fe8879
3,643,408
def remove_punctuation(word): """Remove all punctuation from the word (unicode). Note that the `translate` method is used, and we assume unicode inputs. The str method has a different `translate` method, so if you end up working with strings, you may want to revisit this method. """ return word....
46476b6e4480a2f067c2370fd378778b452a1a3e
3,643,409
def prepare_filter_weights_slice_conv_2d(weights): """Change dimension order of 2d filter weights to the one used in fdeep""" assert len(weights.shape) == 4 return np.moveaxis(weights, [0, 1, 2, 3], [1, 2, 0, 3]).flatten()
2b6ca65d68d4407ac0a7744efe01a90dc5423870
3,643,410
async def hello(request): """Hello page containing sarafan node metadata. `version` contains sarafan node version. `content_service_id` — contains service_id of content node :param request: :return: """ return web.json_response(await request.app['sarafan'].hello())
4a8b82a525082a03009d087a18042574e19c1796
3,643,411
import shutil import os def missing_toolchain(triplet: str) -> bool: """ Checks whether gcc, g++ and binutils are installed and in the path for the current triplet :param triplet: a triplet in the form riscv64-linux-gnu :return: True if some part of the toolchain is missing, False otherwise ""...
9fafae1a4bd5ce781183f28d098580624b6ba1ef
3,643,412
import yaml def load_capabilities( base: str = "docassemble.ALWeaver", minimum_version="1.5", include_playground=False ): """ Load and return a dictionary containing all advertised capabilities matching the specified minimum version, and optionally include capabilities that were advertised from a ...
3bb12fdbf4fc4340a042f0685a4917a7b1c1ed85
3,643,413
def build_graph( config, train_input_fn, test_input_fn, model_preprocess_fn, model): """Builds the training graph. Args: config: Training configuration. train_input_fn: Callable returning the training data as a nest of tensors. test_input_fn: Callable returning the test data as a nest of tensor...
4eff7555b2383db0870d5e63467e2d68a3336ece
3,643,414
import functools import traceback import time def execli_deco(): """ This is a decorating function to excecute a client side Earth Engine function and retry as many times as needed. Parameters can be set by modifing module's variables `_execli_trace`, `_execli_times` and `_execli_wait` :Example: ...
c245cd30f372e6d00895f42ba26936f2fb92c257
3,643,415
import uuid def lstm_with_backend_selection(inputs, init_h, init_c, kernel, recurrent_kernel, bias, mask, time_major, go_backwards, sequence_lengths, zero_output_for_mask): """Call the LSTM with optimized backend kernel ...
4c45709265de5385399a7b9bff0aeb4e9a4d7b17
3,643,416
def _build_stack_from_3d(recipe, input_folder, fov=0, nb_r=1, nb_c=1): """Load and stack 3-d tensors. Parameters ---------- recipe : dict Map the images according to their field of view, their round, their channel and their spatial dimensions. Only contain the keys 'fov', 'r', '...
6cb4e567324cb3404d6e373b3f9a00d3ccdd51ef
3,643,417
def view_menu(request): """Admin user view all the reservations.""" menus = Menu.objects.all() return render(request, "super/view_menu.html", {'menus': menus})
7b8244a315f2da0794a80f71cf73517e81f614e0
3,643,418
def _get_hdfs_dirs_by_date(physical_table_name, date): """ 根据日期获取指定日期的hdfs上数据目录列表 :param physical_table_name: 物理表名称 :param date: 日期 :return: hdfs上的数据目录列表 """ return [f"{physical_table_name}/{date[0:4]}/{date[4:6]}/{date[6:8]}/{hour}" for hour in DAY_HOURS]
6581f81ebcf9051ccf97ade02fc80eeba46e0e78
3,643,419
import json def indeed_jobs(request, category_id): """ Load Indeed jobs via ajax. """ if request.is_ajax() and request.method == 'POST': per_page = 10 page = 1 html = [] if category_id == '0': all_jobs = IndeedJob.objects.all() else: al...
12cf21f9ecad672e78715ef9687ad2e69d5ea963
3,643,420
def iinsertion_sort(arr, order=ASCENDING): """Iterative implementation of insertion sort. :param arr: input list :param order: sorting order i.e "asc" or "desc" :return: list sorted in the order defined """ operator = SORTING_OPERATORS.get(order.lower(), GREATER_THAN) for i in range(1, len(...
8698fbb500bfad3cb2e6964112d46ef8151c1e89
3,643,421
def actor_files_paths(): """ Returns the file paths that are bundled with the actor. (Path to the content of the actor's file directory). """ return current_actor().actor_files_paths
2ec9505eceb2da78aee668ff044e565374aa3a1c
3,643,422
import struct def parse_table(data: bytes, fields: list) -> dict: """Return a Python dictionary created from the bytes *data* of an ISIS cube table (presumably extracted via read_table_data()), and described by the *fields* list and *records*. Please be aware that this does not perform masking of the...
3727a37d619c77c6789e1d11479ecfd67b814766
3,643,423
import scipy def gridtilts(shape, thismask, slit_cen, coeff2, func2d, spec_order, spat_order, pad_spec=30, pad_spat = 5, method='interp'): """ Parameters ---------- tilt_fit_dict: dict Tilt fit dictioary produced by fit_tilts Returns ------- piximg: ndarray, float Image in...
55dd6ddd065e4f4bfefdc30bef27dc6e6541190b
3,643,424
import functools def exp_t(u, t): """Compute exp_t for `u`.""" def _internal_exp_t(u, t): return tf.nn.relu(1.0 + (1.0 - t) * u) ** (1.0 / (1.0 - t)) return tf.cond( tf.math.equal(t, 1.0), lambda: tf.math.exp(u), functools.partial(_internal_exp_t, u, t))
27fe729ea55bc8933d6ccd41c5ae96657b4426ad
3,643,425
def max_matching(G, method="ilp"): """Return a largest matching in *G*. Parameters ---------- G : NetworkX graph An undirected graph. method: string The method to use for finding the maximum matching. Use 'ilp' for integer linear program or 'bf' for brute force. Def...
34407865678e46d7d042fa94852b66ebc22787d6
3,643,426
def hasEdgeFlux(source, edgeDistance=1): """hasEdgeFlux Determine whether or not a source has flux within `edgeDistance` of the edge. Parameters ---------- source : `scarlet.Component` The source to check for edge flux edgeDistance : int The distance from the edge of the im...
2fd924c20cb89b3728ef3a24f92b89eb0b136fe5
3,643,427
def biswas_robustness(data_scikit, data_mm): """ summary stats on consensus peaks """ CV = find_CV(th=0.0001, ca=0.5, sd=1) CV_th001 = find_CV(th=0.001, ca=0.5, sd=1) CV_th01 = find_CV(th=0.01, ca=0.5, sd=1) CV_th00001 = find_CV(th=0.00001, ca=0.5, sd=1) CV_sd15 = find_CV(th=0.0001, ca=...
70ecee0baa60a5b06c785dd172bc9d0719840903
3,643,428
def get_click_offset(df): """ df[session_key] return a set of session_key df[session_key].nunique() return the size of session_key set (int) df.groupby(session_key).size() return the size of each session_id df.groupby(session_key).size().cumsum() retunn cumulative sum """ offsets = np.zeros(...
c8caed25899f71549a9333e64452f8eed9cf1029
3,643,429
def delete_enrichment(): """ Controller to delete all existing GO enrichments :return: Redirect to admin main screen """ CoexpressionCluster.delete_enrichment() flash('Successfully removed GO enrichment for co-expression clusters', 'success') return redirect(url_for('admin.controls.index')...
9cface0783929581f3e6076f43a461ef815c0d2b
3,643,430
from typing import Counter import logging def evaluate_agent(agent, env, alpha, num_users=100, deterministic=False, softmax_temperature=1.0, scatter_plot_trajectories=False, figure_file_obj=None, risk_score_extractor=violence_risk, plot_histogram=False, ...
9bf9413eb49a7fb635ded6b665ce7e3f45a0413b
3,643,431
from typing import Sequence def argmax(sequence: Sequence) -> int: """Find the argmax of a sequence.""" return max(range(len(sequence)), key=lambda i: sequence[i])
58cc1d0e952a7f15ff3fca721f43c4c658c41de1
3,643,432
def read_data_from_device(device, location): """ Reads text data from device and returns it as output Args: location ('str'): Path to the text file Raises: FileNotFoundError: File Does not Exist Returns: Data ('str'): Text data read from the device """...
f6895d25f9f9e68ec33bb2d8f693999a7e3a2812
3,643,433
import os def get_credentials() -> tuple: """Gets bot auth credentials from environment variables defined in the local .env file""" load_dotenv() irc_token = os.environ.get('TWITCH_OAUTH_PASS') client_id = os.environ.get('TWITCH_CLIENT_ID') channel = os.environ.get('TWITCH_CHANNEL') return ...
df1c8e998d27f4fec7574fb10dd7022b284680f0
3,643,434
from typing import Dict def postman_parser(postman_info: dict, environment_vars: Dict = None) -> APITest: """ Get a parser collection, in JSON input format, and parser it :param postman_info: JSON parsed info from Postman :type postman_info: dict :param environment_vars: varia...
1e3c351c3b7ee37d438edeb9e64e70d67b45e1b9
3,643,435
def allOPT2 (routes, dists, maxtime=float("inf")): """ A simpler way to make the 2-OPT optimization on all the provided routes. :param routes: The routes to optimize. :param dists: The matrix of distances. :param maxtime: The maximum time the optimization can go on. :return: The optimised ...
ec7a2e337371cf806b7fa32661185b7400e774a0
3,643,436
def getScoreByName(name): """ This function will search for the name and will, if found, return the scores """ for idx, val in enumerate(names): if val == name: return scores[idx]
77074b360c2e35ae30053e1b00b3270166f27ada
3,643,437
def count_dict(dict_): """ Count how many levels the dict has """ if not isinstance(dict_, dict): raise Dict_Exception("dict_ must be a dict") return max(count_dict(v) if isinstance(v, dict) else 0 for v in dict_.values()) + 1
b608469d67f050b366cb5b97a7d686bdf8347616
3,643,438
def __draw_tick_labels(scales, chart_height, chart_width): """Draws the numbers in both axes.""" axis_values = [0, 0.25, 0.5, 0.75, 1] axis_df = pd.DataFrame({"main_axis_values": axis_values, "aux_axis_position": 0}) x_tick_labels = ( alt.Chart(axis_df) .mark_text( yOffset...
85107e3255953af667e43374927299a5a55b6809
3,643,439
import os def HIP_to_HD(name): """Convert an HIP name in *Hipparcos Catalogue* to HD name in *Henry Draper Catalogue*. Args: name (str or int): Name of star in *Hipparcos Catalogue*. """ hip = _get_HIP_number(name) filename = os.path.join(xindex_path, 'HIP-HD.csv') f1 = lambda r...
a1a7d965ae93043a1b1905a4396484dc1005de99
3,643,440
import torch import sys from io import StringIO def convert_torchscript_module_to_torch_backend_contract_mlir(program: torch.nn.Module): """Perform common lowering from TorchScript to Torch MLIR Returns an MLIR module that satisfies the Torch backend contract. """ mb = ModuleBuilder() scripted = ...
a3e162dd9cea71d7492d626257a81929565dc128
3,643,441
def thread_profile(D,P,inset,internal=True,base_pad=0.1): """ISO thread profile""" H = P*np.sqrt(3)/2 Dm = D - 2*5*H/8 Dp = D - 2*3*H/8 if internal: return np.array([ (-P/2,D/2+H/8+base_pad+inset), (-P/2,D/2+H/8+inset), (-P/8,Dm/2+inset), (P/8,...
abea6e4f234f4176a385b3abc2ca6f1de0c93a1b
3,643,442
import os import json from datetime import datetime def mock_session(monkeypatch, data): """ Mocked out sqlalchemy session """ if data: dirname = os.path.dirname(os.path.realpath(__file__)) filename = os.path.join(dirname, data) with open(filename) as data_file: json_data =...
d855097df6e4f472027958fa5cfb2600b7d12589
3,643,443
def get_service(hass, config, discovery_info=None): """Get the HipChat notification service.""" return HipchatNotificationService( config[CONF_TOKEN], config[CONF_ROOM], config[CONF_COLOR], config[CONF_NOTIFY], config[CONF_FORMAT], config[CONF_HOST])
1d6b7e5d53084bd91de307a162c4710aac84be24
3,643,444
from typing import List def connect_with_interior_or_edge_bulk( polygon: Polygon, polygon_array: GeometryArray ) -> List[bool]: """ Return boolean array with True iff polys overlap in interior/edge, but not corner. Args: polygon (Polygon): A shapely Polygon polygon_array (GeometryArra...
852a43d1782ae85dbb2d2adb70feb59ace7a6a44
3,643,445
import pickle def get_history(kmodel=None): """ returns a python dict with key = metric_id val = [metric each epoch ] """ # get kmodel object from input str if the input is a string if isinstance(kmodel,str): try: kmodel = KModel.objects.get(id=kmodel) except ObjectDoes...
da2886f565ca2f96e49a38b458368de2e4216c01
3,643,446
def get_neighbor_v4_by_search(search=None): """Return a list of NeighborV4's by dict.""" try: objects = NeighborV4.objects.filter() search_dict = search if search else dict() object_map = build_query_to_datatable_v3(objects, search_dict) except FieldError as e: raise api_res...
6893c32014d6b2a8871825744a1953024fe3a289
3,643,447
def load_clean_data(): """funcion that loads tuberculosis file and preprocesses/cleans the dataframe""" df = pd.read_csv('tb.csv') # drop columns 'fu' and 'mu' since they only contain missing values and would mess up the following processing steps df = df.drop(columns = ['fu', 'mu']) # define row an...
2430bb61705f95c77f68eabbcda535e7d0f443ea
3,643,448
def is_anagram_passphrase(phrase): """ Checks whether a phrase contains no words that are anagrams of other words. >>> is_anagram_passphrase(["abcde", "fghij"]) True >>> is_anagram_passphrase(["abcde", "xyz", "ecdab"]) False >>> is_anagram_passphrase(["a", "ab", "abc", "abd", "abf", "abj"]) ...
aa7a95cda82317a41d8c4f2765a4706896135f45
3,643,449
def _client_ip(client): """Compatibility layer for Flask<0.12.""" return getattr(client, 'environ_base', {}).get('REMOTE_ADDR')
1bd110563c5e7165ec795d16e0f0d7be6d053db1
3,643,450
def findtrapezoidfunc( thexvals, theyvals, thetoplength, initguess=None, debug=False, minrise=0.0, maxrise=200.0, minfall=0.0, maxfall=200.0, minstart=-100.0, maxstart=100.0, refine=False, displayplots=False, ): """ Parameters ---------- thexvals ...
239f6d7edf2b99e631c7787ed6370685ff897e1d
3,643,451
def extractRecords(getRecordsResponse): """Returns a list of etrees of the individual records of a getRecords response""" recs = getRecordsResponse.xpath( '/csw:GetRecordsResponse/csw:SearchResults//csw:Record', namespaces={'csw': ns_csw}) return recs
3de69fc99f77c4d06346aa82121cc936e16a06b4
3,643,452
from typing import Set def tagify(tail=u'', head=u'', sep=u'.'): """ Returns namespaced event tag string. Tag generated by joining with sep the head and tail in that order head and tail may be a string or a list, tuple, or Set of strings If head is a list, tuple or Set Then join with sep ...
ddebdc0c4224db428a4338fd1e4c61137ac2d5c5
3,643,453
def get_fn_data(src_db, fn_table, year=None): """Get the data and fields from the query in the src database for the fish net table specified by fn_table. Returns list of dictionaries - each element represents a single row returned by the query. Arguments: - `src_db`: full path the source database....
60d48e0b7727ccd25e4b91bf59f1f505ddbc3127
3,643,454
import collections def convert_example_to_feature(example, tokenizer, max_seq_length=512, doc_stride=384, max_query_length=125, is_training=True, cls_token_at_end=False, cls_token='[CLS]', sep_token='[SEP]', pad_token=0...
1db90a014da443e143411276cbbf0e29a9872b7f
3,643,455
def make_pickle(golfed=False): """Returns the pickle-quine. If "golfed" is true, we return the minimized version; if false we return the one that's easier to understand. """ part_1 = b''.join(PART_1) part_2 = b''.join(GOLFED_PART_2 if golfed else PART_2) # We tack the length onto part 1: ...
79fdc182ef3487090a8acd61c44b46d4b7cc5493
3,643,456
def classify_design_space(action: str) -> int: """ The returning index corresponds to the list stored in "count": [sketching, 3D features, mating, visualizing, browsing, other organizing] Formulas for each design space action: sketching = "Add or modify a sketch" + "Copy paste sketch" 3...
22dc68aa23258691b0d4b9f1b27a9e8451b275d9
3,643,457
import hashlib def get_sha256_hash(plaintext): """ Hashes an object using SHA256. Usually used to generate hash of chat ID for lookup Parameters ---------- plaintext: int or str Item to hash Returns ------- str Hash of the item """ hasher = hashlib.sha256(...
79735973b8ad73823662cc428513ef393952b681
3,643,458
def get_bit_coords(dtype_size): """Get coordinates for bits assuming float dtypes.""" if dtype_size == 16: coords = ( ["±"] + [f"e{int(i)}" for i in range(1, 6)] + [f"m{int(i-5)}" for i in range(6, 16)] ) elif dtype_size == 32: coords = ( ...
6400017e47506613cf15162425843ce2b19eed3e
3,643,459
from klpyastro.utils import obstable def create_record(user_inputs): """ Create a ObsRecord from the informations gathered from the users. :param user_inputs: Dictionary with all the values (as strings) required to fully populate a ObsRecord object. :type user_inputs: dict :rtype: ObsReco...
8fc1a31a24ac7663b405074410d1c025fbcd7d62
3,643,460
import itertools def best_wild_hand(hand): """best_hand но с джокерами""" non_jokers = list(filter(lambda x: x[0] != '?', hand)) jokers = filter(lambda x: x[0] == '?', hand) jokers_variations = itertools.product( *[joker_variations(joker) for joker in jokers] ) best_hands = [] fo...
86cb58dba0338c481ce516657118cdc20260ebf3
3,643,461
def GetTestMetadata(test_metadata_file=FAAS_ROOT+"/synthetic_workload_invoker/test_metadata.out"): """ Returns the test start time from the output log of SWI. """ test_start_time = None with open(test_metadata_file) as f: lines = f.readlines() test_start_time = lines[0] confi...
668e214452bb100885a8631b5d900eb7ca90e43b
3,643,462
import torch def gen_geo(num_nodes, theta, lambd, source, target, cutoff, seed=None): """Generates a random graph with threshold theta consisting of 'num_nodes' and paths with maximum length 'cutoff' between 'source' adn target. Parameters ---------- num_nodes : int Number of nodes. ...
5d3363aab4e13dd8690277453f603fe707c00d41
3,643,463
import re def FilterExceptions(image_name, errors): """Filter out the Application Verifier errors that have exceptions.""" exceptions = _EXCEPTIONS.get(image_name, []) def _HasNoException(error): # Iterate over all the exceptions. for (severity, layer, stopcode, regexp) in exceptions: # And see i...
37b5febe4da731a426c2cd3ef9d6aeb1f28a802c
3,643,464
from typing import Optional def dim(text: str, reset_style: Optional[bool] = True) -> str: """Return text in dim""" return set_mode("dim", False) + text + (reset() if reset_style else "")
cb180649913760b71b2857b61e264b6a17207433
3,643,465
import sys import os def want_color_output(): """Return ``True`` if colored output is possible/requested and not running in GUI. Colored output can be explicitly requested by setting :envvar:`COCOTB_ANSI_OUTPUT` to ``1``. """ want_color = sys.stdout.isatty() # default to color for TTYs if os.ge...
bda881ef70cfdb9bbb1eb1b81958f837f8bd92ed
3,643,466
def jaccard(list1, list2): """calculates Jaccard distance from two networks\n | Arguments: | :- | list1 (list or networkx graph): list containing objects to compare | list2 (list or networkx graph): list containing objects to compare\n | Returns: | :- | Returns Jaccard distance between list1 and list2 ...
1056c3d5a592bea9a575c24e947a91968b931000
3,643,467
def default_argument_preprocessor(args): """Return unmodified args and an empty dict for extras""" extras = {} return args, extras
2031dde70dbe54beb933e744e711a0bf8ecaed99
3,643,468
from typing import List from typing import Tuple import os def expand_site_packages(site_packages: List[str]) -> Tuple[List[str], List[str]]: """Expands .pth imports in site-packages directories""" egg_dirs: List[str] = [] for dir in site_packages: if not os.path.isdir(dir): continue ...
065c08f772440e2c2626fb785e4b89197fbf429c
3,643,469
import random def early_anomaly(case: pd.DataFrame) -> pd.DataFrame: """ A sequence of 2 or fewer events executed too early, which is then skipped later in the case Parameters ----------------------- case: pd.DataFrame, Case to apply anomaly Returns ----------------------- Cas...
0c5f0b0fb3336331737bd9f80712176476110ac9
3,643,470
import os from sys import version def get_package_version(): """ :returns: package version without importing it. """ base = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(base, "gotalk/__init__.py")) as initf: for line in initf: m = version.match(line.strip(...
8dafe13f12d9c4c50139250aacef92ab406bfe76
3,643,471
def parse_cmd(script, *args): """Returns a one line version of a bat script """ if args: raise Exception('Args for cmd not implemented') # http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true oneline_cmd = '&&'.join(script.split('\n')) oneline_...
b3355b20af2ca1ab2e996643ae0918a2d387760f
3,643,472
def expected_inheritance(variant_obj): """Gather information from common gene information.""" manual_models = set() for gene in variant_obj.get('genes', []): manual_models.update(gene.get('manual_inheritance', [])) return list(manual_models)
29bf223249e29942803cef8468dbd8bd04979e81
3,643,473
def player_stats_game(data) -> defaultdict: """Individual Game stat parser. Directs parsing to the proper player parser (goalie or skater). Receives the player_id branch. Url.GAME Args: data (dict): dict representing JSON object. Returns: defaultdict: Parsed Data. """ ...
e39e4e9fb4a3d06421639e9466d29724318484ef
3,643,474
def about(request): """ View function for about page """ return render( request, 'about.html', )
5bf7a52de1218718041ec7a05a749c623e19074e
3,643,475
def getTimeDeltaFromDbStr(timeStr: str) -> dt.timedelta: """Convert db time string in reporting software to time delta object Args: timeStr (str): The string that represents time, like 14:25 or 15:23:45 Returns: dt.timedelta: time delta that has hours and minutes components """ if pd...
66a78192e6cbe5240a9131c2b18e4a42187a6024
3,643,476
def colorBool(v) -> str: """Convert True to 'True' in green and False to 'False' in red """ if v: return colored(str(v),"green") else: return colored(str(v),"red")
8c196bccc5bb1970cc752a495117bcc74ed4f8f6
3,643,477
from typing import List def bootstrap( tokens: List[str], measure: str = "type_token_ratio", window_size: int = 3, ci: bool = False, raw=False, ): """calculate bootstrap for lex diversity measures as explained in Evert et al. 2017. if measure='type_token_ratio' it calculates standardiz...
d86cff5edd61698b1adee14a5c2fb800b4b76608
3,643,478
def by_label(move_data, value, label_name, filter_out=False, inplace=False): """ Filters trajectories points according to specified value and collum label. Parameters ---------- move_data : dataframe The input trajectory data value : The type_ of the feature values to be use to filter t...
3d772f741539009b756744539f4a524e6ad402ea
3,643,479
import numpy def make_pyrimidine(residue, height = 0.4, scale = 1.2): """Creates vertices and normals for pyrimidines:Thymine Uracil Cytosine""" atoms = residue.atoms names = [name.split("@")[0] for name in atoms.name] idx=names.index('N1'); N1 = numpy.array(atoms[idx].coords) idx=names.ind...
eac8e9bd0cc6abeefa5b8a6bad299ff6a0c6b9d8
3,643,480
def get_props(filepath, m_co2=22, m_poly=2700/123, N_A=6.022E23, sigma_co2=2.79E-8, sort=False): """ Computes important physical properties from the dft.input file, such as density of CO2 in the CO2-rich phase, solubility of CO2 in the polyol-rich phase, and specific volume of the polyol-...
2aec573795a40c6c95e19ea9ae531abca47128e8
3,643,481
def get_genotype(chrom, rsid): """ """ geno_path = ('/home/hsuj/lustre/geno/' 'CCF_1000G_Aug2013_Chr{0}.dose.double.ATB.RNASeq_MEQTL.txt') geno_gen = pd.read_csv(geno_path.format(str(chrom)), sep=" ", chunksize = 10000) for i in geno_gen: if rsid in i.index: ...
6269aace777e5870e827152158ab70b73a44f401
3,643,482
import time def task_dosomething(storage): """ Task that gets launched to handle something in the background until it is completed and then terminates. Note that this task doesn't return until it is finished, so it won't be listening for Threadify pause or kill requests. """ # An important task th...
9eabf3977c53932de8d775c21e4a1209003e0892
3,643,483
def highway(input_, size, num_layers=1, bias=-2.0, f=tf.nn.relu, scope='Highway'): """Highway Network (cf. http://arxiv.org/abs/1505.00387). t = sigmoid(Wy + b) z = t * g(Wy + b) + (1 - t) * y where g is nonlinearity, t is transform gate, and (1 - t) is carry gate. """ with tf.variable_scope(s...
dd90cd6107d5d69596c18d46bbef990cec8b1112
3,643,484
import functools def convert_to_entry(func): """Wrapper function for converting dicts of entries to HarEnrty Objects""" @functools.wraps(func) def inner(*args, **kwargs): # Changed to list because tuple does not support item assignment changed_args = list(args) # Convert the dict ...
a5be9b430a47cb9c0c448e8ba963538fd6a435dc
3,643,485
def transform(record: dict, key_ref: dict, country_ref: pd.DataFrame, who_coding: pd.DataFrame, no_update_phrase: pd.DataFrame): """ Apply transformations to OXCGRT records. Parameters ---------- record : dict Input record. key_ref : dict Reference for key mapping. country_r...
2d115f8d64731c5ca88807845d09085b4f07acfd
3,643,486
def hc_genes( input_gene_expression: "gene expression data filename (.gct file) where rows are genes and columns are samples", clustering_type: "single or consensus -- Only single is suported at the moment", distance_metric: "the function to be used when comparing the distance/similarity of the ...
3c0a6345f21a6387e215e15b72a2e933d2586fd3
3,643,487
from google.cloud import vision import io def detect_text(path): """Detects text in the file.""" client = vision.ImageAnnotatorClient() with io.open(path, 'rb') as image_file: content = image_file.read() image = vision.Image(content=content) response = client.text_detection(image=image)...
6dea35d84f538322eed74c9c7c1f9d7a4882dd33
3,643,488
def file_util_is_ext(path, ext): """判断是否指定后缀文件,ext不包含点""" if file_util_get_ext(path) == ext: return True else: return False
27389af32333036b998a421ed35952705092ade6
3,643,489
def load_tract(repo, tract, patches=None, **kwargs): """Merge catalogs from forced-photometry coadds across available filters. Parameters -- tract: int Tract of sky region to load repo: str File location of Butler repository+rerun to load. patches: list of str List of pa...
f989c947dec96426b15219ab224364c96f65d1fb
3,643,490
from datetime import datetime def calculate_delta(arg1, arg2): """ Calculates and returns a `datetime.timedelta` object representing the difference between arg1 and arg2. Arguments must be either both `datetime.date`, both `datetime.time`, or both `datetime.datetime`. The difference is absolute, so the order of ...
f6b3f0b86bd73be7d1702ba8893cd70d99b0b321
3,643,491
import yaml def create_model_config(model_dir: str, config_path: str = None): """Creates a new configuration file in the model directory and returns the config.""" # read the config file config_content = file_io.read_file_to_string(root_dir(config_path)) # save the config file to the model directory...
c695ee36b6dec24ef17179adbf40e81aff708082
3,643,492
def get_deployment_physnet_mtu(): """Retrieves global physical network MTU setting. Plugins should use this function to retrieve the MTU set by the operator that is equal to or less than the MTU of their nodes' physical interfaces. Note that it is the responsibility of the plugin to deduct the value of...
161e7f87e2a68643f81e2b62061d65251a1249de
3,643,493
def _path(path): """Helper to build an OWFS path from a list""" path = "/" + "/".join(str(x) for x in path) return path.encode("utf-8") + b"\0"
d38937deb459bb9bf393402efc31a90a285d4a6d
3,643,494
import time def current_milli_time(): """Return the current time in milliseconds""" return int(time.time() * 1000)
66605d2e23df2c428c70af75247e2b22a2795363
3,643,495
def function_exists(function_name, *args, **kwargs): """ Checks if a function exists in the catalog """ # TODO (dmeister): This creates an SQL injection, but it should not # be a problem for this purpose. function_exists_text_count = PSQL.run_sql_command( "SELECT 'function exists' FROM pg_proc WHERE proname='%...
bf351461b4110349eea1734ef9b482435e946a4e
3,643,496
from typing import Callable from typing import Sequence from typing import Dict from typing import Optional def _loo_jackknife( func: Callable[..., NDArray], nobs: int, args: Sequence[ArrayLike], kwargs: Dict[str, ArrayLike], extra_kwargs: Optional[Dict[str, ArrayLike]] = None, ) -> NDArray: "...
83e39e97e08ef4d16f2c48a084c5ed40d0fbc0ad
3,643,497
from Bio.SeqIO.QualityIO import solexa_quality_from_phred def _fastq_illumina_convert_fastq_solexa(in_handle, out_handle, alphabet=None): """Fast Illumina 1.3+ FASTQ to Solexa FASTQ conversion (PRIVATE). Avoids creating SeqRecord and Seq objects in order to speed up this conversion. """ # Map une...
06422e23bb005756742207e63ec1d8dc603ba5b2
3,643,498
def pull_branch(c: InvokeContext, repo: Repo, directory: str, branch_name: str) -> CommandResult: """ Change to the repo directory and pull master. :argument c: InvokeContext :argument repo: Repo the repo to pull :argument directory: str the directory to change to :argument branch_name: ...
5c21bdbbe91f5f82b40645a3449d373f6c464717
3,643,499