content
stringlengths
22
815k
id
int64
0
4.91M
def create(ctx): """Scaffold out new panki projects and components.""" pass
66,400
def SendKeys(keys, pause=0.05, with_spaces=False, with_tabs=False, with_newlines=False, turn_off_numlock=True): """ Sends keys to the current window. `keys` : str A string of keys. `pause` : float The number of seconds to ...
66,401
def wfc3ir_header(ra=53.1592277508136, dec=-27.782056346146, pa_aper=128.589, flt='ibhj34h6q_flt.fits', filter='G141'): """Make HST/WFC3-IR image header Parameters ---------- ra, dec: float, float Coordinates of the center of the image pa_aper: float Posi...
66,402
def get_base_graph() -> GeNeG: """ Retrieves the base graph created from the news dataset. """ utils.get_logger().info('GeNeG: Loading base knowledge graph into memory..') global __BASE_GRAPH__ if '__BASE_GRAPH__' not in globals(): initializer = lambda: GeNeG.build_base_graph() __BASE_GR...
66,403
def do_parse_pod_name(text): """Find the pod name from the failure and return the pod name.""" p = re.search(r' pod (\S+)', text) if p: return re.sub(r'[\'"\\:]', '', p.group(1)) else: return ""
66,404
def needle_statistics_alignio(infile): """Reads in a needle alignment file and returns an AlignIO object with annotations Args: infile (str): Alignment file name Returns: AlignIO: annotated AlignIO object """ alignments = list(AlignIO.parse(infile, "emboss")) if len(alignmen...
66,405
def test_update(cmd: commands.Commands): """Update test.""" gist_id = cmd.gist_create('setup.cfg') gist_id = cmd.gist_update(gist_id, 'pyproject.toml') with open('pyproject.toml', 'r') as setup_file: source = setup_file.read() cmd.gist_download(gist_id, 'setupkek.toml') with open('setupk...
66,406
def _testProduct_to_dict(product_obj, ctx): """ Returns testProduct instance in dict format. Args: product_obj (_TestProduct): testProduct instance. ctx (SerializationContext): Metadata pertaining to the serialization operation. Returns: dict: product_obj as a ...
66,407
def get_phi(struct,obser='ones',rmax=15,delta=0.05,sigma=0.075,kernsize=10,tol=0.1): """ Get the fingerprint phi for a given structure :param struct: The pymatgen structure you want to use :param rmax: The maximum r in Angstroms you want to create the fingerprint for :param obser: The observable yo...
66,408
def generate_new_model_for_dataset(): """Return a feed forward model from scratch https://www.kaggle.com/kabure/titanic-eda-model-pipeline-keras-nn""" model = Sequential() model.add(Dense(64, activation='relu', input_dim=26)) model.add(Dense(64, activation='relu')) model.add(Dropout(0.50)) ...
66,409
def WarnOnUsingLogOrServiceArguments(args): """Warns on using the --log or --service flag.""" if args.log: sdk_log.warn('--log is deprecated and will soon be removed.') elif args.service: sdk_log.warn('--service is deprecated and will soon be removed.')
66,410
def loss(params, batch, model_predict): """Calculate loss.""" inputs, targets = batch preds = model_predict(params, inputs) return -np.mean(preds * one_hot(targets, preds.shape[-1]))
66,411
async def test_genericstatus_sensor(): """Verify that generic flag sensor works.""" sensor = create_sensor("0", FIXTURE_GENERICSTATUS, None) assert sensor.BINARY is False assert sensor.ZHATYPE == ("CLIPGenericStatus",) assert sensor.state == 0 assert sensor.status == 0 # DeconzSensor ...
66,412
def Action(name): """ Registers any function with this decorator onto the ACTIONS dict under the key of it's name; this decorator also registers the parameters that the function takes, sorting them under static params (those passed in from the database configuration) and/or dymanic p...
66,413
def get_anime_class(url): """ Get anime class corresposing to url or name. See :py:data:`anime_downloader.sites.ALL_ANIME_SITES` to get the possible anime sites. Parameters ---------- url: string URL of the anime. Returns ------- :py:class:`anime_downloader.site...
66,414
def create_cross_chain_payment(payment: Payment, dest_account: str) -> Payment: """ Creates a cross-chain payment transaction. Args: payment: The initial payment transaction. If the transaction is signed, then it will need to be re-signed. There must be no more than 2 memos, since the ...
66,415
def initialize_schur_ksp_obj(matrix_A, schur_approx): """ Creates a right-hand-side and solution PETSc4Py vector for testing ksp solves. Parameters ---------- matrix_A: :class:`PETSc.Mat` Global matrix object. schur_approx: :class:`LS.SchurPrecon` Returns ------- ksp_ob...
66,416
def draw_edges(graph, pos, show_weights, node_size, edge_labels): """Draw edges on the graph""" edge_styles = set((s[2] for s in graph.edges(data='style'))) for style in edge_styles: edges = [e for e in filter( lambda x: x[2] == style, graph.edges(data='style'))] nx.draw_networkx...
66,417
def build_response( *, request: reviews.Request, outcomes: Mapping[ids.HandlerId, execution.Outcome], warnings: Collection[str], jsonpatch: patches.JSONPatch, ) -> reviews.Response: """ Construct the admission review response to a review request. """ allowed = all...
66,418
def calculate_mode(values: dict, data: StepData): """Bestimmt den am häufigsten in einem Array vorkommenden Wert. :param values: Werte aus der JSON-Datei :param data: Daten aus der API """ for idx, key in data.loop_key(values["keys"], values): value = data.get_data(key, values) new_...
66,419
def _get_fields_translation_data(session=DBSession): """ Obtaining Field table with all translations(TranslationAtom) of it's name from DB session and returning it as: dict { (client_id, object_id): dict { 'field': models.Field, 't...
66,420
def check_params(module): """ Most modules must have either `name` or `id` specified. """ if module.params.get('name') is None and module.params.get('id') is None: module.fail_json(msg='"name" or "id" is required')
66,421
def _make_session_diagnostic_plots(model, df_model): """ Display and write to file several diagnostic plots, to: * decide which obs, comps, images might need removal by editing session.ini, and * possibly adjust regression parameters, also by editing session.ini. """ context, defaults_dict, s...
66,422
async def get_all_acls(request: web.Request) -> web.Response: """ Get list of all access control lists in the system :Example: curl -H "authorization: $AUTH_TOKEN" -sX GET http://localhost:8081/fledge/ACL """ storage = connect.get_storage_async() payload = PayloadBuilder().SELECT("name", "s...
66,423
def hxltm_hastag_de_csvhxlated(csv_caput: list) -> list: """hxltm_hastag_de_csvhxlated [summary] Make this type of conversion: - 'item__conceptum__codicem' => '#item+conceptum+codicem' - 'item__rem__i_ara__is_arab' => '#item+rem+i_ara+is_arab' - '' => '' Args: csv_caput (list): Array o...
66,424
def populate_formatting(cfg: Config) -> None: """ Grabs the contents of the three wiki pages that contain the formatting examples and stores them in the cfg object. :return: None. """ cfg.audio_formatting = get_wiki_page('format/audio', cfg) cfg.video_formatting = get_wiki_page('formats/vid...
66,425
def add_payload_parameters(env_params): """ Adds the common parameters to be used by the extension scripts :param dict[str, str] env_params: Dictionary to be added :return: Dictionary with updated parameters :rtype: dict[str, str] """ env_params["STRATOS_APPLICATION_PATH"] = cartridge_agent_...
66,426
def sphere(p: np.array, radius: np.float) -> np.float: """ Sphere SDF :param p: vec3 position :param radius: radius :return: signed distance """ return euclidean_length(p) - radius
66,427
def conv_node(nodes, children, feature_size, output_size): """Perform convolutions over every batch sample.""" with tf.name_scope('conv_node'): std = 1.0 / math.sqrt(feature_size) w_t, w_l, w_r = ( tf.Variable(tf.random.truncated_normal([feature_size, output_size], stddev=std), name=...
66,428
def response_service_unavailable(): """Returns a 503 error based on a static template""" return HttpResponse(loader.render_to_string('503.html'), status=HTTP_SERVICE_UNAVAILABLE)
66,429
def little_endian_decode(array, word_size): """Transform array of words to one integer.""" return big_endian_decode(reversed(array), word_size)
66,430
def plot(var_item, off_screen=False, full_screen=False, screenshot=None, interactive=True, cpos=None, window_size=None, show_bounds=False, show_axes=True, notebook=None, background=None, text='', return_img=False, eye_dome_lighting=False, **kwargs): """ Convenience plotting function f...
66,431
def gen_color(): """ generate random color for WordCloud """ return "rgb(%s,%s,%s)" % ( random.randint(0, 160), random.randint(0, 160), random.randint(0, 160), )
66,432
def mock_tv(): """Disable component actual use.""" tv = create_autospec(PhilipsTV) tv.sources = {} tv.channels = {} tv.application = None tv.applications = {} tv.system = MOCK_SYSTEM tv.api_version = 1 tv.api_version_detected = None tv.on = True tv.notify_change_supported = F...
66,433
def test_context_bad_push(): """ Try pushing a non-RegistryFile object onto the stack """ ctx = Context(None) for obj in [ choice((True, False)), randint(1, 10000), random_str(5, 10), random_str(30, 50, spaces=True), {}, [], Context(None), ]: with pytest.raises(PrologueError) as ...
66,434
def test_freeze(): """ Frozen classes are completely immutable. Users should not be able to mutate or add any existing properties. :return: :rtype: """ # Initialize props and set properties to # 1 and 2, respectively frozen_class = fd.freeze(Props)(1, 2) with pytest.raises(I...
66,435
def cmyk_to_rgb(color_values: tp.List[float]) -> tp.List[float]: """Converts list of CMYK values to RGB. :param color_values: (list) 4-member CMYK color value list :return: (list) 3-member RGB color value list """ return [round(1.0 - min(1.0, x + color_values[3]), 3) for x in color_values[:3]]
66,436
def cancel_all(): """Handles SocketIO request to cancel all goals""" logger.info('Client requests to cancel all goals!') return vtr_mission_planning.remote_client().cancel_all()
66,437
def group_iou_across_classes(gt_boxes: BoundingBoxGroup, pt_boxes: BoundingBoxGroup, as_iou=False): """ Compute the IoU between two boxes group set. For each class in each round, iteratively select a box from gt_boxes and pick corresponding maximum IoU box in pt_boxes as pairs. After finished, compute I...
66,438
def login(username: str, password: str, token: Optional[str], host: Optional[str], yes: bool) -> None: """Log in into Valohai.""" if settings.user and settings.token: current_username = settings.user['username'] current_host = settings.host if not yes: click.confirm(( ...
66,439
def makeAnyJournal(items=3, attrib=None): # noqa """ Retorna uma lista de objetos ``Journal`` com atributos ``jid``, ``is_public`` e ``acronym`` limitando a quantidade pelo param ``items``. Param attrib para adicionar atributo aos objecto do tipo Journal """ journals = [] for _ in range(it...
66,440
def image_from_url(url): """ Read an image from a URL. Returns a numpy array with the pixel data. Arguments: url: urls for images for display Outputs: img: numpy array for the image """ try: f = urllib.request.urlopen(url) _, fname = tempfile.mkstemp() wit...
66,441
def plan_adopt_handler(args: argparse.Namespace) -> None: """ Handler for "plans adopt" subcommand. This command associates the free subscription plan with all groups which do not currently have an associated subscription. """ session = SessionLocal() try: free_plan_id = actions.get...
66,442
def main(): """A command line tool entry point""" parser = argparse.ArgumentParser(prog='setup', description='Dreemchest engine install tool') parser.add_argument('--cmake', help='a CMake version to be installed.', type=str, default='3.4.3') android_options = parser.add_mutually_exclusive_group() ...
66,443
def humanify(code): """ Tries to interpret a Jpl object or site code as a human readable celestial object name. Args: code (str): the code to be translated. Returns: str: the corresponding human readable name. """ if code.isdigit(): id_ = int(code) elif code.sta...
66,444
def extract_providers(decompiled_app_path): """ Extracts provider paths from a decompiled app directory using grep :param str decompiled_app_path: the directory where to look for the providers :return: a sorted list of proviers """ from scrounger.utils.general import pretty_grep import ...
66,445
def stateToQd(x): """ Converts qd struct used in hardware to x vector used in simulation x is 1 x 13 vector of state variables [pos vel quat omega] qd is a struct including the fields pos, vel, euler, and omega """ qd = qd_object() # current state qd.pos = x[0:3] qd.vel = x[3:6] ...
66,446
def get_symbol_size(version, scale=1, border=None): """\ Returns the symbol size (width x height) with the provided border and scaling factor. :param int version: A version constant. :param scale: Indicates the size of a single module (default: 1). The size of a module depends on the us...
66,447
def convert(): """ Writes the convert.inp file. :return convert_inp_str: String for input file :rtype: string """ convert_inp_str = 'MultiInputFile tst.inp' return convert_inp_str
66,448
def run_from_pickle(pickle_file): """ Launch an MPI calibration job from the specified picklefile (usually built from awrals.calibration.cluster.build_pickle_from_spec) Args: pickle_file (str): Input pregenerated pickle file Returns: int: Return code of the executed mpirun...
66,449
def showVecMatrix(xvec, yvec, vals, full=False, **kwargs): """Plot three vectors as matrix. Parameters ---------- xvec, yvec : iterable (e.g. list, np.array, pg.Vector) of identical length vectors defining the indices into the matrix vals : iterable of same length as xvec/yvec vecto...
66,450
def extend_pandas(): """ 扩展pandas的PandasObject (Series, DataFrame),用上述定义的函数 例如: prices_df.to_returns().dropna().calc_clusters() """ PandasObject.to_returns = to_returns PandasObject.to_log_returns = to_log_returns PandasObject.to_price_index = to_price_index PandasObject.rebase ...
66,451
def infected_critical_case_rate_30(): """ Real Name: b'infected critical case rate 30' Original Eqn: b'Infected symptomatic 30*fraction of critical cases 30/symptomatic duration 30' Units: b'person/Day' Limits: (None, None) Type: component b'' """ return infected_symptomatic_30() * ...
66,452
def recover_public_key(message, signature, hasher=None): """ Recovers public key from signed message :param message: message :param signature: signature :param hasher: hash function to use on message (usually sha256 or keccak_hash) :return: public key """ if len(signature) != eth_common...
66,453
def descriptive_statistics( master_path, SG_tabs, avl_recs_SG, missing_recs_SG, all_charts_num_1_, all_charts_cat_1_, print_report=False, ): """ :param master_path: Path containing the input files. :param SG_tabs: 'measures_of_counts','measures_of_centralTendency','measures_of_ca...
66,454
def mocked_operations_create(monkeypatch): """Monkeypatch operations.create.""" mock_create = mock.MagicMock() monkeypatch.setattr(operations, "create", mock_create) return mock_create
66,455
def policy_gradient_loss(policy, model, dist_class, train_batch): """Example of using embedded eager execution in a custom loss. Here `compute_penalty` prints the actions and rewards for debugging, and also computes a (dummy) penalty term to add to the loss. """ def compute_penalty(actions, reward...
66,456
def preprocessing(df, attribute): """ This is the base preprocessing for french. It scapes \ char and replace all ocurrence of - :df: pandas data frame. :attribute: atribute of df. """ return getattr(df, attribute).map(lambda sent: sent.lower().replace('\'', '\\\' ').replace('-', ' '))
66,457
def ident_snapshot_test(arg): """ Used to build identification string for each autogenerated test (for easy recognition of failed tests). :param arg: dict with information about rules. :return: identification string with snapshot_id. """ if isinstance(arg, bool): return "remediated" if ...
66,458
def find_num_fppeak_diff(llprops, blaze, n_init, n_fin, wave_blaze_thres, xdiff_min, xdiff_max): """ :param llprops: :param blaze: :param n_init: :param n_fin: :param wave_blaze_thres: :param xdiff_min: :param xdiff_max: :return: """ # set up storage...
66,459
def gcj2wgs_rough(gcjLat, gcjLon): """ GCJ-02 转 WGS-84 粗略版 """ if outOfChina(gcjLat, gcjLon): print("The latitude or longitude is out of China!") return gcjLat, gcjLon lat, lng = delta(gcjLat, gcjLon) return gcjLat - lat, gcjLon - lng
66,460
def target_expression(environment_file): """ Get the target expression from given file. Parameters ---------- environment_file : str Path and name of the environment file (giving the target relative expression levels) Returns ------- target_expresstion : Numpy array...
66,461
def extract_features( self, prev_output_tokens, encoder_out: Optional[EncoderOut] = None, incremental_state: Optional[Dict[str, Dict[str, Optional[Tensor]]]] = None, full_context_alignment: bool = False, alignment_layer: Optional[int] = None, alignment_heads: Optional[int] = None, averag...
66,462
def sanitize_screenshot(raw_png: bytes, real_size: Tuple[int, int]) -> Image.Image: """Processing screenshots taken by the browser.""" with io.BytesIO(raw_png) as f: image = Image.open(f).convert("RGB") return image.resize(real_size)
66,463
def test_benchmark_policies_for_short_and_long_term_rewards(): """test a drug2 policy has higher long term rewards than the drug2 policy and drug1 policy has higher short term rewards We will use a chort of 10 patients to decide if rewards are different based on previous power analysis. ...
66,464
def read_h5_event_components(hdf_path): """ Read events from HDF5 file (Monash style). @param hdf_path Path to HDF5 file @returns Events as four np arrays with the event components """ f = h5py.File(hdf_path, 'r') if 'events/x' in f: #legacy return (f['events/x'][:], f['event...
66,465
def complex(real=0.0, imag=0.0): """Form a complex number. Keyword arguments: real -- the real part (default 0.0) imag -- the imaginary part (default 0.0) """ if imag == 0.0 and real == 0.0: return complex_zero
66,466
def product_upper_triangle(values, include_diagonal=False): """ Return an iterator over pairs, (v0, v1), drawn from values. If `include_diagonal` is True, returns all pairs such that v0 <= v1. If `include_diagonal` is False, returns all pairs such that v0 < v1. """ return all_pairs_matching_pre...
66,467
def add_training_data_parser(subparsers): """Adds CLI arguments for building a training data set.""" parser = subparsers.add_parser( 'build_train_data', help=('Uses the data from space-track.org to build a training set of ' 'physical model errors.')) parser.add_argument( ...
66,468
def write_lightcone_surfaces(light_cone_surfaces, units, outfile, freqs, cosmo=None, is_healpix=False): """ ----------------------------------------------------------------------------- Write light cone surfaces to HDF5 file Inputs: light_cone_surfaces ...
66,469
def pyfold_tui(config: Config) -> None: """ Final code invocation after Pytest run has completed. This method calls the Pyfold TUI to display final results. """ # disable capturing while TUI runs to avoid error `redirected stdin is pseudofile, has # no fileno()`; adapted from https://githubmemor...
66,470
def test_find_repo_root_with_root_dir(): """ Should still return the repo root directory. """ root = config_utils.find_repo_root(__file__) refound = config_utils.find_repo_root(str(root)) assert _is_root(refound)
66,471
def test_create_returns_app_name(heroku, happy): """Should return the app name and id from the build.""" heroku().create_build.return_value = { 'id': '12345', 'app': { 'name': 'butt-man-123', }, } build_id, app_name = happy.create(tarball_url='example.com') asse...
66,472
def current_filtered_positive_identifier() -> FilteredPositiveIdentifier: """Returns the current filtered positive identifier. Returns: {FilteredPositiveIdentifier} -- the current filtered positive identifier """ return FilteredPositiveIdentifierV3()
66,473
async def _create(pea: 'PeaModel', envs: Optional[Dict] = {}): """ .. #noqa: DAR101 .. #noqa: DAR201""" try: args = ArgNamespace.kwargs2namespace(pea.dict(), set_pea_parser()) return store.add(args, envs) except Exception as ex: raise PartialDaemon400Exception from ex
66,474
def non_numeric(): """\\D: Non-numerical characters.""" return "{}dom is comming, tomorrow".format( re.search(r'\D+', "4free").group())
66,475
def on_connect(client, userdata, flags, rc): """ The callback for when the client receives a CONNACK response from the server. """ if rc == 0: print("connected OK with returned code=", rc) else: print("Bad connection with returned code=", rc)
66,476
def whataremyips(): """ Get the machine's ip addresses :returns: list of Strings of ip addresses """ addresses = [] for interface in netifaces.interfaces(): try: iface_data = netifaces.ifaddresses(interface) for family in iface_data: if family not...
66,477
def update_book(sql: Session, book_id: int, book: BooksUpdate): """ Update a specific book """ old_data = sql.query(Books).filter(Books.BookId == book_id).first() if old_data is not None: new_data = book.dict() old_data.Title = new_data["Title"] old_data.AuthorId = new_data[...
66,478
def test_generate_product_package_with_existing_package_name_and_overwrite_false( valid_product_package ): """ When the package_name already exists and overwrite=False, Products.generate_product_package should raise a FileExistsError """ package_path = Path(gettempdir()) / "uploading_package" ...
66,479
def IsJsFile(ref): """Returns true if the provided reference is a JavaScript file.""" return ref.endswith('.js')
66,480
def calc_topk_accuracy(output, target, topk=(1,)): """ Modified from: https://gist.github.com/agermanidis/275b23ad7a10ee89adccf021536bb97e Given predicted and ground truth labels, calculate top-k accuracies. """ maxk = max(topk) batch_size = target.size(0) _, pred = output.topk(maxk, 1...
66,481
def inputs(dataset_name, total_batch_size, num_gpus, max_epochs, resized_size, data_dir, split): """ A generalized implementation of input pipeline for different datasets. :param dataset_name: the name of the dataset :param total_batch_size: total number of instances per batch :param num...
66,482
def fix_faulty_url(data: DownloadData): """ Removes the tags ("...-OP1-NCBD.webm" -> "...,OP1,NCBD.webm" -> "...-OP1.webm") Used when themes.moe returns a stupid url. """ if data['url'].count('-') == 1: raise BadThemesUrl(f'Cannot get a good url for {data["url"]}') else: url = '-...
66,483
def upgrade(): """ Run upgrade """ # ### commands auto generated by Alembic - please adjust! ### op.create_index( op.f('ix_domain_proxy_logs_cbsd_serial_number'), 'domain_proxy_logs', ['cbsd_serial_number'], unique=False, ) op.create_index( op.f('ix_domain_proxy_logs_...
66,484
def read_anno_Traff_mcl(anno_info): """Read the annotation. if the dataset in ['Trafficlight_mcl'], this function will be used. :return: boxes, klass, is_crowd :rtype: tuple """ (anno_path, set_ignore, set_fake, label_map, tl_color_map, vehicle_person_id, boxes, klass, is_crowd) = anno_info ...
66,485
def get_delayed_hash(delay): """ Returns a delayed version for testing hash_func. """ async def delayed_hash(left, right): await asyncio.sleep(delay) return await hash_func(left, right) return delayed_hash
66,486
def seek_revised(request): """Getting the investigations, studies and assays based on the information given by the user in the upload form. The user selects the project, investigation, study and assay. After selecting the assay the user enter a title and description an can upload a data file to the ...
66,487
def discriminative_instance_loss(y_true, y_pred, delta_v=0.5, delta_d=1.5, gamma=1e-3): """Discriminative loss between an output tensor and a target tensor. Args: y_true: A tensor of the same shape as `y_...
66,488
def main(args): """Entry point. :param args: Parsed CLI arguments. """ # Pull. network_id = factory.create_network_id(args.network) network = cache.infra.get_network(network_id) if network is None: raise ValueError("Unregistered network.") if network.faucet is None: ...
66,489
def get_from_konrad(variable,exps): """Extracts a variable from the output files of several `konrad` experiments. Parameters ---------- variable : str Variable name in the output file. exps : list List of strings describing the paths to the output files. Returns ------- p,t ...
66,490
def test_double009_1947_double009_1947_v(mode, save_output, output_format): """ TEST :Facet Schemas for string : value=+0.0 """ assert_bindings( schema="msData/datatypes/double.xsd", instance="msData/datatypes/double009.xml", class_name="Root", version="1.1", mode...
66,491
def fence_vegalite(source, language, class_name, options, md, **kwargs): """ Inspired by https://github.com/facelessuser/pymdown-extensions/blob/8ee5b5caec8f9373e025f50064585fb9d9b71f86/pymdownx/superfences.py#L146 """ # noqa if not _validateJSON(source): raise SuperFencesException from Plugin...
66,492
def ExportKeypointsToCOCO(image_ids, detection_keypoints, detection_scores, detection_classes, categories, output_path=None): """Exports keypoints in numpy arrays to COCO API. T...
66,493
def to_monochrome(source, fmt): """ Convert an image to monochrome """ img = Image.open(source) img.convert(mode='1') img.save(source, format=fmt.replace('jpg', 'jpeg') if fmt else None) return source
66,494
def call_categorize(final_df, current_df, type): """ :param final_df: A dataframe that is created from the concatenation of 5 datasets :param current_df: Contains the unique AS numbers of RIPE RIS or the AS numbers of RIPE ATLAS probes :param type: Can take 2 values ('Ripe_Ris_monitors', 'Ripe_Atlas_pro...
66,495
def test_uniform_real_data_parallel(): """ Features: test UniformReal data parallel Description: data parallel Expectation: compile success """ context.set_auto_parallel_context(parallel_mode="semi_auto_parallel", device_num=8, global_rank=1) net = Net(SEED_, SEED2_) shape = (8, 8) p...
66,496
def dark_correct_arimg( img: arimage.ARImage, dark: arimage.ARImage) -> arimage.ARImage: """ Dark corrects image """ logger.info("Dark correcting image: " + img.getFullPath()) logger.info(" with dark: " + dark.getFullPath()) # Load image data into memory if it is not already ...
66,497
def _inter_glyph_reuse_key( view_box: Rect, painted_layer: PaintedLayer ) -> InterGlyphReuseKey: """Individual glyf entries, including composites, can be reused. SVG reuses w/paint so paint is part of key.""" # TODO we could recycle shapes that differ only in paint, would just need to # transfer th...
66,498
def isPathPolyIntersect(path, poly): """Given a path in the form of np.ndarray, return if it intersects with a given polygon. :param path: ndarray, (\*, 2) a path represented by N by 2 matrice """ line = LineString(path) intersect = line.intersects(poly) print(intersect) if isinstance(inter...
66,499