content
stringlengths
22
815k
id
int64
0
4.91M
def plot2opencv(fig): """Convert a pyplot instance to image""" buf = _io.BytesIO() fig.savefig(buf, format='png', bbox_inches='tight', pad_inches=0) buf.seek(0) rawbuf = np.frombuffer(buf.getvalue(), dtype='uint8') im = cv2.imdecode(rawbuf, cv2.IMREAD_COLOR) buf.close() return im
72,200
def write_xls(sheet_name, head, data_list): """write listed data into excel """ try: wb = openpyxl.Workbook() ws = wb.get_active_sheet() except Exception as e: logger.error(e) return None ws.title = sheet_name row_num = 0 # write table head for col_num...
72,201
def setup_argparse(parser: argparse.ArgumentParser) -> None: """Setup argument parser for ``cubi-tk sodar landing-zone-create``.""" return CreateLandingZoneCommand.setup_argparse(parser)
72,202
def plot1D(data, fig=100, mstyle='-b'): """ Show result of a 1D scan """ val = data.default_parameter_name() if fig is not None: plt.figure(fig) plt.clf() MatPlot(getattr(data, val), interval=None, num=fig)
72,203
def _write_artists(output_data: str, spark: SparkSession): """Save artists data partitioned by year and artist_id in the parquet format.""" artists_table = spark.sql(select_artists) artists_table.write.parquet(os.path.join(output_data, 'artists.parquet'))
72,204
def missing_local_with_stage(stage: str, ssm_env: dict, local_env:dict, filter_env: list = []): """Returns missing values between ssm stage and local env""" ssm_env = [x for x in ssm_env.keys() if x not in filter_env] local_env = [x for x in local_env.keys() if x not in filter_env] in_ssm = [x for x in ...
72,205
def _slot_history(tracker_dump): # type: (Dict[Text, Any]) -> List[Text] """Create an array of slot representations to be displayed.""" slot_strs = [] for k, s in tracker_dump.get("slots").items(): colored_value = utils.wrap_with_color(str(s), utils...
72,206
def HTN_classical_partition_function_from_edges( edges, beta, j=1.0, h=0.0, site_ind_id="s{}", site_tag_id="I{}", bond_tag_id="B{},{}", ): """Build a hyper tensor network representation of a classical ising model partition function by specifying graph edges. There will be a single ...
72,207
def _getThunk_0_2in_1out(vecMathName, callName, vecSize): """calls a packed func directly""" llvmType = _getLLVMType(vecSize) ## output the func definition cog.outl("define {0} @{1}({0} %ins0, {0} %ins1) nounwind alwaysinline readnone {{".format(llvmType, vecMathName)) cog.outl("entry:") cog.out...
72,208
def generate_cartesian_coords(molecule: Chem.Mol): """ TODO Parameters ---------- molecule : Chem.Mol [description] """ pass
72,209
async def test_countries(aresponses): """Test getting a list of supported countries.""" aresponses.add( "api.airvisual.com", "/v2/countries", "get", aresponses.Response( text=load_fixture("countries_response.json"), headers={"Content-Type": "application/js...
72,210
def country(cert): """ Attempt to get the country from a given certificate. :param cert: :return: """ try: return cert.subject.get_attributes_for_oid( x509.OID_COUNTRY_NAME )[0].value.strip() except Exception as e: sentry.captureException() current...
72,211
def detect_fns_free_variables(source_code, imports_and_functions="", step_parameters=None): """Return the function's free variables. Free variable: _If a variable is used in a code block but not defined there, it is a free variable._ An Example: ``` x = 5 def...
72,212
def reactivate(state, username): """Reactivate a user.""" sdk = state.sdk _reactivate_user(sdk, username)
72,213
def assign(grid: Grid, s: Square, d: Digit) -> MaybeGrid: """Eliminate all the other values (except d) from grid[s] and propagate. if a contradiction is detected, return None """ others = grid[s].replace(d, "") for d in others: if eliminate(grid, s, d) is None: return None r...
72,214
def print_received_data(data): """Print received data in the terminal """ print("Received : '{0}'\n".format(data))
72,215
def split_types(query): """ Split a string of multiple :py:class:`MeasurementType` keys (e.g., one generated by using addition or subtraction of :py:class:`MeasurementType` objects and/or strings). :param query: A :py:class:`MeasurementType` or a string containing multiple :py:c...
72,216
def get_outcome(output: str, test: Test, sig: int): """ Parses out the number of passed and failed tests from cb-test output """ test_outcome = TestOutcome() test_outcome.total = 1 test_outcome.passed = 0 test_outcome.name = test.name test_outcome.is_pov = test.is_pov test_outcom...
72,217
def unzip_image(zip_path): """Unzips a file with a img file inside. :param zip_path: Path to the zip file to uncompress. :raises Exception: If there is no .img file inside the zip. :return: Absolute path to an uncompressed .img file from the zip. """ print("Unzipping OS image: {}".format(zip_pa...
72,218
def evaluate(): """Evaluate on whole test data for DeepSpeech2.""" data_generator = DataGenerator( vocab_filepath=args.vocab_path, mean_std_filepath=args.mean_std_path, augmentation_config='{}', specgram_type=args.specgram_type, num_threads=args.num_proc_data, kee...
72,219
def search(): """ Return search results for a given query """ query = request.args.get("query", "") if query == "": return redirect(url_for("main.browse")) page = int(request.args.get("page", 1)) format = request.args.get("format", "") scan_ids = request.args.get("includeScan...
72,220
def register_dependency_parse_head( model, args, name, num_classes=None, inner_dim=None, **kwargs, ): """Register a span prediction head for a RobertaModel.""" if name in model.classification_heads: prev_num_classes = model.classification_heads[ name].out_proj.out_fea...
72,221
def bubble_sort(array): """ Sorts a list using bubble sort algorithm Input: A list of integers Output: A list containing the same integers as the input, but sorted in ascending order Sorts by iterating through a list swapping values that are in the wrong order. Stops when it is imp...
72,222
def issue_dir(issue_id): """ input: 123 output: /path/to/repo/gl/i/123 """ return DIR / "i" / str(issue_id)
72,223
def _read_info(info_filename: str) -> Dict[str, Any]: """read info into dictionary""" with open(info_filename, "r") as info_file: lines = info_file.readlines() info = {} for line in lines: key, val = line.strip().split("\t") if key == "stroke": if ...
72,224
async def test_interval_update( hass: HomeAssistant, aioclient_mock: AiohttpClientMocker ) -> None: """Test the WLED configuration entry unloading.""" entry = await init_integration(hass, aioclient_mock, skip_setup=True) interval_action = False def async_track_time_interval(hass, action, interval)...
72,225
def tags(conf, dlcs, *count, **opts): """Print all tags, optionally filtered by their count. % dlcs tags [[ '>' | '<' | '=' ] count] """ tags = cached_tags(conf, dlcs, opts['keep_cache']) if count: if not count[0].isdigit(): assert len(count) == 1 count = coun...
72,226
def clear_animation_data(object_name): """ Deletes (also) previously inserted keyframes """ obj = bpy.data.objects[object_name] obj.animation_data_clear() bpy.context.scene.update()
72,227
def signal_derivs(zc, params, dparams): """ Calculate derivatives of signal covariance w.r.t. cosmological parameters. """ derivs = [] # Loop over parameters that should be included in Fisher matrix pnames = dparams.keys() pnames.sort() for pname in pnames: print " Derivati...
72,228
def view_coach(request, coach_id): """ A view to show a particular coaches page and their comments""" coach = get_object_or_404(Coach, pk=coach_id) if request.method == "POST": form = CommentForm(request.POST) if form.is_valid(): comment = form.save(commit=False) co...
72,229
def replace(filename, stext, rtext): """ replace string stext with rtext in file filename """ status = True try: _input = open(filename, "r") except Exception, e: tolog("!!WARNING!!4000!! Open failed with %s" % e) status = False else: try: output = open(f...
72,230
def unflip(word, word_eol, userdata): """/unfip <text> - appends '┬─┬ ノ( ゜-゜ノ)' to the end of the message""" if len(word_eol) > 1: send(word_eol[1] + ' ' + UNFLIP) else: send(UNFLIP)
72,231
def infer_pip_requirements(model_uri, flavor, fallback=None): """ Infers the pip requirements of the specified model by creating a subprocess and loading the model in it to determine which packages are imported. :param model_uri: The URI of the model. :param flavor: The flavor name of the model. ...
72,232
def get_unlucky_days(): """Returns the days that had article request fails percentage higher than 1%.""" query = """SELECT to_char(date, 'FMMonth FMDD, YYYY') as date, error FROM request_errors_per_dar WHERE error > 0.01;""" return format_query( '...
72,233
def test_update_missing_zone_data(shared_zone_test_context): """ Test that updating a zone without providing necessary data returns errors and fails the update """ client = shared_zone_test_context.ok_vinyldns_client result_zone = None try: zone_name = 'one-time.' zone = { ...
72,234
def GetGradleSnippet(args): """Forms a gradle snippet to add to the build.gradle file. Args: args: an argparse namespace. All the arguments that were provided to this command invocation. Returns: A gradle snippet. """ repo_path = _GetRepoPath(args) gradle_template = """\ Please insert follo...
72,235
def PrepareInitialAcousticModel(dir, run_opts): """ Adds the first layer; this will also add in the lda.mat and presoftmax_prior_scale.vec. It will also prepare the acoustic model with the transition model.""" train_lib.RunKaldiCommand(""" {command} {dir}/log/add_first_layer.log \ nnet3-init...
72,236
def run(config) -> Dict[str, dict]: """ Lowpolyfy one or more images using default or user-provided config. Returns (Dict[str, dict]): A mapping from file paths to the config used to generate them. """ if config.run.mode == "single": results = single(config) elif config.run.mode == "rep...
72,237
def update_comp_num(node): """ Set the ``comp_num`` of ``node`` to the ``comp_num`` of its first child. INPUT: - ``node`` -- node whose comp_num needs to be updated EXAMPLES:: sage: from sage.graphs.graph_decompositions.modular_decomposition import * sage: forest = Node(NodeType....
72,238
def load_connector(connector_info): """instantiate the connector class""" connector = importlib.import_module( f"bookwyrm.connectors.{connector_info.connector_file}" ) return connector.Connector(connector_info.identifier)
72,239
def pid_file(pid_path=None, pid_file=None, port=0): """ Create or remove pid file """ global DIR_PID if not sabnzbd.WIN32: if pid_path and pid_path.startswith("/"): DIR_PID = os.path.join(pid_path, "sabnzbd-%d.pid" % port) elif pid_file and pid_file.startswith("/"): D...
72,240
def cli(env, identifier): """Detail firewall.""" mgr = SoftLayer.FirewallManager(env.client) firewall_type, firewall_id = firewall.parse_id(identifier) _firewall = mgr.get_instance(firewall_id) table = formatting.KeyValueTable(['name', 'value']) table.align['name'] = 'r' table.align['valu...
72,241
def axes_contains(ax, obj_list): """ Check that a matplotlib.Axes instance contains certain elements. Parameters ---------- ax : matplotlib.Axes Axes instance. obj_list : list of tuples List of tuples, one for each type of object to look for. The tuple should be of the ...
72,242
def output_instructions(stream, module, insts, is_raw_mode, newline=True): """Output instructions.""" if insts and newline: stream.write('\n') for inst in insts: output_instruction(stream, module, inst, is_raw_mode, indent='')
72,243
def get_globally_rescoped_token(globaltoken, defaultid): """Summary - Get a global project scoped auth token Returns: STRING: Globally Scoped Object Args: globaltoken (string): valid global token defaultid (string): default projct id """ identityURL = 'https://identity.gls....
72,244
def _bessel_ive_bwd(aux, g): """Reverse mode impl for bessel_ive.""" v, z = aux ive = _bessel_ive_custom_gradient(v, z) grad_z = g * ( _bessel_ive_custom_gradient(v + 1., z) + (v / z - tf.math.sign(z)) * ive) _, grad_z = _fix_gradient_for_broadcasting( v, z, tf.ones_like(grad_z), grad_z) # No g...
72,245
def compile_cons_check(context): """Throw a runtime error if the value in rax is not a cons cell or nil. Does not modify rax. See also `compile_list_check`. """ error_block = compile_die(b"not a cons cell :(\n", context) result = [] # mov rdi, rax result.extend([0x48, 0x89, 0xC7]) ...
72,246
def user(): """ exposes: http://..../[app]/default/user/login http://..../[app]/default/user/logout http://..../[app]/default/user/register http://..../[app]/default/user/profile http://..../[app]/default/user/retrieve_password http://..../[app]/default/user/change_password http://.....
72,247
def signin_required(include_gitlab_login=False): """Check if the user is signed in or the access token is valid and return the user.""" def decorator(func): @functools.wraps(func) def wrapper(*args, **kwargs): try: user = None if current_user.is_authe...
72,248
def build_dump_structure(path, tensor_name_list, tensor_list, net_name, tensor_info_list): """Build dump file structure from tensor_list.""" ranks_run_history = {} temp_dir = tempfile.mkdtemp(prefix=net_name, dir=path) for tensor_name, tensor, tensor_info in zip(tensor_name_list, tensor_list, tensor_inf...
72,249
def run_mhsCalculator_berge(temp_dir, efms, keep, opts, verbose): """ Run the mhsCalculator script """ default_opts = { 'm': temp_dir + '/modes.bin', 'r': temp_dir + '/rfile', 'o': temp_dir + '/cutsets.txt', 't': 1, 'b': None, } default_opts.update(opts) ...
72,250
def do_encoding(encoder_inputs, seq_len, sett): """ """ rand_unif_init = tf.random_uniform_initializer(-sett.rand_unif_init_mag, sett.rand_unif_init_mag, seed=123) # with tf.variable_scope('encoder'...
72,251
def branch_and_bound(c, A_ub, b_ub, A_eq, b_eq, bounds, bnbTreeNode=None): """ branch_and_bound 对整数规划问题使用「分支定界法」进行*递归*求解。 底层对松弛问题求解使用 scipy.optimize.linprog 完成, 该算法只是在 scipy.optimize.linprog 求解的基础上加以整数约束, 所以求解问题的模型、参数中的 c, A_ub, b_ub, A_eq, b_eq, bounds 与 scipy.optimize.linprog 的完全相同。 问题模型...
72,252
def nn_layer_fn(in_dim, out_dim, layer_name, fn=tf.nn.relu): """Builds a function of an nn layer, fully connected to the previous layer.""" with tf.name_scope(layer_name + '_vars'): weights_shape = [in_dim, out_dim] weights_stddev = 1.0 / math.sqrt(float(in_dim)) #Xavier initialization b...
72,253
def resolve_float_or_constant(input_value, accept_none = True): """Resolves an input as either a float or chemistry constant.""" if input_value is None: if accept_none: return None else: raise ValueError( f"Received invalid value {type(input_value)}." ) if isi...
72,254
def nextfile(): """ Close the current file so that the next iteration will read the first line from the next file (if any); lines not read from the file will not count towards the cumulative line count. The filename is not changed until after the first line of the next file has been read. Before...
72,255
def normalizeCMS( Ddata, thinSfx, scenario, putativeMutPop, complikeSfx, likesTableSfx, statsSfx = '', DdataNeutral = None, pop2name = pop2name, getio = None ): """Compute normalized versions of CMS computed assuming selection in $putativeMutPop, for all SNPs in all replicas of scenario $scena...
72,256
def test__calculate_enthalpy(): """ test chemkin_io.mechparser.thermo.calculate_enthalpy """ ref_ht1 = -42.58312043165988 ref_ht2 = -19.266388540056756 ht1 = chemkin_io.mechparser.thermo.calculate_enthalpy( SPECIES_POLYNOMIAL, TEMP1) ht2 = chemkin_io.mechparser.thermo.calculate_enthalpy(...
72,257
def saveimage(filename, myarray): """ First ensure your numpy array, myarray, is normalised with the max value at 1.0. Apply the colormap directly to myarray. Rescale to the 0-255 range. Convert to integers, using np.uint8(). Use Image.fromarray(). """ from PIL import Image # @Unresolve...
72,258
def test_compile_regex_with_blanks(): """Returns compiled regex from regex with blank spaces.""" regex = "^(\d{3}) (\d{3}) (\d{4})$" regex_compiled = compile_regex(regex) assert re.search(regex_compiled, "216 321 1234")
72,259
def get_output_metadata(packer, sample_dim_name): """ Retrieve xarray metadata for a packer's values, assuming arrays are [sample(, z)]. """ metadata = [] for name in packer.pack_names: n_features = packer.feature_counts[name] if n_features == 1: dims = [sample_dim_name] ...
72,260
def test_multiple_exp_fail_diff_exp(): """This test should fail""" with Raises(ZeroDivisionError, AttributeError, RuntimeError): float("not a number")
72,261
def local_users_get(handle, dump=False): """ This method gets the list of local users configured on the server Args: handle (ImcHandle) dump (bool) Returns: List of AaaUser objects corresponding to the local users """ aaa_users = _get_local_users(handle) users = [x...
72,262
def sort_data(PDB_files, data): """ Sorts data by name according to PDB files """ sort=natsort.natsorted(zip(PDB_files, data)) PDB_files=[tuple[0] for tuple in sort] if type(data)==list: data=[tuple[1] for tuple in sort] else: data=np.vstack([tuple[1] for tuple in sort]) ...
72,263
def test_invalid_cwts(stocking_event_dict, xls_choices, cache, value): """These are all invalid cwt patterns that should be considered invalid and pass.""" data = stocking_event_dict data["tag_no"] = value form = XlsEventForm(data=data, choices=xls_choices, cache=cache) status = form.is_valid() ...
72,264
def _random_shuffle(*lsts): """Randomly shuffle a dataset. Applies the same permutation to each list (to preserve mapping between inputs and targets). :param *lsts: variable number of lists to shuffle. :return: shuffled lsts. """ permutation = np.random.permutation(len(lsts[0])) shuffled = ...
72,265
def extract_subgraph(graph, object, task, hop=3): """ This function extract n-hop neighbors for an object and task pairs. ToDo: using the subgraph is slightly more involved since node index in the subgraph needs to be adjusted :param object: :param task: :param hop: :return: """ ob...
72,266
def import_records(c, filename='data.json'): """ Import database records from a file """ # Get an absolute path to the supplied filename if not os.path.isabs(filename): filename = os.path.join(localDir(), filename) if not os.path.exists(filename): print(f"Error: File '{filename...
72,267
def choose_report(account_type): """ Choose report object by account type Args: account_type(string): account type """ if account_type == SecuritiesType.futures: report_obj = FuturesReport else: raise Errors.INVALID_ACCOUNT_TYPE return report_obj
72,268
def search_results(search_request): """ Search results from given search paramaters. """ ghh, _ = try_ghh(session) search_users = session["search_users"] search_orgs = session["search_orgs"] search_repos = session["search_repos"] ignore = session["ignore"] if ghh is not None: ...
72,269
def test_predict(): #FIXME: there is a warning in this test (numpy.ufunc size changed), I can't figure out how to fix it. """Send a request to the API using a sample from the model and evaluates the response. """ model_dir = 'tree_model' # set the model saved at models model = HousePriceModel...
72,270
def test_experiments_with_NULL_sample_name(two_empty_temp_db_connections, some_paramspecs): """ In older API versions (corresponding to DB version 3), users could get away with setting the sample name to None This test checks that such an experiment gets corre...
72,271
def fproperty(func): """Decorator for a function that returns (fget, fset, fdel, doc)""" return _property(*func())
72,272
def connect_memdb(): """ :return: Instance of an in memory database. :rtype: SimpleSQLite :Example: :ref:`example-connect-sqlite-db-mem` """ return SimpleSQLite(MEMORY_DB_NAME, "w")
72,273
def deeplabv3_resnet50_features(pretrained=False, **kwargs): """Constructs a ResNet-50 model. Args: pretrained (bool): If True, returns a model pre-trained on Coco """ model = torchvision.models.segmentation.deeplabv3_resnet50(pretrained=pretrained) model.classifier._modules = {k: model.clas...
72,274
def extract_zip(zipfile, output_dir): """ Extracts a zipfile without the uppermost folder. Parameters ---------- zipfile: zipfile object Zipfile object to extract. output_dir: str | Path Directory to extract files to. """ output_dir = Path(output_dir) if zipfile.test...
72,275
def test_level_order_traversal(): """ @ref https://leetcode.com/problems/binary-tree-level-order-traversal/description/ @brief Given root of a binary tree, return level order traversal of its nodes' values, (i.e. from left to right, level by level). """ r = Node(3) r.left = Node(9) r.rig...
72,276
def parser(startpath: str) -> tuple: """Utility method to parse the filesystem""" file_and_hash = {} dirs_list = [] files_lst = [] def parse(startpath1: str) -> tuple: for root, dirs, files in os.walk(startpath1): dir_content = [] for dir in dirs: if ...
72,277
def get_multiclass_labels(): """ 0: normal 1: abnormal 2: notable findings/abnormalities that are not relevant or within normal limits (WNL) :return: """ return [0, 1, 2]
72,278
def test_yolact_head_loss(): """Tests yolact head losses when truth is empty and non-empty.""" s = 550 img_metas = [{ 'img_shape': (s, s, 3), 'scale_factor': 1, 'pad_shape': (s, s, 3) }] train_cfg = rflib.Config( dict( assigner=dict( type='...
72,279
def _boundary_spatial_dissim(data, group_pop_var, total_pop_var, standardize=False): """Calculation of Boundary Spatial Dissimilarity index. Parameters ---------- data : a geopandas DataFrame with a geometry column. group_pop_var : string The name of variable in data that contains the popul...
72,280
def test_skill_template_variables(): """ Test variable coverage for `parameters_skill.tpl`. """ allowed = base.ParametersSkillParser.FIELDS def is_covered_variable(field): """ Check if a skill field is covered during parsing. """ # Check for a regularly allowed fie...
72,281
def prepare_switchboard( audio_dir: Pathlike, transcripts_dir: Optional[Pathlike] = None, sentiment_dir: Optional[Pathlike] = None, output_dir: Optional[Pathlike] = None, omit_silence: bool = True, absolute_paths: bool = False ) -> Dict[str, Union[RecordingSet, Supervisio...
72,282
def k1_mean(success_tag, ms_results): """ Reports the expected value of k1, the rate constant for the bimolecular step of a resting-set reaction. """ success_kcolls = np.ma.array(ms_results['kcoll'], mask=(ms_results['tags']!=success_tag)) n = int(np.sum(ms_results['valid'])) n_s = int(np.sum(~success_kcolls....
72,283
def get_request(filename, persistent = True): """ Helper function to generate HTTP GET requests. Not used in application due to python overhead in string manipulation. """ data = 'GET /{} HTTP/1.1\r\n'.format(filename) data += 'Host: {}:{}\r\n'.format(ADDR,PORT) data += 'Connection:...
72,284
def update_express_route_port_link(cmd, instance, parent, express_route_port_name, link_name, macsec_cak_secret_identifier=None, macsec_ckn_secret_identifier=None, macsec_sci_state=None, macsec_cipher=None, admin_state=None): """ :param cmd: ...
72,285
def command_line_parser(): """ Hmmm well return all the parser argument Returns ------- Return args parser """ parser = argparse.ArgumentParser() parser.add_argument("image_path", type=str, help="Image you want to extract individual faces") parser.add_argument("...
72,286
def test_identify_data(create_fake_fits, name, expconf, expstat): """ test correct status messages are returned with identify_data """ filename = create_fake_fits(name) name = name if 'generic' not in name else [] try: valid_format, config = identify_data(filename) status = 'Success: Va...
72,287
def test_salt_cp(master, minion, salt_cp, tempfiles): """ Test copying a file from the master to the minion """ tfile = tempfile.NamedTemporaryFile(delete=True) tfile.close() dest = tfile.name try: contents = "id: foo" sls = tempfiles.makeslsfile(contents) assert mast...
72,288
def SendServerCommand(s, command): """ Send a command to the server and get the response. Send the command out to the server and pass the response back to the calling function. """ # send the command to the server s.sendall(command) # get the response from the server code, text = GetS...
72,289
def _or(self, other): """Compute the element-wise OR bitwise operation. Parameters ---------- other : Union[dragon.Tensor, number] The value to compute with. Returns ------- dragon.Tensor The output tensor. See Also -------- `dragon.bitwise.bitwise_or(...)`_ ...
72,290
def test_file_no_data(get_branch_info, try_disk, data_collector): """ Configuration from file is loaded from the "uploader.json" key. """ config, pconn = collect_args() with raises(ValueError): collect(config, pconn) data_collector.return_value.run_collection.assert_not_called() dat...
72,291
def zone_shp_overlay(zone_name_shp): """Select pumas within a zonal load area :param str zone_name_shp: name of zone in BA_map.shp :return: (*pandas.DataFrame*) puma_data_zone -- puma data of all pumas within zone, including fraction within zone """ shapefile = gpd.GeoDataFrame( gpd.read_...
72,292
def find_vendor(macs: str, neigh: list): """ This function searches for the NIC vendors in the IEEE DB """ # local vars clean_mac_db = [] # Creating MAC DB in Python dictionary format for entry in macs.splitlines(): if re.match("^[A-Z0-9]+\-", entry): tc = {} ...
72,293
def sort_descendants(): """Sort all descandant children alphabetically.""" selection = cmds.ls(selection=True) nodes = cmds.listRelatives( selection, allDescendents=True, type="transform" ) nodes = [x for x in nodes if not cmds.listRelatives(x, shapes=True)] nodes.extend(selection) ...
72,294
def touch_to_provisioned(): """ """ # FIXME: Empty, remove.
72,295
def build_image_features(network_fn, images): """Builds the CNN model and extract image features Args: network_fn : CNN network images: images Returns: net: extracted image features end_points: end points """ # Extract Image features from CNN networks features, e...
72,296
def sgd_level(bot, update): """ Get Latest FX """ text_bot = ['The markets may be bad, but i slept like baby, every hour i woke up and cry. :smiling_imp:', 'The one with the shortest queue is the best :scream:', 'If only everyone displays FX rates as clearly as me :smirk:', ...
72,297
def define_session(module_path=None, **kwargs): """Define a session object under ``module_path``.""" module_path = module_path or clients.__name__ module_labels = labels.make_labels(module_path, *SESSION_LABEL_NAMES) setup_session( module_labels, parameters.define( module_pat...
72,298
def test_call_step_with_args_and_kwargs( int_step_output, step_with_two_int_inputs ): """Test that a step can be called with a mix of args and kwargs.""" with does_not_raise(): step_with_two_int_inputs()(int_step_output, input_2=int_step_output)
72,299