sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
c3939cd01ef0a4c01458118316ca15dc27aece70dadf48286be9892f3f5a1a52 | Python | 21,540 | 463 | # Class to instantiate Esser model network
from neuron import h
import numpy as np
import cell_esser
cvode_i = h.CVode()
cvode_i.use_fast_imem(1)
class net_esser:
def __init__(self, params, seed_con, seed_tms, seed_input, tstop, delay_jitter, tstart=0):
self.params = params
self.seed_... |
603a4868e2fd6e60d09c7de8dd9d603da90157c9608d34659690ef50570f460d | Python | 21,543 | 587 | #!/usr/bin/env python3
# ******************************************
#
# SHARC Program Suite
#
# Copyright (c) 2023 University of Vienna
#
# This file is part of SHARC.
#
# SHARC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... |
8b5fe29e98d9c1d49fcf1d95df560c4b77682085d5ec2ff125f9287effe8bd3a | Python | 21,550 | 544 | import itertools
import bpy
import databpy
import numpy as np
import pytest
from databpy import ObjectTracker
import molecularnodes as mn
from molecularnodes.nodes._utils import get_final_style_nodes
from .constants import data_dir
from .utils import NumpySnapshotExtension
@pytest.fixture
def density_file(isolated_de... |
da33b3c7395db4efab89e9b1997af7e11b289aec021084b6724847db5c0295e3 | Python | 21,553 | 497 | from __future__ import division
from __future__ import print_function
#!/usr/bin/python
from builtins import range
from past.utils import old_div
import os
import re
import glob
import sys
import argparse
from subprocess import call
import stat
import h5py
import hdf5storage
import APT_interface as apt
import numpy as... |
b7676adce7403d7cd3eb93513330928505e6463dbbf4f5e68da516158c68f7a6 | Python | 21,556 | 745 | from typing import Union
import numpy as np
from numpy.typing import NDArray
from sklearn.cluster import AgglomerativeClustering
from pyntbci.utilities import correlation, find_worst_neighbour
def is_de_bruijn_sequence(
stimulus: NDArray,
k: int = 2,
n: int = 6,
) -> bool:
"""Check whether a stimulu... |
f2a19524e1c9ec31c2b12190bf9c94e1ac06a5463f568c6cf4b8459b580694aa | Python | 21,565 | 504 | """Look at a fitted midsagittal plane before it is committed.
MAINTAINER-side only, driven by ``scripts/fit_hemisphere_planes.py``. Every
plane that ships in ``planes.json`` is confirmed here, once, by a person looking
at the anatomy - which is the entire accuracy argument for the hemisphere
feature. The design t... |
8db9107902532a120b1f20d37f4232d22458fdfa3985a9292d43337d82f3a838 | Python | 21,569 | 470 | from typing import Dict, Tuple, Union
from scipy.signal import butter, hann, lfilter
import numpy as np
from ..base_transform import EEGTransform
def butter_bandpass(low_cut, high_cut, fs, order=5):
nyq = 0.5 * fs
low = low_cut / nyq
high = high_cut / nyq
b, a = butter(order, [low, high], btype='ba... |
d597073763a0afc23e43b6fe472c3d08d78abef4eaeb0dd8c382db70ed11b822 | Python | 21,575 | 673 | # map.py
import sys
import pysam
import dnaio
import numpy as np
import pandas as pd
from pathlib import Path
from collections import defaultdict, Counter
from multiprocessing import cpu_count
from tempfile import _get_candidate_names
from umi_tools import UMIClusterer
from umi_tools import __version__ as umi_tools_ve... |
0a9172ca3747777dce9ab54dbb36d4451d2d4b1e45d3f48a4109f964f26ec5f4 | Python | 21,599 | 481 | import h5py
import numpy as np
import os
import time
import compartment
from common import \
gk, gna, gcl, ghco3, p_atpase, p_kcc2, h2co3_i, \
pw, vw, RTF, cm, F, h_i, kf
class Simulator:
def __init__(self, sim_type="New", new_file_name="", old_file_name=""):
"""
Initializing a new instan... |
761c44c88a1a2caa4905f0775d5277ee47284974d455164b93f4e6f4e2e33261 | Python | 21,607 | 590 | #!/usr/bin/env python
'''Plotting script for LFPs
'''
import sys
import h5py
import pandas as pd
import mesocircuit.mesocircuit_framework as mesoframe
import mesocircuit.plotting.plotting as plot
from mesocircuit.parameterization.base_plotting_params import rcParams
from mesocircuit.lfp.compute_mua import write_mua_fi... |
d8ff9f02b67a176c61835e76c9d760ec085311a5c3d933443363d369fbc820ca | Python | 21,612 | 555 | import re
import pytest
from elasticai.creator.file_generation.in_memory_path import InMemoryFile, InMemoryPath
@pytest.fixture
def saved_files(linear_layer, inputs):
linear_layer.forward(inputs)
linear_layer.eval()
linear_layer.precompute()
design = linear_layer.create_design("linear_0")
desti... |
aacf7ece80ea50fbea0795dec5d770cb9b0dbf2125c59aaed91679b8d28a0c06 | Python | 21,615 | 531 | """RANSAC bad channel identification."""
import mne
import numpy as np
from mne.channels.interpolation import _make_interpolation_matrix
from mne.utils import check_random_state
from pyprep.utils import (
_correlate_arrays,
_get_random_subset,
_mat_round,
_print_progress,
_split_list,
_verify_f... |
0a7c8864dd73e6441c397bc3297bff5666505b68f992d4cd116cc66aa517e324 | Python | 21,630 | 528 | import os
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from nibabel import Nifti1Image
from nilearn.maskers import nifti_spheres_masker
from nilearn.signal import clean
from nilearn.masking import apply_mask, _unmask_3d, compute_brain_mask
from nilearn.image import load_i... |
d268fef7b769f29a58183a54a9940fdbfb398bdbc6c21c94b211871a3be6f941 | Python | 21,631 | 613 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Copyright (C) 2012 Computational Neuroscience Group, NMBU.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at you... |
ee946d77c32960ffa5e91803e4db8b6c2050d5fe8920fe999af2bc6691ad7db9 | Python | 21,631 | 383 | import sys
assert('neuron' not in sys.modules)
import os
nrn_options = "-nogui -NSTACK 100000 -NFRAME 20000"
os.environ["NEURON_MODULE_OPTIONS"] = nrn_options
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.animation as animation
imp... |
1654363e53943ba011c6720077e5353f8a7d147ce121703914d38320d9d9287c | Python | 21,637 | 460 | """Combine the schemas of a merge group into one vocabulary (HED spec 3.1.2.4).
Loading a version specification has three separable steps, and this module owns the last two:
1. Resolve each version string to a file (``hed.schema.hed_schema_io`` and the cache).
2. **Prepass** (:func:`resolve_group`): construct a loade... |
bf5c6cb90089b2c441610a6e67b56ee570025f96708b0108aebd464d1c2c88af | Python | 21,648 | 409 | # -*- coding: utf-8 -*-
"""
Created on Tue May 31 10:09:38 2022
@author: Dalton
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pickle
import dill
import os
import glob
import math
import re
import seaborn as sns
from sklearn.decomposition import PCA
from sklearn.pr... |
663e035054da403abd7247357228cde09cc16fac1cac1b6411d3a141b0805731 | Python | 21,650 | 601 | from traceHandler import *
from modelHandler import *
from optimizerHandler import *
from optionHandler import optionHandler
from scipy.interpolate import interp1d
from scipy import linspace
import time
import numpy
class coreModul():
"""
This class is responsible to carry out the main steps of the optimization proc... |
82b4262b7887adb08d2fef903d0db04775595835a0b04b9bcc80c5aaec39b0b9 | Python | 21,654 | 592 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
d70bd7ab28f2294457c62e797f442bfcb73a4b137fa850baa2e16859f8859885 | Python | 21,671 | 589 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
165f4c4d37235d01910941d4db3a8e5d2c2117dd1b236a68a076e49d5ded1c02 | Python | 21,677 | 552 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from dnc import DNC
from layers import GraphConvolution
import math
from torch.nn.parameter import Parameter
class GCN(nn.Module):
def __init__(self, voc_size, emb_dim, adj, device=torch.device('cpu:0')):
super(GCN, self)... |
3d386442e118efdaa30f9ac62b9b39837d58c86d1f6ba98b22d3b5ee9cd6b0a8 | Python | 21,690 | 601 | from __future__ import annotations
import os
from typing import TYPE_CHECKING, Optional, Literal
import joblib
import numpy as np
import pandas as pd
from sklearn.compose import make_column_selector
import cuppa.compose.pipeline
from cuppa.constants import SUB_CLF_NAMES, META_CLF_NAMES, LAYER_NAMES, CLF_GROUPS, PRED... |
75a32a654e79f54550d3d8443ed26c2517b3947d02685b9719e66d0f3695aa5c | Python | 21,694 | 440 | from typing import Any, Dict, List, Tuple
import pytorch_lightning as pl
import torch
import torch.nn as nn
import torchmetrics
from torch.utils.data import DataLoader
from torchmetrics import MetricCollection
from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint
import os
_EVALUATE_OUTPUT = List[Di... |
7cf92414943260edcc149cfdfc44e7abba2fa7efe95de7b5deeac8b9ffeb61cf | Python | 21,702 | 595 | import pandas as pd
import numpy as np
from pyfaidx import Fasta
import torch
from torch.nn import functional as F
import tqdm
import gffutils
import logging
IN_MAP = np.asarray([[0, 0, 0, 0],
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
... |
0e7ddce577d24b7b1f125d283d5617d32a13967b84b2de606d6b6d984ef799e6 | Python | 21,706 | 721 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
eb882e4865bf9e2cf25ad07c827b9c689cb1894a413b206d6326ca46f18695af | Python | 21,708 | 456 | """
D02_DECAY_AND_ORIENTATION.py
D-02 without picking a number.
The project's effective-sample-size correction currently assumes a clustering rule
(a 640 nm Euclidean ball plus connected components, or a 640 nm grid). Both are
choices. This script replaces the choice with a measurement, and tests whether the
shape of... |
e477c21c216143e42ca814644088a46a7215529b1e68169d79a8a70df16e294f | Python | 21,716 | 519 | import os
import shutil
import sys
import random
import numpy as np
import torch
from torch import nn
from torch.optim.lr_scheduler import ReduceLROnPlateau
from e3nn.o3 import Irreps, Irrep
from .from_nequip.tp_utils import tp_path_exists
def set_random_seed(seed):
np.random.seed(seed)
torch.manual_seed(s... |
5d595abb09bf33fa9ca1653b661aa6f9befbbbcb603a1be57cea063dd9ad46ea | Python | 21,720 | 515 | #!/usr/bin/env python
# Copyright (c) 2019-2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
This module provides Challenge routes as standalone scenarios
"""
from __future__ import print_function
import math
import trac... |
88e929206454322f0de4531cda2a0083bd0007cfc1cdfd5df6fbcca3407bd022 | Python | 21,721 | 470 | import pandas as pd
from vedo import *
import colorcet
def basic_statistics(original_df, climate, obstacle, orientation, heat_SP, cool_SP):
"""
Reports the basic statistics for each diagram:
- minimum value encountered (and for which depth and height)
- maximum value encountered (and for which depth an... |
22a165e7eaab3d4134c47a9dbb18f361846b7522a48f1f5db8a0b5f8f974375e | Python | 21,728 | 460 | import os
import pickle
import sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import warnings
warnings.simplefilter("ignore")
import json
import time
import tqdm
import util
import pprint
import random
import torch
import scipy.stats
import numpy as np
import pandas as pd
from datetim... |
3a7e1d15f6691c983f1e45a4e20123370eab4e6e7d0a792bc5e9d72f5c0bd135 | Python | 21,734 | 420 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... |
0e42be31f130386a13f227dce7ef92326a55575e41bf9e0953108dbfb7cb38cc | Python | 21,737 | 478 | import pandas as pd
import numpy as np
import warnings
warnings.filterwarnings(action='ignore')
import pandas as pd
from sklearn import metrics
from sklearn.preprocessing import MinMaxScaler
from sklearn.utils import class_weight
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA
from sklearn.f... |
8a1ae91e142000b3504101e09ace627b1202f890726e6cfd460bd36530334679 | Python | 21,744 | 520 | import os
from sched import scheduler
import shutil
import sys
import random
import numpy as np
import torch
from torch import nn
from torch.optim.lr_scheduler import ReduceLROnPlateau
from e3nn.o3 import Irreps, Irrep
from .from_nequip.tp_utils import tp_path_exists
def set_random_seed(seed):
np.random.seed(s... |
eed55eff9a4ccbfd9dfff897e6ee9e6f98a5517326658919b94f4e5ad97d4bf4 | Python | 21,746 | 567 | import math
import torch
from torch import autograd as autograd
from torch import nn as nn
from torch.nn import functional as F
from torch.nn.parallel import DataParallel, DistributedDataParallel
import sys
sys.path.append('..')
from models.vgg_model import VGGFeatureExtractor
_reduction_modes = ['none', 'mean', 'sum'... |
7cc3bf61b48a3ab5d206f35a938953d9ad0956eeca694a3a142eb4ec0eb78ec5 | Python | 21,747 | 432 | import numpy as np
import ast
import pdb
# import spiking function
from spiking_ulils import label_encoder
from spiking_ulils import Conv2d, BatchNorm2d, Relu
from spiking_ulils import Flatten
from spiking_ulils import Linear
import argparse
parser = argparse.ArgumentParser()
# quantization level
parser.add_argument(... |
629b9ba7cdf7f05d51be6e0f376488fe7288dcb99b34ec02d658a87ec6514d95 | Python | 21,749 | 413 | import sklearn.preprocessing
from sklearn.metrics import roc_auc_score,roc_curve,auc,accuracy_score,precision_recall_fscore_support,confusion_matrix
import matplotlib.pyplot as plt
from torch import nn, softmax
from model.model_local_global import LGMF_GNN
from dataloader_local_global import dataloader_lg,prepare_... |
6e0ad7ab6c6fc003c60b043719b14b2f5fe250f0881667960df806a03a87b04e | Python | 21,754 | 455 | #!/usr/bin/env python
# Copyright (c) 2019-2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Basic scenario class using the OpenSCENARIO definition
"""
from __future__ import print_function
import itertools
import py_tre... |
f97a9ca8d72c04c4331909948eb8a911e101c21d88a4a77311e3cacbe03c3df0 | Python | 21,755 | 642 | # --------------------------------------------------------
# --------------------------------------------------------
# Based on BEiT, timm, DINO and DeiT code bases
# https://github.com/microsoft/unilm/tree/master/beit
# https://github.com/rwightman/pytorch-image-models/tree/master/timm
# https://github.com/facebookre... |
f749ac8bf2633984b32149f7d89556ee1a4efba20f1608f14e84814a43e6b49c | Python | 21,759 | 524 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
7b732d6fa70c405e5433eaccd9cac4ed1497ad96a4b03ba764787d9767b6ab3e | Python | 21,773 | 564 | """Constructor for 3D TSE Imaging sequence.
TODO: add sampling patterns (elliptical masks, partial fourier, CS)
TODO: add optional inversion pulse
TODO: add optional variable refocussing pulses (pass list rather than float)
TODO: move trajectory calculation to separate file to shared with other imaging experiments (ne... |
03f1a089a15140f843655ddb1d29fd0ab0705b64e7c7f45f1968f3472487681b | Python | 21,792 | 651 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
815fc721846c20474dd5705d7b780eda454c326fc00d61efe7fc0d82c7961097 | Python | 21,806 | 546 | """RANSAC bad channel identification."""
# Authors: The PyPREP developers
# SPDX-License-Identifier: MIT
import logging
import numpy as np
from mne.channels.interpolation import _make_interpolation_matrix
from mne.utils import ProgressBar, check_random_state
from pyprep.utils import (
_correlate_arrays,
_ge... |
5d429e4c646d6ce2e6fb3a39bc129338249f9d9b2e0bc9ae6571dae975336a4c | Python | 21,810 | 600 | # Copyright 2022 HYBRID Team INCIA, UMR5287, CNRS, Université de Bordeaux
# 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 b... |
06721ad0fc3cefbfd9ca697274bcf7e6adb27b17df9c626b8ed26b9de9292c12 | Python | 21,811 | 550 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
0bdc13f9e6e29c0fcc6eb6143cd3b1669f56f97706badd64d6ed74fbd37ee0b2 | Python | 21,811 | 441 | # -*- coding: utf-8 -*-
"""
Created on Fri May 13 11:53:14 2022
@author: Dalton
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from pathlib import Path
import dill
import seaborn as sns
from scipy import sparse
from sklearn.metrics.cluster ... |
bced78c872df098b1ce1bc82a29b9c79feaa5d3292721f55864ad026cd9d0311 | Python | 21,826 | 378 | #####################################
######## Paper Draft Cartoon ########
#####################################
#%%# Catalyzer
import os
import sys
path = os.path.dirname(os.path.realpath(__file__)) + '/../Resources'
sys.path.append(path)
path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(path)
impo... |
d2382147cc817b3a020c6d9acd05e4a74c0de3236d92d1425a0e8aad8c4a1ff1 | Python | 21,828 | 606 | """Metrics evaluating component TE-dependence or -independence."""
import logging
import numpy as np
from scipy import stats
from tedana import io, utils
from tedana.stats import computefeats2, get_coeffs, t_to_z
LGR = logging.getLogger("GENERAL")
RepLGR = logging.getLogger("REPORT")
RefLGR = logging.getLogger("REFE... |
2ef684a6e9bed03e5b55b068ac44f3d17e90dab9e2808800efbebc7bfee6bbda | Python | 21,845 | 729 | import os
import sys
import pdb
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import util_figures
import util
def make_plot_maa_azimuth(
ax,
df,
color='k',
include_yerr=True,
include_legend=False,
kwargs_plot_update={},
kwargs_legend_up... |
9c405013013f5b9223fda7162476e5cd2e5f484c46e5a67b33408724d9142bdf | Python | 21,849 | 468 | import os
import pickle
import sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import warnings
warnings.simplefilter("ignore")
import json
import time
import tqdm
import util
import pprint
import random
import torch
import scipy.stats
import numpy as np
import pandas as pd
from datetim... |
e50064fe7ec699e6a9c3e56a234745a463785d6dfd43016b85684bfe354fc463 | Python | 21,850 | 730 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
f0962542f0c855e4a17141863b8d08f555a7fc5371ddee3885aefe99a635dac9 | Python | 21,853 | 542 | import os
import glob
import io
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
from pylab import rcParams
from matplotlib import cm
import joypy
# =============================================================================
# CONSTANTS
# ===========================... |
9e074df44b6dfc5173590cdab3b712ace6b662f0437ad2a14021267df6db7af3 | Python | 21,859 | 555 | """ vision transfomers models"""
import logging
import math
from copy import deepcopy
from typing import Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as checkpoint
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helpers im... |
49dd8da40cc2dd3097484c6a0efa365b1bef137c4bfec74bdb3ba5e2071e7dbc | Python | 21,865 | 492 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
9681956a80257807ad814c88c45575db6331edbbc2d4fafdceddef85fb68d88b | Python | 21,866 | 556 | #!/bin/env python3
"""
Simulation result data
----------------------
The SimData class is used to store the results of a simulation of ithildin.
"""
from glob import glob
from itertools import chain
from typing import List, Union, Tuple, Dict
import datetime
import numpy as np
import os
import pandas
import re
import... |
c123d73646416b663a57199ff716cbac6a9e9f575dd9294107876d5b49fb8700 | Python | 21,880 | 387 | import numpy as np
import pandas as pd
import random
from collections import defaultdict
from .graph_theory import extract_labelled_circular_subgraph_object, check_if_strict_labelled_subgraph
from .information_theory import mi
from rdkit import Chem
from rdkit.Chem import rdFingerprintGenerator
from rdkit.Chem.rdMolDes... |
11bf9dad377e7a37f539300ab4a5890ebb1404a4750dbed9b2912d407bce5f7f | Python | 21,891 | 412 | import sklearn.preprocessing
from sklearn.metrics import roc_auc_score,roc_curve,auc,accuracy_score,precision_recall_fscore_support,confusion_matrix
import matplotlib.pyplot as plt
from torch import nn, softmax
from model.model_local_global import LGMF_GNN
from dataloader_local_global import dataloader_lg,prepare_... |
23324cc3e73fbfe719bcc8c544f676350a2f4c4279840648e3fb69252bfcedf5 | Python | 21,930 | 447 | # -*- coding: utf-8 -*-
"""
Created on Fri May 13 11:53:14 2022
@author: Dalton
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from pathlib import Path
import os
import seaborn as sns
from scipy import sparse
from sklearn.metrics.cluster im... |
5ca5e6836fd738dad1e26b6ada37c453c5c2b28967dd54864f0f94622128932b | Python | 21,938 | 645 | """
pygments.formatters.img
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for Pixmap output.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import sys
from pip._vendor.pygments.formatter import Formatter
from pip._vendor.pygments.util... |
37492abdb5bf23de2bca7b69c4497c5bd77b384ea6b9eff042ce44499c19bc6d | Python | 21,943 | 532 | import os
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from nibabel import Nifti1Image
from nilearn.maskers import nifti_spheres_masker
from nilearn.signal import clean
from nilearn.masking import apply_mask, _unmask_3d, compute_brain_mask
from nilearn.image import load_i... |
804bf7ce6acba573bed51fefe2327c0cb012eae15eba1bc3e0f321cf8c6cf6e9 | Python | 21,945 | 462 | from __future__ import annotations
import warnings
from functools import partial, singledispatch
from typing import TYPE_CHECKING
import numpy as np
import pandas as pd
import scanpy as sc
from fast_array_utils.conv import to_dense
from pandas.errors import PerformanceWarning
from scipy.sparse import sparray, spmatri... |
a9973f1c8eb5adb563526e5b3218d6723803dc60235da4dbe482db6d5b7f6e58 | Python | 21,973 | 377 | #####################################
######## Paper Draft Cartoon ########
#####################################
#%%# Catalyzer
import os
import sys
path = os.path.dirname(os.path.realpath(__file__)) + '/../Resources'
sys.path.append(path)
path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(path)
impo... |
3249419babf51a344c815ce9724e922ace9481da21b29a5510becd73e9daf5d8 | Python | 21,984 | 571 | import logging
import os
import tempfile
from copy import copy
from typing import Any, Callable, Dict, Union
import numpy as np
import pandas as pd
import torch
from joblib import Parallel, delayed
from torch.utils.data import Dataset
from tqdm import tqdm
from torcheeg.io import EEGSignalIO, MetaInfoIO
from ...utils... |
bd90b8d3706ec950b09eeabfdbe215fe9df2784c76d48a210794845d0a50fc57 | Python | 21,987 | 545 | # Acquisition helper functions from PySpin
import PySpin
import numpy as np
import scipy.ndimage
def start_stream(cam):
if(not cam.IsStreaming()):
cam.BeginAcquisition()
def stop_stream(cam):
if(cam.IsStreaming()):
cam.EndAcquisition()
def init(cam):
if(not cam.IsInitialized()... |
cb2a7a35221888ec44bad26de0e84781492dbc89e539a8eefecc6aa3d4f2d63c | Python | 21,989 | 491 | # Copyright 2022 the Regents of the University of California, Nerfstudio Team and contributors. 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.... |
6bfbfe365ff41c693db1605dd18a15f0d3a09656a6f863599126746d045229df | Python | 22,001 | 633 | from sympy.parsing.latex import parse_latex
from sympy.printing import latex
from sympy import solve
from sympy.core.numbers import Float
################# Program Executor ########################
spec_token_list = ['frac', 'pi', 'sqrt']
spec_letter_list = ['f', 'r', 'a', 'c', 'p', 'i', 's', 'q', 'r', 't']
low_case_... |
ffb1b94f4c64f338c57cb534373694fe82baf479d2964fca2a418b156dfb2bf4 | Python | 22,002 | 599 | """Implementation of gSpan."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import codecs
import collections
import copy
import itertools
import time
import numpy as np
from .graph import AUTO_EDGE_ID
from .graph import Graph
from .graph import VACANT_GR... |
e256968741e9c068a32e2066741218b5b8587a4427373ce1c765bdbb2b344470 | Python | 22,003 | 620 | from __future__ import absolute_import
import email
import logging
import re
import time
import warnings
from collections import namedtuple
from itertools import takewhile
from ..exceptions import (
ConnectTimeoutError,
InvalidHeader,
MaxRetryError,
ProtocolError,
ProxyError,
ReadTimeoutError,... |
40d424bb8bf7f0670e71cb4718d6d156862fe6654c55c7b19e60b187d7eaa46c | Python | 22,013 | 614 | """distutils.command.bdist_rpm
Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions)."""
import subprocess
import sys
import os
from ..core import Command
from ..debug import DEBUG
from ..file_util import write_file
from ..errors import (
DistutilsOptionError,
DistutilsPla... |
7445ca15f77df981677519995e03bc02857042400a99c6225dc1afe789c6d962 | Python | 22,016 | 500 | from typing import Dict, Tuple, Union
from scipy.signal import butter, lfilter
try:
from scipy.signal.windows import hann
except ImportError:
from scipy.signal import hann
import numpy as np
from ..base_transform import EEGTransform
def butter_bandpass(low_cut, high_cut, fs, order=5):
nyq = 0.5 * fs
... |
c874fe4ce6e39fafe8d9b46697d8e3292a9a107091a3a7da20dad9f36cf13ec5 | Python | 22,023 | 424 | import os
import re
from typing import Any, Callable, Dict, Tuple, Union
import mne
import numpy as np
import pandas as pd
from scipy.io import loadmat
from ....utils import get_random_dir_path
from ..base_dataset import BaseDataset
class StrokePatientsMIDataset(BaseDataset):
'''
An EEG motor imagery datase... |
723cd1fdd28aed489abe91647e96e6dacbbf65f512cc0c48e1fa5150aa166b95 | Python | 22,044 | 640 | # -*- coding: utf-8 -*-
import os
import numpy as np
import scipy.misc # save/read image(s)
from . import _logging as logging
from . import prepro
# Uncomment the following line if you got: _tkinter.TclError: no display name and no $DISPLAY environment variable
# import matplotlib
# matplotlib.use('Agg')
__all__ ... |
953a68319435b88c1b9a77236732b0579cb4ade322ccae9192cdb5e360da6f3c | Python | 22,044 | 457 | # For models that use the molecular graph
import torch
import torch.nn as nn
from mnp.models.parents import SimpleModel, MetaModel
from mnp.models.vectors import FullyConnectedCNP, FullyConnectedLNP, FullyConnectedNN
from mnp.molecular_featurizer import MolecularFeaturizer
from typing import Union
import gc
import num... |
bdbbe4f85ffd972340c3e48022b86cc965bd05425957b7d1695556a58b5b097d | Python | 22,067 | 546 | # -*- coding: utf-8 -*-
import nest
import numpy as np
import os
from datetime import datetime
import yaml
from dicthash import dicthash
from helpers.lognormal import mu_sigma_lognorm
class Simulation():
"""
Handles the setup of the network parameters and
provides functions to connect the network and dev... |
c0863be1160056509e8a628405d61226fab113821b1d9592ab1c9b1e856b1f6b | Python | 22,093 | 533 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Updated on Wed Apr 21 13:14:13 2021
@author: mpolonenko; rkmaddox
"""
import numpy as np
from expyfun.io import read_wav, read_hdf5, write_wav, write_hdf5
from glob import glob
import tempfile
import shutil
import os
from scipy.fftpack import ifft, ifftshift
from sci... |
a616defba4d2df6a588c12fe36f99ba1fbe00de1bc0955495d2a536fe1c60bdb | Python | 22,108 | 618 | #!/usr/bin/env python3
#******************************************
#
# SHARC Program Suite
#
# Copyright (c) 2023 University of Vienna
#
# This file is part of SHARC.
#
# SHARC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
... |
ee1cf9373656b73ae7bf63e9dc4558d1c863885fe693d40f2c873d5a56611d6d | Python | 22,115 | 548 |
import os
import pandas as pd
import numpy as np
import torch
from utils.dataloader_utils import load_data_graphalg,load_dataset,load_meg_averages
from matplotlib import pyplot as plt
import json
def save_embeddings_all(trial_dir,first=0,last=-1,save_special=False,overwrite=False):
### gotta be automatic nums!
... |
2bdd8f5f82b63f96ae14b076b6b667a30283ef797478b6bae968f49dd51c19f7 | Python | 22,119 | 436 | """
Login class for Wikidata. Takes authentication parameters and stores the session cookies and edit tokens.
"""
import logging
import time
import webbrowser
from typing import Any, cast
from urllib.parse import parse_qs, urlencode
import requests
from oauthlib.oauth2 import BackendApplicationClient, InvalidClientErr... |
bead6ab55fd1af81fa957e0384c61f990c409b870c02a19302a15a82f82ed806 | Python | 22,121 | 640 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#from ast import Del
from symtable import Symbol
from scipy.io import loadmat
import numpy as np
import os
import sys
sys.path.append(os.path.abspath('../'))
try:
import analysis.connectivityMatrices as matrices
except ModuleNotFoundError:
import KuramotoNetworksPackage... |
35df4d0808a20de6f65ae3b57b8f6f7b275527e285df6d063f67dd38ac953607 | Python | 22,123 | 535 | #!/usr/bin/env python
#================================================================
# Copyright (C) 2022 Yufeng Liu (Braintell, Southeast University). All rights reserved.
#
# Filename : calc_brain_statis.py
# Author : Yufeng Liu
# Date : 2022-10-20
# Description :
#
#=============... |
aba80b9e04a828faef9ee97d043594ef86ba757f579962043a5ffdb201494fc5 | Python | 22,136 | 524 | import os
import time
import json
import random
import argparse
import datetime
import numpy as np
import torch
import torch.backends.cudnn as cudnn
import torch.distributed as dist
from timm.loss import LabelSmoothingCrossEntropy, SoftTargetCrossEntropy
from timm.utils import accuracy, AverageMeter
from models impo... |
2471de6eeed12834514f2cae74115c34d5aa857c4f25037c3560f6027ec42e23 | Python | 22,141 | 576 | import torch
import torch.nn.functional as F
import numpy as np
import matplotlib.pyplot as plt
from rdkit.Chem import rdDepictor
from rdkit.Chem.Draw import rdMolDraw2D
import matplotlib
import matplotlib.cm as cm
from matplotlib.colors import ListedColormap
from skimage.io import imread
from cairosvg import svg2png,... |
6da5eec79c2529d674b9ddf9f0f80910057ed48cacc7f40c461449daeafa96f9 | Python | 22,153 | 558 | from __future__ import annotations
import math
from concurrent.futures import ThreadPoolExecutor
from typing import TYPE_CHECKING, NamedTuple
import numpy as np
import pandas as pd
from numba import get_num_threads, njit
from scipy import stats
if TYPE_CHECKING:
from collections.abc import Sequence
_LOG_2PI = f... |
a185b3e31fee799cd67af8f8fcca74d0cb21949f7cb4857cd9c614133cedbc32 | Python | 22,153 | 598 | #
# MIT License
#
# Copyright (c) 2022 GT4SD team
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... |
f6373b0c7916183dbf9bee735934e8d4f9dd9d5c911f9e29a10d15911469a55d | Python | 22,156 | 574 | import os
import re
import pandas as pd
import numpy as np
from collections import defaultdict
from ckg import ckg_utils
from ckg.graphdb_builder import builder_utils, mapping
def parser(projectId, type='proteomics', directory=None):
data = {}
experiments_directory = ckg_utils.read_ckg_config(key='experiments... |
1c5987f142903df23605d5df41fba484125d785b71788b81ea040e48ca2ba232 | Python | 22,158 | 528 | # trace generated using paraview version 5.5.1
#### import the simple module from the paraview
from paraview.simple import *
from matplotlib import pyplot as plt
import numpy as np
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# create a new 'EnSight Reader'
heart_reme... |
9d11c105271c5cfa283d94df724956b39b910e80755f2d28ef0845eed5311e02 | Python | 22,160 | 538 | """PySide6 dialog showing env + atlas status with install/refresh actions.
Consumes regtools.config_menu.status for all status data so the GUI
stays a thin renderer. Subprocess actions (run installer, reinstall
atlases) launch in a new console so progress is visible and the GUI
event loop is never blocked.
En... |
56a79220a6b012854b7ab60ebd5c756050fc80010eb4a61253d9c2aa7b24ab93 | Python | 22,165 | 524 | # trace generated using paraview version 5.5.1
#### import the simple module from the paraview
from paraview.simple import *
from matplotlib import pyplot as plt
import numpy as np
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# create a new 'EnSight Reader'
heart_reme... |
f6a9c54ad67e9a185c140aaf5e35ae10e3e8e65281d2f224010dd9a423aa717e | Python | 22,166 | 455 | # -*- coding: utf-8 -*-
"""
Created on Fri May 13 11:53:14 2022
@author: Dalton
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import dill
import os
import glob
import seaborn as sns
from scipy import sparse
from scipy.ndimage import gauss... |
78ec4c1cf3c0fe0ef6ee8c9f429d14f66ab40a44fda7a5bac27d51270a1ac5b8 | Python | 22,185 | 716 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
f52ac9745cfbf65cba670be99b0988fb3b6ed3d57007ec149d18f55d76316948 | Python | 22,189 | 471 | # -*- coding: utf-8 -*-
import torch.nn as nn
from supar.config import Config
from supar.model import Model
from supar.modules import MLP, Biaffine, Triaffine
from supar.structs import SemanticDependencyLBP, SemanticDependencyMFVI
class BiaffineSemanticDependencyModel(Model):
r"""
The implementation of Biaff... |
9b06c3184efdc4b41a744f6f5557c2e895c96fda517a148cb51d5f76cba73b5f | Python | 22,199 | 480 | """
Tests for the entity data models (labels, descriptions, aliases, sitelinks,
claims, qualifiers, references, forms). Entities are built locally from the
JSON fixtures — exactly the payloads a Wikibase instance would return — so no
network interaction is required.
"""
import copy
import pytest
from wikibaseintegrat... |
c82a42cfcdfd303da900c9210a6ad63c85c618c4251be86f83ebf10b94a7c2ea | Python | 22,200 | 552 | from matplotlib import pyplot as plt
import numpy as np
import pandas
from typing import List
from merlin.plots._base import AbstractPlot, PlotMetadata
from merlin.analysis import filterbarcodes
class CodingBarcodeSpatialDistribution(AbstractPlot):
def __init__(self, analysisTask):
super().__init__(anal... |
e40dfa1baec50d57643beb2d18054bfd0e09038a8dd5192a930bed6f56a93401 | Python | 22,205 | 562 | # Authors: Jose C. Garcia Alanis <alanis.jcg@gmail.com>
#
# License: BSD-3-Clause
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.transforms as mtransforms
from matplotlib.patches import ConnectionPatch
import matplotlib.cm as cm
from matplotlib import colormaps, ticker
import seaborn as sns
fr... |
ef00736dd66d097e8e42b75ada7d440a22e4bf3d286e7779696774a130c508c2 | Python | 22,230 | 572 |
# -*- coding: utf-8 -*-
"""
Created on Mar 3 2023
@author: Jonas A. Thiele
"""
### Apply models build in main sample (610 subjects of HCP) with network-specific links to
### predict intelligence scores in the lockbox sample (196 subjects of HCP)
import pandas as pd
import numpy as np
import scipy.io ... |
8e4e622023ea2300948ecd8b42efc6a8e3063d479511549cc323800f7f1b391a | Python | 22,241 | 452 | from typing import Any, Dict, List, Tuple
import pytorch_lightning as pl
import torch
import torch.nn as nn
import torchmetrics
from torch.utils.data import DataLoader
from torchmetrics import MetricCollection
from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint
import os
_EVALUATE_OUTPUT = List[Di... |
9eddbb106ef676db12a5c2556afea69615f031e68a119660d5b18578b061b11c | Python | 22,250 | 574 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Mesocircuit-project test suite.
"""
import numpy as np
import unittest
import mesocircuit.analysis.spike_analysis as spike_analysis
import mesocircuit.mesocircuit_framework as mesoframe
from mesocircuit.parameterization import helpers_network as helpnet
class TestSui... |
2f5a98cff706403667f02a0e453e49a8616f81b67bb5328cb3f8d1c580a8b4ea | Python | 22,269 | 601 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 3 09:08:26 2024
@author: mpolonen
"""
import numpy as np
import pathlib
import scipy.signal as sig
from expyfun.io import read_hdf5, write_hdf5
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from scipy import stats
from statsmodel... |
39059dfe35e78df37831cc7126fb6d127dd9cf76737c111f1e16838d50f52a44 | Python | 22,281 | 654 | # -*- coding: utf-8 -*-
#
# Test functionality of data selection features in Syncopy
#
# Builtin/3rd party package imports
import pytest
import numpy as np
import inspect
import dask.distributed as dd
# Local imports
from syncopy.datatype.selector import Selector
from syncopy.shared.errors import SPYValueError, SPYT... |
1bfbfd73a492ce2a107a1b70b78c8d93d1d5d2ab84085dcf745788a2845155c5 | Python | 22,283 | 569 | """
Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
- Analysis settings
Output: - Plots by tomograms:
+ Number of particles by list
+ ... |
656410908da501b2c61db12f87d4d191bfcb5865dca94636795a8c8ac88bde95 | Python | 22,283 | 569 | """
Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
- Analysis settings
Output: - Plots by tomograms:
+ Number of particles by list
+ ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.