content
stringlengths
22
815k
id
int64
0
4.91M
def _SaveCachedDataWithName(data, name): """Saves `data` to a named cache file. Cache files are saved as hidden YAML files in the gcloud config directory. Args: data: The data to cache. name: The name of the cache file. """ config_dir = config.Paths().global_config_dir cache_path = os.path.join(co...
5,300,800
def test_inpxml_non_valid_inpxml(inpxmlfilepath): """ test if valid inp.xml files are recognized by the inpxml_parser """ #Pass Path with pytest.raises((ValueError, FileNotFoundError)): inp_dict = inpxml_parser(inpxmlfilepath)
5,300,801
def image_code(): """ 图片验证码的实现逻辑 1. 获取参数 图片验证码的随机值 ! 切记! 一定要判断 2. 生成图片验证码 3. 将图片文字和随机值保存到redis中 4. 将图片验证码 返回 :return: """ image_code_id = request.args.get("imageCodeId", None) # 判断参数是否有值 if not image_code_id: abort(403) # 生成图片验证码 name, text, image = capt...
5,300,802
def clone_renku_repository( url: str, path: Union[Path, str], gitlab_token=None, deployment_hostname=None, depth: Optional[int] = None, install_githooks=False, install_lfs=True, skip_smudge=True, recursive=True, progress=None, config: Optional[dict] = None, raise_git_exce...
5,300,803
def debug_log(*args): """ Log only if debugging is enabled Explicitly does not use the regular Mephisto logging framework as we may want to deploy this on a server that doesn't have Mephisto installed, and we can keep package size low this way. """ if DEBUG: print(*args)
5,300,804
def _log_error(entity: str, exception: Exception, trace: str, extractor: DSSExtractor): """ Logs an ETL error and exception stack trace to a file. Error messages and exceptions are written to 'errors.txt' A list of failed entities are written to 'failed_transforms.txt' :param entity: A MetadataToPsv...
5,300,805
def traintest_split(data_dir='.', in_extension='.obfs', save_dir=None, save=True, trainfile='train', testfile='target', recurse=0, testsize=0.1): """ Implements the sklearn train_test_split function in a recursive fashion """ walk = os.wal...
5,300,806
def display_content(value): """This callback is used on the User Guide page and returns the selected User Guide when a user selects a certain tab. User Guides can be added to HIVE in the userguide.py page. """ return userguide.user_guide(value)
5,300,807
def test_nernst_potential(): """ Test cases obtained from textbook examples of Nernst potential in cellular membranes. 310K = 37C, typical mammalian cell environment temperature. """ # Sodium in cells assert abs(1000 * nernst_potential(145, 15, 1, 310) - 60.605) < 1e-4 # Potassium in cells ...
5,300,808
def adjust_anomaly_scores(scores, dataset, is_train, lookback): """ Method for MSL and SMAP where channels have been concatenated as part of the preprocessing :param scores: anomaly_scores :param dataset: name of dataset :param is_train: if scores is from train set :param lookback: lookbac...
5,300,809
def sf(k, nc, ntotal, ngood, nsample): """ Survival function of Fisher's noncentral hypergeometric distribution. """ _hg._validate(ntotal, ngood, nsample) sup, p = support(nc, ntotal, ngood, nsample) if k < sup[0]: return mpmath.mp.one elif k >= sup[-1]: return mpmath.mp.zero...
5,300,810
def part_2_solution(graph, search_key): """ keeps a persistant counter that is recursively passed into a helper function for ever depth of the helper function, the branch product gets updated, when a recursive function exits it updates the counter with the product of counts for each sub-bag the co...
5,300,811
def PClone (inUV, outUV, err): """ Make a copy of a object but do not copy the actual data This is useful to create an UV similar to the input one. inUV = Python UV object outUV = Output Python UV object, must be defined err = Python Obit Error/message stack """ ######################...
5,300,812
def example3(): """Demonstrates exception handling, peek, reduce. """ def square_and_raise_on_3(x): if x == 3: raise ValueError('unaccepted value') return x ** 2 result = (Pipes(_EXAMPLE_COLLECTION) .lz_map(lambda x: x['size']) .lz_peek(lambda x:...
5,300,813
def config_set_registry(registry: str): """Set the container registry""" conf["registry"] = registry with open(configfile_path, "w", encoding="utf-8") as new_configfile: json.dump(conf, new_configfile, indent=4)
5,300,814
def get_func_qty(*args): """get_func_qty() -> size_t""" return _idaapi.get_func_qty(*args)
5,300,815
def is_model_quantized(sym_model): """Checks whether the model is quantized. Args: sym_model (tuple): symbol model (symnet, args, auxs). Returns: boolean: True if model is quantized, else False. """ assert isinstance(sym_model, tuple) and isinstance(sym_model[0], mx....
5,300,816
def evaluate(bounds, func): """ Evaluates simpsons rules on an array of values and a function pointer. .. math:: \int_{a}^{b} = \sum_i ... Parameters ---------- bounds: array_like An array with a dimension of two that contains the starting and ending points for the int...
5,300,817
def process_image(image, target_shape): # downsampling to desired shape """Given an image, process it (downsample if needed) and return a numpy array.""" h, w, c = target_shape image = load_img(image, target_size=(h, w)) # Load the image. Downsampling included! e.g. to (32,32,3) img_arr = img_to_array(...
5,300,818
def get_dataset_id(settings): """ Creates and returns an unique ID (for practical purposes), given the data parameters. The main use of this ID is to make sure we are using the correct data source, and that the data parameters weren't changed halfway through the simulation sequence. """ hashing_feat...
5,300,819
def get_sampler_diags(fit): """Returns useful sampler diagnostics for a particular MCMC fit with pystan""" rhat=fit.summary()['summary'][:,-1] rhat_worst=rhat[np.abs(1-rhat)==max(np.abs(1-rhat))][0] n_eff_int_site=int(fit.summary()['summary'][0,-2]) return rhat_worst,n_eff_int_site
5,300,820
def get_category(url=None, category='nieruchomosci', transaction_type='wszystkie', voivodeship=None, city=None, street=None, filters=None): """ Parses available offer urls from given category search page :param url: Url to search web page :param category: Type of property of interest (Mies...
5,300,821
def wmt_preprocess(dataset, training, max_length=-1, max_eval_length=-1): """Preprocessing for LM1B: filter out targets exceeding maximum length.""" def train_right_length(example, target): l = tf.maximum(tf.shape(example["inputs"])[0], tf.shape(target)[0]) return tf.less(l, max_length + 1) def eval_rig...
5,300,822
def instance_masks_to_semseg_mask(instance_masks, category_labels): """ Converts a tensor containing instance masks to a semantic segmentation mask. :param instance_masks: tensor(N, T, H, W) (N = number of instances) :param category_labels: tensor(N) containing semantic category label for each instance...
5,300,823
def URem(a, b): """Create the SMT expression (unsigned) remainder `self % other`. Use the operator % for signed modulus, and SRem() for signed remainder. >>> x = BitVec('x', 32) >>> y = BitVec('y', 32) >>> URem(x, y) URem(x, y) >>> URem(x, y).sort() BitVec(32) >>> (x % y).sexpr() ...
5,300,824
def _SetStronglyConnected(*nodes): """Set a STRONGLY_CONNECTED penalty annotation for the given nodes.""" for node in nodes: _RecAnnotate(node, pytree_utils.Annotation.SPLIT_PENALTY, STRONGLY_CONNECTED)
5,300,825
def calc_col_stats(df: pd.DataFrame) -> Iterable[tuple[str, dict]]: """Calculate column infos. Args: df (pd.DataFrame): Data. Yields: str: Column name. dict: Column info. """ for col in df.columns: col_info = {} s = df[col] col_info['dtype'] = str(s....
5,300,826
def _make_request(endpoint: str) -> dict: """Helper method handles terra fcd api requests. [Source: https://fcd.terra.dev/v1] Parameters ---------- endpoint: str endpoint url Returns ------- dict: dictionary with response data """ url = f"https://fcd.terra.dev/v1/{e...
5,300,827
def fix_end_now(json): """Set end time to the time now if no end time is give""" if 'end' not in json or json['end'] is None: json['end'] = int(time.time()) return json
5,300,828
def load_and_concate(rfiles): """ Loads and concatenates radiomic features from different MR contrasts Args: rfiles (list): list of radiomic files (one for each scan) Returns: pandas dataframe: radiomic features """ animal_id = [] for i, file in enumerate(rfiles): ...
5,300,829
def p_op_as(p): """ op_as : ADD | SUB """ p[0] = p[1]
5,300,830
def file_to_bounding_boxes(file_path, output_folder=None, save_images=False, **kwargs): """ file_path: path to image file. """ # read image using PIL: image = Image.open(file_path) # convert to numpy array: image_numpy = np.asarray(image) # Predict bounding boxes and store to dictionar...
5,300,831
def count_parameters(net, trainable=False): """Counts the parameters of a given PyTorch model.""" params = trainable_parameters(net) if trainable else net.parameters() return sum(p.numel() for p in params)
5,300,832
def assert_link(d, source_pointer="/"): """ Verifies that *d* is a valid JSON API link, raising BadRequest if it is not. :seealso: http://jsonapi.org/format/#document-links :param d: :param str source_pointer: :raises BadRequest: """ if isinstance(d, str): pass elif is...
5,300,833
def prepare_computational_basis(nqubits, number): """Encode number as binary and create the circuit""" # Create empty circuit of requested size qc = QuantumCircuit(nqubits) # encode number into a byte array ba = int2ba(number, nqubits); # Populate the circuit for q in range(nqubi...
5,300,834
def write_fft(fft_features, fn): """ Write the FFT features to separate files to speed up processing. """ base_fn, ext = os.path.splitext(fn) data_fn = base_fn + ".fft" np.save(data_fn, fft_features) print("Written "%data_fn)
5,300,835
def generate_filetree_root(model, rootdir, empty_rootdir=False): """ Create (or recreate) the lowest directory of a filetree within a model. Parameters: ----------- model : Model() The MMVT Model to generate an entire filetree for rootdir : str A string path to the...
5,300,836
def filter_allowed_extensions(extensions, allowed_extensions=None): """Ensure only accepted extensions are used.""" allowed_extensions = allowed_extensions or [] for ext in extensions: ext_name = x509.oid._OID_NAMES.get(ext.oid, None) if ext_name in allowed_extensions: yield ext...
5,300,837
async def test_set_get_seat_heat_level(monkeypatch): """Test HeatedSeatSelect().""" _mock = TeslaMock(monkeypatch) _controller = Controller(None) _controller.set_id_vin(CAR_ID, VIN) _controller.set_last_update_time(vin=VIN, timestamp=LAST_UPDATE_TIME) orig_level = 1 new_level = 2 _dat...
5,300,838
def update_metadata(fid, metadata, pol_list, frequency='A'): """ Update radar metadata. This function mainly interfaces with the science/LSAR/SLC/swaths group to set the right scalar parameters. """ # Open the correct frequency swath group group = fid['science/LSAR/SLC/swaths/frequency' + freque...
5,300,839
def example_ten(): """ bisect_left - provides binary search through a sequence of sorted items - returns an index, the insertion point of the value in the seq - binary search is is O(log(n)) logarithmic, using bisect to search a list of 1M takes roughly the same amount of time ...
5,300,840
def dropout(x, rate, is_training): """drop out layer""" return tf.layers.dropout(x, rate, name='dropout', training = is_training)
5,300,841
def get_cell_inj_span(test_line): """ Return the location of %cell in the given line as (start_index, end_index), or None if %cell does not occur. """ if not test_line.strip().startswith(CELL_INJ_TOKEN): return None else: cell_start = test_line.index(CELL_INJ_TOKEN) cell_...
5,300,842
def in1u_w(name, shape, seed=None, regu=None): """ Convolutional Architecture for Fast Feature Embedding. FAN_IN, factor=1.0, uniform=True. """ init = tf.contrib.layers.variance_scaling_initializer( factor=1.0, mode="FAN_IN", uniform=True, seed=seed) return w(name, shape, tf.float32,...
5,300,843
def test_object_ref_params(): """Test use of object byref parameters.""" result = MethodTest.TestObjectRefParams("hi", MethodTest()) assert isinstance(result, tuple) assert len(result) == 2 assert result[0] is True assert isinstance(result[1], System.Exception) result = MethodTest.TestObjec...
5,300,844
def topics_to_calldata(topics, bytes_per_topic=3): """Converts a list of topics to calldata. Args: topics (bytes[]): List of topics. bytes_per_topic (int): Byte length of each topic. Returns: bytes: Topics combined into a single string. """ return b''.join(topic.to_bytes(b...
5,300,845
def __save_response_content(response: requests.Response, destination: Path): """save the content of the request as file Arguments: response {requests.Response} -- the response to download destination {Path} -- the destination path """ chunk_size = 32768 num_elems = math.ceil(2564838...
5,300,846
def read_size(calibxml): """ This function extracts the size of an image from the xml file. .. note:: Usually, it is similar to "AutoCal_[Focal]_[CameraName].xml" Parameters ---------- calibxml : str Name of the camera calibration file Returns ------- np.ndarra...
5,300,847
def get_packages_names(latex_file): """Find all the package name in a file Args: latex_file: A pathlib file Returns: A list of all the package name found in the latex_file """ with latex_file.open('r', encoding='utf-8') as f: data = f.read() packages_info = re.findall...
5,300,848
def config(rijk_key): """ """ setConfig(rijk_key)
5,300,849
def remove_basic_block_assembly(pydot_cfg): """ Remove assembly text from the CFG's basic blocks """ # Avoid graph and edge nodes, which are the 1st and 2nd nodes nodes = pydot_cfg.get_nodes()[2:] for n in nodes: n.set_label("") return pydot_cfg
5,300,850
async def test_template_triggers(hass): """Test sensor with template triggers.""" hass.states.async_set("input_boolean.test", STATE_OFF) config = { "binary_sensor": { "name": "Test_Binary", "platform": "bayesian", "observations": [ { ...
5,300,851
def set_course_cohorted(course_key, cohorted): """ Given a course course and a boolean, sets whether or not the course is cohorted. Raises: Value error if `cohorted` is not a boolean """ if not isinstance(cohorted, bool): raise ValueError("Cohorted must be a boolean") course_coh...
5,300,852
def parseChatMessage(inXML: str): """ Function to parse BfChatMessage-xml. :param inXML: The xml to be processed. note:: Author(s): Mitch """ pass
5,300,853
def python(*args, **kwargs): """Run a python script with the current interpreter.""" return exec_getout(sys.executable, *args, **kwargs)
5,300,854
def CheckNaN(data): """ Raise exception if data contains NaN. Useful to stop training if network doesn't converge and loss function returns NaN. Example: samples >> network.train() >> CheckNan() >> log >> Consume() >>> from nutsflow import Collect >>> [1, 2, 3] >> CheckNaN() >> Collect() ...
5,300,855
def build_patch302_request(*, json: Any = None, content: Any = None, **kwargs: Any) -> HttpRequest: """Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. See https://aka.ms/azsdk/python/prot...
5,300,856
def construct_array(nums): """ :param nums: array :return: mul array """ l = len(nums) ans = [1 for _ in range(l)] p = q = 1 for i in range(l): ans[i] *= q ans[-i - 1] *= p q *= nums[i] p *= nums[-i - 1] return ans
5,300,857
def create_col(card: dbc.Card) -> dbc.Col: """Pass each card to create a Col element""" return dbc.Col( className="mb-2", children=[card], width=12, sm=12, lg=6, xl=4 )
5,300,858
def test_invalid_mode(device, mode): """ Test if the set_spi_config() function raises the correct exception when passing an invalid mode. """ with pytest.raises(ShdlcCommandParameterError): device.set_spi_config(SensorBridgePort.ONE, mode, 330e3)
5,300,859
def test_emr_container_sensors_trigger_serialization(): """ Asserts that the TaskStateTrigger correctly serializes its arguments and classpath. """ trigger = EmrContainerSensorTrigger( virtual_cluster_id=VIRTUAL_CLUSTER_ID, job_id=JOB_ID, max_retries=MAX_RETRIES, aws_...
5,300,860
def test_packed_scripts(err, xpi_package): """ Scripts must be tested separately from normal files to allow for markup files to mark scripts as being potentially polluting. """ # This test doesn't apply to subpackages. We keep references to the # subpackage bundles so we can process everything ...
5,300,861
def main(): """ Use pw_module_tests.testinfo.json files to find and copy fuzzers. """ parser = argparse.ArgumentParser() parser.add_argument('--buildroot') parser.add_argument('--out') args = parser.parse_args() print(' buildroot: ' + args.buildroot) print(' out: ' + args.out) testinfo = os.pat...
5,300,862
def pic_roc_cmp(title, file_path, dpi=600, palette=None, y_data=[]): """ this function use to plot roc comparation :param title: :param file_path: :param dpi: :param palette: :param y_data: :return: """ fig = plt.figure(figsize=(12, 6)) ax = fig.add_subplot(1, 1, 1) for l...
5,300,863
def make_report(subreads, output_dir, dpi=DEFAULT_DPI): """ Create a basic subread metrics report. Since this may be run either as an independent tool or as part of the barcoding report, it handles the .pbi file reading flexibly. """ pbi_stream = get_pb_index_streamed(subreads) dists, uniqu...
5,300,864
def return_point(m, n, p): """ m is the index number of the Hammersley point to calculate n is the maximun number of points p is the order of the Hammersley point, 1,2,3,4,... etc l is the power of x to go out to and is hard coded to 10 in this example :return type double """ if p == 1:...
5,300,865
def test_set_read_only_point(publish_agent, cancel_schedules): """ Test setting a value of a read only point through pubsub Format of expected result header: { 'requesterID': <Agent ID> } message: { 'type': <Error Type or name of the exception raised by the request> ...
5,300,866
def main(): """ This function will be called for training phase. """ # How to sample minerl data is document here: # http://minerl.io/docs/tutorials/data_sampling.html data = minerl.data.make(MINERL_GYM_ENV, data_dir=MINERL_DATA_ROOT) # Sample code for illustration, add your training code b...
5,300,867
def select2_css_url(): """ Return the full url to the Select2 CSS file. """ return get_select2_setting('css_url') or \ select2_url('css/select2.min.css')
5,300,868
def GetQuasiSequenceOrder(ProteinSequence, maxlag=30, weight=0.1): """ ############################################################################### Computing quasi-sequence-order descriptors for a given protein. [1]:Kuo-Chen Chou. Prediction of Protein Subcellar Locations by Incorporating Quasi...
5,300,869
def OverscanTrim(d,ds): """ Overscan correct and Trim a refurbished HIRES image """ ds = ds.split(',') dsy = ds[0][1:] dsx = ds[1][:-1] dsy = dsy.split(':') dsx = dsx.split(':') x0 = int(dsx[0])-1 x1 = int(dsx[1]) y0 = int(dsy[0])-1 y1 = int(dsy[1]) newdata = d[x0:x1]...
5,300,870
def main(): """ Entry point """ sum_factors = {i: sum(compute_factors(i)) for i in range(10000)} # Second pass: to check for amicability, we need to compute sum-factors for candidates over 10000 extra_factors = dict() for i, sf_i in sum_factors.items(): if sf_i >= 10000: ...
5,300,871
def requests_put(url, expected_sc=200, **kwargs): """ Calls our above requests wrapper for a PUT request, and sets the default expected status code to 200. """ return do_request_with_auth_retry(url=url, method=requests.put, expected_sc=expected_sc, **kwargs)
5,300,872
def calculate_decomposition(data, model=MODEL_ADDITIVE, frequency=2): """ Calculate time series decomposition Args: data (list[float]): Input time series values model (str): Seasonal component type frequency (int): Seasonal component frequency Returns: dict: Calculation...
5,300,873
def set_parallel(val): """ tells code to run execute tasks with dask in parallel whenever possible """ assert isinstance(val, bool) os.environ[ENV_PARALLEL] = str(val) assert get_parallel() == val
5,300,874
def add_funders_relationships(funders: List, funders_by_key: Dict) -> List: """ Adds any children/parent relationships to funder instances in the funders list. :param funders: List of funders :param funders_by_key: Dictionary of funders with their id as key. :return: funders with added relationships. ...
5,300,875
def eval_adv_test_blackbox(model_target, model_source, device, test_loader): """ evaluate model by black-box attack """ model_target.eval() model_source.eval() robust_err_total = 0 natural_err_total = 0 for data, target in test_loader: data, target = data.to(device), target.to(d...
5,300,876
def p_class_member_declarations(p): """class_member_declarations : class_member_declaration | class_member_declarations class_member_declaration """ if len(p) == 2: p[0] = [deepcopy(p[1])] else: p[0] = deepcopy(p[1]) + [deepcopy(p[2])]
5,300,877
def __tokenize(syntax) -> list: """ Validate and tokenize the syntax. Valid syntax: snake_case_words, integers, plus, minus. """ if not re.match(r"^[\w\d\s\+-]+$", syntax): raise SyntaxError("Invalid syntax.") syntax = re.sub(r"\s*([+-])\s*", r" \g<1> ", syntax) return syntax.split...
5,300,878
def unpause(): """unpause(): return None resume paused music""" check_mixer() sdl.Mix_ResumeMusic()
5,300,879
def test_three_clever_players_of_all_types(): """ Try all combinations of preferences for the three player game """ start = perf_counter() for i0 in [1, 2]: for i1 in [0, 2]: for i2 in [0, 1]: preferences = [[i0], [i1], [i2]] result = thre...
5,300,880
def test_test_module_handles_authorization_error(requests_mock): """Tests the test_module validation command authorization error. """ from SOCRadarThreatFusion import Client, test_module, MESSAGES mock_socradar_api_key = "WrongAPIKey" suffix = f'threat/analysis/check/auth?key={mock_socradar_api_key...
5,300,881
def reducer(state, action): """Screen specific reducer Given :func:`screen.set_position` action adds "position" data to state :param state: data structure representing current state :type state: dict :param action: data structure representing action :type action: dict """ state = c...
5,300,882
def see_model_list(): """ Get's the data about all models in the DB to put on a table: - name - organism - strain Returns: render_template to see_data with tab_status set to models. """ tab_status = {"enzymes": "#", "metabolites": "#", "models": "active", "organisms": "#", "...
5,300,883
def localsys_get_login(): """Retrieves the login credentials from the computer you are on. Good for command line tools""" try: sid = local_credentials.get_password('minervaclient_sid','minerva') pin = local_credentials.get_password('minervalcient_pin','minerva') if sid is None or pin...
5,300,884
def GetOrigFn( module, fnName ): """Return the original function.""" return DictGet( orig_fns, ( module, fnName ), getattr( module, fnName ) )
5,300,885
def main(): """Make a jazz noise here""" args = get_args() for line in args.text.splitlines(): print(' '.join(map(word2num, line.split())))
5,300,886
def host_toolchain(xcrun_toolchain='default', tools=None, suffixes=None): """ Return a Toolchain with the first available versions of all specified tools, plus clang and clang++, searching in the order of the given suffixes. If no matching executables are found, return None. """ if tools is...
5,300,887
def transcribe_audio(audio_stream, model: str, language_code: str): """ Transcribe the given audio chunks """ global client encoding = RecognitionConfig.AudioEncoding.LINEAR16 try: audio = RecognitionAudio(content=audio_stream) config = RecognitionConfig( s...
5,300,888
def handle_venv_creation( env: Optional[Environment], config: Config, code: VSCode ) -> None: """ Handles the automatic detection and/or creation of python virtual environments based on detected repo contents and reports to the user. Args: env (Optional[Environment]): The Environment ob...
5,300,889
def indent(yaml: str): """Add indents to yaml""" lines = yaml.split("\n") def prefix(line): return " " if line.strip() else "" lines = [prefix(line) + line for line in lines] return "\n".join(lines)
5,300,890
def smooth_pr(prec, rec): """ Smooths precision recall curve according to TREC standards. Evaluates max precision at each 0.1 recall. Makes the curves look nice and not noisy """ n = len(prec) m = 11 p_smooth = np.zeros((m), dtype=np.float) r_smooth = np.linspace(0.0, 1.0, m) for i in range(m): j = np.argmi...
5,300,891
def get_rbac_role_assigned(self) -> dict: """Get list of accessible menus based on the current session permissions .. list-table:: :header-rows: 1 * - Swagger Section - Method - Endpoint * - rbacRole - GET - /rbac/role/menuAssigned .. no...
5,300,892
def main(): """main entry point for module execution """ argument_spec = dict(gather_subset=dict(default=['!config'], type='list')) argument_spec.update(fujitsu_srs_argument_spec) module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True) gather_subset = module.params['gather_subset']...
5,300,893
def set_user_password(args): """ Sets a user's password in the keyring storage """ print(""" [%s] Preparing to set a password in the keyring for: - Environment : %s - Parameter : %s If this is correct, enter the corresponding credential to store in your keyring or press CTRL-D to abort:""" % (...
5,300,894
def close_session(module_session): """Closes the Shell Interactive Session Args: module_session (object): The module session object that should be closed Returns: A dict holding the result message """ module_session.close() return Response.ok("The Shell Interactive session has be...
5,300,895
def Xfact(m): """Xfact(m) Computes (2m-1)!!/sqrt((2m)!) """ res = 1. for i in xrange(1,2*m+1): if i % 2: res *= i # (2m-1)!! res /= np.sqrt(i) # sqrt((2m)!) return res
5,300,896
def process_csv(csv_file=None): """ Function to read the content(s) of CSV file(s). The function reads the contents of CSV file(s) available in a certain directory and populate a dictionary with e-mail id as key in order to have unique e-mails. :param csv_file: Name of the csv_file. :retur...
5,300,897
def ingest_images(phosim_dir, image_repo, pattern='lsst_*.fits.gz', logger=None): """ Run obs_lsstSim/bin/ingestImages.py in order to set up the initial image repository for the phosim data. """ if logger is None: logger = logging.getLogger() command = 'ingestSimImages....
5,300,898
def check_for_input_len_diff(*args): """ Check for Input Length Difference. This method checks if multiple data sets that are inputted are all the same size. If they are not the same length an error is raised with a custom message that informs the developer that the data set's lengths are not the ...
5,300,899