sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
cb881749d9e0b82face0e564aabf0399d2d919265544e82ce207759226abc192 | Python | 19,234 | 521 | """
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.
ASE calculator wrapper for nvalchemiops DFT-D3(BJ) corrections.
"""
from __future__ import annotations
import io
import re
import tarfile
fro... |
17b5e0ab0c579dc4b1e2fcb49a30c8704551798c6b138b29023297afcb736d3e | Python | 19,242 | 463 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=broad-except
# pylint: disable=invalid-name
# pylint: disable=line-too-long
# pylint: disable=multiple-statements
# pylint: disable=too-many-lines
#-------------------------------------------------------------------------------
'''
This program imputes ... |
4ba2df172d74cb2025362ba10d874baae887bf844e87d9fc1bb7bdb7f67b32af | Python | 19,246 | 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.
OMol Evaluation Recipes
========================
This module provides evaluation recipes for various molecular property tasks proposed in the ... |
f1c5275fab6115d272bbb873dd8c57dcee63aef1e52510c8faeb9351b1577d08 | Python | 19,246 | 531 | #
# 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... |
3114594a319e15486401787b8354de9d4a125d1e594a380e8e87978a2e5383d5 | Python | 19,250 | 425 | """CellChat cell-cell communication inference (vendored pyCellChat, R-parity pipeline).
``run_cellchat`` reproduces the standard R CellChat workflow::
subsetData -> identifyOverExpressedGenes -> identifyOverExpressedInteractions
-> computeCommunProb(type = "triMean") -> filterCommunication
-> computeCommu... |
559f2eee53c97c9ae889a33bbd3ba3ed489890e12bce287a0ca23b7ad544b47c | Python | 19,251 | 507 | import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import numpy as np
tf.random.set_seed(1)
import time
import math
import random
from tensorflow.keras.models import load_model
from model_layers import... |
282d8564814dc3f6187d5d6515a8879985cdf8bafc1a2dce8257a50345462198 | Python | 19,276 | 433 | from reval.best_nclust_cv import FindBestClustCV
from reval.relative_validation import RelativeValidation
from sklearn.model_selection import ParameterGrid
import multiprocessing as mp
import logging
import numpy as np
import itertools
from sklearn.cluster import AgglomerativeClustering
logging.basicConfig(format='%(... |
9c007c5e46307b9af1bca99b3c3cf664b47b17f65f41cc2ed41d047191f2c023 | Python | 19,277 | 431 | import networkx as nx
import numpy as np
import pandas as pd
#import cvxpy as cvx
cvx_install = False
def cvxpy():
global cvx_install
try:
import cvxpy as cvx
cvx_install=True
except ImportError:
raise ImportError(
'Please install the cvxpy: `pip install -... |
a7645a79f66539e1ec5ba9dd9e99e057ecd669080b391effce1533d2b58ebbbe | Python | 19,279 | 374 | # -*- coding: utf-8 -*-
#from __future__ import print_function
"""
Created on Mon Apr 4 15:32:35 2016
@author: fwinkler
"""
import numpy as np
import re
import os
class WavimgPrm(object):
"""
Wavimg object that can be used to load, modify and save a wavimg parameter
file for the Dr. Probe software pac... |
ca742c2b657671c62b66555ac7049c596d513cb1b252d7a0527a2b66d057e6ba | Python | 19,280 | 442 | ####################################################################################################
# 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... |
26c5ace1d0990f64681b0688fd1aa6eaca8c68fa0d13df724b178a2c92267cd6 | Python | 19,290 | 486 | """Hermetic test for the in-repo ``llms_txt`` Sphinx extension.
Builds a tiny Sphinx project in a temp dir (in-process, no network, no Ray
import) that exercises:
* a toctree-structured index (``## Section`` per root toctree entry),
* all three description sources (MyST ``html_meta``, RST ``.. meta::``, and the
fir... |
b7e3cbf3bdaee277dee90705873a26a211a15bad036b5780b10886c886d2fd4f | Python | 19,293 | 474 | ####################################################################################################
# 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... |
9320ba6de5f91012375289a9556c0e8af4b6eb8c413c5ef4cb9ade1bc48aa0c9 | Python | 19,295 | 662 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=broad-except
# pylint: disable=invalid-name
# pylint: disable=line-too-long
# pylint: disable=multiple-statements
# pylint: disable=too-many-lines
#-------------------------------------------------------------------------------
'''
This software has bee... |
8fdb522712afae9723d10c64f59ae3c9ac602aaff08a52f3b2d8c6e02bb5b100 | Python | 19,297 | 570 | import dataclasses
import functools
import logging
import queue
import threading
import time
from typing import (
Any,
Callable,
Generator,
Generic,
Iterator,
List,
Optional,
Tuple,
TypeVar,
)
import ray
from ray.actor import ActorHandle
from ray.data._internal.batcher import Batche... |
3bef156421c47a077afae9a6823f10865f49a206e8fe08d751b03e34b7502ba0 | Python | 19,298 | 594 | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 25 21:35:23 2023
@author: Leyang Xue
"""
import sys
import matplotlib.pyplot as plt
import numpy as np
# Add package path
packagepath = '../kcorePercolation' # Manually specify the path to your script
sys.path.append(packagepath)
from utils import kcorePercolation as kp... |
0d62e17a7d7f2637b4ed27d6a96c8e313c03c46964b0f991aec9d2294acbf00a | Python | 19,304 | 464 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=broad-except
# pylint: disable=invalid-name
# pylint: disable=line-too-long
# pylint: disable=multiple-statements
# pylint: disable=too-many-lines
#-------------------------------------------------------------------------------
'''
This program imputes ... |
eb27e3dbc524a5252301e21835fb063ec7e1794eb4b252184c1a8a48a047b4aa | Python | 19,341 | 467 | import numpy as np
import pandas as pd
import more_itertools as mit
import os
import logging
logger = logging.getLogger('telemanom')
class Errors:
def __init__(self, channel, config, run_id):
"""
Batch processing of errors between actual and predicted values
for a channel.
Args:
... |
2b7f94bdc246bf147ab52511a225ddaf5702a817036a74a6133c41707de09c44 | Python | 19,344 | 456 | # coding=utf-8
# Copyright 2023 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... |
216989709d929d9b15fb942324a06cc44670284f18079fda3d3fce8b09056ee5 | Python | 19,355 | 425 | # Copyright 2023 Zhejiang University Team 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
#
#... |
c54cb2e982ccc01f70de596ec70954055972c995f7315c3755138ea991766b58 | Python | 19,356 | 454 | from __future__ import print_function, unicode_literals, absolute_import, division
from six.moves import range, zip
from ..utils.tf import keras_import
Input, Conv2D, Conv3D, MaxPooling2D, UpSampling2D, MaxPooling3D, UpSampling3D, Activation, Lambda, Add, Concatenate, BatchNormalization, Dropout \
= keras_import('... |
756d91a4eedaf8b8ee6f65232e19f8035b3e43cdd3ed1ff588bf0d6bf348786b | Python | 19,363 | 514 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import rcParams
from .._registry import register_function
def _build_upset_intersections(sets, min_size=1):
names = list(sets.keys())
normalized = {name: set(values) for name, values in sets.items()}
records = []
... |
d6232ecb9a9dbab1cc5631a131b36ae12b237d09a4c07d5c4079518a3014280d | Python | 19,364 | 534 | """ Callbacks for calculating scores."""
from contextlib import contextmanager
from contextlib import suppress
from functools import partial
import warnings
import numpy as np
import sklearn
from sklearn.metrics import make_scorer, check_scoring
from skorch.callbacks import Callback
from skorch.dataset import unpack... |
0f8b78cd6592b6bbfb77e3d2ffd1a5bfb3e872d27b3b7dde0dff6b8f2e71580b | Python | 19,368 | 538 | # coding=utf-8
# Copyright 2023 HuggingFace 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 ag... |
c40e17119331fa4ad85a2cb2e14c4ce3b5f614c5ffaf519b2a429721e81fbf0d | Python | 19,370 | 521 | import json
import logging
from typing import List, Optional
from aliyunsdkcore import client
from aliyunsdkcore.acs_exception.exceptions import ClientException, ServerException
from aliyunsdkecs.request.v20140526.AllocatePublicIpAddressRequest import (
AllocatePublicIpAddressRequest,
)
from aliyunsdkecs.request.v... |
0ac556fe996b0298772575f0388f26713517840dcb9912552f66d306e5f97b7e | Python | 19,371 | 592 | """Rendering utils"""
from typing import Literal, Optional, Tuple, Union
import numpy as np
import torch
import torch.nn.functional as F
from PIL import Image
import flyvis
def median(
x: torch.Tensor,
kernel_size: int,
stride: int = 1,
n_chunks: int = 10,
) -> torch.Tensor:
"""
Apply media... |
5e9d00527daff76cbeec0cec2916b9d6eb1174e73f371ce91470ae8b5c1c1293 | Python | 19,371 | 472 | """
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.
Genarris Output Processing and Initial Deduplication Module
This module handles the complete processing pipeline for raw Genarris structure ge... |
5cc110bd5ba0b77295b122da439f5adf5c46689f792e634bf532ac7cece8b78b | Python | 19,388 | 570 | # 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... |
9306c29e2a858c9716d58127485f9148fa1e78898ab7719b58a2e904712b2bc6 | Python | 19,412 | 362 | import inspect
import multiprocessing
import os
import socket
from dataclasses import dataclass
from functools import partial
from typing import Callable, Optional, Union
import torch.cuda
import torch.distributed as dist
import torch.multiprocessing as mp
from batchgenerators.utilities.file_and_folder_operations impo... |
3f95d072d2e2f1cb0eeda05aa0a85e8092f6e4380b35ec382d8315011e1b5063 | Python | 19,417 | 570 | # Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
from __future__ import annotations
import traceback
from abc import ABCMeta, abstractmethod
from collections.abc import Callable
from types import NoneType
from typing import TYPE_CHECKING, Any, ClassVar, Protocol
import attrs
import django_rq
from... |
2172a9eb98d5285d831c7cea2b7ed5fb132bc74aae59c294a1e8b07228b4cc23 | Python | 19,430 | 518 | import pickle
from itertools import chain
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
Iterator,
List,
Optional,
Tuple,
Union,
)
import pyarrow as pa
from ray._common.retry import call_with_retry
from ray.data._internal.arrow_ops.transform_pyarrow import (... |
3fc21956a40952030c8e33bb9e36a73f5f3d697ae50fbf4460a10da1407cf5e2 | Python | 19,442 | 551 | import numpy as np
import matplotlib.pyplot as plt
from copy import deepcopy
from tqdm import tqdm, trange
from scipy.ndimage import gaussian_filter1d
from typing import Callable
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
import torch.optim as op... |
4c3d7fa461d54e65e1c8123597b04bbbbc7189b1a4f2080ae9affed11a6adf39 | Python | 19,443 | 561 | """
The following code is a modification of a k-means based reclustering algorithm first published at https://github.com/BigDataBiology/SemiBin
The original code is distributed under MIT License.
"""
import os
import subprocess
import sys
import contextlib
from sklearn.cluster import KMeans
import numpy as np
from col... |
81b6c79f00beaa6a90a4f5db9fe243c8c93fc23c5feffce3c3ef94d08a6cca46 | Python | 19,450 | 420 | # Ultralytics YOLO 🚀, GPL-3.0 license
import contextlib
import hashlib
import json
import os
import subprocess
import time
from multiprocessing.pool import ThreadPool
from pathlib import Path
from tarfile import is_tarfile
from zipfile import is_zipfile
import cv2
import numpy as np
from PIL import ExifTags, Image, ... |
b4c1c99d33c617327b69aa598cc0c2c06a7fca9dc21ccdbdea92474ca5fb8819 | Python | 19,464 | 521 | import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import numpy as np
import random
random.seed(10)
import time
import math
import typing
import warnings
class mha(tf.keras.layers.Layer):
r"""MultiHead Attention layer.
Defines the MultiHead Attention operation as described... |
b60c4873ac4dad17ce63c85daeadba0fcd6d1f5486a43074d34a27c1bad17ca9 | Python | 19,471 | 528 | import gc
import logging
import sys
import time
from contextlib import ExitStack
from pathlib import Path
from typing import List, Optional, Tuple
import click
import h5py
import numpy as np
import pandas as pd
from tqdm import tqdm, trange
logging.basicConfig(
format="[%(asctime)s] %(levelname)s:%(name)s: %(mess... |
d0f758ebc4a88ff85002ce5df4e54a958c613e0c5550280848ab83ad1a233ae5 | Python | 19,476 | 491 |
import gym
import numpy
import random
import os
from gym import error, spaces, utils
from gym.utils import seeding
from matplotlib import pyplot
from collections import OrderedDict
import gym_sted
from gym_sted import rewards, defaults
from gym_sted.utils import SynapseGenerator, MicroscopeGenerator, get_foreground,... |
79faf1cea595cd577f324a4647b6a31cc5093d13fb63210eebba8dd80d986752 | Python | 19,477 | 540 | import io
import os
import shutil
import sys
import tempfile
import time
import types
import zipfile
from pathlib import Path
from typing import Dict, Optional, Tuple
from unittest.mock import AsyncMock, MagicMock, Mock, patch
import aiohttp
import pytest
import ray.experimental.internal_kv as kv
from ray._common.tes... |
36b52575c957f7469005e8da4fbd9fcb8575c63f28756aea1026dd3ebc49c865 | Python | 19,510 | 401 | # updated 19/11/2022
# updated 19/11/2022
import logging
from datetime import datetime
from agent.classifiers.ffnn_classifier import ffnn
from agent.classifiers.data.transformer_text_triple_fc_dataset_mgmt import get_datasets
from agent.classifiers.data.transformer_text_triple_fc_dataset_mgmt import annotate_dataset... |
d1e376a7b1e967aa6bcffddf84418c7f11b6fd3a64562da8db1044dbb689b6ca | Python | 19,532 | 636 | #!/usr/bin/env python3
"""
Fully isolated SynthSeg inference script for hippocampus segmentation.
This script contains all necessary code and does not require local imports.
Author: Mahmoud Yaser (mahmoud1yaser)
"""
import argparse
import os
import time
from collections.abc import Sequence
import nibabel as nib
impo... |
15b3fc154c9e6205c5f3b560fee01baa4af4b72abe37ddf36a4fd4f56d7a9444 | Python | 19,540 | 465 | # 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... |
b1b8e927d3f4e5b1afdb3457b65d50de6531bf79718b93e751effb1868fa9463 | Python | 19,547 | 485 | import torch
from torch import Tensor
import torch.nn as nn
#from .utils import load_state_dict_from_url
from typing import Type, Any, Callable, Union, List, Optional
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',
'wide_r... |
c1f7446d1ca181be59e5a9545ffb7c9579153151e301fac95aba04011ffb4241 | Python | 19,550 | 471 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
e42ce3106a650f94aff9b4b337468d4283f2f2fad48e0d088e59f8ae7dcb30dc | Python | 19,556 | 454 | # System imports
import sys, os, re, math
import subprocess
import argparse
from PIL import Image
FILE_TYPE = '.png'
####################################################################################################
# @create_directory
###############################################################################... |
e6fd4b39a5595de4d5ae06263046134c77d463dee1d112ff0925ec6dc3acc5e7 | Python | 19,564 | 508 | # biolgca is a Python package for simulating different kinds of lattice-gas
# cellular automata (LGCA) in the biological context.
# Copyright (C) 2018-2022 Technische Universität Dresden, Germany.
# The full license notice is found in the file lgca/__init__.py.
"""
Interaction functions and helper functions for classi... |
4ba4282f4cab7d2e28970d44557358e1ce480a986c455fc64e8fa626bd849182 | Python | 19,569 | 376 | #!/usr/bin/env python
import sys
import argparse
import gzip
from pysam import VariantFile, VariantRecord
from sv_utils import genomics_io, get_truth_overlap
from typing import List, Text, Optional, Dict, Iterable
SIZE_BINS = [50, 500, 5000]
SIZE_BIN_LABELS = ['SMALL', 'MED', 'LARGE']
# non veriant genotypes (ta... |
31224869c08da5cd0f88a52b53c85bc06abd69ed780c7dd944eafe181b7b43ed | Python | 19,580 | 448 | from __future__ import annotations
from dataclasses import dataclass
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.api as sm
import statsmodels.formula.api as smf
from scipy.io import loadmat
from scipy.stats import pearsonr
from statsmodels.stats.a... |
6ab0d9da657590ec76f10b034f64c38224eeb13ce64d9847340647608d067fe2 | Python | 19,585 | 479 | """ This module contains only the train method """
from network import Noise2NoiseUNet3D, init_weights
from dataset import N2VDataset3D
from transformations import *
import utils
import torch
import torch.nn as nn
# to store the data as tif file (here only the validation result are stored as tiff)
import tifffile
f... |
6734b12b89fa02bd62785be767f728b429aa16eb94feba14b0b0fd53cfcb4067 | Python | 19,593 | 575 | from typing import Tuple, List, Dict, Callable
from collections import OrderedDict
from argparse import ArgumentParser
import pandas as pd
import numpy as np
from tqdm import tqdm, trange
from rdkit.Chem import MolFromSmarts, AddHs, MolFromSmiles, SanitizeMol, Mol, CanonSmiles, MolToSmiles, RemoveHs, RWMol, GetFormalC... |
c589ce71b44aeefe1186de3103bc4038765a4ab40300d8da784abb2473814ca6 | Python | 19,600 | 488 | import json
import logging
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple
from aiohttp.web import Request, Response
import ray
import ray.dashboard.optional_utils as dashboard_optional_utils
from ray.core.generated import gcs_service_pb2_grpc
from ray.dashboard.modules.job.common import JobInfoStorageC... |
d10aeabaaee49c15cc595193376fca2295f0f0a5bff8053750ceffa700b5f36c | Python | 19,601 | 382 | from typing import Callable, Tuple
import numpy as np
import torch
from torch import nn as nn
from torch.nn import functional as F
from denoise_inverse_alg.flashed_recons_glm_components import single_bin_flashed_recons_compute_coupling_exp_arg, \
mixreal_single_bin_flashed_recons_compute_coupling_exp_arg, \
m... |
d88757ec7d7302398883d10349453001eba9ec9c16bdbf1a00d68d8739c8c6fa | Python | 19,601 | 568 | import nibabel as nib
import numpy as np
import pandas as pd
import scipy.stats as sps
import multiprocessing as mp
from os import path
from copy import deepcopy
from joblib import Parallel, delayed
from nilearn.input_data import NiftiMasker
from samri.utilities import collapse
from samri.report.utilities import roi_da... |
7a43f75d0cac763c7e26432a92ad56b2107acdb2c588b41ac2e7bb31def5d63d | Python | 19,602 | 406 | # Training diffusion models built by diffusion_blocks.py
import os
import logging
from functools import partial
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
import keras
import tensorflow as tf
from ml4h.defines import IMAGE_EXT
from ml4h.explorations import predictions_to_pngs
fr... |
eabe17aba6ee23c8736d642a18616fd84902b0b361943e70105c09cf7d487e34 | Python | 19,613 | 553 | import exputils
import numpy as np
import collections
from collections import defaultdict
from six import iteritems, iterkeys # pylint: disable=unused-import
from copy import deepcopy
try:
import json
except ImportError:
import simplejson as json
class AttrDict(dict):
""" A dictionary that provides attrib... |
37d52281455688378aa5855bfaee196b6ebe44db6e5a42c2705b094399126a16 | Python | 19,616 | 543 | # built-in dependencies
import os
import json
import hashlib
import struct
from typing import Any, Dict, Optional, List, Tuple, Union
from itertools import combinations
from urllib.parse import urlparse
# project dependencies
from deepface.modules.database.types import Database
from deepface.modules.modeling import b... |
6744e1bb9f466de2f0e59c089e3b9e8823c91bc94f057a2d071614bc3cda6d90 | Python | 19,621 | 603 | ''' Main underlying functions for SpatialDE functionality.
Optimizations over the original:
- null_fits / const_fits fully vectorized (no Python gene loops)
- lengthscale_fits: batch UTy = exp_tab.T @ U, then joblib-parallel lbfgsb
- dyn_de / run accept n_jobs kwarg (default 1 = sequential)
'''
import sys
import... |
3e8d23322866f030a68de14d764726c524996cc0715f9ae1ec2584e505af37ed | Python | 19,623 | 529 | """
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.
"""
from __future__ import annotations
import contextlib
import time
from pathlib import Path
from typing import Any
import pandas as pd
from... |
f9e03fa5f2146a24603aa6219e6eb2ca302859357de9752a7f9cf481073080d4 | Python | 19,628 | 449 | """Independent NumPy/SciPy references, not a substitute for MATLAB fixtures."""
import math
import numpy as np
import pytest
import torch
from scipy import sparse
from scipy.signal import correlate2d, convolve2d
from palmnet import PalmConfig, PalmPCAGabor
from palmnet.gabor import fixed_gabor_bank, multiscale_bank, se... |
646485a43de199615c3f07100fb06e38d32e5b2153d253e7f11a8484105b9c0e | Python | 19,646 | 511 | # Copyright (c) DP Techonology, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch as th
import pandas as pd
from copy import deepcopy
from rdkit import Chem
from rdkit.Chem import AllChem... |
c882ffa0b86576906cb31f52e07a0b33e04e73f5bc9ae389146dfb1b1199fc75 | Python | 19,653 | 421 | from typing import Optional
import pandas as pd
import numpy as np
import networkx as nx
import scanpy as sc
from sklearn.linear_model import LinearRegression as lr
from matplotlib import pyplot as plt
#from matplotlib_venn import venn3
import matplotlib.ticker as ticker
from matplotlib.pyplot import rc_context
impor... |
7dbad67e7f2f3e3edda248b89282b6930c0d14bf2f3d0a3b09a61b7b0926f528 | Python | 19,655 | 652 | import os
import re
import subprocess
import sys
import tarfile
import tempfile
import threading
from concurrent.futures import ThreadPoolExecutor
from contextlib import contextmanager
from typing import Any, Iterator, List, Optional, Sequence, Tuple
import yaml
import ray # noqa: F401
from ray.autoscaler._private.c... |
31244b763e494018b5bdb43cfb0c4338fea01b14aace7f317bbac48245b35614 | Python | 19,657 | 495 | import os
import time
try:
print('SlURM_JOB_ID',os.environ["SLURM_JOB_ID"])
except:
print("no slurm id")
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
import tables
import tensorflow.keras as K
import gc
import scipy
impor... |
e74aaa663e5b000778176494226237da3975c97f5aa19cef762e8ec60cbdcd36 | Python | 19,657 | 661 | # -*- coding: utf-8 -*-
from __future__ import print_function, division, unicode_literals, absolute_import
import csv
import os
import pandas as pd
# PyBIDS 0.6.5 and 0.10.2 compatibility
try:
from bids.grabbids import BIDSLayout
except ModuleNotFoundError:
from bids.layout import BIDSLayout
try:
from bids.grabbids... |
43fdd284840daaa5758d61de04a833ebb3be5647df8f21ebdf1493e4d5f1a352 | Python | 19,664 | 495 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------
# Created By : Kangjoo Lee (kangjoo.lee@yale.edu)
# Last Updated: 08/06/2024
# -------------------------------------------------------------------------
# =========================================... |
4f5a0de1cac2eedf0341095cb0429a63ada1f5278c4933ba2bb27c82de83a68b | Python | 19,667 | 549 | import os
import math
from typing import Mapping, Optional, Tuple, Any, Union
import torch
from torch import nn, Tensor
import torch.distributed as dist
import torch.nn.functional as F
from torch.nn import TransformerEncoder, TransformerEncoderLayer
from torch.distributions import Bernoulli
from torch.utils.data impor... |
487d96da30a497c25d23aadf87c087b3fd654f282655fcbbeacd32f1dd516b2f | Python | 19,681 | 605 | """
Best-effort access to OmicVerse model/provider metadata.
"""
from __future__ import annotations
import importlib.util
import os
from pathlib import Path
from typing import Any, Dict, Iterable, Iterator, Optional, Tuple
import requests
_MISSING = object()
_MODEL_CONFIG_MODULE: Any = _MISSING
_FALLBACK_PROVIDER_E... |
06536782d7d3acb279d352c0df260787067ed986e4b1d6a41935bebc2c92a608 | Python | 19,685 | 487 | from pathlib import Path
from time import time
from collections import defaultdict
import argparse
import warnings
from tqdm import tqdm
import numpy as np
import torch
from Bio.PDB import PDBParser
from Bio.PDB.Polypeptide import three_to_one, is_aa
from Bio.PDB import PDBIO
from openbabel import openbabel
from rdkit... |
a9b44baf52459d80bc4ee6a6fd71011dfff7a3a13ede8943b43a71ad8441d3ec | Python | 19,690 | 1,127 | """
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.
CGCNN-like embeddings using continuous values instead of original k-hot.
Properties:
Group number
Period number
Electronegativity
... |
2bb61fe862d695fa68576191ffc1c0b729beca25ec1d54f63b3fd6ac8e7822e7 | Python | 19,705 | 619 | import functools
import json
import logging
import os
from pathlib import Path
import random
import subprocess
from typing import Dict, List, Mapping, Optional, Tuple, Union
import numpy as np
import torch
import pandas as pd
from anndata import AnnData
from matplotlib import pyplot as plt
from matplotlib import axes
... |
209e63b40f89ae107a378eacbd8ead4469e4a7b10122b38b451017b7f7d5a0d3 | Python | 19,750 | 506 | r"""Embeddable clustered heatmap built on marsilea.
Unlike :func:`omicverse.pl.complexheatmap` (which is PyComplexHeatmap-based and
always builds its own figure), this heatmap renders into a caller-supplied
``matplotlib`` Figure or SubFigure. That makes it usable as one panel of a
larger multi-panel figure: marsilea's... |
cd8fee5bfbe04704f0935cce04cc8df07d8ba97efe8aaca834eafa1306604f90 | Python | 19,759 | 499 | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 30 18:57:45 2022
@author: jprice
"""
"""
Gridtape Cameras - very simialr to PyAGTUM, but with most of the non-camera things commented out.
There was an attempt to make some functionality to read the barcodes but this is too slow so it
was never implemented.... |
b747945b9059cb3cb92e73c4e907146c91029f472ca270e597f51b08fa84795c | Python | 19,763 | 606 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 6 19:44:46 2024
@author: LeyangXue
"""
import sys
import matplotlib.pyplot as plt
import numpy as np
import networkx as nx
# Add package path
packagepath = '../kcorePercolation' # Manually specify the path to your script
sys.path.append(packagepath)
from utils import ... |
f8641e6ae0559fc6b37972f130aab1509f4232fc1aecc207a588f1a23c709f30 | Python | 19,806 | 543 | #!/usr/local/bin/python
"""
***********************************************
- PROGRAM: boundary2tad.py
- CONTACT: Bryan lajoie (bryan.lajoie@umassmed.edu)
***********************************************
"""
from __future__ import print_function
from __future__ import division
import sys
import argparse
i... |
b1e4539deb6df6b15b80559c01634630ea90e7e094ab4d2d77b0468c18071141 | Python | 19,808 | 444 | import logging
import math
import time
from collections import Counter, defaultdict
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional
import ray
from .base_autoscaling_coordinator import (
STANDARD_RESOURCE_TYPES,
AutoscalingCoordinator,
LabelSelector,
... |
f4f7406683df086a71112a7f21114b0ab17eea98a01a8159375d2fd8ae6def52 | Python | 19,830 | 497 | import torch
import torchvision
from torch import Tensor
import torch.nn as nn
#from .utils import load_state_dict_from_url
from typing import Type, Any, Callable, Union, List, Optional
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',... |
51f478b903141afa92346c54bebc4c1e5fd70a0d6aa7a7c717adfa2d96c3f43e | Python | 19,853 | 506 | # 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... |
4db77c66d17b085a255a474add580814283298d18d0e30b183065fdf7cd34a18 | Python | 19,870 | 578 | import os
import re
import subprocess
import sys
from datetime import datetime
from typing import Callable, List, Optional
import requests
from dateutil import parser
import docker
from ci.ray_ci.automation.crane_lib import (
CraneError,
call_crane_copy,
call_crane_index,
call_crane_manifest,
)
from c... |
1ede6b3c2278832c034d10b6c61a0e2d387f72cf2f2a4be510dab2db59856456 | Python | 19,874 | 494 | ####################################################################################################
# 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>
#
# The code in this fi... |
7e5c39a667d8453f2d1403a924a4cf893ffeb3fc8fa87c904ac9b2990f18eb30 | Python | 19,877 | 448 | # Ultralytics YOLO 🚀, GPL-3.0 license
import math
import os
import platform
import random
import time
from contextlib import contextmanager
from copy import deepcopy
from pathlib import Path
import numpy as np
import thop
import torch
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional ... |
d2ec1b6b6814a79ba53b61f5df627fe4a23fee1e73b455e24874a9fae539941e | Python | 19,885 | 580 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=broad-except
# pylint: disable=invalid-name
# pylint: disable=line-too-long
# pylint: disable=multiple-statements
# pylint: disable=too-many-lines
#-------------------------------------------------------------------------------
'''
This source contains ... |
5be4e041907fc38646aee0211fd778ed97d60fc073855eabd3ec71149fdff0b8 | Python | 19,892 | 358 | """
Context-belief- and/or history-based agent
by Aditya Gilra, Sep-Oct-Nov 2021
"""
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy.io as scipyio
import scipy.stats
import sys
from utils import process_transitions, get_switchtimes
# number of steps on each side of the trans... |
d23e21bceb7ffe56021f8e0fb0b2b5c1c22e212d9832d11a6052434bc8586de4 | Python | 19,898 | 488 | import torch
import numpy as np
from typing import Tuple, Union
from convex_optim_base.optim_base import SingleProxProblem, BatchParallelProxProblem
class ProxSolverParams:
pass
class ProxFixedStepSizeSolverParams(ProxSolverParams):
def __init__(self,
initial_learning_rate: Union[float, t... |
ae14bb8d96c8492a8d78094634a3afbb9c0d6b40e53f071eb963d62604fd7dec | Python | 19,902 | 465 | """NumPy/SciPy re-implementation of the R CytoSignal pipeline (Liu et al., Nat Genet 2026).
Mirrors the default workflow of the R package (v0.5.1)::
removeLowQuality -> changeUniprot -> inferEpsParams -> findNN
-> imputeLR -> inferIntrScore -> inferSignif
Orientation: matrices are **cells x genes** here (R u... |
ddd161a3c07f3c07dbdb2baef19e6bcbd49de071ea2ca1a0fcebc7c1c457b0d7 | Python | 19,915 | 527 | import warnings
from typing import Optional, Sequence, Union
import torch
from torch import Tensor
from rising.random import AbstractParameter
from rising.utils.affine import (
deg_to_rad,
get_batched_eye,
matrix_revert_coordinate_order,
matrix_to_homogeneous,
points_to_cartesian,
points_to_ho... |
4ac482bf1bdba3f88db9ed28a6219c03db4e847d5e23aaed2c518920476e7b05 | Python | 19,922 | 518 | r"""On-demand database fetchers for KEGG / LION / HMDB.
The tiny curated CSVs shipped with omicverse (``data/kegg_pathways.csv``,
``data/lion_subset.json``, ``data/metabolite_lookup.csv``) cover the
tutorial datasets but are obviously too small for real analysis:
======= ================ ======================== =... |
e2c2eb27cc41d060e010f12ac1f4d372b7c29a6ea05e9500d80075021e957a13 | Python | 19,928 | 510 | # 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... |
3e02f6c7057e7804a8ca23fe7a26ab83677aeee194d76be2218a6687c70f4cd0 | Python | 19,938 | 455 | from os import path, remove
from samri.pipelines.extra_functions import flip_if_needed, get_data_selection, get_bids_scan, write_bids_metadata_file, write_bids_events_file, write_bids_physio_file, BIDS_METADATA_EXTRACTION_DICTS
import os
import argh
import re
import inspect
import json
import os
import shutil
import t... |
cf4b365f9a75889c8f0102644dac627433f33b154e6d189c47132dd5cb7a7338 | Python | 19,944 | 565 | from __future__ import annotations
import logging
import math
from typing import TYPE_CHECKING
import torch
import torch.nn.functional as F
from e3nn.o3._spherical_harmonics import _spherical_harmonics
if TYPE_CHECKING:
from fairchem.core.datasets.atomic_data import AtomicData
from fairchem.core.models.allsc... |
5847a17329c46747019f39e1c66481e66181a8dadd70b75b002a9e761d73e000 | Python | 19,954 | 493 | """Pick the most reproducible Leiden resolution via null-adjusted
bootstrap-ARI stability — ``ov.single.autoResolution``.
Implementation follows Lange, Roth, Braun & Buhmann (*Neural Computation*
16(6):1299–1323, 2004), "Stability-Based Validation of Clustering
Solutions". The core observation is that bootstrap stabil... |
9c0dc9d16032f3f50ad2c80c4de973a2b827a135cc758517323ce17256fc43d9 | Python | 19,960 | 453 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 1 16:14:53 2022
@author: joern
"""
# https://coderzcolumn.com/tutorials/machine-learning/scikit-learn-sklearn-feature-selection
# %% imports
import os
os.chdir("/home/joern/Aktuell/PaclitaxelPainLipidomics/08AnalyseProgramme/PaclitaxelNeuropathyPr... |
9ff44495a7879bac5e0068be51266c7b443437a93fd70488e98fadb70204277a | Python | 19,960 | 405 | # Copyright 2023 Stanford University Team 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
#
#... |
65fef2722aaeeea3413bec83ff6574ded82d859455a355aac97d34314115221b | Python | 19,962 | 200 | import numpy as np
from rdkit import Chem
import torch
# ------------------------------------------------------------------------------
# Computational
# ------------------------------------------------------------------------------
FLOAT_TYPE = torch.float32
INT_TYPE = torch.int64
# --------------------------------... |
32186243c683e1e80f059532995bc3964b9939799dee3329f7fd062714bf7bd9 | Python | 19,964 | 459 | import pandas as pd
import sys
import numpy as np
import os
from collections import defaultdict
import json
from itertools import product
import ray
from itertools import combinations
os.environ['RAY_worker_register_timeout_seconds'] = '60'
@ray.remote
class RCS_finder():
'''
This is a python class that c... |
f02c86bbb78e55a900889f1ab5a4bc9c51074df6d4ded832959319263eed94d1 | Python | 19,964 | 465 | from __future__ import print_function
import time
import numpy as np
import tensorflow as tf
from tensorflow.contrib.tensorboard.plugins import projector # for 3d PCA/ t-SNE
from .tensorboard_util import *
start = int(time.time())
# clear_tensorboard()
set_tensorboard_run(auto_increment=True)
run_tensorboard(rest... |
ad7da61ee9974dcad272d24e6da2d8ca8e99004fea9add2c7493bc5d013e3d82 | Python | 19,981 | 465 | """In-memory store for task events on the dashboard head.
Events from the same task attempt (same task id + attempt number) are merged into a single
``TaskEvents`` entry. The store is bounded by ``MAX_NUM_TASK_EVENTS``; when full, entries
in lower-priority tiers are evicted first (see ``gc_policy``). Per-job bookkeepi... |
35d97eb0073634714183ae780e72d50dcc78efa3d5c5c07bd11449b363e570af | Python | 19,986 | 533 | """
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.
"""
from __future__ import annotations
import unittest
import torch
from fairchem.core.models.uma.common.so3 import CoefficientMapping
from ... |
d027d365b07ff8ff42f73445a3a89abc1eb5f780a1154551be94d022cb2c9d94 | Python | 20,011 | 435 | from typing import Iterator, Callable
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
from matplotlib.collections import PatchCollection
from scipy.spatial.distance import euclidean
from scipy.spatial.qhull import Delaunay
from scipy.spatial import Voronoi
from scipy.spatial... |
4a221dc037640ff6b2dd0dae0fd75efd45e68e767a548028974d0cc90f9135ff | Python | 20,019 | 517 | # 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... |
3fb601551ae3dca03943f5d97316f250040bdcaf831ff9063070f998655dbde3 | Python | 20,024 | 584 | import numpy as np
import nir
from tests import mock_affine, mock_delay, mock_integrator, mock_linear, mock_output
def test_has_version():
assert hasattr(nir, "version")
assert hasattr(nir, "__version__")
def test_has_NIRNode():
assert hasattr(nir, "NIRNode")
def test_eq():
a = nir.Input(np.array... |
cc55b8446e01fc497ea1da26ca200e2db70c4ea9cade8482f3786148063787b6 | Python | 20,024 | 527 | # Copyright 2024 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, ... |
d1191fd048b26bf54732893f8c4f2e723a2e168687982cecaf526589d1bf88af | Python | 20,030 | 492 | import json
import logging
import os
from typing import Dict, Optional, Tuple
import ray
import ray._private.ray_constants as ray_constants
from ray._common.constants import HEAD_NODE_RESOURCE_NAME, NODE_ID_PREFIX
from ray._common.utils import (
RESOURCE_CONSTRAINT_PREFIX,
env_bool,
get_cgroup_aware_swap_m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.