sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
3f8a463852dd0cdea076f61954ec6d32af5a97f24754eb28e02e97c6931ddfee
Python
2,363
51
from pddlstream.algorithms.downward import add_predicate, make_predicate, get_literals, fact_from_fd, conditions_hold, \ apply_action, get_derived_predicates from pddlstream.language.constants import And, Not from pddlstream.language.conversion import evaluation_from_fact from pddlstream.language.function import Fu...
d1469ec673395fca661a75c4e58fc5021a72d5a5a1558863bb5d8a703fbb319b
Python
2,363
63
"""Command Line Interface for TGAN.""" import argparse from tgan.research.experiments import run_experiments def get_train_parser(): """Build the ArgumentParser for CLI.""" parser = argparse.ArgumentParser() parser.add_argument('--gpu', help='comma separated list of GPU(s) to use.') parser.add_argum...
0bb238e22e27fcefe5181f5c8600af30dc02f52af1ae102b9367602d6f1ba514
Python
2,364
46
"""Example A: register an alternative neural interface and an experiment that compares it. Enable: Plugins -> Manage plugins... (then restart), or --plugin example_normalized_interface, or LIQUIDAION_PLUGINS=example_normalized_interface. Select it in the Components panel, or run the experiment from the Plugins panel. ...
33fecba07af557369c219e57b92d905ee08aabc39fb2fdcc8b27f38004e35a2d
Python
2,364
46
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ht...
3ca270acc1e70f89b4bd931d9872779be3ab2c46e829c601a583488b9429b88a
Python
2,364
80
# Node-group asset "Atom ID" (GeometryNodeTree), dumped by nodebpy.assets.dump_library. # Rebuild the library with nodebpy.assets.build_library (nodebpy build). # _build_group() is the source of truth: the docstring, __init__ and accessors are regenerated from it on the next dump. from typing import TYPE_CHECKING from ...
6bce410fd82afb050e3b101b49f5383fde62c3dc472348db10377dbdfabb0d22
Python
2,364
68
from torch.utils.data import Dataset, DataLoader import torch import numpy as np from rocf_scoring.data_preprocessing.loading_data import load_raw_data from rocf_scoring.data_preprocessing.preprocess import preprocess, BIN_LOCATIONS from rocf_scoring.helpers.helpers import check_if_in_range class ROCFDataset(Dataset):...
b96f1a2ccd95a9dac7e19297dff0e4fc90fe6b154c1b966fa3dbdcaa60b3ba51
Python
2,364
43
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ht...
730f2d1824c0b2cd95728be6c8111bb6887107c1cd7d8b7937567e87d52efc6d
Python
2,365
87
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. def _test_esm1b(alphabet): import torch batch_converter = alphabet.get_batch_converter() data = [ ("protein1", "MKTVRQG"...
1613fd2d8f2e65a31d63b53475b6a948002c48525655595f5f6c60880ffaed7f
Python
2,366
77
import seaborn as sbn import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib import pyplot as plt # ======================================== # Matplotlib settings params = { "legend.fontsize": 16, "legend.frameon": False, "ytick.labelsize": 15, "xtick.labelsize": 15, # "figure.dpi...
5de5710fa5ec4745f7175882625d0d4f078bd789d7e9cebf208e0ac6e701f561
Python
2,366
61
import nibabel as nib import glob import argparse import matplotlib.cm as cm import matplotlib.colors as mcolors import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy as np # Argument parsing parser = argparse.ArgumentParser(description='Plot lesion frequency maps.') parser.add_argument('--t...
1b989b8b483715679e515895668b3d43942281380e454d38cfb6f3a60b4a5e85
Python
2,367
47
import unittest from hed.schema.hed_schema_entry import HedTagEntry class MockEntry: def __init__(self, attributes, parent=None): self.attributes = attributes self.takes_value_child_entry = False self._parent_tag = parent _check_inherited_attribute = HedTagEntry._check_inherited_attr...
85e933f0a6683a2ff1fcd923ffb790eeb8f32d980850fc0ffffb18b7b67bc8c6
Python
2,368
80
#!/usr/bin/python3 """ Convert SWC files to connected points. SWC nodes are combined into section lines and saved as Python dictionary in JSON format. """ import multiprocessing as mp import numpy as np import argparse import json import os from treem import Morph, SWC from treem.io import TreemEncoder examples = ...
b1932e322a7b63eeb7ff605c9a7bc977a01019c504c918551cbf3e89ee4b53f4
Python
2,368
79
"""Spin-echo spectrum.""" # %% import matplotlib.pyplot as plt import numpy as np from scipy.optimize import curve_fit import console from console.interfaces.acquisition_data import AcquisitionData from console.spcm_control.acquisition_control import AcquisitionControl from console.utilities import sequences # Create...
f599266806a5c9c96ea0326b412aea485e9a1452f5f93976539c5816f9b9aa3a
Python
2,368
75
import argparse import numpy as np import sys def generate(): parser = argparse.ArgumentParser() parser.add_argument('--vocab_file', default='vocab.txt', type=str) parser.add_argument('--vectors_file', default='vectors.csv', type=str) args = parser.parse_args() with open(args.vocab_file, 'r') as f...
bb35070253ccea1432e00575b27c0f7057ef296e4b3abe745e9f3caa6dc840aa
Python
2,369
95
HEADERS_TO_CONVERT = [ 'Sex', 'Location3', 'Diagnosis', 'Chemo (Neoadjuvant)', ] PRE_OP_PREDICTORS = [ 'Sex', # need to one hot encode 'Age', 'Location3', # need to one hot encode 'Diagnosis', # OHE 'Chemo (Neoadjuvant)', #OHE 'TumorSize', 'TumorVolume (cm^3)',...
ebe0c3ab148ed26da4da6460f82686ec0c2fccab653fb5b8824706635455dc42
Python
2,369
101
"""Helpers ---------- """ import numpy as np import json import operator import hashlib import pickle import parameters as ps def merge_dictionaries(main_dict, new_dict, path=None): """ Merges new dictionary recursively into main dictionary. Parameters ---------- main_dict Main dictionar...
4e067de8b261479ac1e8a3c1bb9d98adfdb92e31b9ce618c695fb1c77fb61885
Python
2,370
69
import os import torch from torch.utils import data as torch_data from torchdrug import data, utils from torchdrug.core import Registry as R @R.register("datasets.ProteinNet") @utils.copy_args(data.ProteinDataset.load_lmdbs, ignore=("target_fields",)) class ProteinNet(data.ProteinDataset): """ A set of prot...
525a9735e6cb620d981998ae6b98418ba6ae0e9c5606b9b9ed49712bb47e520b
Python
2,370
66
# checking over the command line params import os def check_params(args): # avoid overwriting saved weights or other output files if args.train is True: if os.path.exists( args.out + "/Train/disperseNN2_" + str(args.seed) + ".weights.h5" ) and args.force is False: prin...
223bb7c4ebdfdace9091c1ad5dafe50ae618af82e9a309eedf66c69c0881bc07
Python
2,371
66
import matplotlib matplotlib.use("Agg") import torch device = torch.device("cuda" if torch.cuda.is_available() else "cpu") import yaml, io with open("./config/MNIST_config.yaml", 'r') as stream: config= yaml.safe_load(stream) config["default_path"]= str(config["default_path"]) config["cuda"]= str(config["cud...
8eca9c0e7b0e90e5364ee0fbe4780290a87d1e5fb74c9993100ff06e3c458cdf
Python
2,371
69
# This file is part of Eigen, a lightweight C++ template library # for linear algebra. # # Copyright (C) 2012 Keir Mierle <mierle@gmail.com> # # This Source Code Form is subject to the terms of the Mozilla # Public License v. 2.0. If a copy of the MPL was not distributed # with this file, You can obtain one at http://m...
ad8626ec1606b63d87fb211995d8af921d977de1278420d9884f0f6c02cdca5c
Python
2,371
77
import os import tempfile import pandas as pd from tests.mock_data import MockCvOutput, MockVisData from cuppa.visualization.visualization import CuppaVisDataBuilder, CuppaVisPlotter, CuppaVisData class TestCuppaVisData: EXPECTED_COLUMNS = pd.Series(( "sample_id", "data_type", "clf_group", "clf_...
ba59bda71a8a840f290f64e1c70b899952b5b839c769dc38e736df471b136bae
Python
2,371
90
# --- # jupyter: # jupytext: # cell_metadata_filter: -all # custom_cell_magics: kql # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.11.2 # kernelspec: # display_name: Python 3 (ipykernel) # language: python # ...
d02614eccf28b40670cadad87782797afbc16e9e72d4c63d56b8d543c590a8a1
Python
2,371
72
## # \file image_similarity_evaluator_test.py # \brief Test ImageSimilarityEvaluator class # # \author Michael Ebner (michael.ebner.14@ucl.ac.uk) # \date February 2018 import os import unittest import numpy as np import re import SimpleITK as sitk import pysitk.python_helper as ph import niftymic.base.stack as ...
626a6037d63b1c6947f7b536e2fbeafd859be5d79a2b8fc36e20fc66e166cbe1
Python
2,372
71
# Copyright 2016 Julien Danjou # Copyright 2016 Joshua Harlow # Copyright 2013-2014 Ray Holder # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
d97d88c1f9f1eaa4356f599db581bdcfaa79ae16d8da2c7551130b6072e18d9c
Python
2,373
66
from ruamel.yaml import YAML import sys import pandas as pd from parser_dicts_variables import dict_manifest_to_version def main(): # Read the information from the manifest with open('manifest.bioimage.io.yaml', 'r', encoding='utf8') as f: yaml = YAML() yaml.preserve_quotes = True mani...
ea7bc49df0fe7c62066ae71965ebb025e032ae00ee897ee0c324406ac1db7ab4
Python
2,373
94
""" Basic example of CCG learning in a CLEVR-like domain. """ from pyccg.chart import WeightedCCGChartParser, printCCGDerivation from pyccg.model import Model from pyccg.lexicon import Lexicon from pyccg.logic import TypeSystem, Ontology, Expression from pyccg.word_learner import WordLearner ######## # Ontology: def...
463beb8f180cb2a002835762dde11e135faae9ebbcf6d9da68d5f9cd9d486171
Python
2,374
72
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
812b9a7c6c1501442b642df222dd6da3164e249f6f078a4abd120856b0fae847
Python
2,375
69
import torch import torch.nn as nn import torch.nn.functional as F import math class DotProduct(nn.Module): def __init__(self, num_classes=1000, feat_dim=2048, bias=True): super(DotProduct, self).__init__() # print('<DotProductClassifier> contains bias: {}'.format(bias)) self.fc = nn.Linear...
ec01c8291f3634b26ed4f838aa3464ec7638f5fd7764120d7cd736319ad758bc
Python
2,375
55
#! /usr/bin/env python from lab.parser import Parser parser = Parser() parser.add_pattern('hc_iterations', 'iPDB: iterations = (\d+)', required=False, type=int) parser.add_pattern('hc_num_patters', 'iPDB: number of patterns = (\d+)', required=False, type=int) parser.add_pattern('hc_size', 'iPDB: size = (\d+)', requir...
f6905ea2a24ad2c58d61cc20dbdff28eefb6da81d10818f4fbd427000a467ce0
Python
2,375
116
"""Common slab workflows.""" from __future__ import annotations from typing import TYPE_CHECKING from quacc import subflow from quacc.atoms.slabs import make_adsorbate_structures, make_slabs_from_bulk if TYPE_CHECKING: from typing import Any from ase.atoms import Atoms from quacc import Job @subflow...
d7d6751be6aeef8f4e4ffa7ad23469d0168d2f5bfcce4eaf6a8d10976dcaae55
Python
2,376
73
#import tensorflow as tf import tensorflow.keras.layers as klayers import tensorflow.keras.regularizers as kreg import tensorflow.keras.initializers as kinit ''' VGG backbone (truncated) for Convolutional Pose Machines, Shih-En Wei, Varun Ramakrishna, Takeo Kanade, Yaser Sheikh https://arxiv.org/abs/1602.00134 '...
32a94b981ba65d471e43ca1b56d933db0763ea38bcdc7815c3802515aae4983f
Python
2,377
54
import os import sys import time datadir = sys.argv[1] # should point to the directory where the fast5 & reds dir exist model_name = 'sigmap' exedir = "../run_scripts/" # the path to HierarchyCall's test/run_scripts dir filtered_bonito_script_path = "../targetcall/run_bonito_params.py " # File Paths fast5_path = ...
6ae22b52e6c6216da1c23c8b4b2460e31625adfdd6d6244ca5a3647f642b17e1
Python
2,377
67
import os from torch.utils import data as torch_data from torchdrug import data, utils from torchdrug.core import Registry as R @R.register("datasets.HumanPPI") @utils.copy_args(data.ProteinPairDataset.load_lmdbs, ignore=("sequence_field", "target_fields")) class HumanPPI(data.ProteinPairDataset): """ Binar...
7fa5c7eb32ae1930292af6d267b973062809efc1bf765ebef89b25c7736bc237
Python
2,377
67
import os from torch.utils import data as torch_data from torchdrug import data, utils from torchdrug.core import Registry as R @R.register("datasets.YeastPPI") @utils.copy_args(data.ProteinPairDataset.load_lmdbs, ignore=("sequence_field", "target_fields")) class YeastPPI(data.ProteinPairDataset): """ Binar...
0888f0900af2249a12b4286ef6f0677621a3a51398164213d614e9f2f83df47a
Python
2,378
64
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
f19292e5dee9498746d431449ac437b57d8c6943c61bfc9ff9dfebba0464e2ea
Python
2,378
75
# # MIT License # # Copyright (c) 2022 GT4SD team # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge,...
f5567c655d5c80cfef21a1292b6f57c641d7a4f1fff0079d1e42ca256f99b543
Python
2,379
63
#!/usr/bin/env python # # Copyright 2015 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of...
e95c50d6eb2907d290d31c23c63fd119c0322101d1ede6a353c6731f9cca4342
Python
2,380
67
import os from torch.utils import data as torch_data from torchdrug import data, utils from torchdrug.core import Registry as R @R.register("datasets.PPIAffinity") @utils.copy_args(data.ProteinPairDataset.load_lmdbs, ignore=("sequence_field", "target_fields")) class PPIAffinity(data.ProteinPairDataset): r""" ...
1816167540977900b083e9265187947a20204d7fae8dd87935f561ef37d27498
Python
2,382
104
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np def alias_method(idx, probs, nsyn): """ Alias method for drawing random numbers from a discrete probability distribution. See http://www.keithschwarz.com/darts-dice-coins/ Parameters ---------- idx: np.ndarray compartmen...
2644163031ade5ad3047bd35fbf22d2031a47723f34a46740db72f0c06a1e2cf
Python
2,382
68
"""Test remove trend.""" # Authors: The PyPREP developers # SPDX-License-Identifier: MIT import numpy as np import pytest import pyprep.removeTrend as removeTrend def test_highpass(): """Test for checking high pass filters.""" srate = 100 t = np.arange(0, 30, 1 / srate) lowfreq_signal = np.sin(2 * ...
7bab25519f673b450f343c4535a70f601d19354e8613cdc67df94a09cfce5880
Python
2,382
74
from torch.utils.data import Dataset import numpy as np import pandas as pd from Bio.Seq import Seq from torch.utils.data import Dataset from utils import reverse_complement, encode_seq def read_coverage(asb_path: str, pos_fdr_upper: float=0.05, neg_fdr_lower: float = 0.5, for_eval: bool=False, eps: float=1e-10): ...
11bf178f4de1e841d5f0b603f255b8e4ec8f863e4aeeea2b9d6cff2a98aaf6b8
Python
2,383
78
import datetime import os import random import binutil from dreamcoder.dreamcoder import commandlineArguments, ecIterator from dreamcoder.grammar import Grammar from dreamcoder.program import Primitive from dreamcoder.task import Task from dreamcoder.type import arrow, tint from dreamcoder.utilities import numberOfC...
57dd116a9d4f49c6b6e39da9950af01ff73eaefbafc9c13acb0c50e6ba0258d2
Python
2,383
57
#! /usr/bin/env python # -*- coding: utf-8 -*- from downward import suites from lab.reports import Attribute from common_setup import IssueConfig, IssueExperiment REVS = ["issue648-base", "issue648-v2"] SUITE=suites.suite_optimal_strips() SUITE.extend(suites.suite_ipc14_opt_strips()) CONFIGS = [ # Test label re...
947bdfeffd89f6dd06d9ab5b64fc1ac16600ac03be13c76d0e3aa6926616a9bb
Python
2,383
73
import numpy as np from .timeIntegration import simulateBOLD class BOLDModel: """ Balloon-Windkessel BOLD simulator class. BOLD activity is downsampled to 0.5 Hz by default. BOLD simulation results are saved in t_BOLD, BOLD instance attributes. """ def __init__(self, N, dt, normalize_input=...
c62f4d33535aabbe76206f754cfa9b98aa26ca7beb3ab9fd49e87c7ac07c9c7b
Python
2,383
83
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
d61a25ad2b1d631a7512ca1adb27d11cb8e26250918b78d8672db25a6eb66155
Python
2,383
78
from distutils.errors import DistutilsOptionError from setuptools.command.setopt import edit_config, option_base, config_file def shquote(arg): """Quote an argument for later parsing by shlex.split()""" for c in '"', "'", "\\", "#": if c in arg: return repr(arg) if arg.split() != [arg...
3ab918f00534286f7d1253174db9709c0a7cfc47353ec22f2c396cef3b1ce2c9
Python
2,384
76
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, BaselSlurmEnvironment import common_setup from common_setup import IssueConfig, IssueExperiment from relativescatter import RelativeScatterPlotReport DIR = os.path.dirname(os.path.abspath(__file__)) BENCHMARKS_DI...
8fd42376adb14dcf0a8464b0bdf594276e201dcc5de38243602bb1d4897473e1
Python
2,384
83
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
e1e7479fa935891bdd1c18d5ae626a0b3a85836c2d1c19ec7272bc47ac72a8ae
Python
2,384
70
from typing import Callable from torch import Tensor from torch.nn import Module from .quantize_to_fixed_point import quantize_to_fxp_hte, quantize_to_fxp_stochastic from .two_complement_fixed_point_config import FixedPointConfigV2 def get_quantize_to_fixed_point( func: Callable[[Tensor, Tensor, Tensor, Tensor]...
2fcc3086baed21635152c5cbc160d7ccc19eacb84c62be22c5b9276a04634b46
Python
2,385
85
import networkx as nx import numpy as np from copy import copy import random import logging from hippo.environments.w_maze import get_wmaze from hippo.agents.replay_agent import ReplayAgent from hippo.environments.action_perception import action_perception_loop from hippo.environments.sequences import ( create_tra...
ddfb0b225d9a1d55c818210c7fa22509ea44b3e71d48afd0c6e8f36ea21ac833
Python
2,386
58
import torch import torch.nn.functional as F class DCS_multi_lay_resolution(torch.nn.Module): def __init__( self, input_channels: int = 128, output_channels: int = 10, num_blocks: int = 3, dilations: list = [3, 6, 9], kernel_size:int = 3, mode = "concat" ...
e2e62ea253c26b9ac27bd112543ea25949b2d0dc16aa384a2ae045ade4053237
Python
2,386
86
import torch import torch.nn as nn import torch.nn.functional as F def get_predictor(input_dim, p_type="elu", vi=True): if p_type == "elu": return EluPredictor(input_dim, vi) elif p_type == "identity": return IdentiyPredictor(input_dim) else: raise ValueError("Function type not kno...
87a0cf0bfeb9ec1ff451ea8b23dce69c7d2940acc9c707c540660b99b8c7130e
Python
2,387
95
""" .. _recording_example: Record from connected devices ============================= This example shows how to record video streams from a connected Pupil Core headset. .. note:: This example requires the dependencies for :ref:`streaming<streaming_dependencies>` and :ref:`recording<recording_dependenc...
3b9c79ffe2f8773a91d31682293ae4bf0c1b38350c32d37656baa034e58029d2
Python
2,388
68
import matplotlib matplotlib.use("Agg") import torch device = torch.device("cuda" if torch.cuda.is_available() else "cpu") import yaml, io with open("./config/DryBean_config.yaml", 'r') as stream: config= yaml.safe_load(stream) config["default_path"]= str(config["default_path"]) config["split"]= float(config...
3f592c52afe09f0441f462ef80149f3d0ce4c391cf78ee1d851c5773b0ac423a
Python
2,389
77
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, BaselSlurmEnvironment import common_setup from common_setup import IssueConfig, IssueExperiment from relativescatter import RelativeScatterPlotReport DIR = os.path.dirname(os.path.abspath(__file__)) BENCHMARKS_DI...
54188581a48e8d004d3d704268e76fe447596b974f25b8e082f1e690b4d41706
Python
2,389
73
import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from localization import Localization import mayavi.mlab import sys def load_surface(path_to_surface): """ Loads a surface file from disk with nibabel functionality, and returns a list of the points and faces in that file ...
6a8a3a9c76a5944e9502e808de4116e73c5c75328d2b22d5e1f5e2b3753515b4
Python
2,391
66
""" Optuna example that demonstrates a pruner for LightGBM. In this example, we optimize the validation accuracy of cancer detection using LightGBM. We optimize both the choice of booster model and their hyperparameters. Throughout training of models, a pruner observes intermediate results and stop unpromising trials....
acfc850a5e76758f62f23e5b7c36d49f62eba007452cb1b499628339759efc07
Python
2,391
68
extensions = dict( required_params=['x', 'event_column', 'training_frame'], validate_required_params=""" # If x is missing, then assume user wants to use all columns as features. if (missing(x)) { if (is.numeric(event_column)) { x <- setdiff(col(training_frame), event_column) } else { x <- s...
3719b6773ab2f711b387594b6661c2cbadd544d59552b765130ea5cf3a12e906
Python
2,392
68
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
384ad84aa2d6a86583ddc4041563820e8de94083fcc88561124cc5528f12ef4b
Python
2,392
62
import numpy as np import torch class BerPossionLoss(): def __init__(self, num_nodes, num_edges): self.num_nodes = num_nodes self.num_edges = num_edges self.num_possible_edges = num_nodes**2 - num_nodes self.num_nonedges = self.num_possible_edges - self.num_edges edge_prob...
d33f4360dc5381c72be5936e75183226519d70a266a06a24a183a8370d835c26
Python
2,392
98
# Node-group asset "Integer Distance" (GeometryNodeTree), dumped by nodebpy.assets.dump_library. # Rebuild the library with nodebpy.assets.build_library (nodebpy build). # _build_group() is the source of truth: the docstring, __init__ and accessors are regenerated from it on the next dump. from typing import TYPE_CHECK...
dc82aa7cfb705ec55b3a0a59eb58d2850985bc18f66b58ba86418ae61c5038d3
Python
2,392
70
# # MIT License # # Copyright (c) 2022 GT4SD team # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge,...
eca03564716189c29f08266d7feeb69517220f96e9752e078882dad85e13b1d4
Python
2,392
54
# MEGIT model inference batch processing script # This script will process ALL subfolders import sys import os sys.path.append(os.getcwd()) import argparse from keras.models import load_model from megit.model.pred import default_model, inference import warnings # CLI inputs parser ----------------------...
425913a94fb601cb801781dffb81e4d58379d380f363c1c41de04d7f05cf566f
Python
2,393
74
#! /usr/bin/env python # -*- coding: utf-8 -*- import itertools import os from lab.environments import LocalEnvironment, MaiaEnvironment from downward.reports.compare import ComparativeReport import common_setup from common_setup import IssueConfig, IssueExperiment, RelativeScatterPlotReport DIR = os.path.dirname...
2c215e4a25fe7cd42e03ce214a1a63fed595f199c64ff2807941545d8d8e9098
Python
2,394
77
#! /usr/bin/env python # -*- coding: utf-8 -*- #! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, MaiaEnvironment import common_setup from common_setup import IssueConfig, IssueExperiment, get_algo_nick, get_repo_base from relativescatter import RelativeScatterPl...
88daa8e949790b14b67e19b7ad56ef01e6756db962ac09c0066509356a2e5669
Python
2,394
61
from ase.io import read import numpy as np import torch from torch.utils.data import DataLoader from ..data import ASEData, ASEDBData, atoms_collate_fn from tqdm import tqdm def eval(model, data_loader, properties, device): output = {prop: [] for prop in properties} target = {prop: [] for prop in properties} ...
98e72453e56cceacfecf9eb7a69a89adf5b6cc6114cee2aba34a3083116cc004
Python
2,394
74
"""CLI for extracting and preprocessing a subset of data in sleeplab format.""" import argparse import json import logging from pathlib import Path from sleeplab_format.extractor import config, preprocess from sleeplab_format import reader, writer logger = logging.getLogger(__name__) def extract(src_dir: Path, dst...
a33c1fc15ae844661bc583dadedcb3a3e1637cfb83da87c3054f79434a768fc4
Python
2,394
68
"""Hub header badge: background loading + update-available indicator.""" import pytest @pytest.fixture(scope="module") def _qapp(): try: from PySide6.QtWidgets import QApplication except Exception as exc: # pragma: no cover pytest.skip(f"PySide6 unavailable: {exc}") return QAp...
23de562c131719cd5a5ecabc12c5d427413dce9d2226ba76cfec5953a74a15fe
Python
2,395
95
from collections.abc import Callable from typing import Any, cast import torch from torch import nn import elasticai.creator.ir as ir from elasticai.creator import function_dispatch as FD dgraph_handlers: list[Any] = [] node_handlers: dict[str, Any] = {} def _register_dgraph(fn: Any) -> Any: dgraph_handlers.ap...
6a4c5ff56ef3bbbb04984dc371bea42079476581bf47597df9fac5c6eeb8ba9a
Python
2,395
73
import os import torch import pytest import numpy as np @pytest.fixture(scope="session", autouse=True) def set_seed(): np.random.seed(42) # noqa: NPY002 import logging from ase.io import read from quacc import get_settings from pathlib import Path from ts_workflow_examples.geodesic_ts_without_hessian.using_ne...
efe7609818ddbae971f7a477977eb14527bf2d846b0aa6ff165cf921a9a67c66
Python
2,395
92
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
d4263cef607ea5d07f230fa6eebd0d4547bbf07d66f7a06b978fb5a895df49be
Python
2,396
80
# Import libraries import numpy as np import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import Dataset, DataLoader import torch.nn.functional as F import matplotlib.pyplot as plt import os import pickle import numpy as np from sklearn import metrics from sklearn.model_...
07ae76bd4863a099e05e5ebc88c342e993082e0dd0173d22631693c7e86c8c10
Python
2,397
68
# Copyright (c) 2022, Ko Sugawara # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and t...
4004b4c634ddb9099d0cb4c64d856484aa51f925a3879eee5bc0ccea5d7fd7e3
Python
2,397
52
""" toposampling - Topology-assisted sampling and analysis of activity data Copyright (C) 2020 Blue Brain Project / EPFL & University of Aberdeen This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation...
55e6081b29e41854faccdb23df07a7d8b12e69a1ba4e8d56501dee3363cdf845
Python
2,397
81
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
c1f9a8784c58ff8439729347581c3f17df3d90cd9a84a99ac167a951b9cde6bb
Python
2,397
80
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
1f4fdfe2e4305c932984a89261a71d3ea6384423ba88932d1ec26f0dee243924
Python
2,398
77
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
88a410528488297a3bced36ab218f10dc5bd18512ef3a01418a830605548e5c4
Python
2,398
66
# Copyright (C) 2017 Sarah Parisot <s.parisot@imperial.ac.uk>, , Sofia Ira Ktena <ira.ktena@imperial.ac.uk> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or ...
162e9050cdeafcbc6efcf4ee1a08254c75f95589df9370c92101e1290cddcda9
Python
2,400
74
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, BaselSlurmEnvironment import common_setup from common_setup import IssueConfig, IssueExperiment from relativescatter import RelativeScatterPlotReport DIR = os.path.dirname(os.path.abspath(__file__)) BENCHMARKS_DI...
29e3a78d7258abcffe1ad740eee9b7dff10d6263de172595e93ad8934047fe71
Python
2,400
59
import pandas as pd import numpy as np import os celltype_list = ['ASC', 'EX', 'IN', 'ODC', 'OPC', 'MG'] Trans_df = pd.read_csv('../chromVAR/Motif_Trans.txt', sep='\t', header=None) Trans_dict = dict(zip(Trans_df[0], Trans_df[1])) # Peak Motif colocation Information (based on hg38) Motif_Peak_df = pd.read_csv('Motif...
69c1c693955a42210a53e7c3832df86add796ec9d3405d6bead9ff3fa33ace61
Python
2,400
80
import argparse import os import sys from enum import Enum import coglet class Mode(Enum): PREDICT = "predict" TRAIN = "train" def __str__(self) -> str: return str(self.value) if __name__ == "__main__": parser = argparse.ArgumentParser(description="Cog HTTP server") parser.add_argument...
a057bd7b695f8667ef4daf0ee06c6472727fde67e748de666f4b097219c95a7c
Python
2,401
57
from typing import Dict, Union, List from ..base_transform import EEGTransform class BaselineRemoval(EEGTransform): r''' A transform method to subtract the baseline signal (the signal recorded before the emotional stimulus), the nosie signal is removed from the emotional signal unrelated to the emotiona...
45ac13ca543cc1ca3eddca41dafad8e62035386d2835e732028bbe5de5363230
Python
2,402
85
"""Class to run generic commands in a subprocess.""" from __future__ import annotations import os from contextlib import ExitStack from pathlib import Path from shlex import split from subprocess import PIPE, CompletedProcess, run from typing import TYPE_CHECKING, ClassVar, Final from quacc.runners._base import Base...
92e733be4ba79090fdc71c0e83948ce4162bfc751f88878cf507df94a5e026e2
Python
2,402
63
import sys import os # Add the parent directory to the sys.path parent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) sys.path.append(parent_dir) # Now you can import the function from the script from PyUtilities.setupFunctions import read_config_file import pandas as pd import os # open expor...
afe1171d50a4af5b22f4592a9af512c8761abde80c1d5e882dceadb33e2502e5
Python
2,402
61
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, MaiaEnvironment from common_setup import IssueConfig, IssueExperiment, is_test_run BENCHMARKS_DIR = os.environ["DOWNWARD_BENCHMARKS"] REVISIONS = ["issue535-v1", "issue535-v2"] CONFIGS = [ IssueConfig( ...
e91d9f50c1c7d4dad68ab6a2505433b7847f39f36e2b5bb670c92f7da4d9268b
Python
2,402
61
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, MaiaEnvironment from common_setup import IssueConfig, IssueExperiment, is_test_run BENCHMARKS_DIR = os.environ["DOWNWARD_BENCHMARKS"] REVISIONS = ["issue535-v2", "issue535-v3"] CONFIGS = [ IssueConfig( ...
fcf29bdcee083edb2b80751aa3688f18b056a17849b95a9fdc613fc10cc18405
Python
2,402
61
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, MaiaEnvironment from common_setup import IssueConfig, IssueExperiment, is_test_run BENCHMARKS_DIR = os.environ["DOWNWARD_BENCHMARKS"] REVISIONS = ["issue535-v3", "issue535-v4"] CONFIGS = [ IssueConfig( ...
3352fca9457bedc38bbfcdda812061c94034f36f7e966a29fd30771a2acbff55
Python
2,403
86
#!/usr/bin/env python # Copyright (c) 2019 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ This module provides the key configuration parameters for an XML-based scenario """ import carla class ActorConfigurationData(objec...
88304f6235a39eb83dad805d30175e4d97ef8a695eabf032303d6536a1db0fae
Python
2,403
101
import random import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F def set_global_seed(seed: int) -> None: """ Sets random seed into PyTorch, TensorFlow, Numpy and Random. Args: seed: random seed """ torch.manual_seed(seed) torch.cud...
3ac5c2860e3706853229ecc3b55d4b4c6bd7504431a3719a972bfee0c8124051
Python
2,404
75
import os import sys sys.path.append(os.path.abspath('../')) from multiprocessing import Lock from model.KuramotoClassFor import Kuramoto import concurrent.futures import itertools import gc import numpy as np import scipy.io as sio import csv import matplotlib.pyplot as plt import time import model.parserConfig as p...
5b1f18b24283a7b2c8b0374faa6102ce427f1c8128b986d01ee539446d361c4a
Python
2,404
61
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, MaiaEnvironment from common_setup import IssueConfig, IssueExperiment, is_test_run BENCHMARKS_DIR = os.environ["DOWNWARD_BENCHMARKS"] REVISIONS = ["issue535-base", "issue535-v1"] CONFIGS = [ IssueConfig( ...
66a2f0bd2cf14152b1da9e29d962a8ada5d8d1aae039856307237556c3adaa7e
Python
2,404
68
"""Qt-free completeness checks for the registration help content.""" import pytest # The option keys each GUI control offers (must match the combo `data` keys in # registration_tab.py / batch_2d_tab.py). If a combo gains/loses an option, # update HELP and this expected set together. EXPECTED_KEYS = { "met...
96665b1c13d4489180bbbb1ce68f1611a05371955bca3f85313aec683a0f593d
Python
2,404
76
import pandas as pd import pytest from cuppa.sample_data.sample_metadata import SampleMetadata, TrainingSampleSelector metadata_df = pd.DataFrame( [ [0, "Breast", "Breast: TNBC", 0], [1, "Breast", "Breast: TNBC", 76], [2, "Breast", "Breast: TNBC", 151], [3, "Breast", "Breast: TNBC...
070d663c684bf176ca18bcab775fcb22a8bd57b6f1f056d3370f9f763d6ac189
Python
2,405
94
from __future__ import annotations from importlib.util import find_spec from pathlib import Path from typing import TYPE_CHECKING from monty.dev import requires from quacc.runners.ase import BaseRunner has_phonopy = bool(find_spec("phonopy")) has_seekpath = bool(find_spec("seekpath")) if TYPE_CHECKING: from c...
1d9a22e50ffe8941f1d998091397bcdf4f86f631aeae52b0f3f19f7a890944ee
Python
2,406
41
import pandas as pd import seaborn as sns import numpy as np import sys sys.path.insert(0, r"C:\Users\ICN_guest\Desktop\ui") import gaussianize def gaussianize_data(data, column_name): out = gaussianize.Gaussianize(strategy="brute", max_iter=200, verbose=True) out.fit(data[column_name]) data[f"{column_na...
293b59ac075e5b2b16d84156ebc5c314ae1f6de96d15021bb6c8ea16562903c4
Python
2,406
69
import torch import pytorch_lightning as pl from typing import Any, Callable, Tuple class TrainingWrapper(pl.LightningModule): def __init__(self, net: torch.nn.Module, loss_fun: Callable, metric: Callable, lr: float=0.01, weight_decay: float=1e-4, momentum: float=0.9, gamma: flo...
e15c0d0d87b0b925ac2c951399b28e81a354c24b29bbe018c6ffba127800e13b
Python
2,406
69
extensions = dict( set_required_params=""" parms$training_frame <- training_frame args <- .verify_dataxy(training_frame, x, y) parms$ignored_columns <- args$x_ignore parms$response_column <- args$y """, module=""" #' Extracts the best R2 values for all predictor subset size. #' #' @param model is a H2OModel wit...
3076d3bcc5c58f1f4abb8c0670f7d42e6bac292e7459e9c541e9a3e3608002cd
Python
2,407
63
from ..neuralnodes import utils, func import numpy as np from .params import Params def run_model(stim: np.ndarray, p: Params, fs: float = 1_000, verbose_output: bool = False, return_dict: bool = False): # --- STIMULUS ----------------------------------------------------------- try: p = Params.from_li...
ccab2e895e5e991a6dd4d33dd36338131427ade6b9dc00810031ea54479bd2d5
Python
2,407
78
from __future__ import annotations import re from typing import Any from wikibaseintegrator.datatypes.basedatatype import BaseDataType from wikibaseintegrator.wbi_enums import WikibaseSnakType class URL(BaseDataType): """ Implements the Wikibase data type for URL strings """ DTYPE = 'ur...
519c89c650e12684b04796c25f6dc8f8d7810b6ad9b83fd14fb20befbb115c21
Python
2,408
84
import tensorflow as tf import math #KL(N_0|N_1) = tr(\sigma_1^{-1} \sigma_0) + # (\mu_1 - \mu_0)\sigma_1^{-1}(\mu_1 - \mu_0) - k + # \log( \frac{\det \sigma_1}{\det \sigma_0} ) def all_pairs_gaussian_kl(mu, sigma, add_third_term=False): sigma_sq = tf.square(sigma) + 1e-8 #mu is [batchsize x dim_z] #...