content
stringlengths
22
815k
id
int64
0
4.91M
def grid_square_neighbors_1d_from(shape_slim): """ From a (y,x) grid of coordinates, determine the 8 neighors of every coordinate on the grid which has 8 neighboring (y,x) coordinates. Neighbor indexes use the 1D index of the pixel on the masked grid counting from the top-left right and down. ...
5,400
def get_total_entries(df, pdbid, cdr): """ Get the total number of entries of the particular CDR and PDBID in the database :param df: dataframe.DataFrame :rtype: int """ return len(get_all_entries(df, pdbid, cdr))
5,401
def _gf2mulxinvmod(a,m): """ Computes ``a * x^(-1) mod m``. *NOTE*: Does *not* check whether `a` is smaller in degree than `m`. Parameters ---------- a, m : integer Polynomial coefficient bit vectors. Polynomial `a` should be smaller degree than `m`. Returns ------- ...
5,402
def parse_Transpose(onnx_node, weights, graph): """ parse Transpose to Permute :param onnx_node: :param weights: :param graph: :return: """ onnx_node['visited'] = True onnx_node['ak_type'] = 'Permute' ak_attr = onnx_node['ak_attr'] data = onnx_node['onnx_attr']['perm'] ...
5,403
def find_cuda_family_config(repository_ctx, script_path, cuda_libraries): """Returns CUDA config dictionary from running find_cuda_config.py""" python_bin = repository_ctx.which("python3") exec_result = execute(repository_ctx, [python_bin, script_path] + cuda_libraries) if exec_result.return_code: ...
5,404
def _prediction_feature_weights(booster, dmatrix, n_targets, feature_names, xgb_feature_names): """ For each target, return score and numpy array with feature weights on this prediction, following an idea from http://blog.datadive.net/interpreting-random-forests/ """ ...
5,405
def group_by_repo(repository_full_name_column_name: str, repos: Sequence[Collection[str]], df: pd.DataFrame, ) -> List[np.ndarray]: """Group items by the value of their "repository_full_name" column.""" if df.empty: return [np.array([], dtype=int)] *...
5,406
def test_count_complete(opt, server_url): """Starts two worlds even though only one is requested by using the count_complete flag. """ global completed_threads print('{} Starting'.format(COUNT_COMPLETE_TEST)) opt['task'] = COUNT_COMPLETE_TEST opt['count_complete'] = True opt['num_convers...
5,407
def _row_or_col_is_header(s_count, v_count): """ Utility function for subdivide Heuristic for whether a row/col is a header or not. """ if s_count == 1 and v_count == 1: return False else: return (s_count + 1) / (v_count + s_count + 1) >= 2. / 3.
5,408
def remove_tau(aut): """ Modify automaton in-place, removing the 'tau' event. Will fail if there is more than one otgoing 'tau' event. @param aut: Existing automaton. @type aut: L{BaseAutomaton} """ coll = aut.collection tau_event = coll.events['tau'] # Count edges from initial st...
5,409
def test_can_change_vport_attributes(vports): """ vport attributes can be changed from client :given: session: a couple of vports :when: perform vport attributes operation :then: should edit a vport """ vport_1,vport_2 = vports vport_1.TxMode = 'sequential' vport_1.TransmitI...
5,410
def remove_deb_packages(packages): """Remove debian packages listed in space-separated string""" print ' ---- Remove debian packages ---- \n', packages, '\n' sudo('apt-get -y remove %s' % (packages))
5,411
def values_hash(array, step=0): """ Return consistent hash of array values :param array array: (n,) array with or without structure :param uint64 step: optional step number to modify hash values :returns: (n,) uint64 array """ cls, cast_dtype, view_dtype = _get_optimal_cast(array) array ...
5,412
async def get_molecule_image(optimization_id: str): """Render the molecule associated with a particular bespoke optimization to an SVG file.""" task = _get_task(optimization_id=optimization_id) svg_content = smiles_to_image(urllib.parse.unquote(task.input_schema.smiles)) svg_response = Response(sv...
5,413
def total_variation_divergence(logits, targets, reduction='mean'): """ Loss. :param logits: predicted logits :type logits: torch.autograd.Variable :param targets: target distributions :type targets: torch.autograd.Variable :param reduction: reduction type :type reduction: str :retur...
5,414
def initialize_parameters(n_in, n_out, ini_type='plain'): """ Helper function to initialize some form of random weights and Zero biases Args: n_in: size of input layer n_out: size of output/number of neurons ini_type: set initialization type for weights Returns: ...
5,415
def logcdf(samples, data, prior_bounds, weights=None, direction=DEFAULT_CUMULATIVE_INTEGRAL_DIRECTION, num_proc=DEFAULT_NUM_PROC): """estimates the log(cdf) at all points in samples based on data and integration in "direction". Does this directly by estimating the CDF from the weighted samples WITHOUT building ...
5,416
def gen_build_rules(generator): """ Generate yocto build rules for ninja """ # Create build dir by calling poky/oe-init-build-env script cmd = " && ".join([ "cd $yocto_dir", "source poky/oe-init-build-env $work_dir", ]) generator.rule("yocto_init_env", comm...
5,417
def post_gist(description, files): """Post a gist of the analysis""" username, password = get_auth() sess = requests.Session() sess.auth = (username, password) params = { 'description': description, 'files': files, 'public': False, } headers = { 'Content-Typ...
5,418
def dlna_handle_notify_last_change(state_var): """ Handle changes to LastChange state variable. This expands all changed state variables in the LastChange state variable. Note that the callback is called twice: - for the original event; - for the expanded event, via this function. """ i...
5,419
def compute_exposure_params(reference, tone_mapper="aces", t_max=0.85, t_min=0.85): """ Computes start and stop exposure for HDR-FLIP based on given tone mapper and reference image. Refer to the Visualizing Errors in Rendered High Dynamic Range Images paper for details about the formulas :param reference: float t...
5,420
def gen_filenames(only_new=False): """Returns a list of filenames referenced in sys.modules and translation files. """ global _cached_modules, _cached_filenames module_values = set(module_white_list()) if _cached_modules == module_values: # No changes in module list, short-circuit the fu...
5,421
def scores_generic_graph( num_vertices: int, edges: NpArrayEdges, weights: NpArrayEdgesFloat, cond: Literal["or", "both", "out", "in"] = "or", is_directed: bool = False, ) -> NpArrayEdgesFloat: """ Args: num_vertices: int number ofvertices edges: np.array ...
5,422
def handle_storage_class(vol): """ vol: dict (send from the frontend) If the fronend sent the special values `{none}` or `{empty}` then the backend will need to set the corresponding storage_class value that the python client expects. """ if "class" not in vol: return None if vo...
5,423
def spherical_to_cartesian(radius, theta, phi): """ Convert from spherical coordinates to cartesian. Parameters ------- radius: float radial coordinate theta: float axial coordinate phi: float azimuthal coordinate Returns ------- list: cartesian vector "...
5,424
def compute_mrcnn_bbox_loss(mrcnn_target_deltas, mrcnn_pred_deltas, target_class_ids): """ :param mrcnn_target_deltas: (n_sampled_rois, (dy, dx, (dz), log(dh), log(dw), (log(dh))) :param mrcnn_pred_deltas: (n_sampled_rois, n_classes, (dy, dx, (dz), log(dh), log(dw), (log(dh))) :param target_class_ids: (...
5,425
def _sharpness(prediction): """TODO: Implement for discrete inputs as entropy.""" _, chol_std = prediction scale = torch.diagonal(chol_std, dim1=-1, dim2=-2) return scale.square().mean()
5,426
def db_get_property_info(cls, prop: str): """ :param cls: :param prop: :return: """ objects_str = [getattr(obj, prop) for obj in cls.query.all()] print("NUMBER OF OBJECTS: %s" % len(objects_str)) maxi = max(objects_str, key=len) print("MAX LENGTH: %s (for '%s')" % (len(maxi), maxi)) ...
5,427
def dummy_sgs(dummies, sym, n): """ Return the strong generators for dummy indices Parameters ========== dummies : list of dummy indices `dummies[2k], dummies[2k+1]` are paired indices sym : symmetry under interchange of contracted dummies:: * None no symmetry * 0 ...
5,428
def _save_student_model(net, model_prefix): """ save student model if the net is the network contains student """ student_model_prefix = model_prefix + "_student.pdparams" if hasattr(net, "_layers"): net = net._layers if hasattr(net, "student"): paddle.save(net.student.state_dict...
5,429
def mc_tracing(func): """ This decorator is used below and logs certain statistics about the formula evaluation. It measures execution time, and how many nodes are found that statisfy each subformula. """ @wraps(func) def wrapper(*args): formula = args[1] start = time.time() ...
5,430
def test_vt100_cursor_movements(text: Text, expected: list[Instruction[Attribute]]): """Ensure the classical VT100 cursor movements are supported.""" assert _instr(text) == expected
5,431
def game(): """ Five-guess algorithm steps are directly from the Mastermind wikipedia page: https://en.wikipedia.org/wiki/Mastermind_(board_game)#Five-guess_algorithm """ # 1. Create the set S of 1296 possible codes # (1111, 1112 ... 6665, 6666) possible_codes = init_possible_codes.copy() ...
5,432
def test_list_decimal_length_1_nistxml_sv_iv_list_decimal_length_2_2(mode, save_output, output_format): """ Type list/decimal is restricted by facet length with value 6. """ assert_bindings( schema="nistData/list/decimal/Schema+Instance/NISTSchema-SV-IV-list-decimal-length-2.xsd", instan...
5,433
def test_intersection_with_stability_selection_one_threshold(): """Tests whether intersection correctly performs a soft intersection.""" coefs = np.array([ [[2, 1, -1, 0, 4], [4, 0, 2, -1, 5], [1, 2, 3, 4, 5]], [[2, 0, 0, 0, 0], [3, 1, 1, 0, 3], [6, 7, 8, 9, ...
5,434
def medview_imaging_interface_demo(): """ Demo interface used to demo the program Can be used to access the MedView user enroller system and the login system """ while True: print('-----------------------------------------------------') print('MedView Imaging System Demo') ...
5,435
def get_uniform_comparator(comparator): """ convert comparator alias to uniform name """ if comparator in ["eq", "equals", "==", "is"]: return "equals" elif comparator in ["lt", "less_than"]: return "less_than" elif comparator in ["le", "less_than_or_equals"]: return "less_th...
5,436
def project_list(config, server): """プロジェクト一覧を表示する""" server_, entity_bucket = build_entity_bucket(config, server) repos_factory = build_repository_factory(server_) command.project_list( project_repository=repos_factory.create_project_repository() )
5,437
def test_conll2000_dataset_get_datasetsize(): """ Feature: CoNLL2000ChunkingDataset. Description: test param check of CoNLL2000ChunkingDataset. Expectation: throw correct error and message. """ data = ds.CoNLL2000Dataset(DATA_DIR, usage="test", shuffle=False) size = data.get_dataset_size() ...
5,438
def inorder_traversal(root): """Function to traverse a binary tree inorder Args: root (Node): The root of a binary tree Returns: (list): List containing all the values of the tree from an inorder search """ res = [] if root: res = inorder_traversal(root.left) re...
5,439
def unlock(): """Releases a lock file. Raises: OSError: If lock file cannot be released. """ if os.path.isfile(LOCK_FILE): os.remove(LOCK_FILE) Log.info("Removed temporary lock")
5,440
def test_search_print_results_should_contain_latest_versions(caplog): """ Test that printed search results contain the latest package versions """ hits = [ { 'name': 'testlib1', 'summary': 'Test library 1.', 'versions': ['1.0.5', '1.0.3'] }, { ...
5,441
def get_extractor_metadata(clowder_md, extractor_name, extractor_version=None): """Crawl Clowder metadata object for particular extractor metadata and return if found. If extractor_version specified, returned metadata must match.""" for sub_metadata in clowder_md: if 'agent' in sub_metadata: ...
5,442
def intensity_scale(X_f, X_o, name, thrs, scales=None, wavelet="Haar"): """ Compute an intensity-scale verification score. Parameters ---------- X_f: array_like Array of shape (m, n) containing the forecast field. X_o: array_like Array of shape (m, n) containing the verification...
5,443
def make_count(bits, default_count=50): """ Return items count from URL bits if last bit is positive integer. >>> make_count(['Emacs']) 50 >>> make_count(['20']) 20 >>> make_count(['бред', '15']) 15 """ count = default_count if len(bits) > 0: last_bit = bits[len(...
5,444
def synthesize_ntf_minmax(order=32, osr=32, H_inf=1.5, f0=0, zf=False, **options): """ Alias of :func:`ntf_fir_minmax` .. deprecated:: 0.11.0 Function is now available from the :mod:`NTFdesign` module with name :func:`ntf_fir_minmax` """ warn("Function supers...
5,445
def r2f(value): """ converts temperature in R(degrees Rankine) to F(degrees Fahrenheit) :param value: temperature in R(degrees Rankine) :return: temperature in F(degrees Fahrenheit) """ return const.convert_temperature(value, 'R', 'F')
5,446
def test_load_translations_files(hass): """Test the load translation files function.""" # Test one valid and one invalid file file1 = hass.config.path( 'custom_components', 'switch', '.translations', 'test.en.json') file2 = hass.config.path( 'custom_components', 'switch', '.translations'...
5,447
def summary( infile, outfile, max_taxa_per_query, taxdump, chunksize=100000, threads=1): """ Parses merged output from binning process into a csv with rows that have more than max_taxa_per_query hits removed. Returns a list of unique taxa that are present in the remaining rows. """ loggi...
5,448
def get_currently_playing_track(): """Returns currently playing track as a file No request params. """ try: pt, _, _ = Track.get_currently_playing() path = pt.track.path return send_file( os.path.join( '..', path ) ) except DoesNotExist: return error_response( 'Nije ...
5,449
def run(env_id, seed, noise_type, layer_norm, evaluation, **kwargs): """ run the training of DDPG :param env_id: (str) the environment ID :param seed: (int) the initial random seed :param noise_type: (str) the wanted noises ('adaptive-param', 'normal' or 'ou'), can use multiple noise type by ...
5,450
def get_statistics_percentiles(d_min, stats): """ For a given set of statistics, determine their percentile ranking compared to other crystal structures at similar resolution. """ if (d_min is None): return dict([ (s, None) for s in stats.keys() ]) try : db = load_db() except Exception as e : ...
5,451
def normalize_number(value: str, number_format: str) -> str: """ Transform a string that essentially represents a number to the corresponding number with the given number format. Return a string that includes the transformed number. If the given number format does not match any supported one, return the gi...
5,452
def execute_command(command): """Execute the sequence of key presses.""" for key in command: keyboard.press(key) keyboard.release_all()
5,453
def get_returning_users(returning_count): """ Returns a list of returning users :return: """ # Read the exclusion file if os.path.exists(stats_dir + 'exclusion.lst'): exclusion_file = open(stats_dir + 'exclusion.lst', 'r') exclusion_list = exclusion_file.readlines() exclu...
5,454
def benchmark(Algorithm_, Network_, test): """ Benchmarks the Algorithm on a given class of Networks. Samples variable network size, and plots results. @param Algorithm_: a subclass of Synchronous_Algorithm, the algorithm to test. @param Network_: a subclass of Network, the network on which to benchmar...
5,455
def add_ip_to_host(port=8000): """ Returns None Args: port which handles the request Add local IPv4 and public IP addresses to ALLOWED_HOST """ IP_PRIVATE = getoutput('hostname -I').strip() try: IP_PUBLIC = urllib.request.urlopen( 'https://ident.me').rea...
5,456
def scale(obj, scale_ratio): """ :param obj: trimesh or file path :param scale_ratio: float, scale all axis equally :return: author: weiwei date: 20201116 """ if isinstance(obj, trm.Trimesh): tmpmesh = obj.copy() tmpmesh.apply_scale(scale_ratio) return tmpmesh ...
5,457
def _case_verify_and_canonicalize_args(pred_fn_pairs, exclusive, name, allow_python_preds): """Verifies input arguments for the case function. Args: pred_fn_pairs: Dict or list of pairs of a boolean scalar tensor, and a callable which returns a list of tensors. ...
5,458
def get_policy(policy_name: str) -> Policy: """Returns a mixed precision policy parsed from a string.""" # Loose grammar supporting: # - "c=f16" (params full, compute+output in f16), # - "p=f16,c=f16" (params, compute and output in f16). # - "p=f16,c=bf16" (params in f16, compute in bf16, output...
5,459
def reset(): """Reset password page. User launch this page via the link in the find password email.""" if g.user: return redirect('/') token = request.values.get('token') if not token: flash(_('Token is missing.'), 'error') return redirect('/') user = verify_auth_token(to...
5,460
def usort_file(path: Path, dry_run: bool = False, diff: bool = False) -> Result: """ Sorts one file, optionally writing the result back. Returns: a Result object. Note: Not intended to be run concurrently, as the timings are stored in a global. """ result = Result(path) result.timings ...
5,461
def datetimeobj_a__d_b_Y_H_M_S_z(value): """Convert timestamp string to a datetime object. Timestamps strings like 'Tue, 18 Jun 2013 22:00:00 +1000' are able to be converted by this function. Args: value: A timestamp string in the format '%a, %d %b %Y %H:%M:%S %z'. Returns: A date...
5,462
def fn_sigmoid_proxy_func(threshold, preds, labels, temperature=1.): """Approximation of False rejection rate using Sigmoid.""" return tf.reduce_sum( tf.multiply(tf.sigmoid(-1. * temperature * (preds - threshold)), labels))
5,463
def remove_disks_in_vm_provisioning(session, vm_ref): """Re-write the xml for provisioning disks to set a SR""" other_config = session.xenapi.VM.get_other_config(vm_ref) del other_config['disks'] session.xenapi.VM.set_other_config(vm_ref, other_config)
5,464
def get_images(filters: Optional[Sequence[pulumi.InputType['GetImagesFilterArgs']]] = None, sorts: Optional[Sequence[pulumi.InputType['GetImagesSortArgs']]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetImagesResult: """ Get information on images for use in ot...
5,465
def polevl(x, coef): """Taken from http://numba.pydata.org/numba-doc/0.12.2/examples.html""" N = len(coef) ans = coef[0] i = 1 while i < N: ans = ans * x + coef[i] i += 1 return ans
5,466
def is_regular_file(path): """Check whether 'path' is a regular file, especially not a symlink.""" return os.path.isfile(path) and not os.path.islink(path)
5,467
def door(): """this creates the door""" dave = turtle.Turtle() dave.penup() dave.forward(250) # this is setting the position at the bottom of square dave.right(90) dave.forward(250) dave.right(90) dave.forward(80) dave.pendown() dave.pencolor("purple") dave.right(90) da...
5,468
def plot_displacement(A, B, save=False, labels=None): """ A and B are both num_samples x num_dimensions for now, num_dimensions must = 2 """ assert A.shape == B.shape assert A.shape[1] == 2 if not labels is None: assert len(labels) == A.shape[0] delta = B - A delta_dir = delt...
5,469
def flip(): """ flip() -> None Update the full display Surface to the screen """ check_video() screen = sdl.SDL_GetVideoSurface() if not screen: raise SDLError("Display mode not set") if screen.flags & sdl.SDL_OPENGL: sdl.SDL_GL_SwapBuffers() status = 0 ...
5,470
def t_dp(tdb, rh): """ Calculates the dew point temperature. Parameters ---------- tdb: float dry-bulb air temperature, [°C] rh: float relative humidity, [%] Returns ------- t_dp: float dew point temperature, [°C] """ c = 257.14 b = 18.678 a = 6...
5,471
def extract_archive(filepath): """ Returns the path of the archive :param str filepath: Path to file to extract or read :return: path of the archive :rtype: str """ # Checks if file path is a directory if os.path.isdir(filepath): path = os.path.abspath(filepath) print...
5,472
def LinkConfig(reset=0, loopback=0, scrambling=1): """Link Configuration of TS1/TS2 Ordered Sets.""" value = ( reset << 0) value |= ( loopback << 2) value |= ((not scrambling) << 3) return value
5,473
def test_tedlium_release(): """ Feature: TedliumDataset Description: test release of tedlium Expectation: release set invalid data get throw error """ def test_config(release): try: ds.TedliumDataset(DATA_DIR_TEDLIUM_RELEASE12, ...
5,474
def test_serialize_bulk_courses(mocker): """ Test that serialize_bulk_courses calls serialize_course_for_bulk for every existing course """ mock_serialize_course = mocker.patch("search.serializers.serialize_course_for_bulk") courses = CourseFactory.create_batch(5) list(serialize_bulk_courses([co...
5,475
def get_data(n, input_dim, y_dim, attention_column=1): """ Data generation. x is purely random except that it's first value equals the target y. In practice, the network should learn that the target = x[attention_column]. Therefore, most of its attention should be focused on the value addressed by atten...
5,476
def generate_tautomer_hydrogen_definitions(hydrogens, residue_name, isomer_index): """ Creates a hxml file that is used to add hydrogens for a specific tautomer to the heavy-atom skeleton Parameters ---------- hydrogens: list of tuple Tuple contains two atom names: (hydrogen-atom-name, he...
5,477
def test_single_key_lookup_feature_to_config(): """Single key lookup feature config generation should work""" user_key = TypedKey(full_name="mockdata.user", key_column="user_id", key_column_type=ValueType.INT32, description="An user identifier") item_key = TypedKey(full_name="mockdata.item", key_column="ite...
5,478
def waitid(*args, **kwargs): # real signature unknown """ Returns the result of waiting for a process or processes. idtype Must be one of be P_PID, P_PGID or P_ALL. id The id to wait on. options Constructed from the ORing of one or more of WEXITED, WSTOPPED ...
5,479
def login(client=None, **defaults): """ @param host: @param port: @param identityName: @param password: @param serviceName: @param perspectiveName: @returntype: Deferred RemoteReference of Perspective """ d = defer.Deferred() LoginDialog(client, d, defaults) ...
5,480
def insertInstrument(): """ Insert a new instrument or edit an existing instrument on a DAQBroker database. Guest users are not allowed to create instruments. Created instruments are .. :quickref: Create/Edit instrument; Creates or edits a DAQBroker instrument instrument :param: Name : (String) unique...
5,481
def find_distance_to_major_settlement(country, major_settlements, settlement): """ Finds the distance to the nearest major settlement. """ nearest = nearest_points(settlement['geometry'], major_settlements.unary_union)[1] geom = LineString([ ( settlement['geomet...
5,482
def x_for_half_max_y(xs, ys): """Return the x value for which the corresponding y value is half of the maximum y value. If there is no exact corresponding x value, one is calculated by linear interpolation from the two surrounding values. :param xs: x values :param ys: y values corresponding to...
5,483
def get_dict_from_dotenv_file(filename: Union[Path, str]) -> Dict[str, str]: """ :param filename: .env file where values are extracted. :return: a dict with keys and values extracted from the .env file. """ result_dict = {} error_message = 'file {filename}: the line n°{index} is not correct: "{...
5,484
def calculate_note_numbers(note_list, key_override = None): """ Takes in a list of notes, and replaces the key signature (second element of each note tuple) with the note's jianpu number. Parameters ---------- note_list : list of tuples List of notes to calculate jianpu numbers for....
5,485
def _from_Gryzinski(DATA): """ This function computes the cross section and energy values from the files that store information following the Gryzinski Model """ import numpy as np a_0 = DATA['a_0']['VALUES'] epsilon_i_H = DATA['epsilon_i_H']['VALUES'] epsilon_i = DA...
5,486
def export_tfjs(keras_or_saved_model, output_dir, **kwargs): """Exports saved model to tfjs. https://www.tensorflow.org/js/guide/conversion?hl=en Args: keras_or_saved_model: Keras or saved model. output_dir: Output TF.js model dir. **kwargs: Other options. """ # For Keras model, creates a saved ...
5,487
def stations_within_radius(stations, centre, r): """Returns an alphabetically-ordered list of the names of all the stations (in a list of stations objects) within a radius r (in km) of a central point (which must be a Lat/Long coordinate)""" from haversine import haversine, Unit # creates empty l...
5,488
def read_data_with_plugins( path: Union[str, Sequence[str]], plugin: Optional[str] = None, plugin_manager: PluginManager = napari_plugin_manager, ) -> List[LayerData]: """Iterate reader hooks and return first non-None LayerData or None. This function returns as soon as the path has been read succes...
5,489
def reset_task_size(nbytes: int) -> None: """Reset the default task size used for parallel IO operations. Parameters ---------- nbytes : int The number of threads to use. """ libkvikio.task_size_reset(nbytes)
5,490
def ticket_message_url(request, structure_slug, ticket_id): # pragma: no cover """ Makes URL redirect to add ticket message by user role :type structure_slug: String :type ticket_id: String :param structure_slug: structure slug :param ticket_id: ticket code :return: redirect """ s...
5,491
def load( fin: Path, azelfn: Path = None, treq: list[datetime] = None, wavelenreq: list[str] = None, wavelength_altitude_km: dict[str, float] = None, ) -> dict[str, T.Any]: """ reads FITS images and spatial az/el calibration for allsky camera Bdecl is in degrees, from IGRF model """ ...
5,492
def loadData(data_source, loc, run, indexes, ntry=0, __text__=None, __prog__=None): """ Loads the data from a remote source. Has hooks for progress bars. """ if __text__ is not None: __text__.emit("Decoding File") if data_source.getName() == "Local WRF-ARW": url = data_source.getURL...
5,493
def get_access_policy_output(access_policy_id: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetAccessPolicyResult]: """ Returns an access policy based on the name. """ ...
5,494
def comp_psip_skin(self, u): """psip_skin for skin effect computation Parameters ---------- self : Conductor An Conductor object Returns ------- None """ y = (1 / u) * (sinh(u) + sin(u)) / (cosh(u) + cos(u)) # p257 Pyrhonen # y[u==0]=1 return y
5,495
def save_wav_file(filename, wav_data, sess, sample_rate=16000): """Saves audio sample data to a .wav audio file. Args: filename: Path to save the file to. wav_data: 2D array of float PCM-encoded audio data. sample_rate: Samples per second to encode in the file. """ with tf.compat.v1.Session(graph=t...
5,496
def homepage(var=random.randint(0, 1000)): """ The function returns the homepage html template. """ return render_template("index.html", var=var)
5,497
def tier(value): """ A special function of ordinals which does not correspond to any mathematically useful function. Maps ordinals to small objects, effectively compressing the range. Used to speed up comparisons when the operands are very different sizes. In the current version, this is a ma...
5,498
def get_next_value( sequence_name="default", initial_value=1, reset_value=None, *, nowait=False, using=None, overrite=None, ): """ Return the next value for a given sequence. """ # Inner import because models cannot be imported before their application. from .models impo...
5,499