sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b88199d62927f432d3a52ae838a2126dbc72a0f6884ca7c34c927f0efd3421b5 | Python | 29,817 | 639 | import torch
from torch import nn
import torch.nn.functional as F
from torch_scatter import scatter
from torch_geometric.utils import degree
from e3nn.o3 import Irrep, Irreps, wigner_3j, matrix_to_angles, Linear, FullyConnectedTensorProduct, TensorProduct, SphericalHarmonics
from e3nn.nn import Extract
from .utils imp... |
a1dd2d12d4ddceed83a153753eba5db08bc23ecc7182255ad63eb1d1309633c0 | Python | 29,818 | 639 | import torch
from torch import nn
import torch.nn.functional as F
from torch_scatter import scatter
from torch_geometric.utils import degree
from e3nn.o3 import Irrep, Irreps, wigner_3j, matrix_to_angles, Linear, FullyConnectedTensorProduct, TensorProduct, SphericalHarmonics
from e3nn.nn import Extract
from .utils imp... |
fdf401f3d58d26839d63f0f7ac297f5d6c44664ca46f945ae0457eab0b9dec21 | Python | 29,827 | 874 | #!/usr/bin/env python
#================================================================
# Copyright (C) 2022 Yufeng Liu (Braintell, Southeast University). All rights reserved.
#
# Filename : arbor_analyzer.py
# Author : Yufeng Liu
# Date : 2022-10-13
# Description :
#
#================... |
0b98b8f258b38f8868eafd48fe9f74cb04638edaa127284fd3c23d1e50511283 | Python | 29,845 | 795 | # -*- coding: utf-8 -*-
"""
Created on Feb 7 2023
@author: Jonas A. Thiele
"""
###Training of prediction models with FC (100 node parcellation) of the complete HCP sample (806 subjects)
###Train with different network-specific selections of functional brain links
#%% Imports
import pandas as pd
imp... |
21ffd3262faa31a65ce1922cd1066686f1cc2c3d21b28f0eb066792619859952 | Python | 29,892 | 805 | from collections import namedtuple, defaultdict
from codex.configuration import MIN_SYN_THRESHOLD
from codex.data.brain_regions import REGIONS
from codex.data.neuron_data_factory import NeuronDataFactory
from codex.data.neurotransmitters import NEURO_TRANSMITTER_NAMES
from codex.data.structured_search_filters import p... |
1d1af99b82855c372a4ef3c82ab7ddb374d314990ee0685697c41f27db52be6f | Python | 29,906 | 830 | # pylint: disable=invalid-name, missing-function-docstring
""" BolT model module from https://github.com/icon-lab/BolT"""
from random import uniform, randint
import torch
from torch import nn, randperm as rp
import numpy as np
import pandas as pd
import wandb
from einops import rearrange, repeat
from timm.models.layer... |
222fec123ed18587e1594c4dc6d4d46748d6fe8ed4841dcb4e20d27ab2dfa575 | Python | 29,931 | 765 | """
Functions related to ctf.
Currently only few that allow running ctffind from console or notebook.
Work in progress.
# Author: Vladan Lucic (Max Planck Institute for Biochemistry)
# $Id$
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from builtins... |
df618e7063f435732602ad7f25dc2981b2429f88a0208499c18362e8773c082e | Python | 29,939 | 605 | """
Tests for wbi_helpers: low-level API call machinery (retries, maxlag, error
mapping), search, merge, SPARQL and the various pure helper functions.
"""
import logging
import threading
from types import MappingProxyType
import pytest
import requests
from wikibaseintegrator import wbi_helpers
from wikiba... |
2c65635eb4abd28c0c7f3c1703933581ee564633549f3d0474f3be00d832bb03 | Python | 29,977 | 883 | # -*- coding: utf-8 -*-
#
# computeFunctions and -Routines for parallel calculation
# of FIR and IIR Filter operations
#
# Builtin/3rd party package imports
import numpy as np
import scipy.signal as sci
import logging, platform
from inspect import signature
# syncopy imports
from syncopy.shared.computational_routine ... |
8d9db077dcb668843d52fc4332fed79739da17d35f1362b26ba7f2f3f207dc58 | Python | 29,977 | 731 | # coding=utf-8
# Copyright 2021 The Fairseq Authors and the HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/... |
d1b5e12aeb69a592c18002f9e222b7b53ae3f894556d407933fda91efff09ca9 | Python | 30,030 | 1,074 | """
shared options and groups
The principle here is to define options once, but *not* instantiate them
globally. One reason being that options with action='append' can carry state
between parses. pip parses general options twice internally, and shouldn't
pass on state. To be consistent, all options will follow this de... |
39d98839e54aced9a4f904fd3972e43db830bf86123c154d899201734068aa93 | Python | 30,033 | 705 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 6 14:19:32 2020
@author: adele
"""
import cPickle as cpk
from os.path import join as joinP
from collections import Counter
from copy import deepcopy
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sk... |
7c5373b2a586c6fe5b71e55659912bcd1474e5a8e72701d917b55fa0056fae68 | Python | 30,034 | 648 | import copy
import os
import warnings
import numpy as np
from numpy import dot, transpose, sqrt
from numpy.linalg import svd, det
import scipy.spatial as spa
from scipy.spatial.transform import Rotation
import torch
from Bio.PDB import PDBParser, MMCIFParser
from Bio.PDB.PDBExceptions import PDBConstructionWarning
fr... |
8e7d0b057e655ef8a51148b8eea340d1a88db29eeea681f8b4f2925bc7c92ca6 | Python | 30,055 | 672 | import PoseTools
import multiResData
import tensorflow as tf
import PoseUNet_resnet
import os
import h5py
import numpy as np
import movies
from scipy import io as sio
from multiResData import int64_feature, float_feature, bytes_feature
import pickle
import sys
import time
import json
import math
import APT_interface as... |
d8cfc25750c611636496c5ea203e3067b3f6c8dfbdef1d6ba0ce648a2ae94264 | Python | 30,072 | 655 | import os
import sys
import pdb
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
import util_signal
def cochlea(tensor_input,
sr_input=20e3,
sr_cochlea=None,
sr_output=None,
dtype=tf.dtypes.float32,
config_filterbank={},
... |
edf7379fa5b34c2325175e934fd42750e43a8ef5989be46029428d053f19bc2c | Python | 30,086 | 767 | """
Library for Positive Cell Cluster Detection (PCCD)
Author: C. Godin Inria, RDP, Juil 2020 - Sept 2021
Design contribution and data:
Jonathan Enriquez, CNRS, IGFL
Wenyue Guan, IGFL
Licence: Open source LGPL
"""
import os
import pandas as pd
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplo... |
ec3e19b304c38326667f7068b1b1fd99abc5638bc038c9cf11c1b9d34b234fbd | Python | 30,091 | 788 | # -*- coding: utf-8 -*-
#
# Module for all kinds of parsing/input sanitization gymnastics
#
# Builtin/3rd party package imports
import os
import numpy as np
# Local imports
from syncopy.shared.filetypes import FILE_EXT
from syncopy.shared.errors import SPYIOError, SPYTypeError, SPYValueError, SPYWarning
__all__ = []... |
2d1434905b07ae5e6a7dc14d10426b20562c9c81d05095d8f5f22c6a44ebaea1 | Python | 30,110 | 802 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
import abc
import functools
import itertools
import re
import warnings
from typing import (
Callable,
Dict,
Iterable,
Itera... |
de67396db2e64cb8679dcda82179b08f28876f24908552486a1241f61f2bc43b | Python | 30,150 | 686 | """Shared pyqtgraph single-pane preview core.
Extracted verbatim from ``regtools/registration/gui/preview_panel.py`` so
other GUIs (e.g. the cellpose detection tab) can reuse the exact same slice
rendering, percentile contrast, and level-stabilization behavior instead of
duplicating it. Two groups of helpers live... |
1b9d1ff5a42b9a393896200ca2856d99a40aa256113810ee9ad466d0874679a3 | Python | 30,153 | 584 | """
DeepLabCut2.0 Toolbox (deeplabcut.org)
copyright A. & M. Mathis Labs
https://github.com/AlexEMG/DeepLabCut
Please see AUTHORS for contributors.
https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS
Licensed under GNU Lesser General Public License v3.0
"""
import numpy as np
import os
from pathlib import Path... |
e61ffa06574f4943d49180f3758d6de898aa6b0db5c81659a24a643156819f2a | Python | 30,153 | 813 | """distutils.command.install
Implements the Distutils 'install' command."""
import sys
import os
import contextlib
import sysconfig
import itertools
from distutils._log import log
from ..core import Command
from ..debug import DEBUG
from ..sysconfig import get_config_vars
from ..file_util import write_file
from ..ut... |
5f65dfda0f9130acdbfc1e0c2228623b7a20c9316324d575c515a9653b1b6d20 | Python | 30,188 | 829 | """distutils.msvc9compiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio 2008.
The module is compatible with VS 2005 and VS 2008. You can find legacy support
for older versions of VS in distutils.msvccompiler.
"""
# Written by Perry Stoll
# hacked by Robin B... |
f8e0a6ea6092599cd19cf6e5ef73d69c4ffe32d00bfe61513637e4ccad05d673 | Python | 30,197 | 667 | """Sequence provider class."""
import logging
from collections.abc import Callable
from dataclasses import dataclass
from math import floor
from pathlib import Path
from types import SimpleNamespace
from typing import Any
import numpy as np
from pypulseq.opts import Opts
from pypulseq.Sequence.sequence import Sequence... |
6a2763aaf2bc22b32a8cad99a56157490fc533144e28785f838933a8ca178bed | Python | 30,200 | 717 | """
Script to compare properties of peri-event time histogram between pre- and post
drug drop, across conditions: leverages peth_module.py to compute PETH of all
good recordings (25, filtered twice); compute std max peak/trough within
subwind; compute std peaks for each recording and compare (Wilcoxon signed-rank
test)... |
c477901e95a319e66fd7897eee15d057ce4440b1286418c93ef8a2d6ef2b6e3f | Python | 30,250 | 954 | from __future__ import division, print_function
import numpy as np
import mne
import pandas as pd
from scipy.fftpack import fft, fftfreq, ifft, fftshift
from scipy.ndimage import convolve1d
from scipy.signal import filter_design, resample, sosfiltfilt
from scipy.signal.windows import hann
import matplotlib.pyplot as p... |
37f76ba50f6f5045102c080652606fedbc7eae16e0b3c96caa68fa06b4ed135d | Python | 30,268 | 741 | from __future__ import print_function
from __future__ import division
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Concatenate
from tensorflow.keras.layers import Activation, Input, Lambda, PReLU
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import Conv2DTrans... |
abb849d309c66cb65be1805f5a9654687c0c5acd5ded102421824db1826d6ce6 | Python | 30,341 | 533 | ##############################
######## Shallow Grid ########
##############################
#%%# Catalyzer
sup_comp = False # Super Computer?
cellulate = (0, 0) # (cell_layers, layer_cells)
card = 0 # {1, 5, 10, 25, 50}
initiate = {'FC_MRNA': 0, 'FC': 0} # {5, 10, 25, 50, 100} # Toll!
_initiate = '_'.join(map(str, [... |
2ee0c7795aadf157a7a1300c7e53482d7dad611fcd5bbe415e8df3765d2d2473 | Python | 30,344 | 644 | # 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... |
f8bbd3ceb3ed7ad493ad1ddbbb1bb85e176032b2452c1d6ae43ecffbe2f65e1c | Python | 30,373 | 833 | """
requests.sessions
~~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
import sys
import time
from collections import OrderedDict
from datetime import timedelta
from ._internal_utils import to_native_string
from .adapters im... |
bb5c0a4f120b0e67421ab05bb7a8361e3a207e35b4df9745abc66de6c4d169db | Python | 30,387 | 720 | import os
import json
import nibabel as nb
from os.path import join as opj
from os.path import split as ops
from os import listdir as opl, stat
import glob
import shutil
import copy, pprint
import pandas as pd
import numpy as np
import nilearn.image as ni
import nilearn.plotting as nplot
import matplotlib.pyplot as pl... |
854b4fbc3620583680d9d59d80bb2c85bc117e6dd0e5846546881d99e454350c | Python | 30,391 | 661 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... |
4ee9ce2da52df24ce572a5350960588ec909067aa4acd067b7cefda37ea536af | Python | 30,417 | 740 | # -*- coding: utf-8 -*-
import logging
import tensorflow as tf
__all__ = [
'cross_entropy',
'sigmoid_cross_entropy',
'binary_cross_entropy',
'mean_squared_error',
'normalized_mean_square_error',
'absolute_difference_error',
'dice_coe',
'dice_hard_coe',
'iou_coe',
'cross_entrop... |
fd10c94a7827619bb4df231b0de32d6e62b46a05dac1209aa26bb0b0d12b3c42 | Python | 30,437 | 451 | # this script, together with the lib process_mouse_trials_lib
# is used to process the raw excel files that have the tracking
# of the mouse in the arena looking for the hidden food
#
# the experiments were originally performed by Kelly Xu from Len Maler lab
#
# the original excel files are not going to be included in ... |
415573bf0d51decde8b7cdc00b8211ef63c2ad1f861dc1cf34304a7756b5c982 | Python | 30,453 | 758 | # 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... |
b600b8c24c325e16db8e9700a4109887457f24d097194ee09c95c5ccbde7de2c | Python | 30,464 | 769 | #!/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... |
ee7df492df80fb871be2f8b6ecf523d9b5a62fbb630ab569bcddc710cff83d59 | Python | 30,464 | 635 | # -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional, Tuple, Union
import torch
import torch.nn as nn
from supar.structs.dist import StructuredDistribution
from supar.structs.fn import mst
from supar.structs.semiring import LogSemiring, Semiring
from supar.utils.fn import diag... |
7e77428bdaf318ed7867a2643556a27137181d54c696e0bd0dc98b0eca632166 | Python | 30,518 | 971 | # Copyright 2021 AlQuraishi Laboratory
# 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/licenses/LICENSE-2.0
#
# U... |
1af1fc5e14b8dbf754027b1b8465a4d5c8f6282bb00a5112746d29932a745dd8 | Python | 30,525 | 935 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import math
import numpy as np
import cv2
def transform_cxcywh(boxes, height, width):
"""
transforms x1y1x2y2 to cxcywh
"""
cx = (boxes[:, 0] + boxes[:, 2]) / (2 * width)
cy = (boxes[:, 1] + boxes[:, 3... |
9304941d625494e27420abaa67d3836cf06a453d7abdd709bddedb220918e81a | Python | 30,556 | 320 | """
REPORT_FIGURES.py 2026-09-25 — the ten report figures, each read from a project output file (no hand-typed numbers
except where a figure is a diagram). Output: 06-OUTPUT/figures/report/F01…F10 (.png, 300 dpi).
"""
import os, re
import numpy as np, pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplot... |
f6ce7f78aab6abdc408279e555de703ffdc6284e236dbea6de81523332477510 | Python | 30,575 | 827 | # coding=utf-8
# Copyright 2021 The I-BERT Authors (Sehoon Kim, Amir Gholami, Zhewei Yao,
# Michael Mahoney, Kurt Keutzer - UC Berkeley) and The HuggingFace Inc. team.
# Copyright (c) 20121, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... |
456cf887c9155ad9b542aa4937754e26868ed530ac6999f46ac0f9ff348c2faa | Python | 30,583 | 922 | # Node-group asset "Select Element" (GeometryNodeTree), dumped by nodebpy.assets.dump_library.
# Rebuild the library with nodebpy.assets.build_library (nodebpy build).
# _build_group() is the source of truth: the docstring, __init__ and accessors are regenerated from it on the next dump.
from typing import TYPE_CHECKIN... |
90e58353b1fc8b59df48278eff9c716a5d8319b2cd4dd24bb86deb52e2d3bddc | Python | 30,590 | 962 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from matplotlib.cm import ScalarMappable
from matplotlib.colors import Normalize, TwoSlopeNorm
from os.path import join, dirname
from moabb.datasets import (
Zhou2016,
BNCI2014004,
BNCI2014001,
MunichMI,
Weibo2014,
... |
b6cf787140ba824e880fdbe89f16c6e12e6904ffbcacb14bdbdac22bed75093c | Python | 30,608 | 571 | # -*- 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 re
import seaborn as sns
from scipy import sparse
from sklearn.metri... |
0813bede733ca45acdecebd5b385382194948f05c5a9d9c630fdc45b909dd41d | Python | 30,615 | 626 | rest_api_version = 99
options = dict(
model_extensions=[
'h2o.model.extensions.Fairness',
"h2o.model.extensions.Contributions",
],
)
def update_param(name, param):
if name == 'metalearner_params':
param['type'] = 'KeyValue'
param['default_value'] = None
return param... |
a4cc1a690292f4fdf06ed788b4e8ea9f3f4f4bf4e7e8c9936cffcacd09ab2734 | Python | 30,642 | 840 | # -*- coding: utf-8 -*-
#
# Syncopy's abstract base class for discrete data + regular children
#
# Builtin/3rd party package imports
import numpy as np
from abc import ABC
from collections.abc import Iterator
import inspect
# Local imports
from .base_data import BaseData, FauxTrial
from .methods.definetrial import d... |
d06a98492adecaf95a4c24c6e76d8251e483830f1befe8911ff18e8a4848569a | Python | 30,659 | 536 | ##############################
######## Shallow Grid ########
##############################
#%%# Catalyzer
sup_comp = False # Super Computer?
cellulate = (0, 0) # (cell_layers, layer_cells)
card = 0 # {1, 5, 10, 25, 50}
initiate = {'MRNA': 0, 'PRO': 0} # {0, 25, 50, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, ... |
f493eb2bb70bb5d9ccc70d7975be7aeec032a375b431510fd1fe0341fcd1a883 | Python | 30,683 | 460 | import multiprocessing
import time
from warnings import warn
import math
import numpy as np
import pandas as pd
import pymp
from postprocess_functions import generate_activation_map
# from geometry_functions import temporal_smoothing_of_time_field
from utils import get_nan_value, initialise_pandas_dataframe, get_row_i... |
f89666a945fc9d1515ac8e68b7eebc36496a188701cecd72ebd7fc72e38c32aa | Python | 30,696 | 711 | import json
import os
from tempfile import TemporaryDirectory
import pickle
from typing import List, Optional, Tuple
from typing_extensions import Literal
import torch
# pip install typed-argument-parser (https://github.com/swansonk14/typed-argument-parser)
from tap import Tap
import chemprop.data.utils
from chemprop... |
02649a7c4318511f6f58a547af553e8247f37689951ab78fee7886ebe98c2e25 | Python | 30,697 | 737 | # coding=utf-8
# Copyright 2020 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... |
e233807d970bb1899b564341bc79c34791d4eb3ad3ef28a91c0610ad90a01644 | Python | 30,711 | 555 | #####################################
######## 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... |
608db205cbdef03b535b08def96e699b010c0abe44af848b0755e734a84f3b85 | Python | 30,721 | 682 | """
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... |
ceb4e0536b97f04d5ec6f8587e8b10290b998e13c45cf9f9a66660760595ce9c | Python | 30,731 | 938 | #
# 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,... |
4d292e1d70112d3a8236bee28693f777b5a5e4f043b31e97a7a8bfed886a92b1 | Python | 30,737 | 646 | # +
import numpy as np
import torch
from torch.utils.data import Dataset
import pickle
import pandas as pd
from scipy.sparse import load_npz
from glob import glob
from math import ceil
import h5py
OUT_MAP = np.asarray([[1, 0, 0],
[0, 1, 0],
[0, 0, 1],
[... |
a39f454b1bfab56d946279a142e72d5e273bc6b8781474d23a2cb2c6d1a78872 | Python | 30,745 | 934 | """
Primary functions of atlasreader
"""
import os
import os.path as op
import warnings
from importlib.resources import files
import nibabel as nb
import numpy as np
import pandas as pd
from nilearn import image, plotting
from nilearn.image import check_niimg
from nilearn.regions import connected_regions
from scipy.n... |
dc2872e299bac4e84615a10392cffaea47d650d1b88413780b878d25be0a1a27 | Python | 30,747 | 657 | import os
import time
import cv2
import numpy as np
import torch
from colorama import Fore, Style
from torch.autograd import Variable
from src.common import (get_camera_from_tensor, get_samples,
get_tensor_from_camera, random_select)
from src.utils.datasets import get_dataset
from src.utils.Vi... |
a28009efd461ab5b77144a02a9bd036fc84be5a0170940b6ee6f713d07b959b4 | Python | 30,790 | 760 | """
Contains class CleftRegions for the analysis of a cleft-like region (a region
between two roughly parallel boundaries) of an image segmented in regions.
# Author: Vladan Lucic (Max Planck Institute for Biochemistry)
# $Id$
"""
from __future__ import unicode_literals
from __future__ import division
from builtins im... |
00a9a874dfefe2e39d82788f071ed26728ca42ac9b35199d2bb6d4ca641db3d8 | Python | 30,797 | 802 | from ..util.ParamStorage import ParamStorage
from scipy.special import psi, gammaln
from scipy.stats import binom
import numpy as np
import logging
def build_states(typ='atac', filename=None, r=None):
logger = logging.getLogger()
class BedOptions(object):
def __init__(self, thres=0.05, ext=100, merg... |
b8a2dfed9e83dceae70676c18e7325a6f5a6672bd44a1115f42bdc012c81eac5 | Python | 30,797 | 731 | """Hemisphere toggle and the preview column's midline overlay.
Kept in its own module: it builds a QApplication, and this repo crashes on
Windows when Qt shares a worker process with dask/zarr work.
"""
import os
import numpy as np
import pytest
os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
ni... |
a9e9b6525ff22d6e6dc6152f089d86c2a15784b7acf97b1197392d7c6afa3505 | Python | 30,814 | 536 | ##############################
######## Shallow Grid ########
##############################
#%%# Catalyzer
sup_comp = False # Super Computer?
cellulate = (0, 0) # (cell_layers, layer_cells)
card = 0 # {1, 5, 10, 25, 50, 75, 100}
initiate = {'N_MRNA': 0, 'G_MRNA': 0, 'N': 0, 'G': 0} # {(200, 0, 200, 0), (175, 25, 175... |
3c92f5496078f129afcc7d729c4df0a605f0d1486cbc58d17ccbde4ee3e39345 | Python | 30,827 | 875 | import os
import unittest
from hed import HedTag, schema
from hed.errors.exceptions import HedQueryError
from hed.models.hed_string import HedString
from hed.models.query_handler import QueryHandler
# Override the tag terms function for testing purposes when we don't have a schema
def new_init(self, *args, **kwargs)... |
e0d8a688c483976e2b5284b10ca0e206fdf08cde3261494becdbda7c2c7d0698 | Python | 30,837 | 802 | import os
import sys
import pdb
import numpy as np
import tensorflow as tf
import scipy.signal
def freq2erb(freq):
"""
Helper function converts frequency from Hz to ERB-number scale.
Glasberg & Moore (1990, Hearing Research) equation 4. The ERB-
number scale can be defined as the number of equivalent
... |
ca0b0ce29d2308f957da65ec89a38053a2da861ea741af5a010810b3a338da8b | Python | 30,845 | 536 | ##############################
######## Shallow Grid ########
##############################
#%%# Catalyzer
sup_comp = False # Super Computer?
cellulate = (0, 0) # (cell_layers, layer_cells)
initiate = {'FC_MRNA': 0, 'FC': 0} # {0, ..., 250} # {0, 25, 50, 75, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000} # Toll!... |
59e58aee4783adfcf6a651e24e0380d676188a76c496c113e12cd6da7d6a6761 | Python | 30,846 | 831 | import pytest
import numpy as np
import scipy.linalg
from fsl.data.image import Image
from oxasl import AslImage
def test_create_data_singleti():
d = np.random.rand(5, 5, 5, 6)
img = AslImage(name="asldata", image=d, tis=[1.5], iaf="tc", order="lrt")
assert img.ntis == 1
assert img.tis == [1.5]
a... |
6fdb6c0be8c347efc0bf51141ead43e05cd9d659dc102c3e2ba523b9abe2e593 | Python | 30,880 | 863 | from neo4j.meta import experimental
import pandas as pd
import csv
import certifi
import urllib3
import urllib
import wget
import base64
import glob
import io
import re
import requests
import ftplib
import json
import gzip
import shutil
from Bio import Entrez, Medline, SeqIO
import os.path
import collections
import ppr... |
d8b6e107e0634d2b0a327f7d68cafb3b7dcdbeee10fb898d683d7e2f422801cc | Python | 30,901 | 537 | ##############################
######## Shallow Grid ########
##############################
#%%# Catalyzer
sup_comp = False # Super Computer?
cellulate = (0, 0) # (cell_layers, layer_cells)
card = 0 # {1, 5, 10, 25, 50, 75, 100}
initiate = {'N_MRNA': 0, 'G_MRNA': 0, 'N': 0, 'G': 0} # {(200, 0, 200, 0), (175, 25, 175... |
db1409e07aa7c1ee82d901c1ab37b74375a20f7634316ef51c2e516a97e2a973 | Python | 30,903 | 804 | # 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 ... |
5d0643b092d4bc98f8bfc1e64c13cbcc1410b6605a13cd6e1917d788af7e132b | Python | 30,905 | 689 | #!/bin/env python
"""
OXASL - Registration for ASL data
Copyright (c) 2008 University of Nottingham
"""
from __future__ import unicode_literals
import os
import sys
import math
import warnings
import traceback
import numpy as np
from fsl.data.image import Image, defaultExt
import fsl.wrappers as fsl
try:
impor... |
6321875eb64ccb4cf4058239d99300dd82203956fc9ba3e4c0e19107f7375f45 | Python | 30,908 | 690 | import time
from pathlib import Path
import numpy as np
import openturns as ot
import seaborn as sns
import uptake
import uptake.metamodel_implementation.ANN.implementation as imp_ANN
import uptake.metamodel_implementation.ANN.utils as ANN_miu
import uptake.metamodel_implementation.utils as miu
from uptake... |
c47ff7805e2edef6564130cda7c13b1da962979d6e146aec4286fc012009466b | Python | 30,932 | 689 | """
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... |
d2fea16e39f331c3bb74ca4c5e92d94df862f82bda161243c59efda34841b495 | Python | 30,943 | 736 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import traceback
def python_version_supported():
major, minor = sys.version_info[:2]
return (major == 2 and minor >= 7) or (major, minor) >= (3, 2)
if not python_version_supported():
sys.exit("Error... |
76fef05a2aa8f302f552142c60cac95e24d2454794399d8e047799d15fb10e83 | Python | 30,950 | 891 | from typing import Iterable
from codex.data.brain_regions import (
match_to_neuropil,
lookup_neuropil_set,
REGIONS,
HEMISPHERES,
neuropil_hemisphere,
)
from codex.data.neurotransmitters import lookup_nt_type, NEURO_TRANSMITTER_NAMES
from codex.utils.graph_algos import pathways
from codex.utils.pars... |
1cabc191c8e8f8e0dffe3a056de53b8d13a565f620fc1f03eb64d269f34723fe | Python | 30,970 | 808 | """
Registration visualization utilities.
Generates diagnostic figures for registration quality assessment:
- Laplacian correspondence point maps with displacement arrows
- ANTs deformation field magnitude and quiver plots
- Laplacian deformation field magnitude and quiver plots
All figures are saved as PNG f... |
65792ed574e492d9ce5ed2967cc6c51d3e34d553ea43762c6b82556489a78732 | Python | 31,010 | 689 | """
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... |
ca05b0ad5d1828c21b9bd930638b713d5f3e73f8239d0aea290e845f97005bc6 | Python | 31,040 | 701 | """
Performs Bivariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference
- A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) to analyze
Output: ... |
0e509a6562cf0ab337a471a01610f06530189586df95e30e480d36e40c4518c2 | Python | 31,079 | 645 | # 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... |
bb6084f30128c34de84641d3cb25e89fbfbb07d6288a84410d8c5261bf50bb66 | Python | 31,093 | 823 | import csv
import os
import sys
import threading
import time
import tkinter
from signal import alarm
from tkinter import ttk
import cv2
import PIL
import numpy as np
from tkinter import *
from matplotlib.axis import Axis
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import (FigureCanvasT... |
a0f97ef11c5c231086e7543cd9b20a4e88897618915ba75897e11fc2d5514922 | Python | 31,100 | 701 | """
Performs Bivariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference
- A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) to analyze
Output: ... |
824170501305dc7ba9b9db9e7dd5073f21e98ebe40d3e9daa574a35e5d6455b1 | Python | 31,105 | 540 | 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... |
cb673b27eb6fcf141e6917677670207d41d7ad276790aae83a3cd192da3bc7b2 | Python | 31,109 | 701 | """
Performs Bivariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference
- A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) to analyze
Output: ... |
32604fd6c6cc65779e89834cbc72db308fcd891c4197be53045e00c83fcd0dad | Python | 31,113 | 945 | """
TIFF / image I/O utilities - section helpers and volume_io dispatcher loader.
Legacy helpers (``read_tif_section``, ``read_multipage_tif``, etc.) are used
throughout the codebase. The dispatcher-style loader functions
(``_load_image``, ``_load_image_2d``, etc.) were previously in
``loaders/tiff_loader.py`` ... |
dda804eca595cd1e37dc3d21fdd7aabe6c29585362f3d6aecf9a8422d506b84c | Python | 31,121 | 882 | import argparse
import sys
import copy
import nibabel as nib
from os.path import exists
import math
import matplotlib.pyplot as plt
import numpy as np
import pickle
import sys
import resource
import scipy.ndimage as ndimage
from nibabel.affines import apply_affine
import numpy.linalg as npl
from skimage.segmentation im... |
92fb708b10f14e279ec9b9968812e696a5dbc7e0079c6a899a7d7c9f574cedab | Python | 31,135 | 967 | """
Shared GUI constants and utilities for PyQt5 widgets.
Modern, clean styling for the U01 Workflow application.
Theme engine
------------
Two palettes (``LIGHT_COLORS`` / ``DARK_COLORS``) share an identical key set.
The stylesheet and the variant-button / label styles are *builder functions*
that take a pale... |
0fb2985a6c44661e4b381def71c0810cef062c64675199eadf1d500984ffb185 | Python | 31,136 | 718 | """
call modifications from fast5 files or extracted features,
using tensorflow and the trained model.
output format: chromosome, pos, strand, pos_in_strand, read_name, read_strand,
prob_0, prob_1, called_label, seq
"""
from __future__ import absolute_import
import torch
import argparse
import os
import s... |
f59126577aea65476d97c9e7065a78b0429d111030e80d815d647fbb0300237e | Python | 31,148 | 811 | from __future__ import division, print_function
import time
from abc import ABCMeta,abstractmethod
import numpy as np
from numpy.lib.stride_tricks import sliding_window_view
from scipy.fftpack import fft, fftfreq, ifft, next_fast_len
from scipy.signal import hilbert
from scipy.interpolate import RectBivariateSpline
... |
6ab7c5a9afa68b6f245839cab7d93ec2402ddadb61a8cada98e0539a72dab0dd | Python | 31,173 | 701 | """
Performs Bivariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference
- A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) to analyze
Output: ... |
1ca55cc76cd717120eccfa77126ada4516f058da34b0109fd0bd906d574bf208 | Python | 31,200 | 754 | import os
import numpy as np
from scipy.io import loadmat
from numpy.linalg import norm
from sklearn.decomposition import PCA
from fig_specs import data_path
# Helpers to transform matlab files to python
def to_dict(arr):
keys = np.array(arr.dtype.names)
return {key: arr[np.where(keys == key)[0][0]] for key i... |
277a84ea8db5bcc48aa8ddc083c504caf29886d4b28b93d94eb5269e7f3db917 | Python | 31,204 | 927 | # 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... |
1010ae76e8cc14b028df7626962cb087a98dd16bc10c380ffe06b211a1eb1e40 | Python | 31,216 | 495 | #!/usr/bin/env python
import os, sys, argparse, random;
import tensorflow as tf;
from tensorflow.python.keras import backend as K
import numpy as np;
import pandas as pd
from sklearn import preprocessing, metrics
from sklearn.linear_model import RidgeCV
import scipy
from scipy.io import mmread
sys.path.ap... |
3556be18cc0d7fd25599253a04cae20187bf50cca61b9c3f72987e995b6bf5cb | Python | 31,232 | 894 | from abc import abstractmethod
import math
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
from .fp16_util import convert_module_to_f16, convert_module_to_f32
from .nn import (
checkpoint,
conv_nd,
linear,
avg_pool_nd,
zero_module,
normalization,
... |
5b7d06070b660a104e9021f666dea49a620f57b6fddefc6e1f683f28cc3f132e | Python | 31,257 | 651 | from __future__ import print_function
import argparse
import datetime
import os
import sys
import time
import random
import math
import numpy as np
sys.path.extend([
os.path.join(os.getcwd(), 'pddlstream'), # Important to use absolute path when doing chdir
os.path.join(os.getcwd(), 'ss-pybullet'),
])
from co... |
94601981240c117af46ddad1db789eb897703ad343ae706f28e6ed7bca649a7a | Python | 31,266 | 637 | from ngclearn.utils.io_utils import makedir
from ngclearn.utils.viz.raster import create_raster_plot
from ngclearn.utils.viz.synapse_plot import visualize
from jax import numpy as jnp, random, jit, nn
from ngclearn.utils.model_utils import scanner
from ngcsimlib.compilers import compile_command, wrap_command
from... |
96d71f3fedcf8e53470a8a397b86bb0b8cfed838414d745f63a8db31b07b3f7d | Python | 31,274 | 386 | ######################## 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... |
641887a0c02fb0c74f3ed702774e5db4ddbffade1c562902376330cecf750a6e | Python | 31,283 | 716 | '''
Description:
Figure plotting for perturbation analysis.
Author:
Jiaqi Zhang <jiaqi_zhang2@brown.edu>
'''
import copy
import scipy.interpolate
import torch
import numpy as np
import pandas as pd
from tqdm import tqdm
from sklearn.neighbors import NearestNeighbors
from sklearn.ensemble import RandomForestCla... |
14ace00ab0447c066f1b84750b99ea837468cc64d0db7110752c0ddee5882921 | Python | 31,289 | 884 | #pgb A probability module
import numpy as np
import scipy as sp
import scipy.stats as stats
import warnings
from pyclamp.dsp.fpfunc import *
from pyclamp.dsp.sifunc import *
from pyclamp.dsp.lsfunc import *
DEFPMAT = False
npmatrix=np.matrixlib.defmatrix.matrix
#------------------------------------------------------... |
7c173e6c9278211edaaa9e98f7ac5af638ea3900a62aa387bb450b1b6e793773 | Python | 31,308 | 839 | """
Classes for curves
# Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry)
# Date: 29.02.2016
"""
__author__ = 'martinez'
import vtk
import math
import numpy as np
from pyorg.globals.utils import angle_2vec_3D, closest_points
from pyorg.surf.utils import points_to_polyline
###### Global varia... |
46f3231b032d7d2d18552f52a3c9e6d6a66f6de3db37d127890cffd563ff1f05 | Python | 31,357 | 658 | #!/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... |
0c249e0ca5e48c50cd9e742b9571b87c1c0f6e31fee601689d959d820771eb28 | Python | 31,381 | 737 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://w... |
3068d97ab81eaa9934e3e15b052c98d4a5f99e41c25fecd4d2e6423496da375e | Python | 31,386 | 763 | # -*- coding: utf-8 -*-
"""
Functions for annotating / selecting microarray probes
"""
import functools
import gzip
from io import StringIO
import itertools
import logging
from pkg_resources import resource_filename
import numpy as np
import pandas as pd
from scipy import stats as sstats
from . import datasets, io, ... |
7f66f8cab592b9f4bd98703ca9eff6b7d40999511f0e119186f892d2f5615573 | Python | 31,391 | 542 | ##############################
######## Shallow Grid ########
##############################
#%%# Catalyzer
sup_comp = False # Super Computer?
cellulate = (0, 0) # (cell_layers, layer_cells)
initiate = {'FC_MRNA': 0, 'FC': 0} # {0, ..., 250} # {0, 25, 50, 75, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000} # Toll!... |
3c0c470637f375ed85ccf50c86a2dcdd3a3053bf5cfce64bf22724603519d31d | Python | 31,395 | 542 | ##############################
######## Shallow Grid ########
##############################
#%%# Catalyzer
sup_comp = False # Super Computer?
cellulate = (0, 0) # (cell_layers, layer_cells)
initiate = {'FC_MRNA': 0, 'FC': 0} # {0, ..., 250} # {0, 25, 50, 75, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000} # Toll!... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.