sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
ba11eb61690bc44feb1793a41ca2279b41d4b2b8e02871d542fb6ddd472fa2d0
Python
27,055
238
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
968dd6e439bf9808db872c2876f7534cd8a147d1b59e7cd2e16bfa321230292e
Python
27,065
771
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 26 13:05:23 2021 @author: joaquin """ import matplotlib.pyplot as plt import seaborn as sns import numpy as np import scipy.io import pandas as pd import os import mat73 from scipy import signal from scipy import stats def eegfilt(data,srate,flo...
10b6309006c0f4f912b51dbf497006e5f3fecca271e8b1ba7bedbe0c7e1852ab
Python
27,069
749
""" Internal ADT (Abstract Data Types) for predictor introspection. This module defines the type system used internally for introspecting predictor inputs and outputs, and validating input values. """ import dataclasses import os import typing from dataclasses import dataclass from enum import Enum, auto from typing ...
de18a8707ff837cbf0466dfef32156ccceed4b08e312f7a7ebd5ea59ab124303
Python
27,073
796
import sys from functools import lru_cache from marshal import dumps, loads from random import randint from typing import Any, Dict, Iterable, List, Optional, Type, Union, cast from . import errors from .color import Color, ColorParseError, ColorSystem, blend_rgb from .repr import Result, rich_repr from .terminal_them...
fb137ace9c4331ce408c66e2ea53e4032f806e5b8d09f22eb6eb4da2fe0be19f
Python
27,088
625
# Copyright 2020 The HuggingFace 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 # # Unless required by applicabl...
36771fa2b08e7e6cca99d61320ea86a7bc291615017b069b0de8315026f28de2
Python
27,099
625
""" Generate a synthetic set of microsomes with different membrane bound proteins Input: - Data set parameters: + Number of tomograms (one microsome each) + Tomogram size + Resolution (pixel size) + SNR range + Missing wedge (sem...
50309246ad4a14e967766f268d4a728eeafe00f492d49c4a2bdf77a0fc2bedf4
Python
27,109
683
from . import get_submodules_from_kwargs __all__ = ['load_model_weights'] def _find_weights(model_name, dataset, include_top): w = list(filter(lambda x: x['model'] == model_name, WEIGHTS_COLLECTION)) w = list(filter(lambda x: x['dataset'] == dataset, w)) w = list(filter(lambda x: x['include_top'] == incl...
1e363f2797ae0259540cb9bd5ac7f552dbf8c50f6c145e503647a6a8ae6f953d
Python
27,113
603
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'dgn_preproco_ctrl.ui' ## ## Created by: Qt User Interface Compiler version 6.8.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! #...
f619427aa90a77be3eb88fe1a74c49a7242181581b87c544dfd0117cb1371494
Python
27,122
718
# 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...
70fe826e9e563abf667847fda94401b964bcd4e477fec2bcd3f864759c2cdf2a
Python
27,132
494
import math from e3nn import o3 import torch from torch import nn from torch.nn import functional as F from torch_cluster import radius, radius_graph from torch_scatter import scatter, scatter_mean import numpy as np from e3nn.nn import BatchNorm from utils import so3, torus from datasets.process_mols import lig_feat...
95c5bbf53510bf80ea68cc6ca2a8e9aec31d1c15b91c8b5661619e1bbe257154
Python
27,141
726
# # 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,...
e2fa4a7fad150dbb95314ca4e3b462ac70c1b6b03028b6bc12b13ad350ba92cc
Python
27,154
615
""" A simple GUI framework for the U01 stitching workflow. Andy Thai andy.thai@uci.edu """ # Import standard libraries import glob import os import subprocess import sys import tempfile import time # Heavy third-party imports (loaded when tab is first accessed) import cv2 import joblib import numpy a...
14d222d4a408aba5b502b70efc935f9ce19a3de0e15710883083db65d99206dc
Python
27,226
617
import numpy as np import time import unittest import pyntbci FS = 120 N_TRIALS = 11 N_CHANNELS = 7 N_SAMPLES = 2 * FS N_CLASSES = 5 DECODING_LENGTH = 0.1 DECODING_STRIDE = 1 / 60 ENCODING_LENGTH = 0.3 ENCODING_STRIDE = 1 / 60 CYCLE_SIZE = 1.0 class TestCorrectLatency(unittest.TestCase): def test_correction(se...
ffc24e98c17025cdc9e2532a857ce48a217d966b8b5617d5f1cb2f044ce24d59
Python
27,245
448
"""Shadow-mode spatial dopamine field prototype (hypothetical; never fed back into the reservoir). Reads recorded reservoir states, maps the 16 DA-classified neurons' activity to a nonnegative release proxy and integrates a 3D reaction-diffusion field dC/dt = D ∇²C − k C + S(r, t) on a voxel grid around the CX51...
9760e291c2cff6c6e53fd193ff8dd8af73192bd80e009696c1c3460119700efe
Python
27,247
751
import bpy import MDAnalysis as mda import numpy as np import pytest import molecularnodes as mn from .constants import data_dir @pytest.fixture def canvas(): return mn.scene.base.Canvas() @pytest.fixture() def universe(): topo = data_dir / "md_ppr/box.gro" traj = data_dir / "md_ppr/first_5_frames.xtc" ...
1ca0f5cc3f8e2065ba447d9f19e836867d587322f9e1b5ccb1385b3e8e23f5d7
Python
27,248
825
import uuid import copy import navis import matplotlib.colors as mcl import numpy as np import pandas as pd import plotly.graph_objects as go import seaborn as sns import scipy as scp import scipy.cluster.hierarchy as sch import scipy.spatial.distance as ssd from dash import dcc, html from dash.exceptions import Prev...
e15fa0b09574eff2508bbb78cc9e2b36cc05267e9f27f1c899823793e585c187
Python
27,259
326
import os.path import sys from ckg import ckg_utils from ckg.graphdb_builder import builder_utils from ckg.graphdb_builder.databases.parsers import * from joblib import Parallel, delayed from datetime import date try: ckg_config = ckg_utils.read_ckg_config() log_config = ckg_config['graphdb_builder_log'] ...
51932a03800d3e66c91d4d74d1a619e2f640813266d0d1b1689be2a37a42066a
Python
27,272
654
""" Analyzes oriented membrane segmentations inter-distances from lists of tomograms Input: - A STAR file with a set of ListTomoOMSegmentations pickles (SetListOMSegmentations object input) - Settings for the measurements Output: - Plots by tomograms - Global plots """ ########...
04fa92ded8226b2d7e59c8a530a504394742ea90e475de587dba51f3ab3727b5
Python
27,331
664
import argparse import collections import gzip import math import os import random import shutil import subprocess import sys import time sys.path.insert(0, '/home/jupyter/repos/genformer') import numpy as np import pandas as pd import tensorflow as tf import pybedtools as pybt import tabix as tb from datetime impor...
cf642eda852cdd7915bb0edb15baffd9e22441b82760f5ba1db474ea0f8c9836
Python
27,340
946
# 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...
a267a0794f5cf4221acc640a8dec9a25ba42435b2b49987d61e0738b09f4b5ac
Python
27,348
579
# coding=utf-8 # Copyright 2020 The Google AI Language Team Authors 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/LICEN...
ef7d6d77368f72ba80fe7d4f705e990282383c5ac064eba3da3e196c83d437a3
Python
27,353
946
# 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...
20decb0e3f84f3afc4859c7d6a1878b895d312a66ad829b4fc6535a3f3758cb0
Python
27,355
946
# 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...
96649951c75cc25ed15ef598a1927bbc3848141d7a296ae0278c39728ac045ed
Python
27,379
605
""" Classes to handle cell assemblies detected in the previous step of the pipeline authors: Michael Reimann, András Ecker, Daniela Egas Santander last modified: 10.2022 """ import os import numpy as np from scipy.stats import binom, pearsonr, hypergeom __io_version__ = "1.0" __str_io_version__ = "_version" __h5_str...
cab2877f87d26260afecb3a605aa69dd26f41257e9ba84204b798d5beb362671
Python
27,456
604
import os import sys import time import json import random import argparse import datetime import numpy as np import pandas as pd import torch import torch.distributed as dist from torch.optim import Adam, AdamW, SGD from torch.nn.parallel import DistributedDataParallel as DDP from torch.utils.data import DataLoader, ...
698f63a5e169b6096420857e6c3681f188b5b10af08c13255edc6c8fa1af0565
Python
27,458
478
import time import os import argparse import wandb from datetime import datetime import tensorflow as tf from tensorflow.keras import mixed_precision import numpy as np import sys # Environment configuration for TensorFlow os.environ['TF_ENABLE_EAGER_CLIENT_STREAMING_ENQUEUE']='False' sys.path.insert(0, os.path.expa...
12ca67b07341421daf36388ec93e863b42bdf678557eee20f7d360fda3caa59b
Python
27,462
797
# 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...
f25b1532dfc502e88636c7ff7bb0bbfdc0923843bba47ca3815991371f965ebc
Python
27,475
740
"""Support for installing and building the "wheel" binary package format. """ import collections import compileall import contextlib import csv import importlib import logging import os.path import re import shutil import sys import warnings from base64 import urlsafe_b64encode from email.message import Message from i...
48f9c2a433d3c8f22dddcfabc48c6ea580b5f403ec6a3b45ee423ecbe4ab85a7
Python
27,476
742
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Oct 26 09:28:25 2019 Collection of functions for preprocessing experimenal visual data. @author: irisyoon """ import numpy as np import matplotlib.pyplot as plt import sys sys.path.append('/usr/local/lib/python2.7/site-packages/') sys.path.append('/usr...
935cbe727757c19ad49a888cfceadfd557092c405ddefea683333a61fb02390b
Python
27,481
681
#!/usr/bin/env python3 import logging import warnings from time import localtime, strftime from typing import Union, Callable, Optional import numpy as np from ase import Atoms from ase.optimize.optimize import Optimizer from ase.utils import basestring from ase.io.trajectory import Trajectory from .restricted_step ...
c4cc56d69852892d6151f79c2b311a12bf3f69cdeacf4509ff443cee89dac500
Python
27,496
549
import io import json import os import shutil import unittest import pandas as pd from hed import Sidecar, SpreadsheetInput, TabularInput, load_schema_version from hed.errors.error_reporter import ErrorHandler from hed.errors.error_types import ErrorContext, ValidationErrors from hed.models.column_source import ListC...
b044106829fcaec859ca9a8e69bd80da1dabe02713c5cc4f983e40ee1b3c2c0d
Python
27,500
1,088
# parsers.py import argparse import sys from fba import __version__ def coords(s): try: # from itertools import chain # s = ''.join([i.strip() for i in chain.from_iterable(s)]).split(',') # return [int(i) for i in s] return [int(i) for i in s.split(",")] except TypeError: ...
d514ebfcfaf29d316697ee488958948ef1e8cf49377158f35dfd1d4f02829e46
Python
27,535
490
############################## ######## Shallow Grid ######## ############################## #%%# Catalyzer sup_comp = False # Super Computer? inference_prod_activate = True # Activate Inference Procedure? data_path = 'Shallow_Grid_1_Rule_Kern' acts = [0] # [0, 1, ...] act = max(acts) _observe = 1 # {0, 1, ...} # L ~...
f28a48adf65b97cc9c81381a6fe6b784e117cd21f1c0c8559d60a3d02276ad5e
Python
27,536
490
############################## ######## Shallow Grid ######## ############################## #%%# Catalyzer sup_comp = False # Super Computer? inference_prod_activate = False # Activate Inference Procedure? data_path = 'Shallow_Grid_1_Rule_Kern' acts = [0] # [0, 1, ...] act = max(acts) _observe = 1 # {0, 1, ...} # L ...
85db2fd871a0cf7d793b65042efc111fc1eaac4d63cc36358431108dcaf8202c
Python
27,539
587
from __future__ import print_function import argparse import math import numpy as np import pybullet as p from pr2_utils import TOP_HOLDING_LEFT_ARM, LEFT_ARM_LINK, LEFT_JOINT_NAMES, RIGHT_JOINT_NAMES, TORSO_JOINT_NAME, \ REST_RIGHT_ARM, \ load_inverse_reachability from create_ir_database import create_invers...
04197953da0f277b6898b8b4910810b729f1fea5ab7177a6c55a08a86df4fad8
Python
27,598
903
#!/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 ...
39973eb068f3471d1e165e63b0403757743932404947940b6d9622cff1003cbd
Python
27,598
847
from __future__ import annotations # built-in from collections import defaultdict from itertools import zip_longest from typing import Any, Sequence, TypeVar # app from .base import Base as _Base, BaseSimilarity as _BaseSimilarity from .types import SimFunc, TestFunc try: # external import numpy except Impo...
479980bab3838d465260eaecdc584877a264a21d31e17e03809834e581344863
Python
27,629
729
""" Classes for doing the spatial analysis of structures in membranes # Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry) # Date: 12.06.15 """ __author__ = 'martinez' from pyto.segmentation.cluster import Cluster from .globals import * from pyorg import pexceptions ##### PACKAGE VARIABLES ST...
c6e4fe22e2e084f96a0d64db4ae91117d3279c1faf37363ba8dad60c09d5c745
Python
27,637
657
# For fully-connected models import torch import torch.nn as nn from abc import ABCMeta, abstractmethod from typing import Union, Tuple, Dict from torch.distributions.distribution import Distribution from mnp.models.parents import SimpleModel, MetaModel # The CNP should read the inputs for each batch # and then outpu...
f60b7a216f4a80e156f5ef35ddc3314394456f846bc064f462bcdbfe9bac563e
Python
27,642
801
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Simulation and plotting script reproducing figure 2 of: Multimodal modeling of neural network activity: computing LFP, ECoG, EEG and MEG signals with LFPy2.0 Espen Hagen, Solveig Næss, Torbjørn V Ness, Gaute T Einevoll bioRxiv 281717; doi: https://doi.org/10.1101/28171...
94d582094c1bcfb0a9ea8dee8ee40d4689df5f8c39b203b691366259ac46ed43
Python
27,643
687
""" Functions to create meshes for demos. :func:`create_cubes` defines a 'cube-in-a-cube' mesh using the built in :class:`dolfin.UnitCubeMesh()`, with subdomains defined and marked by :func:`facet_topology` and :func:`cube_condition` :func:`create_spheres`, :func:`create_ellipsoids`, :func:`create_cylinders`, and :fun...
f1e0eac333a1c18886e1b0166ea0e44361124b761a7e52ff57203f3982b3bbf0
Python
27,654
610
# coding=utf-8 # Copyright 2020, The RAG Authors 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 # # Unless r...
d3b85db0384e6e3caf59149a1d8985ba6cbcc34783b17b95d117f2aab6b8a39d
Python
27,661
719
""" Base classes for representing signals. """ import logging from copy import deepcopy from functools import partial import numpy as np import xarray as xr from ..models.model import Model from scipy.signal import butter, detrend, get_window, hilbert from scipy.signal import resample as scipy_resample from scipy.sig...
1101ae95d0493b76f078562d00252bc2ff334b7882cab0d8db575234eada3e89
Python
27,670
733
""" Classes for doing the spatial analysis of structures in membranes # Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry) # Date: 12.06.15 """ __author__ = 'martinez' from pyto.segmentation.cluster import Cluster from .globals import * try: import pexceptions except: from pyseg import...
7881e7fd772fead2f450e78bc8b109d77a90f73fcd734faf568c557298caa42f
Python
27,686
545
from unittest import mock import numpy as np import unittest import pyntbci FS = 120 PR = 60 SHIFT = 2 v = pyntbci.stimulus.make_m_sequence() SHIFTS = np.arange(0, v.shape[1], SHIFT) V = pyntbci.stimulus.shift(v, SHIFT) V = np.repeat(V, FS // PR, axis=1) N_CLASSES = V.shape[0] CYCLE_SIZE = V.shape[1] / FS LAGS = S...
1b9dceab5f852ef04fad33409114e6ff68abaf841d82b58a31a63fff1cccada2
Python
27,712
837
import json import os import numpy as np from numpy.random import default_rng import random import math from dreamcoder.task import Task from dreamcoder.type import arrow, tint, tlist from dreamcoder.domains.arc.arcPrimitives import * import dreamcoder.domains.arc.arcPrimitives as p def make_rotation_tasks(): # ...
cd90f82c54737c4b78bedbb807c7f3c2a6da6df49824dc893e7e6980e34310cb
Python
27,713
783
# Copyright (c) 2023-2024 Blue Brain Project/EPFL # 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 ...
d9b823a4fcbd239d5809a88da9c904771a87c6c915bb909410268b070f2e08ff
Python
27,713
534
# -*- coding: utf-8 -*- # @title Generate configuration files for bioemum # @file gen_conf_snn_hh.py # @author Romain Beaubois # @date 06 Oct 2023 # @copyright # SPDX-FileCopyrightText: © 2022 Romain Beaubois <refbeaubois@yahoo.com> # SPDX-License-Identifier: GPL-3.0-or-later # # @brief Sc...
3c309c001963d16f36f41c3df35e9482ab466e5f2c316490b967ca45667d0924
Python
27,718
673
import threading from collections import OrderedDict from random import Random from typing import Dict, Iterator, List, Optional, Union import numpy as np from torch.utils.data import DataLoader, Dataset, Sampler from rdkit import Chem from .scaler import StandardScaler from chemprop.features import get_features_gene...
35edbbc5cce3103d37569aef138407646ea5fea5783e828963a77b8a01ba42a9
Python
27,775
460
#--------------------------------------------------------------------------------------------------------- # Author: Brandon Coventry, PhD Wisconsin Institute for Translational Neuroengineering # Date: 02/16/2023 # Purpose: This is an implementation of PyMCs implementation of Krusckes Bayesian Estimation Su...
aa204a41e007135244e9d0abdea61361e810d9839abd5f201d4aec8d35eef779
Python
27,775
601
"""finds bad channels.""" from copy import copy import mne import numpy as np from mne.utils import check_random_state from scipy import signal from pyprep.ransac import find_bad_by_ransac from pyprep.removeTrend import removeTrend from pyprep.utils import _filter_design, _mad, _mat_iqr, _mat_quantile class NoisyCh...
ef05045a53cee1cb321058ef07e8b1d0b746a786d5fb3acba5a52f7ba101582f
Python
27,780
779
# 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...
cc8c2caa4665ba386b491745a3ad697fc9d80de5e98428db43ae2f597ba2badf
Python
27,786
828
import argparse from argparse import RawDescriptionHelpFormatter from pathlib import Path import os import numpy as np from scipy import fftpack, ndimage from skimage.filters import threshold_otsu import tifffile import pywt import multiprocessing import tqdm from dcimg import DCIMGFile from pystripe import raw from .l...
f67d8953290e451e163a1c6f3567b9c8ab3730cc68bd03cf0acc2728cfb41b0c
Python
27,786
800
""" Parses output files from fusion-finding algorithms """ import csv import re import sys import pandas as pd class _Parser: """Base parser.""" def __init__(self, logger): self.fusions = [] self.iterator = 0 self.logger = logger def __iter__(self): return self def...
97270dd90a412e1e1e3de81daf1656c7952b4f11b3187c560e679494ab5f82ac
Python
27,813
942
# 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...
dd1c36cabe88a7bf3049c45919323c00f63ee2fb88d6b4b0ad6318e54ad14873
Python
27,815
711
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu. """ import numpy as np from pathlib import Path from scipy.ndimage import gaussian_filter1d from scipy.stats import zscore, spearmanr from scipy.cluster.hierarchy import fcluster, linkage from sklearn.decomposition i...
0b5664ca97e67c789cdebad907475824c983a2b33a39b7fad97b3628894dec0c
Python
27,819
580
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 16 08:00:51 2020 @author: daltonm """ #%matplotlib notebook import numpy as np import pandas as pd import matplotlib.pyplot as plt import pickle from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler from sklearn.me...
899c112478c4fe79b5f4528e463ea64cc17a744f62e079cce8d9bf698d791ca9
Python
27,819
515
from best_cut_node import best_cut_node import numpy as np from sklearn import datasets from sklearn.neighbors import KDTree, NearestNeighbors from sklearn.decomposition import PCA import pandas as pd from numpy.linalg import svd from sklearn.preprocessing import StandardScaler, normalize import pandas as pd import ran...
6e480ed7e42d6b966b992ef04dd74acf473dcf41c39d3f5c7d865e18f9463229
Python
27,838
624
import os import sys import h5py import xron import toml import torch import pysam import shutil import inspect import argparse import numpy as np from typing import Callable from datetime import datetime from itertools import groupby from functools import partial from fast_ctc_decode import beam_search as fast_beam_s...
cb54367ec57518a0ca3e2b686a938b2c4b3be5637312977897f45ecc2b7ddbb7
Python
27,845
730
import contextlib import functools import logging from typing import ( TYPE_CHECKING, Dict, FrozenSet, Iterable, Iterator, List, Mapping, NamedTuple, Optional, Sequence, Set, Tuple, TypeVar, cast, ) from pip._vendor.packaging.requirements import InvalidRequiremen...
3b3740ff4fe5997566e50a807642e1d4f141b4d2d09dbf5ce6a27b61f58e17e6
Python
27,854
522
import torch import torch.nn as nn from torch_geometric.nn import global_add_pool from utils.constants import LayerType class GAT(torch.nn.Module): """ I've added 3 GAT implementations - some are conceptually easier to understand some are more efficient. The most interesting and hardest one to underst...
e0f9dce01fd01b1e733db150142531a5e431a72df82debfeca922970c4831598
Python
27,875
796
#!/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...
460f1107f5302ece27634b6e2549dfbd2b837fd8ef3f7600d4d2b210f146b952
Python
27,885
850
# 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...
6731fbedf6dcad28f1eb353f7ef94a7543c37f8595697df349c6ac1d1aff303a
Python
27,915
443
import os import sys from warnings import warn import matplotlib.pyplot as plt import numpy as np import pandas as pd from datetime import datetime if __name__ == '__main__': if len(sys.argv) < 2: anatomy_subject_name = 'DTI004' ecg_subject_name = 'DTI004' # Allows using a different ECG for the per...
90534f53b59f7ff61383162c3437fdc7cf179a3bda27bb70cae5354ffd53d5b7
Python
27,926
749
import numpy as np import pandas as pd import matplotlib.pyplot as plt import scanpy as sc from scipy.sparse import issparse from sklearn.preprocessing import normalize import torch from torch.utils.data import TensorDataset, DataLoader, WeightedRandomSampler import torch.optim as optim import torch.nn as nn import tor...
3141199971e874ee7bcae35e13874c4eece517004f363bd6be870a33544346e1
Python
27,929
451
# coding=utf-8 # Copyright 2021 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 # # Unless required by applicable...
34b60f5bcfd847934f151ccbd6971e24757025d8f9b835d52fab618b14ac2c3b
Python
27,948
607
#https://machinelearningmastery.com/image-augmentation-deep-learning-keras/ from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img from PIL import Image import glob from PIL import Image from PIL import ImageOps from PIL import ImageFilter from PIL import ImageEnhance from PIL ...
080648315aa9421a7ac0f1fabd38df173ebc4b72f44f85f3ddfa5faa2a7827fc
Python
27,961
901
# Nucleus 2022.04 # Tiago Rito, The Francis Crick Institute import os from skimage import io import numpy as np import matplotlib.pylab as plt from matplotlib import colors #!pip install Faker from faker import Faker fake = Faker() import pandas as pd import cv2 as cv2 #!pip install networkx==2.5 #!pip install cupy-c...
78511e7466afadd1bf7e8f268195f69514cb7c28f885ce4811259d358b79d45a
Python
27,984
602
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 16 08:00:51 2020 @author: daltonm """ #%matplotlib notebook import numpy as np import pandas as pd import matplotlib.pyplot as plt import pickle from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler from sklearn.me...
d7ba9f751c0ef9e877b49aa165790374501984af4d6907cbf971dbde8b745e30
Python
27,984
658
"""Format templates for HED schema error messages. Add new errors here, or any other file imported after error_reporter.py. """ from hed.errors.error_reporter import hed_error, hed_tag_error from hed.errors.error_types import ( ColumnErrors, DefinitionErrors, ErrorSeverity, SidecarErrors, TagQuali...
d83d1ba0d513169f5e0ee131d499e976d205db60320350278c3ef4cf97ec445d
Python
28,007
758
import datetime import multiprocessing as mp import os import sys import time from collections import OrderedDict import numpy as np import torch from torch import nn import torch.nn.functional as F from torch.utils.data import DataLoader from topaz.filters import AffineDenoise from topaz.model.utils import load_state...
16f42fe02d3da189c983781533058319789ccaed4c940ba4d7ebb5bc72fcbad2
Python
28,024
677
# 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...
d5ab7da4cad931ab6ec69596d9168e4a657dd1b9a3ed4c9b1cbe74e9474bb909
Python
28,033
758
# set QT_API environment variable import os os.environ["QT_API"] = "pyqt5" import qtpy import pyqtgraph as pg import pyqtgraph.dockarea as dock from pyqtgraph.dockarea.Dock import DockLabel import control.utils.dockareaStyle as dstyle import numpy as np from collections import deque # qt libraries from qtpy.QtCore ...
635eb2db6016d644f31b11c4b52d70b7bc74b221b49841e18dcc0f0e228cbf49
Python
28,051
542
''' Implements the combinedFC connectivity method published in: Sanchez-Romero, R., & Cole, M. W. (2020). Combining multiple functional connectivity methods to improve causal inferences. Journal of Cognitive Neuroscience, 1-15. Toolbox to reproduce the results of the paper in https://github.com/ColeLab/CombinedFC. Ver...
6ce6dbb57e4e9d3b56562723d07aa266a8ec7813a7cae664c295865a49fa5eb1
Python
28,073
489
############################## ######## Shallow Grid ######## ############################## #%%# Catalyzer sup_comp = False # Super Computer? inference_prod_activate = True # Activate Inference Procedure? data_path = 'Shallow_Grid_1_N_Link' acts = [0] # [0, 1, ...] act = max(acts) _observe = 1 # {0, 1, ...} # L ~ {1...
c329f4df1ca85b29e1602944d95967fde65b2fb17f94900a8ca9ecba31d5687c
Python
28,074
489
############################## ######## Shallow Grid ######## ############################## #%%# Catalyzer sup_comp = False # Super Computer? inference_prod_activate = False # Activate Inference Procedure? data_path = 'Shallow_Grid_1_N_Link' acts = [0] # [0, 1, ...] act = max(acts) _observe = 1 # {0, 1, ...} # L ~ {...
bc0999328a9f57019e06b4a011769aa049b7fde5c0697c005b3ff64184b247ee
Python
28,084
542
#%% """This script is used to gathering reads from a given sites file with a sam index file.""" import os import sys import h5py import pysam import numpy as np import pandas as pd from tqdm import tqdm import random import time from typing import List from multiprocessing import Pool,current_process,RLock from multip...
c54ee368b0ebcf9bb3a9111fe80843e85ac0489d54b8a5c84b4471c04d2cd787
Python
28,089
772
import sys import os import time import math import shutil import torch import numpy as np from PIL import Image, ImageDraw, ImageFont from torch.autograd import Variable import struct # get_image_size import imghdr # get_image_size class AverageMeter(object): """Computes and stores the average and current value...
4f51ab5989b563c01f54ee4b7af439e138982286c2e617383320236179e5f681
Python
28,098
501
############################## ######## Shallow Grid ######## ############################## #%%# Catalyzer sup_comp = False # Super Computer? cellulate = (0, 0) # (cell_layers, layer_cells) reiterate = f'Reiterate_{cellulate[0]}_{cellulate[1]}' data_path = 'Shallow_Grid_1_Rule_Kern' acts = [3] # [0, 1, ...] act = ma...
6f8f8819b61d475084fbee4097358d8699f44d000533228b0fcd1a72c623ba3c
Python
28,119
497
############################## ######## Shallow Grid ######## ############################## #%%# Catalyzer sup_comp = False # Super Computer? cellulate = (0, 0) # (cell_layers, layer_cells) reiterate = f'Reiterate_{cellulate[0]}_{cellulate[1]}' data_path = 'Shallow_Grid_1_N_Link' acts = [7] # [0, 1, ...] act = max(a...
3709251d1291cc7263b15cf32d4a9c4a3e72f84c6c1847136effa5237608cf9d
Python
28,131
762
""" TODO: Check the commented code for modifying it and getting the appropriate plots; displaying all channels with offset Some functions are modified from Gabrielle Schroeder's functions """ import numpy as np import seaborn as sns import matplotlib.pyplot as plt import sklearn.metrics as sk_metrics import scipy.st...
b628da9dbe2d9aeb779a3e9d6a235a24ae2887803275f51fad3c79ab90daf826
Python
28,169
694
import torch import torch.nn as nn import torch.nn.functional as F import math import torch_geometric import copy from .activation import ( ScaledSiLU, ScaledSwiGLU, SwiGLU, ScaledSmoothLeakyReLU, SmoothLeakyReLU, GateActivation, SeparableS2Activation, S2Activation, ) from .layer_norm i...
be5a4ad3a65e3913ab746dd932c05e7f3bbeb624612b834b63c5de4191153345
Python
28,189
676
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Main simulation script for setting up the model producing the data shown in figure 7 and 8 in: Multimodal modeling of neural network activity: computing LFP, ECoG, EEG and MEG signals with LFPy2.0 Espen Hagen, Solveig Næss, Torbjørn V Ness, Gaute T Einevoll...
870c5edffa539b4c2f97a631d3a6abc7cd26a01384a5f92017faf2303d69d4d6
Python
28,192
651
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu. """ import sys, os import numpy as np import pyqtgraph as pg from qtpy import QtGui, QtCore from qtpy import QtWidgets as QtW from qtpy.QtCore import QEvent from qtpy.QtWidgets import QMainWindow, QApplication, QWidg...
d07d053b8385c96cb26e92c1f467dc8fe391d5168a0def7c569b793ef6c2d8ea
Python
28,192
632
"""the feature extraction module of deepsignal2. output format: chrom, pos, alignstrand, pos_in_strand, readname, read_strand, k_mer, signal_means, signal_stds, signal_lens, cent_signals, methy_label """ from __future__ import absolute_import import sys import os import argparse import time import h5py i...
ea691e2e33df91e21a202e97625560cd75455172d3a24afc31b53914fa8a1027
Python
28,192
641
import os import numpy as np import pandas as pd import torch from torch.utils.data import Dataset import SimpleITK as sitk import random import nibabel as nib from monai.transforms import \ Compose, Resize, AsChannelFirst, ScaleIntensity, ToTensor, RandRotate, RandFlip, RandZoom, EnsureChannelFirst impor...
fefbce95ef492e6d482821a23f3c96213f4da728a1907f70e0764064243ee9ab
Python
28,207
752
""" OXASL: Multi-step Bayesian model fitting for ASL data Based on the BASIL shell command from FSL """ import sys import math import numpy as np import scipy.ndimage from fsl.wrappers import LOAD from fsl.data.image import Image from oxasl import __version__, __timestamp__, reg def run(wsp, prefit=True, **kwargs)...
960c807fe97c867b867ce2f5db2260d847d0276b5d3f8b2699fdbc771fa055f1
Python
28,220
1,566
from __future__ import annotations from pathlib import Path from typing import Sequence import matplotlib.colors as mcolors import matplotlib.pyplot as plt import numpy as np import pandas as pd from matplotlib.gridspec import GridSpec from mpl_toolkits.axes_grid1 import make_axes_locatable from scipy.cluster.hierar...
65de1e702eaaaf5700220bbe17ebe85efe699b62d58ebc867c17130916d15361
Python
28,222
451
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 5 2024 @author: MegNParker https://www.statsmodels.org/stable/gettingstarted.html """ #%% import numpy as np import pandas as pd import statsmodels.formula.api as smf import statsmodels as statsmodels import math import statsmodels.api as sm impo...
a835694592cc15a83f9f05334197d44928ac45f851fbc1463e1028d442afe735
Python
28,234
675
""" @author: heavens """ from torch import nn from torch import Tensor import numpy as np import torch import xron.nn import pandas as pd from copy import deepcopy from functools import partial,reduce from itertools import permutations from fast_ctc_decode import beam_search, viterbi_search from numpy.random import def...
9f33c62c10f0e7d735d89c3efa5b3360e180c0373ade7395ba6fcc5dde4ea954
Python
28,247
654
#!/usr/bin/env python """ Script to visualise spatiotemporal evolution of activity Based on the following modules: Load npx data (load_npx.py) as module SpikeStruct with following variables: - st spike times - spikeTemplates template identity for each spike - clu clusted ...
785c483371d1a7f3a7482becdceb2ce605f566bebe4d908832b9607abeacb150
Python
28,264
643
""" Performs Univariate 1st order analysis to a SetListTomograms object by tomograms Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) Output: - Plots by tomograms: + Plots by list: * Univariate 1st order analysis against ran...
3a647213e1160523194fcd8da43d5873d386fa41eee32cc7fc772190bb551699
Python
28,277
619
import os import unittest from hed.errors.exceptions import HedFileError from hed.tools import get_file_list, get_new_dataframe from hed.tools.analysis.file_dictionary import FileDictionary from hed.tools.analysis.tabular_summary import TabularSummary class Test(unittest.TestCase): @classmethod def setUpClas...
a6df3d405ebf4d782c9dabebe1e1074399e0ac35079bb24d22945cd86457c947
Python
28,281
714
# pylint: disable=line-too-long,too-many-lines,missing-docstring import os import warnings import numpy as np import pandas as pd import torch from torch.utils.data import Dataset from torchvision import transforms from . import video_transforms, volume_transforms from .loader import get_image_loader, get_video_loade...
8d25ff4c4787df872ea6c429a92543b03e4403e9d502a478b8044aa332c9f255
Python
28,294
552
############################### ######## Objective Fun ######## ############################### #%%# Catalyzer # import re import numpy as np # import numba # from scipy import interpolate # import torch # from sbi.inference import simulate_for_sbi # import time import matplotlib import matplotlib.pyplot as plt plt....
1a79abdfaae1cf8dc023f3c514cd8b38a0e826e6be2a807a08ab1a29119c8fd6
Python
28,302
741
""" m6A_semi_supervised.py Author: Anupama Jha <anupamaj@uw.edu> Training and data generator code adapted from bpnet-lite (https://github.com/jmschrei/bpnet-lite) This module contains an implementation of a semi-supervised CNN model for m6A calling. We implement a similar approach to the percolator algorithm for a CNN...
8329c0356bf254d14f01df13d1c353db97a323586e3bef7667a632592acc54be
Python
28,308
940
""" Nonparametric fiducial inference for interval-censored survival data. This module implements Algorithm 1 of [1]_. References ---------- .. [1] Cui, Y.; Hannig, J.; Kosorok, M. R. (2024). "A Unified Nonparametric Fiducial Approach to Interval-Censored Data". Journal of the American Statistical Association, 1...
fa54634be21d153b3ad62b4af72d1e158ac04f0f05ef58671da97813d1a1b6d5
Python
28,339
817
# 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...
a96ad72ec8fbfce57dc0953606e1e4c073d10095aa022c48b7c659ba12d3cb65
Python
28,346
655
# 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...
7115f3b2574bbb405830f6e2fcc1afc3581b1ca52a920aae6e58ef368699ad38
Python
28,372
716
""" Script for cleft segmentation Input: - Pickle files with MbGraphMCF for post- and pre-synaptic membranes - Membranes segmentation files - xml file with mb_slice definitions Output: - Cloud files - Segmentations """ __author__ = 'Antonio Martinez-Sanchez' ######...