sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
500b04f44988340d1fec075b04dce207257f12c69d8d7170d794498a5d4175ef | Python | 16,293 | 459 | """
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.
UMA Nitro's automatic fallbacks, through MLIPPredictUnit.
Every request Nitro cannot serve warns, naming the settings now in use, and
runs the... |
d74c4831d86207e0debd59dc47db534d689bdf3673cf2b3da00672eaa02a8ad3 | Python | 16,295 | 302 | from typing import Callable, List, Optional, Union
import PIL
import torch
from transformers import (
CLIPImageProcessor,
CLIPSegForImageSegmentation,
CLIPSegProcessor,
CLIPTextModel,
CLIPTokenizer,
)
from diffusers import DiffusionPipeline
from diffusers.configuration_utils import FrozenDict
from... |
3501338a38bf40df8b0f1c11b40c38a2b8a7de3a735708c8c507a831de362cdf | Python | 16,296 | 391 | from typing import Tuple, Optional, Set, Sequence
from collections.abc import Callable
from collections import defaultdict
from dataclasses import dataclass
import numpy as np
from causaldag import unknown_target_igsp, gsp
from causaldag import partial_correlation_suffstat, partial_correlation_test, MemoizedCI_Tester
f... |
d7077173854c45673291a0dca81eb6ecf0c6492621fc1d552a83d162a226f7b6 | Python | 16,303 | 414 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
# pylint: disable=no-name-in-module, import-error
"""Converters for `BasicInferencing` Experiment."""
from typing import Any, Dict, List
from torch.nn import M... |
d4b5d4bf519474e7b42d89d5b7e64ada232d7c0b05338281e6fa4346e6b381c9 | Python | 16,306 | 349 | # -*- coding: utf-8 -*-
import sys, os
env_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(env_path + "/../")
sys.path.append(env_path + "/seq2struct")
sys.path.append(env_path + "/seq2struct/esmfold_openfold")
import torch
import numpy as np
import pandas as pd
import re, time, random,... |
6469625446c4bff30a6226f4d73f4e23cc6af385c94cadf957840275c64972a0 | Python | 16,307 | 486 | import json
import os
import numpy as np
import snntorch as snn
from snntorch import functional as SF
from snntorch import surrogate
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
import nir
# NOTE: this requires snntorch/nir (PR) and nirtorch/master (unreleased)
from snntorch import import... |
ad203a58e777a349a74fdb9ca624f4a0a5cc7474c840d52357699704e73ff146 | Python | 16,308 | 353 | 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 numpy as np
from skimage import io
import math
from DWonder.data_process import Img2Subimg
from DWonder.RMBG.network import Network_3D_Unet
from D... |
b99ef39ef6d9a086f53b8676caee0df74a0d68bf1c08d88c1494122ec7c21de3 | Python | 16,314 | 479 | ####################################################################################################
# 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... |
0b3e5a101c4ae3d270ecabdd0f177f6da471c31c01b95a5a73abac3b8c473ae4 | Python | 16,325 | 404 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... |
966e311cf2263a2643aa525fd04390d73fb57179adef240bd3ffbc6283fd33f9 | Python | 16,326 | 466 | # -------------------------------------------------------------------------------------------------------------------------------------
# Following code curated for Bio-Diffusion (https://github.com/BioinfoMachineLearning/bio-diffusion):
# --------------------------------------------------------------------------------... |
3f367c388e77bb6394f2660e0e8e8712765116b5d056f3114186fd4d93cfc58d | Python | 16,346 | 343 | # -*- coding: utf-8 -*-
import sys, os
env_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(env_path + "/../")
sys.path.append(env_path + "/seq2struct")
sys.path.append(env_path + "/seq2struct/esmfold_openfold")
import torch
import numpy as np
import pandas as pd
import re, time, random,... |
c099b911242e22b3e1547f50c32607d7228cc2d0bc6eecdd2a67cdeb63720b28 | Python | 16,348 | 509 | import numpy as np
import copy
import random
from exputils.misc.attrdict import combine_dicts
# try to import torch, so that its seed can be set by the seed() - function
try:
import torch
except ImportError:
torch = None
def numpy_vstack_2d_default(array1, array2, default_value=np.nan):
if len(array1) ==... |
9ea15680a78c614a72ebdcf438cf1a2d87bb59cf9d6d271ce16dddfdf4f6b614 | Python | 16,350 | 385 | import sys
import time
import textwrap
import anndata
import numpy as np
import pandas as pd
import functools
from datetime import datetime
from scipy import sparse
# Global flag to control monitor output display
_SHOW_MONITOR_OUTPUT = True
# Global nesting level counter
_MONITOR_NESTING_LEVEL = 0
def set_monitor_dis... |
41a852a789ee886b8e5dc02c766a3f6f84f94eaf26f2a3275b5ff1c645626224 | Python | 16,358 | 417 | # 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... |
502092de71cc36940cfe26c5806cab20cf6ba24240d1d0e5d8a5377c5636c422 | Python | 16,359 | 546 | #
# \file generator.py
#
# \brief Generates the CUTLASS Library's instances
#
import re
###################################################################################################
import enum
# The following block implements enum.auto() for Python 3.5 variants that don't include it such
# as th... |
61f12186ea9a4af5a51cdbeeff920b607671f2ced2cd637363bebf2f3acfbc8d | Python | 16,374 | 501 | import matplotlib.pyplot as plt
import numpy as np
import warnings
def calc_precision_recall(threshold, y_true, y_pred):
# Instantiate counters
TP = 0
FP = 0
FN = 0
TN = 0
# Determine whether each prediction is TP, FP, TN, or FN
for i in range(len(y_true)):
if y_true[i]==1 and y... |
49062b4a5b98d8811ef84e3e1e24095104973ae0705dbe5ce6c20b59d579c207 | Python | 16,375 | 398 | from __future__ import annotations
import logging
from collections import deque
from typing import TYPE_CHECKING, AbstractSet, Deque, Iterable, Iterator, List, Optional
import numpy as np
import pyarrow as pa
import ray
from ray._common.utils import env_integer
from ray.data._internal.datasource_v2.common.non_sampli... |
4f54c8941ae16d81aafd435d4cd0969d834862aa2d8715946887687f9397d919 | Python | 16,378 | 404 | import torch
import torch.nn as nn
import torch.nn.functional as F
# --- Solar Radiation Module ---
class SolarRadiation(nn.Module):
def __init__(self, envelop, name="Solar"):
super().__init__()
# Initialization
self.envelop = envelop
# Load transmission and absorption coefficient... |
3e7e984bc5f928c9ea205f1e9f1d5b35f9654e5f6b082a38fa49c171fd4fae58 | Python | 16,381 | 428 | from imports import *
import gzip
from ngs_mapper.data import NoPlatformFound
class Base(common.BaseClass):
modulepath = 'ngs_mapper.data'
def setUp(self):
super(Base,self).setUp()
self.reads = {
'Roche454': [
'Vero_WHO_S16803__RL45__2012_05_01__Den2.fastq'
... |
5cf4785c4422b1910674b6b0426a2efa4d998814a3e0537fa5adf3f2fee51735 | Python | 16,388 | 544 | from abc import abstractmethod
from torch import nn
from torch.nn.utils import weight_norm
class HyperNet(nn.Module):
"""This module is responsible for taking the losses from all tasks and return a single loss term.
We can think of this as our learnable loss criterion
"""
def __init__(self, main_ta... |
70d42ed84d2e52f22845ad53aabc123b4ce1b4006253ff29a16daea6e30593a0 | Python | 16,390 | 447 | # -*- 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.
#... |
92ededbc45d40b3e0e82a6763fb8c71f9afe4a5f0804378979874c332cbc7523 | Python | 16,395 | 498 | # 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... |
e4011985b15b195f7ac6f86300310a1d8eaaf275401cdf77a8f1f43b6100e676 | Python | 16,414 | 465 | #### trust game task ####
# ebeard
# 5/30/18
# edited by Dominic Fareri, 6/2018
### specs ###
# add task description here
### timing ###
# add timing info here
#import modules
from psychopy import visual, core, event, gui, data, sound, logging
import os
import sys
import csv
import datetime
import random
#maind... |
dc6d8cc057c0600f48e612a7d4da6482b7d972a5eba41317285fa50550c82019 | Python | 16,418 | 282 | import unittest
import numpy as np
from skimage.transform import resize
from batchgenerators.augmentations.utils import (interpolate_img, resize_multichannel_image,
resize_segmentation)
def nearest(seg, new_shape):
return resize(seg.astype(float), new_shape, 0, mo... |
2e84e33134aaee1ede91e67dddc0c83c79b2c0513120db69e774caee16e3b708 | Python | 16,419 | 485 | import torch
import torch.nn as nn
import torch.functional as F
# import matplotlib.pyplot as plt
import numpy as np
from sklearn import linear_model
import argparse
from model import RMSF_net_model
from moleculekit.molecule import Molecule
import mrcfile
from gen_data import *
import os
def get_parser():
parse... |
5d0e610ba88bbeb04d7f9b1e467467a70138186f89af29760899d6e54e059a64 | Python | 16,419 | 418 | """Detect overlapping tick labels and separate them.
Tick labels are the one piece of text on a plot whose crowding depends entirely
on the physical size the axes ends up at. "Fri Sat Sun Thur" is comfortable on
a 90 mm panel and a smear on a 40 mm one, and nothing in the plotting call
knows which it will be — a layou... |
bc28998754508def2a02a6fd74fd2a0c646f64ff0d94c2db29fdd0f1d9da3789 | Python | 16,425 | 424 | """Run the `>>>` docstring examples in the files a pull request changed.
Used by the "docstring-only" label's "doc: docstring examples" step in
.buildkite/others.rayci.yml, for every library. It runs only the examples in
the changed files, not a library's whole doctest target, and only in files
that a CPU doctest() ta... |
c7aedf6df3efada15f5df2498d14a9cbd391278a563b8b51bc3ab4d7421a81ee | Python | 16,428 | 444 | ####################################################################################################
# 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 library is fr... |
6253723070d107adeb7bd7c455edbdf72aeb81a869b65b2604d767baa4d90db7 | Python | 16,435 | 469 | # coding: utf-8
import os
import sys
from typing import Optional
import pytest
import torch
import ray
import ray.cluster_utils
from ray.dag import InputNode, MultiOutputNode
from ray.dag.compiled_dag_node import CompiledDAG
from ray.dag.dag_node_operation import _DAGNodeOperationType
from ray.tests.conftest import *... |
0e83bab8a07ba26b9919f383bf6ae464db63a0b83a57abc8fc4d915edc1d4886 | Python | 16,438 | 391 | """UCell — per-cell signature scoring via Mann-Whitney U on descending ranks.
Reference: Andreatta & Carmona, *Comput Struct Biotechnol J* 19 (2021).
Reproduces the canonical algorithm from the R package
``UCell::ScoreSignatures_UCell`` exactly — see ``HelperFunctions.R`` /
``u_stat`` in the upstream R source.
Algori... |
54aef0520ac2ce33a8ce9ecc98e981438b70a8ad9692ab0314d41136a506ef03 | Python | 16,440 | 400 | import configparser
from typing import Dict, Any, Optional, List, Tuple, Union
import os
from lib.data_utils.interaction_hashable import FeatureInteraction
from dataclasses import dataclass
LookupKey = Tuple[str, str]
def awsify_piece_name_and_datarun_lookup_key(dataset_raw_path: str,
... |
e72c95f79b020337987ee46e1f26de7d56e50117437a30d3185db55d109b1ecb | Python | 16,440 | 387 | #!/usr/bin/python
"""Gene graph handling."""
# --------------------------------
# Class for handling a gene graph:
# Updated: 06/28/21
# --------------------------------
from .adjacency_matrix import adjacency_matrix
from .utils_graph_plotting import plot_gene_graph, plot_gene_umap
from .utils_enrichment import plot_df... |
14315c180ceb15a531f9c0cb4717978f63074919537f38dc3453ef90d40bf93c | Python | 16,442 | 403 | import sys
sys.path.append('../../reval_clustering/')
from reval.best_nclust_cv import FindBestClustCV
from reval.internal_baselines import select_best, evaluate_best
from reval.visualization import plot_metrics
from reval.utils import kuhn_munkres_algorithm, compute_metrics
from reval.param_selection import SCParamS... |
4632ca61642e0bda2198348920d0bcf7c89de7c10453a294aa5e761dcec22eb0 | Python | 16,448 | 481 | #!/usr/bin/env python
#!/usr/local/bin/python
"""Utilities for downloading and providing data from openslr.org, libriSpeech, Pannous, Gutenberg, WMT, tokenizing, vocabularies."""
# TODO! see https://github.com/pannous/caffe-speech-recognition for some data sources
import os
import re
import sys
import wave
import num... |
4acafc024e253fddbb44c678d6f85077af1a20c27c267b59a1c5d73d64703848 | Python | 16,448 | 455 | # built-in dependencies
import os
import json
import hashlib
import struct
from typing import Any, Dict, Optional, List, Union, cast
# 3rd party dependencies
import numpy as np
# project dependencies
from deepface.modules.database.types import Database
from deepface.modules.exceptions import DuplicateEntryError
from ... |
ae62e92b04af436f99434bcbdb5c220b895ecf35c723cd0fa694eefe540f60fd | Python | 16,449 | 408 | r"""Layer A — strain design: which genes/reactions to knock out or amplify to
push a genome-scale model toward over-producing a target metabolite.
Two entry points:
* :func:`production_envelope` — the classic growth-vs-product trade-off curve
(pure COBRApy).
* :func:`strain_design` — ranked amplification **and** kn... |
5908948aed5b586b9dd2157a8cf2208f260895bbdb9b498ef1f2b49c2b27ec0b | Python | 16,452 | 408 | """
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: OMol evaluation recipes — molecular-property functions
(conformers, distance_scaling, ieea, ligand_pocket,
ligand_strai... |
dfd0800f67974ffdafe66ccd98c4407f397a969209c3bfec2a2aacdf2c09557d | Python | 16,457 | 415 | from torch_pgn.train.run_training import run_training
from torch_pgn.train.Trainer import Trainer
from torch_pgn.train.hyperopt import hyperopt
from torch_pgn.args import TrainArgs, HyperoptArgs, DataArgs
from torch_pgn.load_data import process_raw
from scripts.generate_plec import generate_plec_pdbbind
from scripts.ge... |
0d187786660a01ed5c560667f3f127ae956db965bab4373425b3b10ca70a8dd0 | Python | 16,467 | 365 | from typing import Callable, Tuple, List, Dict
import numpy as np
import torch
import torch.nn.functional as F
from movie_upsampling import compute_interval_overlaps, flat_sparse_upsample_transpose_cuda, flat_sparse_upsample_cuda
import lib.data_utils.dynamic_data_util as ddu
from glm_precompute.ct_glm_precompute imp... |
81698d3f62bdea276919f94994148db4ce37a43642a14b57508b185997a05d19 | Python | 16,483 | 313 | r"""
The file contains stimuli generated based on a texture image
"""
from mozaik.stimuli.vision.visual_stimulus import VisualStimulus
import mozaik.stimuli.vision.visual_stimulus
import imagen
import imagen.random
from imagen.transferfn import TransferFn
import param
from imagen.image import BoundingBox
import pickl... |
e27c14a626156cbfb59d70c1a4dea847ff49091239981ba621e2ec741cdde435 | Python | 16,498 | 443 |
# !/usr/bin/env python
import os
from collections import OrderedDict
from timm.models.layers import DropPath
import torch
from torch import nn
from torch.nn import MultiheadAttention
import torch.nn.functional as F
import torch.utils.checkpoint as checkpoint
MODEL_PATH = '/mnt/lustre/share_data/likunchang/model'
_M... |
f3049849944e10763facd237a640c257bebb62f1fefece849503f21222f9a922 | Python | 16,503 | 373 | # --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ze Liu
# --------------------------------------------------------
from tutel import system
import os
import time
import json
import rando... |
fbb0187475e38d2bf9e5193abf751eef0ecdca9646efc586434f0d7df525ad5a | Python | 16,504 | 484 | """
MLX-based PCA implementation for Apple Silicon GPU acceleration.
Automatically detects MPS device and uses MLX for computation when available.
Falls back to sklearn when MLX is not available or device is not MPS.
This module is designed to be integrated with omicverse's PCA pipeline.
"""
import numpy as np
import... |
bd288f5510cc704f3438552df80a6bacb6148c30e573ceb3e564ab020f2d1870 | Python | 16,537 | 432 |
import gym
import numpy
import random
from gym import error, spaces, utils
from gym.utils import seeding
from matplotlib import pyplot
from collections import OrderedDict
from gym_sted import rewards, defaults
from gym_sted.utils import SynapseGenerator, MicroscopeGenerator, get_foreground
from gym_sted.rewards impo... |
02daa8410b3d716de0f6b53d6932f9c675907278da6785effb0d99e4f14bcebb | Python | 16,540 | 379 | r"""Publication-quality sequence & construct visualisation.
The bar charts elsewhere are for *numbers*; DNA deserves proper genetic maps.
These helpers use `dna_features_viewer <https://edinburgh-genome-foundry.github.io/DnaFeaturesViewer/>`_
(the Edinburgh Genome Foundry library, same lab as DNAchisel) and
``logomake... |
c3055d180e61d60c0603f94a171725d2444d58d1fca5d1aa8a22147c5e4d8792 | Python | 16,543 | 396 | # 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... |
6946692ec9b16b1c8a2cf05b4e03bcd17ed86c6437b29ecad8551e8faefdba6a | Python | 16,554 | 413 | import numpy as np
import pandas as pd
import ants
import os
import torch
from matplotlib import pyplot as plt
from tqdm import tqdm
from importlib import reload
import pickle
import helper_funcs;reload(helper_funcs);from helper_funcs import *
import cave_vae_models
reload(cave_vae_models)
from cave_vae_models import ... |
2b4db6e4f4b91fc4d61dd0115905c45e1266f4c937f8d9c0180fe45733f3ce52 | Python | 16,564 | 455 | """
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 asyncio
import json
from datetime import timedelta
from typing import Any
import requests
from ... |
c8fb92c34ccdd2ee8c397675ba5baba0274d96f3b5e4f3246d4f66317d923a30 | Python | 16,564 | 476 | #
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or ... |
aa3f58d5a1fbc1a9ae4b04d6066aee2e7e823fdffc2973aa4e915f036a2b2dcf | Python | 16,566 | 408 | # 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... |
29a7c7e761d47cdb3d0622dc550356a9e1de3c7e72a086463474de3d415927ef | Python | 16,573 | 433 | #
# 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... |
9ab8132401258da71daf76410ebbbe328c80b8fdfd035807bcd401797129fd5d | Python | 16,579 | 428 | # -*- coding: utf-8 -*-
""" Module for pairwise functional alignment
"""
import os
import warnings
import nibabel as nib
import numpy as np
from joblib import Memory, Parallel, delayed
from nilearn.image import concat_imgs, load_img
from nilearn.maskers._masker_validation import _check_embedded_nifti_masker
from sklea... |
65061573b72bb7215115cc2a8253448be33ac8cc11d7ccfbdbfdc139f5389521 | Python | 16,585 | 362 | from argparse import ArgumentParser
from typing import List, Tuple
import os
import os.path
import sys
import skimage
import skimage.segmentation
import sklearn.preprocessing
import sklearn.model_selection
import math
import shutil
import pathlib
import glob
import shutil
import uuid
import random
import platform
impo... |
d2e2d63857a24490aa99473fdae2b7d66bc97a6b17f90060c54afe3f95c2c7b3 | Python | 16,589 | 498 | # 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, software
# distributed under th... |
c9bc6e14b14df0f5dfb349ea46c438c9747f47d8f52c242f6b2aa3ba0e789e33 | Python | 16,591 | 463 | from __future__ import division
import numpy as np
from ..utils import *
from .. import gpu_utils
# Import manually defined functions
from .variational_nodes import BernoulliGaussian_Unobserved_Variational_Node
from .variational_nodes import UnivariateGaussian_Unobserved_Variational_Node
class Z_Node(UnivariateGauss... |
d5cc45f975c89bc8222201dcd2fa54e7a91410e5df42dd732c1de08e428dd320 | Python | 16,592 | 444 | # 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... |
df067217e8e8051bdbd52c465bb9044a982b462a195f0a0bcf94d895efe96a3e | Python | 16,599 | 508 | # 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... |
56a0690c87464d44488488b9067bda63f2f97987ed4c081ed89e938db06e6233 | Python | 16,600 | 401 | ####################################################################################################
# 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... |
ca1cca15c5036f809b604eb9287a44672009827efafd26e1ab3d7b760ba75d14 | Python | 16,604 | 314 | import matplotlib.pyplot as plt
import pickle
import numpy as np
import os
from util import *
from sklearn.metrics import accuracy_score, confusion_matrix, roc_auc_score, roc_curve, precision_recall_curve, PrecisionRecallDisplay
def plot_scatter_plot(label_d, score_d, label_a, score_a, filename):
junc_prob = label... |
f4c39e8b002175a1760fc0db0ada3e3e738bc8bde45f515497c51c71abac86ee | Python | 16,616 | 405 | #!/usr/bin/python
####################################################################################################
# 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>
#
# T... |
0ec869ec7123d0a57b4c5cb3a1dddfa39a4b45fcf47f6c3643290e21c19a9e55 | Python | 16,622 | 374 | '''
The frame rate and bin size for this script is hardcoded to be 8.333 ms, corresponding
to a 120 Hz frame rate on the stimulus monitor.
This is because we choose to compute the LNP models at frame rate, which is a non-integer
multiple of the electrical sample rate, and because the TTL trigger design for the white
n... |
fd515d145cff0664becd758b7543d7fea8ec25b1d755bc9581546c9da7f91e96 | Python | 16,622 | 377 | """Tool metadata contract and registry seam for OVAgent dispatch.
Defines the execution-facing tool metadata model (ToolMetadata) and the
registry (ToolRegistry) that maps canonical tool names to metadata and
handler callables. The model reuses ToolDefinition from tool_catalog
where available and adds policy attribut... |
30a5017b1cd4dca0b968975141e30d88f52b62c2f1ce2c13b58c047ad676d956 | Python | 16,628 | 383 | import numpy as np
import visionloader as vl
from typing import Tuple, List, Dict, Union, Set, Any
from collections import Counter
from lib.data_utils.contamination import contamination_search_duplicate_merge
from lib.data_utils.cosine_similarity import MatchPair
import lib.data_utils.sta_metadata as sta_metadata
... |
1fc1bed0a17828b33c3188de5d818b07f9caffc32d938a56744c6b58495cdb81 | Python | 16,631 | 444 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" functions related to the creation and management of the cluster
We put arrays on disk as raw bytes, extending along the first dimension.
Alongside each array x we ensure the value x.dtype which stores the data type.
@author andrea giovannucci
"""
# \package caiman
# ... |
29ae55a1f3a72cabbd026cc7aebb730e778434f5c4014ec2eeb3ce51fc5d52d4 | Python | 16,640 | 346 | import logging
import os
import sys
import numpy as np
import tensorflow as tf
def set_up_logging(logging_dir, model_name):
"""
Set up logging for the simulation.
"""
os.makedirs(logging_dir, exist_ok=True)
logging.basicConfig(
level=logging.DEBUG,
handlers=[
logging.Fil... |
c746ee4ee678f4a646fce595e1c01eb293cfb8fb32e8e872c129c386b7050840 | Python | 16,641 | 451 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
"""
Apply per-sample minGQ filters to an input VCF
"""
import argparse
import sys
from collections import defaultdict
import csv
import numpy as np
import pysam
import svtk.utils as svu
# Make dummy dict for all unique ranges of SVLEN
def _make_SVLEN_interval_dict(min... |
d74eb1bf26cfbc5aac1e524e8233ac8b014bf66280d9c90063da25847cd2c0c0 | Python | 16,646 | 397 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Conductance converters for the phenomenological noise models for inference."""
from typing import Dict, List, Optional, Tuple
from torch import abs as torch... |
72a7a1fd0fe00ded8ef972bbacd43c1d61258ef242545d9b844d17203752f0a4 | Python | 16,647 | 362 | from argparse import ArgumentParser
from typing import List, Tuple
import os
import os.path
import sys
import skimage
import skimage.segmentation
import sklearn.preprocessing
import sklearn.model_selection
import math
import shutil
import pathlib
import glob
import shutil
import uuid
import random
import platform
impo... |
27c0046406575267bb3912112f6c9a7674d7a287e85ee3dcfff2ec2c76bca43c | Python | 16,649 | 366 | import torch
import torch.nn as nn
import gaussian_denoiser.dpir_models.models.basicblock as B
import numpy as np
'''
# ====================
# unet
# ====================
'''
class UNet(nn.Module):
def __init__(self, in_nc=1, out_nc=1, nc=[64, 128, 256, 512], nb=2, act_mode='R', downsample_mode='strideconv', ups... |
d19fd47645320e2d9ced6afdeafdc9a1d9e00347bce31b7b02c2e1b921a641e8 | Python | 16,652 | 382 | import copy
import warnings
from typing import Dict, Tuple, Union
import torch
from mmdet.models import SingleStageDetector, TwoStageDetector
from mmengine.model import BaseModel
from torch import Tensor
from lqit.common.structures import OptSampleList, SampleList
from lqit.edit.models import add_pixel_pred_to_datasa... |
a8105638286a3f2884ee036d0dc4667aa84eeea7cd9356e63f875211324d3cf4 | Python | 16,653 | 460 | ####################################################################################################
# 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... |
36c63d6ea839417fece5c9f0ea134f640d11247991154c7b431b55e3c7b459d8 | Python | 16,659 | 603 | import torch
from latent_time_stepping.oracle import ObjectStorageClientWrapper
from latent_time_stepping.special_loss_functions import MMD
from latent_time_stepping.AE_training.optimizers import Optimizer
import pdb
import torch.nn as nn
import matplotlib.pyplot as plt
class LatentRegressor(nn.Module):
def __in... |
ddb69ff2853bdd16f49c296d1fdf112add8c1abd05bd0b34cc06d7d455e8f073 | Python | 16,659 | 420 | # -*- 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.
#... |
6518e730ae742a615b87a6fbe22354b233202a556365175e1965871f6a729414 | Python | 16,666 | 387 | import copy
from typing import Any, Dict, Tuple, Union
from mmengine.model import BaseModel
from mmengine.model.wrappers import MMDistributedDataParallel as MMDDP
from mmengine.utils import is_list_of
from torch import Tensor
from lqit.common.structures import SampleList
from lqit.detection.utils import merge_det_res... |
b2d802200aa83c0d5bcfdbccd09cd65a47807fb830f211b699cd9379dd8dd714 | Python | 16,669 | 445 | ####################################################################################################
# Copyright (c) 2020, 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... |
8ab08758ccc0996997a53d23c69827bddc3df51a5e876503de8c0e400b55b235 | Python | 16,674 | 489 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.hub import load_state_dict_from_url
from torch.nn import Parameter
__all__ = [
"ResNet",
"resnet18",
"resnet34",
"resnet50",
"resnet101",
"resnet152",
"resnext50_32x4d",
"resnext101_32x8d",
"wide_resnet50_... |
12de742c708d5f48f05375bdea6c3a34c24ebfa7d9929736e5ebc3e0092371df | Python | 16,680 | 482 | # Copyright NVIDIA Corporation 2023
# SPDX-License-Identifier: Apache-2.0
import fnmatch
import io
import json
import re
import tarfile
from functools import partial
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Union
from ray._common.utils import env_bool
from ray.data._internal.ut... |
a0a8893767ffd97751aee4ba57ee31f37dbec0da2e149c1602a2a1f21f9aabdb | Python | 16,683 | 469 | """
This module contains tests that run mozaik models and compare their output to a
saved reference.
"""
import numpy as np
import os
import sys
import subprocess
import textwrap
import shutil
from mozaik.storage.queries import *
from mozaik.storage.datastore import PickledDataStore
from mozaik.tools.distribution_para... |
0a5e1ada3b78f0a3b156249e5e9e66574fd0733489222b21f0a239958ce1b362 | Python | 16,686 | 467 | """
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
from functools import partial
from typing import TYPE_CHECKING
import torch
import torch.nn as nn
fro... |
8986cbca5b0167f76efc34a4d23aa4e18d3f08b272234ebe2f7292e11c4f15ed | Python | 16,688 | 452 | """
Wrapper specifications for class-backed MCP tools.
Each wrapped class has a ``ClassWrapperSpec`` that defines its fixed action
set, parameter schemas, and lifecycle rules. No generic method dispatch is
ever allowed — every callable action is explicitly enumerated here.
"""
from __future__ import annotations
fro... |
832ec1d503c51dab6460c113c6d6c545b84cd1fa36b0150944a97a75f5a6d0a7 | Python | 16,692 | 416 | r"""Visualisation helpers for :mod:`omicverse.synbio`.
Keeps tutorial/notebook cells to a single call (the omicverse convention: plot
logic lives in the package, not inline in notebooks):
* :func:`view_structure` — interactive 3D (py3Dmol) coloured by pLDDT bands.
* :func:`plot_variant_effect` — deep-mutational-scan ... |
4766a69119bdb1ffa131c1fc03508f99885b330d4c60c12a13e525990469e79c | Python | 16,693 | 369 | # Ultralytics YOLO 🚀, GPL-3.0 license
import contextlib
import math
from pathlib import Path
import cv2
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sn
import torch
from PIL import Image, ImageDraw, ImageFont
from PIL import __version__ as pil_version
fr... |
0507881f3d3b9e2e0cf7d3fb88f616fe65b93808e251907d0f9d69f95109d49d | Python | 16,704 | 470 |
# !/usr/bin/env python
import os
from collections import OrderedDict
import clip
from timm.models.layers import trunc_normal_, DropPath, to_2tuple
import torch
from torch import nn
from torch.nn import MultiheadAttention
import torch.nn.functional as F
import torch.utils.checkpoint as checkpoint
def conv_3xnxn(inp, ... |
a8ad51109b22f3be9c7e228a6c318d786d467550b0fc4e6231d9ab1a4f6c882e | Python | 16,714 | 387 | ####################################################################################################
# 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... |
0c32b93b63082244b0bd3dc0a71c119a5534e6ec97f308b75c96095d34d7e594 | Python | 16,730 | 423 | ####################################################################################################
# Copyright (c) 2020 - 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... |
761d29d5d5428b9f7f9d2ff4e37f447e802ae9ac8c6f8cec4a15d08a4ea6a282 | Python | 16,732 | 414 | ####################################################################################################
# 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... |
d585a1e9d9f80c8911fcac7048fa8ee21d5a6918a6c950e08104189be280cf5c | Python | 16,747 | 385 | import importlib
import os
import ray
from tqdm import tqdm
import yaml
import pdb
import numpy as np
from matplotlib import pyplot as plt
import torch
from data_assimilation.particle_filter.NN_forward_model import NNForwardModel
from data_assimilation.particle_filter.nudging_filter import NudgingFilter
from data_assim... |
352416bcfe78b2d2a545a2b3e449c96489715f3dfbdedb5e74c49aac6b05d268 | Python | 16,748 | 500 | import os
import numpy as np
import tensorflow
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import RMSprop
from tensorflow.keras.callbacks import ModelCheckpoint, LearningRateScheduler
import deepinterpolation.loss_collection as lc
from tensorflow.keras.layers import Input
import math
impo... |
0942fdbd0fc5e5a3ca589ab78313339249d577dd05b527b09946ca1180173dfb | Python | 16,752 | 473 | # Copyright (C) 2022 Intel Corporation
# Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
from enum import StrEnum
from typing import cast
from django.conf import settings
from rest_framework.exceptions import ValidationError
from cvat.apps.engine.models import Job, Project, Task
from cvat.apps.eng... |
ddc5126f11c3385c7f812ea29c30cbf34532bf821a52bc7bdd9f09dc3acd21c5 | Python | 16,764 | 497 | # 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... |
c2de4f185e4fa6bc079c60ae15cf7e4c29c653787878f1881868866bc7c459b9 | Python | 16,768 | 302 | from .CAST_Mark import *
from .CAST_Stack import *
from .CAST_Projection import *
from .utils import *
from .visualize import *
from .model.model_GCNII import Args, CCA_SSG
def CAST_MARK(coords_raw_t,exp_dict_t,output_path_t,task_name_t = None,
gpu_t = None,args = None,epoch_t = None, if_plot = True,
... |
40cf708f440bffb223874a106866b03c261c8a08cd9335753937fe18a1de6716 | Python | 16,775 | 361 | import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import numpy as np
import pandas as pd
from random import choices, sample
from itertools import combinations
from scipy import stats
import tensorflow as tf
from tensorflow import keras
import time
import random
from tensorflow.keras.model... |
5bdfda0c3ed25a2b1e34b1147e6a5d08682feb7b3a9b8decfa841dc6657d7838 | Python | 16,791 | 428 | from ..pp import (
qc,
preprocess,
scale,
pca,
score_genes_cell_cycle,
neighbors,
umap,
tsne,
)
import scanpy as sc
import numpy as np
from .._settings import add_reference, settings
from .._registry import register_function
@register_function(
aliases=['一键单细胞流程', 'lazy', 'lazy sc... |
0e9997ca26771721d68808a139a4f51d78e06def062ba373bad98a5d5cca2055 | Python | 16,794 | 392 | import pandas as pd
import os
import numpy as np
import csv
import shutil
import math
import ants
from nipype.interfaces import fsl
from config import config
from utils import utils
def coregister_timepoint(row, logger, keep_old=True):
accession_number = row[1].AccessionNumber
if math.isnan(accession_number... |
e66b62bdc3f6e8c54019aa7611b5015d512aa089eb06c36b6b7c00d1e2dd01eb | Python | 16,795 | 467 | """
Edge-of-synchrony measures
"""
import numpy as np
import neurokit2 as nk
import scipy
import edgeofpy as eop
def pcf(data):
"""Estimate the pair correlation function (PCF) in a network of
oscillators, equivalent to the susceptibility in statistical physics.
The PCF shows a sharp peak at a critical va... |
a1c0e4dfedbe828fe1a9fcc3ba17cc77db3086500c7f2739573d817a4c0c8b8c | Python | 16,798 | 488 | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 27 00:46:20 2023
@author: Leyang Xue
"""
import sys
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.image as mpimg
# Add package path
packagepath = '../kcorePercolation' # Manually specify the path to your script
sys.path.appe... |
b1490623dde460daa5dfa5f93a66ce346c5ad7d4c33cab5e65403fc3fe38f044 | Python | 16,798 | 528 | import sys
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from matplotlib.colors import LinearSegmentedColormap
from scipy import interpolate
import logging
from time import time
import warnings
from scipy import optimize
from scipy import linalg
from scipy import stats
from .._finite_differenc... |
6a1cde23f2662260e67d6edc3d5bba1dcf0ad1efd309501681662f696933572e | Python | 16,800 | 502 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from itertools import product
from copy import deepcopy
import nibabel as nib
import numpy as np
import multiprocessing as mp
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import statsmodels.formula.api as smf
from joblib import Memory, Parallel... |
9c532e81a7829b0151b14a4eaad900e503a13b9a4278663ae4d78106631927e2 | Python | 16,816 | 483 | from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
import numpy as np
import ray
from ray.data._internal.logical.interfaces import SourceOperator
from ray.data.block import Block, BlockAccessor, BlockMetadata
from ray.exceptions import RayError
from ray.types import ObjectRef
if TYPE_CHECKING:
fr... |
dde7c73a1e72e3a432871549170a2722077a4ed6d9aa35fb43f20586d39b3489 | Python | 16,821 | 426 | import numpy as np
from numpy.random import default_rng
import torch
import torch.nn.functional as F
import random
import matplotlib.pyplot as plt
from contextlib import contextmanager
from matplotlib.patches import Ellipse
import matplotlib.transforms as transforms
from astropy.convolution import convolve
import warni... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.