sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
3b43c9bb3256f176ae2ee365bd8a74fa5c8f0c2564b7ad61f39db088ed9273c7 | Python | 12,949 | 370 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------
# Created By : Kangjoo Lee (kangjoo.lee@yale.edu)
# Last Updated: 08/06/2024
# -------------------------------------------------------------------------
# =========================================... |
5b2aba6f7d652830adc0ccd48eb6e08bc397820433aa5d967d447fd3d2593907 | Python | 12,951 | 328 | import torch
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler, random_split
import pandas as pd
import numpy as np
import os
import random
from collections import defaultdict, Counter
from itertools import combinations
import json
import torch.nn as nn
import torch.nn.fu... |
76478cc415b34bb51eb9248135d25e67b79f3c271eb52b0de7a258a18f2cdcd2 | Python | 12,954 | 363 | # Copyright 2023 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
adc87dcd8f13e02efc2a9d00eb5f65f2793b443f3f04ee67c58b16ecbe3bd7e3 | Python | 12,955 | 353 | import random
from tkinter import W
import brainrender as b
import numpy as np
from brainrender.actors import Point
from brainrender import _utils
#Find cell coordinates
import csv as c
file = open("CN_neuron_coordinates_allcells.csv")
csvreader = c.reader(file)
# Skip first line to get to get to data
next(csvreade... |
570abaf068dd909ac94f7405cf2ba06182eaec2f182afaa7435a18d0b0fc018f | Python | 12,956 | 290 | import glob
import os
from typing import Dict, List, Union
import torch
from diffusers.utils import is_safetensors_available
if is_safetensors_available():
import safetensors.torch
from huggingface_hub import snapshot_download
from diffusers import DiffusionPipeline, __version__
from diffusers.schedulers.sche... |
1fa55cd2cbb5767cc52db6aeb1649cef422e2487af4017d710b939137750269c | Python | 12,964 | 515 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
# dataclasses_json breaks if using __future__.annotations, so keep 3.9 typing annotations for compatibility
from dataclasses import dataclas... |
c1c017b511068e3afee9f6bf5079bd5184562b5123eccac6e59147a6f7d2d284 | Python | 12,964 | 354 | # mypy: ignore-errors
import os
from pathlib import Path
from tempfile import TemporaryDirectory
import numpy as np
import pytest
import rioxarray # noqa
import spectral as sp
from siapy.core.exceptions import InvalidInputError
from siapy.entities import SpectralImage
from siapy.entities.images import RasterioLibIma... |
614800abf8145078b8381016fea7ae4b5e0d6d308edc16dcfe7c911906b4d0a0 | Python | 12,969 | 394 | import sys
import pytest
from ci.ray_ci.automation.image_tags_lib import (
format_platform_tag,
format_python_tag,
)
from ci.ray_ci.automation.push_release_test_image import (
ReleaseTestImagePushContext,
_annotate_pushed_image,
)
from ci.ray_ci.configs import DEFAULT_PYTHON_TAG_VERSION
from ci.ray_ci... |
60667fa67ca22356e3b63140b5b39ede1e296fe056567c28d41739958dedb235 | Python | 12,978 | 326 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
# pylint: disable=line-too-long
# pylint: disable=multiple-statements
# pylint: disable=too-many-lines
# pylint: disable=wrong-import-position
#-------------------------------------------------------------------------------
'''
This program... |
fafc868c16f12b2559658a34353799790b075e7eaada07fce2aae81d5c9f8f23 | Python | 12,982 | 344 | """dbSNP API client."""
import logging
from typing import Any, Dict, List, Optional, Union
import json
from .base import BaseAPIClient
from ..config import settings
logger = logging.getLogger(__name__)
class dbSNPClient(BaseAPIClient):
"""Client for NCBI dbSNP API.
dbSNP is a public-domain archive fo... |
7c46cf2ad40fd13bac94aee7a5c6989fcd3def3feb90dfe649b631e91dfaa261 | Python | 12,984 | 344 | """dbSNP API client."""
import logging
from typing import Any, Dict, List, Optional, Union
import json
from ..base import BaseAPIClient
from ...config import settings
logger = logging.getLogger(__name__)
class dbSNPClient(BaseAPIClient):
"""Client for NCBI dbSNP API.
dbSNP is a public-domain archive ... |
3f707c6a08d8144008cfbf18b09454ff750cccfeb1d9c5a5a41986f4d3dfab74 | Python | 12,989 | 436 |
# coding: utf-8
# # Table of Contents
#
# 1. [Import & Set Up](#import_everything)
# 2. [Load in data](#load_files)
# 3. [Within Pair Correlation](#within_pair_correlation)
# 3. [Center of Mass](#c_o_m)
# 1. [distance apart](#distance_apart)
# 2. [error by overlap](#error_by_overlap)
# 4. [Face Associate Tas... |
645ebd19cc6c6aec1f41702a6e14382203b5faeca2293bafe3ee1dc426ca1ab7 | Python | 12,989 | 409 | import time
from collections import Counter
import pytest
import ray
from ray.air.execution.resources.placement_group import PlacementGroupResourceManager
from ray.air.execution.resources.request import ResourceRequest
REQUEST_2_CPU = ResourceRequest([{"CPU": 2}])
REQUEST_1_2_CPU = ResourceRequest([{"CPU": 1}, {"CPU... |
3977b5d6742756f709c66b1012a6bf0269d29443238adece62f554561c23609b | Python | 12,995 | 306 | # Copyright 2023 Kakao Brain and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
4af437d8f2aed02298058590b8db114c6a25802416d21989bcc313fe47ce1e9a | Python | 12,996 | 270 | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 11 11:18:48 2021
@author: Nikhil
"""
exec(open('./Imports/modules_pixar.py').read())
path = input("Enter full name of the results folder:")
cache = pd.read_csv(str(path) + "/cache/cache.csv", index_col = 0)
#creates folders to save results
def createFolder(d... |
92ead939a1d867a4ebbae16a132347e751b216d4bef0115649ca7f83594a2333 | Python | 12,997 | 445 | import time
import numpy as np
from discontinuous_galerkin.base.base_model import BaseModel
from discontinuous_galerkin.polynomials.jacobi_polynomials import JacobiP
from discontinuous_galerkin.start_up_routines.start_up_1D import StartUp1D
import matplotlib.pyplot as plt
import pdb
from scipy.optimize import fsolve, l... |
998178f9b102b78c0af01633dc2affd082ad1ee1e9c62019f7185a0a56be5be5 | Python | 12,998 | 270 | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 11 11:18:48 2021
@author: Nikhil
"""
exec(open('./Imports/modules_pixar.py').read())
path = input("Enter full name of the results folder:")
cache = pd.read_csv(str(path) + "/cache/cache.csv", index_col = 0)
#creates folders to save results
def createFolder(d... |
663d9f730db5bf44aa16f65962925ecbe915c9792168c656edce6ddebeebb3e4 | Python | 13,001 | 338 | import os
import glob
import datetime
import numpy as np
import pandas as pd
import nibabel as nib
import pydicom
import dicom_numpy
from dicompylercore import dicomparser
from rt_utils import RTStructBuilder
from utils import utils, mri_utils
from config import config
def match_mri_dir(mri_dirs, rtstruct_path):
... |
7abd6ffad57ae202a01efe98c70e5518c7f382b6eddab4bad6ccd7ab684211ac | Python | 13,002 | 384 | # Copyright 2021 Google LLC
# 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, sof... |
d63203d955f9e17198019da63685ed0132c23f1e48f511ba2ba85f2b77b1b58a | Python | 13,003 | 359 | import json
import warnings
from dataclasses import asdict
from typing import Any, List, Optional, Tuple, Union
import pandas as pd
from dacite import from_dict
from data_profiling.config import Correlation, Settings
from data_profiling.model import BaseDescription
from data_profiling.model.alerts import Alert
from d... |
9ecf5619eb2cdf1f76727889ade6687fadf8dc95e648565a944e43bbccf74db7 | Python | 13,007 | 352 | import numpy as np
import gym
import numbers
import exputils as eu
import matplotlib.pyplot as plt
def sample_value(value_descr=None, random_state=None):
if random_state is None:
my_random_state = np.random.RandomState()
my_random_state.set_state(np.random.get_state())
else:
my_random_... |
ebedaf86fc991c4deffc979b5ba8fb619eecc39e75cf81f1f0ce84048dc02099 | Python | 13,012 | 426 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import copy
import glob, os
from poser.patients import Patient, PatientCollection
import re
import scipy.stats as st
import seaborn as sns
#%% load patient data
directory = './data/' # put the DLC tracking files in this directory
# this is... |
656f40c7e11caa8227f9bb02abdfcfa0ba6ce4566205848d37dccd207050aba1 | Python | 13,013 | 348 | import os
import shutil
import sys
import signal
import subprocess
import time
import platform
import nibabel as nib
import numpy as np
from medpy.filter.smoothing import anisotropic_diffusion as ans_dif
def get_mode(input_data):
"""
Get the stastical mode
"""
(_, idx, counts) = np.unique(input_data,
... |
05dcf32aa518a71f0df128b2d92353bdc7268652ee8df60e4dd9c106a7bad180 | Python | 13,014 | 380 | # -*- coding: utf-8 -*-
### ----------------------------- IMPORTS --------------------------- ###
import click
import os
import json
### ----------------------------------------------------------------- ###
def check_main(folder, data_dir, csv_dir):
"""
Check if folders exist and if h5 files match csv files.... |
c72bca646b2026148717f7431ad9a53f365252f8c8a2950b0fcaab2b2f5fb95b | Python | 13,021 | 351 | import os
from pathlib import Path
from typing import Annotated, Any
import numpy as np
import rioxarray # noqa # activate the rio accessor
import spectral as sp
import xarray as xr
from numpy.typing import NDArray
from siapy.core import logger
from siapy.core.exceptions import InvalidInputError
from siapy.core.typ... |
1a6a6d09d57d3a60fd007e0a89531d0bdcb646d551bc79c036769e377a4aa67b | Python | 13,022 | 340 | import unittest
import torch
from rising.transforms.functional.affine import (
_check_new_img_size,
affine_image_transform,
affine_point_transform,
create_rotation,
create_scale,
create_translation,
parametrize_matrix,
)
from rising.utils.affine import matrix_to_cartesian, matrix_to_homoge... |
e60f8501639927e2f04d6d75b8f0c34897a59e06c08b5d5d514f8152ebeb3143 | Python | 13,023 | 456 | # Copyright 2026 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
ab24c77c267c6f1df1f0bbb6220b95f199cfb0e6859fa9c83b6fc3b5e92af211 | Python | 13,024 | 306 | import argparse
import copy
import logging
import os
import sys
from datetime import datetime
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch
import torch.utils.data
from torch.utils.tensorboard import SummaryWriter
from src.config import ConfigFile
from src.data import GraphBatchI... |
d71fc14300d560bf7acddadeec5d49c4df68215a5495d25fbcb271203d1570c0 | Python | 13,024 | 349 | ###socialDoors - RF1 Aging - Ori Zaff 8/23/22
from psychopy import visual, core, event, gui, data
from psychopy.visual import ShapeStim
from instructions import *
import pandas as pd
import os
import datetime
import time
#gui set up for subject id and picture order
subjDlg = gui.Dlg(title="Picture Task")
subjDlg.addF... |
5380f382b24ae33c3fa58302e24bcbcc9a2ff696348e30f1cd896bbba69688ea | Python | 13,026 | 326 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
# pylint: disable=line-too-long
# pylint: disable=multiple-statements
# pylint: disable=too-many-lines
# pylint: disable=wrong-import-position
#-------------------------------------------------------------------------------
'''
This program... |
bc21c641ab2276fc5b1a44edeeab3d9692a43a74a7c4a0d7bba423ea554001ca | Python | 13,027 | 270 | """FastCCC backend for :func:`omicverse.single.run_ccc` (permutation-free CCC).
FastCCC (Hou, Ma & Zhou, *Nat Commun* 2025) scores every
sender-receiver-interaction triple of the CellPhoneDB database like
CellPhoneDB does (mean expression, complex = min of subunits, arithmetic
mean of ligand and receptor, >10% express... |
fedd162b5a5e4320835eb93c6ac0647008eef50e674535faea3224ba34961545 | Python | 13,027 | 402 | """
From https://github.com/ehoogeboom/e3_diffusion_for_molecules/
"""
import tempfile
import warnings
import torch
import pickle
import os
import openbabel
import numpy as np
from rdkit import Chem
from typing import Any, Dict, List, Optional, Tuple
from rdkit.Chem.rdForceFieldHelpers import UFFOptimizeMolecule, UFF... |
2d386c1c8805e46bdd70a666b2d1dfb578a2bfc4a1b32a51cf536bc9130c3027 | Python | 13,030 | 349 | import unittest
from functools import partial
from typing import Mapping, Sequence
from unittest.mock import Mock, patch
import numpy as np
import torch
from rising.loading.dataset import Dataset
from rising.loading.loader import (
BatchTransformer,
DataLoader,
SampleTransformer,
_MultiProcessingDataL... |
5b13acecadddc5ffacd21e1b3619b87ba5108848bb1419877eb89b4baacb6f30 | Python | 13,041 | 425 | """IUCN Red List API client for conservation status."""
import logging
from typing import Dict, List, Optional, Any
from .base import BaseAPIClient
logger = logging.getLogger(__name__)
class IUCNClient(BaseAPIClient):
"""Client for IUCN Red List API."""
def __init__(self, api_token: Optional[str] = Non... |
d1ef559924d867ead1f9c2208812b5e98a2d9e9a81c83705d39e002b4278b636 | Python | 13,041 | 382 |
from abc import abstractmethod, ABC
import pdb
import numpy as np
import ray
import torch
import tqdm
import matplotlib.pyplot as plt
from data_assimilation.utils import create_directory
class BaseForwardModel(ABC):
@abstractmethod
def update_params(self, params):
raise NotImplem... |
66155eba59e624adc447083372ed4274318aaa66b0de7c06219564e7046d0076 | Python | 13,042 | 425 | """IUCN Red List API client for conservation status."""
import logging
from typing import Dict, List, Optional, Any
from ..base import BaseAPIClient
logger = logging.getLogger(__name__)
class IUCNClient(BaseAPIClient):
"""Client for IUCN Red List API."""
def __init__(self, api_token: Optional[str] = No... |
5d9205c3971b0ea14d3d21189c946d757da435b08beba22026265c4dc5c23446 | Python | 13,043 | 339 | import asyncio
import dataclasses
import json
import logging
from functools import wraps
from typing import Optional
import aiohttp
from aiohttp.web import Request, Response
from pydantic import ValidationError
import ray
import ray.dashboard.optional_utils as dashboard_optional_utils
from ray.dashboard.modules.versi... |
2583feaf4feb9bc92fd8d06edfb19021f835ca481df3774443df215cbf62d44a | Python | 13,049 | 286 | """
This script generates a figure showing the distributions of the distances from PMJ for spinal and vertebral levels.
It also computes the mean and standard deviation for each spinal and vertebral level.
Usage: python distributions_and_heights.py -i <input_file> -o <output_folder> -p <participants_file> -normalised ... |
113042a5bb02f9d55aad29c581907281bff91d8bbe71f09807a7fef24e952929 | Python | 13,056 | 354 | import numpy as np
import matplotlib.pyplot as plt
from lib5c.util.plotting import plotter
from lib5c.plotters.scatter import scatter
from hic3defdr.util.scaled_nb import mvr, inverse_mvr
@plotter
def compare_disp_fits(fit_fns, labels, max_dist=200, colors=None,
linestyles=None, legend=True, *... |
5eb5479615c759128066f99b6fb609b6517d4125698a3f8da57f4288f0570269 | Python | 13,058 | 332 | import numpy as np
import scipy.sparse as sparse
import pandas as pd
from lib5c.util.bed import parse_feature_from_string
from lib5c.util.primers import natural_sort_key
from hic3defdr.util.clusters import cluster_to_loop_id, cluster_from_string
COLUMN_ORDER = ['loop_id', 'us_chrom', 'us_start', 'us_end', 'ds_chrom'... |
57288545807d3cb3edc358f5bc80b612092470ece67b09c2bbcbb2556f251eed | Python | 13,059 | 341 | ####################################################################################################
# Copyright (c) 2021, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is free softw... |
870464074d3c60a591ce533258ed0fcf98ba5bcf80df69de967c9355e2a1cc6a | Python | 13,063 | 351 | from typing import Any, Dict, List, Tuple
import numpy as np
import pandas as pd
import random
from anndata import AnnData
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal
from .logging import logger_manager as lm
from .utils import lab_to_hex, matrix_distance
def m... |
7d115d73ec8372cd9445ba6ef0c94ed05ceb4386bcd72c70461b5b73bcb92ed5 | Python | 13,067 | 349 | # -*- coding: utf-8 -*-
# (C) Copyright 2020, 2021, 2022, 2023, 2024 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#... |
5ee52b335def409c4d9b7ebc7b5343d64dfe6897c6ebfafbed19b2727a1aa185 | Python | 13,073 | 333 | # Copyright 2023 Google LLC
# 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, sof... |
10d837f94c83f905ac73128e8b30e7880fc150ee2dff72af1f6f30d736ca370b | Python | 13,079 | 388 | #
# CEBRA: Consistent EmBeddings of high-dimensional Recordings using Auxiliary variables
# © Mackenzie W. Mathis & Steffen Schneider (v0.4.0+)
# Source code:
# https://github.com/AdaptiveMotorControlLab/CEBRA
#
# Please see LICENSE.md for the full license document:
# https://github.com/AdaptiveMotorControlLab/CEBRA/bl... |
069a45bd463056878dd5d7ade273ad7112ffaee12e3b73d6c588159a97925315 | Python | 13,080 | 390 | import os
import logging
import warnings
import numpy as np
from tqdm import tqdm
import scipy.sparse as sp
from scipy.optimize import minimize
from sklearn.decomposition import PCA
from joblib import Parallel, delayed
import matplotlib.pyplot as plt
from .tangent_space import corr_kernel, cos_corr, density_corrected... |
5592e3008a7b8e373b0ddb390bb29fa36fc43ccfcc8f2be193870771e7252c96 | Python | 13,080 | 335 |
#%%
import numpy as np
import torch
import os
import json
import deep_sdf.workspace as ws
import deep_sdf
import random
import logging
import numpy as np
import plyfile
import skimage.measure
import time
import torch
from math import cos
from math import sin
import matplotlib.pyplot as plt
import t... |
9ec63d32cd16ab85bc659446c0917598d2d8279df02b7ae2f86f9529b9c866d2 | Python | 13,085 | 296 | # -*- coding: utf-8 -*-
"""Jax implementation of hash encoding for accelerated implicit neural representation for 1D-4D scenes.
Our implementation is based on the paper::
Müller, Thomas, et al. "Instant neural graphics primitives with a multiresolution hash encoding." ACM transactions
on graphics (TOG) 41... |
aeb8b03dda9d33a7a9ca927479f6d3bb2cd86e22d4073ef0651a60c4f1628991 | Python | 13,091 | 299 | from typing import List, Union
from functools import reduce
import numpy as np
from rdkit import Chem
import torch
import torch.nn as nn
from .retention import MultiBondRetention, MultiBondFastRetention, MultiAtomRetention, SublayerConnection
from GR_pKa.args import TrainArgs
from GR_pKa.features import BatchMolGraph... |
c6d27875ec794b93864da1db1222a799f224b6a4d88e4fc6511435817c51e4f0 | Python | 13,094 | 338 | import io
import logging
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
import pandas as pd
from ray.data._internal.pandas_block import PandasBlockAccessor
from ray.data._internal.tensor_extensions.arrow import pyarrow_table_from_pydict
from ray.data.context import DataContext
from ray.data.dataso... |
e240ebb8446e2c1509e4a3dbf169c9799e03d158fae8ab57a4405116cd596d83 | Python | 13,096 | 324 | import os
import pickle
import pandas as pd
import numpy as np
def make_match_table(Scores2Include, Matches, Output, TotalScore, OutputThreshold, ClusInfo, param, UIDs = None, MatchesCurated = None):
# Making Match Table
nUnits = param['nUnits']
#Give UMID add it as well?
# xx, yy =np.meshgrid(np.aran... |
edb8c2b2da96da4ecb961ed3f231744dafc38a0201a479478ac5caa3f5b9ef75 | Python | 13,099 | 355 | # Copyright 2021 Division of Medical Image Computing, German Cancer Research Center (DKFZ)
# and Applied Computer Vision Lab, Helmholtz Imaging Platform
#
# 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 L... |
152efc581f93e088dc944138496fa3b3706b22e05baf8edc89bee096cdc40991 | Python | 13,102 | 355 | """Diagnostics for ambient-RNA decontamination.
These helpers verify that an ambient-removal run behaved sensibly — the
"count-integrity" and "negative-marker" checks stressed by the 2026
ambient-RNA benchmark (Janssen *et al.*). None of them modify the data;
they are read-only audits of a corrected :class:`anndata.A... |
3f2b10ea0783dd9250b8c76e130d9eda6fb524812b8dce5cc072abb63a04a8a0 | Python | 13,109 | 333 | # Script for converting a HF Diffusers saved pipeline to a Stable Diffusion checkpoint.
# *Only* converts the UNet, VAE, and Text Encoder.
# Does not convert optimizer state or any other thing.
import argparse
import os.path as osp
import re
import torch
from safetensors.torch import load_file, save_file
# ========... |
f718fa5bb3addc2c498ccbab560a1f86b7f3ce13310fe5028e815e4ed1f9ab06 | Python | 13,113 | 383 | # Copyright 2021 Google LLC
# 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, sof... |
f37c57669f4e8aee1759a53d108a56dca2082a119c4461fce5d4b510ef312619 | Python | 13,114 | 353 | from typing import Tuple, List, Dict, Callable
import numpy as np
import torch
from torch.nn import functional as F
from lib.data_utils import dynamic_data_util as ddu
from lib.data_utils.dynamic_data_util import LoadedFlashPatch, PartitionType
from lib.data_utils.matched_cells_struct import OrderedMatchedCellsStruct... |
5aad7574181a3234a1db699dcbd383cc3ac0e15a41b56a750faf20c8f95f274d | Python | 13,115 | 381 | # NOTE: This file has been copied from OpenCensus Python exporter.
# It is because OpenCensus Prometheus exporter hasn't released for a while
# and the latest version has a compatibility issue with the latest OpenCensus
# library.
import logging
import re
import threading
from typing import Any
from wsgiref.simple_ser... |
14f99b2a366dac02adab272dbbc325de77b4f804a79a5db95e680398a3aa1d79 | Python | 13,116 | 323 | """
This module contains the implementation of a Model API.
Each simulation contains one model, that overarches the neural network that has been built using
the basic *mozaik* components (sheets and connectors) and some additional structures such as the recording configurations.
"""
from parameters import ParameterS... |
7c7b85f17fbb3c90d043d9da3f94c59b561f8c00055b8fc310ee377299bb19dc | Python | 13,122 | 352 | #!/Users/jeffcole/miniconda3/bin/python
import tensorflow as tf
import numpy as np
from random import shuffle
import random
import os
import sys
from itertools import groupby
import argparse
factorDict ={
"A":[-0.59,-1.30,-0.73,1.57,-0.15],
"C":[-1.34,0.47,-0.86,-1.02,-0.26],
"D":[1.05,0.30,-3.66,-0.26,-3.24],
"E":[1... |
57f5377bcf090ae061bc78006c09b455bc739646236d595c4a765bb2d63aa7a6 | Python | 13,123 | 326 | from __future__ import annotations
import logging
import math
import sys
from typing import TYPE_CHECKING, Optional
from .autoscaling_actor_pool import ActorPoolScalingRequest, AutoscalingActorPool
from .base_actor_autoscaler import ActorAutoscaler
from ray.data._internal.execution.interfaces.execution_options import... |
d0859d0b64bd0ce015b632791de70282fc43faaf9ebb83035ba85338ebb17b83 | Python | 13,124 | 393 | import math
from enum import Enum
from typing import Union, Tuple
import numpy as np
import torch
from gilbert.gilbert2d import gilbert2d
from gilbert.gilbert3d import gilbert3d
class OrderingType(Enum):
RASTER_SCAN = "raster_scan"
S_CURVE = "s_curve"
RANDOM = "random"
HILBERT = "hilbert_curve"
cl... |
63a234194183ea172e39ecc17644b2fe6cfb9c378e66b77a3d7cecc618de5655 | Python | 13,127 | 301 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
A preliminary version of this experiment was created using
PsychoPy2 Experiment Builder (v1.81.03), Tue Jan 20 10:30:57 2015
This script was then further modified by JTM (Jan-Feb 2015).
If you publish work using this script please cite the relevant PsychoPy publicat... |
8a154230d3a8283005c3e4d08ca5a46d10e586a9e1512f9bacd487c76f2837fc | Python | 13,127 | 372 | from typing import Optional, Literal
from pygam import LinearGAM, s
import logging
from tqdm import tqdm
import numpy as np
import pandas as pd
import scipy.sparse as sp
from scipy.optimize import minimize_scalar
from anndata import AnnData
from .utils import flatten
from .kernel_density_smooth import kde2d
def fit... |
e7d8d9b823161d46b76f3c123f631c4c9a80d6e89b963d35af4e9c7ee0d0078c | Python | 13,130 | 301 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
A preliminary version of this experiment was created using
PsychoPy2 Experiment Builder (v1.81.03), Tue Jan 20 10:30:57 2015
This script was then further modified by JTM (Jan-Feb 2015).
If you publish work using this script please cite the relevant PsychoPy publicat... |
3934d03ec027e3167d8b16437e4437a12dbc8fa9c1aaeac3f03be0646f5228ee | Python | 13,131 | 371 | # -*- coding: utf-8 -*-
"""
scFEA: single-cell Flux Estimation Analysis.
Vendored into omicverse from https://github.com/changwn/scFEA
(commit 4c1fb76d52f07bafad84ce7686ad7c3acfcf0126).
Original author: wnchang@iu.edu
Reference: Alghamdi et al. (2021), Genome Research.
This module keeps the original GNN architecture... |
0b7f27a8d3f22a0562aaf58e0c8d40d594797b22038e305d62fc2242bd3f655e | Python | 13,135 | 345 | """
From https://github.com/ehoogeboom/e3_diffusion_for_molecules/
"""
import msgpack
import os
import torch
import argparse
import numpy as np
from typing import Any, Dict
import torch_geometric
from torch_geometric.data import Data, Dataset
from torch.utils.data import BatchSampler, DataLoader as TorchDataLoader, ... |
d355edf18e038bb9dfae00fb299a1f4b639cb49fc89626f92cacd5021f68c531 | Python | 13,141 | 385 | import logging
import sys
import time
import traceback
import pytest
import ray
from ray._private.test_utils import (
format_web_url,
request_with_auth_token,
wait_until_server_available,
)
from ray.dashboard.modules.node import actor_consts
from ray.dashboard.tests.conftest import * # noqa
from ray.util... |
6bd19cd567d98b771bd93e5ef9044d7812157709c1488f98732990029b379e64 | Python | 13,142 | 402 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
Tests: InferenceBatcher — the Ray-backed batched-inference wrapper
around a fairchem predictor. Initialization, context-manager
... |
f5a3e4f58b8081b7c8fd7c28adfcbe49b243412455164b2a68b53765a0a64bbe | Python | 13,153 | 335 | from typing import Callable, Dict, Iterable, List, Optional, Set, Tuple, Union
from torch import nn
from sinabs import layers as sl
from sinabs.utils import expand_to_pair
from .dynapcnn_layer import DynapcnnLayer
def construct_dynapcnnlayers_from_mapper(
dcnnl_map: Dict,
dvs_layer_info: Union[None, Dict],... |
fc881edddd37ba2db1e3d59af4de76886e8a5e50e2a404f2e68b8de9fe7982ba | Python | 13,162 | 410 | from unittest import loader
import torch
import torch.nn as nn
import numpy as np
from pathlib import Path
from IPython.display import display, clear_output
from tqdm import tqdm
from tqdm.notebook import tqdm as tqdm_n
import copy
import matplotlib.pyplot as plt
import warnings
from m2snn.snn import build_network, r... |
140eab78fcee8ff0f20dd5cc0a1699dd50d385e174cf97679e6b02556435ef86 | Python | 13,166 | 372 | from collections import OrderedDict
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils import model_zoo
from torchvision.models.densenet import densenet121, densenet161
from torchvision.models.squeezenet import squeezenet1_1
import ssl
ssl._create_default_https_context = ss... |
81494009f60fa57a61e92de0c111c572e23db82001ff3e6050cae1139fb57b08 | Python | 13,169 | 353 | """Helper function to execute cell-type annotation and accumulate results."""
from __future__ import annotations
import inspect
import logging
import os
import string
from collections import defaultdict
from dataclasses import dataclass, field
import anndata
import joblib
import networkx as nx
import numpy as np
imp... |
d8bf468a4b6840ab1d10efa03ab5bda041bcc99677eb4781d331e364d0fbe132 | Python | 13,172 | 374 | # mypy: ignore-errors
from dataclasses import dataclass
from pathlib import Path
from typing import TYPE_CHECKING, Any
import numpy as np
import spectral as sp
import xarray as xr
from numpy.typing import NDArray
from PIL import Image, ImageOps
from siapy.core.exceptions import InvalidFilepathError, InvalidInputError... |
02b321868ead7d42579c08cb143459484a9dbbadc0acd90505e9388fa558c87d | Python | 13,179 | 258 | """
Configurations of the network_scaffold.
To add other confifuration use "elif"
"""
from __future__ import print_function
import numpy as np
def get_connectivity_and_synapses_matrix(NAME, SI_units=True, number=3):
# creating empty arry of objects (future dictionnaries)
M = np.empty((number, number), dtype=o... |
e8e7d5197c0f8c5fccb4d27dac4099c1f64486f999354c30132bc7cb834b5221 | Python | 13,180 | 325 | """
For each train-test experiment, train a model based on predetermined parameters
@author: Haowen Zhou and Siyu (Steven) Lin, Oct 17, 2023
"""
# In[0] Dependencies and Library Configurations
from __future__ import print_function, division
import torch
import torch.nn as nn
import torch.optim as optim
from torch.op... |
f3da0e28a97996a3c65540f990ce0ed64bbca5861d0590630dbebd7e56a8569d | Python | 13,186 | 397 | import os
import tempfile
import unittest
import numpy as np
import pytest
import torch
from torch import nn
import pfrl
from pfrl.agents import trpo
from pfrl.envs.abc import ABC
from pfrl.experiments import (
train_agent_batch_with_evaluation,
train_agent_with_evaluation,
)
from pfrl.experiments.evaluator i... |
d12646dff7d0ed5cc7087424c0e2607508e55756b5933cc79331158b097e97e8 | Python | 13,187 | 312 | from enum import IntFlag
from itertools import product
from prettytable import PrettyTable
import sys
import os
from typing import List
from omegaconf import OmegaConf
import omegaconf.dictconfig
import omegaconf.listconfig
import time
import logging
import pynvml
import subprocess
from subprocess import PIPE,Popen
imp... |
7e1082c279970f4764ed232e0c300d08ef0181cdc75c753eb550000c0b338645 | Python | 13,189 | 299 | # Copyright 2023 Katherine Crowson, The HuggingFace Team and hlky. 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
#
# ... |
4c88d17974ac1ab339cce634291a925dd067424ea39b9f716a3d5a1baf52a91c | Python | 13,196 | 366 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.nn import (
MessagePassing,
global_add_pool,
global_max_pool,
global_mean_pool,
)
from torch_geometric.nn.inits import glorot, zeros
from torch_geometric.utils import add_self_loops, softmax
from torch_scatter import... |
ea53c938cb5d36eeba7245093fea72f7f59211f23703b38f0a53064a082fbccc | Python | 13,198 | 346 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from convex_optim_base.optim_base import BatchParallelUnconstrainedProblem
from denoise_inverse_alg.glm_inverse_alg import FlashedModelRequiresPrecomputation
from denoise_inverse_alg.hqs_alg import BatchParallel_HQS_X_Problem
from ... |
f6ec160559247c952e7e8a365159e655159ed024aa8531144519b016476fbea9 | Python | 13,198 | 288 | # Copyright (c) 2017-present, Facebook, Inc.
#
# 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... |
7a7aeab6a621552364aae2dea79e2204f3951e6efd9bd8a335528a4fe13faad9 | Python | 13,199 | 427 | r"""
OmicVerse: A comprehensive omic framework for multi-omic analysis.
OmicVerse is a Python package that provides a unified framework for analyzing
multi-omic data including single-cell RNA-seq, bulk RNA-seq, spatial transcriptomics,
ATAC-seq, and multi-modal integration. It offers streamlined workflows for
preproce... |
c234da7a1b74844b5b3e4b5997bffca1649c57d855804e1508694bfea198a195 | Python | 13,199 | 336 | import os, time
import torch
import torch.nn as nn
from model.enlcn import ProjectionUpdater
import model.swinir as module
class Model(nn.Module):
def __init__(self, args, ckp):
super(Model, self).__init__()
print('Making model...')
self.scale = args.scale[0]
self.idx_scale = 0
... |
cc9f367f3e7940b03e02209008527d5149e23018a8c20781a3cc45f6d5136972 | Python | 13,203 | 432 | # -*- coding: utf-8 -*-
"""
Created on Sun Jul 1 15:42:00 2019
@author: ju-bar
Image data access tools
This code is part of the 'emilys' repository
https://github.com/ju-bar/emilys
published under the GNU General Publishing License, version 3
"""
#
from numba import njit # include compilation support
import numpy as... |
62aa31000d9c82afaf490220c7e1556c8275207852d34d524653ee40a0a787b3 | Python | 13,208 | 435 | # flake8: noqa
"""
Code examples for the asyncio best practices guide.
All examples are structured to be runnable and demonstrate key concepts.
"""
# __imports_begin__
from ray import serve
import asyncio
# __imports_end__
# __echo_async_begin__
@serve.deployment
class Echo:
async def __call__(self, request):
... |
55efc9329070dc11118b4fda4f77354b83ae5e15766b703434a5add8ecd4cf8e | Python | 13,209 | 314 | # encoding: utf-8
r"""
This module contains implementation of vision related sheets.
"""
import numpy
import mozaik
from parameters import ParameterSet
from pyNN import space
from pyNN.errors import NothingToWriteError
from mozaik.sheets import Sheet
logger = mozaik.getMozaikLogger()
class RetinalUniformShee... |
303415a126bc6d2b343e14541fd12142a9b7f584f655ba31e821da9efebd4465 | Python | 13,216 | 238 | # encoding: utf-8
import pickle
import numpy
from scipy.interpolate import NearestNDInterpolator, CloughTocher2DInterpolator
from mozaik.core import BaseComponent
from mozaik import load_component
from parameters import ParameterSet
from mozaik.connectors.modular import ModularSamplingProbabilisticConnector, ModularSam... |
be7917f60975872a9c024914adc21c81f1f07d71d1f5146dcda4e602816073c0 | Python | 13,218 | 340 | # Ultralytics YOLO 🚀, GPL-3.0 license
import contextlib
import glob
import inspect
import math
import os
import platform
import re
import shutil
import subprocess
import urllib
from pathlib import Path
from typing import Optional
import cv2
import numpy as np
import pkg_resources as pkg
import psutil
import requests
... |
79dd9b8f06a5fc3fbeadce8a4df1ea97a73a451f2c5037c2e36175579a0b034f | Python | 13,220 | 377 | """
This script outlines the class for the metadata subGUI, which allows
users to modify names and group of variables.
***
built as part of the Russell Ray Lab Breathing And Physiology Analysis Pipeline
***
Breathe Easy - an automated waveform analysis pipeline
Copyright (C) 2022
Savannah Lusk, Andersen Chang,
Aver... |
e0637d39c205bd859d5018915db9ba836da618af0bcbf0ef05ae03c9453b1622 | Python | 13,229 | 282 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
4091d9618973a6b1ee692a526b3453eb5f33f30d94957e482da5aa7c0c4b732f | Python | 13,231 | 400 | """Data transformation and normalization utilities."""
import re
import logging
from typing import Dict, List, Optional, Tuple, Union
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
import pandas as pd
from src.models.protein import Protein
from src.models.structure import Structure
... |
c7e5344dc39c7595d4cfc319661e892949ddc3b840ec03a4005e8c25965c3403 | Python | 13,237 | 289 | import numpy as np
import os
import json
from scipy.stats import chi2_contingency, wilcoxon, mannwhitneyu, shapiro, linregress
from ..io import SAVED_DIR, RESULTS_DIR
from ..analysis import find_response_range, parse_activity, find_stimulus_range, find_response_time, binarize_inputs, binarize_outputs
from tqdm import ... |
9e086a1398bf0f57a22d08ab1b2c7e88d6ee415bd0ce9d538f1ed27fdecfc229 | Python | 13,242 | 418 |
from tensorflow.keras.layers import (
Input,
Conv1D,
MaxPooling1D,
Dropout,
BatchNormalization,
Activation,
Add,
Dense,
GlobalAveragePooling1D,
)
import tensorflow as tf
from tensorflow.keras.models import Model
import numpy as np
def PCLR_model() -> Model:
"""
Builds and ... |
f58264d75ab632154e3d40f2868180b867770e072a9c72af5266cfcca2bbe7dc | Python | 13,247 | 341 | """Diagnostic and repair helpers for agent-generated code.
Extracted from ``analysis_executor.py`` during Phase 4 decomposition.
Contains prerequisite checking, pattern-based error recovery (Stage A),
package management, LLM-based error diagnosis, and output validation.
All functions receive an explicit ``ctx`` (Agen... |
ce60d19ed05924685e2af29ee6de7c00d756e583974a77241730a58bc457e94a | Python | 13,256 | 321 | import argparse
import cloudpickle
import collections
import json
import os
import scipy.stats
import nibabel as nib
import numpy as np
import pandas as pd
import tensorflow as tf
from experiments.keras.models.alzheimer_disease_cnns import AlzheimerDisease2DCNN, AlzheimerDisease3DCNN
from experiments.keras.models.bra... |
6e9ddb94b8d3c14d8148ec60166631674aaba7e49e7ca7e8f9da6af968f244e1 | Python | 13,268 | 361 | ''' Plotting event-related averages per stimulus duration '''
import os
import glob
import nibabel as nb
import numpy as np
import subprocess
import pandas as pd
import re
import matplotlib.pyplot as plt
import seaborn as sns
import sys
# Define current dir
ROOT = os.getcwd()
sys.path.append('./code/misc')
from find... |
9ade21c3d4777cee503d4e2d08cf20ec7bf46df10773a0e95e6566031cc7ba05 | Python | 13,274 | 357 | import torch
import torch.nn as nn
import torch.distributed.distributed_c10d as dist
from typing import Dict, List, Sequence, Union, Tuple, Optional
from torch.nn import functional as F
from monai.networks.blocks import SubpixelUpsample
from src.networks.vqvae.vqvae import VQVAEBase
# Isolated baseline implementati... |
b5d77e049855549fbd63f8c9b928e7cb32fa33af5dda028c2bd6241ae438372d | Python | 13,274 | 268 | import copy
import logging
import os
import platform
import shutil
import socket
import statistics
import sys
import tempfile
from typing import Any, Dict, List, Optional, Union
import mlflow
import optuna
import transformers
from optuna.trial._frozen import FrozenTrial
from optuna.trial._trial import Trial
from seqev... |
dd8cb434eed2a0ccb4cb8204345764c56d717254223a528fcb0595a9ba108ca8 | Python | 13,278 | 300 | """Recurrent multicellular structure — niches.
A niche is a composition that repeats: the same mix of cell types, found in
several places, doing the same job in each. Issue #760 asked for three flavours
of this and they turn out to be three different questions.
**Spatial niche.** Describe every spot by *what surround... |
7e3996af9bdd86f6b706d4439b043addccf58a6cc1a3aa73525643442e6ff477 | Python | 13,279 | 340 | import elephant
import warnings
import numpy as np
import quantities as pq
from parameters import ParameterSet
from scipy.optimize import curve_fit
from mozaik.storage import queries
from mozaik.analysis.analysis import Analysis
from mozaik.analysis.data_structures import SingleValue, SingleValueList
from mozaik.tools.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.