sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
b11e8d9bbce6b8fb166dab6cabd3c12200d7aecdb64c4ccba8c69effc1470a8c
Python
39,426
1,125
# 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 os import sys from dataclasses import _MISSING_TYPE, dataclass, field from typing import Any, List, Optional import torch from omegaco...
fd68746ace82a3883cc2aefe8b782c5e846faceb1b162447bbbf93e16a5f5035
Python
39,499
952
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import warnings from pathlib import Path import numpy as np import matplotlib as mplb import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec, GridSpecFromSubplotSpec from matplotlib import font_manager as fm from matplotlib import ...
1ffb620948d238bd139223bdb203af8ccd8dbc9e8f59bfd2fc0700d8b8609f41
Python
39,819
1,153
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.ticker import MultipleLocator sys.path.append(os.path.dirname(os.path.abspath(__file__))) from helper_functions import ( # pyright: ignore[reportMissingImports...
8ba6a27a7a0a415a3dea1268c45cf9e69f4e230886404b81d8003905d8321f73
Python
39,908
1,222
"""Tests for SanPy application, window, and plugin shutdown behavior.""" import gc from functools import partial from pathlib import Path from types import SimpleNamespace from typing import Any from unittest.mock import Mock import pytest import pyqtgraph as pg from matplotlib.backends.backend_qtagg import Navigatio...
7aee6c2dba14d6d4ef45390a8ae2b3549983677d24f53d8585feaade4c695283
Python
40,258
834
import torch from torch.autograd import Variable import torch.nn.functional as F from torch.utils import data from torch.utils.data import SequentialSampler from torch import nn from tqdm import tqdm import matplotlib.pyplot as plt import numpy as np import pandas as pd from time import time from sklearn.metrics impo...
739f53fd6b2a24900903ef311f7c0d85966acbb81339ddc916fc508920269482
Python
40,274
1,134
import hashlib import hypothesis import hypothesis.strategies as st from typing import Any, Optional, List, Dict, Union, cast, Tuple from typing_extensions import TypedDict import uuid import numpy as np import numpy.typing as npt import chromadb.api.types as types import re from hypothesis.strategies._internal.strateg...
0c88e24199e9a64c4f30f957bcf563a9fa896d7e21f95c80cc488c2b98f8652a
Python
40,288
953
# 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...
4a7694c8390f19621ced903629922e986d3881f887f4dce9c3d99c222b3b7037
Python
40,288
1,020
# 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...
b6f14e8fa2a95de4d38218fef31380c6a70de770f585107e209ff83075c307ef
Python
40,302
794
# 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...
f1f6827af1e0a54f28fde70b045cb0bcc60f46d496fca057516fffa789c89cf2
Python
40,455
1,014
# 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 math import sys from typing import Dict, List, Optional import torch import torch.nn as nn from torch import Tensor from fairseq impo...
23e01bdbdd4f6c44f44081a7e983c92aa01dc00021a3a3ad56227312c5f141e6
Python
40,528
625
#!/usr/bin/env python3 # # Sniffles2 # A fast structural variant caller for long-read sequencing data # # Created: 18.10.2021 # Author: Moritz Smolka # Maintainer: Hermann Romanek # Contact: sniffles@romanek.at # import os import sys import datetime import argparse import tempfile from collections import...
b2e075985a79df08f4474c6d640ac94ab0a0ce6e3ebc749a408afb38642b4045
Python
40,551
998
# -*- coding: utf-8 -*- import numpy as np from scipy import stats import copy import functions.prediction from sklearn.preprocessing import MinMaxScaler from scipy.ndimage.measurements import center_of_mass import functions.transient import functions.time_functions as tf def tst_v_baseline_selectivity_r...
cefaf611604fd9426c03c802c9be1d057237abf9c74ace16b6493933a455e328
Python
40,559
991
# 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...
c3539679d4257608d9762e09d1052ca80ff0897508f78b00a30c47fd3e90577f
Python
40,855
1,025
""" Modelling """ import os import re import shutil import time import glob from pathlib import Path import json import inspect import logging import math import functools from typing import * import torch from torch import nn from torch.nn import functional as F import pytorch_lightning as pl from transformers impo...
a802b7864b31ffe95a4764faad0a3d7766d1aa5aa0552ae4bc72535b0c07b4ac
Python
40,860
1,186
# Author: Robert H Cudmore # Date: 20190722 import os, sys import numpy as np import scipy.signal from PyQt5 import QtWidgets, QtGui, QtCore import matplotlib import matplotlib.figure from matplotlib.backends import backend_qtagg import matplotlib.pyplot as plt # abb 202012 added to set theme import matplotlib.ticker...
878bc7bad719e6a72d5440e8abb738bda56f8cc0b41a9d54c421894fe5997979
Python
40,911
1,145
"""Network model functions.""" # Authors: Nick Tolley <nicholas_tolley@brown.edu> from pathlib import Path from copy import deepcopy import warnings import hnn_core from hnn_core import read_params from .network import Network, _create_cell_coords from .params import _short_name from .cells_default import ( baske...
628de5320dbdac9320627eae1e0794b525c19eb0a131cd440a70cfbb6add485c
Python
41,177
708
import torch import torch.nn as nn import numpy as np from rdkit import Chem from dig.ggraph.utils import check_chemical_validity, check_valency, calculate_min_plogp, qed from dig.ggraph.utils import convert_radical_electrons_to_hydrogens, steric_strain_filter, zinc_molecule_filter from .disgraphaf import DisGraphAF ...
561fe6b15f17970bac48e9a8da675b3c4b5b275052c4be83ea100ec5629da2df
Python
41,182
863
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # This work is licensed under the Creative Commons Attribution-NonCommercial # 4.0 International License. To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to # Creative Commons, PO Box 1866, Mountain ...
668698e81b2474a42bb107a271cde8ce263f08704efbb0ee345a3d3187d48ed7
Python
41,237
1,081
"""Backend abstraction for CPU/GPU operations. Supports NumPy (CPU-only) and PyTorch (CPU/CUDA/MPS) backends for linear algebra operations, so algorithms are written once against NumPy semantics and run on a GPU when one is available. This module is also the package's single GPU execution layer: memory budgets (`_dev...
83f9b072b0d1927f7c845346a4174c2728b9467226f27ff862f33de9643c37ec
Python
41,352
1,422
import os from copy import deepcopy from pathlib import Path import matplotlib.pyplot as plt import numpy as np # sys.path.append('./BIC_codes/') from functions.dFC_funcs import * from functions.post_analysis_funcs import * print(" VISUALIZATION IN PROGRESS ... ") ################################# LOAD RESULTS ####...
ac27b79ae7c1723308b0ad2e756c52ae280ed82a819365e63ac7534b1dc7765d
Python
41,358
1,537
import math import glob import logging import os import re import smtplib import ssl import subprocess import time import copy import collections import json import matplotlib import matplotlib.pyplot as plt from matplotlib.backends.backend_agg import FigureCanvasAgg import numpy as np import pandas as pd import requ...
24d56a1e2220ff567d749f1c409acc8e804da7a8c9b90b402666585a730a03d8
Python
41,550
1,092
"""Loading, resampling, writing, and uploading for `BrainData`. Functions that resolve a mask, load data (from files, lists, URLs, HDF5, or other `BrainData` objects), resample to a target grid, write NIfTI/HDF5, and upload to NeuroVault. `BrainData` methods delegate here. """ import os import shutil import tempfile ...
4b4bb16cc3e6bfd552f0e9d191a61f24b00beb2a371c5f7e443c61cb1a9e2777
Python
41,772
1,158
"""The n-dimensional hypersphere. The n-dimensional hypersphere embedded in (n+1)-dimensional Euclidean space. Lead author: Nina Miolane. """ import logging import math from scipy.stats import beta import geomstats.algebra_utils as utils import geomstats.backend as gs from geomstats.geometry.base import LevelSet f...
f83af3bfafc2cf3ebc07f96a57fd2b2dc5eeb77efc905afefbbaf736d5820e6a
Python
41,820
1,203
""" Integration test for Chroma's Task API Tests the task creation, execution, and removal functionality for automatically processing collections. """ import functools import io import json import pytest import time import urllib.parse import uuid from typing import Any, Optional, cast from chromadb.api.client import...
821aa12328f6fd201f5c0d7dffd6b1b27f2c520a86ffa20438b1ef654f18b965
Python
41,879
1,375
import argparse from collections import namedtuple from itertools import product from typing import List, Tuple import einops import matplotlib.pylab as plt import mrcfile as mrc import numpy as np import scipy import torch import torch.nn.functional as F from numpy.typing import ArrayLike from scipy.ndimage import co...
18a91af8d4bb64a01b17ce2ed8eb478794c778dd3819de02328a298fee31d56a
Python
41,937
1,044
# # For licensing see accompanying LICENSE file. # Copyright (C) 2022 Apple Inc. All Rights Reserved. # import sys import traceback import torch import copy import gc import time import shutil from typing import Dict from torch.cuda.amp import autocast from torch.nn import functional as F import random from typing im...
f0a26ef602a190083af9a21ff3feef30d0c5377c9a76c410e4b6aa71df9d7fa8
Python
41,974
1,205
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 from typing import List, Tuple, Union import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor from .gvp import GVP, GVPConvLayer, LayerNorm import dgl INTER_PHYS_KEYS = [ "int...
764f19b5bb4d2978cf9cc28b06cd398a88d5529e1b94e55bc440ac4afb6513f7
Python
42,023
1,005
# This file is a part of the `nequip` package. Please see LICENSE and README at the root for information on using it. import dataclasses import torch from torchmetrics import Metric from nequip.data import AtomicDataDict, BaseModifier, PerAtomModifier from .metrics import ( MeanSquaredError, MeanAbsoluteError, ...
9c27b73e13ea6c1592a9902056066c7424e08a4f718a9fc1949bb9dec05196b4
Python
42,065
1,118
# Copyright (C) 2023: Max F. K. Wills & Ian C. Eperon # FluoroTensor: identification and tracking of colocalised molecules and their stoichiometries in multi-colour single molecule imaging via deep learning # Max F.K. Wills, Carlos Bueno Alejo, Nikolas Hundt, Andrew J. Hudson, Ian C. Eperon # bioRxiv 2023.11.21.567874...
b8da1d2c6664ceeed0020d0d2d3b61470a978454fadc68a2b26f71c490e1d720
Python
42,130
1,184
import torch import numpy as np import pytorch_lightning as pl from collections import defaultdict from torch import nn from torch.nn import functional as F from torch.nn import Linear, ReLU import torch_geometric from torch_geometric.nn import ( GCNConv, PNAConv, VGAE, global_mean_pool, global_add...
15df8fd8f450acf40c2c07c902839a0c88dc2256962bf4292eae7b32942b87b3
Python
42,163
1,230
from typing import TYPE_CHECKING from tenacity import retry, stop_after_attempt, retry_if_exception, wait_fixed from chromadb.api import ServerAPI if TYPE_CHECKING: from chromadb.api.models.AttachedFunction import AttachedFunction from chromadb.api.collection_configuration import ( CreateCollectionConfigurati...
8859d0b4a1eeda5ce98fc0827e926c627f265dc08c2cb575c21aa576e1a9de2d
Python
42,174
967
import json import logging import os import uuid from datetime import timedelta from django.core.files.base import File as djangoFile from django.contrib.auth.models import User, AnonymousUser from django.db.models import Q, Count from django.utils.decorators import method_decorator from django.views.decorators.cache ...
95b9df11cc8da008657284f21ea61b57082191aaa0b6484e9171d8a84f57b101
Python
42,520
1,120
"""Example from pytest documentation https://pytest.org/en/stable/example/simple.html#incremental-testing-test-steps """ from typing import Dict, Tuple import copy import pytest import pickle from pathlib import Path import hnn_core from hnn_core import ( read_params, calcium_model, duecker_ET_model, ...
c94e63cb8736dead3cc412ec749529910d76bb3da8e20fc163d1f81576ee7da2
Python
42,529
1,245
import multiprocessing import os import socket import subprocess import tempfile import time from typing import ( Any, Generator, Iterator, List, Optional, Sequence, Tuple, Callable, cast, ) from uuid import UUID import hypothesis import pytest import uvicorn from httpx import Conne...
a5fa8afbabddb7712c252118560754f4f850adaf3249e4ae57167a683026d48c
Python
42,636
1,149
""" Author: Arnaud Desvachez --<arnaud.desvachez@gmail.com> Purpose: Defines the path search class. It is required due to the dynamic loading of parameters/widgets. One cannot connect the clicked of the button to write in the QLineEdit Created: 4/09/2019 """ import os import pickle from glob import glob ...
54d34ccf9f7b8e20c40d30a0ab7a450b9b1c72b5cfedb71f6f3a80d4fe23dde8
Python
42,755
1,056
"""pfl3_im.py Analysis and plotting functions for PFL3_LAL_imaging.ipynb """ import os import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import scipy as sc from scipy.interpolate import interp1d import analysis_plot as ap import fun...
4776325da2290072f8c561a7678751cb6966bee2d3000615912312ed5eb5dce9
Python
42,798
1,181
"""Establish class def for general cell features.""" # Authors: Mainak Jas <mjas@mgh.harvard.edu> # Sam Neymotin <samnemo@gmail.com> from copy import deepcopy import numpy as np from numpy.linalg import norm from neuron import h, nrn from .viz import plot_cell_morphology from .externals.mne import _valida...
f5756a1b86ca10d45b9078795c33697578a9b801151edd461739ab523ca5dc62
Python
42,878
1,193
from abc import ABC from typing import Union, Optional, Sequence import torch from torch import optim import numpy as np from ..network.nodes import SRM0Nodes from ..network.topology import ( AbstractConnection, Connection, Conv2dConnection, LocalConnection, ) from ..utils import im2col_indices clas...
073a3251ddbc52ffad47c3028993e7299e2063df1f54d8d1f409d117ca4e41a6
Python
42,882
1,161
"""analysis_plot.py Common analyses and plotting functions """ import numpy as np import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import pandas as pd from simplification.cutil import simplify_coords_idx from scipy import stats, ndimage from scipy.signal import find_peaks import sqlite3 import...
0564867e45d5880190b6f59c2b3806068920b223460a9d88ed2e3ed3091a43c5
Python
42,968
1,075
import json import logging from collections.abc import Iterable, Sequence from datetime import datetime from importlib import metadata from itertools import count, pairwise from math import sqrt from os import cpu_count from pathlib import Path from statistics import fmean from typing import Any, Literal import cv2 im...
11d6d737badb553c4c4c0519bc4bc08fb076eb7ec1e70e6c04825950dcc8bde0
Python
43,011
1,133
import logging import sys from collections.abc import Sequence from datetime import datetime from enum import Enum from pathlib import Path from time import sleep import numpy as np import toml from qtpy.QtCore import Signal # type: ignore[reportPrivateImportUsage] from qtpy.QtCore import Qt, QThread from qtpy.QtGui ...
51167692951babe4a848893d3a41e0cdd2acc94b4b2a7d12de30af2c6cf916c3
Python
43,133
796
"""TCREMP: cluster CDR3s by where they land in a prototype-distance embedding. The second motif method, run beside :mod:`vdjdb.motifs.tcrnet` rather than instead of it. TCRNET asks whether a clonotype has more neighbours than a background repertoire explains, which only sees sequences that are literally one substituti...
76175a1fc386a52302c454e1917cfc1bedbd6444331be7b31d6636e387358bae
Python
43,164
1,042
"""Polars-based design matrix for neuroimaging analysis. `DesignMatrix` wraps a Polars DataFrame with neuroimaging metadata (sampling frequency, which columns are HRF-convolved, which are confounds) and offers HRF convolution, resampling, polynomial and cosine drift regressors, multi-run concatenation, and collinearit...
06cf687238fb55bf06225123682f48540e9b0b9c958feea921bf64bab0261007
Python
43,173
1,352
"""The manifold of full-rank correlation matrices. Lead authors: Yann Thanwerdas and Olivier Bisson. References ---------- .. [T2022] Yann Thanwerdas. Riemannian and stratified geometries on covariance and correlation matrices. Differential Geometry [math.DG]. Université Côte d'Azur, 2022. """ import logging...
bfc3e23eb832be0c79551c51afeb4a27a82659d69ce343e7be64ca6bbcade593
Python
43,189
1,456
########################################################################################### # Parsing functionalities # Authors: Ilyes Batatia, Gregor Simm, David Kovacs # This program is distributed under the MIT License (see MIT.md) #####################################################################################...
0be6d12a0c52d27b8f6650739884281cb462860eda75d79d5e702e6d66c2968a
Python
43,259
1,029
# This file is a part of the `nequip` package. Please see LICENSE and README at the root for information on using it. """ Basic and energy-specific model test mixins. These mixins provide core functionality tests and energy model-specific tests. They can be composed with other test mixins (compilation, integrations) a...
a45e7dd9df9b576f92465396a456d1a0f8cebebb3f6050f01efd275cd3bd997c
Python
43,321
1,348
import keras from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.layers import Dense, Dropout, Merge, Input from keras.callbacks import ModelCheckpoint, EarlyStopping from sklearn import metrics from keras import optimizers from gensim.models import Word2Vec ...
9cf640b9b7f8c8a4d892087644aa315b6e2b8d0aba690488642f6ce5672f9b47
Python
43,350
1,043
#!/usr/bin/env python3 import typing import warnings from typing import Any, Callable, List, Tuple, Union, cast import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor from torch.nn import Module from torch.utils.hooks import RemovableHandle from captum.attr._uti...
072b82d10f9f083b1b87be9c3af182800de70b7d05f7e6b41fa4305966953717
Python
43,411
964
# Copyright (c) 2023 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...
670b9c3fc5ba5fdc98c7e6dc6b505e36884a4542203fcae58a16df0a20e3d467
Python
43,443
1,044
import os import typing import warnings import tqdm import copy import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import torch import torch.nn as nn import torch.optim as optim from . import utils from . import pc_layer class PCTrainer(object): """A trainer for predict...
a97951fc1c48fd02f8ed2eb32b7215bfcce14b8f82a31e59382c06f12505b959
Python
43,514
1,284
# 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 math from dataclasses import dataclass, field from typing import List, Tuple import numpy as np import torch import torch.nn as nn imp...
69b867da8eea2433cb475f27f4a6035595f1b094e0bec717a7bd8335081f8d05
Python
43,550
1,039
import json import logging from abc import abstractmethod from dataclasses import field from functools import cached_property from typing import Literal, Optional, Union from typing_extensions import Annotated, override import numpy as np import pydantic from pydantic import ConfigDict, Field from pydantic.dataclasses...
1b9c9de2ee73461b42331a9803e685e1989b898903e34500133aacad4c00b9b7
Python
43,769
1,362
import math import enum # Error if we use 'from functools import partial' # Error shows up in sanpy.bPlugin when it tries to grab <plugin>.myHumanName ??? import functools from typing import Union, Dict, List, Tuple, Optional, Optional from matplotlib.backends import backend_qtagg import matplotlib as mpl import mat...
12153d079a7a6bcd11bc159234d3de058b270ca447f3b3048b82a6a438ea612e
Python
44,214
1,527
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 8 2023 @author: mte """ import math import os import sys import warnings from copy import deepcopy from math import ceil import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy.cluster.hierarchy...
3c88cd468c5a89da2d28c3b59f508020e552e27e157b58b757563abed08fad35
Python
44,309
1,232
"""Class for the BHV Tree Space. Lead author: Jonas Lueg References ---------- .. [BHV01] Billera, L. J., S. P. Holmes, K. Vogtmann. "Geometry of the Space of Phylogenetic Trees." Advances in Applied Mathematics, volume 27, issue 4, pages 733-767, 2001. https://doi.org/10.1006%2Faama.2001.0759 .. [OP1...
6bf64bd6005bec828e2f6fee35f79831353119cd13908065802df3595a663c0b
Python
44,342
1,144
"""Tests for BrainData.predict() — kwargs API returning PredictResult dataclass.""" import inspect import numpy as np import pytest from sklearn.base import BaseEstimator from sklearn.model_selection import ( LeaveOneGroupOut, StratifiedKFold, ) from nltools.data import PredictResult from nltools.data.braind...
ce51255098cde92a8613d42362d14e07edcce77b3715572249a3cf75273ba1e2
Python
44,686
817
"""IMGT segment nomenclature (#389), driven by the authority table rather than a hand-written map. ``proofreading/imgt_alleles.tsv.gz`` is the authority: 5,342 alleles across the species VDJdb covers. This module reads it. Nothing is invented and nothing is guessed between two candidates. A call that IMGT already kno...
8172395745ad26654eb39883143b5805eff2be12dd03ea62e27b8ac26e6f79ef
Python
44,718
933
# -*- coding: utf-8 -*- """Tools for the evaluation of reconstruction methods. """ import sys from warnings import warn from itertools import product from math import ceil import numpy as np import pandas as pd import matplotlib.pyplot as plt from tqdm import tqdm from dival.util.odl_utility import CallbackStoreAfter f...
d1ad3a6d4ea9a47ab7867df6d602434195c7516bf3bd3df9a6b0ef488a8f557a
Python
44,790
1,219
""" Contains source code for loading in data and creating requisite PyTorch data loader object """ import json import pickle import hashlib import functools import multiprocessing import os import glob import logging from pathlib import Path from typing import * from matplotlib import pyplot as plt import numpy as np...
6516eede1138b91ef49709fabb77e60d6488dfaf811545a5c7149c658caca0de
Python
44,964
1,129
# import os.path as op # import tempfile from unittest.mock import patch import matplotlib from matplotlib import backend_bases import matplotlib.pyplot as plt from matplotlib.colorbar import Colorbar import numpy as np from numpy.testing import assert_allclose import pytest # from hnn_core import read_spikes from hn...
bad9c5dab5cac00f7f98a9a04866ca72a4274cd1922ecba11073b5eb30557cc8
Python
44,990
1,213
from brian2 import * from mpl3d import glm # https://github.com/rougier/matplotlib-3d from mpl3d.camera import Camera # ----------- import numpy as np import matplotlib as mplb from scipy import signal as sig from matplotlib import ticker from matplotlib import colors from matplotlib import font_manager...
7f725baed395e07ffb4b0e4ec97d1ed8f357945100e51e184e520f7b5f3fb7ee
Python
45,052
880
#!/usr/bin/env python3 import os import logging import json from logging import StreamHandler, FileHandler from lib.designer_input_utils import get_input_info, convert_input_data, create_shell_table, assert_inputs from lib.designer_fit_wrappers import refit_or_smooth, save_params from lib.io import load_mrtrix from mr...
46280159aa7e71cd1cec658088ac20cbb052f8b1f9f47ca4bedf8e13fdcedd40
Python
45,129
1,283
from pathlib import Path import numpy as np import pytest import torch import torch.nn.functional from ase.build import molecule from e3nn import o3 from e3nn.util import jit from scipy.spatial.transform import Rotation as R from mace import data, modules, tools from tests.helpers import REPO_ROOT from mace.calculato...
1b3265263b91004c268a15bdf7d9571c1cfdff274c8ed9995f39c0bfbad762c9
Python
45,474
979
import pickle import pandas as pd import numpy as np import os import warnings import sys import shutil from tqdm import tqdm, trange import random import torch from torch_geometric.data import InMemoryDataset, Data import prettytable as pt import math import argparse warnings.simplefilter(action='ignore', category=Fu...
dab827c32b49ad7e20f8e1c33d0538397cc6937bee85f01acf6318f15e934da1
Python
45,868
772
import os import numpy as np import torch import torch.nn as nn from rdkit import Chem from dig.ggraph.utils import check_chemical_validity, check_valency, calculate_min_plogp, qed from dig.ggraph.utils import convert_radical_electrons_to_hydrogens, steric_strain_filter, zinc_molecule_filter from .graphaf import Masked...
09ff9ee370ff9e49e081f820e502effcc524ae4a25b74cdbea167a7c2da29620
Python
46,015
1,313
import torch import torch.nn as nn import globals from collections import OrderedDict from typing import Dict, Callable Detached=True def GlobalWeightedRankPooling(x,d=0.9): x,_=torch.sort(x.view(x.shape[0],x.shape[1],x.shape[2], x.shape[3]*x.shape[4]), ...
5074f476d84adb76c17dde168f808a83df996e4ef8195ef8a362938407fc2cf0
Python
46,296
1,255
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from brian2 import * import brian2cuda from scipy.spatial import distance as dst from scipy.spatial.transform import Rotation as R # from tqdm import tqdm from random import sample as smplf import os import time import sys from shutil import copyfile import argparse impo...
37faf7227461a1ee62c155b4cdec2fd73c4a346ccf08647fa03d271c3fc71b33
Python
46,767
1,376
"""The special Euclidean group SE(n). i.e. the Lie group of rigid transformations in n dimensions. Lead authors: Nicolas Guigui and Nina Miolane. """ import math import geomstats.algebra_utils as utils import geomstats.backend as gs from geomstats.geometry.base import LevelSet from geomstats.geometry.euclidean impo...
d560716d6c33db2cc59111c4b993d16b8ada8309662e6b9d4c12d82b9020365d
Python
46,849
1,105
''' Utilities for the transformations needed inside a CNN and performing object detection ''' import random import torch import torch.nn.functional as F import torchvision.transforms.functional as FT import numpy as np device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') def decimate(tensor, m): ...
741388d2bd6621b2538d39ccf4f819a9891e46a31f37b4aa3f8e11bfd0c14d8b
Python
46,925
976
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license """ Train a YOLOv5 model on a custom dataset. Models and datasets download automatically from the latest YOLOv5 release. Usage - Single-GPU training: $ python train.py --data coco128.yaml --weights yolov5s.pt --img 640 # from pretrained (recommen...
bd45cc4c769709101877c17f86f6bb80b3ff2d8a691934e2287a08732193446d
Python
47,023
930
"""Comparison of a candidate build against a released bundle. ``vdjdb diff <reference> <candidate>`` compares a released bundle against a freshly built one in three passes: 1. **file set** -- exact names and count; 2. **two digests per file** -- raw sha256 and *canonical* sha256 (data rows sorted). Canonical equal...
fa99a8326a494eeba8cc50b059317daa98c4a2bf5c42557cca5932dbca5c1bad
Python
47,065
1,202
"""The CLI-observable contract of the legacy stack. These tests are written once and re-used verbatim: the rewrite may change the syntax of the command line, but the semantics pinned here are the user contract it has to honour, and the live parity run re-executes this file with the engine switched rather than porting ...
52669a93b032497c0fa920ee81a67d9523db72d75d9f00abc31806d5cffae254
Python
47,468
1,336
"""Default cell models.""" # Authors: Mainak Jas <mjas@mgh.harvard.edu> # Sam Neymotin <samnemo@gmail.com> import numpy as np from functools import partial from .cell import Cell, Section from .params import compare_dictionaries from .params_default import ( get_L2Pyr_params_default, get_L5Pyr_param...
9b3193d91d617a6c9e6ef49896dc8612cbcbb67c146d0a76ce16bf2b64dac86f
Python
47,810
1,080
# 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 # # Unle...
fc7e2f16c7fd08c60d50317b8264afb439dbc70c85c89b5ab7d799463323bc4e
Python
48,050
1,210
# + from copy import deepcopy def flatten_list(nested_list): """Flatten an arbitrarily nested list, without recursion (to avoid stack overflows). Returns a new list, the original list is unchanged. >> list(flatten_list([1, 2, 3, [4], [], [[[[[[[[[5]]]]]]]]]])) [1, 2, 3, 4, 5] >> list(flatten_list([...
60136e5093246362e26fc4c9df35ab1185d7061400407adc482e9cb9605ac39c
Python
48,178
936
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 16 12:41:34 2019 @author: mmolina """ import os import numpy as np import torch import torch.utils.data from PIL import Image, ImageFile import torch from collections import OrderedDict import torchvision_05 from torchvision_05.models.detection.rp...
4eb582d3765ba49c9ba86bd97930eeb1d113dd936006caec53901e39e204c8a7
Python
48,211
974
import numpy as np from .SharedTrees import cstr, get_fmt, Description, AmplifierState_v9, LockInParams_v9, UserParamDescrType from .SharedTrees import \ get_segment_class, \ get_data_kind, \ get_seg_store_type, \ get_leak_comp_type, \ get_break_type, \ get_leak_hold_type, \ get_lea...
bf142575108192d575d0b66eea4afa45b2595b1bbbef651c1ffb7f97c6fae938
Python
48,271
918
# %% import sys import os import cv2 import math import numpy as np import time import h5py import pyfftw from scipy import sparse from scipy.io import savemat, loadmat import multiprocessing as mp # sys.path.insert(1, '../..') # the path containing "suns" folder os.environ['KERAS_BACKEND'] = 'tensorflow' # os.enviro...
6568df9bfbb187f88594a38dcc2c13281635ef17f1089ce523120ffc06e3da0c
Python
48,511
1,270
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from brian2 import * from scipy.spatial import distance as dst from scipy.spatial.transform import Rotation as R from random import sample as smplf import os import time import sys from shutil import copyfile import argparse import parameters import re # regular expressi...
e36ee9077f71fd4accee7b77a065ffa3fdcf0764edb77323dce8765d531846bb
Python
48,852
1,038
import os, sys, argparse import serial, datetime, time from transitions import Machine from transitions.extensions.states import add_state_features, Timeout, State import random, copy import numpy as np from collections import Counter # #gpio.setmode(gpio.BOARD) # GPIOChans = [33,35,36,37,38,40] # IRD_GPIOChan_Map = ...
d1644dc5bfff7123bc622a5070fce27bc9fb6d6420622d8a59257591f57e31fb
Python
48,861
1,180
#!/usr/bin/env python3 """Chain co-occurrence graph for the four-donor Immudex dCODE matrices. A node is one chain (locus + V + J + CDR3). An edge is two chains in the same cell barcode, carrying both UMI counts. A cell carries one beta and up to two alphas; any further chain is the contamination slot. The ambient rat...
8b665918c408506862e88741d8b893753ca8ab536ccf729847d22be75ba18f06
Python
48,862
1,198
# Copyright (c) 2023 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...
1b7ed40d88143a18aeae04aac69633e47fed5da6d0a35272dba271575e7fcad0
Python
48,942
1,413
import numpy as np from sklearn.decomposition import PCA import matplotlib.pyplot as plt from sklearn import mixture import torch from matplotlib import colors import os, sys file_dir = os.path.dirname(__file__) sys.path.append(file_dir) from model import * sys.path.append(os.path.dirname(os.path.realpath(__file__)) + ...
c5d4cf0521528ff63a92c39af03a16830c091f90b0c21f2b58e650a7059613e2
Python
49,289
1,271
# + from copy import deepcopy def flatten_list(nested_list): """Flatten an arbitrarily nested list, without recursion (to avoid stack overflows). Returns a new list, the original list is unchanged. >> list(flatten_list([1, 2, 3, [4], [], [[[[[[[[[5]]]]]]]]]])) [1, 2, 3, 4, 5] >> list(flatten_list([...
8868e80b9b3d99ce96ab9de7186e8194fa6e0fa98744d5859253218b69b9d4a0
Python
49,389
1,327
"""Left- and right- invariant metrics that exist on Lie groups. Lead authors: Nicolas Guigui and Nina Miolane. """ import geomstats.backend as gs from geomstats.geometry.matrices import Matrices from geomstats.geometry.riemannian_metric import RiemannianMetric from geomstats.integrator import integrate from geomstats...
b2706de826abf0177942fbf85b8173e1d0d91f93c614835edbf840ef95792c78
Python
49,459
1,294
"""Add-ons for sample analyzers. """ import warnings from functools import partial import numpy as np import xarray as xr from scipy.spatial.distance import cosine as cos_dist, cdist from scipy.stats import spearmanr, pearsonr from sklearn.decomposition import PCA from sklearn.model_selection import cross_validate ...
dcf5e6e6a89574f55168f2b4d5e7280db4fb80da2f5cf03b3def70686ffcb794
Python
49,823
1,373
""" tensorflow/keras utilities for the neuron project If you use this code, please cite Dalca AV, Guttag J, Sabuncu MR Anatomical Priors in Convolutional Networks for Unsupervised Biomedical Segmentation, CVPR 2018 or for the transformation/interpolation related functions: Unsupervised Learning for Fast ...
68a21198f984b202d825081e300c759d01e74930f7c2d6801b55c27f43c07613
Python
49,901
1,266
"""BrainData prediction — timeseries (encoding) and MVPA (decoding). Single entry point: `predict`. It resolves exactly one mode, validates every argument for that mode, and returns either a new `BrainData` (fitted-model prediction) or a frozen `PredictResult` record (MVPA). Nothing is attached to the source object. "...
3fc7f49dc93d47dded6bb7c36cba9f73c0600e1570b4d5838cbe9648dd637744
Python
50,056
1,582
"""Exposes the `SpecialOrthogonal` group class. Lead authors: Nicolas Guigui and Nina Miolane. """ import geomstats.algebra_utils as utils import geomstats.backend as gs from geomstats.geometry.base import LevelSet from geomstats.geometry.general_linear import GeneralLinear from geomstats.geometry.hermitian_matrices ...
fa6fd94d6a3d44a223538ccb7c585380823264685046d3167c2d5be968d814c6
Python
50,100
1,201
# 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...
71db078407cf6402abf37cbacd8b2283ce16a24b35cedcc0e5532dee3bf99635
Python
50,547
1,000
################################################################################ # 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...
9bbe5abc45403d0309a8b4203cc75fc2bed807c6e1bb28811be68a9590c75ccf
Python
50,662
1,228
########################################################################################### # Training utils # Authors: David Kovacs, Ilyes Batatia # This program is distributed under the MIT License (see MIT.md) ########################################################################################### import argpars...
f46647c92f3e6d72c7dc38945c07755893ed68de8216c9946b6f96203aa78087
Python
50,889
1,216
"""Module that defines losses to train a model.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from sleeprnn.common import constants def get_border_weights_quad(labels, amplitude, half_width): print( ...
85f22c20dbc33a7c666ced3985b7049a446b3349152c0825ab8e353f1a6751c1
Python
51,381
1,360
# 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 app...
5b6fc6c97c04ee4e3bf8f61231e8659ac10990307c78eff1e3c4cb72b3ebb634
Python
51,408
1,278
# 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...
aeb8de1d9dfa35a919a9572c2c7b425a05f81f7501994b9485d5c9dbcb343267
Python
51,423
1,161
# Copyright (c) 2023 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...
7215a0e3ee5b8d231fa4b4c30418ec4841acdf42bbe55228c6413d11dd39fda2
Python
51,612
1,537
"""The MACE v1.0 disposition table: every surface v1 removes or replaces. Generated from the rewrite's feature inventory, which carries a KEEP / MERGE / DROP disposition and a reason for every enumerable surface of this package. Only the non-KEEP rows are reproduced here, because those are the ones a 0.3.x user has to...
9021c71f8d61d496de7077e344988a6260cf779ac7e4e036029b38e7c2a10fa3
Python
51,626
1,192
# 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...
6c2148b4644d3b08a2bec92e0633e6426ccbc2f80a90272cc0d44072e7bf7f1b
Python
51,636
1,501
"""Manage folder-backed collections of SanPy recording analyses.""" # Acknowledgements: # Author: Robert H Cudmore # Date: 20210603 import os import time import copy # For copy.deepcopy() of bAnalysis # import uuid # to generate unique key on bAnalysis spike detect import pathlib # ned to use this (introduced in P...
82858d5833df54c6d3b93bc01fa095c1d6d97b97ac043431f78d366e27bc8bde
Python
51,783
1,458
"""Discrete Surfaces with Elastic metrics. Lead authors: Emmanuel Hartman, Adele Myers. References ---------- .. [HSKCB2022] Emmanuel Hartman, Yashil Sukurdeep, Eric Klassen, Nicolas Charon, and Martin Bauer. "Elastic shape analysis of surfaces with second-order Sobolev metrics: a comprehensive numerical ...