sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
46614f671f24ae99c47c247bf3c6d3190a9cd33044a37a0cfc077edb5afc6c20 | Python | 23,614 | 580 | # Copyright (c) 2021 PaddlePaddle 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 appli... |
90022f6b2e1094ffd671e12af1443b9952db72648427a77b84c32cab38f5bb39 | Python | 23,661 | 666 | # Script containing the modular version of the code
# so far we have only implemented the non_linear_embedding layer
# for simplicity we can just use dense layers for the merge operations
import numpy as np
# import matplotlib.pyplot as plt
import torch
import h5py
import torch.nn as nn
from torch.utils import data
... |
65f6137b4c07dfaedc61830e6af3fa457c172f1b118f039eb173b58846eabd06 | Python | 23,690 | 673 | """Principal Component Analysis on Manifolds.
Lead author: Nina Miolane.
"""
import numbers
import random
from math import log
from scipy.special import gammaln
from sklearn.base import BaseEstimator
from sklearn.decomposition._base import _BasePCA
from sklearn.utils.extmath import stable_cumsum, svd_flip
import ge... |
f2031a0ffc1ec17c9236d65f5716db050a8d4e2fe5621210c95c988b7e3ed562 | Python | 23,709 | 578 | # Copyright (c) 2024 PaddlePaddle 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 appli... |
9886063a3a65bf57c4b671f67a0ea1b5c432c2cf2daa6b7bc8d5770d7d2bee18 | Python | 23,724 | 544 | # Copyright © 2023 German Cancer Research Center (DKFZ), Division of Medical Image Computing
#
# SPDX-License-Identifier: Apache-2.0
import nibabel as nib
from nibabel.affines import apply_affine
from skimage.morphology import binary_dilation, binary_closing
from sklearn.svm import SVC
from dipy.segment.clustering imp... |
08b2d31c7d70b4a2be0ec0e46e0f53e79be39d655277f38693067a13beaa4b1d | Python | 23,742 | 646 | """Network io"""
# Authors: Rajat Partani <rajatpartani@gmail.com>
# Mainak Jas <mjas@mgh.harvard.edu>
# Nick Tolley <nicholas_tolley@brown.edu>
# George Dang <george_dang@brown.edu>
import json
import numpy as np
from copy import deepcopy
from collections import OrderedDict
from pathlib im... |
f25cbaec70e804c9a7a1029c7fe89df1ac2b73a045ac78566ceb1325b3e6766e | Python | 23,773 | 510 | import tensorflow as tf
import numpy as np
from scipy import ndimage, misc
from scipy.io import loadmat
from tensorflow_addons import image
from tensorflow_addons.image import translate
import random
import glob
from matplotlib import pyplot as plt
class BatchLoader(object):
def __init__(self, image... |
cd034d75e661e1f63247d5e1f3a83c1d38b5d80af314b0287115fcc0f7ad3a39 | Python | 23,777 | 542 | import cv2
import math
import numpy as np
import time
from scipy import signal
from scipy import special
import multiprocessing as mp
import pyfftw
import h5py
import os
from scipy.io import loadmat
import sys
from cpuinfo import get_cpu_info
from suns.PreProcessing.par1 import fastexp, fastmask, fastlog, \
fastco... |
bfd6a8803a509308e181523cce0d746b2879c50dc1ea52738bdf742601dfef16 | Python | 23,829 | 587 | """Provide standalone modeling and inference functions for Adjacency matrices.
Each function takes an Adjacency instance as its first argument (`adj`).
"""
import numpy as np
def _bootstrap(
adj,
statistic,
*,
n_samples=5000,
confidence_level=0.95,
return_samples=False,
n_jobs=-1,
ra... |
c8767fbe448672ea9d3a5bea431234947b472f8c31e9b7da260ef0791132a084 | Python | 23,845 | 564 | import pandas as pd
import numpy as np
import wget
from zipfile import ZipFile
from DeepPurpose.utils import *
import json
import os
'''
Acknowledgement:
The BindingDB dataset is hosted in https://www.bindingdb.org/bind/index.jsp.
The Davis Dataset can be found in http://staff.cs.utu.fi/~aatapa/data/DrugTarget/.
The... |
24003065f9e615383ed6b34e02d1eb3f98da369e98558c73aebd2d7645fc0336 | Python | 23,871 | 561 | """Data alignment — SRM, Procrustes, and state alignment."""
import numpy as np
from joblib import Parallel, delayed
from scipy.linalg import orthogonal_procrustes
from scipy.optimize import linear_sum_assignment
from scipy.spatial import procrustes as procrust
from sklearn.metrics import pairwise_distances
from sklea... |
a3f36f6c7e1265f60e36a99e59b30e1d9cb4a2a4fa610dcac0214138e18a35df | Python | 23,899 | 735 | import logging
import multiprocessing
from multiprocessing.connection import Connection
import multiprocessing.context
import time
from typing import Generator, Callable, List, Tuple, cast
from uuid import UUID
from hypothesis import given
import hypothesis.strategies as st
import pytest
import chromadb
from chromadb.a... |
058f0dc9e8eefc38daa40bd3948b01e94aa7fff51f1a3415200bb265914b64f6 | Python | 23,972 | 705 | # %%
"""
#### ## ## ######## ####### ######## ######## ######
## ### ### ## ## ## ## ## ## ## ## ##
## #### #### ## ## ## ## ## ## ## ##
## ## ### ## ######## ## ## ######## ## ######
## ## ## ## ## ## ## ## ... |
d694332852b310d58000e1955711f00af91500558774621f339f5f9047bbca81 | Python | 23,988 | 680 | from typing import Optional, Union, Tuple, List, Sequence, Iterable
import numpy as np
import torch
from scipy.spatial.distance import euclidean
from torch.nn.modules.utils import _pair
import torch.nn as nn
from torchvision import models
from ..learning import PostPre, Triplet, LearningRule, AntiHebb, wSTDP
from ..n... |
5e830d38458bb8ad314fba79742826993725c8755c1298cbda8e182297c57ff5 | Python | 24,029 | 605 | #!/usr/bin/env python3 -u
# 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.
"""
Train a new model on one or across multiple GPUs.
"""
import argparse
import logging
import math
import os
impor... |
1832fa98cb5b75173200295c249d98b9698525387b302a370c041ac4d2f1bf41 | Python | 24,042 | 603 | ################################################################################
# Import, Set up MPI Variables, Load Necessary Files
################################################################################
import os
from os.path import join
import sys
import matplotlib
import matplotlib.pyplot as plt
from matp... |
4ebe84b95aeac73db850d07874b61fbdc8db34bf629e4e2772ff753b3430bfa3 | Python | 24,065 | 347 | #!/usr/bin/env python3
from lib.designer_input_utils import *
from lib.designer_func_wrappers import *
from lib.gnc import resolve_gnc_request, run_gnc_precorrection
def usage(cmdline): #pylint: disable=unused-variable
from mrtrix3 import app #pylint: disable=no-name-in-module, import-outside-toplevel
cmdlin... |
0b4df671cff5293930588433ae3aeca86dfc8fca364b9ea55d0a9e52e7a9e159 | Python | 24,124 | 482 |
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this so... |
3a71dd32c5f104e023f062bcb3da2100af186852eb2e316eb5fe0b0c25a6c71a | Python | 24,125 | 571 | from io import open
import numpy as np
import struct
from .trees.SharedTrees import BundleHeader, BundleItems, UserParamDescrType, LockInParams_v9, AmplifierState_v9, UserParamDescrType, Description, \
cstr, MarkerRootRecord, MarkerRecord, get_stim_to_dac_id, get_data_kind
from .readers import stim_reader
from .rea... |
93dee29007d3ba6070331590fe7215642bec3de51233ec3e57afbea5b55302f7 | Python | 24,132 | 679 | """Utilities for converting Snakemake apps to BIDS apps."""
import json
import logging
import re
from collections import defaultdict
from pathlib import Path
from typing import Dict, Generator, Iterable, List, Optional, Tuple, Union, overload
import more_itertools as itx
from bids import BIDSLayout, BIDSLayoutIndexer... |
a9eaabbb1eeff7c9e92244cb4801a4d89adb77d6c80560c956e9d271366b2e23 | Python | 24,153 | 585 | import logging
from collections.abc import Iterable
import cv2
import numpy as np
from scipy.spatial.distance import cdist
from idtrackerai import Blob, ListOfBlobs, ListOfFragments, Session
from idtrackerai.utils import track
from .erosion import compute_erosion_disk, get_eroded_blobs
def set_individual_with_iden... |
23d7feb3c6b544b456609593ba62cc7819ca3ea56d35a578312a899004914a70 | Python | 24,186 | 630 | # Authors: Mainak Jas <mainakjas@gmail.com>
from glob import glob
import matplotlib.pyplot as plt
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from hnn_core import CellResponse, read_spikes
from hnn_core.network_models import default_cell_metadata
@pytest.mark.para... |
a7f4b55a65d9b559de32a3d84d3ffa0a34de65bfaf8713c0fe444ebca70523ff | Python | 24,214 | 723 | # system
import time
import copy
import warnings
from typing import Any, Tuple, Literal
# sci
import numpy as np
from scipy.optimize import least_squares
from scipy import stats, signal
import pandas as pd
# ml
from sklearn.neighbors import LocalOutlierFactor
from sklearn.decomposition import PCA
from sklearn import ... |
015603dc7939ad4da612ba2ffd26e0444918ce172b13360e4362dce022a572da | Python | 24,215 | 618 | #!/usr/bin/env python
# coding: utf-8
# Copyright (C) 2022-2024 TU Darmstadt
# SPDX-License-Identifier: Apache-2.0
# -----------------------------------------------------------
# Primary author: Phillip Rieger <phillip.rieger@trust.tu-darmstadt.de>
# Co-authored-by: Torsten Krauss <torsten.krauss@uni-wuerzburg.de>
# ... |
6bde690f84469da92c07bcafaf973b171f2895c59632e9e7601b3f1b5bec06ac | Python | 24,241 | 621 | import gc
import math
import os.path
from uuid import UUID
from contextlib import contextmanager
from chromadb.api.segment import SegmentAPI
from chromadb.db.system import SysDB
from chromadb.ingest.impl.utils import create_topic_name
from chromadb.config import System
from chromadb.db.base import get_sql
from chroma... |
b49c7bd045881aeffdfc2b2f5fdf4e6b3c2e1242a8ce339ddc7a00e53536e8ec | Python | 24,268 | 673 | # Copyright (C) 2020-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# Co-authored-by: Brandon Edwards <brandon.edwards@intel.com>
# Co-authored-by: Anindya S. Paul <anindya.s.paul@intel.com>
# Co-authored-by: Mansi Sharma <mansi.sharma@intel.com>
from clip_optimizer import ClipOptimizer
from copy import... |
23b1d3954fea334aaeb019761af56d27b3a4b4527d19c21c2eed43b896c98c30 | Python | 24,352 | 633 | from collections.abc import Iterator, Sequence
from functools import cached_property
from statistics import fmean
from typing import Any, Literal
import numpy as np
from . import conf
from .utils import deprecated
class Fragment:
"""A collection of :class:`Blob` s that belong to the same animal or to the same c... |
f09007dfad33ec5aa0b31a744787c3a6f70cf37c8add9b86f85d7929e718c998 | Python | 24,355 | 598 | """The accelerated backends reproduce the committed CPU e3nn references.
`tests/backends/backend_parity.py` already checks that a freshly built model
survives the round trip e3nn -> backend -> e3nn *in one process, on one
machine, against a model built beside it*. That is a self-consistency check:
if the e3nn side mov... |
5e9e2ebf9ea3daa55b98a1893f9db9928011163fdcad135384c828e18f1828b1 | Python | 24,371 | 612 | #!/usr/bin/env python3
import threading
import typing
import warnings
from typing import Any, Callable, Dict, List, Tuple, Union, cast
import torch
from torch import Tensor, device
from torch.nn import Module
from captum.attr._utils.batching import _reduce_list, _sort_key_list
from captum.attr._utils.common import _r... |
e1332245ed521ea643a6f8cb11a3e6553ee479ef2c8b9cd35c9d17a064c427eb | Python | 24,394 | 638 | # Copyright (c) 2021 PaddlePaddle 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 appli... |
fdd6ccc4596b81f9491c3d68d24e87b72a44927a7329384a65b2e3240dfbb6c2 | Python | 24,429 | 600 | # Copyright (c) 2024 PaddlePaddle 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 appli... |
d011fd3063d74ef91b497ad62e05e05a7779f6327fed32dbdc61c3fed5a89bef | Python | 24,469 | 941 | # Copyright (c) 2020 PaddlePaddle 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
#
# Un... |
c6702613aead20a308f83327cb09805669dc2a799366f2097432f7466b6f3d85 | Python | 24,474 | 659 | ###########################################################################################
# Implementation of different loss functions
# Authors: Ilyes Batatia, Gregor Simm
# This program is distributed under the MIT License (see MIT.md)
################################################################################... |
c49bf520df379702e453e07d8c81b951e7184c3d9cdafd14263c29417cefe915 | Python | 24,551 | 636 | import os
import numpy as np
import seaborn as sns
# import matplotlib as mpl
# mpl.use('TkAgg')
import pandas as pd
from matplotlib import pylab as plt
from minepy import MINE
from sklearn.decomposition import PCA
from scipy.stats import pearsonr
from .ConvNet import load_model
from .train_eval import evaluate_fold... |
8575acc596aa62c54900b09f9271e7cc89e222b23a8ab33dff4fa3b3bfbbd1b8 | Python | 24,592 | 647 | import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from simplification.cutil import simplify_coords
import scipy as sc
import seaborn as sns
import analysis_plot as ap
import functions as fc
import plotting_help as ph
# ------------------ Plotting parameters -------------... |
a4c8338eabb9c3f6bc399fc779f093bfec505689c0532a8dfa008c3b489e8f92 | Python | 24,608 | 781 | """The vector space of symmetric matrices.
Lead author: Yann Thanwerdas.
"""
import geomstats.backend as gs
from geomstats.geometry.base import (
DiffeomorphicMatrixVectorSpace,
LevelSet,
MatrixVectorSpace,
)
from geomstats.geometry.diffeo import Diffeo
from geomstats.geometry.euclidean import EuclideanMe... |
9701839b3eb5d6c540d787a400045c956214a63c4e0da749d372e3813b14ee53 | Python | 24,610 | 632 | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
# Modified by Ke Sun (sunk@mail.ustc.edu.cn)
# ------------------------------------------------------------------------------
from ... |
8f638fe537dc9b27b554731591d2931796a89a4a086dc01220d0ed426a998bb0 | Python | 24,621 | 612 | """The feature-inventory gate, as a test so CI fails when a feature has no row.
It runs in the per-PR ci-core `unit` job, which already collects this directory:
the row has to be written by the pull request that adds the feature, because a
nightly only ever reports it late, and by then the row is written after the fac... |
30c5b32d8497a2ff27a08a4b277ab8bd8871951b94ff05efd1d551610077e1e3 | Python | 24,627 | 581 | import os
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.ticker import MaxNLocator
from scipy.spatial.distance import cdist, directed_hausdorff
from ..utils import elements
from ._molecule_graph import MoleculeGraph
class GraphStats:
"""
Gather statistics on graph predictions divided int... |
21d40433ab7fa7db6dd37a46c87f4a019b08f684c14171c93ba9c227fcf8a50c | Python | 24,675 | 629 | # Copyright 2020-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Collaborator module."""
import importlib
import logging
from enum import Enum
from os.path import splitext
from time import sleep
from typing import List, Optional
import openfl.callbacks as callbacks_module
from openfl.databases impor... |
284e8c81a64a6c53a6be9c0fed719f741cc2baff3c65cd1079ba40b893a47627 | Python | 24,692 | 616 | """
GENERATOR
====================
Generator and Rollout models.
This module is slightly modified from Gabriel Guimaraes and
Benjamin Sanchez-Lengeling original implementation (which is
also a slight modification from SeqGAN's model).
Carlos Outeiral has handled some issues with the Rollout efficiency,
removed dupl... |
607fb23f8dbe6347eb8fc26ee1b76f745b0cc17e0421fbf13b728639093b1014 | Python | 24,704 | 517 | import random
import coloredlogs
import hydra
import yaml
from omegaconf import OmegaConf
from sklearn.metrics import roc_auc_score, balanced_accuracy_score, \
mean_squared_error, cohen_kappa_score
from tqdm import tqdm
# from common import copy_src
from common.ece import ECELoss, AdaptiveECELoss, ClasswiseECELos... |
2d9e4b614792e6ae51ca25a8b2b191a572291e9c01b71bfd0dc45317d95584f4 | Python | 24,716 | 652 | # copyright (c) 2022 PaddlePaddle Authors. All Rights Reserve.
# 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 applicabl... |
bd21fb7babac42ba195a0fcd870effa36c27901085948e29db822b4b8342508d | Python | 24,741 | 151 | from PymoNNto import *
#https://github.com/crypto-code/Hopfield-Network/blob/4cc079d14c97157503567ea8fbdf6582b13ae140/network.py#L93
#from mnist.loader import MNIST # pip install python-mnist
#mndata = MNIST('../../../MNIST/')
#data = mndata.load_testing()
#mnist_pictures = data[0]
#mnist_labels = data[1]
#print(mn... |
b4b0c4fd77597e7e285b2b60dd53daf641a67fee8b36fbc33b9ad0638f9ab648 | Python | 24,810 | 717 | # Copyright (c) MACE contributors
# Script for exporting MACE-Polar density coefficients to Gaussian cube files
# This program is distributed under the MIT License (see MIT.md)
# pylint: disable=wrong-import-position
import argparse
import json
import os
import tempfile
import warnings
from contextlib import contextman... |
aba0d216ce9856d3190193f749914d482cdf49a31ff3847fdf01b7a0a6a94997 | Python | 24,826 | 965 | # -*- coding: utf-8 -*-
"""Symmetry_PINNs_updated.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1MYtbtLTBgCt0gQXo67LB7Ew0devS6pa_
"""
# ============================================================
# ONE-CELL S-PINN TRAINING CODE FOR FOUR SYMMETRY CASE... |
04d5860f87e7cfd8ed03d1cb75dd91d8101067d406117d1f3f872bb12b810b4e | Python | 24,860 | 681 | from typing import TYPE_CHECKING, Optional, Union, List, cast, Dict, Any, Tuple
from chromadb.api.models.CollectionCommon import CollectionCommon
from chromadb.api.types import (
URI,
CollectionMetadata,
Embedding,
PyEmbedding,
Include,
IndexingStatus,
Metadata,
Document,
Image,
... |
18134d1d93c90e7516c1d75e9cdfe7ea14ce837cd5f1cf73ceecda7186db9c5f | Python | 24,925 | 596 | # Copyright (c) 2021 PaddlePaddle 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 appli... |
f2c4692923a1f54f574c9c3ec89d427c870806aaaf1060d041cd07ee8108f026 | Python | 24,935 | 565 | """
Spectronaut PTM Data Processing Module.
This module provides functionality for processing post-translational modification (PTM) data
from Spectronaut, a mass spectrometry data analysis software. It handles mapping of peptide
sequences to protein sequences, position calculation, and sequence window generation ... |
d591f37ac94d521814b093041d0da3ca706b2b889e1aa212d34bd0f2b1b8d891 | Python | 24,947 | 669 | #!/usr/bin/env python3
#
# Sniffles2
# A fast structural variant caller for long-read sequencing data
#
# Created: 28.05.2021
# Author: Moritz Smolka
# Contact: moritz.g.smolka@gmail.com
#
from dataclasses import dataclass
import re
import itertools
import pysam
#for: --dev-cache
import os
import sys
import pickle
#... |
c8191ef6d88594223557ed458ecf30d4f98e48b209464eccefe725185c512a78 | Python | 24,992 | 811 | import argparse
import json
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib.colors import to_rgba
from matplotlib.ticker import PercentFormatter
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from helper_functions import ( ... |
c561eed96232a6709ce7e62876c3d003b846a097b9c1703d905a6aa86010091b | Python | 25,009 | 632 | # Copyright (c) 2019 PaddlePaddle 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
#
# Un... |
d8f07cff42f8a4a0b64eceeaa7ff94d79ffd24653fe97924bdd7d2dff32664ca | Python | 25,037 | 703 | # 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.
import logging
from pathlib import Path
from typing import Any, Dict, List, Optional
import torch
from torch import Tensor
from fairseq impo... |
66d0ec4c7f4167009fc334fe6f68265d069ea4fc88eb1c5c3fd20ada37f8612b | Python | 25,074 | 575 | import warnings
import numpy as np
import nibabel as nb
import pytest
from nltools.data import BrainData
from nltools.mask import create_sphere, roi_to_brain
class TestBrainDataAnalysis:
@pytest.mark.slow
def test_extract_roi(self, sim_brain_data):
"""Test ROI extraction with different methods and l... |
b9062c7895cd5dcfcd80094c3f5ca84a253aebf094cc2b144a2f84b922375165 | Python | 25,076 | 820 | #!/usr/bin/env python3
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "docstring-parser>=0.15",
# "chromadb==1.5.0",
# ]
# ///
"""
Generate Python SDK reference documentation for Chroma.
Usage:
uv run generate_python_reference.py --output reference/python/index.mdx
This script introspects t... |
0f7556bd06fadd7726f9c03b23d044fd9f02a4264ec468a409582bb32db89539 | Python | 25,136 | 664 | import math
import pytest
import geomstats.backend as gs
from geomstats.test.random import RandomDataGenerator, get_random_times
from geomstats.test.test_case import TestCase
from geomstats.test.utils import IdentityPointTransformer, PointTransformerFromDiffeo
from geomstats.test.vectorization import generate_vectori... |
51fbdc02facc771019eb913e7a2963d896e5cd8f7220d80fa57cdba1ff75301c | Python | 25,144 | 470 | import os
import sys
# supress warnings about having no GPU
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
import logging
# suppress warnings about tf retracing
tf.get_logger().setLevel('ERROR')
logging.getLogger('tensorflow').setLevel(logging.ERROR)
import numpy as np
import pandas as pd
import argp... |
d202ae691fb7ae4f8d73a2c2dddb6a55082c8d1960ca9492026387e1fa958324 | Python | 25,146 | 579 | from numba import njit, jit, objmode
from numba.experimental import jitclass
from numba import int32, int64, float32, float64, boolean, prange
from numba import deferred_type
from numba import typed, types
from numba.types import pyobject
import numpy as np
from scipy.io import loadmat, savemat
from .KMeansDTW import ... |
7e3cf4be27fda33ca0a86c1028416017cf8c9c130f9face10a8b01ffd0a4bb86 | Python | 25,151 | 685 | from __future__ import annotations
import copy
import itertools as it
import re
import string
import warnings
from pathlib import Path
from typing import Any
import more_itertools as itx
import pytest
from hypothesis import assume, given
from hypothesis import strategies as st
from snakebids.core.datasets import (
... |
e230e1fc09fdd042e3536430d36ae8b07de84a22038cb0d24a90b5087d67f03a | Python | 25,157 | 599 | # -*- coding: utf-8 -*-
"""
Variability postanalysis of presynaptic inputs
Clean code for publication
@author: Sebastian Molina-Obando
"""
#%% Importing packages
import os
import pandas as pd
import glob
import pandas as pd
import numpy as np
from scipy.stats import shapiro, f_oneway
from statsmodels.sta... |
5ecb02a52b1123e3bffb077f10d5cd7771893a102e9a0a76bdc40a1d337287a6 | Python | 25,167 | 628 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
### PSD and PAC!
import os
import sys
from pathlib import Path
import json
import numpy as np
import matplotlib as mplb
import matplotlib.pyplot as plt
from scipy import signal as sig
from scipy import integrate
from matplotlib import colors
from matplotlib import tick... |
942ec39f5bfa96f3596a5b0e335203406e2e914eb04baceb041e73e176051f08 | Python | 25,174 | 712 | import copy
import logging
from datetime import datetime
from importlib.resources import files
from pathlib import Path
import h5py
import numpy as np
import pytest
from idtrackerai import (
IdtrackeraiError,
ListOfBlobs,
ListOfFragments,
ListOfGlobalFragments,
Session,
)
from idtrackerai.base.run... |
f65a149f65a92596d173323f065dab5b469cb9a697c113642444eb6c2278995a | Python | 25,229 | 693 | # Copyright (C) 2020-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# Co-authored-by: Anindya S. Paul <anindya.s.paul@intel.com>
# Co-authored-by: Brandon Edwards <brandon.edwards@intel.com>
# Co-authored-by: Mansi Sharma <mansi.sharma@intel.com>
from clip_optimizer import ClipOptimizer
from copy import... |
23e1016b3c049345b45c8ccbfc1c8637ea7b28349fa2dd1f19a9253eb311ca49 | Python | 25,238 | 661 | import os
import re
import sys
from pathlib import Path
import pandas as pd
from data_classes import VOPADataset,VOPADataset_img
from puzzlecrop import Puzzlecrop
from models import Dense161_model,VGG16_model,ResNet18_model
import random
import torch
import torch.nn as nn
import torchvision.transforms as transforms
fro... |
a09a22e8dce8a3f3ca0881e401738d93ae84020b96ad47a53aa7bbe3aa664662 | Python | 25,276 | 704 | import os
import pytest
import numpy as np
import nibabel as nb
import pandas as pd
from nltools.simulator import Simulator
from nltools.data import Brain_Data, Adjacency, Groupby
from nltools.stats import threshold, align
from nltools.mask import create_sphere, roi_to_brain
from pathlib import Path
from nltools.prefs... |
40a88022dd1f87aa9613efa20328d59498e10d03ce9e11fda9853b6e6f3c1640 | Python | 25,324 | 728 | # Copyright 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import subprocess
import time
import signal
import socket
import shutil
import atexit
import boto3
import logging
from botocore.client import Config
from botocore.exceptions import ClientError
import fnmatch
from pathlib import Path
im... |
7dd38e868ae419d906dff2934765b3578ba9cca9917cd14fe7aa98748152899d | Python | 25,326 | 655 | """The fine-tuning contract, offline, from a committed anchor.
Separate file from ``test_finetuning_pseudolabels.py`` on purpose, and the
reason is a trap worth stating rather than working around: that file carries
a module-level ``pytest.mark.network``, so *every* test added to it inherits
it and is skipped on every ... |
039e688d73a92210383346dcc4144379e1da2e28f837c06088d2d8e2bb133554 | Python | 25,328 | 749 | r"""Helper classes for tree spaces.
Class ``Split``.
Essentially, a ``Split`` is a two-set partition of a subset of :math:`\{0,\dots,n-1\}`.
This class is designed such that one part of both parts of the partition can be empty.
Splits are corresponding uniquely to edges in a phylogenetic forest, where, if one cuts
the... |
89b870edac9797253910baad0bf9f671747287efcaf68f80fe266ef2b393afd5 | Python | 25,382 | 581 | import pickle
import numpy as np
import os
import sys
import functools
import math
import re
# Set environment variable to control jax behaviour before importing jax
os.environ["NVIDIA_TF32_OVERRIDE"] = "0"
os.environ["JAX_ENABLE_X64"] = "True"
import jax.nn
import jax.numpy as jnp
import optax
import haiku as hk
imp... |
cc661ea2cbc7322660e7a681b1bed128ae330d2f1a48d597b5a092634795c9b9 | Python | 25,384 | 689 | # created 20210212
import os, math
import numpy as np
import pandas as pd
from PyQt5 import QtCore, QtGui, QtWidgets
import sanpy.analysisDir
import sanpy.bDetection
from sanpy.metaData import MetaData
from sanpy.sanpyLogger import get_logger
logger = get_logger(__name__)
def old_loadDatabase(path):
"""
... |
8fadc5480a68a3e683a33cd4bddef64154502318af0f051d614def1e71d82e28 | Python | 25,388 | 713 | """Parameter optimization functions."""
# Authors: Blake Caldwell <blake_caldwell@brown.edu>
# Mainak Jas <mjas@mgh.harvard.edu>
from math import ceil, floor
from collections import OrderedDict
import fnmatch
from functools import partial
import numpy as np
import scipy.stats as stats
from scipy.optimize im... |
9657fc7bd8df21c6d1fce45981f747d18d53b9c8d442198fa11ca30dc8161d64 | Python | 25,488 | 603 | """The CI gates that cannot check themselves.
Everything this file guards failed the same way once: green, and measuring
nothing.
* The nightly `benchmarks` job ran a directory whose only test was marked
`gpu` AND `network`, on a CPU runner with no network. All sixteen
parametrizations skipped, the job passed, an... |
8979a8fe96e38ce7f34b496b9b757eff68bdde6d754193f15ff67da7c7b323ee | Python | 25,540 | 851 | """Define, validate, and store SanPy current-clamp spike results."""
from __future__ import annotations
from collections.abc import Callable, Iterable, Iterator, Mapping
from copy import deepcopy
from datetime import datetime
from enum import StrEnum
import math
from numbers import Real
from typing import Any, TypeAl... |
ab0be1aa33dab106d2a1511596e2ef56707c871b75fd66479c19f3e6dd775376 | Python | 25,550 | 811 | # Authors: Mainak Jas <mainakjas@gmail.com>
# Christopher Bailey <bailey.cj@gmail.com>
import pytest
import numpy as np
from hnn_core import Network
from hnn_core.drives import (
_drive_cell_event_times,
_get_prng,
_create_extpois,
_create_bursty_input,
)
from hnn_core.network import pick_c... |
5cc9470353408f577330aae1195103ace6a0624429c4b667c364ff9ecf33262a | Python | 25,605 | 592 | '''
Module focused on the creation of the object detector and implementaion of the
training and testing phases.
'''
from functools import reduce
from pprint import PrettyPrinter
import time
import torch
import torch.nn as nn
import numpy as np
from torchvision import transforms
from tqdm import tqdm
from PIL import Ima... |
7b620fd3f25cdc14e3f0e9ee4e5ea191903565202f4af4480fad2d7d1af10255 | Python | 25,726 | 697 | # Copyright (c) 2020 PaddlePaddle 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 appli... |
885a4c165897e0c83eec5ce80932bea9302cea3b7466a608e82dd552d08d5341 | Python | 25,739 | 591 | # Copyright 2020 Forschungszentrum Jülich GmbH and Aix-Marseille Université
# "Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. "
import datetime
import os
import json
import subprocess
import copy
from nest_elephant_t... |
b05b5967c46e92374477adc0a0b016f743bd1168c1cc60ec872703321cc536be | Python | 25,785 | 786 | """
Statistical tests
"""
from __future__ import absolute_import, division
import warnings
from nose.tools import nottest
import numpy as np
from scipy import stats
# import warnings
from . import descriptive, swap2zeroaxis
from . import utils
from .distributions import kappa
import pandas as pd
from pycircstat.data i... |
973961b8b83baf6a91a84ff047bf8e5c33f5e85edac8f330e2b2d17027542249 | Python | 25,786 | 723 | from typing import Optional, Sequence, Any, Tuple, cast, Generator, Union, Dict, List
from chromadb.segment import MetadataReader
from chromadb.ingest import Consumer
from chromadb.config import System
from chromadb.types import RequestVersionContext, Segment, InclusionExclusionOperator
from chromadb.db.impl.sqlite imp... |
5bca3f79b3ff55caec19c5cc4339557737840465258c2941bd5153f450377196 | Python | 25,811 | 812 | """The manifold of lower triangular matrices with positive diagonal elements.
Lead authors: Olivier Bisson and Saiteja Utpala.
References
----------
.. [T2022] Yann Thanwerdas. Riemannian and stratified
geometries on covariance and correlation matrices. Differential
Geometry [math.DG]. Université Côte d'Azur,... |
061d2a031f18989118f7c4306e5e52e3b20e55f180398c466fbcf5d0a23c46ce | Python | 25,827 | 638 | # Copyright 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""AggregatorRESTClient module."""
# Standard library imports
import logging
import ssl
import struct
import time
from typing import Any, List, Tuple
# Third-party libraries
import requests
from google.protobuf import json_format
from requests.... |
6fc660faccc3cece788e6f06407c4cb39ef43a866a348979b9b5b0bc7f02d32d | Python | 25,831 | 627 | # Copyright (c) 2021 PaddlePaddle 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 appli... |
3ed75a496267236e0d361fc43c9f90f04f5af22f678ec444d0d38455d1e88c2c | Python | 25,878 | 731 | """Tests for the SanPy NicePool plugin's data and selection boundaries."""
from __future__ import annotations
import json
from collections.abc import Callable
from types import SimpleNamespace
from unittest.mock import MagicMock, call
import pandas as pd
import pytest
from PyQt5 import QtCore
from PyQt5.QtTest impor... |
07a8d2fb0442b9dfa77dd689bf00d078f95661173d1d4283d1860af309ca8821 | Python | 25,879 | 710 | """Base class for the n-dimensional hyperbolic space.
The n-dimensional hyperbolic regardless its different representations.
"""
import geomstats.backend as gs
from geomstats.geometry.diffeo import Diffeo
class HyperbolicDiffeo(Diffeo):
"""Diffeomorphism between hyperbolic coordinates.
Parameters
-----... |
aa558463e4803d9f5fafb96f4bfa937815c353bd933eb66a0b8e8301b0ded337 | Python | 25,893 | 852 | """
Session and experiment management
Author: Tal Eisenberg, 2021
Responsible for creating/continuing/deleting sessions and loading, running, and managing the
lifecycle of experiment modules.
"""
from datetime import datetime
import inspect
import re
import json
import shutil
import pandas as pd
from pathlib import Pa... |
56cfdc4748c7700b6f1b9df1a2a015b87c3abe205063f03d168b3663292eeaaa | Python | 25,915 | 486 | #!/usr/bin/env python3
#
# Sniffles2
# A fast structural variant caller for long-read sequencing data
#
# Created: 15.08.2021
# Author: Moritz Smolka
# Maintainer: Hermann Romanek
# Contact: sniffles@romanek.at
#
import logging
from collections import Counter
import pysam
import os
from sniffles import ... |
804031f3b5944d80c2bd5a425746f5b030a9dd8e37d5205eac91e7b48f79943f | Python | 25,924 | 659 | # Copyright (c) 2021 PaddlePaddle 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 appli... |
f876719a72da1137ab53d2d252f681c1b6ba4403441e6ce9eeafe08d924784d8 | Python | 25,985 | 657 | import warnings, copy #,sys
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
#from scipy import sparse, linalg
from sklearn.neighbors import NearestNeighbors
from scipy.spatial import distance_matrix
try:
import faiss
use_fast = True
except:
use_fast = False
from sklearn.metrics import p... |
a7d6f2a24bf92dc7a1024eed0183ba35f9c051a9d98244384ea7ab820a1156a5 | Python | 25,988 | 520 | import numpy as np
# import tensorflow as tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import os
import sys
import time
import LSM_STDP_CONSTRUCTOR_N_MNIST as construct
import NALSM_PARALLEL_SAVE as parasaver
import NALSM_SIM_SUPPORT as runSupport
import NALSM_GEN_SUPPORT as sup
class ru... |
4daac48188fe46d500a3ec3014c517cd31481fee2538751fcf6d8a4593d92338 | Python | 26,045 | 582 | """Motif inference: the statistic, the graph, and the PWM cascade that stopped deleting letters."""
from __future__ import annotations
import math
import numpy as np
import polars as pl
import pytest
from vdjdb.motifs import cluster as C
from vdjdb.motifs import emit as E
from vdjdb.motifs import pwm as P
from vdjdb... |
6d03869a8d85e0736ee2bbfed3a0e4e8fa2177be404e4fa87975ff1e4065d27c | Python | 26,068 | 521 | import numpy as np
# import tensorflow as tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import os
import sys
import time
import NALSM_CONSTRUCTOR_N_MNIST as construct
import NALSM_GEN_SUPPORT as sup
import NALSM_PARALLEL_SAVE as parasaver
import NALSM_SIM_SUPPORT as runSupport
class run_s... |
aecd7b54636ad5c8429beb64ddaa2c43efe6a43d18529fc01f46b7906f8dc73b | Python | 26,074 | 710 | """Neuron simulation functions and NetworkBuilder class."""
# Authors: Mainak Jas <mjas@mgh.harvard.edu>
# Sam Neymotin <samnemo@gmail.com>
# Blake Caldwell <blake_caldwell@brown.edu>
import os
from copy import deepcopy
from pathlib import Path
import numpy as np
from neuron import h
from .cell im... |
6057d03eeafe76afe3e7b6e2a8dfd0016b19fc80d8c13e693625505e02378fa0 | Python | 26,086 | 755 | """Plot firing-rate/current summaries across recording sweeps."""
import time
from typing import Union, Dict, List, Tuple, Optional, Optional
from functools import partial
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from PyQt5 import QtCore, QtWidgets, QtGui
from sa... |
f04f45d6f741921e2f6441da9afa55dfd1cb5f64fa3b1717b43849731ea7e396 | Python | 26,147 | 642 | import copy
import pytest
import torch
from mace.modules import TimeReversalSymmetrizedMACE
from mace.modules.extensions import MagneticSCFMACE
from mace.tools.torch_tools import default_dtype
from .test_magmace import (
_build_small_magnetic_model,
_make_magnetic_cluster_data,
_random_rotation,
)
CUDA_... |
d4cb4779311f08a8876a1d2e45260a3e5976da575e181f10fc92e8653a412fb3 | Python | 26,205 | 807 | # -*- coding: utf-8 -*-
"""
This library can be used to programmatically read, create, manipulate .sqc files
as used by the cRIO pulse interface developed by Stefanie Neupert
(stefanie.neupert@uni-konstanz.de) in the lab of Christoph Kleineidam at the
University of Konstanz.
The internal logic of the RIO system, that... |
06082fb3e8929e477f58fb8bc78e7ecb9a9209eb01444272d1d153c85a6a89f7 | Python | 26,208 | 515 | # Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this sof... |
e53178808397a35cc10ae8a6755c02a457b00d9813594b302297f5d30831446f | Python | 26,215 | 654 | import pytest
from typing import List, Any, Callable, Dict
from jsonschema import ValidationError
from unittest.mock import MagicMock, create_autospec
from chromadb.utils.embedding_functions.schemas import (
validate_config_schema,
load_schema,
get_available_schemas,
)
from chromadb.utils.embedding_function... |
b44a625c7108d8895890a5305fe6c79aa0604483e001513bc305b519838ef277 | Python | 26,297 | 683 | """
Module to train, optimize and evulate ML model
Author: Son Gyo Jung
Email: sgj13@cam.ac.uk
"""
import os
import numpy as np
import pan... |
7048f1f358c28e35dbb86c8ee320ef9d69906fdb68418f2d0075b3d312f3be75 | Python | 26,342 | 804 | import os
import glob
import math
import enum
import inspect
from typing import Union, Dict, List, Tuple, Optional
from abc import ABC, abstractmethod
import numpy as np
import scipy.signal
import sanpy.fileloaders
# from sanpy.config import DO_KYMOGRAPH_ANALYSIS
import sanpy.metaData
from sanpy.fileloaders.fileMeta... |
0f1b9c27849238f24ad58c5c7e34df8c16462dea04d70abcd425cd662081bdb1 | Python | 26,348 | 691 | # Copyright (c) 2022 PaddlePaddle 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 appli... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.