sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
2c7789fe77332ae85a68b26634b392ecfbe24e571e82676de327b62fd3a4f2b1 | Python | 25,798 | 670 | # -*- coding: utf-8 -*-
"""
Created on Jun 2 2023
@author: Jonas A. Thiele
"""
###Training of prediction models with FC (100 node parcellation) of the main sample (610 subjects, 5-fold cross-validation)
###Training with different selections of brain links: links between random nodes, random links, and links... |
147425fdcc01451f3bf63eabbfd3fb4a00c62de9015f1b5145ea1207fb50bef7 | Python | 25,810 | 773 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
def _compute_same_pad(kernel_size, stride):
if isinstance(kernel_size, int):
kernel_size = [kernel_size]
if isinstance(stride, int):
stride = [stride]
if not (len(stride) == len(kernel_size)):
raise V... |
884eee150a1367098fff792f2ad89fa303efe0f8a1fc89575c10540831018d26 | Python | 25,812 | 817 | # Copyright 2019 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... |
0cf4190ef6a2dc73a95720ff4f6e3be92f25ac02cc0429d848e53a424f431c47 | Python | 25,815 | 768 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 17 09:58:02 2021
@author: leupinv
"""
## libraries
import numpy as np
import mne
from scipy import stats
from mne.stats import fdr_correction, f_mway_rm, permutation_t_test
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['svg.f... |
73b1169e14062f59b1a8008c689bd1b18b5087eb63ce7b1591d79af8a93ad3a5 | Python | 25,819 | 715 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''plotting/analysis routines on output of example_parallel_network.py
Copyright (C) 2018 Computational Neuroscience Group, NMBU.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the ... |
afd16f3bb55865196637cda7cd3065e369d1fbc5a224f7d4b8bfa535108576f3 | Python | 25,822 | 744 | #!/usr/bin/env python
"""
Basic greyscale density and morphology analysis of any kind of segments.
Typically used regions / boundaries that are manually / Amira segmented.
Calculates:
- greyscale density statistics
- surface (membrane) and lumen greyscale density statistics
- distance to a specified region
... |
10518b6efe24e3e72cd4df249501102a5c61b0c1b62612e795a5af2ec200078e | Python | 25,848 | 591 | from __future__ import print_function, division
import random
import time
import numpy as np
import scipy
from scipy.stats import norm
from learn_tools import helper
from learn_tools.active_learner import ActiveLearner, format_x, THRESHOLD, tail_confidence, \
BEST, CONFIDENT, STRADDLE, VARIANCE, REJECTION
from l... |
abf650939ce2fdd965163a9fd4afedd09a9552f5368d33211a8b2d93d91117db | Python | 25,860 | 573 | """
PyQt5 dialog widgets for the cell_counting_legacy GUI.
Owns:
- ``PreviewWorker`` - QObject/QThread worker that runs cell detection for a single
section in the background and emits results via signals.
- ``PreviewWindow`` - QDialog that lets the user scrub through sections,
tweak parameters, and open pe... |
e1e379b1c773d3eba5f3f324005e38a9f3e578c595c8eb3d32f3b07281d909df | Python | 25,878 | 641 | """Network class
----------------
Main file of the mesocircuit defining the ``Network`` class with functions to
build and simulate the network.
"""
import os
import numpy as np
from pathlib import Path
import tarfile
import h5py
import nest
from mpi4py import MPI
from mesocircuit.helpers.mpiops import GathervRecordA... |
abca97abb88188335bc2195f3df74a9a9b4cbf2e0c6e86e212ed27f0f2568ea2 | Python | 25,887 | 578 | import PoseUNet_resnet
import PoseTools as pt
# import tensorflow
# vv = [int(v) for v in tensorflow.__version__.split('.')]
# if (vv[0]==1 and vv[1]>12) or vv[0]==2:
# tf = tensorflow.compat.v1
# else:
# tf = tensorflow
# # from batch_norm import batch_norm_mine_old as batch_norm
# if vv[0]==1:
# from ten... |
7943cabb5429fe8633952c8f059e63a121b575c204bc3e0db921e23eba417c7a | Python | 25,900 | 760 | """
Tests of noise input.
"""
import unittest
import numpy as np
from chspy import CubicHermiteSpline
from neurolib.models.aln import ALNModel
from neurolib.models.fhn import FHNModel
from neurolib.models.hopf import HopfModel
from neurolib.models.wc import WCModel
from neurolib.models.kuramoto import KuramotoModel
f... |
ebcb8e3b32edb8d555332038c5b91d2aa74f4df812d3781ba3fddcc97ecd87f5 | Python | 25,903 | 576 | import os
import argparse
import time
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
import torch.nn.functional as F
import networkx as nx
import torchdiffeq as ode
import sys
import functools
import scipy.io as scio
from utils import *
import argparse
... |
876084ed57eac762798a21686649b7a8d92c2f29dd8cc845d04899445b0ee526 | Python | 25,915 | 794 | #%%
"""
Version 1.0
Name: Aref Kalantari
Issues: https://github.com/Aswendt-Lab/AIDAqc/issues
Other requests: aswendtlab@gmail.com
Date: 24.08.2021 - 02.03.2022
-----------------------------
Code Describtion: Quality Control Toolbox. Every tool (function) needed can be found here and be modified.
---------------------... |
f06fe212b396123931a6b847efa8b81c13fee9a3950903486b1a942ed1bc4fda | Python | 25,959 | 763 | from __future__ import annotations
import logging
from functools import cached_property
from typing import Iterable, TYPE_CHECKING
import numpy as np
import pandas as pd
from numpy.typing import NDArray
from pandas.core.dtypes.common import is_integer_dtype
from sklearn.compose import make_column_selector
from cuppa... |
2738d487a70aeb79e849068358aac6a9b5bee369cb443f73c9032866fc3b80cd | Python | 25,965 | 600 | import logging
import xarray as xr
import numpy as np
from ..models import bold
from ..utils.collections import dotdict
class Model:
"""The Model base class runs models, manages their outputs, parameters and more.
This class should serve as the base class for all implemented models.
"""
def __init_... |
da4c0c394aecdb0f26de44428af7ae004d455ffd1c0f129a859ad4e06ca33fed | Python | 26,000 | 641 | from __future__ import print_function
import numpy as np
import random
import time
from examples.continuous_tamp.primitives import BLOCK_WIDTH, sample_region, plan_motion, GRASP
from pddlstream.language.constants import partition_facts, NOT, MINIMIZE, get_constraints, is_parameter
from pddlstream.language.optimizer i... |
eab49dfa8323f5c9223c070171949210bf90d819278a2fae71acdebc117a9665 | Python | 26,006 | 817 | #!/usr/bin/env python3
"""
m6a_semi_supervised_cnn_ont.py
Author: Anupama Jha <anupamaj@uw.edu>
This module predicts whether an
adenine is methylated or not. The
model is trained with ONT read sequence,
read quality score and methylation score
from oxford nanopore. The model is a
convolutional neural network. The
trai... |
7ebf56093cb0d6faf1a370a2d8feffa07d12dd8ef17fe59362d922183b2540b4 | Python | 26,007 | 818 | #!/usr/bin/env python3
"""
m6a_semi_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. The
traini... |
ede46abedbea7f928717ae78f8b1c2d0fabbc7cc00afc411217899d713ab4eda | Python | 26,007 | 733 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Copyright (C) 2012 Computational Neuroscience Group, NMBU.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at you... |
829ba8f20cb67973c3aecd9ea846a3c79a20fbe34ef1ae6292919878886fe3b9 | Python | 26,009 | 606 | #!/usr/bin/env python
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Object crash with prior vehicle action scenario:
The scenario realizes the user controlled ego vehicle
moving along the road and encounters a cyclist ahead after taking a rig... |
6f30b532ef7afedf60097373524f4e26711431a2759106e524504e7c4e6eb879 | Python | 26,015 | 590 | import math
from collections import defaultdict
import torch
from torch import nn
from torch.nn import functional as F
from torchdrug import core, layers, tasks, metrics, utils
from torchdrug.core import Registry as R
from torchdrug.layers import functional
@R.register("tasks.PropertyPrediction")
class PropertyPred... |
36b5f4cc0a2b53b70c886bb0092ebf3964e2698108a437b3d419a3cc895aefd0 | Python | 26,026 | 498 | """
Tests for the fastrun container. The SPARQL endpoint is served by the simulated
Wikibase instance, so the whole pipeline (statement loading, lazy qualifier /
reference / rank loading, comparison) runs offline and deterministically.
"""
import re
import pytest
from wikibaseintegrator import WikibaseIntegrator, wbi... |
b7b8fcff08e27072731c437d9eac2781fabf70a822799ff70a4cb766f01384d4 | Python | 26,033 | 645 | """
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: ... |
d20177eecbb199abf6b03e97e631f7fc2ba3a4b078ee022f4859b82a639b768a | Python | 26,053 | 599 | from __future__ import annotations
import uuid
from functools import singledispatchmethod
from typing import TYPE_CHECKING, Literal
from warnings import warn
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scanpy as sc
from anndata import AnnData
from numba import njit, prange
from scipy... |
535650a8aa226a40f6c00846eba159f23edde92d15a0294a7757697253c9af8f | Python | 26,069 | 819 | #!/usr/bin/env python3
"""
m6a_semi_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. The
traini... |
676f8ba0b5a9f31a8ebe818ec059056ee1da245d194e245dc838da57a4a2ff49 | Python | 26,073 | 645 | """
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: ... |
b774b050720891dca8ae6580d5630557cfe385d6e0a7a478db62d6637e96b164 | Python | 26,075 | 742 | from .pydist.linecell import trajectory_set_grid
from .cydist.sspd import c_e_sspd, c_g_sspd
from .cydist.dtw import c_e_dtw, c_g_dtw
from .cydist.erp import c_e_erp, c_g_erp
from .cydist.edr import c_e_edr, c_g_edr
from .cydist.lcss import c_e_lcss, c_g_lcss
from .cydist.hausdorff import c_e_hausdorff, c_g_hausdorff
... |
d6c60eb9c57c04454c5d3c034b817d23c00659feb23bc5fd3605fc7b5d0d6ad5 | Python | 26,078 | 775 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
def compute_same_pad(kernel_size, stride):
if isinstance(kernel_size, int):
kernel_size = [kernel_size]
if isinstance(stride, int):
stride = [stride]
assert len(stride) == len(
kernel_size
), "Pas... |
e3bb7c14c44a9d3d19c0a2c09ddd7ccb0b2bdc715b6878c88d6f37842a54b9ea | Python | 26,090 | 718 | import re
import copy
import numpy as np
import pandas as pd
import networkx as nx
from functools import lru_cache
from pathlib import Path
from fafbseg import flywire
from requests.exceptions import HTTPError
from .core import DataSet
from .scenes import FLYWIRE_MINIMAL_SCENE, FLYWIRE_FLAT_MINIMAL_SCENE
from .ds_ut... |
1c31994ee04e08d462aff1c9338538339a89cc1bfbb7f6bd159669e75224ff3e | Python | 26,092 | 811 | import numpy as np
import pytest
from SurvivalEVAL import PointEvaluator
from SurvivalEVAL.evaluations.discrimination._concordance_utils import (
_ConcordanceCounts,
)
from SurvivalEVAL.evaluations.discrimination.static.concordance import (
_finalize_counts,
_margin_counts,
_right_censored_risk_counts,... |
3f0fa507ff246dea917132279f259252f9208b110d874838d058e7adff8999e4 | Python | 26,092 | 618 | #!/usr/remote/bin/python -u
import argparse
import numpy as np
import os
from sys import argv
import copy
import math
import re
import stat
import shutil
from optparse import OptionParser
import readline
def read_output_dat(args):
""" used class: output_dat
"""
y=output_dat(args.datafile)
n_doublets = ... |
809a2fe18ffea5da6328b131e5e5057da40c2524219106c4375b057fd9807d5a | Python | 26,098 | 736 | # coding=utf-8
# Copyright 2018 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... |
591b6598285392527399169c64d101561937f1d221b7fea04d90fae3e191e9df | Python | 26,161 | 756 | import json
import math
import bpy
from bpy.props import (
BoolProperty,
CollectionProperty,
EnumProperty,
FloatProperty,
IntProperty,
PointerProperty,
StringProperty,
)
from nodebpy.nodes.geometry import NamedAttribute
from ..blender.utils import set_object_visibility
from ..entities.base i... |
94ddf050b551e88fe37b78e36e1613cf7731f7e0cb7e0f97e644979936a922e1 | Python | 26,181 | 655 | import re
import json
import numpy as np
import pandas as pd
from pathlib import Path
class BigClustProject:
"""Helper for building and exporting BigClust 2.0 projects."""
META_FILE = "meta.parquet"
DISTANCES_FILE = "distances_{i}.parquet"
FEATURES_FILE = "features_{i}.parquet"
EMBEDDINGS_FILE =... |
d767b46d4bf6976b3d2dade81187decec9b017bf80e30b9a4af404c0b28a29e6 | Python | 26,182 | 581 | import os
import unittest
from functools import partial
from hed import schema
from hed.errors import error_reporter
from hed.errors.error_types import DefinitionErrors, ValidationErrors
from hed.errors.exceptions import HedFileError
from hed.models import HedString
from hed.schema.hed_schema_group import HedSchemaGro... |
b15375c1279468815786433e57c17e7dd079230cd832d9b6f80300c66c7465d6 | Python | 26,184 | 789 | """
Load setuptools configuration from ``setup.cfg`` files.
**API will be made private in the future**
To read project metadata, consider using
``build.util.project_wheel_metadata`` (https://pypi.org/project/build/).
For simple scenarios, you can also try parsing the file directly
with the help of ``configparser``.
"... |
b40de3be6e00f738eca8925f9fdba284a0886d73e1f9245223e0ab1ca20657e7 | Python | 26,189 | 505 | #%%
import numpy as np
import pandas as pd
import pickle
from pathlib import Path
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import ttest_ind, pearsonr
from scipy import stats
import statsmodels.formula.api as smf
from statsmodels.stats.anova import anova_lm
import math
ATLAS = '220'
BEHAVI... |
d29b8577c57183fc6715fb2ec973f785bc6c2843e413708439e033647c895ad7 | Python | 26,212 | 635 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 17 15:15:46 2024
@author: anne hoffmann & frederic crevecoeur
"""
# Import python packages: numpy
import numpy as np
def setupSystem(G,m,tau,delta,nState,nCtrl,nAug,nStep,nStab,r,wposh,wposc,wvel,
tarycoor,motorNoise,sensoryNoise,motorSdn0,mot... |
2a1f5ecdfd887bd834913f39ba2539b43abb4d0c60aa63fe70ca602aeac2e112 | Python | 26,239 | 784 | # 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... |
84b02ee0b1fd9810706ceab5c9aaebff6cc11532497f31b6f67b70a253e42275 | Python | 26,239 | 654 | # 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
#
# Unless required by applicable law or agr... |
ba6025f5ef961aefd5f6b305e3fdc9c2d47855000db8d17ada51ecf19bbad9d9 | Python | 26,286 | 591 | import numpy as np
import pandas
import os
import tempfile
from skimage import transform
from typing import Dict
from typing import List
from merlin.util import aberration
from merlin.core import dataset
from merlin.core import analysistask
from merlin.util import decoding
from merlin.util import barcodedb
from merlin... |
e097434060cd4eafc698d75a51032f3b096d199a3bc293a7d9c0589fcd350724 | Python | 26,290 | 609 | """Qt tests for the rectangle-drag multi-label selection + deletion
feature. Uses the same qapp / settings-isolation pattern as
test_ccf_boundary_viewer_qt.py."""
import numpy as np
import pytest
@pytest.fixture
def qapp():
from PySide6.QtWidgets import QApplication
app = QApplication.instance()... |
a2753087540d280d6c59a2b375acf17960cdbdcabd8b44194ee5110c38b86de7 | Python | 26,299 | 678 | from dreamcoder.likelihoodModel import AllOrNothingLikelihoodModel
from dreamcoder.grammar import *
from dreamcoder.utilities import get_root_dir
import os
import traceback
import subprocess
import numpy as np
def multicoreEnumeration(g, tasks, _=None,
enumerationTimeout=None,
... |
4a52b817977b2d6f697955fef4773b13f4879de10138d478df9446b8828b09c0 | Python | 26,308 | 757 | #!/usr/bin/env python
"""
Basic greyscale density and morphology analysis of vesicle-like segments.
These segments are typically manually / Amira segmented.
This script may be placed anywhere in the directory tree.
Calculates:
- greyscale density statistics
- surface (membrane) and lumen greyscale density stati... |
60112a154216909c8c1a957cd6114607c599f45c870e8c0f48cc9afb0d6357d5 | Python | 26,309 | 752 | from __future__ import annotations
from logging import WARNING, getLogger
from shutil import which
import pytest
from quacc import get_settings
settings = get_settings()
pytestmark = pytest.mark.skipif(
which(str(settings.ESPRESSO_BIN_DIR / settings.ESPRESSO_BINARIES["pw"])) is None
or which(str(settings.ES... |
00cf6d81ca37d6ade43404fb1b9894c66e2a8a54074083374a4f2ae31cbfbf44 | Python | 26,313 | 723 | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 8 16:24:03 2022
@author: Dustin Garner
"""
import os
import collections
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import fafbseg
from fafbseg import flywire
import flycode.reduction as reduction
import flycode.utils as utils
import flycode.... |
9f12641b43c951114f263f1ed7aea800147179e0e19030a05801f8b7191e7359 | Python | 26,330 | 752 | # SPDX-FileCopyrightText: 2024 Blue Brain Project / EPFL
#
# SPDX-License-Identifier: AGPL-3.0-or-later
import networkx as nx
import numpy as np
import pandas as pd
from scipy.stats import hypergeom
from scipy.stats import binom
from scipy.linalg import eigvals
#TODO: MODIFY THE IMPORTS TO EXTERNAL IMPORTS
from .topo... |
1040999de026e46b63a23491d2f764a293de92a299a630f0e071934466a4ad74 | Python | 26,340 | 754 |
device = '0'
import os
os.environ['CUDA_VISIBLE_DEVICES'] = device
from stephenHeadConfig import conf
conf.cachedir = '/home/mayank/temp/cacheHead_Round2'
import PoseUMDN
import tensorflow as tf
import PoseTools
import math
import PoseCommon
self = PoseUMDN.PoseUMDN(conf,unet_name='pose_unet_nomean_contrast')
# ... |
ee548a333e0efda7aedb7987d03482c7325c50b933e0cb57ef198f0ec88a7a9d | Python | 26,346 | 643 | # -*- coding: utf-8 -*-
#
# Test proper functionality of Syncopy DiscreteData-type classes
#
# Builtin/3rd party package imports
import os
import tempfile
import time
import h5py
import pytest
import numpy as np
# Local imports
import syncopy as spy
from syncopy.datatype import AnalogData, SpikeData, EventData
from ... |
e73606b3bd3a947af71fed1c1e5ec42fb7784f5819c16aa7e8bb24ca15a89f04 | Python | 26,351 | 797 | import tqdm
import numpy as np
import scipy
import jax.numpy as jnp
import jax
import matplotlib.pyplot as plt
from scipy import integrate
from functools import cache, partial
import itertools
import netket.jax as nkjax
import numba as nb
import netket as nk
from scipy.special import comb
import math
from src.quantu... |
37af178c7d62150b397592e793fdf79eacc03dc720086be122ea55a86e5cc0ee | Python | 26,360 | 866 | # 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... |
290b929380f1523a787ad30014adac75a14b07dcf94676e663fe812d3a79d3cd | Python | 26,365 | 731 | # 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... |
8d486596b48aa4b674c7a6bc81befdecd0ee7729a2e55ac76f9c51bb4d9487a1 | Python | 26,372 | 726 | """
Visualization of across-trials average burst probability modulation
per burst dictionary characteristic for a pair of channels.
Optionally perform cluster-based statistics and identify
statistically significant differences within- and across-
conditions.
"""
import numpy as np
import matplotlib.pyplot as plt
impo... |
c0284d0fb6b4fa294a2435718f8e778e2027f44c3ae7d05c284c9973c25af200 | Python | 26,399 | 735 | """setuptools.command.egg_info
Create a distribution's .egg-info directory and contents"""
from distutils.filelist import FileList as _FileList
from distutils.errors import DistutilsInternalError
from distutils.util import convert_path
from distutils import log
import distutils.errors
import distutils.filelist
import... |
a3d8f67695e5fbb5470ec12815bcb02d5e36c06c9c3a2b9a788a04fddb203800 | Python | 26,400 | 561 | rest_api_version = 3 # type: int
def update_param(name, param):
if name == 'algorithm_params':
param['type'] = 'KeyValue'
param['default_value'] = None
return param
return None # param untouched
def class_extensions():
def _extract_x_from_model(self):
"""
extr... |
70c063fd865712138448d37b6cbb5e2ede1c5f91b96ecce92a160b42233d90c9 | Python | 26,421 | 731 | #!/usr/bin/env python
from typing import List
import numpy as np
from sella.hessian_update import update_H
from sella import _gpu as _gpu_mod
from sella._gpu import gpu_eigh, gpu_eigh_t, to_gpu
from scipy.sparse.linalg import LinearOperator
class NumericalHessian(LinearOperator):
dtype = np.dtype('float64')
... |
92c6cb65765dbfc4597de1d3b5f77317e401d6944cbcd9d533f7f8fc9b665257 | Python | 26,426 | 767 | import pytest
from torchvision.models import resnet18
from elasticai.creator import ir
from elasticai.creator.torch2ir import (
Torch2Ir as Torch2IrTranslator,
)
from elasticai.creator.torch2ir.default_handlers import (
adaptiveavgpool2d,
add,
batchnorm1d,
batchnorm2d,
conv2d,
flatten,
... |
a2578f29fd5d3b814f7559ecb1c0484d515030bd449470de0feb80f858653ae2 | Python | 26,429 | 670 | """Per-region quantification of a segmentation, measured in the DATA's frame.
Every number the feature reports comes from quantify_regions, so these tests
use planted objects with hand-countable pixel areas and assert exact values -
not approximations. A tolerance here would hide precisely the arithmetic
errors t... |
1ebca6d8f7168a89830b20d428a2f8b97b3f3877e29e5c8a48225e87104c0e19 | Python | 26,433 | 608 | """Embedded pyqtgraph preview panel for the Cellpose detection tab.
Two modes, toggled by the Source dropdown:
- **Input**: the selected section rendered with the same orientation the detector
will apply - scrub sections, follow the tab's Channel pick, zoom/pan, hover
intensity, percentile contrast + "Reset... |
e7bd5a606734703506e7ff6805793fc4e2d8839f70aa9b5e0211d191b71c638a | Python | 26,442 | 781 | import numpy as np
import matplotlib.pyplot as plt
from os.path import join
from matplotlib.style import use
from help_funcs import load_exp_variables
use("default")
# ----- #
# Dataset selection.
datas = ["2014001", "2014004", "cho2017", "dreyer2023", "munichmi", "weibo2014", "zhou2016"]
# Mode.
mode = "local" ... |
9de8ac04ae909bdb969ffb053130a4da431ed75772b06042eebc54f0dc4757e9 | Python | 26,455 | 790 | # 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... |
7d012c25bec6b3ff55abd574c47202074105c4d446cb1b9baf8c386459867316 | Python | 26,498 | 904 | import os
import re
import abc
import csv
import sys
from .. import zipp
import email
import pathlib
import operator
import textwrap
import warnings
import functools
import itertools
import posixpath
import collections
from . import _adapters, _meta, _py39compat
from ._collections import FreezableDefaultDict, Pair
fro... |
ffbf4541981246f646c330a3d69be6637b299a1422bc307fef2adbd11d96a7e3 | Python | 26,509 | 917 | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
Perform ACBC experiments using LabSmith
@author: Dr. Stelios Chatzimichail, PDRA
Kapanidis Group, Oxford, 2022.
"""
#-------- LabSmith Imports ----------#
import serial.tools.list_ports
import serial
from uProcess import uProcess # Import ... |
c2e58bf817074a4e0ce25e78fd828d49067de2f2add091dc0d4f50b9de7912df | Python | 26,522 | 700 | import os
import re
import json
import copy
import itertools
from csv import DictReader
from pathlib import Path
class Reactions:
def __init__(self, rxns_file='reactions.tsv'):
self.path = Path(os.path.dirname(__file__))
self.BiochemRoot = os.path.join(self.path, 'files', 'biochemis... |
15c6a8ed27405b40dc619eb34dbbaaa71d0593dc05f72db2da911222310cb7bb | Python | 26,524 | 727 | # 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... |
6ddc33d7e6ffdbfe251d6b6b4139f60e975be70c7b2fe8677dee54c63c59cbf0 | Python | 26,525 | 674 | from traceHandler import *
from modelHandler import *
from optimizerHandler import *
from optionHandler import optionHandler
import time
from datetime import datetime
import numpy
import json
import os
import matplotlib
matplotlib.interactive(False)
class my_candidate():
"""
Mimics the behavior of ``candidate`` from... |
c0f7b608e75c6920480cadd0b9633c87790678db6d250d2e23ec9f2e985fb94d | Python | 26,546 | 842 | # 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... |
2ab280f033b9101fa8c87c80aaa37840a85dec78dfd38011d9ca0275ffdaacaa | Python | 26,555 | 785 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
def _compute_same_pad(kernel_size, stride):
if isinstance(kernel_size, int):
kernel_size = [kernel_size]
if isinstance(stride, int):
stride = [stride]
if not (len(stride) == len(kernel_size)):
raise V... |
d5fbf9212f2a8a583dfd5bf4a7a7e30bf2d623e5110bf031472b530f8401140f | Python | 26,561 | 762 | #!/usr/bin/env python
"""
Basic greyscale density and morphology analysis of vesicle-like segments.
These segments are typically manually / Amira segmented.
This script may be placed anywhere in the directory tree.
Calculates:
- greyscale density statistics
- surface (membrane) and lumen greyscale density stati... |
a504386175fe512cdb1e394215a7c47ab012aab602be9f74faf21db98f4dbb3b | Python | 26,564 | 617 | import numpy as np
import random
import pickle
from Loader import SignedPairsDataset, SinglePeptideDataset, get_index_dicts
from Trainer import ERGOLightning, ERGODiabetes
from pytorch_lightning import Trainer
from torch.utils.data import Dataset, DataLoader
from pytorch_lightning.logging import TensorBoardLogger
from ... |
e12233d22616f58b6aec05cc13d3a8d76d1fce57f4cc219202d312d992c93e1d | Python | 26,580 | 1 | {"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"acceler... |
4da104b550d839a478bbfd2bbf675a54eb8d4aaba59a21bbc37c3a648bf660b3 | Python | 26,606 | 583 | """
Unit tests for schema format I/O roundtrip validation.
Tests that schemas can be loaded, saved in all 4 formats (XML, MEDIAWIKI, TSV, JSON),
and reloaded with perfect fidelity for both standard and library schemas.
"""
import os
import shutil
import tempfile
import unittest
from hed.schema import load_schema, lo... |
aa74c8ac3d8b368dba01b671dbb43889bbd2af713a33545c9a73af7e9b5b9b97 | Python | 26,641 | 508 | import pybullet as p
UNKNOWN_FILE = 'unknown_file'
class UrdfInertial(object):
def __init__(self):
self.mass = 1
self.inertia_xxyyzz = [7, 8, 9]
self.origin_rpy = [1, 2, 3]
self.origin_xyz = [4, 5, 6]
class UrdfContact(object):
def __init__(self):
self.lateral_frictio... |
f3ca59f567b68e468af5808aa20c6880814f8623c3ac880ec9684ceccd5c7fc6 | Python | 26,644 | 868 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Cached networks to use with the population classes, as the only
variables being used is "nodes_ex" and "nodes_in" VERSION THAT WORKS.
"""
import numpy as np
import os
from glob import glob
if 'DISPLAY' not in os.environ:
import matplotlib
matplotlib.use('Agg')
f... |
70a70a621d15a3b1a2f5d787546b6e6e3c5be32909fdd3d311c42154d0696ac8 | Python | 26,650 | 653 | """
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: ... |
f5dcaa43ec373237e6c566c5b7c2843d4e887d77b245da16a763a0f34dab5106 | Python | 26,692 | 796 | # results.py
from collections.abc import (
MutableMapping,
Mapping,
MutableSequence,
Iterator,
Sequence,
Container,
)
import pprint
from typing import Tuple, Any, Dict, Set, List
str_type: Tuple[type, ...] = (str, bytes)
_generator_type = type((_ for _ in ()))
class _ParseResultsWithOffset:
... |
3bdc4a58bb1071aa01a551d4d70541806b3948cfb2d2fc3462a29d1638871aea | Python | 26,710 | 563 | #!/usr/bin/env python
# =============================================================================
# GLOBAL IMPORTS
# =============================================================================
import os
import time
import json
import glob
import logging
import numpy as np
import pandas as pd
from simtk import ... |
d960a00f0da9098ac540fb46987bdb8408ba9518f87b63165f8220677801fb5b | Python | 26,722 | 575 | import numpy as np
import open3d as o3d
import skimage
import torch
import torch.nn.functional as F
import trimesh
from packaging import version
from src.utils.datasets import get_dataset
class Mesher(object):
def __init__(self, cfg, args, slam, points_batch_size=500000, ray_batch_size=100000):
"""
... |
20eb5214e760918008760119ed72293f286e7a175b9fe509f18de431b4154adc | Python | 26,729 | 690 | """
Contains class Gray for segmentation related analysis of grayscale (3D) images.
# Author: Vladan Lucic (Max Planck Institute for Biochemistry)
# $Id$
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from builtin... |
d37b117700c97777f7c134314b2a09500e772541ed121287d33a8a68647027e0 | Python | 26,730 | 596 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import copy
import argparse
import csv
import time
import torch
from DiscRisk_utilities import get_optimizer, get_loss_func, norm2unnorm, randomly_omit_columns, numpy_to_cuda, \
cuda_to_numpy, cuda_is_availa... |
5b1d8a236c3c6dbf36abcb04a082447629f6e964ab6a623b46e8d995901aa2c0 | Python | 26,745 | 613 | from copy import deepcopy
import cv2
import carla
import random
import torch
import numpy as np
import pygame
import json
from utils import lts_rendering
from utils.map_utils import MapImage, encode_npy_to_pil, PIXELS_PER_METER
from autopilot import AutoPilot
def get_entry_point():
return 'DataA... |
30dc0d55f120d776e5e404fc62e52b25a6e6e4a607284cac2224c83f5c61ae3e | Python | 26,752 | 386 | """ATLAS.py 2026-10-08. Pre-registration: 04-NOTES/PREREG-2026-10-08f-SIGN-ATLAS.md
The sign atlas of the whole fly brain. A: certainty — a calibrated probability that each neuron inhibits, from cell types whose
transmitter laboratories measured (votes + lineage; held out by lineage). B: the corrected brain — the mos... |
08e6b76bf3fc887f28805f0b35d68e06cd854185b8a6f2d46be1577fb110b09c | Python | 26,754 | 728 | from functools import lru_cache
from math import atan, cos, exp, pi, sin, sqrt
import matplotlib.pyplot as plt
import numpy as np
from mpmath import coth, csch
class Fixed_Mechanical_Properties:
"""
A class to represent the mechanical properties of the cell membrane and the particle.
Attribu... |
785e111115201a279de48d011757497671f085ff48d2acf7494634e21188f267 | Python | 26,772 | 614 | import os
import argparse
import time
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
import torch.nn.functional as F
import networkx as nx
import torchdiffeq as ode
import sys
import functools
import scipy.io as scio
from utils import *
import argparse
... |
33ae7d5b3e228b0d10971d858d75a9ffb30e788d0f1b8ffad1976828fbb4700c | Python | 26,775 | 489 | """
Functions to run hierarchical clustering (via Ward's linkage)
of the cosine similarity matrix of significant time bins
a la Perez-Ortega et al. 2021 (see also Carillo-Reid et al. 2015)
Then "core-cells" and cell assemblies are detected with correlation
based methods from (Montijn et al. 2016 and) Herzog et al. 2021... |
927de2f98455e1b570ceea3c32547dc668fe79df8c1f069d9e0f0afca4f9a651 | Python | 26,784 | 683 | """ Modal dialogs for carrying out automatic detections.
"""
from logging import getLogger
from fractions import Fraction
from numpy import arange, array, zeros
from scipy.signal import resample_poly
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QComboBox,
QErrorMessage,
... |
f054219c1c83629ca98d35d6f96967f53c92f74156e23087a3719a57a42adade | Python | 26,796 | 752 | import numbers
import random
import numpy as np
import PIL
import skimage
import skimage.transform
import torchvision
import torch
from torchvision import transforms
from PIL import Image
import torch
import cv2
def _is_tensor_clip(clip):
return torch.is_tensor(clip) and clip.ndimension() == 4
... |
e293f4c6db16dcc76bb5d44f92fc40e32bb0827818c8b079ecba61db2e8a5ca5 | Python | 26,803 | 710 | # -*- coding: utf-8 -*-
from __future__ import annotations
import copy
from typing import Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
class TransformerWordEmbedding(nn.Module):
def __init__(
self,
n_vocab: int = None,
n_embed: int = None,
embed_s... |
79684d2cba644ef7402be5da3e2ccd56f10e6e2c608a7de6adcaaa177ab872cc | Python | 26,814 | 734 | # Copyright (c) 2022, Ko Sugawara
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... |
bcdbca5775be2917daae2314d022de2a0901f67bc890fbc73f645055b2991ed2 | Python | 26,816 | 549 | import math
import torch
from torch import nn
import torch.nn.functional as F
import timm
class TransfuserBackbone(nn.Module):
"""
Multi-scale Fusion Transformer for image + LiDAR feature fusion
image_architecture: Architecture used in the image branch. ResNet, RegNet and ConvNext are supported
lidar_a... |
b557c555aa9d0b6422e244bb15cefa9ae9a61c75352f046eb0eeda7c638c1f1d | Python | 26,838 | 699 | # 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... |
36c662885750fe96efe2fb2175ab42e95bb5ef0d7203309cf2ecc8cb893b77fc | Python | 26,870 | 675 | # Node-group asset "oxDNA Style Classic" (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.
import math
from typing im... |
a09272d40a41437280848f512e4b86a94f2f15866b24ecb1d6d145f6ae96dcb0 | Python | 26,909 | 737 | # This script is part of navis (http://www.github.com/schlegelp/navis-flybrains).
# Copyright (C) 2020 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ve... |
dcf5d36c7b918c04cb8c8698ef01f37ff251676dd1f29ec1a28d4016aabc2979 | Python | 26,923 | 619 | import copy
import datetime
import logging
import multiprocessing
import os
import pathlib
import numpy as np
import pandas as pd
import psutil
import pypet
import tqdm
import xarray as xr
from ...utils import paths
from ...utils import pypetUtils as pu
from ...utils.collections import dotdict, flat_dict_to_nested, f... |
dafcdc81f327d28058b1eb6a4a571f66fdfb968b4d1247350328f6aa56046345 | Python | 26,927 | 734 | """Module to compute frequency representation.
"""
from copy import deepcopy
from logging import getLogger
from functools import partial
from multiprocessing import Pool
from numpy import (arange, array, asarray, copy, empty, exp, isnan, log, max, mean,
median, moveaxis, nan, pi, real, reshape, sqrt... |
4033f4221756d2c47aa19da67da20eb2745f09b521dfaadcf1a4975b60d32e3a | Python | 26,961 | 744 | """
Managing selections for the ``Molecule``
For selectively applying styles inside of Blender, we represent selections as a
boolean attribute on the mesh of the ``trajectory.object``.
These could be directly created with ``traj.store_named_attribute(array, "selection_name")``
but the SelectionManager class is a conv... |
884f52daf778b4f7e6380625431484111de73781a2df3b49ec391f5820a1a74a | Python | 26,972 | 689 | #!/usr/bin/env python3
# Rootlets Hierarchical Principle Components Analysis algorithm
#
# Loading saved output:
# with open(data_fname, 'rb') as f: hPCA_results = pickle.load(f)
import os
import pickle
import numpy as np
from numpy.linalg import svd, det
from scipy.stats import norm, chi2, zscore
def ESET(d, N... |
0cb46f26120d6330f596a6a17cbda4afdc22b38fd2685ee731e342fe2a8fcb9b | Python | 26,976 | 1,059 | import numpy as np
import scipy as sp
import scipy.optimize as spo
from pyclamp.dsp.fpfunc import *
from pyclamp.dsp.dtypes import *
np.E = 0.57721566490153286060651209008240243104215933593992
def sortparam(_p, s, ofs, ply): # sorts parameter groups in order specified by s, where the p[:ofs] are ignored and p[ofs:] o... |
14c3950c7b1df064aab60571609fd3d54f4ed4d40aa3f97d0867b9fc0662a661 | Python | 27,018 | 823 | """Database for accessing and serializing fingerprints.
Author: Seth Axen
E-mail: seth.axen@gmail.com
"""
from __future__ import division
from collections import defaultdict
import pickle as pkl
import logging
import warnings
import numpy as np
import scipy
from scipy.sparse import vstack, csr_matrix
import smart_op... |
c3ba980903170c0e715f66f4a388efe701fe6e6b8203f7de8b854ed3ab4b03b5 | Python | 27,052 | 495 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.