sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
38da2784a077ff00a0425a8a61a5d6ae82b63d78d279a84adfbecb81a96615f6 | Python | 14,107 | 319 | import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from palettable.colorbrewer.sequential import Greens_9
from palettable.colorbrewer.qualitative import Paired_12
from matplotlib.patches import Patch
import seaborn as sns
from collections import Count... |
818341e2abac1fcb889af33e28c4dcd83750bb7ae6d321d5401f18325cf3c84a | Python | 14,132 | 347 | # %%
"""
==============================================================
Attempt to classify MEG data in the source space - neuronal avalanches vs classical approaches - Plot ROC curves - Rebuttal analysis
===============================================================
"""
# Authors: Marie-Constance Corsi <marie-consta... |
0bcb9d84930212aed39d7b72960fe71ecd437b49ef3d4cbd4ad9aed2d2502812 | Python | 14,158 | 437 | import os
import tempfile
import numpy as np
import numpy.testing as np_test
import pytest
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 XMLBIFReader, XM... |
93bed02394d7d9b8c3076386af36c79951dcd9ec8e2598654955bb7ef6057db4 | Python | 14,172 | 385 | # 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... |
f67731c2877c2321c52f96c00e89befee6d2fa75c0a9e9ff50e1e5b87a7a55b4 | Python | 14,174 | 237 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
debb567a8563100aff203196b2efebeb2e5366f7e5848c4c17b568b3fb044ff1 | Python | 14,175 | 414 | import pdb
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
BatchNorm = nn.BatchNorm2d
# __all__ = ['DRN', 'drn26', 'drn42', 'drn58']
webroot = 'http://dl.yf.io/drn/'
model_urls = {
'resnet50': 'https://download.pytorch.org/models/resnet50-19c8e357.pth',
'drn-c-26': webroot + '... |
c04fb09a2aeb4fd3d8da35eb3535d5248d0ef80ad1443ed40f076bfe495b3275 | Python | 14,179 | 249 | import numpy as np
import pandas as pd
import pytest
from skbase.utils.dependencies import _check_soft_dependencies
from pgmpy.factors.discrete import TabularCPD as LegacyTabularCPD
from pgmpy.models import DiscreteBayesianNetwork
from pgmpy.parameter_estimator import DiscreteMLE
from pgmpy.parameterization.cpds impor... |
6ecda7fdf206c5c55353a79cd1585fdab16ce1fc1b1e9278cba1a8303e1a4347 | Python | 14,194 | 385 | """Execution policies for the persistent shell middleware."""
from __future__ import annotations
import abc
import json
import os
import shutil
import subprocess
import sys
import typing
from collections.abc import Mapping, Sequence
from dataclasses import dataclass, field
from pathlib import Path
try: # pragma: no... |
e27c5ef8cbdb552a1e0e398a3cf3fd4643841353d1ce35b53ea077ab51e8abd7 | Python | 14,197 | 496 | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 22 15:57:43 2018
@author: 2624224
"""
from math import pi
import random
from OCC.Core.BRepBuilderAPI import (BRepBuilderAPI_Transform, BRepBuilderAPI_MakeWire,
BRepBuilderAPI_MakeEdge, BRepBuilderAPI_MakeFace)
from OCC.Core.BRepFeat impor... |
bf173f874908d9924506fdfd8dfe2f6a09cd22fb5cc1c097487b976142875f03 | Python | 14,198 | 388 | # Copyright 2021 AlQuraishi Laboratory
# 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
#
# U... |
2e2ccda5212756197f0d2522dfc67909be5e2333e42d58e1d906175252288341 | Python | 14,207 | 370 | # utility functions for compiling responses
import pandas as pd
import numpy as np
from chreyesees import colormedulla
from chreyesees import OPSINS, LEDS
import puffbird as pb
from chreyesees import transform
from chreyesees.analysis import CI_INTERVAL
def get_Q_given_other(
k, k_other, cell_types,
):
r_info... |
a3c6f8bfd1b397ef88b45e74e20e730ba39e77d8a82baef0227b28616e3d8d12 | Python | 14,214 | 262 | """Environment diagnostics should report actionable failures without workloads."""
from contextlib import nullcontext
import io
import os
from pathlib import Path
import subprocess
import sys
import tempfile
from types import SimpleNamespace
import unittest
from unittest.mock import Mock, patch
import check_environme... |
81cd3b8b58e38cf1e03432e31a27dff27c6288f5340df0109b243ef2a7ded329 | Python | 14,219 | 317 | # Copyright (c) MONAI Consortium
# 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, so... |
5fe6524afae0d2425f43704d41779df14d998612e85df879af2d3fafc46018bd | Python | 14,222 | 339 | # Copyright (c) MONAI Consortium
# 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, so... |
5b1566e7203d2ee5e18095ab28c89d12d23872ddf876fd8126612f37dcdf8b80 | Python | 14,223 | 487 |
"""Module Description
Copyright (c) 2014, Ying Jin <yjin@cshl.edu >
This code is free software; you can redistribute it and/or modify it
under the terms of the Artistic License (see the file COPYING included
with the distribution).
@author: Ying Jin
@contact: yjin@cshl.edu
"""
import sys
import time
import loggi... |
855591c4d51578305ca3b99d2a1dcf61bcdf26bac8b937fda49615696ebacaf1 | Python | 14,224 | 401 | import inspect
from itertools import product
from numbers import Number
import numpy as np
import pandas as pd
import torch
from scipy.spatial import Delaunay
from dreye.api.convex import in_hull
from sklearn.linear_model import LinearRegression
from scipy.optimize import least_squares
from chreyesees.rbf.rbfinterp imp... |
7e69879d450d6863fe16bd1ff2702b16fac972ba7ff39739bd663dfc6391152e | Python | 14,241 | 406 | import math
from math import sqrt
import numpy as np
import torch
from torch import nn, einsum
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Softmax
import torch.optim as optim
import torch.utils.data as Data
from torch.utils.checkpoint import checkpoint, checkpoint_sequential
from sklearn.... |
0882cd9a057d3133029c6b967a31eef993de109ab64836f71fca5d419dbbee83 | Python | 14,245 | 309 | import copy
import torch
import os
from tqdm import tqdm
import numpy as np
from CEL.utils.register import register
import torch.nn as nn
import optax
import equinox as eqx
import jax
from CEL.data.data_manager import MyDataLoader
from CEL.networks.models.meta_model import ModelClass
import pathlib
from munch import M... |
7d16de1bdedcce629e9a05d033b88b7fee8b39def9aedb5b383c5a2fecda1d88 | Python | 14,250 | 271 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
d08db7121ea28dc79deec36b47638212c98ed8e307e094ca8ea7861ac6db163c | Python | 14,254 | 400 | import logging
from collections.abc import Callable
from typing import NamedTuple
import numpy as np
import torch
import torchmetrics
from torch import nn
from scvi.module.base import BaseModuleClass, LossOutput, auto_move_data
logger = logging.getLogger(__name__)
class _REGISTRY_KEYS_NT(NamedTuple):
X_KEY: st... |
058d277e02887f192957349a8594fcfaf7c1204f8cd5de17fa17be40cef0c86a | Python | 14,259 | 417 | # Copyright (c) 2023 Shihao Ma, Haotian Cui, WangLab @ U of T
# This source code is modified from https://github.com/yuyangw/MolCLR
# under MIT License. The original license is included below:
# ========================================================================
# MIT License
# Copyright (c) 2021 Yuyang Wang
#... |
db52ff07cc51f2308591466b3053f0a8a745fc36703216620642152361cb8b87 | Python | 14,262 | 377 | import glob
import os
import pathlib
import shutil
import tempfile
import traceback
from copy import deepcopy
from typing import List, Optional, Union
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem.MolStandardize import rdMolStandardize
from .xtbp import XTBP, RunXTB
class Tautomerize:
""... |
4253a8b9fe2cfa85f97d80561e1063888849fe6ccdf2d4261c514d4882d2b392 | Python | 14,274 | 389 | """Combine many documents together by recursively reducing them."""
from __future__ import annotations
from collections.abc import Callable
from typing import Any, Protocol
from langchain_core._api import deprecated
from langchain_core.callbacks import Callbacks
from langchain_core.documents import Document
from pyd... |
56fd360e5354a849f935b1a768a269f8130c06a6e50330d200dbdcd35dc1aac3 | Python | 14,283 | 341 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from sklearn.metrics import log_loss
from SMdRQA.RQA_functions import doanes_formula
from SMdRQA.RQA_functions import binscalc
from SMdRQA.RQA_functions import mutualinfo
from SMdRQA.RQA_functions import time... |
cd14cfd2a0b4816e2ec540c54f9fa45a2747e65fe07f0a2cdbb42c377af098b6 | Python | 14,283 | 377 | # This script is part of navis (http://www.github.com/navis-org/navis).
# Copyright (C) 2018 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... |
07128348618bb3089fad91958c13e77895b22498e65676e1a1ad443faa56b616 | Python | 14,292 | 601 | # Time-stamp: <2011-02-14 15:49:14 Tao Liu>
"""Module Description
Copyright (c) 2008,2009,2010,2011 Hyunjin Shin, Tao Liu <taoliu@jimmy.harvard.edu>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file COPYING included with
the distribution).
@status:... |
d6b5cc372c58e3a7ee9a21d9a30b569e960b8742fb0d89a64b87fd9beaba7c2c | Python | 14,293 | 335 | # -*- coding: utf-8 -*-
""".
Created on Thu Apr 21 14:38:31 2022
@author: ywjin0707
scRNA-seq datasets
sample bulk dataset (TCGA) 'D:/OneDrive/210831_Bioinformatics/DATA/TCGA/TCGA_GDC_HTSeq_Counts.txt'
GRCh37.87 download link: http://ftp.ensembl.org/pub/grch37/release-100/gtf/homo_sapiens/
GRCh38.106 download link: ... |
5306bb516ba4eeb6d05fba5d9a042b9299c06355d19e200459e6a3e32953e452 | Python | 14,294 | 338 | from functools import partial
from typing import NamedTuple
from flax.core.frozen_dict import freeze
import flax.linen as nn
from flax.training import checkpoints
from flax.training.train_state import TrainState
import jax
import jax.numpy as jnp
import optax
from tqdm import tqdm
from chemoxrl.cell import MultiCell
... |
0f6c7e70acb6be686a5a3725db8938404eae99becf66824571f280e39ff2907d | Python | 14,315 | 247 | """Synthetic CPU tests for the unified CLI and affine-aware deployment."""
import argparse
import json
import os
from pathlib import Path
import subprocess
import sys
import tempfile
import unittest
from unittest.mock import patch
import numpy as np
import nibabel as nib
import SimpleITK as sitk
import torch
import tr... |
75647e72dfae339ec751d990e7c6671a86e2e25fe395cedef4dcd1f2eb8a5728 | Python | 14,321 | 452 | import os.path
import pickle
from functools import partial
from itertools import islice
from typing import List, Optional
from pymatgen.core.structure import IStructure
from pymatgen.io.ase import AseAtomsAdaptor
import ase
import ase.io
import numpy as np
import torch.multiprocessing as mp
import tqdm
from ase.io.uti... |
a4c64f4f668348fc0a44062b5e22611c85025a44e29fbbb8d83568435019cf3f | Python | 14,323 | 428 | # Copyright 2021 AlQuraishi Laboratory
#
# 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 i... |
53da1be7b70a2edde8eae1cfea900da5adbf43f6b734854a26cb55d0be5daed7 | Python | 14,332 | 316 | import warnings
import torch.nn.functional as F
import torch
import time
import os
import random
import numpy as np
import logging.config
import logging
import datetime
import argparse
from utils.utils import get_cnn_minibatch, stat, train_stat, current_time, imbalence_split
from torch_geometric.loader impo... |
ce5f93a9ea79cb56eeae7a82a0c3c470373597f53bd9dcf7359fca04a4d2c14d | Python | 14,337 | 391 | ###########################################################################################
# #
# This sample shows how to evaluate object detections applying the following metrics: #
# * Precision x Recall curve ----> ... |
069a98d69c3c0973a2b34c4a3a3485c478ee722be6b30f1e9d289a20975b6d59 | Python | 14,344 | 401 | import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.use('agg')
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
import pandas as pd
import numpy as np
from sklearn.decomposition import PCA, SparsePCA
from sklearn.manifold import TSNE
from sklearn.cluster import KMea... |
f35adf77c8a6131529832ce7cad1782ac1b3148fe3b19a122aa7aee579ed2142 | Python | 14,347 | 347 | # Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
2a2b5d0b4f042693500f782f2251e0f8fc078cb3a5ef38c0c7a09a5691c788a6 | Python | 14,355 | 316 | import pandas as pd
import argparse
from utils import set_seed
import numpy as np
import wandb
import os
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.nn import functional as F
from torch.cuda.amp import GradScaler
from model import GPT, GPTConfig
from trainer import Trainer, Tr... |
57ea043aca8465bd3305c467cd1bc863d9f3277411deaab75321b1a9db94f4a7 | Python | 14,370 | 334 | #!/usr/bin/env python
import argparse
import numpy as np
import sys
import cv2
import tritonclient.grpc as grpcclient
from tritonclient.utils import InferenceServerException
from processing import preprocess, postprocess
from render import render_box, render_filled_box, get_text_size, render_text, RAND_COLORS
from l... |
86c6fa32fc52bade95eee56670abb2380a23eadde869df21e065a8f238c4de30 | Python | 14,412 | 370 | """Module contains code for a cache backed embedder.
The cache backed embedder is a wrapper around an embedder that caches
embeddings in a key-value store. The cache is used to avoid recomputing
embeddings for the same text.
The text is hashed and the hash is used as the key in the cache.
"""
from __future__ import ... |
909bef34569e7a7d91fa6676bd8be9cd7a0987aa0df857e7ad5299f385855070 | Python | 14,416 | 314 | # Imports
from cmath import inf
import sys
import os
import argparse
import inspect
from datetime import datetime
import numpy as np
import torch
import torch.optim as optim
import dynamo as dyn
try:
from torchdiffeq.__init__ import odeint_adjoint as odeint
except ImportError:
from torchdiffeq import odeint_... |
e6cc19de88cdd5651f8736e5da2d717ac28e32b8d1ce69b6468193ad11175ccf | Python | 14,417 | 426 | from torch import matmul, relu, cat, real
from torch.linalg import eig
from torch.autograd.functional import hessian
import pickle as pkl
from types import SimpleNamespace
from plotly.subplots import make_subplots
import plotly.graph_objects as go
from config import Scenario
import json
import numpy as np
fro... |
87b47d5c93ffb5ad932cbd5760eddfdf8e85bacadc3161b3633959c9f7f10b15 | Python | 14,426 | 307 | #!/usr/bin/env python3
"""
Simple SMT File Reader - Reads .smt files and outputs to a single .txt file
"""
import os
import sys
import struct
import numpy as np
import pandas as pd
def read_smt_file(input_file, output_file=None):
"""Read a .smt file and convert to a readable txt file"""
if output_file is... |
a90241c6e7b69d4cd9e97f878000524f2b2f43f4f2efaba1e5b19aaba8bfa718 | Python | 14,430 | 421 | import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from argparse import ArgumentParser
from scipy.stats import hypergeom
import pandas as pd
import numpy as np
import pickle
from argparse import RawTextHelpFormatter
pd.set_option('display.max_rows', 400)
pd.set_option('display.max_column... |
d2190fd924b96e824d104c16269cd72f7f4d0f3dc962237db22392677eeb47e1 | Python | 14,447 | 366 | import configparser
import cv2
import numpy as np
import os
import copy
from skimage.segmentation import watershed
# Credit: https://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python/3035188#3035188
def primesto(n):
""" Returns a array of primes, 3 <= p < n """
sieve = np.on... |
3ec7354080461057b2a81325bc97ba2c3d107a3bd3167a6e0ee21cb257bf8c92 | Python | 14,450 | 491 | import torch
import torch.nn as nn
import timm
import types
import math
import torch.nn.functional as F
class Slice(nn.Module):
def __init__(self, start_index=1):
super(Slice, self).__init__()
self.start_index = start_index
def forward(self, x):
return x[:, self.start_index :]
class... |
c497077ceb6a788a1bf8d51a36a2b396e536292620a483581ccc22c29d2e95ae | Python | 14,459 | 353 | # Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this sof... |
58a09550041946fee67a29d185a0f72a60002f02d1376786e14e04e97c3895db | Python | 14,460 | 414 | import os
from os.path import join as opj
from torch.utils.data import DataLoader, WeightedRandomSampler
from torch.optim.lr_scheduler import MultiStepLR
from pandas import DataFrame, read_csv
import torch
from torch import nn
import numpy as np
import pickle
from scipy.stats import pearsonr, spearmanr
# command line ... |
708063a14d14f137b022e39ced25a5e94091053fa9d574438baa8213c8f13266 | Python | 14,474 | 410 | # Copyright (c) MONAI Consortium
# 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, so... |
f89d6a01b99426f7fd63a48e1288828f6da3430875f504a0e702defcfc8a511c | Python | 14,485 | 364 | # This script is part of pymaid (http://www.github.com/navis-org/pymaid).
# Copyright (C) 2017 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of ... |
3ad7b798ee3efbb45c86b896dca9acbbef1ac1a85cf5b201251c50b5e9280556 | Python | 14,488 | 300 | """ OmicScope Module
OmicScope allows user to import data and perform statistical analysis
for differential gene/protein expression. This is the key module of
all OmicScope workflow, being the input for all other modules.
"""
import warnings
from .Input import Input
from .Stats.imputation import value_imputation
fr... |
ee1b52656ffc502a90b4b6635145ed92922c08ed6a05e177aab09b2688575284 | Python | 14,490 | 423 | from __future__ import annotations
import warnings
from typing import Callable
from typing import List
from typing import Optional
from typing import Type
from typing import Union
import torch
import torch.nn as nn
task_mapping = {
"autoencoder": "autoencoding",
"colorization": "colorization",
"curvature... |
9fe916f90114ca73d42d7d07d06fbd5afa6cd6514b875404782a86b367805de9 | Python | 14,494 | 417 | """
2023.08.30
author: femke.hurtak@epfl.ch
script to draw the meta network, obtained by clustering the neurons. Each node
of the meta network is a cluster of neurons, and the edges are the connections
between the clusters.
"""
import networkx as nx
import matplotlib.pyplot as plt
import os
import pandas as pd
import... |
3d29d3aa483fc684fc7f2a36dcce049504371244d04406620b2995cdc3e4db3c | Python | 14,509 | 329 | import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from palettable.colorbrewer.sequential import Greens_9
from palettable.colorbrewer.qualitative import Paired_12
from matplotlib.patches import Patch
import seaborn as sns
from collections import Count... |
2ea12694fcdcbd295164819e341e109da62539f498dab9b14b3be3bc14b3649b | Python | 14,510 | 299 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@Description: :
@Date : 2022/06/15 09:38:31
@Author : Zilan Yu
@version : 1.0
'''
import pandas as pd
import os
import random
root_clustered = "../clustered_datasets"
clustered_iedb_filepath = os.path.join(root_clustered, "clustered_iedb.tsv")
clus... |
ba840ec9adff1e7c6d7aff31581d9e2ba77789ac9890ec56bc418bf259889892 | Python | 14,510 | 432 | import torch
import torch.nn as nn
import numpy as np
import random
import matplotlib.pyplot as plt
import os
import math
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import torch.nn.functional as F
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# save image, and sav... |
1d02d58b942723382b4b76c1a53c4c80a5a5fce4d78fd984f425ec521884e19f | Python | 14,511 | 307 | import numpy as np
import matplotlib.pyplot as plt
import torch
from scipy import stats
import time
from omegaconf import OmegaConf
from dipy.data import fetch_stanford_hardi, read_stanford_hardi, read_stanford_t1, read_stanford_pve_maps
from dipy.denoise.localpca import mppca
from dipy.denoise.patch2self import patch... |
7ac47c927a1495a34b1e667a6431b81e2d596fbf51a9b80767ca49ca76ac195b | Python | 14,513 | 365 | import csv
import pandas as pd
from scipy import stats
from statsmodels.miscmodels.ordinal_model import OrderedModel
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import collections
import math
import os
from collections import defaultdict
import copy
from icecream import ic
def boxplot(shap, n... |
bd2d7bf719817baedf7687aa26b42cfd0aa01b29fe0246e1c069f3fbe6e846b1 | Python | 14,527 | 424 | import numpy as np
import copy
from scipy.special import expit
from neural_net_utils import random_weight_init, check_dims
######################
### Nonlinearities ###
######################
class Nonlin(object):
@staticmethod
def f(x):
raise NotImplementedError()
@static... |
730874b83bbba842e6f482c8451830c0075286fbab5427beb20aaced4a92ee25 | Python | 14,528 | 387 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Datasets with multiple phase encoded directions.
.. _sdc_pepolar :
:abbr:`PEPOLAR (Phase Encoding POLARity)` techniques
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This corresponds to `this s... |
e97b3813bcc0bb069815df3fa034acfc090c3f913b35e302d3087718123f20a2 | Python | 14,536 | 331 | # Analyses of the DNN representations
# Copyright (c) 2021 Laurent Caplette
import numpy as np
from sklearn.decomposition import PCA
import nltk
from nltk.corpus import wordnet as wn
import csv, os, re
import torch
from torch import nn
from robustness.datasets import ImageNet
from robustness.model_utils import make_an... |
7915648bb433f526e6a17baf6e7df603893b098747c3d103ef13c305d8fb1cca | Python | 14,539 | 324 | import argparse
import random
import mxnet as mx
import mxnet.ndarray as nd
from hko_factory import HKONowcastingFactory
from nowcasting.config import cfg, cfg_from_file, save_cfg
from nowcasting.my_module import MyModule
from nowcasting.hko_benchmark import *
from nowcasting.encoder_forecaster import encoder_forecaste... |
695cff76889fe0ab9e8a2369291450b224df7562a5894180d4ece5c818e6a0d2 | Python | 14,552 | 276 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 15 11:44:13 2024
@author: baran
"""
import mat73
import scipy
import numpy as np
from matplotlib import pyplot as plt
from bisect import bisect_left
import matplotlib
def return_unit_lifetimes(spikeTimes, spikesByCluster, num_units, days, time_bo... |
81c0b291ec98b5d05f9c661ef53554934d1ab08de473fc34af48406abe97e801 | Python | 14,565 | 352 | # base file : 201010_createref.ipynb
import os
import sys
import multiprocessing
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from tqdm import tqdm
import scipy.stats as stats
import statsmodels.stats.multitest as multi
import matplotlib as mpl
mpl.rcParams['figure.fac... |
ce93297bdb855ef00f0699bda31060339ddcc112e501bf627f21271f76372526 | Python | 14,584 | 461 | import socket
from typing import Any
from unittest.mock import patch
import httpx
import pytest
from langchain_core._security import (
SSRFBlockedError,
SSRFPolicy,
SSRFSafeSyncTransport,
SSRFSafeTransport,
ssrf_safe_async_client,
ssrf_safe_client,
validate_hostname,
validate_resolved_... |
0a94048bd7db5040689aa4f767fcffa95ac5fb6cd4a85b320cb991d0977e6513 | Python | 14,594 | 341 | """
Script for running Chainsaw
Created by: Jude Wells 2023-04-19
User can provide any of the following as an input to get predictions:
- a single uniprot id (alphafold model will be downloaded and parsed)
- a list of uniprot ids (alphafold model will be downloaded and parsed)
- a list of pdb ids (alphafo... |
70bb3f5b989f80100fc15487d9ed06734aab9cc9c29e36d80eacf7a7475d34de | Python | 14,603 | 403 | """Analyze git diffs to determine which directories need to be tested.
Intelligently determines which LangChain packages and directories need to be tested,
linted, or built based on the changes. Handles dependency relationships between
packages, maps file changes to appropriate CI job configurations, and outputs JSON
... |
533855141c60e072df1db0194d17ffd4479f8b520c3b652b27e426e1a4dc35cf | Python | 14,641 | 347 | #!/usr/bin/env python3
import pandas as pd
from Bio import SeqIO
from sklearn.feature_extraction.text import CountVectorizer
import warnings
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
import numpy as np
import pandas as pd
import pickle, os
# from multiprocess... |
5fb1fa9df06c9556efaa818b0e5127a8a7228e7d4df499eb87d2d82e08e396a5 | Python | 14,642 | 340 | import argparse
import multiprocessing as mp
from pathlib import Path
import parmap
from cwas.core.common import chunk_list
from tqdm import tqdm
import re
import zarr
import yaml
import pandas as pd
import numpy as np
from functools import partial
import cwas.utils.log as log
from cwas.core.categorization.categorize... |
65e1bb2937ed4d935e73086d929bdf7f1a6ef4cd30716d395a3ab2f9533211dc | Python | 14,655 | 291 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
POCIF-BAT R3 — Addendum de préenregistrement, cycle des hypothèses H-R2-5 et H-R2-6.
Ce fichier est écrit et haché AVANT tout calcul sur le corpus PINN4SOH. Il ne
modifie aucun seuil : les seuils de H-R2-5 et H-R2-6 demeurent ceux du
préenregistrement R2, dont le cond... |
9f654bd3aaedc9a3b014d76666c6396cdecfeba0d66a01cd4fe2fddeec657a25 | Python | 14,658 | 336 | """
Analyze perses calculations for a benchmark set of ligands annotated with experimental data
"""
# SDF filename containing all ligands annotated with experimental data
# Ligands should be annotated with experimental data using the SD tags
# EXP_BINDING_AFFINITY_IN_KCAL_PER_MOL
# EXP_BINDING_AFFINITY_IN_KCAL_PER_MO... |
05acaf21a503942f5e2e2a8cf3d25ae85eb7cc2b30032d1b84806d6a3ddc4e4a | Python | 14,661 | 388 | # Copyright (c) MONAI Consortium
# 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, so... |
170d0fd0e0709482c689ab704b7da53aada4137c2a62aea387fa66a882c3758c | Python | 14,662 | 339 | import os
import torch
import tarfile
import numpy as np
import os.path as osp
from tqdm import tqdm
from ase.db import connect
from argparse import Namespace
from torch_geometric.data import Data
from torch_geometric.data import InMemoryDataset, download_url
import logging
logger = logging.getLogger()
def random_sp... |
6c9b8da1cb0be65fe66e47be6ea572f6606f438f57733e474006bedef4affbc8 | Python | 14,686 | 324 | import argparse
import sys
import time
#argv = sys.argv
#dataset = argv[1] #'mouse_human_sagittal'#
#argv[1] = dataset
def acm_params():
parser = argparse.ArgumentParser()
parser.add_argument('--save_emb', action="store_true", default=True)
parser.add_argument('--turn', type=int, default=0)
parser.add... |
9372fcdc7350c137242eb8a1c7e67b652e8af2793021428c0fdb72d66c169042 | Python | 14,688 | 329 | # Rdkit import should be first, do not move it
try:
from rdkit import Chem
except ModuleNotFoundError:
pass
import argparse
import torch
import numpy as np
from tqdm import tqdm
from eval_follow_edm.datasets_config import get_dataset_info
from eval_follow_edm.analyze import analyze_stability_for_molecules
from... |
8795b3ba6afaa246f1aeba3ab66524029a0ff64096f0cdb38ecd9f63595b2c82 | Python | 14,690 | 393 |
import copy
import numpy
import matplotlib.axes
import matplotlib.lines
import matplotlib.patches
import matplotlib.collections
import scana
__all__ = ['SignalArtist', 'DEFAULT_NUM_BINS']
DEFAULT_NUM_BINS = 100
class SignalArtist:
DEFAULT_COLOR = '#00AABB'
DEFAULT_ALPHA = 1.0
DEFAULT_ALPHA_SCALE_FILL... |
b18cff669674ee6259b369bafae8c1ebccd6bc87cb0cadac48fe00a37891084b | Python | 14,694 | 415 | import numpy as np
from pensa.statesinfo import get_discrete_states
from pensa.comparison import ssi_ensemble_analysis, relative_entropy_analysis
from pensa.features import get_multivar_res
import scipy.spatial.distance
import matplotlib.pyplot as plt
import os
from scipy.optimize import curve_fit
# -- Functions for ... |
87fa0445279d5fd789e9b1fb01f412357c3df99a931ac966e2f69ab58d9c5aa7 | Python | 14,697 | 264 | ###########################################
# IMPORTS
###########################################
from simtk import unit, openmm
from nose.tools import nottest
from unittest import skipIf
from perses.app.setup_relative_calculation import *
from perses.annihilation.relative import HybridTopologyFactory
from perses.app.r... |
e18e6af2cbe04414f5a8ad9cb6bdd33798a7903337c70f50135e679aba690ebe | Python | 14,703 | 306 | import matplotlib.pyplot as plt
import napari
import numpy as np
import tifffile
import time
from scipy.ndimage import affine_transform
class ObliqueStackProcessor:
def __init__(self, theta, camera_pixel_size_xy_um, z_step_um, z_pixel_shape, y_pixel_shape, x_pixel_shape):
self.theta = theta
self.r... |
e1f75560ac1b761ff0a20f6b9bc1a7f01b08491b164995c7141256af5eb14917 | Python | 14,703 | 357 | ''' This module provides implementations for training different variants of Auto-encoders,
modifications on standard gradient decent are provided (centering, denoising, dropout,
sparseness, contractiveness, slowness L1-decay, L2-decay, momentum, gradient restriction)
:Implemented:
- GDTrainer
... |
385c2d887196873c088dce68c9c3d4cc089adf15b058e6a790b9d615c8ed2903 | Python | 14,704 | 440 | #!/usr/bin/env python
# third party modules
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.nn.aggr import MultiAggregation
# pnabind modules
from pnabind.nn.layers import SAModule, FPModule, ContinuousCRF
from pnabind.nn.utils import MLP
# Edge features dimensionality
EDGE_DIM... |
d097b828c801c7e94393f98a2ef61e0b73dfad7a1b89fe13cfd99d8d6423e92a | Python | 14,710 | 353 | import json
from abc import ABC
from itertools import islice
from pathlib import Path
from typing import Tuple, List
from protocol import DicomImagingSequence
from pydicom import dcmread
from pydicom.errors import InvalidDicomError
from MRdataset import logger
from MRdataset.base import BaseDataset
from MRdataset.con... |
f8ff4ddd20dd10819afe6e26758cec54f5c786f8dbcac721228cd12737cdb6c5 | Python | 14,720 | 274 | import pandas as pd
import numpy as np
import sklearn
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import PredefinedSplit
from sklearn.tree import DecisionTreeClassifier
from sklearn.svm import LinearSVC, SVC
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model ... |
be1381e0c7ca5dd33e3e7cc6fe45c835253d65e726052d4a6580db9585d4f608 | Python | 14,730 | 443 | ###########################
# Latent ODEs for Irregularly-Sampled Time Series
# Author: Yulia Rubanova
###########################
import numpy as np
import torch
import torch.nn as nn
from torch.nn.functional import relu
import lib.utils as utils
from lib.utils import get_device
from lib.encoder_decoder import *
fro... |
b8a5fb6ecf8c31bbef9a797cbf5ccc0c410028257541e94c64fef61e3d0bd001 | Python | 14,740 | 402 | # -*- coding: latin-1 -*-
"HTML Renderer for FPDF.py"
__author__ = "Mariano Reingart <reingart@gmail.com>"
__copyright__ = "Copyright (C) 2010 Mariano Reingart"
__license__ = "LGPL 3.0"
# Inspired by tuto5.py and several examples from fpdf.org, html2fpdf, etc.
from .fpdf import FPDF
from .py3k import PY3K, basestri... |
7743aaa737d9004c5bed0b5eba32dba26b686dc7a0f2ffe653935cd58d6818f7 | Python | 14,744 | 283 | "plotting the order preservation plots"
import pyrootutils
root = pyrootutils.setup_root(search_from=__file__, pythonpath=True)
import numpy as np
import src.pipeline as pl
import src.eval_utils as eval_utils
import src.plotting as plot
import src.utils as utils
def sample_spherical(npoints, ndim=3):
vec = np.... |
9ca39ea5efa2360bb01082b58daec7a4548a6e71b543702d4f1702d966709ec4 | Python | 14,745 | 439 | ##Copyright 2009-2014 Jelle Ferina (jelleferinga@gmail.com)
##
##This file is part of pythonOCC.
##
##pythonOCC is free software: you can redistribute it and/or modify
##it under the terms of the GNU Lesser General Public License as published by
##the Free Software Foundation, either version 3 of the License, or
##(at ... |
b6a23d2b32f83c49123173d18505921047c6673109550f57c98a1e280d71c279 | Python | 14,746 | 327 | from optimization.EPIOptimize import EPIOptimize
from optimization.ADMM import ADMM
import torch
import time
from EPI_MRI.utils import save_data, m_plus
import matplotlib.pyplot as plt
class LCurve(EPIOptimize):
"""
EPI-MRI Distortion Correction, choosing alpha parameter with LCurve.
Attributes
-----... |
bd78051e88c0a4d8b18bcd39ebc1e921b31962069d53658479abdcf83e4d3e11 | Python | 14,762 | 283 | from typing import Tuple
from KineticAssembly_AD import ReactionNetwork
from KineticAssembly_AD import reaction_network as RN
from KineticAssembly_AD import VectorizedRxnNet
import networkx as nx
import torch
from torch import DoubleTensor as Tensor
from torch import rand
from torch import nn
class VectorizedRxnN... |
152c028a59c75ecfcbe20243ba9e1e3e7b9e0d797f6d9bc27dc827d12e53627f | Python | 14,766 | 334 | # Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this sof... |
5c3a4a03bb5eff3b2cb47a6bb857a6c035bdaa43cbbeddbe3a0b0bb532d084cf | Python | 14,773 | 434 | """
Module with mostly code for quickly using the SAM model at inference time.
"""
import os
import time
import json
import pathlib
import shutil
import subprocess
import numpy as np
try:
import yaml
has_yaml = True
except ImportError:
has_yaml = False
import torch
from sam.nn.autoencoder.decoder import ge... |
cd4d7f0290e1fb6d023fc6dc0e8f7c964f3a276fee26916f9bfc93028dfbf1ae | Python | 14,777 | 385 | #!/usr/bin/env python
import pysam
import argparse, sys
import math, time, re
from collections import Counter
from argparse import RawTextHelpFormatter
__author__ = "Colby Chiang (cc2qe@virginia.edu)"
__version__ = "$Revision: 0.0.1 $"
__date__ = "$Date: 2015-09-28 11:31 $"
# --------------------------------------
#... |
8c2f9389243e0613ded6f9d3b247860b5be94e4e74d36fc319249e5e245ca0be | Python | 14,783 | 313 | import argparse
import logging
import os
import random
import shutil
import sys
import time
import numpy as np
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from tensorboardX import SummaryWriter
from torch.nn import B... |
150cfcbbf6d9c9b751082bd39f26281bbccc9183146d0988128c2eda677312cc | Python | 14,793 | 310 | import os
from time import time
from copy import deepcopy
import gc
import json
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.gridspec as gridspec
from natsort import natsorted
from utils.read_mda import readmda
plt.rcParams["font.weight"] = "bold"
plt.rcParams["axes.labelw... |
88bc2098b53dc6f00b37ee4922e1ca17ea035dcdbdc6171e93f5660666d84786 | Python | 14,799 | 278 | """
Defines a class to compute Suggested Selections, or clusters that exhibit
consistent or noteworthy changes from one frame to another.
"""
import numpy as np
from sklearn.cluster import AgglomerativeClustering
from .utils import Field, inverse_intersection, standardize_json
from numba.typed import List
from scipy.s... |
6d0a055bbb3c1985782387857b02c3b4f92f2b98041831081102ad02c964db81 | Python | 14,821 | 448 | ########################################################################
# Well-mixed chemical reactions.
# AIMS: to verify STEPS well-mixed deterministic solver 'wmrk4' computes
# reaction rates correctly when many different chemical species and
# reactions are present in the model.
# This model combines all we... |
2d0462b00ee3b4ca09b59beae68e4b810b54e2f23ec11a335bbd458a0a881e84 | Python | 14,822 | 447 | """Module for RBF interpolation - """
import warnings
from itertools import combinations_with_replacement
import numpy as np
from numpy.linalg import LinAlgError
from scipy.spatial import KDTree
from scipy.special import comb
from scipy.spatial import Delaunay, ConvexHull
from scipy.linalg.lapack import dgesv # type:... |
60715b833278daf67cdf352bd9159f72b9e9261a6a48e5798122dc597f9c4afc | Python | 14,823 | 306 | import mxnet as mx
from nowcasting.ops import *
from nowcasting.operators.common import identity, grid_generator, group_add
from nowcasting.operators.base_rnn import MyBaseRNNCell
import numpy as np
class BaseConvRNN(MyBaseRNNCell):
def __init__(self, num_filter, b_h_w,
h2h_kernel=(3, 3), h2h_di... |
0285219a0bc3c9a59f4c3be56ca7431084d70dbe8a8887b47fb3a6c975a2c1af | Python | 14,826 | 345 | import torch
from torch import Tensor
from torch import nn
import torch.nn.functional as F
class E_GCL(nn.Module):
"""Graph Neural Net with global state and fixed number of nodes per graph.
Args:
hidden_dim: Number of hidden units.
num_nodes: Maximum number of nodes (for self-attentive poo... |
3625a924c377cb63ea8fa17c1ed669bba064f011713dffcba1cda0e9190332d2 | Python | 14,838 | 448 | ########################################################################
# Well-mixed chemical reactions.
# AIMS: to verify STEPS well-mixed deterministic solver 'wmrk4' computes
# reaction rates correctly when many different chemical species and
# reactions are present in the model.
# This model combines all we... |
3e082cdc536cd4c1c7c138977ee16d7457f2a8bc3af926d12d071f49df7efc9b | Python | 14,839 | 268 | ###########################################
# IMPORTS
###########################################
from simtk import unit, openmm
from nose.tools import nottest
from unittest import skipIf
from perses.app.setup_relative_calculation import *
from perses.annihilation.relative import HybridTopologyFactory
from perses.app.r... |
87001209a047133519371d4a01e3e2bdddc55bf3d41e9a7ff68a2664badc2333 | Python | 14,842 | 335 | from torch import nn
import torch
import math
class GCL(nn.Module):
def __init__(self, input_nf, output_nf, hidden_nf, normalization_factor, aggregation_method,
edges_in_d=0, nodes_att_dim=0, act_fn=nn.SiLU(), attention=False):
super(GCL, self).__init__()
input_edge = input_nf * 2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.