sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
e6b3e526e0b02056723ddf2a2dc2c23c6deff11f5b95ff3132781bd496db9ce8 | Python | 14,222 | 328 | """
Generates a ListTomoParticle object from a input STAR file
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import numpy as np
import scipy as sp
import ... |
086315c46307ff01587694a2fdec1789ef12ade1ed36c418f16cbf7250e425f7 | Python | 14,224 | 398 | """
m6A_calling.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 a reference implementation of a CNN model for m6A calling.
GS hackathon participants: you can start with this code to develop your own
models f... |
047b6e8d86a9ff2be1bda37db9bc31992fc93c90bf6fc1e3bb56dced4095c5a0 | Python | 14,228 | 325 | """
This module is used to create a HedSchema object from a set of .tsv files.
"""
import io
import pandas as pd
import hed.schema.schema_io.df_constants as constants
from hed.errors import error_reporter
from hed.errors.exceptions import HedExceptions, HedFileError
from hed.schema.hed_schema_constants import HedKey... |
e4cb2a5f8586fe123c485cd8c0e7a7c564c9b2e24f37e80988594774cfd572ae | Python | 14,233 | 442 | """Data related functionalities.
This modules contains the tools to preprare the data, from the raw csv files, to the DataFlow
objects will be used to fit our models.
"""
import os
import urllib
import numpy as np
import pandas as pd
from sklearn.mixture import GaussianMixture
from sklearn.preprocessing import LabelE... |
36193e03c4c609f4ff5872dc56d3d476d8b69fb714ae012a539c94ff08ed1355 | Python | 14,235 | 336 | # 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/LICENSE-2.0
#
#... |
18e789505d86f2fc273faf151cdd59ce5ca8ffc4b6158ac3f9dc8483ae3bb6ef | Python | 14,236 | 362 | """
Script for finding transmembrane high density structures (features)
TODO: return feature oriented normal to membrane
Input: - Density map tomogram
- Membrane segmentation tomogram
- Segmentation parameters
Output: - Transmembrane MCF graph
- List (.csv) of fea... |
55fc52440308f9215c72b945b0c1aacef47ce443c0fb3454074d5b0608b1586d | Python | 14,236 | 328 | import pybullet as p
import random
import time
import numpy as np
from dimensions.common import get_properties
from plan_tools.common import randomize_body, get_type, get_liquid_quat, load_body
from plan_tools.samplers.grasp import SPOON_DIAMETERS, SPOON_LENGTHS
from plan_tools.simulated_problems import TABLE_NAME, Z... |
5c7df8d863d7030259bcf26ccf1f791d9e6f3780b04353e710817488440be751 | Python | 14,236 | 376 | # 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... |
0ab7212b0ef43cf06a26e4c4c9321900e2a44c9f504015a87b6e36efb1c3ad70 | Python | 14,237 | 328 | """
Generates a ListTomoParticle object from a input STAR file
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import numpy as np
import scipy as sp
import ... |
4c1998c831913ca8db38fa827047eb2871ce847f055e6c5fc358cee96cab8442 | Python | 14,244 | 360 | import torch
import torch.nn as nn
device = torch.device('cuda:0')
class PositionEmbedding(nn.Module):
def __init__(self, num_nodes: int, sequence: int, dim: int):
super(PositionEmbedding, self).__init__()
self.device = torch.device('cuda:0')
self.sequence_len = sequence
... |
6b7b182a36ec91d8aa1c8ad865afd6325727895c53d39f7a04803e0e1bdef902 | Python | 14,251 | 270 | import copy
import os
import torch
import shutil
import warnings
warnings.filterwarnings("ignore")
import time
from argparse import ArgumentParser, Namespace, FileType
from rdkit.Chem import RemoveHs
from functools import partial
import numpy as np
import pandas as pd
import scipy
from Bio.PDB import PDBParser
from r... |
8584061ec276ac0fdd3f800f4d182fcc89a9622ac6daf695204624c6adb75f8e | Python | 14,252 | 339 | import anndata as ad
import numpy as np
import pandas as pd
import pytest
from scipy import sparse
import pertpy as pt
@pytest.fixture
def tiny_dense_adata():
exp_matrix = np.array([[6, 0, 2], [1, 5, 0], [0, 1, 7]]).astype(np.float32)
return ad.AnnData(
exp_matrix,
obs=pd.DataFrame(index=[f"c... |
22d9dfb66e8aacce88baf4b9c740fdc89d8338e75692bcaef6ca5cbc88b4a109 | Python | 14,255 | 358 | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import os
import os.path as osp
from collections import defaultdict
from datetime import datetime
import mmcv
import numpy as np
from mmcv.utils import print_log
from ..core.evaluation.ava_utils import ava_eval, read_labelmap, results2csv
from ..utils import... |
311d25793950f39ce24ccdd9c403f792ed276f44171534f5eb50a4c567d3cfdf | Python | 14,259 | 226 | import time
import numpy as np
from utils import get_values_from_pandas, change_resolution, translate_from_pandas_to_array
"""Glossary
Theta: parameters being inferred. This will NOT include other parameters that are not part of the inference solution.
Parameter: all parameters that need to be given to the simulator... |
1ab1d3392b818ba82eac9ab1a8a9d99bd6eb0624e34c7de5b62f3c82f6d77c42 | Python | 14,260 | 481 | from ast import Str
from cProfile import label
import re
import collections
import pandas as pd
import time
import datetime
import math
import requests
from sympy import N
import tensorflow.keras as keras
import tensorflow as tf
import numpy as np
from sklearn.utils import shuffle
from sklearn.model_selection import tr... |
6a75610c7a5c9628c7e9649cc2a1c3ccb1f52af91dc233d3aa96f1061804d62f | Python | 14,260 | 334 | #
# Copyright (C) from 2009 to Present EPAM Systems.
#
# This file is part of Indigo toolkit.
#
# 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
#
... |
c696e264525f9f01697b97c0fce9aa98114e6419be93a9d0dd575a81fee510ab | Python | 14,263 | 308 | import cv2
import imagej, scyjava
import os
import shutil
import tifffile
from glob import glob
import numpy as np
import multiprocessing as mp
JVM_MAX_MEMORY_GB = 4.0
def compute_overlap_percent(deltaX, deltaY, image_width, image_height, pixel_size_xy, min_overlap=0):
"""Helper function to calculate percent over... |
cb333ffc33c0a145276ea1d7134085084fb60deb15baf372661d4508b9e84c81 | Python | 14,263 | 409 | """Shape optimization of a multilayer stack over a broad bandwidth.
The 1D stack consists of alternating materials of index N_LAYER_1 and N_LAYER_2
in the arrangement: N_LAYER_2, N_LAYER_1, N_LAYER_2, N_LAYER_1, ..., N_LAYER_2.
The design parameters are the N layer thicknesses: [t_1, t_2, ..., t_N]. N must
be odd.
T... |
f42a5a170d3770ed673a37b6e4d7ba7f0b95ebb2a9c04ff4fa6e97320a9aefdd | Python | 14,264 | 374 | """Functions used when creating a new window.
"""
from logging import getLogger
from functools import partial
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import (QAction,
QDockWidget,
QMessageBox,
... |
f3894d9eb6f2408d726295833b68f42bb025bcdf9bd401607d417cc39fc25200 | Python | 14,266 | 387 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import subprocess
import sys
from lab.experiment import ARGPARSER
from lab import tools
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute import AbsoluteReport
from downward.reports.compare import ComparativeReport... |
83bf8414cbb5c5064b7f2f1748853e447319ae7038d81e2f72ab05387eeabdaf | Python | 14,267 | 429 | # -*- coding: utf-8 -*-
"""
Created on Jun 5 2023
@author: Jonas A. Thiele
"""
###Plot results of network-specific link selections for main sample, lockbox sample, and replication sample
#%% Imports
import numpy as np
import seaborn as sns
from matplotlib import colors
import matplotlib.pyplot as pl... |
39ae0f41f770a22e1c32a7466b453cb339d3483573395fa1d09a3853890270a3 | Python | 14,271 | 276 | """
Serialization tests for the datatypes: they validate that the JSON produced
locally by the library matches what a Wikibase instance expects. No network
interaction is involved.
"""
import pytest
from wikibaseintegrator import WikibaseIntegrator, datatypes
from wikibaseintegrator.datatypes import (URL, BaseDataType... |
bd9cd8beeedfab096fdc6b61976c62c350dcfcef3456519c095d03387c02c833 | Python | 14,273 | 375 | import sys
from threading import Event, RLock, Thread
from types import TracebackType
from typing import IO, Any, Callable, List, Optional, TextIO, Type, cast
from . import get_console
from .console import Console, ConsoleRenderable, RenderableType, RenderHook
from .control import Control
from .file_proxy import FileP... |
db8eca98cf3fee03211e98d577e30cea319ede5532c271d76db883bb04e5d0f8 | Python | 14,274 | 354 | import torch
import numpy as np
from typing import Tuple, Union
from sklearn.metrics import (mean_absolute_error, mean_squared_error, r2_score,
matthews_corrcoef, f1_score, precision_score,
balanced_accuracy_score, recall_score,
ave... |
938909e91acf937b614338c61ab92ec4b76e78439450672580fa291beeb60dfc | Python | 14,276 | 336 | """
Generates a ListTomoParticle object from a input STAR file
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import numpy as np
import scipy as sp
import ... |
5e47074de65a9a9a668edff88739860467c98f903ca8db88735474f0c9fa0f26 | Python | 14,278 | 336 | """
Generates a ListTomoParticle object from a input STAR file
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import numpy as np
import scipy as sp
import ... |
cfcd27ce95d61bce151845a8ff3f217f7638e622eb04cba59b6cc27832d807b9 | Python | 14,278 | 350 | import torch.nn as nn
import torch
from typing import Optional, Type
from . import hcnn_cell_compressed
class HCNN_compressed(nn.Module):
"""
The HCNN_compressed class creates a Historical Consistent Neural Network that makes a difference
between the features you are really interested in (task) and the fe... |
cf38db205333ba7c06a24bb94786e240df3780f91b7038f052e913c21b4fb968 | Python | 14,281 | 274 | # MIT License
#
# Copyright (c) 2024 Zihan Zhang, Yi Zhao, Harbin Institute of Technology
#
# 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... |
8cad86a0c28964263041380d6d86a816da40a0775abf6484c01883e152c4cb42 | Python | 14,282 | 489 | # ResNet models for Keras.
# Reference papers
# - [Deep Residual Learning for Image Recognition]
# (https://arxiv.org/abs/1512.03385) (CVPR 2016 Best Paper Award)
# Reference implementations
# - [TensorNets]
# (https://github.com/taehoonlee/tensornets/blob/master/tensornets/resnets.py)
# - [Caffe ResNet]
# (https://... |
37cf773429541015c0365c7ad43d35dc6f45b8ff9f08827b7068a1b0d5964e52 | Python | 14,284 | 384 | """Tests for the estimation interface."""
import numpy as np
import pytest
from test_io import init_data
import hmp
from hmp.estimators import BaseEstimator, EMEstimator, EstimationResult
from hmp.models import EventModel
from hmp.patterndata import PatternData
@pytest.fixture(scope="module")
def projected():
"... |
097090e59dca48ab7a6fd2dbcef0b3d674035fd65052dc54c33c1933b34dc97a | Python | 14,285 | 415 | import copy
from abc import ABC, abstractmethod
import threading
import multiprocessing
from typing import List
import merlin
class AnalysisAlreadyStartedException(Exception):
pass
class AnalysisAlreadyExistsException(Exception):
pass
class InvalidParameterException(Exception):
pass
class AnalysisT... |
765dc6923c74fd437ce98362532f7b4d80c3fa6865c9ae4411f278454a3ff9f9 | Python | 14,289 | 634 | import operator as op
import numpy as onp
from numpy_utils import binary_ufunc_check, binary_ufunc_check_no_same_args, stat_check, unary_ufunc_check
import autograd.numpy as np
import autograd.numpy.random as npr
from autograd.test_util import combo_check
npr.seed(0)
# Array statistics functions
def test_max():
... |
29315c208e3c48d2215b2805c920c54df4dd1c5a7c9995a584692361d67beed5 | Python | 14,295 | 456 | # Node-group asset "Select Res Name" (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_CHECKI... |
6c78607e272ffb8b8dd633e0e1fbabc86391efe35c31ce25843393e30450642b | Python | 14,297 | 363 | import torch
import torch.nn as nn
# from .utils import load_state_dict_from_url
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',
'wide_resnet50_2', 'wide_resnet101_2']
model_urls = {
'resnet18': 'https://download.pyt... |
34370753e0ebcc02979f91c360ebc60d9a8aa6981d2cb3edf2f06ee144cb536e | Python | 14,300 | 336 | # Defines different classes of artificial shapes used to generate training stimuli.
from enum import Enum
import torch
from torch import Tensor
from typing import List, Literal
######################################################
# Image primitives from which shapes are constructed #
################################... |
6297c9134009b4b99b51ca1fe040f835f1fd92d7847b76af436b629b909a08c2 | Python | 14,300 | 328 | """
Generates a ListTomoParticle object from a input STAR file
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import numpy as np
import scipy as sp
import ... |
af71f0752291219da05423555d25240ad05fe77187453ed1261bfb5dd72b8b7b | Python | 14,303 | 374 | import torch
from torch_geometric.nn import MessagePassing
from torch_geometric.utils import add_self_loops, degree, softmax
from torch_geometric.nn import global_add_pool, global_mean_pool, global_max_pool, GlobalAttention, Set2Set
import torch.nn.functional as F
from torch_scatter import scatter_add
from torch_geomet... |
8bf3c147b04ea1c7916e001945a891bfb8f79b2049b08db1fdbb1b0d8866afa3 | Python | 14,309 | 434 | # 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... |
fc10652dce594e36f3922f4939d4fe5005e354abec9d50dea148b842d352b33e | Python | 14,314 | 479 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 4 10:18:33 2023
@author: Shengze Cai
From:
https://github.com/omniscientoctopus/Physics-Informed-Neural-Networks
"""
# Import Libraries
import torch
import torch.autograd as autograd # computation graph
from torch import Tensor # tensor n... |
ebf6cfd2bc7c5f8ff06d94ad58a111cb8b4bca161d29ae2edc923edbb782f91f | Python | 14,317 | 376 | # Copyright (c) OpenMMLab. All rights reserved.
# By Shuran Liu, 2023
import torch
import torch.nn as nn
from mmcv.cnn import constant_init
from mmcv.ops import ModulatedDeformConv2d, modulated_deform_conv2d
from model_2D.models.backbones.sr_backbones.basicvsr_net import (
ResidualBlocksWithInputConv, SPyNet)
from... |
1bccfb09d0e05b2b1d38767f60f28090d41412cd20f4bdd8bab3e6b832d0d3e9 | Python | 14,318 | 358 | ########################################################################################
# C. Jarne 2024 Analysis Group of D. Vidaurre @cfin #
# #
# Code performs a Kernel Ridge regression (called KRR... |
3bb92c4e281d79998fef3d17fcea219b7664828eb64ee7e62cb0adb5b5adb343 | Python | 14,318 | 286 | import pandas as pd
import numpy as np
from sklearn.cluster import KMeans
import matplotlib as mpl
from scipy.stats import zscore
import seaborn as sns
from matplotlib import pyplot as plt
from scipy.stats import pearsonr
from one.api import ONE
import os
one = ONE(silent=True)
one = ONE()
ROOT = one.cache_dir.joinpat... |
483add96e829623c1644aa02c874208079585f73c4e53fc8068b3f8fc3e89d55 | Python | 14,318 | 404 | """
Modified by Mayank Kabra
Adapted from 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
Adapted from Deeper... |
e58661bc900453f6ffc291daabc19cc7def40ebc3552a1e63d6346b637e8d18d | Python | 14,319 | 314 | from wonambi.utils import create_data
from numpy import arange, pi, sqrt, cos, sum
from scipy.signal.spectral import _spectral_helper
from numpy.random import seed
from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_almost_equal
from wonambi.trans.frequency import _fft
from wonambi.trans im... |
f9762125737deb05196a3428d19dc27e0ee6b3955be84faaccb4a86cff176444 | Python | 14,329 | 504 | from rdkit import Chem
from rdkit.Chem.Draw import MolToImage
from rdkit.Chem import AllChem
import numpy as np
import deepsmiles
import selfies
import re
import torch
import maldi_nn.nn as maldinn
import torch.nn as nn
from bio_attention.attention import GLU, TransformerEncoder, Aggregator
from bio_attention.embed imp... |
545ecb12070ab555c068db29abdb05af8f5f4a9ec64e721047c11a739deeeda2 | Python | 14,330 | 366 | #!/usr/bin/python
# Gogulan Karunanithy, UCL, 2023
import tensorflow as tf
import time
import os, copy
from tensorflow import keras
import tensorflow.keras.backend as K
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.keras.mixed_precision import experimental as mixed_precision
polic... |
be59bd3015a7cdb0d57dbe26022e336fd3c2655a30904cb3533bfc9c2f7ade94 | Python | 14,336 | 385 | # 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... |
cf87d8a3eadd95b64649919db95874f8391b7ee28215446156fff682f2c7ecb7 | Python | 14,337 | 378 | import io
import itertools
import random
from typing import Dict, List, Union
import matplotlib
import matplotlib.pyplot as plt
import mne
import numpy as np
import PIL
import torch
from matplotlib import colors
from mne.viz import circular_layout
from mne_connectivity.viz import plot_connectivity_circle
from pylab im... |
6e08254a8315fcdff4d012ba7049f03eedd8c1cc7a668c281b5efa44b7db910d | Python | 14,343 | 353 | """Test that all Jupyter notebooks in examples directory can be loaded and executed.
This test suite validates that all example notebooks:
1. Are valid Jupyter notebook format
2. Can be executed without errors (with mock data paths)
3. Import statements work correctly
TestNotebooks uses only the standard library (jso... |
853b36bc2776070f6a5f915ee1409fde9b7fd6cdf9d117882688b7793348a15e | Python | 14,343 | 454 | # regex.py
from itertools import islice, repeat
from multiprocessing import Pool, cpu_count
import dnaio
import regex
from fba.levenshtein import rev_compl
from fba.utils import get_logger, open_by_suffix
logger = get_logger(logger_name=__name__)
def compile_regex_ref_barcodes_exact(barcodes):
"""Compiles a r... |
796a4903645d7a756b0330b7970561df46b93b167ad0f22725018bff8545071e | Python | 14,344 | 396 | """
Golden-image tests for final renders.
Renders are compared against committed reference PNGs with the same tolerance
model Blender's own render tests use (see `compare_images` in utils.py): a
pixel fails when a channel differs by more than ~4/255, and the image fails
when more than 1% of pixels fail. This absorbs t... |
5e18fedbde3c6d9872b5d57fa490cc5c0815ed58359410bfee67186f80cec112 | Python | 14,349 | 530 | import os
import sys
import tempfile
import operator
import functools
import itertools
import re
import contextlib
import pickle
import textwrap
import builtins
import pkg_resources
from distutils.errors import DistutilsError
from pkg_resources import working_set
if sys.platform.startswith('java'):
import org.pyt... |
511573e7b7f3dc4dbc1da63e6e58849293be772a59c43bb2708890d0a195ac98 | Python | 14,351 | 241 | """
Created on Thu Jan 20 01:25:44 2022
@author: Haotian Teng
"""
# from bwapy import BwaAligner
# from bwapy.libbwa import Alignment
import sys
import re
import pysam
import numpy as np
import mappy as mp
from numpy import ndarray
from typing import List, Optional
from xron.utils.seq_op import raw2seq
from itertools... |
87d1815caa57631a663cbe1d8a40e1addc7f59b7ef647481fc647bb5a3f955dc | Python | 14,351 | 386 | """
From two different segmentation generates two RWR and compares the results. This script
assist in the analysis of GraphMCF with trans- or inter-membrane structures
Input: - GraphMCF instance (pkl)
- Segmentation with at least three regions
Output: - GraphMCF with the result of every ... |
8e62245255a890b3ab0db97f23acc6260a64e52000fa20dec97408a4bf746b4f | Python | 14,353 | 338 | """
Generates a ListTomoParticle object from a input STAR file
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import numpy as np
import scipy as sp
import ... |
6110d5e9c9ab5ee5d67a727e37074a0b743fed46516d1407e1f171171c4991a2 | Python | 14,363 | 338 | """
Generates a ListTomoParticle object from a input STAR file
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import numpy as np
import scipy as sp
import ... |
ba406742a0fec8ba479fb742d8e903aef7acdfd6ffdd1433a75bfe3a00206187 | Python | 14,366 | 281 | import os
import numpy as np
from scipy import stats
from sklearn.linear_model import Lasso,lasso_path
# Kirsten Peterson, Jan. 2024
# Peterson, K. L., Sanchez-Romero, R., Mill, R. D., & Cole, M. W. (2023). Regularized partial correlation provides reliable functional connectivity estimates while correcting for widesp... |
cfc7749ccc9fc428f37b4bdd09b701895508b366172bc3eb66bfe432c96c912f | Python | 14,366 | 386 | #
# 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,... |
31d0a93ee6c69b1e1f1c8559829892ad75ac482f66a2e3dd78b980fdf31fbcbf | Python | 14,367 | 359 | """
m6A_calling.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 a reference implementation of a CNN model for m6A calling.
GS hackathon participants: you can start with this code to develop your own
models f... |
857ab8a296511002d81aded78473da55bf2ba3278a85c3ee4f97eb59b4b3d6c8 | Python | 14,370 | 439 | #!/usr/bin/env python
'''
Example plot for LFPy: Single-synapse contribution to the LFP
'''
import plotting_helpers as phlp
import analysis_params
from analysis_params import params as PlotParams
from matplotlib.ticker import MaxNLocator, FormatStrFormatter
from matplotlib.colors import LogNorm
from matplotlib.collecti... |
116819a5d9f0b83c7e99b84509ddaddeeb052614f0648b1f549785bed8cca83c | Python | 14,375 | 373 | # Copyright (c) OpenMMLab. All rights reserved.
# By Shuran Liu, 2023
import torch
import torch.nn as nn
from mmcv.cnn import constant_init
# from mmcv.ops import ModulatedDeformConv2d, modulated_deform_conv2d
from model_3D.models.backbones.sr_backbones.basicvsr_net import (
ResidualBlocksWithInputConv, SPyNet)
fr... |
69b36a12aa616c19fac534f309aa669a6804aa8e3a417142ec75d649cd69cff4 | Python | 14,378 | 323 | """
Pre-processing for mb_graph_batch.py of double oriented membranes from a lumen labeled segmentation
Input: - STAR file with 3 columns:
+ _rlnMicrographName: tomogram original (denisity map)
+ _psSegImage: labelled tomogram with the segmentations
+ _mtMtubes... |
d7106577d06c0d135063f671407786816a73134d58222da72ef4b53b2ca4b12a | Python | 14,379 | 426 | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import load_checkpoint
from model_2D.models.common import (PixelShufflePack, ResidualBlockNoBN,
flow_warp, make_layer)
fr... |
999f56eaaf426b5d28b745a2a0d81d0c7ff1fdad264f12809c8bd7ea3793b4d1 | Python | 14,383 | 328 | """
Generates a ListTomoParticle object from a input STAR file
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import numpy as np
import scipy as sp
import ... |
f46270fbbd5239b8ba42c76f6de7a0e30d196cc1d81bfbb21d9a725eafd019cd | Python | 14,384 | 378 | #!/usr/bin/env python
#================================================================
# Copyright (C) 2021 Yufeng Liu (Braintell, Southeast University). All rights reserved.
#
# Filename : neurite_shape.py
# Author : Yufeng Liu
# Date : 2021-07-30
# Description : size, intensity, and ... |
99e79ef5b047b05c19f9e0acdd69c2fccb81b0f36edd6d77e8ed59479c0ab5d5 | Python | 14,389 | 299 | import os
import re
from typing import Any, Callable, Dict, Tuple, Union
import numpy as np
import scipy.io as scio
from ..base_dataset import BaseDataset
from ....utils import get_random_dir_path
class SEEDIVFeatureDataset(BaseDataset):
r'''
The SEED-IV dataset provided by the BCMI laboratory, which is led ... |
f56a95dc4ead75a63aca905ea916b212c58db3c3fc033be65be18f99cf87b8e8 | Python | 14,389 | 402 | #
# 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,... |
d5fbe68bb89d7df9cbb731cb659a535fbf60080cfb854bf30626b69a5cd94e6f | Python | 14,390 | 293 | # 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... |
0d888da0185fb9e0c77591a7c19383f0d38fcf4c9971ddc6f541d4306f8a8234 | Python | 14,392 | 325 | from __future__ import annotations
from typing import TYPE_CHECKING
import numpy as np
import pandas as pd
from rich.progress import track
from scverse_misc import Deprecation, deprecated_arg
from sklearn.metrics import pairwise_distances
from statsmodels.stats.multitest import multipletests
from pertpy._types impor... |
42db03a2842786fff583d44dd285668174e503f79c2a27e324eb45064f297334 | Python | 14,394 | 259 | # coding=utf-8
# Copyright 2018 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... |
eaa4b00501806c58995c2b05d0db6d275008d0cceb73f7b5bf49f9205f50c021 | Python | 14,400 | 380 | import torch
from torch_geometric.nn import MessagePassing
from torch_geometric.utils import add_self_loops, degree, softmax
from torch_geometric.nn import global_add_pool, global_mean_pool, global_max_pool, GlobalAttention, Set2Set
import torch.nn.functional as F
from torch_scatter import scatter_add
from torch_geomet... |
c3cb7e3daa11a89a98646749e804e71a03af399c4a11eadf0da9fabc2d2f6441 | Python | 14,403 | 432 | # 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... |
37b04c9abf261e85f73927f592d0cdb3244fdeff777681314c4c237bc30ae979 | Python | 14,404 | 127 | # Autogenerated by nbdev
d = { 'settings': { 'branch': 'main',
'doc_baseurl': '/MIOFlow/',
'doc_host': 'https://KrishnaswamyLab.github.io',
'git_url': 'https://github.com/KrishnaswamyLab/MIOFlow/tree/main/',
'lib_path': 'MIOFlow'},
'syms': { 'MIOFlow.co... |
c4c3f619d0b7a4f5a38aa1aea53ed34e5cbe2d64bf4446bcf44ed3c25b307c7e | Python | 14,416 | 220 | import copy
import math
import os
from functools import partial
import numpy as np
# import wandb
import torch
torch.multiprocessing.set_sharing_strategy('file_system')
from torch_geometric.nn import DataParallel
import resource
rlimit = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NO... |
8993e516e982e9451d48e64f84463f1a65d221726b4bd6284213131e40c4c284 | Python | 14,418 | 423 |
import numpy as np
from bonito.nn import Permute, layers
import torch
from torch.nn.functional import log_softmax, ctc_loss
from torch.nn import Module, ModuleList, Sequential, Conv1d, BatchNorm1d, Dropout
from fast_ctc_decode import beam_search, viterbi_search
class ModelTinyNoSkipX01(Module):
"""
Model tem... |
19cd6584f260abe00d3aa14f860851df5fdec26f41259d52305440184afef724 | Python | 14,421 | 492 | import logging
import os
import time
import hydra
import numpy as np
import pandas as pd
import torch
import wandb
from omegaconf import OmegaConf
from sklearn.metrics import accuracy_score, average_precision_score, roc_auc_score
from torch import nn, optim
from torch.utils.data import ConcatDataset, DataLoader
from ... |
4cd9b70569bd605ddac04d72f295391e640c3df20146208a1a53ab2be160019e | Python | 14,422 | 305 | import ants
import numpy as np
import cv2
import os, sys, glob, json
import networkx as nx
import pandas as pd
from tqdm import tqdm
sys.path.append('pix2pix')
from utils import rgb_to_labels
def main(repair_dir='.', reference_id = 40, neighbours=5, reg=0.5, padding=100):
# set output directory and save argume... |
fe85ab4a1a272cf20be00f68e9bde48b25e1614b193c95c2b2f3b5b6b903e701 | Python | 14,426 | 320 | #!/usr/bin/env python3
"""Keep ``schemas_latest_json/`` in sync with the latest *released* version of each schema.
``schemas_latest_json/`` holds one merged JSON copy of the newest released version of each schema:
schemas_latest_json/HEDLatest.json <- standard_schema/hedjson/HED<latest>.json (copied)
... |
a52c3eeed1061d2d6cfa436b320c7fb52ba3b94bed328e1ac1cdfb65e2ebf906 | Python | 14,435 | 288 | import os
from typing import Callable, Dict, Tuple, Union
import numpy as np
import pandas as pd
from ....utils import get_random_dir_path
from ..base_dataset import BaseDataset
class AVEDProcessedDataset(BaseDataset):
r'''
This dataset contains EEG recordings from 10 subjects listening to one of two compet... |
bd4a5dce84060ab95f1027525f16d0b2ed1dd1a8eba687ff695ee99c952a3613 | Python | 14,435 | 388 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import subprocess
import sys
from lab.experiment import ARGPARSER
from lab import tools
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute import AbsoluteReport
from downward.reports.compare import ComparativeReport... |
31b83c69f7c5a56e76d9a75efd46fa0c249194ed3c0d37f766e293545410fbf8 | Python | 14,438 | 404 | """
Contains class DistanceTo for calculations of distance between segments of
a segmented images and given region(s)
# Author: Vladan Lucic (MPI for Biochemistry)
# $Id$
"""
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import zip
from builtins import range
__version_... |
0f7188265034cb83c33bff47b874c50206868177f33d15486f14d720feb63295 | Python | 14,452 | 402 | # 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... |
8adf27faf25f06dbb74d716df4e01a447c0d75fe8e67206fcd0b4aebf573462e | Python | 14,452 | 391 | # Function for handling additional return values from compute functions
import h5py
from hmac import compare_digest
from numbers import Number
import numpy as np
from syncopy.shared.errors import SPYInfo, SPYTypeError, SPYValueError, SPYWarning
def metadata_from_hdf5_file(h5py_filename, delete_afterwards=True):
... |
a79531f303e6e87c07bdf9f60d5ee982baa0d6eff322678171584f8bdf6f97b9 | Python | 14,452 | 271 | # 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... |
0cf61e52b8966aeb9375f64d35a2d6978af19554bd0b370fc45251cf68f61d68 | Python | 14,453 | 338 | import os
import sys
import json
import copy
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import matplotlib.patches
import matplotlib.transforms
import util_network
def process_cnn_layer_list(fn_arch,
input_shape=[100, 1000],
n_class... |
3a5f024dfc8410e682004d589906c964202c22a4ec2f299611889eb2bc2c9796 | Python | 14,453 | 426 | """Module reads and writes header and data for EDF data.
"""
from logging import getLogger
from datetime import datetime, timedelta, time, date
from pathlib import Path
from re import findall, finditer
from struct import pack
from fractions import Fraction
from numpy import (abs,
asarray,
... |
f985d14ae4deb7fbef04b48c4096c1d2b9cb9ce4e592278e3610d07f048d38ed | Python | 14,453 | 391 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import subprocess
import sys
from lab.experiment import ARGPARSER
from lab import tools
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute import AbsoluteReport
from downward.reports.compare import ComparativeReport... |
d4dae83fc833ca32b89f283d2c88b52a846178dcbbc8222a337714064f110c8b | Python | 14,457 | 389 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import subprocess
import sys
from lab.experiment import ARGPARSER
from lab import tools
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute import AbsoluteReport
from downward.reports.compare import ComparativeReport... |
71b8714c4ff41b010704fba34ca481ca0c43c5b152dbddda44c567a2caf80f0d | Python | 14,458 | 388 | import math
import numpy as np
import torch
import torch.optim as optim
from einops import rearrange
from torch import nn
from typing import Any, Dict, Optional
from dataloaders.torch_dataloader import create_torch_loader
from dataloaders.utils import get_dataset, sample_gt
from models.model import train, save_train_... |
8a20b8c619ddbd5e3f540b19b786ed343053fc319511ef6d73789281bf1e25c1 | Python | 14,462 | 398 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import subprocess
import sys
from lab.experiment import ARGPARSER
from lab import tools
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute import AbsoluteReport
from downward.reports.compare import ComparativeReport... |
f2141996ae0e8be743bb3a61ea39ba0b4897fc44bb07e845a086b7cc07c80bd0 | Python | 14,466 | 428 | import os
import random
import re
import numpy as np
from collections import namedtuple
from control_tools.common import PR2_JOINT_SAFETY_LIMITS
from dimensions.common import load_cup_bowl_obj
from dimensions.cups.dimensions import OLIVE_CUPS
from perception_tools.common import get_type, get_body_urdf, get_models_pa... |
8182bd1681baebb308ea4a606b1f48ae672fb84509751ee19b568f6895df67fb | Python | 14,467 | 458 | """"""
import multiprocessing as mp
import logging
import time
from queue import Empty
import numpy as np
from pupil_recording_interface.decorators import device
from pupil_recording_interface.device import BaseDevice
from pupil_recording_interface.utils import monotonic
from pupil_recording_interface.errors import D... |
88ea63d414960cbe2550d01a5b0b2c003eedfc50f45e35401c82441edcfd89e1 | Python | 14,467 | 419 | import numpy as np
from bonito.nn import Permute, layers
import torch
from torch.nn.functional import log_softmax, ctc_loss
from torch.nn import Module, ModuleList, Sequential, Conv1d, BatchNorm1d, Dropout
from fast_ctc_decode import beam_search, viterbi_search
class ModelTinyNoSkipX3(Module):
"""
Model templ... |
b0093b6f37b2de26394bf6c73569cbfb01f201a47d943895f1faf0d09b18132f | Python | 14,472 | 354 | # -*- coding: utf-8 -*-
from collections import defaultdict, deque
from itertools import chain
import heapq
DEBUG = False
class CausalGraph(object):
"""Weighted causal graph used for defining a variable order.
The causal graph only contains pre->eff edges (in contrast to the
variant that also has eff<->... |
5d6362da2a8780034f976b99ff977ba626178aac070507e8a9f0bd55c14333f5 | Python | 14,475 | 392 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import subprocess
import sys
from lab.experiment import ARGPARSER
from lab import tools
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute import AbsoluteReport
from downward.reports.compare import ComparativeReport... |
e75828de92452b2dade135409453db1e4bd1a2690d5763f069bf997e1c2e28e8 | Python | 14,481 | 413 | import gzip
import os
import sys
from datetime import datetime, timedelta
from glob import glob
import numpy as np
import pandas as pd
import scipy.sparse as sp_sparse
from numba import njit
from . import __version__
from .utils import echo, secho
def prepare(input_files, data_dir, input_format, round_sites, chunks... |
2bdd2bc6df4b99a5169ffd458475251a7a7625b9fe028a5ad939cce7bb3e0bd5 | Python | 14,483 | 299 | import itertools
import os
import shutil
import unittest
from hed import schema
from hed.errors import HedExceptions, HedFileError
from hed.schema import hed_cache, load_schema_version
class Test(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.hed_cache_dir = os.path.join(os.path.dirname(os... |
89455b1d4a78d932daa94e6fb285c8238a0bdc529bb2d4ab3c7ca47a373b6cb5 | Python | 14,485 | 130 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import suites
from lab.reports import Attribute, gm
from common_setup import IssueConfig, IssueExperiment
try:
from relativescatter import RelativeScatterPlotReport
matplotlib = True
except ImportError:
print 'matplotlib not availabe, scatter plots ... |
cefae40f92fbab162611009fb57e8cc039dc5e20c598ec05c1af1531943a1018 | Python | 14,486 | 461 | """Tests for cog.predictor module (BasePredictor)."""
from pathlib import Path as FilePath
from typing import Optional
import pytest
from cog import BasePredictor, BaseRunner, Path
def test_base_runner_run_and_predict_bridge() -> None:
class MyRunner(BaseRunner):
def run(self, text: str) -> str:
... |
a91c0fc979afb86323681af1efb0850d31de6532be8d4c7bf7d4bea5ec2296fa | Python | 14,491 | 315 | import numpy as np
import argparse
import sys
import os
import random
import scipy
import colorsys
from itertools import islice
import matplotlib.pyplot as plt
sys.path.extend([
os.path.join(os.getcwd(), 'pddlstream'), # Important to use absolute path when doing chdir
os.path.join(os.getcwd(), 'ss-pybullet'),... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.