sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
e01e2b426de23a536698c442d4de523f804586d2bd9108b809c6167ad6c9578d | Python | 34,892 | 862 | import unittest
import numpy as np
import pandas as pd
from skbase.utils.dependencies import _check_soft_dependencies, _safe_import
from pgmpy import config
from pgmpy.example_models import load_model
from pgmpy.factors.continuous import LinearGaussianCPD
from pgmpy.factors.discrete import TabularCPD
from pgmpy.facto... |
918cb2720fe681dcc432b072117e79d38f3a486c131133a2053d295f9ebcab91 | Python | 34,974 | 897 | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... |
1622ae65c71546c85eed49bdcffe82b5eb3365432309f6f1dcea4f9cf8299f48 | Python | 35,033 | 892 | # Copyright (c) Facebook, 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 math
from typing import List, Optional
import torch
import torch.nn as nn
from fairseq.token_generation_constraints import (
Cons... |
b1ae6cfa726be11281fac550633d8ba4747b1e210ba04a130d04df528892ba58 | Python | 35,078 | 815 | """A copy of the DeepTfExplainer from the deepShap repository.
I modified a bit to work with TF 2.16 and trimmed some imports.
The original DeepShap code is licensed under the MIT license. You can find
a copy of this license at ``etc/shap_license.txt``.
Note: I have *removed* quite a few features that BPReveal doesn... |
536544fee094e2d4e84757f9f335c3c46508ecad20043e3881d67eb8c96e4b3c | Python | 35,110 | 789 | import theano
from theano.sandbox.cuda import dnn
from .. import init
from .. import nonlinearities
from .base import Layer
from .conv import conv_output_length, BaseConvLayer
from .pool import pool_output_length
from .normalization import BatchNormLayer
from ..utils import as_tuple
if not theano.sandbox.cuda.cuda_e... |
6e664ec35f454fb16482f1afbba7d1ca8e2e884525b27bbc7ccf26faac9e8b7e | Python | 35,150 | 853 | #%% The main script of the spatial jitter simulations
import numpy as np
import matplotlib.pyplot as plt
from bfieldtools import sphtools as sph
import functions
font = { 'size' : 20}
plt.rc('font', **font)
#%% Plot parameters
legendfontsize = 15
linewidth = 2.5
#%% Define simulation parameters
#the path to s... |
69b975a1ea835943cb9537b20d44e14341536c00dc34dc761c8fb17c1cf2f107 | Python | 35,156 | 533 | #!/usr/bin/env python
'''
(c) 2016-2020 Oleksandr Frei, Alexey A. Shadrin, Dominic Holland
MiXeR software: Univariate and Bivariate Causal Mixture for GWAS
'''
import argparse
import numpy as np
import pandas as pd
import scipy.optimize
import json
import scipy.stats
import random
import time
import common.utils_cli
... |
fdff88c882872df625c3563aaa3fa0333ff33f244accb8629fa6d30c3f575d1c | Python | 35,159 | 893 | from __future__ import annotations
import logging
import warnings
from typing import TYPE_CHECKING
import numpy as np
import torch
from torch.nn.functional import one_hot
from scvi import REGISTRY_KEYS, settings
from scvi.data._constants import ADATA_MINIFY_TYPE
from scvi.distributions._utils import _needs_cpu_detou... |
b216509e89c68701585b67f807dd853a5d6cc68cede566cd89250bf7d3c339e5 | Python | 35,221 | 1,186 | # -*- coding: utf-8 -*-
"""
Created on Tue May 6 17:00:16 2025
@author: hanna
"""
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 23 22:50:55 2025
@author: hanna
"""
import os
import pickle
import numpy as np
import pandas as pd
from tqdm import tqdm
import seaborn as sb
import matplotlib as mpl
import matplot... |
0dde50b837751582b66d5f51cfdfe0f0d62ae0c57afc0ba9fabd2439c1da83be | Python | 35,236 | 910 | # Copyright (c) Facebook, 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 math
from typing import Dict, List, Optional, Tuple
import torch
import torch.nn.functional as F
from torch import Tensor, nn
from tor... |
63e7ca90841e9bf0ab5fabfa1b223d703231f0c4c8ffee41d923128e02aa4367 | Python | 35,298 | 860 | """Model class for contrastive-VI for single cell expression data."""
from __future__ import annotations
import logging
import warnings
from functools import partial
from typing import TYPE_CHECKING
import numpy as np
import pandas as pd
import torch
from scvi import REGISTRY_KEYS, settings
from scvi.data import An... |
69ffc00678a834f49d6b8e29c1f74b333e2fa4701178302422f103128f64fecc | Python | 35,375 | 1,018 | """
Module for generating LD scores for each spot in spatial transcriptomics data.
This module is responsible for assigning gene specificity scores to SNPs
and computing stratified LD scores that will be used for spatial LDSC analysis.
"""
import gc
import logging
import warnings
from pathlib import Path
import nump... |
28dd7032c0afc45b54a7c6c8d60a29265e725854ae5f39e9b7a147dfb6b23ad7 | Python | 35,391 | 748 | import math
from math import gamma
import os
import json
import copy
from typing import Optional, Tuple, Union
import torch
import torch.nn.functional as F
from dataclasses import dataclass
import torch.nn as nn
from torch.nn import CrossEntropyLoss
from torch.nn.modules.sparse import Embedding
from transformers import... |
6ec762c88f5e40a236340bd54186d01ff13f248ac8af13284456550de14e35f5 | Python | 35,413 | 866 | """Main module."""
from collections.abc import Iterable
from typing import Literal
import numpy as np
import torch
import torch.nn.functional as F
from torch.distributions import Normal
from torch.distributions import kl_divergence as kl
from torch.nn.functional import one_hot
from scvi import REGISTRY_KEYS
from scv... |
45afb623a31835399988116ce59f9ee9d5c6fda20fd8030bf7559894f91bfa23 | Python | 35,420 | 872 | import functools
from functools import partial
from unittest import mock
import jax
import jax.numpy as jnp
import jax.tree_util as jtu
import numpy as np
from laplacian_testcase import LaplacianTestCase
from packaging.version import Version
from parameterized import parameterized
from folx import (
deregister_fu... |
103716dbdd7ab4afbe24edca8f422dc77b17a40e761be50409a4ab53491733ca | Python | 35,475 | 971 | #!/usr/bin/env python3
# MIT License
#
# Copyright 2024 Broad Institute
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... |
e0fa550be9d5421d6b351a45f476e9d6185d195e7dc6e08b2d363af81222e685 | Python | 35,497 | 1,132 | from __future__ import annotations
import contextlib
import logging
import os
import platform
import re
import shutil
import sys
from collections.abc import Iterator
from pathlib import Path
from typing import TYPE_CHECKING
import findpython
import keyring
import packaging.version
import pytest
import responses
fro... |
7d08bf68a2accf9f068ac48b15330af8b12557b80a1dec7bd01e8a3b633c45af | Python | 35,551 | 819 | #!/usr/bin/python
# -*- coding: ISO-8859-1 -*-
from qtmodern import styles, windows
from qtpy import QtGui, QtCore
from qtpy.QtWidgets import *
import subprocess
import glob
import shutil
import os
import time
import psutil
from collections import namedtuple, OrderedDict
from pprint import pprint
from recordclass imp... |
e97f578563ac5d0853cb7ce32eb3d97d66307d2baf312efc7fcb8d7385dcdfaa | Python | 35,553 | 820 | #!/usr/bin/python
# -*- coding: ISO-8859-1 -*-
from qtmodern import styles, windows
from qtpy import QtGui, QtCore
from qtpy.QtWidgets import *
import subprocess
import glob
import shutil
import os
import time
import psutil
from collections import namedtuple, OrderedDict
from pprint import pprint
from recordclass imp... |
e456394855b8d307e758f1a30e36a4e0f86a0f3de12a3b3fe45046568f69a32b | Python | 35,585 | 898 | #!/usr/bin/env python3
"""
Classical Comparators for TSNFA Monte Carlo Paper - Deliverable 1
==================================================================
Implements four binary frame-level event detectors at Cortex-M0 cost class,
adapted to TSNFA's regime (100 Hz sample rate, 128-sample frames):
Slot 1: Lip... |
e2d79a63fa3e2a50b956df5943a2b8d3462dc9aa611eea193a555c0c363c8469 | Python | 35,634 | 691 | """
This module is responsible for creating the final output file for MM/PBSA
statistics printing.
"""
# ##############################################################################
# GPLv3 LICENSE INFO #
# ... |
cac49ec54677f32b9ad99eef67528cc110e0b37fd3a4ad51d4dd2b717d153430 | Python | 35,640 | 874 | import torch
import torch.distributed as dist
import torchmetrics
import json
import math
import numpy as np
import os
import copy
import faiss
import time
import pandas as pd
import random
from tqdm import tqdm
from .protein_encoder import ProteinEncoder
from .structure_encoder import StructureEncoder
from .text_enco... |
7ca5e15ef1b2b2dffe9ee1985dcae70bdd92dbe1085b0d9cdfcc9a80158517d4 | Python | 35,796 | 951 | """
Inspired and partly copied from https://github.com/google-research/google-research/blob/ad2d81983e4c717f477a232f625d0da2808b15aa/d3pm/text/diffusion.py
"""
import os
import torch
import abc
import fastNLP
import numpy as np
from typing import Any, List, Optional, Sequence, Union
import utils
from transformers impo... |
b0ea7a535b639e11ac2f20bfe74b7d2fca745b0f7da58b9458dd2fd67c959aaf | Python | 35,831 | 714 | """Dual-echo pCASL processing scripts for ETLAS2 dataset.
This module contains core processing pipelines used in the ETLAS2 paper:
Neurovascular effects of tadalafil in patients with
cerebral small vessel disease: ETLAS-2 substudy
- motion correction and template registration for dual... |
1fa4d5606c517f49d29a45c37dc08be3317a3858283c428d3a6929ebdbd20a20 | Python | 36,024 | 997 | import numpy as np
import pandas as pd
from collections import OrderedDict
import warnings
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA
from sklearn.neighbors import NearestNeighbors
from sklearn.metrics import silhouette_score
from scipy.spatial.distance import cdist
from scipy.stats ... |
227a63ef1ac4caea5bfb3229af247424485c496e40697f5c4a862573b38a7af4 | Python | 36,043 | 901 | # Copyright (c) Facebook, 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 logging
import os
import math
import numpy as np
import torch
import warnings
from fairseq import metrics, search, tokenizer, utils
fr... |
97579dde5e56ad55fd3b2b266814eb766574c489e75dd0b4b753a6b7ced09da3 | Python | 36,147 | 1,060 | """
Copyright (c) Facebook, 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 ast
import collections
import copy
import importlib
import itertools
import json
import logging
import os
import sys
import time
from ... |
77d4848fd7a60845d6a9af21e03eeeecab4f4538ec0b4a755c9276bbdaadcaea | Python | 36,230 | 886 | """
This module contains classes and functions that manipulate Amber prmtop
objects with respect to MM/PBSA. It will figure out where atoms belong
in the context of a complex/receptor/ligand system. It will also be able
to translate complex atom selections into either Amber masks or Amber
group input selection strings ... |
7db4869c1db5b973dcb99a1b1c50e4c43f4b3ecca635941ea8733953006f0bab | Python | 36,411 | 936 | # Copyright (c) Facebook, 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 ast
import collections
import contextlib
import inspect
import logging
import os
import re
import time
import traceback
from collection... |
026525fe5743cf726258e81d1825c9d0d64c29d62f5d23dd457e152b42dfa14e | Python | 36,424 | 1,033 | """Gold-mention labelling and the window-overlap rules."""
import pathlib
import numpy
import pytest
from conftest import _ENZYME, _encode, _labels_over
from d3text import corpus, surface_forms, token_labels
from hypothesis import HealthCheck, given, settings
from hypothesis import strategies as st
_TESTDB = (
p... |
1b8e55a7bbf56a3aebafea0578ea207ed019d2a995d6dbf4fdaf5cbbee22c463 | Python | 36,733 | 1,003 | import torch
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import savemat
from .math import nm, um, mm, cm, m
class Light:
def __init__(self, dim, pitch, wvl, field=None, device='cpu'):
"""
Light wave that has a complex field ... |
7d7a6310a03a4ff400e55265cc5e19a3490cf83f7ee88995543ba3a3c4fbaf4a | Python | 36,853 | 901 | import os
from collections import namedtuple
from pathlib import Path
from typing import Callable
import click
import cv2
import dask
import dask.array as da
import matplotlib.animation as animation
import matplotlib.pyplot as plt
from tqdm import tqdm
import moving_least_squares
import numpy as np
import xarray as xr... |
63a6a1e3e4be2d63cb51c529a079fea527b5f90e871c465097ab97c6ece65cc0 | Python | 36,871 | 652 | import argparse
import sys
import time
import os
import shutil
import sys
from copy import deepcopy
from functools import lru_cache
from typing import List, Union, Tuple, Type
import numpy as np
import torch
from batchgenerators.utilities.file_and_folder_operations import load_json, join, save_json, isfile, maybe_mkdi... |
e6a3875e1e3fc2142b6dca00fc448b7c194a90af5ef4ab1b6fe3081ef78b29f2 | Python | 36,871 | 1,131 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Name: Robert Kim
# Date: October 11, 2019
# Email: robert.f.kim@gmail.com
# Description: Implementation of the continuous rate RNN model
import os, sys
import numpy as np
import tensorflow as tf
if tf.__version__[0] == '2':
import tensorflow.compa... |
3c5f508c21c067fedf1945832ec6f935c3f27b522dab82a97d7a4e50b08808ca | Python | 36,893 | 667 | ###主要功能:在已经获得的组内叠加平均数据的基础上进行时间窗叠加平均和组间叠加平均
###首先在第29行设置需要保存结果的日期文件夹
###时间窗叠加平均:1)先选择视觉刺激或电流刺激
### 2)在visualresults或者/electricalresults中选择已经被组内叠加平平均的数据组
### 3)按顺序依次处理完所有数据组
###组间叠加平均:1)选择视觉刺激还是电流刺激(处理对象是已经进行过时间窗叠加的数据组)
### 2)选择起始数据和终止数据(就是确认哪些组是要进行叠加平均的)
###20210915 将组间叠加的数据添... |
399eda8814f20b6a021fe524ab91eb09a85a0d1d1c22678dd207130d08535775 | Python | 36,910 | 1,091 | from datetime import datetime
import matplotlib.pyplot as plt
import matplotlib.widgets as widgets
import numpy as np
import itertools
import cv2
from scipy.interpolate import Rbf
from tkinter import Tk, messagebox
import click
import matplotlib as mpl
from matplotlib.colors import to_rgb
from sys import platform
if p... |
1b52f8577fa0d2db14d6e3cd898cf3d3232b32c25fc15d55f18b8e3a8a203ed5 | Python | 36,979 | 951 | #!/usr/bin/env python
import argparse
import dataclasses
import logging
import math
import os
import pathlib
import queue
import threading
import typing
from collections.abc import Sequence
from concurrent.futures import (
FIRST_COMPLETED,
Future,
ThreadPoolExecutor,
as_completed,
wait,
)
import lm... |
ad34350f5f2d346f074d438bf96d9401246c16dcc150817f662d2a738204fa13 | Python | 37,015 | 896 | from __future__ import annotations
import inspect
import logging
from os.path import join
from pathlib import Path
from typing import TYPE_CHECKING
import numpy as np
import torch
from anndata import AnnData
from lightning.pytorch.callbacks import Callback
from lightning.pytorch.loggers import TensorBoardLogger
from ... |
6cb101d3e98fdc912ddc1560a37330b90522aa303ffe721800ca856e76af212b | Python | 37,145 | 1,070 | #!/usr/bin/env python3
"""
neighborhood_diagnostics.py
---------------------------
Standalone script for neighborhood diagnostics:
1) Protein diversity per kNN neighborhood
2) GO multiplicity per neighborhood
3) Neighborhood reuse overlap across queries (Jaccard of neighbor protein sets)
Two kNN backends:
- br... |
33a22c397ec379ed98a8ae8345a585aefc38171da6658ff0d5937c6e05741765 | Python | 37,173 | 916 | #!/usr/bin/python
# -*- coding: ISO-8859-1 -*-
from qtmodern import styles, windows
from qtpy import QtGui, QtCore
from qtpy.QtWidgets import *
import subprocess
import glob
import shutil
import os
import time
import psutil
from collections import namedtuple, OrderedDict
from pprint import pprint
from recordclass imp... |
627eb7e697bf29a5aeb3f749a365492d61607e2ea4599c856d42a790d1239559 | Python | 37,243 | 820 | from __future__ import annotations
import argparse
import json
from pathlib import Path
import numpy as np
import pandas as pd
from scipy.stats import pearsonr, spearmanr
from sklearn.metrics import average_precision_score, roc_auc_score
from st_risk.eval.reference_eval import (
compute_reference_marker_scores,
... |
2c748f4892f427eb073f09555f57f56dd10da0356c4a0f42663e5ef51b859b94 | Python | 37,260 | 1,020 | # Copyright (c) Facebook, 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 argparse
import math
from collections.abc import Iterable
import torch
import torch.nn as nn
from examples.speech_recognition.data.dat... |
71bafd2f98676b9f231a73d0d4b42d7e93969d1d25611d7a69fb742832318ff7 | Python | 37,264 | 1,009 | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... |
bae70ffae0092e147122adc71e91efc97e41f66d7cd57739bba57104caccdd3e | Python | 37,329 | 839 | from argparse import Namespace
from collections import OrderedDict, Counter, namedtuple
from copy import deepcopy
import os
import tempfile
import unittest
import intervaltree
import itertools
import numpy as np
np.random.seed(7)
import parasail
import pysam
from medaka.common import yield_from_bed
from medaka.vcf im... |
8a36fffdd30c7b46c7b98a901061aeb3062305ab91cbb6dcf8739d91066c4469 | Python | 37,407 | 1,099 | import collections
from collections.abc import Callable, Iterable
from functools import cache
from typing import Literal
import torch
from torch import nn
from torch.distributions import Normal
from torch.nn import ModuleList
from scvi.nn._utils import ExpActivation
def _identity(x):
return x
@cache
def _mps_... |
cf2fd12464718c76cbaee3edac532d14b87786f6fab69b27479d75e5001b48b2 | Python | 37,411 | 1,197 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 6 13:42:50 2025
@author: hanna
"""
"""
Figure 3 - Behavior
[3A] exponential (averaged by condition); fit exponential curve
[3B] performance during first PE TSN, second PE TSN, and best performance (variable TSN)
[3C] "AoL"
"rates"? (amount recove... |
d265d67a47d2baa45b4b0052a48af3d5d377063a851b7a178c99799fdd0117b4 | Python | 37,490 | 1,080 | """``precompute-token-labels``: the producer of the distant-supervision store.
Everything here runs off inline fixtures and a tokenizer built in-process — no
``documents.json``, no split csv, no download. The entity tables are a
hand-built dump of the same shape ``surface_forms.load_entity_tables`` reads,
which is all... |
39fa7d0bab9cecf23307a6f5dde12d22614deaf41f50576ad87ca43644f1d1ff | Python | 37,499 | 992 | import collections
import glob
import numbers
import os
from warnings import warn
import numpy as np
import copy
from mdt.lib.exceptions import ProtocolIOError
__author__ = 'Robbert Harms'
__date__ = "2014-02-06"
__license__ = "LGPL v3"
__maintainer__ = "Robbert Harms"
__email__ = "robbert@xkls.nl"
class Protocol(... |
4cbf3b893f9c1352c74004354093d71c50ebc4d43e467e61b3f0828c69c10514 | Python | 37,565 | 985 | from __future__ import annotations
import csv
import functools
import itertools
import json
import threading
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures import wait
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from ... |
6c22ce79251bee63c20b00df7ecef4e3a8614fedbf10da753545cfcb883a3b99 | Python | 37,648 | 899 | from typing import NamedTuple, List
from urllib.parse import urlparse
import os, sys
import subprocess
from subprocess import check_call, check_output
import glob
import wget
import re
import multiprocessing as mp
from functools import partial
import pathlib
from collections import OrderedDict
WORKDIR_ROOT = os.envir... |
f4180f362f614bafd3c9a5f2545d1210a094f381c20aeef95c785334615ced7a | Python | 37,649 | 897 | from collections import namedtuple
import pytest
# kmedoids/scikit-learn are imported lazily by rnalysis.utils.clustering (see tests/test_imports.py),
# so the star-import below no longer re-exports them -- the tests import them directly instead.
from kmedoids import KMedoids
from sklearn.cluster import KMeans
from ... |
b1d644ae62190a657123db60b2ded31147552a32cf60c5660a853aa4ce29eb30 | Python | 37,672 | 801 | import os
import qt, vtk, slicer
from PythonQt import BoolResult
from slicer.util import VTKObservationMixin
import WarpDrive, ImportAtlas
from ..Helpers import GridNodeHelper
import numpy as np
import glob
import json
class TextEditDelegate(qt.QItemDelegate):
def __init__(self, parent, renameControlPointsFunction):... |
eacba7c91df0086d06c729f9e9d46f51c736b4d2866baadbfbcde2c6e5020166 | Python | 37,707 | 792 | # coding=utf-8
# Copyright 2018 T5 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 copy of the License at
#
# ... |
4df7adcda592948ebbedf1597e9a039fb42fff8deb4fa6741fc03b6f04cb91f0 | Python | 37,708 | 793 | # coding=utf-8
# Copyright 2018 T5 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 copy of the License at
#
# ... |
7ae80ad381420617e347061ad9e8f8d5b13544a18512b13cbbc62f21bb14a6b6 | Python | 37,789 | 1,173 | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 4 13:28:36 2025
@author: MarcusBaaz
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def simulate_tumor_volume(
n_individuals,
dose_amounts_list,
dose_times_list,
a_drugs,
k_growth_mean=0.1,
k_growth_sd=0.02,
... |
b109921f6d9a8fa795b29043af7faa5ae5665e320d5cc32ebf2b10164660de24 | Python | 37,859 | 1,047 | import os
import tempfile
import unittest
import numpy as np
import numpy.testing as np_test
from skbase.utils.dependencies import _check_soft_dependencies
from pgmpy import config
from pgmpy.factors.discrete import TabularCPD
from pgmpy.models import DiscreteBayesianNetwork
from pgmpy.readwrite import BIFReader, BIF... |
4de1771fa1c6b1ef7ee3228d0dc596c88947c3a305180955f09078522fc29531 | Python | 37,882 | 774 | from modelR.backbones.mobilenetv2 import MobilenetV2
from modelR.necks.conv_csa_drf_fpn_hbb import Conv_CSA_DRF_FPN, FC_CSA_DRF_FPN, Cat_Conv_CSA_DRF_FPN, M_CSA_DRF_FPN
from modelR.head.dsc_head_hbb import Ordinary_Head
from modelR.loss.loss_hbb import Loss_s_l, Loss
import config.cfg_lodet as cfg
from modelR.laye... |
761a39a0d53df2e1cef3b533efedb0c850e2e36b8bd491f56c8a98c89f48a51d | Python | 37,940 | 156 |
"""Auto-generated schema validators for the JSON used by the main CLI."""
# DO NOT EDIT THIS FILE - IT IS AUTO-GENERATED BY build.py
# TO CHANGE A SCHEMA, EDIT THE CORRESPONDING .schema FILE
# AND RUN make schemas OR make all IN THE src DIRECTORY.
# pylint: disable=line-too-long
import json
from jsonschema import Draf... |
be1a95c9cb0341b1c813df4b7143e43fbf14f57cf9db7fe91f91eb1aff8a0dbe | Python | 38,107 | 872 | """
This module contains thread controller and thread.
As this module was developed rapidly per changing demand, some actually
unused code might still be saved as comments and there may be some codes that is
actually obsolete, but still not removed, as it might be used later on, if
demand changed.
"""
"""
Copyrigh... |
098a4551fb28fb0238a345b3270e8b501195436b9ac2d8c3d825f66447c68da2 | Python | 38,117 | 748 | """
This is a module that contains functions responsible for parsing the
input file for gmx_MMPBSA. It must be included with gmx_MMPBSA to
ensure proper functioning.
"""
# ##############################################################################
# GPLv3 LICENSE INFO ... |
b770089fcca0e54284d44723a3263954be07720683931ace7f91b6b709b1dbec | Python | 38,240 | 1,003 | #!/usr/bin/env python3
"""Mutation type analysis: BLASTn hits vs query genomes.
For each of 4 PhiX174-like phage datasets, BLASTn each genome against NCBI nt,
take the top 10 hits, fetch annotated GenBank records for those hits, classify
all mutations by type (synonymous, nonsynonymous, indel, intergenic) per gene,
an... |
39c7fe28645a0a892aa6ae4cc901bf1fc91682888e3318d0bd81eb674b88688f | Python | 38,242 | 878 | """
Manual classification analysis functions for BombCell
Functions for analyzing concordance between manual and automatic BombCell classifications,
and suggesting parameter threshold adjustments based on disagreements.
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pathlib import Pat... |
af2ba3b3e9e5a22f60c153cd8f1900674e76bcfbdfbb54f5ef25607e65d90f36 | Python | 38,244 | 885 | # 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... |
2068228abd8ba1839c28e042ab556d53dbf5f91b75119e748fb7280202a4c010 | Python | 38,508 | 963 | from __future__ import annotations
import inspect
import logging
import warnings
from functools import partial
from typing import TYPE_CHECKING
import numpy as np
import pandas as pd
import torch
import torch.distributions as db
from pyro.distributions.util import deep_to
from scvi import REGISTRY_KEYS, settings
fro... |
ea84d209cbd8536b19fd4dab7c4427569c2b83031f5e671caf7dd8b54a0a7978 | Python | 38,535 | 1,225 | # Copyright 2022 InstaDeep Ltd
#
# Licensed under the Creative Commons BY-NC-SA 4.0 License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://creativecommons.org/licenses/by-nc-sa/4.0/
#
# Unless required by applicable law or a... |
d94242c7711facac0097b632cac637a124909bd9bc7074be8c18e6d89a59bb1b | Python | 38,552 | 1,089 | from collections import namedtuple
from collections.abc import Hashable, Sequence
from itertools import product
import numpy as np
import pandas as pd
from pgmpy import config, logger
from pgmpy.extern import tabulate
from pgmpy.factors.base import BaseFactor
from pgmpy.utils import StateNameMixin, compat_fns
from pg... |
d832b3334f97532d39b2d035713e59d259b94b4a8d923b6d3d31b5afde81c322 | Python | 38,627 | 887 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# Modified by Roshan Rao
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... |
31c3f719c3391f6cb481fa4fd6c989e1371cd38b978d528553980eb6159788c4 | Python | 38,674 | 1,096 | """
Type III toxin-antitoxin sampling pipeline using Evo.
Usage: python pipelines/t3ta_sample.py --config path/to/config.yaml
"""
import argparse
import ast
import subprocess
import sys
import tempfile
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, Dict, List, Optional, Set,... |
aa44d055e06e93de7920eaaa0148dcde20a354eaf023ca907354eb0aaaf60095 | Python | 38,778 | 920 | # -*- coding: utf-8 -*-
import sys, os
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
# 基础库
import random
import numpy as np
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
import math
from torch.nn import functional as F
# 你的项目组件
from DENNs import PINN... |
70b430892a2f28e948ec80c29d3b73dbb857d1c970003ae3246dadabb4ef732e | Python | 38,779 | 926 | import numpy as np
import pandas as pd
from scipy.spatial import cKDTree
from scipy.spatial.distance import cdist
from scipy.ndimage import gaussian_filter1d
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib.pyplot as plt
import seaborn as sns
import scipy as sp
def align_major_axis... |
a1f80a962bad1c22f5c8800f832bb743a7fc26215429426d3aee185c5b1582d8 | Python | 38,943 | 1,032 | import warnings
import numpy as np
import pandas as pd
import os
from collections import defaultdict
import networkx as nx
from scipy.spatial import distance
import scipy
from scipy.sparse import csr_matrix
from sklearn.cross_decomposition import CCA
from sklearn.neighbors import NearestNeighbors
import ... |
a0c8e1cbd6ff404da1ef354b23395cf857a77e5ab47d741bc3214233dfea5ab7 | Python | 38,968 | 823 | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and 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 copy of the License... |
7336a8d6717d767b1fbd77e3df2812bfa96c9d677fe70700d2294008a4643b9e | Python | 38,969 | 824 | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and 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 copy of the License... |
0dafa8e6debafdd17ac44bad1b4f957ee66ece9e1f80772cd23827a7081d124e | Python | 39,032 | 811 | # coding=utf-8
# Copyright 2019-present, Facebook, Inc and the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
53e249f92a0743ece8e73be17ea93de1ecd962d02735ebdc89d6651872275d41 | Python | 39,037 | 813 | # coding=utf-8
# Copyright 2019-present, Facebook, Inc and the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
4ae77618cc6f12a7d1f6d946fee3f7bd5c56f3e9e103073394a590ceba5a35ed | Python | 39,040 | 1,039 | import gc
import math
import warnings
from typing import Dict, Mapping, Optional, Tuple, Any, Union
import torch
import numpy as np
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 imp... |
7f4cafddeb2901acb5d8948beb40b3ec3758a3fc0c14754272054374fb74454e | Python | 39,093 | 927 | #!/usr/bin/env python
# ENCODE reporting module wrapper
# Author: Jin Lee (leepc12@gmail.com)
import sys
import json
import argparse
from encode_lib_common import (
infer_n_from_nC2, infer_pair_label_from_idx, log, now,
run_shell_cmd, write_txt)
from encode_lib_log_parser import (
MAP_KEY_DESC_ANNOT_ENRIC... |
8df12b96afb116f4ac39ef8d15b43ff97326f99965c7c4334a779d84950d3266 | Python | 39,253 | 866 | from dataclasses import dataclass
from typing import Dict, List, Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import pytorch_lightning as pl
try:
# Package-style import (used by `from hippie.multimodal_model import ...`)
from .backbones import ResNet18E... |
5a987a037b3d9c97d329177185fdfed71cea60dc845d423c2a2c69460a6c787f | Python | 39,339 | 809 | """A set of callbacks useful for training a model."""
import re
import time
from collections.abc import Callable, Sequence
from bpreveal.internal import disableTensorflowLogging # pylint: disable=unused-import # noqa
from keras.callbacks import ModelCheckpoint, EarlyStopping # type: ignore
from keras.callbacks import... |
233392e5faac760bcbca3e488bd22f3348175949259c52bba7cf79a8e1a2ebff | Python | 39,354 | 835 | # coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and 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.or... |
c426f4e78cbb75b346d95f0041e3a716f825f95611853db2e01faf29e98ba862 | Python | 39,379 | 838 | # coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and 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.or... |
be712e157e630e1d3120eca39919af3f11a88bfabbff91a4e3c67d341ae1da16 | Python | 39,446 | 1,104 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Extract neural activity from a fluorescence trace using a constrained deconvolution approach
Created on Tue Sep 1 16:11:25 2015
@author: Eftychios A. Pnevmatikakis, based on an implementation by T. Machado, Andrea Giovannucci & Ben Deverett
"""
from builtins import ... |
3e858f470e1eb912d9447ebf8aec44a6d8700d1edca81373a4cc2ece7a870ebd | Python | 39,466 | 1,144 | # Copyright (c) Facebook, 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.
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
import contextlib
import itertools
impo... |
7cf2ce3e8fb0ce2ba4651add3f3443ba66a68768fc36b4b2ffc924ac66ad6347 | Python | 39,468 | 1,085 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import shutil
import subprocess
import tempfile
from typing import List, Dict, Any, Optional, Tuple
import numpy as np
import pandas as pd
import pdb
# sys.path.append("../../corecode/")
from build import *
import matplotlib.pyplot as plt
import seaborn as sns... |
325e27d54f88cb082708a225eb4d69ccb7f9d5a45b225923132708defcccbd78 | Python | 39,509 | 1,027 | import pandas as pd
import scanpy as sc
import numpy as np
import seaborn as sn
import matplotlib.pyplot as plt
from scipy.stats import zscore
from scipy.stats import pearsonr
from sklearn.metrics import mean_squared_error
from sklearn.manifold import MDS
from sklearn.preprocessing import StandardScaler
from sklearn.... |
18f26d43934f5678f871de59da92a6f9449796341ad4924ab077809d98d5f9fb | Python | 39,585 | 885 | import torch
import numpy as np
import scanpy as sc
from sklearn.metrics import r2_score
from scipy.stats import pearsonr, spearmanr
from sklearn.metrics import mean_squared_error as mse
from sklearn.metrics import mean_absolute_error as mae
def evaluate(loader, model, uncertainty, device):
"""
Run model in i... |
84325ae4bb5561c363d95fbd3cd6673c66f109674c275f9ba536467f622fea63 | Python | 39,737 | 857 | """
This module contains classes and such that are responsible for generating
trajectories for MM/PBSA based on input, starting trajectories. It will
strip trajectories and output the ones that will be used for the calculations.
Needed for proper operation of gmx_MMPBSA
Methods:
make_trajectories(INPUT, FILES... |
b8edbd696adad3af161027c03d368f562ddcb6900ea89e2b5cd1a5b533a37cd8 | Python | 39,787 | 907 | # -*- coding: utf-8 -*-
"""
Batch multi-slice 2D LBM extraction simulations.
This standalone script is derived from taichi_extraction_lbm.py but removes the
Streamlit UI and real-time animation. It runs repeated D2Q9 2D pore-scale
simulations on representative slices extracted from a 3D CNN porosity volume.
It intenti... |
4a189676ffbba9c04284d4f282a7136b3c481b6624c19556a0857f8cba5af9f7 | Python | 39,828 | 1,145 | from __future__ import annotations
import shutil
from pathlib import Path
from subprocess import CalledProcessError
from typing import TYPE_CHECKING
from typing import Any
import pytest
from cleo.io.null_io import NullIO
from packaging.utils import NormalizedName
from packaging.utils import canonicalize_name
from p... |
5d3a7de651e19f8f9583671cf4950eb4a3b09c9650f30a170e9d64b1755808cc | Python | 39,854 | 828 | # coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and 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.or... |
81f24ec2829824a032a5817ea3d4507bbe2a02c010d8de5631cf912956e21bf9 | Python | 39,857 | 1,034 | from samap.mapping import SAMAP
from samap.analysis import (get_mapping_scores, GenePairFinder,
sankey_plot, chord_plot, CellTypeTriangles,
ParalogSubstitutions, FunctionalEnrichment,
convert_eggnog_to_homologs, GeneTriangles)
import s... |
23d089ae8c74d7427f28a03472093ba101b8abab4ffe13cf48b968af93bb1514 | Python | 39,876 | 1,043 | # Copyright 2015 Google Inc. 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 applicable law or a... |
5ee0495b0a3215b5fdee3790fb6064a05e6af7490510a94904bc4ca446f611a7 | Python | 39,887 | 828 | # coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and 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.or... |
437e438501b6ad8cb9349ffa27f2752be08a8d71a6a1df13b522ae1706829284 | Python | 39,972 | 802 | '''
(c) 2016-2020 Oleksandr Frei, Alexey A. Shadrin, Dominic Holland
MiXeR software: Univariate and Bivariate Causal Mixture for GWAS
'''
# Utility classes for univariate and bivariate fit
# Contains
# _log_exp_converter, _logit_logistic_converter, _arctanh_tanh_converter - converters to map bounded parameters into -in... |
fffe2c35a39a61d1e17dcc2b9c4a206ceaebd6bb008e0b7414a1434f2384e1ce | Python | 39,984 | 1,054 | import numpy as np
import torch
import torch.nn.functional as F
import matplotlib.pyplot as plt
from .math import wrap_phase
from .math import nm, um, mm, cm, m
class OpticalElement:
def __init__(self, dim, pitch, wvl, field_change=None, device='cpu', name="not defined", polar='non'):
"""
Base clas... |
53636483a38e7aa3634ae0d8d9dafe43822e7f544c999b20f3e2590d63f7f54f | Python | 40,034 | 960 | """
BACTERIOPHAGE CDS PREDICTION AND GENOME ANNOTATION
This script is for running bacteriophage genome annotation independently of the genome design pipeline.
The individual environment requirements are provided in environments/genome_annotator.yaml.
Predicts ORFs in (optionally pseudo-circularized) phage genomes usi... |
657e22c3ee914e0e573c390d8d6ffbf14a763968e739b1756047841ca58e6ec4 | Python | 40,135 | 968 | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... |
04f5e697cfb825f2f08c1d64678a65311445b55b04fd34bd643cf9f8c23887b6 | Python | 40,197 | 1,147 | # Copyright (c) Facebook, 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 os
import sys
from dataclasses import _MISSING_TYPE, dataclass, field
from typing import Any, List, Optional
import torch
from omegaco... |
b869bd7a187cd34a9bc1d731d4d5898c53c6add52b420c63f7228f91a1338a36 | Python | 40,201 | 1,140 | import numpy as np
import pandas as pd
import torch
import copy
from pymatgen.core.structure import Structure
from pymatgen.core.lattice import Lattice
from pymatgen.analysis.graphs import StructureGraph
from pymatgen.analysis import local_env
from ase import Atoms
from sklearn.metrics import accuracy_score, recall_s... |
418fb39c951cecedd42aae72d321bab7f7adbb394c5272a914e4dfac13eaa6d5 | Python | 40,254 | 807 | import os
import unittest
import logging
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
from slicer.util import VTKObservationMixin
import json
import numpy as np
from WarpDriveLib.Tools import NoneTool, SmudgeTool, DrawTool, PointToPointTool, ShrinkExpandTool
from WarpDriveLib.Helpers import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.