sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
42954777c50c25ee4dc764d761f56f8a68de6e3c5039abbf6a159293b0f48415
Python
29,754
668
"""Interface converters for Keras 1 support in Keras 2. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import six import warnings import functools import numpy as np def generate_legacy_interface(allowed_positional_args=None, ...
d2ea5a41553871159b23a49ed0a3c84abfcc40e7273cef1cf562b8141f5798e4
Python
29,777
891
"""Cell template class""" """ Copyright (c) 2016-2020, EPFL/Blue Brain Project This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3.0 as published by the F...
81eb98e13aeb6f43aa23614ec5eda402d050299c0f46acab275fd9f9e9a2331e
Python
29,788
801
#!/usr/bin/env python # -*- coding: utf-8 -*- # tests/long_training.py ################################################################################ # EncoderMap: A python library for dimensionality reduction. # # Copyright 2019-2024 University of Konstanz and the Authors # # Authors: # Kevin Sawade, Tobias Lemke # ...
49181ee1d43492a00c8d75253f434d3e5e1fa8ec9b1a71032435d68462c2d790
Python
29,803
890
import math from math import pi from typing import Optional, Tuple, Callable import torch import numpy as np from torch import nn, Tensor from torch_geometric.nn.conv import MessagePassing from torch_scatter import scatter, scatter_mean from oa_reactdiff.model.util_funcs import unsorted_segment_sum from oa_reactdiff...
cd1811fcd13419919a5ad24a7b2553d886032141414d7b747a4390f78d070766
Python
29,843
757
# Copyright (c) OpenMMLab. All rights reserved. import warnings from collections import OrderedDict from copy import deepcopy import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkpoint as cp from mmcv.cnn import build_norm_layer from mmcv.cnn.bricks.transformer import FFN, build_d...
82bc78cd12f596282e792c0a587fd35c32cc9fac113d2fd128a61ac7e4c94838
Python
29,865
709
"""Decide whether a DANDI asset, or a whole dandiset, holds photometry GuPPy can read. The question is answered off the remote bytes rather than off the archive's metadata, because the metadata does not carry it (see :mod:`guppy.utils.dandi_search`). Reading is arranged so that the answer costs a few kilobytes per fil...
0d9d2048c0f18e909229cf98f124773a15558db7d307048160441ae8f93e511b
Python
29,870
976
import hashlib import os import re import sys import time from itertools import groupby import h5py import numpy as np import pytraj as pt from . import config, constants, log # torch and scipy are imported where they are used. Both are heavy -- torch # alone is ~580 ms -- and nothing on the featurization path needs...
90bf0f8bd427f8685d9ad34e3270c34c18498a52841300747b9d2de47681e58f
Python
29,870
742
import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import numpy as np import pandas as pd from rdkit import Chem import torch from torch.utils.data import IterableDataset import dgl import random from dgl.dataloading import GraphDataLoader from rdkit.Chem.BRICS import Fin...
de932e1a854828c9c5ea6e9f7f53add62a1fc4fb5c5753893ebb008e8f239ee3
Python
29,894
863
import pytest import json import numpy as np from keras.layers import Dense, Dropout, Conv2D, InputLayer from keras import layers from keras.engine import Input, Layer, saving, get_source_inputs from keras.models import Model, Sequential from keras import backend as K from keras.models import model_from_json, model_fr...
38db5cec966c3997cf5b0927975c16569199fbb9875c0831abf0c49f1ae8b179
Python
29,925
671
"""Pure core for the GuPPy NWB-export metadata form (channel-centric, schema-driven). GuPPy owns the fiber-photometry channel structure (it wrote ``storesList.csv``), so the form auto-derives everything structural and the user only supplies what GuPPy cannot know: the hardware/biology device library, per-channel wavel...
f2d52dea5f4682666643323a97bd9fa59d576a24fec43eb50839cf993cd4b265
Python
29,946
635
"""Recommend right-sized SLURM ``mem`` / ``cpus`` from run data. Joins *actual* usage (Snakemake ``benchmark:`` TSVs) against *requested* resources (the SLURM efficiency report, falling back to the per-rule logs) and, for each rule, classifies the fit and recommends a size. The recommendation is the observed peak time...
9b77139c2dd388929f47e83a62f1689d7a94dd25b90fbe716a41d619ddb627f5
Python
30,004
838
# -*- coding: utf-8 -*- import json from typing import Any, Dict, List, Optional, Tuple import yaml from typing import Set from guardian.shortcuts import (assign_perm, get_objects_for_user, get_perms_for_model) from django.db import connection from django.db.models import Exists, OuterRef from django.http import Htt...
edeac83a49a4a2c2e2d65bba74516efe3a9af45f7e39e8dde2148094b50cb551
Python
30,040
797
import numpy as np import pandas as pd import sklearn as skl def run_sz_alarm(curr_df, sz_mask, sz_onsets, wins_per_min, lookback, sph_, sop_, df_pred_mva, y_pred_tile_std, corr_, thresh=0.5, chunk_size=None, verbose=False): sph = sph_ * wins_per_min sop = sop_ * wins_per_min # Debugging variables ...
bfbcf006c438ebe84872945b0f7b972364077cc3049cc1625b281759a2b6fc70
Python
30,123
671
import numpy as np import os # import nibabel as nib import pandas as pd import joblib import time from sklearn.preprocessing import StandardScaler from sklearn.svm import LinearSVR, LinearSVC from sklearn.model_selection import (train_test_split, cross_val_score, KFold) import matplotlib.pyplot as plt from tqdm i...
ef584f0a4755671d5f84101ed85e145e0b6eb61c28ab1b5c31e7137a4d0ca3e6
Python
30,173
582
# SPDX-License-Identifier: Apache-2.0 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Versi...
119ad3dabaa719748167b62ed4a820ede3e9f7be6dd9bf640fcd51f7431807d5
Python
30,183
847
"""Tests for Socket.IO room functionality.""" import asyncio import uuid import pytest import socketio from httpx import AsyncClient from zndraw_socketio import wrap from zndraw.exceptions import NotInRoom, RoomNotFound from zndraw.schemas import PresenceResponse, RoomCreateResponse from zndraw.socket_events import ...
bc4e2719054453c92307e140b192f42c21dd55cd465f5320ec0ee420b3baaadf
Python
30,198
834
""" 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 import sys import time import numpy as np import torch import torch.nn as nn from ocpmodels.common.registry import registry ...
732eee48370fc27d6db67007e00f8cc8170b3d1e0746715ac8080b307467ee82
Python
30,209
825
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmcv.cnn import ConvModule from mmengine.registry import init_default_scope from mmseg.models.backbones.unet import (BasicConvBlock, DeconvModule, InterpConv, UNet, UpConvBlock) from mmseg.models.ut...
02553f95c46d0b622228fdbdebaa30294fc8df1027c47e61529f737a495a8f24
Python
30,281
1,043
from ocpmodels.common.utils import setup_imports import torch import itertools import json import hashlib import os import torch.nn as nn import torch.optim as optim import torch_geometric import torch_scatter import torch.multiprocessing as mp from torch.utils.data.distributed import DistributedSampler from torch.util...
7bc557083ec3305206e10bb6753da7b5ee09718a71ea269ca431b6a229e48a80
Python
30,318
767
"""Independent Bruker TDF2 reader for macOS/Linux/Windows. The module reads ``analysis.tdf`` with Python's standard-library SQLite driver and decodes ``analysis.tdf_bin`` itself. It does not import OpenTIMS, AlphaTims, NumPy, pandas, or Bruker's TDF-SDK. Python 3.11 does not include a ZSTD decoder, so compressed fra...
0975763cbb6515fc5369cdcdf5f770b04f70e27de9681434352b7c3c6734a6d2
Python
30,343
889
#!/usr/bin/env python # -*- coding: utf-8 -*- # tests/run_docbuild_tests_and_cover.py ################################################################################ # EncoderMap: A python library for dimensionality reduction. # # Copyright 2019-2024 University of Konstanz and the Authors # # Authors: # Kevin Sawade #...
f280919beb3ed916d272ebac4934dfd3f13e179fdb7c2d3e3b4e0dc83b4f113b
Python
30,371
819
""" 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 datetime import errno import logging import os import random import subprocess from abc import ABC, abstractmethod from collections imp...
3bb7f8fb4111a2bbd7e30b14a55744ed940922a59f7423247aa1e978e8c916b5
Python
30,385
620
import os import numpy as np from tqdm import tqdm from collections import OrderedDict import pandas as pd from sklearn.metrics import adjusted_rand_score import scanpy as sc import torch from torch import nn from torch.utils.tensorboard import SummaryWriter from torchvision.models import resnet50, densenet121, swin_s,...
a2ac071e61c5242dd08c15045ed2e6a5e446a92050e6f138e98aae56a416f35c
Python
30,403
808
import filelock import os import os.path as op import logging from math import nan import shutil import sys import random import re from .due import due, Doi from .utils import ( read_config, load_json, save_json, write_config, TempDirs, safe_copyfile, safe_movefile, treat_infofile, ...
0c9d0bfff06a931fb69d5fc7e43b05432384e0eae39c34e5eb304118b8b5d470
Python
30,526
563
# pytest unit tests for sct_analyze_lesion import os.path import shutil import pytest import logging import math import pickle import numpy as np from scipy.ndimage import center_of_mass from spinalcordtoolbox.image import Image from spinalcordtoolbox.utils.fs import extract_fname from spinalcordtoolbox.utils.sys i...
d852c3ff1187594dae163357d29c38b0c6579b728f92eb1b69172d362ee3cfe5
Python
30,544
610
# The DuckDB exporter can be used to export particular intermediate files into the # in-process database engine DuckDB (https://duckdb.org) for future querying. import os.path import stat import tempfile from contextlib import contextmanager from pathlib import Path import duckdb from src.memory import _bytes_to_gib,...
2ed2d1e81059c7ebe221f1ce8641fa9fbf4b0f4e481bee62366ef6ca35051d65
Python
30,574
762
import random import scipy.sparse as sp import torch import torch.nn as nn import sys import pickle as pkl import torch.nn.functional as F import pickle import os import yaml from sklearn.svm import SVC import numpy as np from sklearn.utils import shuffle import networkx as nx from scipy.linalg import fractional_matrix...
b8124de26a554b3576fc7d80104c21b047812ebdd5e6d4c8123b6583e0504e9c
Python
30,601
899
""" Classical KGX graph summary module. """ from typing import Dict, List, Optional, Any, Callable import re import yaml from json import dump from json.encoder import JSONEncoder from deprecation import deprecated from kgx.error_detection import ErrorType, MessageLevel, ErrorDetecting from kgx.utils.kgx_utils impo...
d657e4679d6c11678c6616fd99b4fbc516484144423de501d029a4bad1034134
Python
30,646
736
# Copyright (c) OpenMMLab. All rights reserved. from functools import partial from typing import Dict, List, Tuple import torch import torch.nn as nn from mmcv.cnn import ConvModule, build_norm_layer from mmcv.cnn.bricks.transformer import BaseTransformerLayer from mmcv.ops import point_sample from mmengine.dist impor...
7905719a4ddbd31a1f0ac4650be8690720aafc621bb7dd34ed3e3c160d0cdd66
Python
30,655
847
""" Functions for computing metrics from neuroimaging data. License: BSD-3-Clause Author: Hanna M. Tolle Date: 2024-10-31 """ import sys sys.path.append('../') import os import numpy as np import pandas as pd from typing import List import glob from nilearn import datasets from nilearn.maskers import NiftiLabelsMa...
0ed5383a98b4ed4e4d0f1d89d166e7839bc31e49228d1b2d754127228bf82ef3
Python
30,841
761
# -*- coding: utf-8 -*- import json from django.contrib.auth.models import Permission from django.db import connection, transaction from django.http import JsonResponse from django.test import TestCase, TransactionTestCase from django.test.client import Client from guardian.shortcuts import assign_perm from guardian....
6854821402c59468de5e3c1e036403a97050db7ff3ec4e654c03b64e938a4208
Python
30,847
737
# Stack manipulations # Author: David Young, 2017, 2019 """Import and export image stacks in various formats. """ from collections import OrderedDict import os import glob from typing import List, Optional, Sequence import numpy as np from skimage import transform from skimage import io from matplotlib import animati...
4771d84a7a96ba6b5b7aa0a20699567ed97570424d61e653fca58484438cd6e8
Python
30,876
862
import gzip import typing from typing import Set, Dict, Union, Optional, Any, Tuple, List, Generator import rdflib from linkml_runtime.linkml_model.meta import SlotDefinition, ClassDefinition, Element from rdflib import URIRef, RDF, Namespace from kgx.error_detection import ErrorType, MessageLevel from kgx.prefix_man...
36dbe9c5a9c49d09be0f235c600941f904bd6952e56773afd1e95926b4083055
Python
30,963
915
from functional import compose, partial from functools import reduce from scipy.ndimage import rotate as scipy_rotate import copy import glob from . import constants as const import nibabel as nib import numpy as np import os import pickle import pydicom import scipy.interpolate as interp import scipy.stats as stats im...
9415b3530eddf35c30543fc4a470b53445133d6911bba20d770d7879e63545c2
Python
31,037
790
""" Functions for performing SPICE-based electrical simulation of a neuron given its synapses and skeleton using a simple linear passive model. Try the `interactive simulation tutorial`_ for a tour of basic simulation options. .. _interactive simulation tutorial: notebooks/SimulationTutorial.ipynb .. note:: Th...
47ac61a00aeb3648f6f2cd62c6ce48f0f0ef16bf7a79f3e5983847f42491dc81
Python
31,074
821
import logging import time import math import hydra import numpy as np import torch import torch.nn as nn from omegaconf import omegaconf from pyexpat.model import XML_CQUANT_OPT from fairchem.core.common.registry import registry from fairchem.core.common.utils import conditional_grad from fairchem.core.models.base i...
62c1fa4f9493d9178838131e427969f285826fa5506429cc11990e30edbe167c
Python
31,081
711
# Blob verifications against ground truth import os from typing import Optional, Sequence, Tuple import numpy as np from scipy import optimize from scipy.spatial import distance from magmap.cv import colocalizer, detector from magmap.io import df_io, libmag, sqlite from magmap.settings import config from magmap.stats...
f8801e26df065e780ba6a41e8eb9519c6c10489bd6f1b916cf2b7551baa5b9f4
Python
31,093
958
# Copyright (c) OpenMMLab. All rights reserved. import math import warnings import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule, build_activation_layer from mmcv.cnn.bricks.transformer import build_dropout from mmengine.logging import print_log from mmengine.model import ...
34bc2f489ef5077e068bd5dd73c043718b424349bd516a6e70c3f6e9a11de03b
Python
31,128
768
## ## CPCantalapiedra 2019 from os.path import isfile as pisfile import sys import time from collections import defaultdict, Counter from ..emapperException import EmapperException from ..common import get_call_info, get_data_path, ITYPE_PROTS, ITYPE_CDS from ..utils import colorify from ..search.hmmer.hmmer_seqio im...
126e03d478f9d4c78026b6470b541a78776a70ff0ad6101a9fa7fc974156458b
Python
31,220
1,045
import numpy as np from matplotlib import pyplot as plt from matplotlib.gridspec import GridSpec from myphdlib.general.toolkit import smooth, psth2 from sklearn.decomposition import PCA from scipy.ndimage import gaussian_filter as gaussianFilter from scipy.ndimage import zoom from scipy.interpolate import interp2d impo...
808e507607299979208ddf45b5ca7ed566d790a8f4348d35369c5fe15df02e52
Python
31,267
788
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors, and NVIDIA. # # 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 ...
6497a3b46e0be31b20da2f932bff5aa926c4235756825684041205a6b144ed80
Python
31,285
834
import warnings import numpy as np import pandas as pd import networkx as nx import torch import copy import itertools from pymatgen.core import Element from pymatgen.core.structure import Structure from pymatgen.core.lattice import Lattice from pymatgen.analysis.graphs import StructureGraph from pymatge...
2c83783133049e416ce01490f3cf9812778bd8e546edc7c7094bb5c5774680fd
Python
31,301
691
import os import numpy as np import datetime from typing import Sequence, Dict, Optional, List, Any, Tuple, Callable, Union from argparse import ArgumentParser import pandas as pd import math import sklearn.metrics import matplotlib.pyplot as plt import torch from torch_geometric.loader import DataLoader import torch.n...
ade022b8fe2bd68576389aa98ee123a7709f52d40bbad132f9dfdfef405eeeeb
Python
31,310
853
# -*- coding: utf-8 -*- """ Created on Sat May 23 10:38:20 2020 @author: george.dickinson@gmail.com This program is a Python script developed to analyze the motion of intracellular Piezo1 proteins labeled with a fluorescent tag. It allows the user to load raw data from a series of image files and track the movement o...
181cf825b43b3278ba168865aa380cb86f2cfb8ca92c334fc21db26c9b95d2e2
Python
31,380
794
import itertools import json import logging import os from pathlib import Path import neurokit2 as nk import numpy as np import pandas as pd # from . import get_logger, set_logger_level # def get_logger(name=None): # """Return a logger to use""" # return logging.getLogger("physio" + (".%s" % name if name els...
eb7db0a4d0d7efec411d3b5b7039719111c18ec15702ec9ce6f7061654e1c9e3
Python
31,426
704
''' Computes GRAIL patterns for all patients with all fold models. Does not cluster results and only saves mean alignment values. Additionally, computes fold-wise performance of each model and saves it. Dependencies: - data/raw/receptor_maps/f{atlas}/f{atlas}_receptor_maps.csv Authors: Hanna M. Tolle Date: 2025-05-03...
9e4f3f86fc3f20258a677ebbec3fc120e2a8f74c5d388d79b396e6a9e80837f6
Python
31,473
512
# This document holds the functions used as part of # the poro-mechanical modelling of living tissues # according to the theory in ./Theoretical_Developments.pdf # Theta Wilson method # Author: Thomas Lavigne # Date: 18/09/2024 # def readme_VFTW(): print('This document holds the functions used as part of the poro-m...
d2a800583f5a545397b18386c3e5734bae20c8a4bb88137a4a18284b3601fae4
Python
31,486
883
import json import os import pickle import sys import urllib from collections.abc import Generator from pathlib import Path from typing import IO, Any, cast import arcp import bagit import pytest from rdflib import Graph, Namespace, URIRef from rdflib.namespace import DC, DCTERMS, RDF from rdflib.term import Literal ...
c72d94b29813da98b8dc759368fa434afa3e62e1d2331fcbc0c390e77e6da2b0
Python
31,579
759
# coding=utf-8 # Copyright 2021 The IDEA 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 a...
64f299df0d5673a67bad77aa4a57842194baf3b2c4bf55c1231a470337e81fa6
Python
31,598
703
try: import cPickle as pickle except: import pickle import gzip from hippounit import plottools import matplotlib.pyplot as plt import os import numpy import seaborn as sns big_errors_spiking = [] all_features = [] spiking_features = [] base_dir= '/mnt/csoport31-2/Modellezo_csapat/CA1_pyramidal/Spine_project...
e33f720b58f34ca09f3b2f4f7caa77b03b03c738d31b4a911a253f5658bba1d0
Python
31,671
904
import json import logging import os from collections.abc import Sequence from pathlib import Path import numpy as np import pandas as pd logger = logging.getLogger(__name__) RAISE_ISSUE_URL = "https://github.com/LernerLab/GuPPy/issues/new" _RUN_FOLDER_PREFIX = "output_" _RUN_NAME_MARKER = "_" + _RUN_FOLDER_PREFIX ...
59a2ed95b82157685c12e90d81994d93a5843425dc8f88bb305614e00f4e3812
Python
31,688
628
# Copyright (c) ByteDance, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import argparse import os import sys import datetime import time import math import json import numpy as np import utils i...
81293d739248f3e18cf08e9edd35d03bb2b868a2d063d79ad31b38cf6cae04d8
Python
31,710
741
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
d7c354d5161167621f4c271b71d3dea44f72bc2a9e78c87d23e7ff326de87f5c
Python
31,832
792
# -*- coding: utf-8 -*- """Pooling layers. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from .. import backend as K from ..engine.base_layer import Layer from ..engine.base_layer import InputSpec from ..utils import conv_utils from ..legacy import int...
ec7f73402ee88013a29a7f37bb3f795e5f1e93062ab1309667ae6e9078b344de
Python
31,835
709
# This script reads the replay files and evaluates the performance. import yaml import os import pickle from copy import deepcopy import pandas as pd import numpy as np import matplotlib.pyplot as plt import torch import datetime import time from ev2gym.models.ev2gym_env import EV2Gym from ev2gym.baselines.heuristic...
17afef16b3f1ef18696a3c9d0e067cf42e2e27e301cb44ad56deac01a7bdc60f
Python
31,902
965
"""Tests for Frame REST API endpoints.""" from typing import Any import ase import msgpack import pytest from helpers import ( auth_header, create_test_room, create_test_user_in_db, decode_msgpack_response, make_raw_frame, ) from httpx import AsyncClient from sqlalchemy.ext.asyncio import AsyncSes...
0d910a72b9f74f50602b1a68a020992a761e730d86df3a9722d598d0886f6b0d
Python
31,994
845
# Input/Output for SimpleITK/SimpleElastix objects # Author: David Young, 2019 """Input/Output for SimpleITK/SimpleElastix objects. Manage import and export of :class:`simpleitk.Image` objects. """ import os import shutil from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union try: import itk ex...
c39426bcb6d254b9c38fb70c0fbf0710b022b45746f5b062978863ed227a9bad
Python
32,012
830
""" 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 import os from collections import defaultdict from typing import Dict, Optional import numpy as np import numpy.typing as npt...
202daf7d1b034cd9f9dc82672a9a0be5c2ea73bbb671c5577ca342fad7b2f4a6
Python
32,026
625
from nilearn.plotting import view_img from pathlib import Path import pandas as pd import nibabel as nib import base64 from modules.plot_mosaics import get_axial_slices, get_coronal_slices, get_sagittal_slices, save_axial_mosaic, save_coronal_mosaic, save_sagittal_mosaic def save_report(output_file, svr_param...
30bff0a16e1672fd46b55ac82558398f2d1958752d2b6d342b9b6bde3b233e97
Python
32,034
684
import logging import re import shutil import warnings from pathlib import Path from typing import Any import h5py import numpy as np import pandas as pd from guppy.analysis.io_utils import is_channel_label from guppy.extractors import BaseRecordingExtractor from guppy.extractors.detect_acquisition_formats import _is...
0c40e04792c2bbe3f0e92c9dd9b6545ccf2801bcd5ce9fafa19d374191aa4e50
Python
32,137
902
# Author: Huaxu Yu # A module to annotate metabolites based on their m/z, retention time and MS2 spectra # imports import os import pickle import numpy as np import pandas as pd import json from tqdm import tqdm from ms_entropy import read_one_spectrum, FlashEntropySearch from .utils_functions import extract_signals...
d0091f63e95fe3661f99e76e75438ee5caf94997c672136592705ddf7577f46c
Python
32,138
783
########################################################################################### # Training script for MACE # Authors: Ilyes Batatia, Gregor Simm, David Kovacs # This program is distributed under the MIT License (see MIT.md) ####################################################################################...
f0c069f10e73be2433eaf6cc373c3e59ab7a47dabe9bdec32ff17373b49e07a8
Python
32,176
1,136
import importlib import re import time import uuid import sqlite3 from enum import Enum from functools import lru_cache from typing import List, Dict, Set, Optional, Any, Union import stringcase from inflection import camelize from linkml_runtime.linkml_model.meta import ( TypeDefinitionName, EnumDefinition, ...
57e93ea4a5fcb92f0d4479de6555160aa1e38f454a8807f8ebb5dcef5954a45e
Python
32,267
744
import copy import datetime import logging import urllib import uuid from collections.abc import MutableMapping, MutableSequence, Sequence from io import BytesIO from pathlib import PurePath, PurePosixPath from typing import TYPE_CHECKING, Any, TypedDict, cast from cwl_utils.types import ( CWLDirectoryType, CW...
845d447551e7244cb4e1dfbcba74e17ffda323022ee3df037d07c339dfe14b87
Python
32,270
831
import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import numpy as np import pandas as pd from rdkit import Chem import torch from torch.utils.data import IterableDataset import dgl import random from dgl.dataloading import GraphDataLoader from rdkit.Chem.BRICS import Fin...
aa6e6e81080ed85e362327ec97d5d5215832306d6ece55e843b9a1e77c5ce6c1
Python
32,287
831
import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import numpy as np import pandas as pd from rdkit import Chem import torch from torch.utils.data import IterableDataset import dgl import random from dgl.dataloading import GraphDataLoader from rdkit.Chem.BRICS import Fin...
7322fbb584e27ffa832040057ce7ba2c52c765d2ced14aa50579af84394c3c63
Python
32,296
881
import merlinth import numpy as np import torch import wandb import os import glob import ants import matplotlib.pyplot as plt import h5py import nibabel as nib import warnings from medutils.mri import ifft2c, rss from scipy.stats import linregress from scipy.ndimage import binary_erosion from skimage.metrics import pe...
56d0392879ceb3734d17620fb855e0b7282c7892ced1260217286b758201937e
Python
32,297
679
from django.db import migrations, models import django.contrib.gis.db.models.fields forward = """ -- We rewrite the table from scratch, because all indices have to be -- rewritten anyway. This also allows us to regenerate all indices in one go -- and check all constraints also only once at the end. The ne...
26402e748eef78bc7f3206b8bec3b6a72c70be72f5ae30a16b789db3c4b5bb11
Python
32,307
1,193
import numpy as np from matplotlib import pylab as plt from matplotlib import widgets as wid from matplotlib import lines from matplotlib.backend_bases import MouseButton from matplotlib.colors import LinearSegmentedColormap import matplotlib as mpl def removeArrowKeyBindings(): """ """ pairs = ( ...
fc21590096649933d84c5a4a9fb0706e0c28346fc7f571f6709ec2143987beac
Python
32,341
686
import argparse import contextlib import json import os import platform import re import subprocess import sys import time import warnings from pathlib import Path import pandas as pd import torch from torch.utils.mobile_optimizer import optimize_for_mobile FILE = Path(__file__).resolve() ROOT = FILE.parents[0] # YO...
7fadcc4bb27caa5ca2e2d95b73c763d94dd7dc88c136ceba54315bd91b79fde5
Python
32,367
743
from typing import Any, Dict, List import hydra import numpy as np import omegaconf import pandas as pd import torch import pytorch_lightning as pl import torch.nn as nn from pymatgen.core import Structure from torch.nn import functional as F from torch_scatter import scatter from tqdm import tqdm fro...
d64b5a231cbedea72b16b9844c341490ab729dd3afe24c5ea614cd28ba84344a
Python
32,468
792
# Microscope profile settings # Author: David Young, 2020 """Profile settings for processing regions of interests. These setting typically involve high-resolution such as microscopy images. """ from magmap.settings import config from magmap.settings import profiles from magmap.settings.profiles import RegKeys class...
e47f1d06112fb2bcdbcceadd2a455eab4d40ecc37fcb92bb34732680751f2d86
Python
32,480
602
#!/usr/bin/env python '''convert behavioral file into event lists and singletrial format - regressor of interest per task - duration of epoch - rating onset - potential covariates? ''' # %% import numpy as np import pandas as pd import os, glob, re, json from os.path import join from pathlib import Path import argpar...
0d8ffe92b4f434544124ff63f3e97d7e21271f2fdb77d1547324346e1ea8d9db
Python
32,541
797
import os, datetime, mne import numpy as np import scipy as sp import pandas as pd import nibabel as ni from fooof import FOOOFGroup, sim import matplotlib.pyplot as plt from surfer import Brain from mpl_toolkits.axes_grid1.inset_locator import inset_axes from seaborn import despine from scipy.stats import pearsonr, sp...
3e256bdd2ce779f0651b9bdc85d837f5d579b12158737890fa75d528c23f711f
Python
32,575
906
"""REST API manager for the ZnDraw client.""" from __future__ import annotations import json import logging from dataclasses import dataclass, field from typing import TYPE_CHECKING, Any import httpx import msgpack from zndraw.exceptions import PROBLEM_TYPES, ProblemDetail, RoomLockedError, ZnDrawError if TYPE_CHE...
fb26019b46f794d70308faff5f77c9d991ae4cba2683995d9c3fa57bc00a5257
Python
32,752
919
""" This module implements all the read modifications that cutadapt supports. A modifier must be callable and typically implemented as a class with a __call__ method. """ import re import logging from collections import defaultdict from types import SimpleNamespace from typing import Optional from collections.abc impo...
76f06d85cf30d4d940f702c863a2252c3a4b2fdca3f4772f97e51ec69208a774
Python
32,893
1,109
# pylint: disable=invalid-name, too-many-lines """Utilities for data generation.""" import gc import multiprocessing import os import string import zipfile from concurrent.futures import ThreadPoolExecutor from dataclasses import dataclass from typing import ( TYPE_CHECKING, Any, Callable, Dict, Gen...
7b26ca1dd0fa7a2b279bef0e127414fa75a9f3fbd4c913b110ce2fe467b01307
Python
32,910
950
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import inspect import pprint from abc import ABCMeta, abstractmethod from typing import Any, Callable, List, Optional, TypeVar import numpy as np import torch from .transform_util import to_float_tensor, to_numpy __all__ = [ "BlendTransfor...
8782cda9e6a4f2268e63ca7d3a2eb8441f88133aa48ab5e669a1abb1d7a1a825
Python
32,936
847
'''create JSON/ACC files for Arbor from a set of BluePyOpt.ephys parameters''' # pylint: disable=R0914 import io import logging import pathlib from collections import ChainMap, namedtuple, OrderedDict import re import jinja2 import json import shutil from bluepyopt.ephys.acc import arbor from bluepyopt.ephys.morpho...
6ada4924bc587d65d7128d5309b3a471b881c797e492993abb15c0ae488cbb21
Python
32,968
884
## The following code contains work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105. ## Additionally, we waive copyright and related rights in the utilized code worldwide through the CC0 1.0 Universal public domain dedication. import pprint from copy import deepco...
5c3c991f4de67fd34db5144d1a72ada196cb2b73cb0de2a0678304120a1dde27
Python
32,984
589
import numpy as np from grid_cell.util import select_arr_by_t, get_data_filename_by_keywords, reduce_true_elements, digitize_arr from sklearn import random_projection import grid_cell.tuning as gct import matplotlib.pyplot as plt from scipy.ndimage import gaussian_filter from sklearn.decomposition import PCA from scipy...
02e14ef8181d5d15258a3f0359ed785b10050254f1314f35fc663405cf374a4a
Python
33,026
952
"""create JSON/ACC files for Arbor from a set of BluePyOpt.ephys parameters""" # pylint: disable=R0914 import io import logging import pathlib from collections import ChainMap, namedtuple, OrderedDict import re import jinja2 import json import shutil from bluepyopt.ephys.acc import arbor from bluepyopt.ephys.morpho...
8d3c1b1191512774a749fe1f5fdbd97a71b4015a79203853d3e4181c2bb7207a
Python
33,107
872
import pandas as pd import numpy as np import os from tqdm import tqdm from scipy.stats import pearsonr import matplotlib.pyplot as plt import seaborn as sns import sys import warnings import textwrap from adjustText import adjust_text GREY50 = "#7F7F7F" GREY30 = "#4d4d4d" # Loading data should have para for differen...
a81f85678e5a362043b80c88c6870c00fb50191628a11f741861a835ad082ddd
Python
33,159
719
""" Author : Alexis Lebrun (PhD student) School : Université Laval (Qc, Canada) This module provides neural network model specifically designed for the classification of vibrational spectra. """ import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import warnings import tensorflow as tf from tensorflow import keras fro...
5b95b8b1daca5f6f0bb947dafb76f2e3802e952e73b4cefde2e7c7e18bfa9254
Python
33,181
777
""" Functions for UV melting analysis """ import numpy as np import pandas as pd from scipy import stats import os, json import matplotlib.pyplot as plt from matplotlib.ticker import (MultipleLocator, FormatStrFormatter, AutoMinorLocator) from matplotlib.backends.backend_pdf imp...
3581131292e694d188114716271134199ee6a75c87f56d4ce74e2df2b9c7278e
Python
33,182
769
# coding=utf-8 # Copyright 2022 IDEA-CCNL The HuggingFace Inc. team. 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 # ...
eced0096259cd8cc3c4c538abf52bc2ceb6c161b46c2d162084135a522267a2a
Python
33,190
896
""" Routines for printing a report. """ from dataclasses import dataclass from io import StringIO import textwrap from collections import defaultdict, Counter from typing import Any, Optional from collections.abc import Iterator, Mapping from .adapters import ( EndStatistics, AdapterStatistics, FrontAdapte...
7613acb9581d509b05ec9436af707181e5575da3345cbd02d064593690ce91e6
Python
33,254
751
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-08-17 19:09 from django.db import migrations # Create view generating functions and a new version of the history table # creation function, which implements history table initialization in a # separate functions (which makes future changes easier). As part o...
631415030187ae8572724e62850da51be6eba2ca41e9abad643d825e2acd9ef1
Python
33,266
599
#!/usr/bin/env python2.7 import os, sys os.environ["OMP_NUM_THREADS"] = "1" os.environ["OPENBLAS_NUM_THREADS"] = "1" os.environ["MKL_NUM_THREADS"] = "1" os.environ["VECLIB_MAXIMUM_THREADS"] = "1" os.environ["NUMEXPR_NUM_THREADS"] = "1" import argparse import shlex import shutil import glob import re import traceba...
1ac7e5a26dc10995651f1c0078f8eaae6708aeecc05bce097670e459f61e4293
Python
33,315
636
""" Custom object and error types. Copyright (c) 2013 Polytechnique Montreal <www.neuro.polymtl.ca> License: see the file LICENSE """ from operator import itemgetter from numpy import dot, cross, array, einsum, stack, zeros from numpy.linalg import norm, inv import numpy as np import scipy class Coordinate: ""...
7e631e5d319466f3b5001b4668c51f14f51c65c0786613d8c746be42b4401d86
Python
33,471
761
import os import sys import time from pathlib import Path from typing import Optional import numpy as np import torch import mrcfile import typer from tqdm import tqdm from torch.utils.data import DataLoader from torch.utils.tensorboard import SummaryWriter # from torch_geometric.nn import knn_graph, radius_graph fr...
7de43dca4ef79b3817a453984dd9b471aee1235f445ce0ff9881cf24852c54af
Python
33,478
751
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
637d1ed2f5de1ff5b63c2753a2b892960030479064e0da678b39695fe1bbc973
Python
33,484
852
import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import numpy as np import pandas as pd from rdkit import Chem import torch from torch.utils.data import IterableDataset import dgl import random from dgl.dataloading import GraphDataLoader from rdkit.Chem.BRICS import Fin...
cfc0041f0c910fb67ff2902ac8a9795ba618d49651762e28b64c055943d7bb58
Python
33,501
764
from PyQt5.QtWidgets import (QVBoxLayout, QHBoxLayout, QWidget, QAction, QStyle, QLabel, QComboBox, QApplication, QTableWidgetItem, QTableWidget, QMenuBar, QLineEdit, QPushButton) from PyQt5.QtGui import (QIntValidator, QDoubleValidator, QColor) from PyQt5.QtWidgets import QFileDialog impo...
4d1fccf213e2323a2c7df5f51f90f8da6ea4adf840241fd9dae8495897d29177
Python
33,525
897
""" Define the training pipeline Do not import from `nnn` as those use a different environment """ import os import torch os.environ['TORCH'] = torch.__version__ import numpy as np import pandas as pd from scipy import stats import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator import seaborn a...
1de6a7cd586a34b9e1fd2596c4dace4abadb3ea01fa51e72bcaeffc0c59ae432
Python
33,551
787
# Code is adapted from the PyTorch pretrained BERT repo - See copyright & license below. # Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not ...
880216880bea7a2d918a12f182d3da8be596b7111a68f942ed475c72a4adb760
Python
33,552
1,006
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import import os import random import numpy as np from PIL import Image import pickle import csv import warnings import tensorflow as tf try: #py3 from urllib.parse import urlparse from urllib import request except: #py2 from...
85db71eae5007ec812bb8778f71c5196f58204e4db688e60286fb34fdd9db58b
Python
33,561
1,006
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import import os import random import numpy as np from PIL import Image import pickle import csv import warnings import tensorflow as tf try: #py3 from urllib.parse import urlparse from urllib import request except: #py2 from...
5d199d183f837331fe9d6627c3c36d492d8e4d063c689cdefe4c1730656dca7f
Python
33,575
718
"""Contract tests for DoricRecordingExtractor.""" from pathlib import Path import h5py import numpy as np import pytest from guppy.extractors.doric_recording_extractor import DoricRecordingExtractor from .recording_extractor_test_mixin import RecordingExtractorTestMixin # ------------------------------------------...
7e9bef7aca0ba4e0da1c65c62da8063dc799bfe5f6900ebaeb75f9307ec5f30c
Python
33,649
984
#!/usr/bin/env python """ Module for calculations related to grid manipulations. This is temporary, functions should be organized in separate files. """ import numpy as np import mrcfile as mrc import torch from typing import Tuple, Union, TypeVar, List from scipy import interpolate import matplotlib.pylab as plt T...