sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
593f6e2bf5cbf65778c8e72e5ecb326e82337fb324a54715112f8d7b26425863 | Python | 13,135 | 349 | from __future__ import division
import numpy as np
# import json
from matplotlib import pyplot as plt
from .probe_functions.readUtils import read_flat
from .probe_functions.readUtils import openHDF5file, getHDF5params, getHDF5params_brw4
from .probe_functions.readUtils import readHDF5t_100, readHDF5t_101
from .probe_f... |
7846b16d735bf4c39dc661f820f5e745058020ede5765aba7adbfe1d47655128 | Python | 13,135 | 365 | """Tear / damage detection on the microscope slice.
Ports of:
utils/damagedPoints.m
utils/compute_tear.m
Uses the `triangle` Python wrapper around Shewchuk's `triangle` for the
constrained Delaunay triangulation that MATLAB performs with
`delaunayTriangulation(c, constraint)` + `isInterior()`.
"""
... |
8b808e42a1671bbc13bf8f3ae3c46c467b0dbcc81957dec26c782988a48d172f | Python | 13,135 | 403 | import nibabel as nib
from nilearn import image, maskers, masking, plotting
import nilearn.image
import numpy as np
from glob import glob
from scipy import stats, linalg
from sklearn.decomposition import PCA
from sklearn.linear_model import LinearRegression
import multiprocessing
from scipy.stats import zscore
import p... |
1ad90b5dd4859ee7ae17a42befcd3d9596618ce602728a806e400d6f3399fa48 | Python | 13,141 | 449 | """
Tests for BASIL module
FIXME need more multi-step tests
FIXME need to test more error conditions
"""
import pytest
import numpy as np
from fsl.data.image import Image
from oxasl import AslImage, Workspace
import oxasl.basil as basil
pytest.skip("skipping basil tests as neeed rewrite", allow_module_level=True)
... |
e3712460a84d21fd1f7888a81c1f6d499fe02fb529ea96a2cce35efe983b8d28 | Python | 13,143 | 257 | # 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... |
02931e5e0bac9a3f4c51fbe9d369ec1e7fa313cc0d1c1668bfa4cf5ed25fab08 | Python | 13,147 | 339 | from __future__ import division, print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
from topaz.model.utils import insize_from_outsize
# below are ResNet constituent components
class MaxPool(nn.Module):
def __init__(self, kernel_size:int, stride:int=1, dims:int=2):
super(Max... |
63b3e4fa02079fc5963495ddf0989dccd06b928be9ec6a1557fbfe229ec66eab | Python | 13,149 | 358 | # -*- coding: utf-8 -*-
#
# Test ability to attach extra datasets to Syncopy Data objects.
#
import numpy as np
import h5py
import pytest
import tempfile
import os
# syncopy imports
import syncopy as spy
from syncopy.tests.test_spike_psth import get_spike_data, get_spike_cfg
from syncopy.tests.test_metadata import _g... |
91973565d9a7d2a1c301c5ddd19026e23096feb04b3ac9fcbd50584c90422d30 | Python | 13,150 | 298 |
import torch.nn as nn
import torch.nn.functional as F
from model.layers import PairNorm,GraphConvolution, GraphConvolution2, InecptionGCNBlock, GraphConvolutionBS,GraphConvolutionBS2, snowball_layer,GCN
from model.GCN import snowball, truncated_krylov, graph_convolutional_network
import numpy as np
from torch.nn... |
668bc98e07205b60719a42a3c2746e7265f7ade8d1db1a482fdb63be9e6d5ad3 | Python | 13,154 | 375 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 17 09:24:49 2023
@author: Dustin Garner
"""
from collections import defaultdict
import numpy as np
import pandas as pd
import scipy.stats as stats
import matplotlib.pyplot as plt
from fafbseg import flywire
import flycode.utils as utils
import f... |
5dbdd01dacd1282cc2c8c784fbbb46ef776edd875c6f4ca5d247db861fa48ec3 | Python | 13,157 | 295 | # trace generated using paraview version 5.5.1
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# create a new 'EnSight Reader'
heart_remeshed_3D_strainsensicase = EnSightReader(CaseFileName='he... |
cf9aad4a7b0f4ce3328ce444ead692cb8b19307e867dcaff255427927d2d3e92 | Python | 13,163 | 276 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Linear as Lin
import os
import numpy as np
import yaml
import scipy.sparse as sp
from sklearn.metrics import accuracy_score
from utils.gcn_utils import normalize,normalize_torch
from utils.graph_mixup import g_mixup
fro... |
3e0d659d42a3aa71b7ef8edea18d6c3b703e303482eefa7fdbb4ff7a774e9c0f | Python | 13,170 | 235 | # 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... |
eaf405b77e61facb0a9c1b05b920f59379f4b95d4737ec9f9f05b606cc3d39de | Python | 13,171 | 400 | """
RECOLLECT architecture. @author: A.R. van den Berg
Based on AuGMEnT implementation @author: J.O. Rombouts
"""
import numpy as np
from numpy.random import rand
import pickle as pickle
import logging
class Sigmoid(object):
"""
Simple container class for sigmoid transformation.
"""
... |
1cf3ce2365f8fac60ff4db67ad06b96dd4bd4fd484923fe8cc6c39b4336196cc | Python | 13,172 | 364 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import sys
from lab.environments import LocalEnvironment, MaiaEnvironment
from lab.experiment import ARGPARSER
from lab.steps import Step
from downward.experiments import DownwardExperiment, _get_rev_nick
from downward.checkouts import Translator, Pr... |
d57cafe5880a3aecb37716b8e20c3c91146b875043ce41ba59fc9a0600f7925b | Python | 13,174 | 371 | #!/usr/bin/env python3
"""Plot tumor volume over time from tumor_tracking.py's output CSV.
Reads the long-format CSV (patient_id, tumor_id, date, volume_cm3, ...) and
draws a RANO-BM-style volume-over-time chart per tumor_id: the volume trend
line, the running nadir (lowest volume seen so far), and a progression
thres... |
2da64701f30f03349b22080053231432a5c48fa4e32e10d51b5f62bab339b488 | Python | 13,175 | 319 | import datetime
import enum
import json
import logging
import time
from typing import List, Union
import requests
from pydantic import BaseModel, Field
from requests import HTTPError
from NDATools import exit_error
from NDATools.Utils import get_request, post_request, HttpErrorHandlingStrategy, DeserializeHandler, \
... |
8e5f35c9dfbdf8d136779d730219b1a76e26dcfa11199ff39654004784ffa2af | Python | 13,175 | 330 | """Tests for the custom-template final-review fixes.
Covers:
* Fix 1 - register_ndim forwards the CUSTOM annotation for a 2D pair.
* Fix 2 - the unified 2D counting path counts against the annotation slice.
* Fix 3 - count_registered_points grid guard (expected_grid).
* Fix 4 - custom atlas disables the ... |
bf63e649105c98f56141606b3f7791a27825707709226aaefecf81fd0c0973e9 | Python | 13,176 | 332 | from ._base import EncoderMixin
from timm.models.regnet import RegNet
import torch.nn as nn
class RegNetEncoder(RegNet, EncoderMixin):
def __init__(self, out_channels, depth=5, **kwargs):
super().__init__(**kwargs)
self._depth = depth
self._out_channels = out_channels
self._in_chan... |
d130b6aea8316c8a1abcd74a8f64391b71ce7d555eb7fe62f7920397122a22e8 | Python | 13,177 | 402 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
d20ef672d6843c852034cb77fb7d270a7d5a08a866f13a55adfef5d997ba8563 | Python | 13,178 | 331 | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and the HuggingFace Inc. team.
#
# 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
#
# U... |
ca63a573ee7457f6e9bc2d2e9fb635c1a04bd14ff3c61e7391517378abeb64f5 | Python | 13,184 | 337 | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 23 11:49:59 2021
@author: u0139894
"""
import re
import os
import json
from csv import DictReader
from pathlib import Path
class Compounds:
def __init__(self, cpds_file='compounds.tsv'):
self.path = Path(os.path.dirname(__file__))
self.Bioche... |
a8b74737bdfe39a01d45266510e70569a203a527d4b0dc57e78f68e7db30116c | Python | 13,185 | 342 | import torch
import torch.nn as nn
import torch.nn.functional as F
from src.common import normalize_3d_coordinate
class GaussianFourierFeatureTransform(torch.nn.Module):
"""
Modified based on the implementation of Gaussian Fourier feature mapping.
"Fourier Features Let Networks Learn High Frequency Funct... |
c9d4c9f507d7f6395660eb8a30a3828ffba75e0c52cb4fd2f00f85100d862077 | Python | 13,188 | 392 | from __future__ import annotations
from io import StringIO
import pytest
from ase.atoms import Atoms
from ase.calculators.calculator import compare_atoms
from quacc.calculators.mrcc.io import (
read_energy,
read_geom_mrccinp,
read_mrcc_outputs,
write_mrcc,
)
def test_read_geom_mrccinp(tmp_path):
... |
f22a89548140375f726c4614ef8280ba13f2b56f72bfff5c3730dc325827d125 | Python | 13,188 | 376 | import numpy as np
import pandas as pd
import rdkit
import rdkit.Chem as Chem
import networkx as nx
import torch
import os
from tqdm import tqdm
from torch_geometric.loader import DataLoader
from build_vocab import WordVocab
from utils import *
from dataset import DTADataset
from sklearn.model_selection import KFold
... |
ae1d3797560ab5e50e004326e888acfa7cd5f83153802c52e062d6f27a197d7e | Python | 13,191 | 305 | __author__ = "Zoe Wefers"
__credits__ = ["Ryan Huang"]
__version__ = "1.0.0"
__maintainer__ = "Zoe Wefers"
__email__ = "zoe.wefers@mail.mcgill.ca"
"""Purpose: Calculates four kinds of statistics about the localization of mRNA in dendrites/somas. For mRNA colocalization
and synaptic localization performs 100 si... |
a011365dbe6222f35db0c4feaa6834a023465a2d723053de900f16066886d19a | Python | 13,198 | 377 | #from rdkit.Chem.Draw import SimilarityMaps
from rdkit import Chem, DataStructs
from rdkit.Chem import Draw, AllChem
from rdkit.Chem.Draw import rdMolDraw2D
from rdkit.Chem import BRICS
from rdkit.Chem import Recap
from collections import Counter
import numpy as np
import numpy.random as npr
#import pubchempy as pcp
im... |
13709aeddff3c146640bc78fcf1fef0c095f15e80b0e6b201f14eba29de61e1d | Python | 13,199 | 354 | # modified by Yichao, to design for short DNA sequences
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... |
31292f75c99818fb44da0c22ddee1a0c5919f7158d267f77b7653e2936ef229d | Python | 13,199 | 367 | import anndata as ad
import mudata as md
import torch
from torch.utils.data import Dataset, DataLoader
import numpy as np
from typing import Union
from scipy.sparse import issparse
import pytorch_lightning as pl
class DictDataset(Dataset):
"""
Dataset class for dictionary data. It is a subclass of torch.utils... |
0c8149fbc95754bee623ba8f90e8604361cd3c63acf44c603cb4d41edf2e7fb5 | Python | 13,200 | 453 | import numpy as np
from jitcdde import input as system_input
from symengine import exp
from ....utils.stimulus import OrnsteinUhlenbeckProcess, ZeroInput
from ..builder.base.constants import EXC, INH, LAMBDA_SPEED
from ..builder.base.network import SingleCouplingExcitatoryInhibitoryNode
from ..builder.base.neural_mass... |
a68f80a9f18605dc6315141ca30748884482c7bfe7e521bc79b64ccb9449f6da | Python | 13,201 | 272 | """
Script to run drug response classification experiments (sensitive/resistant)
for all chosen drugs and cancer types.
Output files are identified by {gene}_{cancer_type} (in this order).
"""
import sys
import argparse
import itertools as it
from pathlib import Path
import numpy as np
import pandas as pd
from tqdm i... |
e969d45f67bea2ee6237833df199767a26cb12d7c714869400b618a28d9abf0b | Python | 13,205 | 272 | import torch
import torch.nn.functional as F
import numpy as np
import ABIDEParser as Reader
import argparse
import random
from torch_geometric.data import Data
from sklearn.model_selection import StratifiedKFold
from scipy.spatial import distance
from model_RGAT import RGAT
from sklearn.metrics import roc_au... |
f7310eb46cdd8ba82b607476ea60034785642461d38136212a1e07715be49670 | Python | 13,216 | 369 | #!/usr/bin/env python3
"""
m6a_supervised_cnn.py
Author: Anupama Jha <anupamaj@uw.edu>
This module predicts whether an
adenine is methylated or not. The
model is trained with Fiber-seq
HiFi read sequence, inter-pulse
distance and pulse width signal
from pacbio. The model is a
convolution neural network.
"""
import tor... |
8548b293a0c9f5a0d804164fac4d6f137e9150d563cdbf53778c4271c2442f13 | Python | 13,219 | 287 | """Theme-aware monochrome SVG icon helper for the GUI.
A small set of line-style glyphs (24x24 viewBox, ``stroke="currentColor"
fill="none" stroke-width="2"``) are bundled as inline string constants so there
are no asset-path / packaging concerns. :func:`themed_icon` renders a named
glyph in a chosen color (defa... |
220ee50f1efa2be79dfcedd3d2fbc29dc05a58264517fbfee86a21624f566ae4 | Python | 13,220 | 274 | """Preparing the Cam-CAN MEG data
[STEP 2] Coregistration
"""
# Install dependencies
import os
import glob
import numpy as np
from osl import source_recon, utils
from dask.distributed import Client
# Set directories
BASE_DIR = "/home/scho/camcan"
DATA_DIR = "/ohba/pi/mwoolrich/datasets/camcan"
PREPROC_DIR = os.path.j... |
aa1138ece6ec28b76a0e5880799de2d07534f0a67780470e90bb3c976dfb76ae | Python | 13,221 | 258 | # 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... |
b2367d92ca2c0655c3fcbd488727ca2ba34a636b81e27bfa234a7aa3c2f1b8f5 | Python | 13,223 | 320 | import numpy as np
import torch
from tqdm import tqdm
import pickle as pkl
from pathlib import Path
import pandas as pd
from Utilities.transforms import get_transforms
import hashlib
def outliers(data, ex=3):
total_cols=len(data.columns)
for i in range (0, total_cols):
kolumna = data.iloc[:,i]
... |
24e7498b53c6cf305f1e5c0abe4ae16ae347b9e59d5823388e6c5d9cb322d32a | Python | 13,225 | 306 | #### Edit ninfo file with given weight factors
#### Usage: $python remove_contacts_ninfo.py "A:1-20,B:30-40" test.ninfo cg.pdb
#### list order of scale factors [bond, angle, dihedral_1, dihedral_2,long_range, basepair, basestack]
#### Value of each scale factor range (0:9)
#### a new ninfo file is produced with a nam... |
d0ab7220f89d4b90e7be12fe5a83e78f5e619d641e6074ab0fa8997ef373ca79 | Python | 13,225 | 419 | # 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... |
07491e0be03c68d8a531f6067b53804954c37edbb756f39c82a2bb4de083d53b | Python | 13,226 | 344 | # Modified version of inspyred/swarm.py that allows evolution of PSO metaparameters
# and implements damped reflection at boundaries
"""
==================================
:mod:`swarm` -- Swarm intelligence
==================================
This module provides standard swarm intelligence... |
92286067025545f321fb9f40d859e0b75ad21490bb757ad2b80d0419e43e1f3c | Python | 13,228 | 256 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 6 10:09:47 2023
@author: daltonm
"""
from pynwb import NWBHDF5IO
import ndx_pose
import numpy as np
import matplotlib.pyplot as plt
from importlib import sys
import neo
import elephant
from quantities import s
from os.path import join as pjoin
fro... |
0ccf3ca16acaa0d2c3860b3e62e49f249e2f1454b9fed0118cad3d6c11bda09b | Python | 13,229 | 348 | # 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... |
ab57d1f39b8a0878c579d189a7c490bc25881f7ab1d844a7061c7698b5f12b0a | Python | 13,229 | 269 | """
RHOBAR_CI.py written 2026-09-22.
Pre-registration: 04-NOTES/PREREG-2026-09-22b-RHOBAR-CI.md (written before this ran).
A confidence interval on rho_bar, the within-neuron correlation that sets how many independent
observations a neuron's synapse votes are worth (Kish: n_eff = n / (1 + (n-1) rho_bar)).
A rep... |
ba0025db08543a33099db0e866f13e970d166317fcf351485660a4155d0aef29 | Python | 13,230 | 360 | from atom3d.filters import filters
import os
import torch
import numpy as np
import pandas as pd
import random
import torch
import torch_geometric as tg
# import e3nn.point.data_helpers as dh
from transformers import BertTokenizer, BertForMaskedLM
import os
from eudockscore.utils.interface import get_pair_interface_... |
983c8d5fa54a78650bafc848f92fa12908c88ab61f899b152c35095eac38395c | Python | 13,233 | 361 | from dreamcoder.dreamcoder import *
from dreamcoder.domains.tower.towerPrimitives import primitives, new_primitives, animateTower
from dreamcoder.domains.tower.makeTowerTasks import *
from dreamcoder.domains.tower.tower_common import renderPlan, towerLength, centerTower
from dreamcoder.utilities import *
import os
im... |
0336335230d5dea5e5c2d31743ce7326f44896afcc03d1dc30ba90413df2dd95 | Python | 13,234 | 319 |
'''The following script allows to run Jansen-Rit simulation with dynamic Feedback Inhibiton Control algorithm
for chosen GC and y_0^target values. It consititutes the necessary basis to replicate the findings from:
'Homeodynamic feedback inhibition control in whole-brain simulations'
and for adjusting the code ... |
6504461bf44d1f4e47a6e95f72c1e1316e3ec285173bcc6c5fabbfe946ac6996 | Python | 13,235 | 423 | """
Bonito utils
"""
import os
import re
import sys
import random
from glob import glob
from itertools import groupby
from operator import itemgetter
from importlib import import_module
from collections import deque, defaultdict, OrderedDict
from torch.utils.data import DataLoader
import toml
import torch
import koi.... |
7f255a5c6c9b1f548e5dc7f3221d2bfc6dad9690abbbe5a9b82a6454360c7203 | Python | 13,239 | 381 | from __future__ import annotations
import re
import numpy as np
import pytest
from scipy.optimize import NonlinearConstraint
from bayes_opt.exception import NotUniqueError
from bayes_opt.target_space import TargetSpace
def target_func(**kwargs):
# arbitrary target func
return sum(kwargs.values())
PBOUNDS... |
fd2cb5a84c5653fb9d605841113eef5400109ffdad110897d827972eb32684a3 | Python | 13,239 | 408 | #!/usr/env/bin python
'''
# brunel_alpha_nest_topo_exp.py
#
# This file is not part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 2... |
c6692e4e77cfd05864c053980f9dcdc99942274e8cceaa1c08fd0bbe6c248dab | Python | 13,242 | 328 | import matplotlib.pyplot as plt
import matplotlib.colors as mcolorson
from matplotlib import animation
import numpy as np
from scipy import optimize
import os
import ROOT
class Plot2D:
def __init__(self, number, limits, limits_spheroid, plk1_to_mex_multiplicator, v_plk1, v_MEXp_slow, v_MEXp_fast, path):
... |
08ecc8ce712c215e02418b6326fc59e5a979486fdef5679d71fdc009652be77b | Python | 13,245 | 309 | from __future__ import annotations
import glob
import json
import os.path
from collections import Counter
import pandas as pd
from google.protobuf import json_format
from json_repair import repair_json
from loguru import logger
from ord_schema.proto import reaction_pb2
from pandas._typing import FilePath
from pydanti... |
b8cc845cfea5aa927e7c56b87194b330b833e736fc6bb3ba859df5f87f27253e | Python | 13,252 | 346 | import os
import torch
import librosa
#import joblib
import time
import argparse
import torch.nn as nn
from torch.utils.data import Dataset,DataLoader
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
import math
from torch.nn import functional
BITNUM_SIG=5
POINTNUMS=2**BITNUM_SI... |
ceb44220844f91fde0cb673a6a7ceb50374a4b45aeb98f0141f0913e3e47e2d2 | Python | 13,252 | 319 | """
Script for extracting the graphs for analyzing quantitatively a synapse
(or any other junction between two membranes)
Input: - A STAR file with segmentations
Output: - A graph
"""
__author__ = 'Antonio Martinez-Sanchez'
# ################ Package import
import os
import time
import scipy
imp... |
de751b5a92726c34dcbc6a5b2963bd988fd6b168b51592e78261b1245d9d8055 | Python | 13,253 | 348 | """
PyQt5 tab for the Point Reorient tool (multi-file edition).
The user adds any combination of image volumes (TIFF / NIfTI / NRRD /
NPY / NPZ) and point clouds (CSV / TXT / NPY) to one input list. Each
file's type is auto-detected - ``.npy`` is inspected to disambiguate
images from point clouds. The user pic... |
7a1b8502466ccc0b57de93b033451a7d52cc38f9b9b3f5cb7dd3942f0fd5ade0 | Python | 13,254 | 358 | """Core recipes for espresso."""
from __future__ import annotations
from typing import TYPE_CHECKING
from ase.optimize import BFGSLineSearch
from quacc import job
from quacc.atoms.core import check_is_metal
from quacc.calculators.espresso.espresso import EspressoTemplate
from quacc.recipes.espresso._base import run... |
d9855617a29a74468dd8800f483cc533007160200a5bc8513cdd743476dbfa81 | Python | 13,254 | 384 | #
# 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,... |
066188bef74f06d5e3a30b75449a88c9aac45196fb90bdacd571784d2084b106 | Python | 13,258 | 329 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.module import Module
from torch.nn.parameter import Parameter
class ChannelAttention(nn.Module):
def __init__(self, in_channelsnel, ratio=2):
super(ChannelAttention, self).__init__()
self.max_pool... |
de83ccb646692f0d7636b1dcf297a13bcde26fd409f32c3c82d8be4f53f66817 | Python | 13,259 | 366 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import sys
from lab.environments import LocalEnvironment, MaiaEnvironment
from lab.experiment import ARGPARSER
from lab.steps import Step
from downward.experiments import DownwardExperiment, _get_rev_nick
from downward.checkouts import Translator, Pr... |
3d4d6d09c5b6694a5b80e897c8ba453a7699b885ea0b6fe7b02b9914acc8de49 | Python | 13,260 | 417 | import random
import os, sys
import json
import tempfile
import subprocess as sp
import numpy as np
import math
import gzip
import pickle
import re
from typing import Dict, List, Set
from rdkit import Chem
from rdkit.Chem import Recap, BRICS, AllChem, DataStructs, RDConfig, rdMolDescriptors
from .libfilter import che... |
6997852c678141cec427fe7a1c6c5c4b8e894f4e2efb7ea322aae443151b48ee | Python | 13,261 | 334 | #https://github.com/Yashwanth-23/Pneumonia-detection-using-CNN/blob/main/Pneumonia_detection_using_CNN.ipynb
import os
import numpy as np
import pandas as pd
import random
import cv2
import matplotlib.pyplot as plt
import keras.backend as K
import keras
from keras.models import Model, Sequential
from keras.layers imp... |
59700636a9f6bf7f879f84bf23a0ff736a689b96f6e450a0b8fe431dbad303b9 | Python | 13,263 | 318 | import torch
import time
import types
from ptflops import get_model_complexity_info
from tensorboardX import SummaryWriter
# from thop import profile
from torch.nn import functional as F
import mlflow
from mlflow.models.signature import infer_signature
from .util import AverageMeter, ProgressMeter, accuracy
class CI... |
e3f61de8280aebefe0859b7e26ac8d2c5ba63da85b7b9ffce2dbeb5aa5033899 | Python | 13,263 | 269 | # 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... |
378dd49fa14f62c1bcb156e8e0a46b2635a07b74460ffef8d94babf6334a202f | Python | 13,269 | 422 | """
Renders template copies in a tomogram from a STAR file
Input: - STAR file
- Reference tomogram
- Template pre-processing parameters
- Rigid transformations parameters
Output: - A set of VTK poly data for rendering the templates on the reference tomogram
"""
__au... |
9adf312eb3a1a1f36a09b265f986a3d87aafbe58b811c4724eaf3bfe52221ed4 | Python | 13,269 | 778 | from __future__ import annotations
from dataclasses import dataclass
import cv2
import numpy as np
import pandas as pd
from skimage.morphology import skeletonize
# ======================================================================
# RESULT
# =====================================================================... |
e274cd5d7d6a1bf25a423068f905cd47a963d69327b163637c87ef6e08e602e9 | Python | 13,272 | 610 | from functools import partial
import numpy as onp
import pytest
import autograd.numpy as np
import autograd.numpy.random as npr
from autograd import tuple
from autograd.test_util import check_grads
npr.seed(1)
# Fwd mode not yet implemented
check_grads = partial(check_grads, modes=["rev"])
def check_symmetric_mat... |
d84302c68fe01aa7a82f6da09f7cc805a236ae907d906b76cd784a52f98b6d6b | Python | 13,286 | 347 | """
Script for post-processing already reconstructed particles
Input: - STAR file with next columns:
'_rlnMicrographName': tomogram that will be used for reconstruction
'_rlnImageName': tomograms used for picking
'_rlnCtfImage': (optional) CTF model subvolume
... |
6509f7e30ff5d8d056e51ad0826e6950b50dac4efadc75576415712fbb186d05 | Python | 13,287 | 372 | import datetime
import json
import os
from google.cloud import datastore
from cirrocumulus.abstract_db import AbstractDB
from cirrocumulus.envir import CIRRO_EMAIL, CIRRO_JOB_RESULTS, SERVER_CAPABILITY_JOBS
from cirrocumulus.invalid_usage import InvalidUsage
from cirrocumulus.job_api import save_job_result_to_file
fr... |
7d755d5965b1327a6fc6ca71bf39b8a4625c2155bfe2f29968b7a26a81ed2527 | Python | 13,292 | 296 | from typing import List, Union
from functools import reduce
import numpy as np
from rdkit import Chem
import torch
import torch.nn as nn
from .attention import MultiBondAttention, MultiBondFastAttention, MultiAtomAttention, SublayerConnection
from chemprop.args import TrainArgs
from chemprop.features import BatchMolG... |
9fe61924579eb179501d403c9c1afb59113a9fc4e1e81e9b819e84e5e64a3df7 | Python | 13,292 | 440 | """Module to read open-ephys .continuous files
TODO
----
It assumes that the lenght of a block (i.e. record) is 1024 data points but this
might change in the future.
"""
from datetime import datetime
from logging import getLogger
import locale
from struct import unpack, calcsize
from math import ceil
from re import se... |
ad91d1cfa016faf474fe663cfef7a6bc2900fe0877b924a0409683f7d17383bb | Python | 13,293 | 366 | """
Simple loading through MOABB and pre-processing pipelines.
"""
import numpy as np
from os.path import join
import moabb
from moabb.datasets.base import BaseDataset
from moabb.paradigms import LeftRightImagery
import mne
from mne.io import read_raw_gdf
from autoreject import get_rejection_threshold
from help_f... |
17f96561ad0bf41a7e35ceb30c1012674d4491bdb2952e46f9be5b222130bca1 | Python | 13,294 | 401 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
file containing plotter functions for example scripts
'''
from matplotlib.collections import PolyCollection
from matplotlib import gridspec
import matplotlib.pyplot as plt
import os
import numpy as np
import h5py
import LFPy
import matplotlib.style
matplotlib.style.use(... |
cac9b13534b40416352eceb0e0b2ec56d2eea013383d01e01c572ff0269e021c | Python | 13,294 | 492 | from collections import OrderedDict
import torch
from torch.nn import BatchNorm2d, Conv2d, Flatten, Linear, Module, ReLU, Sequential
from elasticai.creator import ir
from elasticai.creator.torch2ir import (
Torch2Ir as Torch2IrTranslator,
)
from elasticai.creator.torch2ir import (
Torch2IrWithParams as Torch2... |
2061d0bee56d744653e7c49cef5e884f0d3cb12d804d2d1c5d0f3cd9aafc8483 | Python | 13,295 | 301 | import os
from typing import Any, Callable, Dict, List, Tuple, Union
import mne
import numpy as np
from mne.io import read_raw_edf
from ....utils import get_random_dir_path
from ..base_dataset import BaseDataset
def _crop(raw: mne.io.BaseRaw, start_at: int = 15 * 60, end_at: int = 15 * 60 + 6 * 60 * 60):
if end... |
f40e2783cf1f40d143f858cf78c19fedd16f262f88b74094f5284ddd5cd495de | Python | 13,296 | 346 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import itertools
import pddl
import timers
from functools import reduce
def convert_rules(prog):
RULE_TYPES = {
"join": JoinRule,
"product": ProductRule,
"project": ProjectRule,
}
... |
08803e63aa657831a70f7cb8931d3489e5acc69528f28df4c6696385005d3226 | Python | 13,297 | 353 | """
GIF output module for registration results.
Generates animated GIFs cycling through slices along each axis (coronal,
sagittal, axial) for ANTs and Laplacian registration outputs, with and
without CCF annotation boundaries overlaid.
"""
import os
import gc
import numpy as np
import cv2
from PIL import ... |
5069d51b03e670719eb7282780ce1bafcd34e616d18058d815a4d57ddc0d9702 | Python | 13,300 | 374 | import numpy as np
from skimage import measure
from sklearn.decomposition import PCA
from numba import jit
from scipy.special import sph_harm
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import shortest_path
from trimesh import curvature
import trimesh
def get_com(coord):
"""returns center of ... |
9e09f9baedbe93325f21f02822f76c9578fdec001ad42330096a6ac3c92c52ba | Python | 13,302 | 399 | import requests
import pandas as pd
from tqdm import tqdm
from rdkit.Chem import rdMolDescriptors, Crippen, rdchem, SDMolSupplier
import rdkit
import math
from dataset import ProteinDataset
lg = rdkit.RDLogger.logger()
lg.setLevel(rdkit.RDLogger.CRITICAL)
def annotate_uniprot(df: pd.DataFrame):
'''
Extracts ... |
8105f1bb0cad28e200105d2e5001ec3e94df7e5d3f33a437e439d6f700f1b8ca | Python | 13,305 | 278 | from typing import Callable, Dict, List, Union
import numpy as np
import torch
from scipy.signal import hilbert
from torch_geometric.data import Data
from ..base_transform import EEGTransform
class ToG(EEGTransform):
r'''
A transformation method for constructing a graph representation of EEG signals, the re... |
20e7c3fe6d899f8252d9f771113e2b705e9b615885d2124b293bad0a062cd54d | Python | 13,306 | 220 | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 29 16:59:54 2021
@author: CY
"""
from collections import OrderedDict
from torch.utils.data import Dataset, DataLoader
from batchgenerators.dataloading.data_loader import SlimDataLoaderBase
import numpy as np
from batchgenerators.utilities.file_and_folder_operati... |
3da819890a9068d33bb4ad6040670b918cc8e64b34e40c69bb80c70107020651 | Python | 13,306 | 304 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Pose_design_window(object):
"""Pose estimator GUI design:"""
def __init__(self, screen_height=None, screen_width=None):
# Get screen dimensions if not provided
if screen_height is None or screen_width is None:
screen = QtWidgets.QAp... |
d1c8932b5215e162aed5db6d1457c27f9faddadfebf4e3d7bb98b2e4d315891e | Python | 13,310 | 420 | '''
Created on 20.08.2020
Author:
Michael Diedenhofen
Max Planck Institute for Metabolism Research, Cologne
Read Bruker ParaVision JCAMP parameter files (e.g. acqp, method, visu_pars).
'''
from __future__ import print_function
VERSION = 'pv_parser.py v 1.0.2 20200820'
import re
import sys
import collections
impo... |
f5f780a75d37860573376d23b598fdf47d92d5df894b64209a065d43e9b0ffa4 | Python | 13,311 | 302 | from typing import Dict, Tuple, Union
import numpy as np
from scipy.interpolate import griddata
from ..base_transform import EEGTransform
class ToChunks(EEGTransform):
r'''
Splits the EEG signal into a specified number of chunks along the temporal dimension.
Args:
num_chunks (int): The number o... |
757978203f1c8c48f81e08ae390d1792e68637087c3fd5f4e85a1fe49967c46e | Python | 13,314 | 387 | # 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... |
3d978b005f6e8ac2fa101ed1c74fa94a67c088210be80f4732735459dd42fb0b | Python | 13,319 | 310 | """Create a project-level single-image or overlay report from NIfTI suffixes."""
import argparse
import csv
import logging
from pathlib import Path
if __package__:
from . import batch_qc_reports as qc
else:
import batch_qc_reports as qc
import matplotlib.pyplot as plt
import nibabel as nib
import numpy as np... |
ef7789c111ebdc09d04c56bb7f55fd4b2d38898465dc344d1b5e1205ff59e668 | Python | 13,319 | 195 | """SIGN_WORLDS.py 2026-10-07. Pre-registration: 04-NOTES/PREREG-2026-10-07a-SIGN-WORLDS.md
Do the 164 laboratory-checked predictions of Shiu et al. (2024, Nature 634:210) survive the transmitter signs that the
classifier is unsure of? 106 of them are an optogenetic screen (CsChrimson in 106 SEZ cell types, proboscis ex... |
8edc8afc856b6f9c85dd8cb0f7079d82bc28b6d0f139501322424df89eb0139e | Python | 13,320 | 320 | import torch
import torch.nn as nn
import numpy as np
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
import os
import time
import matplotlib
import matplotlib.pyplot as plt
import random
import pandas as pd
import torch.nn.functional as F
import argparse
from Models import *
parser = ar... |
6a21baea0c46b30e9bc7ebb863b84e02d5e034318911bda45d86bc6ea6797416 | Python | 13,321 | 334 | """Compositor node assets and the Canvas plumbing that wires them up."""
import bpy
import numpy as np
import pytest
import molecularnodes as mn
from molecularnodes.nodes import compositor as mc
from .constants import data_dir
GROUPS = [
mc.ConeShadow,
mc.CompositeDepthFog,
mc.DepthOutline,
mc.IDOutli... |
237e9521809136128f565321571875cc4ba86daf7d63959083b69fb4c92e98e4 | Python | 13,323 | 358 | import anndata
import numpy as np
import pandas as pd
from pandas import CategoricalDtype
DATA_TYPE_MODULE = "module"
DATA_TYPE_UNS_KEY = "data_type"
ADATA_MODULE_UNS_KEY = "anndata_module"
ADATA_LAYERS_UNS_KEY = "anndata_layers"
def get_base(adata):
base = None
if "log1p" in adata.uns and adata.uns["log1p"]... |
749932746184e7182867edeba72f4d895747fca47515556f4a1ee22735a049df | Python | 13,323 | 324 | """
Performs Univariate 2nd order analysis and comparison again a model from a ListTomoParticles
Input: - The path to the pickled ListTomoParticles object
- Parameters to set up the model simulation
Output: - Plots with the analysis
- Matrix with the analysis for further post-pro... |
c5b9d568b0333d830a3f950410b89c11e64ab633724cd4b659b6d40a3cad44d9 | Python | 13,323 | 372 | # 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... |
9ca8875ce61c4758cebaabca51c6d3b420ca11b094be94143137ffb6ce4362f7 | Python | 13,327 | 414 | import pandas as pd
import numpy as np
import csv
import json
import os
from sklearn.utils.extmath import randomized_svd
from sklearn.decomposition import TruncatedSVD
import scipy.stats as stats
from numpy.random import RandomState,SeedSequence
from numpy.random import MT19937
from scipy import signal
import scipy
fr... |
dc3b8b62c6353014f607ec6a251e97fce337675fd62844084af249c8666ecb51 | Python | 13,331 | 415 | # 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... |
7deb7bda278d78d7a1eecd82f93eb8218fdacad1588f5ab291bdb0e0875b241d | Python | 13,333 | 394 | # imports
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from pathlib import Path
from matplotlib import lines as mlines
from multisim import MultiSim
from scipy import interpolate
# set plotting style
plt.style.use(['default', 'biophysics.mplstyle'])
data_dirs = [
Path('paper_data2/fig1/... |
e1f4cf9444f4eda215ba851f0b5998a9cc3651f576cce5ffe66e0e8d2d12fab8 | Python | 13,333 | 302 | import numpy as np
## returns total number of spikes for a full well
def total_number_of_binary(spikes_binary):
return np.where(spikes_binary.flatten() == 1)[0].shape[0]
## returns mean firing rate (spikes) in Hz for a full well
def mean_firing_rate(spikes_binary, total_seconds = 600):
return np.round(np.wher... |
b2f93e2e90d883e4d86d61c2e39d601639d56b408ec8cd96e9a452d01fc971b5 | Python | 13,334 | 352 | # -*- coding: utf-8 -*-
"""
Created on Wed May 29 12:42:15 2024
@author: mpolonen
"""
import numpy as np
import os.path as op
from numpy.testing import assert_array_equal
import mne
from mne_bids.copyfiles import copyfile_brainvision
# from mne_bids import write_raw_bids, make_bids_basename
# from mne_bi... |
b306510e6275a2c5c85d41c7bd537a6a719d442f903ef7447540298e8d4b80c3 | Python | 13,336 | 356 | from brian2 import *
import matplotlib.pyplot as plt
import numpy as np
from math import cos, tan, sin, exp, floor, sqrt
#Izhikevich model with exponentially decaying current inputs:
class izzy:
eqns = '''
dv/dt = (0.04*v**2 + 5*v + 140 - u + I)/ms : 1
du/dt = (a*(b*v - u))/ms : 1
dI/dt = (0 - I)/tau ... |
214c4df8f4d5d1a8b2d406c5f6f683258dd4c9fce790c3f3d671f77454f5d3b6 | Python | 13,337 | 355 | import datetime
import json
import os
from cirrocumulus.abstract_db import AbstractDB
from cirrocumulus.envir import (
CIRRO_JOB_RESULTS,
SERVER_CAPABILITY_ADD_DATASET,
SERVER_CAPABILITY_DELETE_DATASET,
SERVER_CAPABILITY_EDIT_DATASET,
)
from cirrocumulus.io_util import unique_id
from cirrocumulus.job_a... |
2db403c89125d6128833c21bce1a00ca3b9ebf0372f216a30397d3eaa614b03a | Python | 13,344 | 381 | import json
from pathlib import Path
import bpy
import databpy
import mrcfile
import numpy as np
import starfile
from databpy import AttributeTypes, BlenderObject
from pandas import CategoricalDtype, DataFrame
from PIL import Image
from scipy.spatial.transform import Rotation
from ... import blender as bl
from ...nodes... |
3d840e5dae6d24fc99b5c116157f407c41f606b6d02fbb96732fba029d162591 | Python | 13,344 | 359 | #! /usr/bin/env python2.6
# -*- coding: utf-8 -*-
import sys
TIMEOUT = 1800
EPSILON = 0.0001 # Don't care about this little time.
class Results(object):
def __init__(self, file):
self.configs, self.problems, self.data = self._parse_entries(file)
self._add_missing_entries()
assert len(se... |
154fbb68300a1f2d953545aba0ecc6873967b09a24121410110e7b966e0a8dc8 | Python | 13,348 | 279 | import torch.nn as nn
import torch.nn.functional as F
import torch
class EEGfuseNet(nn.Module):
r'''
EEGFuseNet: A hybrid unsupervised network which can fuse high-dimensional EEG to obtain deep feature characterization and generate similar signals. For more details, please refer to the following information.
... |
9b4560df41eb38df2bb3dbf8de8413e730b7bdcc3a1512eb17dba99d9ac81a7e | Python | 13,351 | 362 | # Copyright 2018 The TensorFlow 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 applica... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.