sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
77cf99ad5d25af532340934ed305ce91d0609b2fcb4fa19f8c42d378b84eedd6
Python
36,571
994
""" Copyright (c) Meta, 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. Adapted from: https://github.com/FAIR-Chem/fairchem/tree/main/src/fairchem/core/models/scn """ import logging import time from typing import List, ...
dcd98be5dfe17b248c6e8f598fbfbed003b72af44610d030fb0c0a00fefa6262
Python
36,602
870
import pandas as pd import numpy as np import wfdb import ast import torch import torch.nn as nn import torch, queue from torch.utils.data.sampler import SequentialSampler, RandomSampler, BatchSampler import numpy as np from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor #from .core import * import ...
523db07b069293686fbe0165bc5ae0d974b440d4f668533f7a139e4dcfbcf98d
Python
36,627
924
from __future__ import annotations from typing import Literal from pydantic import BaseModel, Field class LandmarkPoint(BaseModel): x: float y: float z: float class ClippingConfig(BaseModel): # leave as None to get the usual clip for the target (cranial for cranium, # facial for face). "manual...
245bc6e7719b57c02273bb99ea728c7680341a62dbb375638b7ceac439330ba7
Python
36,633
1,169
##!/bin/env python '''farm.py - process data stream on cluster =========================================== Purpose ------- This script reads data from stdin and splits it into independent chunks to be executed on a cluster. Usage ----- As a basic, but not very useful example, the following command will take the in...
ff7ff623a22c2c9fe9caaa99e482c027dfddc6af07111dfc1478ac01c4a4f6c5
Python
36,741
748
"""Methods for searching for amplicons and guides within them. This combines primer_search, to search for amplicons bound by primers, and guide_search, to search for guides within those amplicons. We term the combination of these a "target". These methods score possible targets and search for the top N of them. """ ...
b94a11387a977b34e42b51658b7e10dc66005e8bc4645f37b68441d2c09a5d72
Python
36,895
838
""" This file contains functions used to copy and compress data in order to prepare it for the upload to Harvard Dataverse. It also contains functions to decompress and re-arrange the data to a consistent folder structure after downloading it from Harvard Dataverse. Author: jonas.braun@epfl.ch """ import os import shut...
f06d29b3e08ea705abcfb56813c486bc3f0ff2c3ff65bbc6695b831bdb6ebcd7
Python
36,917
1,142
# VIN-HMI EEG dataset # each (action/intention) sample/run belongs to 1 scenario and has 3 or 4 event types # # events = { # "Resting", # "Thinking" (eye closed), # "Thinking and Acting", # "Typing", # } # # action run: # scenarios = { # "nâng tay trái", # "nâng tay phải", # ...
126026b86ed0a1d06f5945bcd06798ce1608381ee61efb18083329c8793a07b9
Python
36,954
916
#!/usr/bin/env python3 # pylint: disable=line-too-long """ Various functions for annotating genomes. """ # System imports import pickle import shutil import os import tempfile import logging import subprocess import multiprocessing as mp from os import path, close, mkdir, listdir from dataclasses import dataclass from...
fbc549abbb6361d4d6245dba68abcc3c987dba0a4f9102c5604782842ce7286e
Python
36,976
667
""" This script contains the classess of the layers that we have implemented for our model """ import tensorflow as tf class AttGraphConvLayer(tf.keras.layers.Layer): def __init__(self, outDim,activation=None,alphaLReLU=0.2,dropAtt=None, **kwargs): # constructor, which just calls super constructor ...
5fff4ef3a73ed4dba2115cc537158dfca244e499cc5697a15ba5a3c543918b93
Python
37,018
900
"""PII detection and handling middleware for agents.""" from __future__ import annotations from functools import partial from typing import TYPE_CHECKING, Any, ClassVar, Literal from langchain_core.messages import AIMessage, BaseMessage, HumanMessage, ToolMessage from langgraph.stream import StreamTransformer from t...
4d8ad86f597366a47d8513368342b4bf8e94d49cfd725d33da19172a8b16c49d
Python
37,114
874
# based on https://github.com/atomicarchitects/equiformer_v2/blob/main/nets/equiformer_v2/equiformer_v2_oc20.py import logging import time import math import numpy as np import torch import torch.nn as nn from torch_geometric.data import Data, Batch import torch_scatter from pyexpat.model import XML_CQUANT_OPT from ....
bd8ca7927d785a5b70a0a7a27d1108e65e5ad7c2dc828010cd729c386ebdc8a8
Python
37,129
897
import time import torch.nn.functional as F from .modules import * import math import torch from torch import nn from torch.nn import functional as F from torch_cluster import radius_graph from e3nn import o3 from torch_scatter import scatter from e3nn.nn import FullyConnectedNet, Gate, Activation from e3nn.o3 import...
e7aaf98ecb4c1a7d930c574fe8a3b7053a9553628846ccc219761ba922209efe
Python
37,202
831
""" This module provides different types of training algorithms for RBMs running on CPU. The structure is kept modular to simplify the understanding of the code and the mathematics. In addition the modularity helps to create other kind of training algorithms by inheritance. :Implemented: - CD ...
dfa55e97b4c45f2a670395782fc652698561318d25567b450ad3128b4a4124e7
Python
37,212
1,031
import os os.environ["CUDA_VISIBLE_DEVICES"]="0" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
ddd8b059cdfdbb5bd31f125924ffb776a81aeff5273466f67d4b3b5c16e0bb3e
Python
37,226
1,292
from pathlib import Path import math from rich.console import Console from rich.table import Table from rich.pretty import Pretty import numpy as np import pandas as pd import cv2 from sklearn.cluster import MeanShift from skimage.transform import hough_circle, hough_circle_peaks import torch from torch.utils.d...
d10a3ae4bffa61a7912750c56cf600ff022ec2a1f1a24de2b830264ee26c9e1b
Python
37,259
899
# fix the issue that invariant feature in Convnet should come from src and dst nodes. # https://github.com/divelab/AIRS/issues/23 import time import torch.nn.functional as F from .modules import * import math import torch from torch import nn from torch.nn import functional as F from torch_cluster import radius_graph...
b243cebfe2591c2bf03ae5f89fe055fd2cea3d490c6fe0756cf418021369a5d3
Python
37,277
1,034
# -*- coding: utf-8 -*- """ Created on Fri Aug 28 23:57:02 2020 @author: Xingyan Liu """ from typing import Union, Sequence, Dict, Optional, Tuple import logging import numpy as np import pandas as pd import scanpy as sc from scipy import sparse import torch as th import dgl from ..utils import preprocess as pp from...
67131f5ef0b65d9a621c3d8cfaa1bd1217f93a2d18c0ffac2ce1830d8737860d
Python
37,325
1,034
# -*- coding: utf-8 -*- """ Created on Fri Aug 28 23:57:02 2020 @author: Xingyan Liu """ from typing import Union, Sequence, Dict, Optional, Tuple import logging import numpy as np import pandas as pd import scanpy as sc from scipy import sparse import torch as th import dgl from ..utils import preprocess as pp from...
238f7efceffe8069ce7ebbe6fb9b7ba98a89fe2ee015d62fd701f03a913364f5
Python
37,327
1,346
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Feb 17 15:40:11 2022 @author: mariano """ import sys, os import cooler import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import scipy as scy import time import pdb import esprenv as env from numba imp...
1989186f94ac3f002c26a587378714335a5e600e5771efe5b0706d7808744d43
Python
37,335
719
""" return hypergraph and subgraph DOSE: C2, CELL C3 GeneSet Hypergraph include 1. c2cp pathway gene sets 2. c3 tf-targeting genes 3. tissue-specific TFs GeneSet Subgraph include 1. tsp: tissue-specific expressed genes 2. es: essential genes 3. ef: effective genes (gene effect) 4. grn: cell line-specific targeting ...
c87e61cefaeb5e72978c747c1b7cf6cec4faf1ebe26ebf97b7125539260ba56a
Python
37,354
1,034
import os os.environ["CUDA_VISIBLE_DEVICES"]="2" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
83beeb462e4106cb5132d23c6d5e74bf441b34adc341ed82645ccdeb34b0b685
Python
37,360
1,034
import os os.environ["CUDA_VISIBLE_DEVICES"]="3" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
ef31cf40ad7519d2cb52a53a5bb56a61c31aaacf445f30744594a666d234fd16
Python
37,384
978
from __future__ import annotations from collections.abc import Hashable, Iterable from typing import Any import networkx as nx import numpy as np import pandas as pd from scipy.stats import multivariate_normal from pgmpy import logger from pgmpy.base import DAG from pgmpy.factors.continuous import LinearGaussianCPD ...
202fff59d427e591bb8209478af7b6bf9dbbb9673d5da1834d2f20f668b1eb34
Python
37,407
917
# -*- coding: utf-8 -*- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~IMPORTS~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# # Standard library imports from collections import OrderedDict, namedtuple, Counter import hashlib # Third party imports from tqdm import tqdm import numpy as np import pandas as pd import jinja2 from pyfaidx imp...
10d692bbd4cfccd82ad514649682f79306b9cd730235c3838bc3d1a96a455dea
Python
37,441
1,229
"""Base callback handler for LangChain.""" from __future__ import annotations import logging from typing import TYPE_CHECKING, Any if TYPE_CHECKING: from collections.abc import Sequence from uuid import UUID from langchain_protocol.protocol import MessagesData from tenacity import RetryCallState ...
0d40f04e0e6f5df5f304933ab44c230952b8924104244ee595cafaa0277a4edc
Python
37,445
988
import json from collections import namedtuple from datetime import datetime from pathlib import Path from zipfile import ZipFile import h5py import numpy as np from scipy.signal import convolve2d from torch.utils.data import Dataset from ..utils import no_transforms, recursively_load_dict_contents_from_group from .e...
a06e9584b1220d545f6d0ae5cad68bedaf2d057fd8e69de54513dff4fa38e8a7
Python
37,488
1,131
#!/usr/bin/env python # coding: utf-8 # In[1]: import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import Parameter import math from torch.nn.modules.loss import _WeightedLoss from torch.utils.tensorboard import SummaryWriter from sklearn.model_selection import train_test_split from sci...
a011f6ca0424465ee944539e6b4d85a751095d554f027036997aab52382a0c72
Python
37,497
923
"""Main training entry point for pre-training and downstream fine-tuning. """ import json import os import random import time from functools import wraps from typing import Callable, List, Sequence import fsspec import hydra import numpy as np import pytorch_lightning as pl import torch import wandb from omegaconf i...
4bbabc86e0637743aef50ca2ea1aeff49291d088dc77734aa4a5ed2bbe52d929
Python
37,499
1,042
import os os.environ["CUDA_VISIBLE_DEVICES"]="2" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
1448dce265d4a7fc30ea43bdfc10ca657c36cbaf4134a4b067211ce5f302af62
Python
37,664
905
'''Fairly basic set of tools for real-time data augmentation on image data. Can easily be extended to include new transformations, new process methods, etc... ''' #Code from https://github.com/oeway/keras/blob/extendImageDataGenerator/keras/preprocessing/image.py #wfrom __future__ import absolute_import from __future...
e078f72a767ac050694ff3fe596efcd9ffd020910625e61bcc89d7e90cb3594a
Python
37,686
793
# Code from https://github.com/titu1994/DenseNet '''DenseNet models for Keras. # Reference - [Densely Connected Convolutional Networks](https://arxiv.org/pdf/1608.06993.pdf) - [The One Hundred Layers Tiramisu: Fully Convolutional DenseNets for Semantic Segmentation](https://arxiv.org/pdf/1611.09326.pdf) ''' from __futu...
8f55c3c305e7a909366f6958d6890a8811afeef234a461d7d4e836ab3ee52511
Python
37,789
1,010
import numpy from typing import Union import pandas import hummuspy.config import hummuspy.explore_network import hummuspy def format_multilayer( TF_layer: Union[list, pandas.DataFrame], ATAC_layer: Union[list, pandas.DataFrame], RNA_layer: Union[list, pandas.DataFrame], TF_ATAC_bipartite: pandas.Data...
9506295684bb0c72553a80b9018b9d722ebdd80ff79f293bd60ffbd8b9f9b0cb
Python
37,886
908
'''Fairly basic set of tools for real-time data augmentation on image data. Can easily be extended to include new transformations, new process methods, etc... ''' #Code from https://github.com/oeway/keras/blob/extendImageDataGenerator/keras/preprocessing/image.py # Used for Random Crop function currently #wfrom __fut...
6289a6aa0544521ed478a9d936434927799f3f720f69bc4a980559864c394e29
Python
37,906
1,001
import argparse import torch from torch import nn import numpy as np from data import get_dataset import pandas as pd import pickle as pk from pymatgen.io.jarvis import JarvisAtomsAdaptor from pymatgen.core.lattice import Lattice from pymatgen.core.structure import Structure from jarvis.core.atoms import Atoms from tor...
d78702f022da3c9a48a0bf361b94f2ff5e913e93b13ba694a2d62286eecb9fdf
Python
37,929
1,122
""" This module is copied over from scikit-learn with some tweaks to prevent centering datasets. The :mod:`sklearn.pls` module implements Partial Least Squares (PLS). """ # Author: Edouard Duchesnay <edouard.duchesnay@cea.fr> # License: BSD 3 clause import numbers import warnings from abc import ABCMeta, abstractme...
1d02c176c0e8e311ca2df62321f406a6f3316c30f31cec19c8c20157f395ce05
Python
37,954
1,006
import copy import warnings from collections.abc import Mapping, Sequence from dataclasses import dataclass from itertools import chain from typing import ( Any, Callable, Dict, Iterable, List, NamedTuple, Optional, Tuple, Union, ) import numpy as np import torch from torch import T...
b1239ad46f5167c31828a5820d11b9e1af6d41489de1d24d19af67ab2f248d67
Python
38,100
1,054
import os os.environ["CUDA_VISIBLE_DEVICES"]="2" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
2b771068eda19b6f783e12ff483a02ab6ef8264108f3af5e486d3381fb1e7fb6
Python
38,178
914
import math from argparse import Namespace from typing import Optional from time import time from pathlib import Path import numpy as np import torch import torch.nn.functional as F from torch.utils.data import DataLoader import pytorch_lightning as pl import wandb from torch_scatter import scatter_add, scatter_mean f...
58b688d909ce03ccd6be0f7219cccb05d30b4909589eac4015eacbf469ed2f45
Python
38,232
714
''' -------------------------------- MODULUS MOTION TRACKING -------------------------------- History: Date Programmer Description ---------- ---------- ---------------------------- 29/06/2023 S MU v1.0.0 ''' _version='1.0.0' import os import sys sys.path.inse...
c8f0c7ba303a8b83db90c789715dff7c0ce92047088e79bcaf86f632a4cbb78f
Python
38,269
1,059
import os os.environ["CUDA_VISIBLE_DEVICES"]="1" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
bb850a417a6ee434dac80d40a3aaab398336aeb78a816cec32d4843b4606c219
Python
38,297
1,066
import os os.environ["CUDA_VISIBLE_DEVICES"]="3" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
c4bb51331d4e21a6db815cf869de93aaa2a530b577f95391296d25aef463e503
Python
38,335
843
"""Methods for analyzing coverage of a design against a collection of sequences. """ from collections import defaultdict import logging import math import numpy as np from easyDesign.utils import guide logger = logging.getLogger(__name__) class Design: """Immutable object representing a design. This can ...
13d257fb42e5bca02db9a8ae72c392d94d54b027c0d61454461e57e70c031232
Python
38,336
1,191
# 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...
e9145d7a586607e20af455b5053be0fae6f66564c0a710b89b075525465ec3dd
Python
38,388
1,209
""" module for behavioural processing with functions for behaviour classification and behaviour onset detection. Author: jonas.braun@epfl.ch """ import os import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt import pickle from scipy.ndimage import gaussian_filter1d, gaussia...
9aa70e05a095339603a12681309525bd01a48451532b948b092d9813a1e62c8f
Python
38,438
1,061
import os os.environ["CUDA_VISIBLE_DEVICES"]="1" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
0174e276f6d33ef4bfbcf1e019f0a829299e16e6fc431a4325bcc3eedcffe170
Python
38,613
1,214
import os import numpy as np import pandas as pd from hbayesdm.base import PATH_COMMON def alt_preprocess_func(self, raw_data, general_info, additional_args): # Iterate through grouped_data subj_group = iter(general_info['grouped_data']) # Use general_info(s) about raw_data # subjs = general_info['...
5851b1c3b5a84925a0d2b170453b06e4a8ecd2dc8fa31ced27577abfb0804782
Python
38,774
945
import os.path import sys sys.path.append('../') import came_origin as came from came_origin import pipeline, pp, pl import warnings warnings.filterwarnings("ignore") import logging import os #import sys #sys.path.append('../') from pathlib import Path import numpy as np import pandas as pd from matplotlib import pypl...
752b331c12fc175ba24dfe0e747caba277b796a707f75e6083ca7aa625b457e2
Python
38,791
1,032
""" Test suite for pymaid. For testing we are by default using the publicly hosted CATMAID instance of Virtual Fly Brain (https://fafb.catmaid.virtualflybrain.org/). You can switch the CATMAID instance and the neurons, volumes and annotations used for testing by setting environment variables. For example: PYMAID_TES...
ecd98f241ebddbb026ab525270d82b050bded3ff3dc6547e6b029df1507ef80a
Python
38,812
1,212
# 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...
8d4dfd172cfd877f53765f2f64ef211487cc605488eb90d8d1f88a0a3159b487
Python
38,846
875
''' Survival topic models experiment script Authors: Lexie Li, George H. Chen ''' import gc import itertools import sys, os, argparse, json, pickle os.environ['OPENBLAS_MAIN_FREE'] = '1' import numpy as np import torch from lifelines.utils import concordance_index from progressbar import ProgressBar from pycox.evaluat...
9dfc2b5279bf1183ec81a9ecbf31317b6eb55648cf10f08e7ba03498781b4e00
Python
38,889
1,078
import os os.environ["CUDA_VISIBLE_DEVICES"]="2" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
ef40c35102a51a664262949ee08a4d725973295e41f9761f20fa003e1ca78812
Python
38,907
947
import os.path import sys sys.path.append('../') import came from came import pipeline, pp, pl import warnings warnings.filterwarnings("ignore") import logging import os #import sys #sys.path.append('../') from pathlib import Path import numpy as np import pandas as pd from matplotlib import pyplot as plt # optional ...
85566ef74a41d794ecd6a808adcd6123ced13e2c7d14c079ace2016190994f4f
Python
39,011
726
import torch from torch.nn import functional as F import numpy as np import matplotlib.pyplot as plt import psutil from KineticAssembly_AD import VecSim from KineticAssembly_AD import VectorizedRxnNet from torch.optim.lr_scheduler import StepLR from torch.optim.lr_scheduler import ReduceLROnPlateau from torch.optim.lr_...
f007c9a4969ca481706871c9d7426b8ded49b1c004955ae7e433bce93cc13870
Python
39,019
1,072
import os os.environ["CUDA_VISIBLE_DEVICES"]="1" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
75c53989b58e70e171723c293203895fee119ffd4323bb6763baed2d3fc691dc
Python
39,078
1,042
import os os.environ["CUDA_VISIBLE_DEVICES"]="1" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
26105248fcb2dcd846632d4f3815daf661120ccbcb4d2ffbf20b5ef4ba1537f0
Python
39,083
726
import torch from torch.nn import functional as F import numpy as np import matplotlib.pyplot as plt import psutil from KineticAssembly_AD import VecSim from KineticAssembly_AD import VectorizedRxnNet from torch.optim.lr_scheduler import StepLR from torch.optim.lr_scheduler import ReduceLROnPlateau from torch.optim.lr_...
5a53cc963c9de60c259f29375d96871b46a8a173e0450d22ba04cd4e7382facd
Python
39,088
1,074
import os os.environ["CUDA_VISIBLE_DEVICES"]="1" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
cd68c8d203fc2d6d7a4e70fd4dd668e5e030c2109663e1adca3497d43b4e9a84
Python
39,113
1,074
import os os.environ["CUDA_VISIBLE_DEVICES"]="0" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
6114e16c9b74686e441bffd2576637fa8efb27cae2ca8d30fd97958636a3f2e1
Python
39,150
1,074
import os os.environ["CUDA_VISIBLE_DEVICES"]="1" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
6ec181dca45ee7449040150b574e46931cd402930ecc106db28a79fabccc4a16
Python
39,170
570
import torch import numpy as np num2aa=[ 'ALA','ARG','ASN','ASP','CYS', 'GLN','GLU','GLY','HIS','ILE', 'LEU','LYS','MET','PHE','PRO', 'SER','THR','TRP','TYR','VAL', 'UNK','MAS', ] aa2num= {x:i for i,x in enumerate(num2aa)} # full sc atom representation (Nx14) aa2long=[ (" N "," CA "," C ...
c8e62ee279272d11437f0b9f0da8c8d30fd132984005b9f27c4feeca05bfee61
Python
39,240
1,080
import os os.environ["CUDA_VISIBLE_DEVICES"]="1" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
4f6b25112cf4155c8df4f057b095a1924ca384363e0c7c1a41fb5983f41ed122
Python
39,246
954
"""Module contains logic for indexing documents into vector stores.""" from __future__ import annotations import hashlib import json import uuid import warnings from itertools import islice from typing import ( TYPE_CHECKING, Any, Literal, TypedDict, TypeVar, cast, ) from langchain_core.docum...
33fb48d7c62841b6c5bdaa654d310a160504bf8e92cf0ca2a524f4c0c75ea865
Python
39,265
948
import pdb import torch.nn.functional as F from .modules import * import math import torch from torch import nn from torch.nn import functional as F from torch_cluster import radius_graph from e3nn import o3 from torch_scatter import scatter from e3nn.nn import FullyConnectedNet, Gate, Activation from e3nn.o3 import ...
3f288673d96493a9bcdc1a4db1defb7a3820b1163fefe424d2cd1f2d30d7cc03
Python
39,355
920
# TODO update all 2p stim related attr's to naparm submodule import glob import os import time from typing import Union import matplotlib.pyplot as plt import numpy as np import pandas as pd from imagingplus import TwoPhotonImaging from imagingplus.main.subcore import MicroscopeMetadata, CellAnnotations from imagingp...
f8593a80dc0b0e35edb04f7f315517265947808ba8d1ebcc0bf7a5fa5bfdc89a
Python
39,356
1,068
import argparse import torch from torch import nn import numpy as np from data import get_dataset import pandas as pd import pickle as pk from pymatgen.io.jarvis import JarvisAtomsAdaptor from pymatgen.core.lattice import Lattice from pymatgen.core.structure import Structure from jarvis.core.atoms import Atoms from tor...
1b6e2fe3e26cb00a9e565187eb49d344eae98a8a1693da36807edb1cf06173e1
Python
39,451
1,048
import os os.environ["CUDA_VISIBLE_DEVICES"]="0" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
9fdf31302d50c7781c2dc0e9a0431e3e1b0a3ed030f6c7e54fa6e63a71e409e0
Python
39,459
1,062
import warnings import numpy as np import torch import matplotlib.pylab as plt import ast from os.path import join as opj from PIL import Image from imageio import imwrite from matplotlib.colors import ListedColormap from pandas import DataFrame, concat from skimage.morphology import binary_dilation from dataclasses im...
c2f794d2ed6a61458339f049d167fc5a2edec758736c66344073788121f4f52a
Python
39,474
952
import time import torch.nn.functional as F import math import torch from torch import nn from torch.nn import functional as F from torch_cluster import radius_graph from e3nn import o3 from torch_scatter import scatter from e3nn.nn import FullyConnectedNet, Gate, Activation from e3nn.o3 import Linear, TensorProduct,...
979f445734c460eb8240ec80a53518c0cd4acf82cba81322dd526733daaf73fa
Python
39,489
922
import torch torch.autograd.set_detect_anomaly(True) import torch.nn as nn import torch.nn.functional as F import numpy as np import copy import math import re import torch.distributions as dist from collections import namedtuple from transformers.modeling_outputs import MaskedLMOutput from mamba_ssm.models.mixer_seq_...
ef4f31dc9d397fca79330b6b881b81f0e204f758ddecfbee8893810afff8b386
Python
39,531
950
import time import torch.nn.functional as F import math import torch from torch import nn from torch.nn import functional as F from torch_cluster import radius_graph from e3nn import o3 from torch_scatter import scatter from e3nn.nn import FullyConnectedNet, Gate, Activation from e3nn.o3 import Linear, TensorProduct,...
0dd2fd157d4d4696c96a824c9a8da8e17fe8e93784fb1a3d574e7cacf18566dd
Python
39,532
1,047
import os os.environ["CUDA_VISIBLE_DEVICES"]="1" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
1a24de5b08768e9719eadd961be71f3163c194ba36411e88a8db20ebc2d2e4c8
Python
39,532
1,047
import os os.environ["CUDA_VISIBLE_DEVICES"]="0" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
2bdb7ef301715f0d45b531799207b3cf2f659d0c5f5d01b36ed3e68f91b54218
Python
39,541
1,047
import os os.environ["CUDA_VISIBLE_DEVICES"]="0" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
f71215104a1e60f7448907d35c4bc0ddd130433f7d25f7ab66d7c08e3227ec82
Python
39,562
1,310
# 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...
a6590a03c7c4b557d44085515492fbb7618f58232621f5a489c18806fbac167a
Python
39,645
585
import torch import numpy as np num2aa=[ 'ALA','ARG','ASN','ASP','CYS', 'GLN','GLU','GLY','HIS','ILE', 'LEU','LYS','MET','PHE','PRO', 'SER','THR','TRP','TYR','VAL', 'UNK','MAS', ] # Mapping 3 letter AA to 1 letter AA (e.g. ALA to A) one_letter = ["A", "R", "N", "D", "C", \ "Q", "E...
371b781fa556a9ddd535eeb80e336962b81a8eec5c8a2949e74768984f0db3c9
Python
39,672
971
#@title Huggingface Pretrained Wrapper # for Huggingface integration, we use a wrapper class around the model # to load weights import json import os import subprocess import transformers from transformers import PreTrainedModel, AutoModelForCausalLM, PretrainedConfig import re import torch import torch.nn as nn import...
812a8036ad32fe235bc93a8653ac010528d50015f6ba156d4c2215dc4eaac5e6
Python
39,707
899
import torch import numpy as np from typing import Any class Muscle(torch.nn.Module): """Base class for `Muscle` objects. If a effector contains several muscles, this object will contain all of those in a vectorized format, meaning for any given effector there will always be only `one` muscle object, regardless...
72b22c21bf42d4dcec8aa94d34867015da1493aee5bdbe77316cf183cffd2849
Python
39,713
733
# 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...
20cb733817920ad2d7af43dedc2a543f3dd42c8bf5c6b07fcbe45c7f6bf12fb0
Python
39,750
1,157
# -*- coding: utf-8 -*- """Defines the basenetwork class.""" # Core imports import abc # Vulcan imports from .layers import * from .utils import set_tensor_device from .metrics import Metrics from ..plotters.visualization import display_record, get_save_path # Generic imports import pydash as pdash from tqdm import ...
8beb112174cb25ec2f6af320156edc10f11613b7ed0e6b05703868316de0b36e
Python
39,938
1,097
import os os.environ["CUDA_VISIBLE_DEVICES"]="0" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
dabcb1b29da06c387c47f8d1fdb18425896289cc2ceab048f715fc0cb0007f60
Python
40,018
840
#!/usr/bin/env python # coding: utf-8 # Copyright (c) venkatesh-sivaraman. # Distributed under the terms of the Modified BSD License. """ Defines the main Emblaze visualization class, `emblaze.Viewer`. """ from ipywidgets import DOMWidget from numpy.core.fromnumeric import sort from traitlets import Integer, Unicode...
e60874dedc4479e526d84d7178c9f671a16f1f95c769b8963709c89128a5f608
Python
40,021
1,312
""" ================================================ bamstats.py - Tasks for QC'ing Bam Files ================================================ :Author: Adam Cribbs :Release: $Id$ :Date: |today| :Tags: Python Perfroming stats on a bam file is an important task in quality control of `.bam` files. The majority of tools ...
ed531d00ed88698652d4ede95f6a97a504304919c57904fd66a779c570c60e09
Python
40,024
843
import argparse import logging import sys from copy import deepcopy sys.path.append('./') # to run '$ python *.py' files in subdirectories logger = logging.getLogger(__name__) import torch from models.common import * from models.experimental import * from utils.autoanchor import check_anchor_order from utils.general ...
93e49cb99299d6b13bb9d17e62879354526066c29f7d672c49c4c2a158068b7b
Python
40,028
784
# 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...
a4dc8e01904ebb4dc22fead215acd94ddeed3d6459553a2692c345633040e9e0
Python
40,078
1,033
import torch from torch import nn from torch.autograd import Variable import torch.nn.functional as F from torch.autograd import Function from bernn.dl.models.pytorch.utils.stochastic import GaussianSample from bernn.dl.models.pytorch.utils.distributions import log_normal_standard, log_normal_diag, log_gaussian from be...
84abe206133fe6bc0ae8c42275d61d4eb1fc51ea24f0e6f1ac410b18c83aff36
Python
40,114
1,076
import os os.environ["CUDA_VISIBLE_DEVICES"]="0" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
74468ece5135745bb6fa2fd4cfa06c2a9f495802b59c730863cd8839746e8cb6
Python
40,178
1,092
import os os.environ["CUDA_VISIBLE_DEVICES"]="0" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, MultiplicationArc...
7785af0ae6ff2fa441eeb7f9cbf6fe62d7e4c8495987ec89ca149a6e07d03771
Python
40,232
1,052
#################################################################################### # # STEPS - STochastic Engine for Pathway Simulation # Copyright (C) 2007-2023 Okinawa Institute of Science and Technology, Japan. # Copyright (C) 2003-2006 University of Antwerp, Belgium. # # See the file AUTHORS for d...
56fc4f6ec2b46937f7c2cd124456386f2c46f9012af841a2c46e58538f79e83e
Python
40,275
775
"""tests for pipeline.py. landmarks are always manual now (see pipeline.py for why automatic detection got dropped). fast tests use a synthetic ellipsoid with hand-placed landmarks, and/or template_xy_com.ply (already in the frame the clip constants assume, since it's literally the mesh the app displays as the registr...
f9d2787635e557c138530e8612d589f402ec5a585498bf7f63276c51cd783528
Python
40,313
1,139
# -*- coding: utf-8 -*- """ Created on Tue Apr 20 20:11:08 2021 @author: Xingyan Liu """ import os from pathlib import Path from typing import Sequence, Union, Mapping, List, Optional # , Callable import numpy as np import pandas as pd from matplotlib import pyplot as plt import seaborn as sns import scanpy as sc fr...
693e760284093682e99a4f9136d69e74619c6b27eb53994b84f5c7e342287f01
Python
40,336
743
# 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...
53abf1bf007ba776fd91ab0a13084e86aeaf3e6e0b0ee2c0c0496abb2ded75de
Python
40,472
1,100
import os os.environ["CUDA_VISIBLE_DEVICES"]="3" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, MultiplicationArc...
7e62f5d0b31d18b31125dd4065f2f20e6fac3c1ba3f8e6386ae00fdcb3447740
Python
40,568
819
# Author: Sarthak Jain (Supervisor: Professor Sandra Safo) import numpy as np import numpy import matplotlib.pyplot as plt import torch from sklearn.model_selection import train_test_split from sklearn.svm import SVC from sklearn.metrics import classification_report import skfda from skfda import FDataGrid fr...
9e6455af058aca0c7b75006f24f61d173e1de137b62c6f50f10fc48612f0c045
Python
40,570
1,042
import tensorflow as tf import numpy as np from utils.ProcessData import get_maxDims, gen_smiles2graph from sklearn.utils import gen_batches import matplotlib.pyplot as plt import pandas as pd from sklearn import metrics def perform_validation(model,validation,val_metric,batchsize,nfeat): """ Test the model o...
02927bd701816775afdfabbf6272cedb68d73c79cd04cb2085417f805f397d5a
Python
40,614
1,090
import os os.environ["CUDA_VISIBLE_DEVICES"]="1" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
3b40b00fb9135d431bba53abcf5c54d60668b189863d6cefa5c1eb35dd8b2823
Python
40,627
1,119
import os os.environ["CUDA_VISIBLE_DEVICES"]="0" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
b35505610a2fbbcbb7764b571027a61f786ced63c605dd7db042a31f31f79c45
Python
40,628
1,119
import os os.environ["CUDA_VISIBLE_DEVICES"]="0" import sys sys.path.insert(0,"/examples") from modulusDL.models.arch import ( CustomModuleArch, FullyConnectedFlexiLayerSizeArch, CaseIDtoFeatureArch, CaseIDArch, FixedFeatureArch, MaxPoolArch, MatrixMultiplicationArch, SumMultiplication...
778318d97cc923745d0f71bc4be58550c2619782b12444ddac115073d3b91c60
Python
40,739
1,327
'''windows - Tasks for window based read distribution analysis ====================================================================== Requirements: * bedtools >= 2.21.0 * picardtools >= 1.106 * samtools >= 1.1 * MEDIPS >= 1.15.0 Reference --------- ''' import os import re import collections import pandas import ma...
f4e91f6860ad9f518e41bfae903dce8cfad3f19ee678a989cc6deda2451ff26e
Python
40,763
1,068
from __future__ import annotations import warnings from collections.abc import AsyncIterator, Callable, Iterator, Sequence from importlib import util from typing import Any, Literal, TypeAlias, cast, overload from langchain_core._api import deprecated from langchain_core.language_models import ( BaseChatModel, ...
d8d4ca4ac1110b3e9cf57b7174bb9052125b1badb647a13255f0cdf1ee3f7c45
Python
40,800
1,213
import logging import shutil import tempfile import traceback from pathlib import Path import h5py as h5 import numpy as np import pytest import tifffile from click.testing import CliRunner from astrocast.analysis import Events from astrocast.cli_interfaces import climage, convert_input, delete_h5_dataset, denoise, d...