sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
8b40aa23efa3cea9eaee072269202c9f4881025101426cb411574487dc003f64 | Python | 26,289 | 875 | # Copyright 2014 Darsh Ranjan
#
# This file is part of python-plyfile.
#
# python-plyfile 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 the
# License, or (at your option) any ... |
f1f7755e16ab70b96276fdb8359e457a1cbc56b15d2fa39a2f69927381bfbced | Python | 26,338 | 617 | """Caduceus model for Hugging Face.
"""
import math
from functools import partial
from typing import Optional, Tuple, Union
import torch
from mamba_ssm.modules.mamba_simple import Mamba, Block
from torch import nn
from torch.nn import functional as F
from transformers import PreTrainedModel
from transformers.modelin... |
38f1c22c0081e2ca84f5bf6a7362c4db7bc00a1a72a101788a1ba36dbd7e56e5 | Python | 26,401 | 672 | import json
import tempfile
from abc import ABC, abstractmethod
from datetime import timedelta
from typing import List
from MRdataset import valid_dirs
from MRdataset.base import BaseDataset
from bokeh.palettes import turbo, d3
from mrQA.config import status_fpath
from protocol import BaseSequence
class CompliantDat... |
7634cf73ca1111db9a3e383326669dd8548e20788946aaf24855409a8969356d | Python | 26,417 | 156 | #!/usr/bin/env python
# -*- coding: latin-1 -*-
# Fonts:
fpdf_charwidths = {}
fpdf_charwidths['courier']={}
for i in range(0,256):
fpdf_charwidths['courier'][chr(i)]=600
fpdf_charwidths['courierB']=fpdf_charwidths['courier']
fpdf_charwidths['courierI']=fpdf_charwidths['courier']
fpdf_charwidths['cou... |
29a3fc15418fe90d0c0238dda9abc0ff75054539d55f79a2bcbb9f6298d346b0 | Python | 26,492 | 492 | # 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... |
07f5436e106081b15f97064b049bf9f86b80c9d771e640aa3faea9746d38eeb7 | Python | 26,566 | 620 | """Dataloaders for genomics datasets, including pretraining and downstream tasks.
- Adapted from:
https://github.com/huggingface/transformers/blob/master/examples/pytorch/language-modeling/run_clm.py
- Adapted from:
https://github.com/HazyResearch/flash-attention/blob/main/training/src/datamodu... |
4bd84ae178149dd27423c829db9d16150f12027c1993d8088bf0c4fbeb958cfb | Python | 26,581 | 627 | # Copyright (c) 2008-2026 the MRtrix3 contributors.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Covered Software is provided under this License on an "as is"
#... |
b07464bd90e1f75bd9f98c35e5fc67f1b46a91941771d59d3d8a62e14dfe893d | Python | 26,592 | 625 | """ This module provides different sampling 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
sampling algorithms by inheritance.
:Implemented:
- Gibbs Samplin... |
006d9acffc0b32e0b95e72487389eede710056a2d5cfa8296bd6729460301ee5 | Python | 26,598 | 687 | import numpy as np
import json
import warnings
import operator
from matplotlib import pyplot as plt
import matplotlib.gridspec as gridspec
warnings.filterwarnings("ignore")
base_path = 'data_20_05/'
all_approaches_path = ['dnn/', 'dnn_wc/', 'cnn/', 'cnn_wc/', 'gru/', 'gru_wc/']
titles = ['(a) Dense neural network ... |
43c6b98bc68d5d214dd2e2775a10eb007dee034c005766fbc310005147bfb788 | Python | 26,617 | 436 | # 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... |
d1029e9158176ab08a50fa08f6fad49ae6b3ed935e5e698596b9017734f790e9 | Python | 26,634 | 588 | """Tests for motornet.effector — Effector base class and all pre-built effectors."""
import numpy as np
import pytest
import torch
from motornet.effector import Effector, FreePointMass24, Reacher
from motornet.muscle import ReluMuscle, RigidTendonHillMuscle
from motornet.skeleton import PointMass
# ----------------... |
cf86c57a335923f2a6aa819850b894e2f4f5306bfb87c2682c196b8763bd0db8 | Python | 26,635 | 647 | # Copyright 2022 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, s... |
e3642e31973433bb39fdeb88755f73c3fd962039c47e2161d318afe10407dfb0 | Python | 26,648 | 585 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Version Jela! 6.0
import xml.dom.minidom as dom
import xml.dom
from decimal import *
import sys
import os
import datetime
#from Numeric import *
# Dokument erzeugen
implement = xml.dom.getDOMImplementation()
###################Globale Variablen###################
musi... |
7615653ad85ba357ef21623c66981f83ae8d1e57c6d9813829cbda19e6b27edc | Python | 26,685 | 695 | """
===============================================================================
File: data
Date: 6/6/2024
Description: Database utilities
Notes:
Structure of LMDB:
* Keys are cids as strings, ex: b'000015111' (strings enoded with string.encode or b'string')
* Values are nested d... |
131a96577df7ed45c1c0d7e5306af05737bc66976393d06eb3817ebcace4d59e | Python | 26,701 | 670 | #-----------------------------------------------------------------------------
# Copyright (C) 2019-2022 A. Behdenna, A. Nordor, J. Haziza and A. Gema
# 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 Founda... |
82393c43326efd893e88b1fbf78edebea63044ce22e4096ef42fcf3fe10ebcaf | Python | 26,705 | 508 | import os
import pandas as pd
import numpy as np
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import accuracy_score, f1_score, roc_auc_score
from sklearn.metrics import accuracy_score, f1_score, confusion_matrix, precision_recall_fscore_support,classification_report
import scanpy as sc
from scipy... |
260de5bbbc388123f43ef30b9c4625e3e4748fd4c378db5f2f646347dc8bf556 | Python | 26,718 | 849 | """Implementation of the `RunnablePassthrough`."""
from __future__ import annotations
import asyncio
import inspect
import threading
from collections.abc import Awaitable, Callable
from typing import (
TYPE_CHECKING,
Any,
)
from pydantic import RootModel
from typing_extensions import override
from langchain... |
43e8db1f20a6990308f034e314ce05da3a6ea7aec35b0d8ba3f6a7a8dbea3cbe | Python | 26,785 | 600 | ####################################################################################
#
# 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... |
2e7e04dca639f66701931f2197cdca7137261bfc89393d48db9e076792abeee5 | Python | 26,794 | 426 | import argparse
import os.path
def main(args):
import json, time, os, sys, glob
import shutil
import warnings
import numpy as np
import torch
from torch import optim
from torch.utils.data import DataLoader
from torch.utils.data.dataset import random_split, Subset
import copy
im... |
8d41f2920ec4f71bc0890238dd2a396aecbfec9dc7b0698162e27be5a156c218 | Python | 26,796 | 610 | """
Generic acquisition functionality used by both Python and Java backends
"""
import copy
import types
import numpy as np
from typing import List, Iterable
import warnings
from abc import ABCMeta, abstractmethod
from docstring_inheritance import NumpyDocstringInheritanceMeta
import queue
import weakref
from pycroman... |
7248f4ba02c067deddc131be905bf27998d363e801a4a81d0e1eed4c840dc0bf | Python | 26,832 | 565 | """ Automatically discard noise clusters conservatively (by amplitude, spatial spread, ISI violation ratio) and viz"""
#%%
import json
import os
from time import time
from copy import deepcopy
import gc
from collections import OrderedDict
import numpy as np
# from scipy.io import loadmat
import matplotlib
from matplot... |
9c62b290b1b76fc7289f4b803fbda7b619b8893d9366eb5770c0db9dc9a340ff | Python | 26,859 | 744 | """ This module provides functions for displaying and visualize data.
It extends the matplotlib.pyplot.
:Implemented:
- Tile a matrix rows
- Tile a matrix columns
- Show a matrix
- Show plot
- Show a histogram
- Plot data
- Plot 2D weights
- Plo... |
7175c7518f7cf296a828b10d97cf4896ec41c9afe5a18a21114aa8c9f51e4188 | Python | 26,904 | 533 | #!/usr/bin/env python3
"""Analyze coverage obtained by designs."""
import argparse
import logging
import os
import sys
import math
from easyDesign import coverage_analysis
from easyDesign.prepare import ncbi_neighbors
from easyDesign.utils import log
from easyDesign.utils import predict_activity
from easyDesign.utils... |
e39099d6bb2303240e3a2f5bd9ac753456b0d5dd2b96aae94db14a478f0504f3 | Python | 26,909 | 748 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import json
import logging
import math
import os
from os.path import exists, join, split
import threading
import time
import numpy as np
import shutil
import sys
from PIL import Image
import torch
from torch import nn
import torch.backends.cudnn as cudnn... |
e63352a02c59359f6fcf5d1d4d5d29bb67066fed64a38b202842f932fa174ac7 | Python | 26,937 | 635 |
# Contains the following functions:
# DeepIDA_nonBootstrap
# DeepIDA_Bootstrap
# DeepIDA_VS
# Please see helper_functions.py for additional functions that the above three functions make use of
# Original Authors: Jiuzhou Wang and Professor Sandra Safo (https://arxiv.org/abs/2111.09964) --- (https://github.com/la... |
2c20dc8026e71f585780d0bf4f7198bce15443cb235b137ceb9aadef0d69299a | Python | 26,990 | 593 | # Import libraries
import os
os.environ["CUDA_VISIBLE_DEVICES"]='0'
os.environ["TF_CPP_MIN_LOG_LEVEL"]='2'
import tensorflow as tf
physical_devices = tf.config.list_physical_devices('GPU')
availale_GPUs = len(physical_devices)
print('Using TensorFlow version: ', tf.__version__, ', GPU:', availale_GPUs)
if physical_dev... |
83da77018a55c455a1ea17f3f74492469b8b035c14d73df983875fb5e9d8270f | Python | 26,990 | 593 | # Import libraries
import os
os.environ["CUDA_VISIBLE_DEVICES"]='0'
os.environ["TF_CPP_MIN_LOG_LEVEL"]='2'
import tensorflow as tf
physical_devices = tf.config.list_physical_devices('GPU')
availale_GPUs = len(physical_devices)
print('Using TensorFlow version: ', tf.__version__, ', GPU:', availale_GPUs)
if physical_dev... |
6dca15f41cfd5569356148db02a21fc225be23298a069f0775f8e3ee043eaa19 | Python | 27,004 | 717 | import torch
from torch import nn
from torch.autograd import Variable
import torch.nn.functional as F
from torch.autograd import Function
from .utils.stochastic import GaussianSample
from .utils.distributions import log_normal_standard, log_normal_diag, log_gaussian
from .utils.utils import to_categorical
import pandas... |
f5e73aac44fef5acc3693f68beae045e932a80187a512f1d727ab8921551502b | Python | 27,119 | 552 | # %%
"""
==============================================================
Attempt to classify MEG data in the source space - neuronal avalanches vs classical approaches - classification on longer trials w/ SVM
===============================================================
"""
# Authors: Marie-Constance Corsi <marie.con... |
6be9a4e14f1828480c2bf717c8fa641a86172936e60644456c4e6c428d5629b9 | Python | 27,132 | 847 | import torch
from numbers import Number
import numpy as np
import pandas as pd
from typing import Optional, Union
from torch import nn
import torch.distributions as dist
import torch.autograd as autograd
from torch.optim import Adam, AdamW, SGD
from torch.utils.data import DataLoader, TensorDataset
from torcheval.metri... |
5c609fc3db6f68ffa06da1f43e9b6bdad28ca04ebe8010a79bd0d47fc0e55a64 | Python | 27,161 | 723 | #pyenv shell miniconda3-4.2.12/envs/3D_CNN_tf24
import os
import zipfile
import numpy as np
import copy
import tensorflow as tf
import cv2
from tensorflow import keras
from tensorflow.keras import layers, models
from tensorflow.keras.utils import to_categorical, plot_model
#import keras
#from keras import layers
#fro... |
470ed30af44f781196154f5ffccf563687d2119aa74ffa54c328ced853f67485 | Python | 27,168 | 486 | # -*- coding: utf-8 -*-
import math
import os
import torch
import random
import gudhi
import anndata
import cmcrameri
import numpy as np
import scanpy as sc
import networkx as nx
import torch.nn as nn
import matplotlib.pyplot as plt
from scipy.spatial import distance_matrix
from torch_geometric.nn import GCNConv, DeepG... |
cceb09bba50c7e33481a874b235d26eaaf76b263fb0909556858b4dab0777344 | Python | 27,233 | 843 | # 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 ... |
f236b6fc0d692bec71bf6ecf7361d3910a6d084656df99c6b31701fac7799222 | Python | 27,233 | 774 | """Utilities for the root listener."""
from __future__ import annotations
import logging
import traceback
from abc import ABC, abstractmethod
from datetime import datetime, timezone
from typing import (
TYPE_CHECKING,
Any,
Literal,
cast,
)
from langchain_core.exceptions import TracerException
from la... |
33fed9b51f688393c03601dfde7162352c03fac9dd9e177defad5ed1ae60c14f | Python | 27,320 | 633 | import random
from torch.utils.tensorboard import SummaryWriter
import time
import argparse
import torch
from torch import optim
from torch.optim.lr_scheduler import StepLR
from models import ModeFormer, SRCNN, RDN, Wrapper
from models_FNO import FNO2d
from RCAN import RCAN
from DataLoader import PDEDataset, train_vali... |
b4f58593d0d1e8baa33edbcfd5caa3e6be57e6afc6ae1b539e74892267f3fff5 | Python | 27,323 | 539 | # 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... |
16c0379362c91d9d9145fa2f4b5e79c108c5a6238600b2838f0213a02f143182 | Python | 27,361 | 659 | # 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... |
079e5ccebbfab65cebf098d67fd99c9da34cabdb8ee30e1a82c911740ba06c5e | Python | 27,362 | 814 | # Copyright 2024 DeepMind Technologies Limited
#
# AlphaFold 3 source code is 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... |
b77b3d5a6af11f3622cd9fa2c8b132e0448d0a513169bd45051f8da28c3e65a0 | Python | 27,370 | 595 | ''' Feed Forward Neural Network Trainer.
.. Note::
Due to computational benefits the common notation for the delta terms is
split in a delta term for the common layer and the error signal passed
to the layer below. See the following Latex code for details. This allows
to store all... |
8b11ebcc532e8b685e123a3b0cf84b623e5ef9a28b1c5bcd79495f027b82b0a5 | Python | 27,387 | 750 | #!/usr/bin/env python
import argparse, sys, copy, gzip, os
import math, time, re
import numpy as np
from scipy import stats
from collections import Counter
from argparse import RawTextHelpFormatter
from operator import itemgetter
__author__ = "Colby Chiang (cc2qe@virginia.edu)"
__version__ = "$Revision: 0.0.2 $"
__da... |
89285729f0d3a5479dd41e49106a1fc4498575d4d23dbb45d40d6907d222c33d | Python | 27,411 | 805 | """
Utility subroutines
"""
__all__ = [
"all_subclasses",
"convert_0_1_smirnoff_to_0_2",
"convert_0_2_smirnoff_to_0_3",
"convert_all_quantities_to_string",
"convert_all_strings_to_quantity",
"deserialize_numpy",
"get_data_file_path",
"get_molecule_parameterIDs",
"inherit_docstrings... |
74a559c5b07dd621c3ca0d8253c4a040d3e73674c8c4f29bdaa1d2b9a9213a37 | Python | 27,438 | 659 | import MDAnalysis as mda
from MDAnalysis.analysis.hydrogenbonds.hbond_analysis import (HydrogenBondAnalysis as HBA)
import numpy as np
from gridData import Grid
from tqdm import tqdm
import os
from pensa.preprocessing.density import generate_grid, local_maxima_3D, write_atom_to_pdb
# -------------------
# Helper Fu... |
c59607bd8709be0fe6d2f44bec73779eb33f924299b6a5e66a5d519b198767b8 | Python | 27,505 | 728 | """
Module to create and interact with a DataFrame that summarises data from all recordings.
Author: jonas.braun@epfl.ch
"""
import os
import sys
from glob import glob
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import cv2
import json
from datetime import date
today = date.today().strftime... |
e4cf09cc4e5dd1c2e6c3241fae5878a6343182910ca6e5445da63d7a34984674 | Python | 27,526 | 764 | import numpy as np
import scipy.integrate
import matplotlib.pyplot as plt
from matplotlib import patches
import copy, math, os, types
from data import generate_recog_data, generate_recog_data_batch
import torch
from torch.utils.data import TensorDataset
def plot_w1_row_col_sums(w, label='', save=False)... |
ee37ba826e4ab616ce3087a0b8d254c91375d49638a8b13538a58a2e5b391cc8 | Python | 27,544 | 648 | ####################################################################################
#
# STEPS - STochastic Engine for Pathway Simulation
# Copyright (C) 2007-2026 Okinawa Institute of Science and Technology, Japan.
# Copyright (C) 2003-2006 University of Antwerp, Belgium.
#
# See the file AUTHORS for detai... |
d8907b305db48d14c86019eba672e78400a9158eebe5771f16170e04a5f846c0 | Python | 27,557 | 716 | # Define the RNN model and task related function
import os
import numpy as np
import tensorflow as tf
import scipy.io
# define the RNN class respecting Dale's law
class RNN_Dale:
def __init__(self, hp):
# load the hyperparameters
self.task = hp['task']
self.with_STP_f... |
0b0e0b4d9fa2fb61002abcd1e529e84daef249e8d6fc481c574c41ad1dbac7f7 | Python | 27,563 | 589 | #!/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-04-22 09:31 $"
# --------------------------------------
#... |
ec8c9f7056992975f941ebf67170d025e9897dc619849cc8d5642ce31afa3f33 | Python | 27,621 | 750 | import copy
from functools import partial
import json
import logging
import os
import pickle
from typing import Optional, Sequence, List, Any
import ml_collections as mlc
import numpy as np
import pytorch_lightning as pl
import torch
from torch.utils.data import RandomSampler
from openfold.data import (
data_pipe... |
5d67fdc2ab95f6c18a83ce51e8493deb93423efccee2643893ed0a82a3af54e8 | Python | 27,640 | 906 | from enum import Enum
import pydantic
import pytest
from packaging.version import Version
from langchain_core.tools import tool
from langchain_core.utils.function_calling import convert_to_openai_tool
from langchain_core.utils.json_schema import dereference_refs
def test_dereference_refs_no_refs() -> None:
sche... |
cb0087dd94263f2e8add3849a24876fa0f38a0ba487adf768f431d448451a10d | Python | 27,651 | 955 | """Base interfaces for tracing runs."""
from __future__ import annotations
import asyncio
import logging
from abc import ABC, abstractmethod
from typing import (
TYPE_CHECKING,
Any,
)
from typing_extensions import override
from langchain_core.callbacks.base import AsyncCallbackHandler, BaseCallbackHandler
f... |
c804fa419233e80988e24329a2641802b069259eeda9169a8764d55c1e96829a | Python | 27,653 | 609 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Test utility functions in utils.py.
"""
import abc
import copy
# ==============================================... |
5d9239cd1a330b3858e1b128c37be4690a4f939576eb2219d5336665aa6c03cc | Python | 27,725 | 700 | from __future__ import annotations
import logging
import warnings
from collections import OrderedDict
from typing import TYPE_CHECKING
import numpy as np
import pandas as pd
import torch
from scipy.sparse import csr_matrix
from scvi import REGISTRY_KEYS, settings
from scvi.data import AnnDataManager
from scvi.data._... |
0ca612058da3353c2043e0d5c35ccb04b6ae7dbbb4c9f64cc02eb3352145af42 | Python | 27,754 | 736 | """Functionality for loading chains."""
from __future__ import annotations
import json
from pathlib import Path
from typing import TYPE_CHECKING, Any
import yaml
from langchain_core._api import deprecated
from langchain_core.prompts.loading import (
_load_output_parser,
load_prompt,
load_prompt_from_conf... |
40a14e84a4839e71fd9e346eaee2a1e4c42371c0b4f4d10eec1bca315ccca399 | Python | 27,770 | 754 | """================================
Optimizing cufflinks parameters
================================
:Author: Nick Ilott
:Release: $Id$
:Date: |today|
:Tags: Python
The cufflinks optimization pipeline attempts to assess the quality of
a variety of transcript assemblies using various sets of parameters.
Overview
====... |
be028d6281bc64d3633f50c84ed2472c928417658482d7b3bae21bdc8dfb9880 | Python | 27,807 | 646 | """ This module provides basic structural elements, which different models have in common.
:Implemented:
- BipartiteGraph
- StackOfBipartiteGraphs
:Version:
1.1.0
:Date:
06.04.2017
:Author:
Jan Melchior
:Contact:
JanMelchior@gmx.de
:Licens... |
24cd7676e54b61fc2e957322c03db4202ea22f54ef56cc8d002398d84a14ce49 | Python | 27,878 | 928 | """
===========================
Pipeline bamstats
===========================
:Author: Adam Cribbs
:Release: $Id$
:Date: |today|
:Tags: Python
The intention of this pipeline is to perform QC statistics on
`.bam` files that are produced following mapping of fastq
files.
The pipeline requires a `.bam` file as an... |
e69e1d4710574b18a43263957c6a5a7777f5312d9891cc4c3322e87d325bf15c | Python | 27,952 | 660 | ####################################################################################
#
# STEPS - STochastic Engine for Pathway Simulation
# Copyright (C) 2007-2026 Okinawa Institute of Science and Technology, Japan.
# Copyright (C) 2003-2006 University of Antwerp, Belgium.
#
# See the file AUTHORS for detai... |
bcaa470c690da99d1fb0f20500154974472caf0bf4ffeb37c28d8ba388c9c6e1 | Python | 27,966 | 748 | 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 pyro
from pyro.infer import Trace_ELBO
from scvi import REGISTRY_KEYS, settings
from scvi.data import AnnDataManager
from scvi.data._utils imp... |
49cb124d19f9522a1379336f1eead794d45ab0525ea9a075bc45630d42e2980e | Python | 27,974 | 642 | import torch
import torch.nn as nn
import torch.optim as optim
import pandas as pd
import numpy as np
import random
import json, os
import h5py
import scipy
from scipy.sparse import csr_matrix
import pysam
from torch.utils.data.dataloader import DataLoader, Sampler
from tqdm import tqdm
from torch_geometric.utils impor... |
764fff6bee79c6b66fc2911dcb252e285f2a9661812715fab39030a67635dab6 | Python | 27,981 | 518 | """
Module to make figure for predictions data
Author: jonas.braun@epfl.ch (with input from femke.hurtak@epfl.ch)
"""
import os
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.backends.backend_pdf import PdfPages
import pickle
from tqdm import ... |
6f2854925aa29d294dab1bde99e0d7d1b24a38992f2ffe6cca70546450c7f69f | Python | 27,996 | 766 | from collections import defaultdict
from collections.abc import Mapping
from typing import TYPE_CHECKING, Optional
if TYPE_CHECKING:
from openmm.app import Atom as OpenMMAtom
from openmm.app import Residue as OpenMMResidue
from openmm.app import Topology as OpenMMTopology
class OpenFFToolkitException(Exc... |
43e6fca7483da065e2421ddf3cac6282acac889862ca27728b36518f4daa921d | Python | 28,069 | 853 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 7 14:26:48 2022
@author: shni2598
"""
import numpy as np
import firing_rate_analysis as fra
import connection as cn
#%%
def detect_target_T(spk_mat_1, spk_mat_2, stim_posi, stimNum_reach_thre_min, trg_exist, \
e_lattice, an... |
445635999c128cf82f5ab387634f5d2e0de6a74bb3dfca2466613150d8a9b786 | Python | 28,073 | 761 | """========================
Transfac match pipeline
========================
The transfac match pipeline takes a several set of :term:`bed` or
:term:`gtf` formatted files and scans intervals for transcription
factor binding motifs.
It performs the following analyses:
* transfac match motif analysis
* If bed... |
c83d6b6290e24ee3733ff5ae0c3921d28975676dba392f854f3fd810af78c8be | Python | 28,189 | 743 | # Copyright (c) OpenMMLab. All rights reserved.
# This is extracted from mmcv library just for compatibility with mmcv config
# without import mmcv(to avoid lapse of my device setting function)
import ast
import copy
import os
import os.path as osp
import platform
import shutil
import sys
import tempfile
import uuid
im... |
f660fceef58ba5b86092f14d54db23e9fc23b7030becaf861b56c4a9e2392646 | Python | 28,194 | 570 | import torch.nn.functional as F
import torch
import torch.nn as nn
import math
from utils import grid
# ----------------------------------------------------------------------------------------------------------------------
# GFNO2d
# -------------------------------------------------------------------------------------... |
0f817d29877716d59b5d782e2877ac1ea46fa6a598dd60867eb2f672579bd3d5 | Python | 28,263 | 679 | # pypl2lib.py - Classes and functions for accessing functions
# in PL2FileReader.dll
#
# (c) 2016 Plexon, Inc., Dallas, Texas
# www.plexon.com
#
# This software is provided as-is, without any warranty.
# You are free to modify or share this file, provided that the above
# copyright notice is kept intact.
from ctypes i... |
2620f51387ce8e88ee5d02d68fb7f7ddbe9f815d8f2ebe94d0e4fbe69332ed9f | Python | 28,297 | 639 | import torch
from torch import nn
from torch.utils.data import Dataset, DataLoader
import numpy as np
import albumentations as A
from albumentations.pytorch.transforms import ToTensorV2
from skimage.io import imread, imsave
from CNN2D import CNN2D
from CNN3D import CNN3D
from PredictionMulti3DDataset import PredictionM... |
33eb6a6d960d6185151a5e204dcfe7a82306f45613241bd712f5c5ac40fb1c0e | Python | 28,320 | 673 | ''' This module provides a general implementation of a 3 layer tied weights Auto-encoder (x-h-y).
The code is focused on readability and clearness, while keeping the efficiency and flexibility high.
Several activation functions are available for visible and hidden units which can be mixed arbitrarily.
The c... |
ce4a1a22901f3ab838349f8ac2e4df804739a954cea8d5b4d7c27fe83f4ed76a | Python | 28,351 | 579 | """
Visualize each individual segment of unit metrics chopped from the entire sorted data
"""
# (1) read filt.mda for how many samples there are
# (2) for each defined segment, create new filt_seg.mda and firings_seg.mda and calculate template and metrics
# and save template and metrics to a file
import json
impo... |
6110759eee0b29c4251aeabc758e26b47198e80c517c4a185bb934f86c078e8b | Python | 28,356 | 556 | import mxnet as mx
import mxnet.ndarray as nd
import nowcasting.config as cfg
from nowcasting.ops import reset_regs
from nowcasting.operators.common import grid_generator
from nowcasting.operators import *
from nowcasting.ops import *
from nowcasting.prediction_base_factory import PredictionBaseFactory
from nowcasting.... |
66a66b133e25b942acf267581630beef1c40009acd0fe849b769c097fce61b99 | Python | 28,373 | 595 | #!/usr/bin/env python
# Command-line arguments
import argparse
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument("structures_file",
help="a list of protein structures to process")
arg_parser.add_argument("--residue_ids",
help="a list of residue identifiers that define a bin... |
0b1798e55fdaf773a832454985785db01b8a6d45130a915f341bb5926cb1f2de | Python | 28,430 | 694 | from copy import copy
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
def barplot(self, save=None, vector=True, dpi=300):
""" Barplot
Bar plot for proteins/genes identified and differentially regulated
according to each group
Args:
... |
fc7b9ec8956a7cf312ce796411623a3645c47ad2febc10c21c1d980601e9a737 | Python | 28,478 | 778 | import math
from typing import Tuple, Union, Callable
import inspect
import numpy as np
import torch
import torch.nn as nn
from sam.nn.common import get_act_fn, AF2_PositionalEmbedding, MLP
from sam.nn.noise_prediction.embedding import (TimestepEmbedder,
ConditionalInjecti... |
732d14bcd1900f66b50fbbf0661783645649b7b9c08b71cb4cc9bc5d41ade2fd | Python | 28,480 | 957 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
np.random.seed(100)
get_ipython().run_line_magic('matplotlib', 'inline')
# %config InlineBackend.figure_format = 'retina'
import matplotlib as mpl
mpl.rcParams['figure.facecolo... |
7c1e994964fe6d93986fa08f6b3d3d7314dac65521104267b6d0f8b3356f9e8f | Python | 28,509 | 699 | import matplotlib.pyplot as plt
import numpy as np
import joblib
import torch
from torch.utils.data import TensorDataset
from torch import nn
from net_utils import load_from_file
import plotting
import networks
from data import generate_recog_data, GenRecogClassifyData
import seaborn as sns
sns.set(font='Arial',
... |
4a679483c6cb8f5f0c8d3375265998362035768b9caacf3d6ac3b4cb9fc7044d | Python | 28,513 | 727 | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 8 17:56:06 2024
@author: Shencong Ni
"""
'''
Simulations for 2-input condition with/without cue
To run simulations for 1-input condition, set stim2 = False at line 97.
'''
import brian2.numpy_ as np
from scipy import sparse
from brian2.only import *
import time
im... |
b56be8c94db1b40a73e47012247439ab87cc761bc6e98f38ea8e3d98ccc23744 | Python | 28,541 | 491 | import os
import math
import glob
import pathlib
import librosa
import pandas as pd
import numpy as np
import matplotlib as mpl
from scipy import signal
from scipy import stats
from matplotlib import pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
def get_clusters_type(filename):
types_dict = {... |
279d9c1e3f4df78b0891b37753246a292ba8d24c23f01d8e6235ef26ead91b44 | Python | 28,560 | 725 | from collections import Counter, defaultdict
import os
from os.path import join as opj
from copy import deepcopy
from pandas import DataFrame, read_csv, Series
import numpy as np
from imageio import imread
from PIL import Image
import torch
import random
from glob import glob
from torchvision.transforms.functional impo... |
22e3529ccbcfd15ec7dbff194d77810317ded855fc0f8ab066e7519dbfb1b1bf | Python | 28,603 | 781 | from pymongo import MongoClient, IndexModel, ASCENDING
from configparser import ConfigParser
from copy import deepcopy
import logging
import time
from itertools import permutations
import os
from iteration_utilities import duplicates
logger = logging.getLogger(__name__)
unknown_hemi_lineage_names = [
'NA',
'N... |
93f158772df7820b88e4f76ac76e95739bc217152825afe3d86439e5db61c144 | Python | 28,674 | 557 | from PyQt5.QtWidgets import QWidget, QPushButton, QSizePolicy, QLabel, QGridLayout, QFileDialog, QGroupBox, QComboBox, QLineEdit, QCheckBox, QVBoxLayout, QHBoxLayout, QMessageBox
from PyQt5.QtCore import QDir
import napari
import numpy as np
from napari.layers import Points, Shapes
from scipy.spatial import KDTree
fro... |
cd5d3609d7c875d81a5ebc448903ab01719170c4ab5c9fb1ff077f62d43d511e | Python | 28,684 | 689 | 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.example_models import load_model
from pgmpy.factors.discrete import DiscreteFactor, TabularCPD
from pgmpy.inference import BeliefPropagation, VariableElimi... |
4aca366c88f1473532e7bc0db8573a82ae2323ea87b15b13fa87c1b91d00f667 | Python | 28,687 | 695 | #%% Import libraries and scripts
import pandas as pd
import numpy as np
import time
from sklearn import preprocessing
import matplotlib.pyplot as plt
from sklearn.pipeline import Pipeline
from sklearn.model_selection import cross_val_score
from sklearn.feature_selection import SelectPercentile, f_classif
from sklearn.... |
78541be693b3bd1f9c9377ce34d695a2dc7ca63f1c7069ed9ce5cf002ed7c2c8 | Python | 28,703 | 608 | """ Automatically discard noise clusters conservatively (by amplitude, spatial spread, ISI violation ratio) and viz"""
#%%
import json
import os
from time import time
from copy import deepcopy
import gc
from collections import OrderedDict
import multiprocessing
import shutil # rmtree
import numpy as np
# from scipy.io... |
d5a4dbb29006415c74464d90a04b955aed3f779b13030d36678b41ac93266834 | Python | 28,755 | 654 | """Tests for motornet.muscle — all muscle classes and the shared activation ODE."""
import pytest
import torch
from motornet.muscle import (
CompliantTendonHillMuscle,
MujocoHillMuscle,
ReluMuscle,
RigidTendonHillMuscle,
RigidTendonHillMuscleThelen,
)
from tests.conftest import make_geometry_state... |
6cf3ca78af52a698b0b366e4c23abfedf195362bfd15a780f4a1325a2341c91f | Python | 28,788 | 603 | """ Automatically discard noise clusters conservatively (by amplitude, spatial spread, ISI violation ratio) and viz"""
#%%
import json
import os
from time import time
from copy import deepcopy
import gc
from collections import OrderedDict
import multiprocessing
import shutil # rmtree
import numpy as np
# from scipy.io... |
a4798a57e58e3669260641c1333a156b91715ce517f8dc44cdf37e5fa155b1d5 | Python | 28,816 | 549 | import os
import pandas as pd
import numpy as np
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import accuracy_score, f1_score, confusion_matrix, precision_recall_fscore_support, \
classification_report
from scipy.stats import rankdata
import scanpy as sc
from sklearn.metrics import accuracy_s... |
76c8dbbd7bfdba3b83b194894f787ac9f5c7123e8868a19611d3d61e4cc21e14 | Python | 28,866 | 731 | import os
os.environ["CUDA_VISIBLE_DEVICES"]="3"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import CustomModuleArch, SumMultiplicationArch, HypernetFullyConnectedFlexiLayerSizeArch, FullyConnectedFlexiLayerSizeArch, InheritedFullyConnectedFlexiLayerSizeArch, SingleInputInheritedFullyConnectedF... |
0edc70876e665185b934ee58c6d441dc2a1e3c4d18cf7e784097ba49a0c380cc | Python | 28,879 | 598 | """cohort-level analysis: reading an accumulated cohort spreadsheet back in
(see api/results_bundle.py's _upsert_cohort_xlsx, the thing that writes
one), and computing a mean 3D shape across patients who share the same NICP
template topology.
mean_shape relies on registration.nicp.register_template's own guarantee
(se... |
08ae93eeffa1ab209b293fb98e868d52cc5588b774147f3e00d1d3db67123b0c | Python | 28,941 | 752 | 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... |
f8e0617ca0da4eb905842c8bf0ffb5f64f1737fe0a0afa88003a41ea38222d01 | Python | 28,975 | 461 | import argparse
import os.path
def main(args):
import json, time, os, sys, glob
import shutil
import warnings
import numpy as np
import torch
from torch import optim
from torch.utils.data import DataLoader
from torch.utils.data.dataset import random_split, Subset
import copy
im... |
aa4bba718d5961814312ccb7458d81e77b5b43945fc747756ca3a59df2d4ab72 | Python | 29,006 | 628 | import numpy as np
import os
import math
import sys
import torch
import torch.nn.functional as F
from torch.distributions.categorical import Categorical
import seq_des.util.pyrosetta_util as putil
import seq_des.util.sampler_util as sampler_util
import seq_des.util.canonicalize as canonicalize
import seq_des.util.dat... |
495f80f195f83c43c59e0eaf6918b6ffad7e257f5be21479855bb38162979874 | Python | 29,057 | 939 | import torch
AA_ALPHABET = "".join(
["A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "F", "P", "S", "T", "W", "Y", "V"]
)
RES_TYPES = [x for x in AA_ALPHABET]
AA_ALPHABET += "X-"
AA_INDEX_MAP = {aa: i for i, aa in enumerate(AA_ALPHABET)}
N_AMINO_ACID_KEYS = 22
BB_ATOMS = ["N", "CA", "C", "O"]
SC_A... |
ed82c2b38e37eb3377867297c7ca430c02d43f0f6826c4032822e3beee9a060e | Python | 29,057 | 984 | # 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... |
3a41fb1c38115bae737a1131e187177b46e665a48cc810117bf707058521bf0e | Python | 29,115 | 853 | """AI message."""
import itertools
import json
import logging
import operator
from collections.abc import Sequence
from typing import Any, Literal, cast, overload
from pydantic import Field, model_validator
from typing_extensions import NotRequired, Self, TypedDict, override
from langchain_core.messages import conte... |
1d5352b289d76eb051be185efdbbf35b9aa7f19629d3689fe01b7d1c647a600b | Python | 29,138 | 827 | #!/usr/bin/python
#############################################################################
#Package: stamp
#Updated By Yiqin Wang
#Usage:
#main
#call mtDNA variation from mapped reads
#
##############################################################################
import sys
import re
import copy
from collectio... |
083bf19f25848d0c37c2faf2511c55a3fe657cefda1a2579c2bada26c59c3aa4 | Python | 29,193 | 726 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 10 10:22:51 2023
@author: Shencong Ni
"""
'''
Simulations for 2-input condition with/without cue
To run simulations for 1-input condition, set stim2 = False at line 97.
'''
import brian2.numpy_ as np
from scipy import sparse
from brian2.only impo... |
546062f36f5adfca0c9b13976e3e45b7e190c841622e152b0a7b902051899afa | Python | 29,342 | 662 | # - Author: 'leo@opensignal.com'
# A pure-python implementation of the UpSet suite of visualisation methods by Lex, Gehlenborg et al., forked from ImSoErgodic/py-upset https://github.com/ImSoErgodic/py-upset
# Cloned from https://github.com/pedromiravaz/py-upset
# --- Edited: line 609
# order = np.argsort(-inters_degr... |
3f02a2fa9096f22580757996f8218e1cd0d3dd5fed32eab1cbc5529572e7ad90 | Python | 29,348 | 662 | # - Author: 'leo@opensignal.com'
# A pure-python implementation of the UpSet suite of visualisation methods by Lex, Gehlenborg et al., forked from ImSoErgodic/py-upset https://github.com/ImSoErgodic/py-upset
# Cloned from https://github.com/pedromiravaz/py-upset
# --- Edited: line 609
# order = np.argsort(-inters_degr... |
745c41296cc42edb91c2e43291b452597f9124bbf0c3ff104909f8fcfd3e7a90 | Python | 29,349 | 610 |
import tkinter as tk
import cv2
from PIL import Image
from PIL import ImageTk
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.dates as mdates
from datetime import datetime,timedelta
import numpy as np
import os
from pytz import utc
# Window to print debugging messages to
class DebugWindow(... |
e820c270925dcfba5340c8b077e108344b30403bd83c89aa89391c7a55bab523 | Python | 29,352 | 644 | # this file contains the two fundamental class types (Trial and Experiment) needed to construct an experiment in imagingplus
from __future__ import absolute_import
from dataclasses import dataclass
from typing import Optional, MutableMapping, Union, Dict
import os
import time
import re
import pickle
import numpy as np... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.