sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
15881acaee54a7301c5b3afde64afd350c12058088153a991ae4ac36f8bb9fe7 | Python | 7,785 | 249 | from __future__ import division
import os
import numpy as np
import pandas as pd
from helper_lib import filelib
from SPHARM.classes.node import Node
def extract_node_names(inputfile, outputfile=None):
"""
Extract the names of the nodes from vrml file.
Parameters
----------
inputfile : str
... |
b718ac10e5bbf35a17a6d4d2856eae470b6412214b1b8ebefc17aedd00c1c391 | Python | 7,792 | 198 | # SPDX-License-Identifier: LGPL-3.0-or-later
import torch
from deepmd.dpmodel.long_range.kernel import (
COULOMB_CONSTANT,
)
from deepmd.dpmodel.long_range.latent_charge import (
LatentChargeLongRange as LatentChargeLongRangeDP,
)
from deepmd.pt_expt.common import (
torch_module,
)
from deepmd.pt_expt.fitt... |
4004307845d909cb683ed35b6cf05e2ea96fd38107b981d6e615fd329a5033e5 | Python | 7,800 | 229 | # this software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#python detect_terminals.py --fg ../uemura-sensei/2018_corrected_terminals/Fused_180130_ppkGal4_UAS-mCD8GFP_TrpA1K_8Y_4_A3m/F... |
da14ae5a9b9fb0fe00dd3c94a07080f24c759535c812c27c81f7cc7cda355dd7 | Python | 7,800 | 244 | # -*- coding: utf-8 -*-
#
# digitalConfocal documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration value... |
efb300df79e93d6013ce57246e2570a07e06da2bb87d67642e899f850b1e14e7 | Python | 7,801 | 244 | # Copyright 2026 DeepMind Technologies Limited
#
# 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 applicable law or agr... |
b1900b2241b38891342e9835317099fc5a27fa7dda3ba93dc5ce89bd514681a4 | Python | 7,803 | 181 | from IPython.core.debugger import set_trace
from src.utilities.DDE_Solver import ddeinttf
import src.utilities.findiff.findiff_general as fdgen
import src.kdv_burgers_eqn_case.kdv_burgers_eqn as burg
import numpy as np
import scipy as spy
import tensorflow as tf
import matplotlib.pyplot as plt
from matplotlib import ... |
fd40c3517344eda5fd9ff4a27b996127fb224e6d80031e48326f9c84f8c8958d | Python | 7,804 | 215 | import argparse
import datetime
import json
import os
import time
import tqdm
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from atom3d.datasets import LMDBDataset
from scipy.stats import spearmanr
from model import CNN3D_LBA
from data imp... |
dfcb8822b998dfbe7012e868effd642ea68d5c6815054b38a9f7b0319292a9d5 | Python | 7,806 | 231 | from __future__ import print_function
import re
import os
import sys
import tempfile
import subprocess
import multiprocessing
import multiprocessing.pool
import dxpy
def normalize_timedelta(timedelta):
"""
Given a string like "1w" or "5d", convert it to an integer in seconds.
Integers without a suffix are... |
8e4b4b255a0c38b9dfb5273538ab5179b99d47705be0e834bb06cdae6c1560eb | Python | 7,815 | 213 | # SPDX-License-Identifier: LGPL-3.0-or-later
import os
import unittest
from typing import (
Any,
)
from unittest.mock import (
patch,
)
import array_api_strict as xp
from deepmd.utils.batch_size import (
AutoBatchSize,
)
from deepmd.utils.errors import (
OutOfMemoryError,
)
class CustomizedAutoBatch... |
30da49db5e919b4dc804c606bd74e8227ff2c9ed73db0c49fd8330541131b632 | Python | 7,816 | 215 | """Tests for source/fishers_exact.py.
Covers the graph-building / connected-components helpers (``FET_graph``,
``FET_bfs``, ``FET_connected_components``), the chrom-to-CC translator
(``FET_sample_to_chrom_to_CC``), and the Fisher's-exact-test wrapper
(``calculate_FET``) on small synthetic RBH tables.
"""
from __future... |
511bb68aa6f49b531d38c76923a4fee0b3adc4ddb72118e6c8d2d1b3561d8a19 | Python | 7,816 | 257 | # Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
import numpy as np
import logging
"""This module contains learning-to-rank met... |
046c2f53a339192695ae8f8f6ff0c3b6df5ce66042fd36cb80a0f5bf0e46c85c | Python | 7,819 | 176 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright © 2023 Charles E. Vejnar
#
# 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 https://www.mozilla.org/MPL/2.0/.
#
"""Extract & rename proj... |
9afdc49080b17daba1f351e5f1dcdf14bf26d772cecf47650b66c8ef86bc93ee | Python | 7,820 | 236 | import os
import sys
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(parent_dir)
from seas.domains import get_domain_map, domain_map, \
rolling_mosaic_movie, mosaic_movie, get_domain_edges, save_domain_map
from seas.hdf5manager import hdf5manager
from seas.defaults import ... |
45169f129f1186ab17353e3e86a6ed7f76bdce52301cc7fd4b97609106fc439a | Python | 7,822 | 193 | # Copyright (c) ONNX Project Contributors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import pytest
import onnx
from onnx import helper, numpy_helper, parser, printer
def print_initializer(initializer: onnx.TensorProto) -> str:
"""Print a graph holding `initializ... |
bc70f31977eb2c708c9c8775f6bd06e2d1c33e5b9b31dc60798953b68cead3b5 | Python | 7,826 | 231 | # Copyright 2026 DeepMind Technologies Limited
#
# 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 applicable law or agr... |
9a7b1afa872bfb4afbda08603b5a25565b7049a28b50b856950cf004ad42822e | Python | 7,827 | 169 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import shutil
import numpy as np
import ray
from mprl.utility_services.payoff_table import PolicySpec
from mprl.utility_services.worker import LearnerManagerInterface
from ... |
1f94b0c210f7b771ce100453783f8e2650a19cc27f310164ad3e28cb5737a93a | Python | 7,828 | 237 | # Copyright 2019-2021 The ASReview Authors. All Rights Reserved.
#
# 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 appl... |
2d2f1abd99dbf8571254de3b714a5fddf75a15d55df1382188a1e6f1f29430d1 | Python | 7,829 | 231 | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.reference.ops.op_rotary_embedding import rotary_embedding
class Ro... |
8b5d703da500b57e5b4c57630e449dc786b659f07e556fcf31648171ffd85d09 | Python | 7,833 | 225 | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# 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 appl... |
b8c5848bddd578f48e4976a25393d901b5255816323bb81ba51c687788ced917 | Python | 7,833 | 234 | # Copyright 2018-2025
# Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH
# 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/LICE... |
aa7eea31ad2296887414b211348cc744ac4d64325750cb6a633bc2a0e3aaf2c5 | Python | 7,835 | 190 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Assemble per-node force and virial from a per-edge gradient g_e = dE/d(edge_vec).
The autograd that produces g_e (grad(E, edge_vec)) is wired in the torch/jax
backend later; this pure-array-API assembly is shared by all backends.
Conventions (see the unified edge-nlist ... |
edf84ec2767f2e0912bf9567df0a9adef11b17beef0b83cd158857ad1d6d722e | Python | 7,837 | 205 | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# 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 appl... |
8c92aa69d973159e32a490c9685fa46da72731a9c1f25d6a69b4df4987fd85c6 | Python | 7,840 | 244 | # -*- coding: utf-8 -*-
#
# abcd_paper documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values hav... |
2595ff135bda535f10ef9441c9a1ffffb87896254db946c222a8f8e51ae1dd3a | Python | 7,843 | 207 | #!/usr/bin/env python3
"""Check that the documentation matches the Baysor CLI and config parser.
Run from the repository root (no Baysor build needed):
python docs/tools/check_cli_docs.py
The checker fails (exit code 1) when:
1. the docs mention a ``--long-option`` that none of the documented command
line to... |
699c4291b6c166b839317cee383a129f48b159047af06b21923e69ab4f7e85f1 | Python | 7,844 | 242 | # -*- coding: utf-8 -*-
#
# ANLffr documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 6 11:21:20 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... |
d75e02101b7fb2ea2fe55016716d432ede44d6af4928338f1f1e9e192ea692d2 | Python | 7,855 | 248 | # Copyright 2026 DeepMind Technologies Limited
#
# 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 applicable law or agr... |
9a18c436637204f2f86be04a382576818645b874ced9e584241b59fc0b29330c | Python | 7,858 | 292 | # Copyright 2026 DeepMind Technologies Limited
#
# 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 applicable law or agr... |
2464171f2f5b00b1722e055d8b938f4c06d41089b72d081cfb631f63f5391cf5 | Python | 7,861 | 223 | import cv2
import numpy as np
import torch
def visualize_cam(mask, img):
"""Make heatmap from mask and synthesize GradCAM result image using heatmap and img.
Args:
mask (torch.tensor): mask shape of (1, 1, H, W) and each element has value in range [0, 1]
img (torch.tensor): img shape of (1, 3, ... |
1a974236e44409715d2e1b561187b2bf7ede9e6c197b89b1bfd7a59850f21163 | Python | 7,869 | 233 | # Copyright (c) OpenMMLab. All rights reserved.
import argparse
from functools import partial
import mmcv
import numpy as np
import onnxruntime as rt
import torch
from mmcv.onnx import register_extra_symbolics
from mmcv.runner import load_checkpoint
from mmcls.models import build_classifier
torch.manual_seed(3)
de... |
897b9fcbc7da9d733689591190a5899abdcf922dad0ed5d4b7fb67ab162609ce | Python | 7,870 | 222 | from __future__ import annotations
from collections.abc import Callable
from typing import Any
from typing import Literal
import numpy as np
import pytest
import optuna
from optuna import Study
from optuna.study import create_study
from optuna.testing.visualization import prepare_study_with_trials
from optuna.trial ... |
88443b428314256e32aef949b2b18eb969c1320fd5b19650466bbdff3a38d9c8 | Python | 7,874 | 145 | import numpy as np
from numba import types, jit, prange
from stratego_env.game.stratego_procedural_impl import _get_state_from_player_perspective, _get_valid_moves_as_1d_mask, \
_get_partially_observable_observation, _get_fully_observable_observation, _get_valid_moves_as_spatial_mask, \
_get_action_1d_index_fr... |
73594369d65b04c9fd7fc77728c51da31df65b1107e1f2c778a3ed6b7f97cd48 | Python | 7,875 | 270 | import numpy as np
import matplotlib as mpl
from distutils.version import LooseVersion
import nose
import matplotlib.pyplot as plt
import nose.tools as nt
import numpy.testing as npt
from .. import rcmod, palettes, utils
class RCParamTester(object):
def flatten_list(self, orig_list):
iter_list = map(np... |
9553c71c95335cc1ffb03bf9a0554292c9cd2e7a402f71690a28a160c098c196 | Python | 7,877 | 238 | # Copyright 2026 DeepMind Technologies Limited
#
# 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 applicable law or agr... |
1c7f03530b6eecb1ddba27194f61cb5556c893e5b564ed91f9d07928b9adbe80 | Python | 7,881 | 181 | # Copyright (c) ONNX Project Contributors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
from onnx.reference.op_run import OpRun
def _unpack_3d_to_4d(x: np.ndarray, num_heads: int) -> np.ndarray:
"""Reshape (B, T, H*D) -> (B, H, T, D)."""
b, t, hd = x.shape
... |
88126a15703aeadb516049605acae8021662965cecc9d41803fdac80e63385e6 | Python | 7,881 | 223 | # Copyright 2026 DeepMind Technologies Limited
#
# 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 applicable law or agr... |
6f8222a29773bc20c64dc6e67b2b45650ef81f9926d8eba282a8680e178402d5 | Python | 7,883 | 259 | # Copyright 2019-2026 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
import logging
import numpy as np
"""This module contains learning-to-rank me... |
38bf393075ab5e051bce8a04ae0a8a040e8e7a5f0a4201f02324b999875effda | Python | 7,884 | 194 | import random
import numpy as np
from PIL import Image
from math import *
from skimage.transform import AffineTransform, warp
from skimage.transform import rotate as rotate_transform
import torch
import torchvision.transforms.functional as TF
from torchvision import transforms
torch.cuda.empty_cache()
class... |
4e4c4bc171f4f084742a6b43a9c2e6b3019176a53d5d7830ffc2b5b9926740b0 | Python | 7,885 | 318 | """Tests for STRAY outlier estimator."""
__author__ = ["KatieBuc"]
import numpy as np
import pytest
from sklearn.preprocessing import MinMaxScaler, RobustScaler
from sktime.detection.stray import STRAY
from sktime.tests.test_switch import run_test_for_class
@pytest.mark.skipif(
not run_test_for_class(STRAY),
... |
6ee770eefd3cbc9e4740a6f49212bb62dc384620158c45f280abe3f5639a39b1 | Python | 7,901 | 236 | # Copyright 2026 DeepMind Technologies Limited
#
# 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 applicable law or agr... |
0051f0e9c8b69edc9a457fa5d53740d4cf16199ce9834250c0ea6bf133eff914 | Python | 7,902 | 189 | """
@file: binaryio.py
Created on 01.04.2021
@project: CrazyAra
@author: queensgambit, maxalexger
Contains the main class to communicate with the C++ binary.
"""
import logging
import time
from subprocess import PIPE, Popen
from dataclasses import fields
from DeepCrazyhouse.configs.rl_config import UCIConfig, UCIConf... |
57ff1299470e6192517e7f273ad4f92b2024c40ab0e639cbf30f61cfc6ff1d20 | Python | 7,903 | 189 | """
@file: binaryio.py
Created on 01.04.2021
@project: CrazyAra
@author: queensgambit, maxalexger
Contains the main class to communicate with the C++ binary.
"""
import logging
import time
from subprocess import PIPE, Popen
from dataclasses import fields
from DeepCrazyhouse.configs.rl_config import UCIConfig, UCIConf... |
6ff6af112040dbfa3e2baa452ef0c694b51cb124f85f8622cbf8bba1056a2325 | Python | 7,903 | 176 | import numpy as np
from numpy import ma
import SimpleITK as sitk
from scipy.ndimage.filters import gaussian_filter
from skimage import morphology
from skimage.filters import threshold_otsu
from skimage.transform import resize, rescale
from ..lddmm._lddmm_utilities import _validate_ndarray
def correct_bias_field(imag... |
f5a1841aeaa377cf13779168ea46ad9f6e9f9287427dd04691b978095ca88a0c | Python | 7,909 | 169 | import torch
from torch import nn as nn
from vp_suite.base import VPModelBlock
class SpatioTemporalLSTMCell(VPModelBlock):
r"""
Spatio-Temporal LSTM Cell (v2) as introduced in
"PredRNN: A Recurrent Neural Network for Spatiotemporal Predictive Learning" by Wang et al.
(https://arxiv.org/pdf/2103.09504... |
eae2a13a748a0b532b1339da51e695b8f0d318c8364a83ac6da0798bb0fe2f99 | Python | 7,910 | 212 | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import warnings
__all__ = [
"registry",
]
import typing
from typing import Any, Protocol, TypeVar
import google.protobuf.json_format
import google.protobuf.message
import google.protobuf.text_fo... |
3ff96f6bcb511564bd686639c21cc1a665b3bc48797773c0ab890fd79f15022e | Python | 7,914 | 231 | # SPDX-License-Identifier: LGPL-3.0-or-later
import logging
from typing import (
Any,
)
import torch
from deepmd.dpmodel import (
FittingOutputDef,
OutputVariableDef,
fitting_check_output,
)
from deepmd.pt.model.task.fitting import (
GeneralFitting,
)
from deepmd.pt.utils import (
env,
)
from ... |
f9c87d734517a320a1f633e74012d69d81a3e8c7fc8596992b7f7a5405d6e46b | Python | 7,914 | 272 | import urllib.request
from pathlib import Path
from unittest import mock
import pytest
import requests
from genomic_benchmarks.loc2seq.loc2seq import EXTRA_PREPROCESSING
from genomic_benchmarks.utils.datasets import (
_check_dataset_existence,
_download_url,
_fastagz2dict,
_get_dataset_name,
_get_r... |
e312b28b18d17de7e90c6b2b3d282344bec4b06dd1f23481b029339a6106660c | Python | 7,916 | 228 | import os
import sys
import logging
import argparse
import numpy as np
file_path = os.path.dirname(os.path.realpath(__file__))
lib_path = os.path.abspath(os.path.join(file_path, '..', '..', 'common'))
sys.path.append(lib_path)
work_path = os.path.dirname(os.path.realpath(__file__))
from .file_utils import get_file
... |
cefd862013147284f222ed6ac809f7273c7b65ad7b262e62429239264f0c22b9 | Python | 7,923 | 258 | import matplotlib as mpl
import numpy as np
import seaborn as sns
from matplotlib.colors import ListedColormap
from matplotlib.patheffects import Normal, Stroke
from matplotlib.transforms import Bbox
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
def shrink_axis(ax, scale=0.7, shift... |
a714487e12eee82bcae7f086f0ec7830bc01576833f120920188a7bb9a3a5e36 | Python | 7,926 | 229 | import inspect
import logging
from abc import abstractmethod
from collections.abc import Sequence
from typing import Any, Generic, Union
import torch
from torch.nn import Parameter, ParameterList
import flair
from flair.data import DT, Sentence
log = logging.getLogger("flair")
class Embeddings(torch.nn.Module, Gen... |
35fe8e7d9a5b461fdaa08e7e7018d92cbdb898138bac6ec6f27e737e58fbcfa4 | Python | 7,930 | 273 | # Copyright 2026 DeepMind Technologies Limited
#
# 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 applicable law or agr... |
db84209ef19f0ec3c2ebb28823163dc4cf7b0178c760a0b28c6076b9f79f2e4a | Python | 7,935 | 198 | from __future__ import print_function
import os, sys, pickle, pprint
import numpy as np
import pyqtgraph as pg
from .. import AUDIT_TESTS
class UserTester(object):
"""
Base class for testing when a human is required to verify the results.
When a test is passed by the user, its output is saved and used... |
da049da05cad7bf6bc94406afb2551571e6718f491778dfcc1c1545f9e382095 | Python | 7,941 | 217 | import tensorflow as tf
from keras import backend as K
from keras.callbacks import ModelCheckpoint, Callback
from keras.callbacks import TensorBoard
from keras.callbacks import ReduceLROnPlateau
import h5py
#
# Copyright @ Yanqiu Feng
# Laboratory for Medical Imaging and Diagnostic Technology
# Southern Medical Univer... |
dd20fe7416e3b12037897313bccdc08f4aaff3405db331616c28b4cc16d78992 | Python | 7,944 | 240 | # Copyright 2019 DeepMind Technologies Limited
#
# 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 applicable law or agr... |
118fcf007f29f33f54a7e0643e0e1f00c85b749fb2d151d3aef1151735b7ca15 | Python | 7,947 | 222 | """Tests for fault-tolerant benchmark execution."""
import logging
import pandas as pd
import pytest
from sklearn.metrics import accuracy_score
from sklearn.model_selection import KFold
from sktime.benchmarking.benchmarks import FailedExperimentRecord
from sktime.benchmarking.classification import ClassificationBenc... |
2f05ef2eb28bb4e727b92d5697504e1ee820f547960bf1c0caf2e8415c7be91a | Python | 7,949 | 219 | import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import pytest
from distutils.version import LooseVersion
import nose.tools as nt
import numpy.testing as npt
from numpy.testing.decorators import skipif
from .. import distributions as dist
try:
import statsmodels.non... |
6c8a196817b412b2646f1ffe770dc1adc1baf573c3aad5e2ebae59cfb4261c3f | Python | 7,949 | 193 | """
T2 / R4 -- necessity of strategy sharing for a pass@k inversion.
T6 -- group size G shifts the crossing budget k*.
T2 : with per-prompt INDEPENDENT (tabular) softmax policies and exact gradient
flow, the success prob p(x) is nondecreasing for every prompt, so
Δ_k = E[(1-p0)^k - (1-pτ)^k] >= 0 for ... |
a6c30d84f1ec4aeaecb22f75cc86365f61f0822cd7b9d3e6b60eb908785ad4c7 | Python | 7,951 | 231 | import pytest
import pandas as pd
import numpy as np
import scanpy as sc
from anndata import AnnData
import os
import tempfile
import anndata
import warnings
import palantir
@pytest.fixture
def sample_data():
"""Load the sample data from the data directory"""
# Get the data directory relative to the test fil... |
8cb053282614f8d108967b6b20174d25d13ccdc15fb9fbd74be1362763221e1a | Python | 7,955 | 227 | #!/usr/bin/env python
import sys
import os
import math
import re
from os.path import isfile, join, isdir
from kn_common import pipetools,pipedef
from kn_pipeline_class import CPipeError,CPipeStep
class CPipeStepStitch3D(CPipeStep):
reg_name = "img3D_bg_TC_org.nii.gz"
reg_channel=1
def progress_update(self,tx... |
99081d26aea5a095348fee8d3956ac7882e2a646b2f0f1d2f8d079aaa0acc8ec | Python | 7,957 | 255 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Declarative architecture tables for named DPA4-family model presets."""
from typing import (
Any,
)
# fmt: off
PERIODIC_TABLE: tuple[str, ...] = (
"H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al",
"Si", "P", "S", "Cl", "Ar", "K", "Ca", ... |
654a74bb9ec7671d027e4b9d7295d467bac91c056dc027294ca04985033819a4 | Python | 7,960 | 174 | # Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#import tensorflow as tf
import tensorflow.compat.v1 as tf
from .EmbeddingMode... |
619d2390c14ad83ac0a4e5a8fe7e44709f6b7fda9c83cf305b4b48c135b15336 | Python | 7,963 | 185 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements adapter for sklearn distances."""
__author__ = ["fkiraly", "Z-Fran"]
__all__ = ["_SklearnDistanceAdapter"]
from inspect import signature
import numpy as np
import pandas as pd
from sktime.datatypes import convert
class _SklearnD... |
8d92c22db9fe5b46069e7ea892a157508262dc0e27e57eb55e491a46c37b10a0 | Python | 7,976 | 213 | # Copyright (c) ONNX Project Contributors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
from onnx.reference.op_run import OpRun
from onnx.reference.ops._op_common_indices import _get_indices, _is_out
def _col2im_shape_check_2d(X, output_shape, kernel_shape, dilations, ... |
079d560e3ad71968f4d850e536457517b067919a2268674eddd7c72c7559b7a5 | Python | 7,991 | 206 | # Copyright 2019 DeepMind Technologies Limited
#
# 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 applicable law or agr... |
e0298f7435782c27952963ec82515e3c4484122a6c1a4c3959cfff35a685e080 | Python | 7,993 | 139 | """
Analyze the data we collected in the component comparison test
William Nourse
December 16th 2021
"""
import pickle
import numpy as np
import matplotlib.pyplot as plt
test_params = pickle.load(open('variant_benchmark_data/test_params.p','rb'))
num_neurons = test_params['numNeurons']
data = []
data.append(pickle.l... |
dd0abba43a0dee711a1ba68e89c280ce34f6fa2f781d218163621c79ef50e4ba | Python | 7,994 | 231 | """
Uses simulation to try and estimate the effective degrees of freedom
of the CNN used by MINE in the 1-predictor case on random-wave stimuli
and responses as used in cnn_sta_test.py, by estimating the covariance
between changes in true outcomes y drawn from N(0,s) and the changes
in their prediction.
See eq. (7.33; ... |
0c625b1ed5e18c7ebeab03c344989594cea3b46c38e78f471892d546368aa3e3 | Python | 7,996 | 198 | from __future__ import print_function
import os, sys, pickle, pprint
import numpy as np
import pyqtgraph as pg
from .. import AUDIT_TESTS
class UserTester(object):
"""
Base class for testing when a human is required to verify the results.
When a test is passed by the user, its output is saved and used... |
139966f3184b7c59bee6dfb1bc899cc82fa2da50567080c2ce8930ccd062f511 | Python | 8,001 | 236 | import ast
import os
import os.path as osp
from collections.abc import Sequence
from typing import List, Tuple, Union
import dill
import numpy as np
import pandas as pd
import torch
import torch.utils.data
from sklearn.model_selection import train_test_split
from torch import Tensor
from torch_geometric.data import He... |
9e35a2f5f0c00a954459ed9f35b372189f95fca699aeca55888ba1f989fecd1a | Python | 8,001 | 234 | # SPDX-License-Identifier: LGPL-3.0-or-later
import copy
from deepmd.dpmodel.atomic_model.dp_atomic_model import (
DPAtomicModel,
)
from deepmd.dpmodel.atomic_model.pairtab_atomic_model import (
PairTabAtomicModel,
)
from deepmd.dpmodel.descriptor.base_descriptor import (
BaseDescriptor,
)
from deepmd.dpmo... |
e79e40ac58cf3bcfb9fe1764cdbbe382f99337c77e1388d5df6d5e58402767b3 | Python | 8,002 | 204 | """
@file: puzzle_to_planes_converter.py
Created on 05.04.24
@project: DeepCrazyhouse
@author: queensgambit
Format
Puzzles are formatted as standard CSV. The fields are as follows:
PuzzleId,FEN,Moves,Rating,RatingDeviation,Popularity,NbPlays,Themes,GameUrl,OpeningTags
Sample
00sHx,q3k1nr/1pp1nQpp/3p4/1P2p3/4P3/B1P... |
9bb99a44a27fa603a700defdb9062b7a72edfbd43645d8105c9d6f3fbdc92535 | Python | 8,008 | 135 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 16 14:16:35 2018
@author: tpisano
"""
import os, sys
from tools.utils.io import makedir, load_dictionary, load_np, listdirfull
from tools.registration.transform_list_of_points import create_text_file_for_elastix, point_transformix, modify_transform... |
039a5de9b1c396717b8e30a15217d32c64911b9ffa11c5f0d2ae399d75c6fec0 | Python | 8,009 | 150 | from __future__ import print_function
# from os import listdir
import pickle
import numpy as np
import string
import random
from sklearn import linear_model, svm, ensemble, neural_network
from stageLabelAndOneHot import restrictStages
from fileManagement import getEEGAndFeatureFiles, findClassifier, writeTrainFileIDsUs... |
ded5211eaa7484f875593a881dfef2d1e401abb3bf8f574fd8084587c27a9129 | Python | 8,011 | 181 | # Copyright (c) ONNX Project Contributors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import string
from typing import TYPE_CHECKING, Any, Literal, cast
import pytest
import onnx
from onnx import TensorProto, ValueInfoProto, helper, shape_inference, version_converter
if TYPE_CHECKING:
... |
6f3c5633d474f8c4284dcd8bf13d8ec4f5de043314e2f79c76110441fa6f4879 | Python | 8,013 | 192 | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 req... |
abb2e1500a8ecece7b7e7554b8feb44cc7a4dcd44b568ec63c11eaf83a6f8add | Python | 8,029 | 234 | # Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#import tensorflow as tf
import tensorflow.compat.v1 as tf
import numpy as np
i... |
93cc590fa9a2c6e6c5386c33d15bd6cd27409e8d35ad918ff81e5dfb610d0184 | Python | 8,036 | 231 | # Copyright 2019 DeepMind Technologies Limited
#
# 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 applicable law or agr... |
595f018d9606e5e919da13cccc5a94ee2f4fd9e166ba1104ce95d0be2ba59f0d | Python | 8,041 | 205 | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# 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 appl... |
e1cfc5d3f5e70099716b839385f09a01240b51be6d9acda51f208d219dd4d4b7 | Python | 8,043 | 211 | # Script to voxelize data based on a real point cloud acquired from a vision sensor.
# Uses ZoomOut to compute corresponding points between the point cloud and a template.
# It is assumed that the point cloud is cleaned, segmented and rigidly aligned with the template.
import sys, os
import argparse
import numpy as n... |
848415b5320cc932fdc5f18cdfa63759ed11fcd7aeb791c2ee7b66f4638d6226 | Python | 8,051 | 196 | #!/usr/bin/env python3
"""Build a portable Baysor release archive for one platform.
python3 packaging/build_release.py --platform linux-x86_64|macos-arm64|windows-x86_64
Steps: check out and bootstrap vcpkg at the ref in packaging/vcpkg-ref,
configure with the matching `release-<platform>` CMake preset (dependenc... |
9f3d7bfe616207dddee9f5337e604823745e8a2886d64b0e8d4da3597ec01e23 | Python | 8,054 | 182 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import shutil
import numpy as np
import ray
from mprl.utility_services.payoff_table import PolicySpec
from ray import tune
from ray.rllib.utils import try_import_tf
from ra... |
3b6661ea5897161fd5fe169a88e7cf86b4dc8b66bcbac4a2da4271b3c9eb4b14 | Python | 8,057 | 235 | # Copyright 2019-2020 The ASReview Authors. All Rights Reserved.
#
# 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 appl... |
9b6d783fc56929fe406f0d8840f86b1e05920801c60cf975d9becffc277fa34b | Python | 8,058 | 196 | import os
import logging
from tqdm import tqdm, trange
import numpy as np
import torch
from torch.utils.data import DataLoader, RandomSampler, SequentialSampler
from transformers import BertConfig, AdamW, get_linear_schedule_with_warmup
from model import RBERT
from utils import set_seed, compute_metrics, get_label
l... |
571f6def5c1fac60440c14a581785fae7a54ddcb320233f4176b5d04cdb3fa76 | Python | 8,059 | 234 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 3 16:15:31 2019
@author: skibbe-h
"""
#pip install matplotlib scipy nibabel
from nibabel import gifti as gi
import nibabel as nib
import os
import numpy as np
import matplotlib.pyplot as plt
import scipy.io as sio
#import scipy
#import skimage
fro... |
3384e98fdc2f5510ba7b98b554d010918a23ba8dff39a318159d4f89d018ca18 | Python | 8,060 | 244 | """This module contains functions that will help to perform symmetry
operations and anhilations using the point group symmetry matrixes
"""
from fractions import Fraction
from itertools import combinations
import numpy as np
DIM_DICT = {"x": np.asarray((1, 0, 0)), "y": np.asarray((0, 1, 0)),
"z": np.asarr... |
03ede5ae2174a939ebe0daa8a90089ba1710c25c82c51f02f0f6fc233d8566c0 | Python | 8,063 | 215 | """Tests for state-aware private BaseForecaster methods."""
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
__author__ = ["SimonBlanke"]
import numpy as np
import pytest
from sktime.forecasting.dummy_global import DummyGlobalForecaster
from sktime.forecasting.naive import NaiveForecaster
fro... |
0af149bfde34c21c736af8444169d38ee78312ad19a22b98569a94a51f2df847 | Python | 8,065 | 220 | # Copyright 2018-2025
# Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH
# 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/LICE... |
01cc3cf31fe1acfa6b673fb6dabd752e89583ed56a9ae11099ff984be6dfd0cd | Python | 8,066 | 240 | #!/usr/bin/env python
import click
from click_option_group import optgroup
import json
import numpy as np
import os
import pandas as pd
import shutil
import sys
sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])),
os.pardir))
sys.path.insert(0, os.path.join(os.... |
b9f08327d2261e3fc37b768982cdcffc76ee7ed4c9f2cdb214293a1859e04b10 | Python | 8,068 | 179 | from rdkit import Chem
import argparse
from tqdm import tqdm
import multiprocessing
from rdkit import RDLogger
lg = RDLogger.logger()
lg.setLevel(RDLogger.CRITICAL)
def canonicalize_smiles_clear_map(smiles,return_max_frag=True):
mol = Chem.MolFromSmiles(smiles,sanitize=not opt.synthon)
if mol is not None:
... |
239a6ccca12ebf2697addd416fe3bc219c39d1a37fe90fe77447e53912d06f69 | Python | 8,069 | 181 | # -*- coding: utf-8 -*-
#
# Copyright © 2013 Charles E. Vejnar
#
# 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 https://www.mozilla.org/MPL/2.0/.
#
"""Interface with the `GeneAbacus <https://git.... |
8128357a60cfa1ac2e86648e2212fd7d261e1116e223a00c11777bbec388e27b | Python | 8,069 | 276 | # Copyright 2018-2026
# Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH
# 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/LICE... |
db9b4b1800881aca398da24f9259e08e3832b9f1261a5bd2dd51f2cb609d6897 | Python | 8,078 | 204 | from .triplet_loss import batch_hard_triplet_loss
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
""" model structure of MUSE """
def structured_embedding(x, y, z, label_x, label_y, label_z, dim_latent, triplet_margin,
n_hidden, weight_penalty, triplet_lambda):
"""
Constru... |
1339722f341cb1fb26012b6c239c9593c72fa6bf2587c763601f62c02ea776da | Python | 8,079 | 178 | """
Paper figures for Section 2.
Fig 1 (iconic): the price frontier -- pass@1 gain vs first-crossing k*, as the
per-prompt floor gamma sweeps 0->1, for one representative
inverting instance. Marks GRPO (gamma=0) and gamma=0.9,0.99,1.
Fig 2: pass@k curves base/RL, regime A (crossover) vs ... |
42af03e11cfd49fd195cbb175bb18dfd6d475650461986a6d8d3be98b155a81c | Python | 8,081 | 171 | """
T1 / T3 / T4 / bridge -- SETUP results (verified, but SCOOPED by Winner-Take-All
and Rad et al. 2026b; presented in the paper as reproduced context, not as our
contribution). We still verify them numerically as requested.
T1 mirror-descent tilt is exact (machine error); GRPO deviates by a bounded TV.
T3 entropy ... |
7c2c571f8b557910870dd4f16a1d2f07e43ad5f7eb3bbca36286d25af3877b91 | Python | 8,085 | 246 | # SPDX-License-Identifier: LGPL-3.0-or-later
import os
import unittest
import numpy as np
from deepmd.utils.spin import (
Spin,
env_protection_descriptors,
normalize_spin_use_spin,
)
CUR_DIR = os.path.dirname(__file__)
class EnvProtectionDescriptorsTest(unittest.TestCase):
def test_hybrid_only_conf... |
ccba78ed67c4c002aa2c84674f12852f960da578a837210ae957c9c667e6e6a3 | Python | 8,089 | 237 | # Copyright 2019 DeepMind Technologies Limited
#
# 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 applicable law or agr... |
31c7fe6aa02947d33511bb6d5efad3dcee020f5c7eba2af1dffc3575d1e9fc09 | Python | 8,094 | 189 | # Copyright 2019 DeepMind Technologies Limited
#
# 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 applicable law or agr... |
15d890fa986ed7d10138d4763c7fc2d0d3c8d750d5c267cd8f3b4310d2fa3a7f | Python | 8,095 | 264 | import numpy as np
import pytest
import torch
import torch.nn as nn
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import EpochBasedRunner, IterBasedRunner, build_optimizer
from mmcv.utils import get_logger
from mmcv.utils.logging import print_log
from torch.utils.data import DataL... |
3a90bfba0beec632be2a1319e9319b4100c56b1830034771d8e85cfe3be4370e | Python | 8,095 | 292 | import argparse
from multiprocessing import Manager
import os
from pathlib import Path
import warnings
import hydra
from joblib import Parallel
import numpy as np
import pandas as pd
import pytorch_lightning as pl
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning.utilities.warnings import ... |
94a9749b1bbc24c30369cd9509c741d15fdbe636cc41c2a66f6b05495eac64c9 | Python | 8,095 | 205 | __author__ = ["chrisholder", "TonyBagnall"]
from typing import Any
import numpy as np
from sktime.dists_kernels._numba_distances.base import DistanceCallable, NumbaDistance
class _TweDistance(NumbaDistance):
"""Time Warp Edit (TWE) distance between two time series.
The Time Warp Edit (TWE) distance is a d... |
8a9e7ed2491c6e690759204ccb1cd37326b20da6cba34d1d38a8ea36c6fc9366 | Python | 8,099 | 217 | # Copyright 2022 DeepMind Technologies Limited
#
# 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 applicable law or agr... |
8ca9d7ef33fb5f32f459d1b37e098dc7ae2cafc051a4d97184cf04c6f79e180f | Python | 8,101 | 309 | """
dict_key_definitions.py
Dictionaries are used to define simulations and models. Keys are
defined here as 'constants' so that keys can be consistently used
without fear of an incorrect keys creating silent bugs where default
values are used.
Only keys are specified, default values should be set by the relevant
sc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.