sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
f1f4aa8bc3a5608e1e500c1671c8995d8c5f19a5f4404ace0977a2c206259519 | Python | 9,645 | 262 | # @String(visibility="MESSAGE",value="<html><div WIDTH=600>This script tags particles according to skeleton features: It detects maxima on a masked image and clusters detected maxima using features of the mask-derived skeleton. A maxima is considered to be associated to a skeleton feature (junction, tip, etc.) if the d... |
7fe0c7e222550a78e03543300305083e2dd6acc98d0c40af89cc38003b1fb484 | Python | 9,646 | 276 | """
Performs rotation simulations for all hypotheses.
"""
from utils.grid_funcs import (
gridpop_clustering,
gridpop_repsupp,
gridpop_conj,
rotate_traj,
gen_offsets,
traj
)
from utils.utils import get_hexsym, get_pathsym, convert_to_rhombus
import numpy as np
import pickle
import os
import setti... |
e7033d8b95f3873006c58549c655625aa56f3180041070aa353f8e9c1534d79b | Python | 9,646 | 267 | ####################################################################################################
# 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... |
68c574ade173bf7eb76ff26c455f88867ba5cc04fcfe3929f2e073d85f9979f4 | Python | 9,648 | 249 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 8 18:37:21 2022
@author: pbolan
"""
import numpy as np
from os import path, makedirs
import sys
import glob
import pandas as pd
import nibabel as nib
import matplotlib.pyplot as plt
from skimage import filters
import seaborn as sns
from utility_f... |
8c59dc32fd2a5c5f2e9a83095287d74424f4ea032fdcd43ccef6e9b4a8a6ae3b | Python | 9,649 | 214 | from model.models import PepCA
from model.models import PeptideComplexes, PepCA_dataset
from time import time
import numpy as np
import torch
import argparse
import torch.nn.functional as F
import datetime
import os
import random
import pickle
from tqdm import tqdm
from sklearn.metrics import roc_auc_score
device = 'cu... |
da14dc46dee7f3f2cbc19c326ff4f1f82ff426cb348bae13b267b7c9b5cb1ea2 | Python | 9,658 | 286 | from glob import glob
from os.path import *
import os
import sys
import re
import log
from Bio import SeqIO
import gzip
logger = log.setup_logger(__name__, log.get_config())
ROCHE_FILE = '\S+?(?:__[0-9]){0,1}__(?:TI|RL)\d+__\d{4}_\d{2}_\d{2}__\w+.(sff|fastq)'
'''
Matches roche sff or fastq files
sample__region__barc... |
74a0490063ba38d8f39f4f196da3cade7f7c9054eb29cded7d5961da652bdffc | Python | 9,662 | 269 | import random
import os
from progress.bar import Bar
from pyfaidx import Fasta
SEQ_LENGTH = "800"
QUARTER_SEQ_LEN = int(SEQ_LENGTH) // 4
EACH_JUNC_PER_LOCUS = 20
MIN_JUNC = 200
MAX_JUNC = 20000
'''Obtain chromosome size'''
def get_chrom_size(path):
chrs = {}
with open(path, 'r') as file:
# rea... |
b68651086f9a5ee2eca3ebed8225aeb6ce0226c35be3fb84b9936cac37d858b2 | Python | 9,663 | 305 | """Convert XML (VOC) style annotations to coco format.
Note: If the image does not have annotations, it will be filtered.
Examples:
python tools/dataset_converters/xml_to_json.py \
${DATASET_NAME} \
${PATH TO XML ANNOTATIONS} \
${PATH TO IMAGES} \
${ANNOTATIONS FILE} \
--out-dir ${OUTPUT FILE ... |
9a6c48f83da50376942e3ca427ef17312e417fa11e4c5439197a54d8aa33f64e | Python | 9,667 | 225 | #!/usr/bin/env python
import sys
from typing import Sequence, Set
import argparse
import numpy
import pandas
_zero_svs_are_outliers = True
_outlier_std_threshold = 5.0
_column_order = ["CHROM", "SVTYPE", "Mean", "Median", "STD",
"Outlier_Sample", "Outlier_Number", "Outlier_Cate"]
def read_statfile... |
774568176a77cdf718ec35c7899cf3ac2fd23a66e3ca87ba1309d12ba92dbaf3 | Python | 9,672 | 261 | """
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 logging
from functools import partial
from pathlib import Path
from typing import TYPE_CHECKING
... |
9d13640d8a5113f1b7ef49f34b752507bf64ba6a65fcf2ec2f34caa2d2c4f49e | Python | 9,673 | 279 | # 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... |
0475bae4f46a64d4d1340d0246f0eb3f4ba226193db577fcbc491c221667f2da | Python | 9,676 | 184 | import numpy as np
import os
import json
import math
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 .... |
478a31ddbde02fa0fcf48ae277e4accb2102fa8c87121a155f598400ac1b1e86 | Python | 9,677 | 292 | import logging
import os
import tempfile
from unittest import mock
import numpy as np
import pytest
import pfrl
from pfrl.experiments import (
train_agent_async,
train_agent_batch_with_evaluation,
train_agent_with_evaluation,
)
from pfrl.experiments.evaluator import (
batch_run_evaluation_episodes,
... |
137e8a504735bba199a9e3d51d638e6e226618b967a9790b4be055c0e910aa7c | Python | 9,678 | 273 | ####################################################################################################
# Copyright (c) 2019, 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... |
fac3be85c2d495d7808fec905111ed63474ddef535ecc909d5b77f8f1cb8ae71 | Python | 9,679 | 254 | """QC-metric distribution plots — inspect before you filter (issue #808).
The classic scRNA QC workflow is *look, then cut*: view the distribution of
each QC metric (optionally per sample, since quality differs between samples)
and only then choose thresholds. omicverse computes the metrics
(:func:`omicverse.pp.qc_met... |
9c1fc66e4c797bd7d8ba51655cff0ffeac9c376bce6c056230d0b29dea201380 | Python | 9,682 | 212 | # encoding: utf-8
"""
Mozaik connector interface.
"""
import math
import numpy
import mozaik
import time
from mozaik.core import BaseComponent
from mozaik.sheets.vision import SheetWithMagnificationFactor
from parameters import ParameterSet
from mozaik.tools.misc import sample_from_bin_distribution, normal_function
fro... |
8658a6fc7e8b0178f44d1b163e68e9ce22cb50c10d6ea17b744a75fc34b13c1f | Python | 9,684 | 332 | import argparse
import functools
import logging
from multiprocessing.pool import ThreadPool
from pathlib import Path
import time
import typing
import grpc
import numpy as np
import read_until
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import csv
import torch
from torch import... |
00348e3695a09a9b3d60124db0848dc24e581fa58ff429dadecdc97c66d1a192 | Python | 9,689 | 226 | import logging
import torch
# from sre_constants import IN_IGNORE
from transformers import FSMTForConditionalGeneration, FSMTTokenizer
from transformers import MarianMTModel, MarianTokenizer
from transformers import MBartForConditionalGeneration, MBartTokenizer
from agent.data.sql.sql_mgmt import select_fields_where,... |
141b95cdc3a089cd3f7a1f01f5f419d85a4de6345223ef12f3b720361a64eaf2 | Python | 9,691 | 232 | from typing import Optional, Union, Sequence
import numpy as np
from .sites import Sites
class Lattice(Sites):
"""
A lattice with periodic structure in real space. Contains the coordinates of sites
and the Hilbert space dimension at all sites.
"""
def __init__(
self,
extent: Seque... |
df66bfd44fd5c015878e6e16171700ebcb62ced99d0fdd04f8b99b762992a5aa | Python | 9,692 | 289 | # Copyright 2025 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, ... |
5407812bb7cc266c77ff120d4044e0e85653627334eaa684c3f32c7038715dc1 | Python | 9,694 | 292 | # 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, ... |
a726b72fb90c5ab2bc42ffc18334f9659caca2c715c4f5ac1dfa1f28b4abc2bc | Python | 9,694 | 234 | # --------------------------------------------------------
# SimMIM
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ze Liu
# Modified by Zhenda Xie
# --------------------------------------------------------
import os
import time
import argparse
import datetime
imp... |
e71519d3dbffdc217909010431e25753ffec0b2d75898fd383adb41d73a49e9f | Python | 9,694 | 246 | # 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... |
02ce6448eca483e941782f30f6498264e2824a905dde7844c5a0bd2e09e48a46 | Python | 9,695 | 189 | import numpy as np
import pandas as pd
def get_header_names(raw_data_headers, header_index_range):
"""
This function takes in the raw data column headers and header index list and creates a list with the header names
:param raw_data_headers: A list of all the column names from raw data
:para... |
b713477e1a8764e0b8d2b0b370846039d1d6283bb02ece3b16a9489012e3d1a7 | Python | 9,697 | 201 | import argparse
from utils.utils import load_data, quick_tokenize, evaluation, define_logger
import random
import numpy as np
import torch
from model.discriminate_model import pretrained_model
from transformers import AdamW
import sys
import torch.nn as nn
import os
from torch.utils.data import TensorDataset, DataLoade... |
6288cce657b4093f9ed5649d3d9db9f4e750156ee41aa6db2dd4bc1772fb4a5b | Python | 9,701 | 309 | from PIL import Image
import numpy as np
from ctypes import *
import ctypes
import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import cv2
import time
import pdb
import socket
import pickle
import scipy
import scipy.ndimage
import PySpin
import matplotlib.pyplot as ... |
8c6d234f831efb2a30497dd7c02c6a2826166d10c6977cd3b2c9a852dbc87b00 | Python | 9,701 | 260 | from __future__ import division
from .. import gpu_utils
from ..distributions import *
import scipy as s
import numpy as np
# Import manually defined functions
from .variational_nodes import (
UnivariateGaussian_Unobserved_Variational_Node_with_MultivariateGaussian_Prior,
)
# Z_Node_GP
class Z_GP_Node(
Univa... |
1826159f95449f43cb94e11233c0e331c5a3688e966da4e8122288479d98aa68 | Python | 9,703 | 301 | #!/usr/bin/env python
#
# This file is based on
# https://github.com/llvm-mirror/clang-tools-extra/blob/5c40544fa40bfb85ec888b6a03421b3905e4a4e7/clang-tidy/tool/clang-tidy-diff.py
#
# ===- clang-tidy-diff.py - ClangTidy Diff Checker ----------*- python -*--===#
#
# Part of the LLVM Project, under the Apache License v2.... |
af6f14cca2188ab0282a7f63c73558756cc5d8c4896aab3166451e8235b785ec | Python | 9,703 | 272 | """An example of training DQN against OpenAI Gym Envs.
This script is an example of training a DQN agent against OpenAI Gym envs.
Both discrete and continuous action spaces are supported. For continuous action
spaces, A NAF (Normalized Advantage Function) is used to approximate Q-values.
To solve CartPole-v0, run:
... |
94b93011239b6bdc283f88e2fc2bf6bc5610d61328784909454e2df5a9d684dd | Python | 9,705 | 274 | import contextlib
import string
from collections import Counter
from typing import List, Tuple
import numpy as np
import pandas as pd
from data_profiling.config import Settings
from data_profiling.model.pandas.imbalance_pandas import column_imbalance_score
from data_profiling.model.pandas.utils_pandas import weighted... |
4eb5c3ff7761c8b4fb20a0b9e45db4279aee69ab21a50bc0d52634ca5afb6a9b | Python | 9,707 | 128 | # This file was created by
# MATLAB Deep Learning Toolbox Converter for TensorFlow Models.
# 07-Jul-2023 14:20:39
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
def create_model(shp):
data = keras.Input(shape=shp, name="data_unnormalized")
#data = keras.layer... |
d715080da8852fd9595f251069f5881d17348b81f68bb5017b71147c16198d09 | Python | 9,709 | 229 | r"""Public entry points of ``ov.space.seg`` for images."""
from __future__ import annotations
from typing import Literal
import numpy as np
import pandas as pd
from ..._registry import register_function
from ._backends import BACKENDS, _sample
from ._tiling import segment_tiled
ImageMethod = Literal["watershed", "c... |
2061ff1b0f4e5cf1ad95b50926ad7ad6d89254a24052a22f2d8c71ac2b93f4ac | Python | 9,711 | 311 | #!/usr/bin/env python3
"""
OmicVerse Skill Seeker CLI
Utilities to list, validate, and package OmicVerse Agent Skills bundled
under `.claude/skills`.
Examples:
# Show discovered skills (title, slug)
python -m omicverse.ov_skill_seeker --list
# Validate all skills
python -m omicverse.ov_skill_seeker -... |
b7d873de1890f90d8ce110048740d400a54a80bf106a2bd351666d6348a9cf27 | Python | 9,719 | 247 | import torch.nn.functional as F
from tqdm import tqdm
from pathlib import Path
import time
import torch
from torch.nn.parallel import DistributedDataParallel
import numpy as np
import torch.distributed as dist
from torch.utils.tensorboard import SummaryWriter
class TrainerFineTuneClassification:
def __init_... |
ba4c40d27702f61b498ab5120e56c480df60bb2cac2bb5e3d59a3ab2c3374fd0 | Python | 9,721 | 213 | """Real public genetics datasets for the ``ov.genetics`` GWAS tutorials.
Each loader downloads a dataset asset from the ``omicverse-data`` GitHub
release (``genetics-v1``) on first use, caches it under ``dir``, and
returns it ready for the ``ov.genetics`` post-GWAS workflow.
| Loader | Returns | Source |
|---|---|---... |
6129e9523a79e27dce3a3e11ad661697a5f3ea9863acf8e16efcb3bd58a491c5 | Python | 9,722 | 253 | import numpy as np
import cupy as cp
from multiprocessing import Pool
from functools import partial
def tom_ctf1d(pixelsize, voltage, cs, defocus, amplitude, phaseshift, bfactor, length=2048):
ny = 1 / pixelsize
lambda1 = 12.2643247 / np.sqrt(voltage * (1.0 + voltage * 0.978466e-6)) * 1e-10
lambda2 = lam... |
daa5fd216331b4d09417afa1a3246fbb0cf049c6b62a575037a5092b508b5cc9 | Python | 9,722 | 262 | import gc
import random
import unittest
import torch
from transformers import (
CLIPImageProcessor,
CLIPTextConfig,
CLIPTextModel,
CLIPTokenizer,
CLIPVisionConfig,
CLIPVisionModelWithProjection,
)
from diffusers import AutoencoderKL, DDIMScheduler, DDPMScheduler, StableUnCLIPImg2ImgPipeline, U... |
b32f4c8cf224fb4e90c2bbd1bd9ca9a5acf06dc2e3a05dc3117475c1a66d03b7 | Python | 9,723 | 251 | # %%
import numpy as np
import seaborn as sns
import pandas as pd
import matplotlib
# matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import json
import torch
import os
import datetime
import monai
import adrd.utils.misc
from tqdm import tqdm
from matplotlib.pyplot import figure
from torchvisi... |
91c7feaa9abbfd3e6f653e1311f56dd8d78fa2c9cc0d77c03bff1e0c5e1849f0 | Python | 9,724 | 182 | import pysolr
import time
from os import path
import sys
from utils import group_in_dict
import os
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
os.chdir('..')
from bionlp import nlp, disease... |
cd543abfa97baaeb3183355e6fb0e8d5b86d74abfbe104145c6393a67003f265 | Python | 9,728 | 279 | from PIL import ImageFilter
import random
from anndata._core.anndata import AnnData
import torchvision.datasets as datasets
from torch.utils.data import Dataset
import scanpy as sc
import torch
from copy import deepcopy
import numpy as np
import pandas as pd
class TwoCropsTransform:
"""Take two random crops of o... |
5b1e864b5aef4871dfea4185a770b56d3a22396e67f1ede94a204f3eef32394b | Python | 9,730 | 306 | # -*- coding: utf-8 -*-
#
# pySTED documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 14 13:03:03 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
ba89c3595aa032274e68aa74936c37afdd0c54d105ff929cdda6ed5d07bb7e03 | Python | 9,730 | 342 | # Copyright 2024 The bayesnf 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 applicable law or agreed to in ... |
c1a068d12070a0f6673919d2c01449bb7dde215343a885ec4ac51e41e68b2d75 | Python | 9,730 | 306 | # -*- coding: utf-8 -*-
#
# pySTED documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 14 13:03:03 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
e11087d857837e92c8d25ac479b11c2d319608125320f044482e560f4a50b71d | Python | 9,733 | 273 | """
Defining structural features to be computed
"""
import logging
import networkx as nx
import numpy as np
import pandas as pd
import scipy as sc
from scipy import signal
from neurodsp.spectral import compute_spectrum
import csv
import itertools
import warnings
L = logging.getLogger(__name__)
EXPECTED_KEYS = ['... |
c0b72bc2ad7e25e03230e88b1191e5229d1d81b4eea7920f43c683b03f546dcb | Python | 9,735 | 285 | import json
import numpy as np
import pandas as pd
import mne
from pathlib import Path
from helpers import get_relevant_data, get_largest_peaks
def create_scores_data(
score_files: list[Path],
models_dict: dict,
) -> pd.DataFrame:
""" Create a DataFrame with scores data from the score files.
... |
0d9ec4dd46c95c6137aa007f12b5292ed9e0370ab28649afee0796b4bcd1fdf0 | Python | 9,738 | 245 | #!/usr/bin/env python
try:
get_ipython().magic(u'load_ext autoreload')
get_ipython().magic(u'autoreload 2')
except:
pass
import itertools
import logging
import matplotlib.pyplot as plt
import numpy as np
from operator import itemgetter
from scipy.io import loadmat
from scipy.ndimage import center_of_mass
... |
fc71dd7af3c59e87f9a155cd9f86b49986ec3837fb4bf5f7321c0ef963d9a189 | Python | 9,738 | 266 | from numpy.random import seed
seed(1)
import tensorflow as tf
tf.random.set_seed(1)
import random
random.seed(1)
import tensorflow as tf
import csv
import numpy as np
import SimpleITK as sitk
import matplotlib.pyplot as plt
from numpy import argmax
import pandas as pd
import tensorflow.keras.backend as K
... |
357fee8c23debf9a96abf136e96725c96e710227616f3e04a69105fb7ed82f4d | Python | 9,739 | 228 | from typing import Tuple
from matplotlib import pyplot as plt
from matplotlib.axes import Axes
from src.dataset.batchdataloader import BatchDataloader
from torch import nn
import torch
from src.models.resnet import ProbResNet1d
from src.evaluations.utils import remove_outliers, boxplot_buckets
from src.dataset.utils im... |
2194dfc7e9e194a6c499b24aa5c61c41ae0d7e841e355c09621ddcdc2bf0d734 | Python | 9,742 | 233 | #%%
import torch
import torch.nn.functional as F
import numpy as np
import scipy.special
import math
import itertools
from src.encoders_decoders import *
import itertools
import random
# This file contains definitions of loss functions used to train encoder and decoders.
# %%
###########################################... |
291f2715c15ba2eeb910609ddee52f15548c52bc046d1a2fc4c69772eb25b41f | Python | 9,745 | 228 | import torch
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.functional as F
from sklearn.m... |
a939466255d93205d3cbd6656dc116cd65c9329173ded62b974d71f06f8c3401 | Python | 9,745 | 284 | """
This test suite covers error handling and propagation in Ray Train/Tune.
There are two main error types to test:
1. Trainable errors: These happen in the remote actor itself.
-> Within this, we should test:
- fail_fast=True/False/'raise'
- AIR Trainer w/o Tuner, AIR Trainer w/ Tuner, Tuner w/ f... |
a47121253274db07d5851c7da9af0d9b14c11f1d78159ee7c425131efd83e0e1 | Python | 9,748 | 240 | # 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, ... |
01465e1c506b0bf24654659d53252623206a03aae2ce1e2c39aa90fc0bf1250d | Python | 9,749 | 221 | import csv
from copy import deepcopy
import numpy as np
from batchgenerators.utilities.file_and_folder_operations import *
import shutil
from nnunetv2.dataset_conversion.generate_dataset_json import generate_dataset_json
from nnunetv2.paths import nnUNet_raw
import SimpleITK as sitk
# label_code of the RibFrac info c... |
7c4f7fe4cf5b7932dcf0243cd128903d40ed5e4ed73ed56fbed56c2ca955c836 | Python | 9,754 | 229 | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from lib5c.util.plotting import plotter
from lib5c.plotters.colormaps import get_colormap
from hic3defdr.util.matrices import dilate, select_matrix
from hic3defdr.util.thresholding import threshold_and_cluster, size_filter
from hic3defdr.util.cl... |
3a6716833529143328e7786d99c308b62b92d50b1dbc1586d2f49947ddf7ff67 | Python | 9,756 | 317 | # built-in dependencies
from typing import Any
# 3rd party dependencies
import tensorflow as tf
# project dependencies
from deepface.commons import package_utils, weight_utils
from deepface.models.FacialRecognition import FacialRecognition
from deepface.commons.logger import Logger
logger = Logger()
tf_major = pack... |
9e0ec51ca5fb3a43e5609715ee49703c32ad81d07224dbfa1f23fed637dc6aab | Python | 9,756 | 245 | ####################################################################################################
# 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... |
c6c5bc8848ee46082c2d31a4726da48e3d5e42b2119843d4ca4cb3cc7f688392 | Python | 9,758 | 205 | import os
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.utils.data import DataLoader
import argparse
import time
import datetime
import sys
import math
import scipy.io as scio
import numpy as np
from skimage import io
import random
from DWonder.SEG.data_process import train_preproc... |
212e2e184b4a01be81cdbd18526c8386f88d1eaa32680672dc8cbc31bcdb2c3d | Python | 9,766 | 279 | # A incremental sticky CRP
#
# Note:
# This is modified based on John McDonnell's Anderson model
# https://github.com/johnmcdonnell/Rational-Models-of-Categorization/blob/master/rational.py
# References: Anderson (1990) and Anderson (1991)
#
# Implementation of Anderson's venerable "rational" model of categorization.
#... |
3dcfc1e073713ba31d7d3c292fe5dacfd8fdac7b5ccc9f2ccc981a8d29b88b40 | Python | 9,768 | 271 | ####################################################################################################
# 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... |
8cf6efd0d29343eb0f747bfb86c9b77fea775930d968b1aa8cb6b5046ae86fc0 | Python | 9,778 | 225 | from typing import Union, Tuple, Optional
from torch_geometric.typing import (OptPairTensor, Adj, Size, NoneType,
OptTensor)
import torch
from torch import Tensor
import torch.nn.functional as F
from torch.nn import Parameter
import torch.nn as nn
from torch_geometric.nn.dense.line... |
87b1641c6fa0dae62f006186ff799e3ebcb74a3dd4dad8590ba627e38e17abf9 | Python | 9,779 | 231 | from __future__ import print_function
# Usage python train_with_labels_three_fold.py number_of_data_parts_divided NEPDF_pathway
# command line in developer's linux machine :
# module load cuda-8.0 using GPU
#srun -p gpu --gres=gpu:1 -c 2 --mem=20Gb python train_with_labels_three_foldx.py 9 /home/yey3/cnn_project/c... |
0cc33d165b2b87bfcaa25652bc6e55c5689850cf5662e9017f91a53aa201218f | Python | 9,785 | 246 | import numpy as np
import mrcfile
import os
import logging
import gc
import scipy.fft
def tom_ctf1d(pixelsize, voltage, cs, defocus, amplitude, phaseshift, bfactor, length=2048):
ny = 1 / pixelsize
lambda1 = 12.2643247 / np.sqrt(voltage * (1.0 + voltage * 0.978466e-6)) * 1e-10
lambda2 = lambda1 * 2
... |
70c19c2b72a62a566ba858aecc0888dad3ae1ae5e461c7b70b57f97fe1de0652 | Python | 9,785 | 272 |
# %%
import matplotlib.font_manager
fonts = set(f.name for f in matplotlib.font_manager.fontManager.ttflist)
print(fonts)
#%%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('default')
import seaborn as sns
from statannot import add_stat_annotation
from statannotations.Annotator i... |
ee6947339a5dd70da47e2fcc9a1749b85279dbe721d4f5ddbe7957cd1f5f2f7b | Python | 9,787 | 243 | #!/usr/bin/env python
import argparse
import distutils.dir_util
import filecmp
import glob
import os
import platform
import psutil
import shutil
import string
import subprocess
import sys # for sys.prefix
from typing import Dict, List, Tuple
from caiman.paths import caiman_datadir
sourcedir_base = os.path.join(s... |
9ef3e4ce11979d9c1b835038b0465da807408d0ed327c918a79ed92273e6a35f | Python | 9,788 | 285 | import hashlib
import json
import logging
import os
import shutil
import subprocess
from typing import List, Optional, Tuple, Union
"""Utilities for conda. Adapted from https://github.com/mlflow/mlflow."""
# Name of environment variable indicating a path to a conda installation. Ray
# will default to running "conda"... |
63c46fba1a8f17d04e6d9aab922b65f8b739730ce229bb56b6cbf9f69f5f88f1 | Python | 9,790 | 232 | # Copyright 2023 NVIDIA 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 required b... |
a78050d4da8ef1fea41b06faaa7012c312533362d47ae3aa30c079ace6da5ca9 | Python | 9,797 | 359 | import argparse
import torch
import torch.nn as nn
import os
import pandas as pd
import wandb
import yaml
from tqdm import tqdm
from scipy import stats
from sklearn import metrics
from .data import ChromoformerDataset
from .net import ChromoformerClassifier, ChromoformerRegressor
from .util import seed_everything
t... |
62ea56294b5576c31ea71aebafef21b69a59ffe9f7a9e50d87bd6cb5a827fb85 | Python | 9,800 | 262 | try:
import matplotlib.pyplot as plt
import matplotlib.colors as mc
from matplotlib.axes import Axes
import colorsys
except ImportError:
raise ImportError(
"Matplotlib is required for visualization functions. "
"Please install it with: pip install timescoring[plotting]"
... |
6320decca1102489d261655df35791d6f6d20e483b8a3de02a6c45aec721d0bd | Python | 9,802 | 237 | ####################################################################################################
# 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... |
db887be5e1aed078de476ceb209021bd0990e28bf1d139cd4f12805e0e2e41ba | Python | 9,806 | 344 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 23 23:01:23 2024
@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... |
4ab4950ba820cb4bdbebeb5bbc5afc43770f8c1fcb5399fb6ae4fb3c3cd3cf2d | Python | 9,807 | 269 | import torch
from torch.nn import Module, BatchNorm1d, LeakyReLU, Conv1d, ModuleList, Softmax, Sigmoid, Flatten, Dropout2d, Linear
from torch.optim.lr_scheduler import LambdaLR
from torch.optim import Optimizer
from torch.utils.data import Dataset, DataLoader
import argparse
import math
import random
import numpy as n... |
b2323e19c42b5d0fd565099a90c9c44c24a68ae06967469eca59a2b4de9497a7 | Python | 9,811 | 297 | from os.path import join
from tqdm import tqdm
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
from config import args
from models import GNN, GNN_graphpred
from sklearn.metrics import accuracy_score, average_precision_score, roc_auc_score
from splitters import rand... |
1a88f4db522bce5608e5a84542e4ce17bf5ff17fbb9638eb3f037d27d4f1ae01 | Python | 9,812 | 238 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import networkx as nx
import itertools
from ..utils import plot_network
from .._registry import register_function
from typing import Union, Tuple, Any
import matplotlib
@register_function(
aliases=["STRING交互分析", "string_interaction", "ppi_analy... |
70c481d16482c45196beae85c566454730a605852912256afd9a4051ac83be3f | Python | 9,812 | 346 | """Formatters are mappings from object(s) to a string."""
import decimal
import math
import re
from datetime import timedelta
from typing import Any, Callable, Dict, List, Optional, Union
import numpy as np
import pandas as pd
from markupsafe import escape
def list_args(func: Callable) -> Callable:
"""Extend the... |
f6592b7e3a188c8c64c7ba54d3965852f1b4b5529c30b401087677838b5b1713 | Python | 9,812 | 276 | #!/usr/bin/env python
"""Preflight check that the local environment matches the Read the Docs build.
Ray's docs build on Read the Docs with ``fail_on_warning: true``, so a local
build is only trustworthy when it reproduces RtD's environment. This doctor
compares the active interpreter and installed packages against wh... |
2b5e80b10c3f68e6b5fcca0df42cf6f25b0579b78ca9d4d404fbeb45b40e42e7 | Python | 9,813 | 248 | import gurobipy as gp
import cv2
import numpy as np
from math import log
import copy
import math
import tifffile
from tqdm import tqdm
import sys
def cal_feature(image):
if len(image.shape) == 3:
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# f = np.fft.fft(np.fft.fft(gray,axis=0),axis=1)
... |
b0e59941f1e1f3ec08b5ad99866b9b7e6df95b4c113bbca4ff483535d33a9ffa | Python | 9,813 | 267 | import torch
from torch.nn import Module, BatchNorm1d, LeakyReLU, Conv1d, ModuleList, Softmax, Sigmoid, Flatten, Dropout2d, Linear
from torch.optim.lr_scheduler import LambdaLR
from torch.optim import Optimizer
from torch.utils.data import Dataset, DataLoader
import argparse
import math
import random
import numpy as n... |
f0eb8b81db5125614609176992b26a79b4e0371d42f31f323d4c234262ef2dc7 | Python | 9,813 | 182 | # --- START OF FILE operator_mode.py ---
import streamlit as st
TUTORIAL_TEXT = """
# Operator Mode Tutorial
---
You are not allow to Launch Public Link IN ANY TIME.
## 1. Understanding the Interface
When you open the web application, you will see the main content in the center of the screen and a sidebar on the l... |
2bc3894dc33604d9c7c3861ef886e68a57386c6c178fd88a6e0a4d230d71f236 | Python | 9,814 | 216 | import torch
from torch import nn
from models_.modules import BasicBlock, Bottleneck
class StageModule(nn.Module):
def __init__(self, stage, output_branches, c, bn_momentum):
super(StageModule, self).__init__()
self.stage = stage
self.output_branches = output_branches
self.branche... |
7559c0f4240a20d634e2fa4aa9f35723ed97faad300052d4425c16631fdb8eee | Python | 9,814 | 267 | import torch
from torch.nn import Module, BatchNorm1d, LeakyReLU, Conv1d, ModuleList, Softmax, Sigmoid, Flatten, Dropout2d, Linear
from torch.optim.lr_scheduler import LambdaLR
from torch.optim import Optimizer
from torch.utils.data import Dataset, DataLoader
import argparse
import math
import random
import numpy as n... |
f70b7e0087e0c6ccffbb3d54e6696b7b7855f8011cd9dab628c7d3d07837cab0 | Python | 9,814 | 259 | #!/usr/bin/python
"""Utility scripts for gene graph class."""
import logging
import numpy as np
import pandas as pd
from scipy import sparse
import scipy.stats as st
from scipy.interpolate import SmoothBivariateSpline
def prune_degree(aw, degree_cutoff):
"""Remove nodes with degree of `degree_cutoff` or lower.""... |
03b14638b5cb97044a77321940a5e106dad28471c7ab793e546595db91571f2d | Python | 9,816 | 199 | from __future__ import annotations
# built-in dependencies
import importlib
from typing import TYPE_CHECKING, Any, Dict, Final, TypedDict
# project dependencies
from deepface.commons import backend_utils
from deepface.commons.backend_utils import ONNX, PYTORCH, TENSORFLOW
from deepface.modules.exceptions import Unimp... |
970eb50de661d08fd48185318188ecc073ca7d9b6d7875f897ed9739b6458a79 | Python | 9,818 | 363 | import matplotlib
matplotlib.use("TkAgg")
import mozaik.stimuli.vision.topographica_based as topo
import mozaik.experiments.vision as exp
import mozaik.experiments.apparent_motion as am
import stimulus_visualization as viz
import dummy_model as dm
from parameters import ParameterSet
import numpy as np
def experiment... |
1a7e3dba12ebc2675be06f7ed2d8deef3d8c6ca0cc5dfe619be8812a82603637 | Python | 9,821 | 265 | # Copyright 2023 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 required by applicabl... |
4ef4d582be149cbeded0a88d2d0bcdfdb35c06fd968cb8c1c6ba78faab1ce305 | Python | 9,822 | 210 | import os
from PIL import Image
import torch
import torch.utils.model_zoo
from torch.utils.data import Dataset
import torchvision
import math
import numpy as np
import random
from sklearn.metrics import precision_recall_curve
def least_common_multiple(num):
mini = 1
for i in num:
mini = int(i) * int(mi... |
bb43b1a31c448c74f6e006b94393165c1b98baebd4ba0ccec3461e23aacec7ff | Python | 9,822 | 220 | import pandas as pd
import numpy as np
import sklearn.neighbors
import scipy.sparse as sp
import seaborn as sns
import matplotlib.pyplot as plt
import torch
from .._pymclustr import fit_pymclustr
def Transfer_pytorch_Data(adata):
from torch_geometric.data import Data
G_df = adata.uns['Spatial_Ne... |
906e495c34059c37e9ccc0f487ef6bf41199dd77ed1874e69134398f48017035 | Python | 9,823 | 210 | import os
from PIL import Image
import torch
import torch.utils.model_zoo
from torch.utils.data import Dataset
import torchvision
import math
import numpy as np
import random
from sklearn.metrics import precision_recall_curve
def least_common_multiple(num):
mini = 1
for i in num:
mini = int(i) * int(mi... |
549559a67c2724c59eda6b6c6bb7ea5c8b0d4874898fb139b59eff0b1d2d8b68 | Python | 9,825 | 231 | import tempfile
import torch
from diffusers import (
DEISMultistepScheduler,
DPMSolverMultistepScheduler,
DPMSolverSinglestepScheduler,
UniPCMultistepScheduler,
)
from .test_schedulers import SchedulerCommonTest
class UniPCMultistepSchedulerTest(SchedulerCommonTest):
scheduler_classes = (UniPCM... |
ef03a7487991e337d56441fc222e30a2c8c8e9ed56ca2eaeb0a6ace4af03de6a | Python | 9,832 | 313 | """
From https://github.com/ehoogeboom/e3_diffusion_for_molecules/
"""
# Bond lengths from:
# http://www.wiredchemist.com/chemistry/data/bond_energies_lengths.html
# And:
# http://chemistry-reference.com/tables/Bond%20Lengths%20and%20Enthalpies.pdf
bonds1 = {'H': {'H': 74, 'C': 109, 'N': 101, 'O': 96, 'F': 92,
... |
98d9115190dacbb809eec0b9e480f30f1cbe1f14ad99af5295c1e37efcad57fd | Python | 9,838 | 180 | from tests.objects import test_node, test_tree
from neuron_morphology.validation.result import InvalidMorphology
from neuron_morphology.validation import type_validation as tv
from tests.validation.validation_test_case import ValidationTestCase
from neuron_morphology.constants import *
import unittest
from mock import ... |
e379a73f62747ad6d25dd30dcf3931c42cf7b18fb1ed55266e6fcb68061cb685 | Python | 9,840 | 298 | """
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 os
import sys
import tempfile
import hydra
import numpy as np
import pytest
from ase import Ato... |
90c8585a7b369a27498607c4f1f6d8dd70a7e504d61d3e633958e66c5386f5f4 | Python | 9,841 | 217 | #!/usr/bin/env python3
# Szi Kay Leung (sl693@exeter.ac.uk)
"""
Aim: Split reference genome annotation gtf by target gene name
"""
## Load Libraries
import argparse
from gtfparse import read_gtf
import pandas as pd
import csv
import numpy as np
# switch off loc warnings
pd.options.mode.chained_assignment = None # ... |
c3c929ace88b03cdb9578f0f16c3fc96195e73ca9150d2d90131fa89e9fecf48 | Python | 9,841 | 187 | import time
from utils.model_initializer import *
from utils.data_preparation import *
from utils.model_predict import *
from utils.clustering import *
from utils.wandb_initializer import *
from utils.finetune_models import *
from utils.file_opener_raw_recording_data import *
from utils.filter_signal import *
from uti... |
9e7d1e16950549ca980276e4ffd6521c58b2d57246b2e951ae8baa923fe3a00d | Python | 9,842 | 235 | ###########################################################################
#
# Python implementation of the ImageJ Cell Magic Wand plugin
# (http://www.maxplanckflorida.org/fitzpatricklab/software/cellMagicWand/)
# with modifications to reduce variability due to seed point selection
# and to support edge detection usi... |
489c9198fc5770916a3fb35dc1de5cbe36415201c561ffedc4c847379fdc56ca | Python | 9,843 | 282 | import logging
import torch
import torch.nn as nn
log = logging.getLogger(__name__)
class Diffusion(nn.Module):
"""
Diffusion model for time series data.
The model is initialized with a denoising network, a noise sampler and a way to compute Mahalanobis distances.
Ususally, the noise sampler and th... |
47c21e72c7185350b06a85e544fe6092d677b86891f580dbd2e70e71682ecd3a | Python | 9,845 | 276 | """
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 torch
import torch.nn as nn
import torch.nn.functional as F
class ScaledSiLU(nn.Module):
d... |
62cc86fca6cbbad21766c0e66eb2533bcc16cb0ef8d0416621034432c37f2e45 | Python | 9,845 | 222 | # -*- coding: utf-8 -*-
"""
@author: Valeria Fascianelli, 2023
"""
import dataset_valeria_new
import matplotlib.pyplot as plt
import numpy as np
import itertools
import scipy
from sklearn import svm
import random
import pickle
def get_dichotomies(n_cond, side_dim):
patterns = list(range(n_cond))
tot_dicho... |
dfed2a15140eca6cb1599aa47160309d05cdc5cd6ac22d3b4990623301dc5da4 | Python | 9,845 | 225 | import yaml
import projectmetis.python.utils.proto_messages_factory as proto_messages_factory
class Docker(object):
def __init__(self, docker_image):
self.docker_image = docker_image
class TerminationSignals(object):
def __init__(self, termination_signals_map):
self.federation_rounds = te... |
1e5cd5287dc5a58297207e48b2d9ddf2de457b3a73c7461324f6824430ccc2c1 | Python | 9,853 | 226 | from __future__ import print_function, unicode_literals, absolute_import, division
from six import string_types
import numpy as np
import argparse
from distutils.version import LooseVersion
from ..utils.tf import keras, K
from ..utils import _raise, axes_check_and_normalize, axes_dict, backend_channels_last
class ... |
5f3095c1c5a6e14a46fa52b5f51a65d2293ec225224c497162376a60eca93c07 | Python | 9,853 | 314 | from data_profiling.config import Settings
from data_profiling.report.formatters import (
fmt,
fmt_bytesize,
fmt_monotonic,
fmt_numeric,
fmt_percent,
)
from data_profiling.report.presentation.core import (
Container,
FrequencyTable,
Table,
VariableInfo,
)
from data_profiling.report.s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.