sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
936d9601b470248414764f9d6af7e4a340a737d7ab25b7e801af632ba6da38fc
Python
53,853
1,413
import os import json import pickle import shutil import re from collections import namedtuple import glob from typing import Callable, Union import numpy as np import mdtraj import torch from sam.coords import sample_data from sam.data.sequences import aa_list, aa_one_letter # from sam.data.common import (# get_pro...
18516bdd6bbb36e14a9546770db815fc01a619479254bac2ee95b1f6a9d38519
Python
53,861
1,053
# -*- coding: utf-8 -*- ModulePy = str('NMF_demixing__ProofOfPrinciple_v23_20240617.py') ''' Description: NMF analysis demixing spatio-temporal ensemble signals from Fiber Photometry ensemble video data (proof-of-principle analysis). - Input files: (i) raw_ensemble_video_data.mat [videodat...
146b6687ca7691018fce958a30c3d739a06a0b5a5cb20555ff939e7ad8850771
Python
54,207
1,294
#!/usr/bin/env python3 # pylint: disable=line-too-long import math import os import re import logging import multiprocessing as mp from itertools import product, combinations, chain from scipy import stats from scipy.cluster.hierarchy import linkage, cophenet from scipy.spatial.distance import pdist import numpy as np ...
d05dba83623cbfc1b56e169629122f4beb3996dbacedb7517b9e531452c9db6e
Python
54,250
1,342
# 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 ...
4c9c797d2b15629edf9db64ed77670de720f29b2032280380bf921d0b4dd6ed5
Python
54,336
1,108
import simtk.openmm as openmm import os import copy import openmmtools.mcmc as mcmc import openmmtools.integrators as integrators import openmmtools.states as states from openmmtools.states import ThermodynamicState import numpy as np import mdtraj as md import mdtraj.utils as mdtrajutils import simtk.unit as unit imp...
8a52038ceac21076c5a62a4dd4e8131748b5200e0ae2a18bfc4a8daa5d87d16f
Python
54,461
1,618
import os import sys import re import types import itertools import matplotlib.pyplot as plt import numpy import scipy.stats import numpy.ma from ChipseqReport import * from cgatReport.Tracker import * # for trackers_derived_sets and trackers_master if not os.path.exists("conf.py"): raise IOError("could not find...
1eef1ce5e41d6f61b3774b0a9370aac7e3030aa58956730dbdbcfbb6b393ba09
Python
54,708
1,663
# -*- coding: utf-8 -*- """ Created on Tue Nov 3 13:14:05 2020 @author: Xingyan Liu ==================================================== Functions for downstream biological analysis """ import os from pathlib import Path from typing import Sequence, Union, Mapping, Optional, Callable import logging import numpy a...
32151701f4d85dba445a9ec15fd639ec76bd6a29e4d2d36c9fb8ac7bfadb82df
Python
55,466
1,538
# 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...
c59ddf4ebe0257b127e2f0aa98eb99180b1924579dedc09db3a043960a56698a
Python
55,691
1,191
import os import time from pathlib import Path from typing import Dict, Any, Optional, List, Union, Tuple import numpy as np import pandas as pd import suite2p # todo add type hinting controls for expobj import matplotlib.pyplot as plt from imagingplus.main.subcore import CellAnnotations, ImagingData from suite2p impo...
491d44ce9dd6151e6b24de2143e3e005df8ea9bc52654bbc997c172236df1fe6
Python
55,821
1,137
""" ============================================================== Plot figures - updated version post-rebuttal =============================================================== """ # Authors: Marie-Constance Corsi <marie-constance.corsi@inria.fr> # # License: BSD (3-clause) import pandas as pd import ptitprince as p...
08a9d4bf0d8fd377305d6ba46c7ee02f80f1bda9bcec953dd49608c783e69074
Python
55,860
1,681
"""=========================== Pipeline transcriptdiffexpression =========================== To do: update documentation and pipeline.ini. e.g supports sailfish too! Overview ======== RNA-Seq differential expression analysis can, broadly speaking, be performed at two levels. Gene-level and transcript-level. As trans...
be6854aa4476dc57767e9a81e516fa5adfbc90b3e2bf88a5f59f644084fc001d
Python
55,911
1,616
# 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...
821e6973d9c322b8ee0851a03fe0a99c0030f4b8343195c40015caef1a6bd4b5
Python
55,965
1,264
import numpy as np import torch import scipy import matplotlib.pyplot as plt from scipy.stats import rv_discrete def set_task_defaults(task_params, task='sequential'): """ Sets defaults for stimulus change task """ if 'noise_type' not in task_params: task_params['noise_type'] = None if 'noise_scale' not in tas...
df49489b38313719e32f45545d4286b6011e77cb71df1f5ecb2529e9cbbe6d4d
Python
56,048
1,299
import torch # import torch.nn as nn # from torch.nn import functional as F import numpy as np import datetime from scipy.stats import pearsonr import matplotlib.pyplot as plt ''' def model_train(model,data,optimizer,device,EPOCH,loss_func,alpha=None,beta=None,vbeta=1): """ function for training...
cbd93e7bf32257f055692e84d3cbab3d09a80714651ca1642d6c1cab30b047f8
Python
56,454
1,476
#!/usr/bin/env python3 import os import unittest import networkx as nx import numpy as np import pandas as pd from skbase.utils.dependencies import _check_soft_dependencies import pgmpy.tests.help_functions as hf from pgmpy.base import ADMG, DAG from pgmpy.ci_tests import Pearsonr from pgmpy.example_models import lo...
215a010b95bf0754d156b13240ea4d114124834c2186a720a30797cb45999cd1
Python
56,488
1,565
"""Base interface for traditional large language models (LLMs) to expose. These are traditionally older models (newer models generally are chat models). """ from __future__ import annotations import asyncio import builtins import functools import json import logging from abc import ABC, abstractmethod from collectio...
2271cefcea253e1ce650e321d0a7837f88fa85520caface6b3ae26993926942c
Python
56,799
1,288
import os import re import io import sys import math import urllib import tempfile import collections import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.path as mpath import matplotlib.patches as mpatches from Bio import SeqIO import Bio matplotlib.rcParams["figure.max_open_war...
fbe69ba0bce0b3bb700638d9a4fb918f201ca285eb277589651169066aaa425e
Python
57,414
1,315
# New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt, # and (in the case of viridis) Eric Firing. # # This file and the colormaps in it are released under the CC0 license / # public domain dedication. We would appreciate credit if you use or # redistribute these colormaps, but do not impose any legal r...
4b5cbae1d0fdf96559a261cef9fdb8f4662d3f83929692d10874fd6f57a01091
Python
57,544
1,548
"""A de novo peptide sequencing model.""" import collections import heapq import itertools import logging import warnings from typing import Any, Dict, Generator, Iterable, List, Optional, Tuple, Union import einops import lightning.pytorch as pl import numpy as np import torch import tqdm from depthcharge.tokenizers...
0c8bc86388d73b29ee93da2f41be0164ee32dfea837755af6c25c0a43433f419
Python
57,770
1,411
#################################################################################### # # 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...
ce6712a27184de523972199e063e9f9e868cd89a508dd55303760d33370d4202
Python
57,776
1,040
## ## Summary Visualizations of Gene Ontology Enrichment with GO-Figure! ## ## Authors: Maarten JMF Reijnders and Robert M Waterhouse ## ## Contact: maarten.reijnders@unil.ch or robert.waterhouse@unil.ch ## import matplotlib matplotlib.use('Agg') import sys import logging from datetime import date from collections imp...
9f83de626a32759cc5388b50e8e6fea738265bfe7ff7ab80728f0abd43dbf2ca
Python
57,962
1,545
""" =================== CAPseq pipeline =================== :Author: David Sims :Release: $Id: pipeline_capseq.py 2900 2011-05-24 14:38:00Z david $ :Date: |today| :Tags: Python The CAPseq pipeline imports reads from one or more CAPseq experiments and performs the following tasks: * Align reads to the genome usin...
8f1431ee3afa23cbe1808978c11391a120555210af9ed478489e8edda28eb32c
Python
58,031
1,460
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...
4e42ea01a481eb1217e71694a54a77bbb33b12eb171ec5a1205cf86e03e17587
Python
58,642
1,541
# Copyright Generate Biomedicines, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
ae9ebbfd13fd106674884065b3d2ff3dddd4b7390bd3a26ca517bc8b7c1f96ea
Python
59,379
1,238
import matplotlib from bernn.utils.pool_metrics import log_pool_metrics matplotlib.use('Agg') CUDA_VISIBLE_DEVICES = "" import uuid import shutil import matplotlib.pyplot as plt import pandas as pd import numpy as np import random import json import copy import torch from itertools import cycle from torch import nn...
493f9f1624ba8e07e35f7acaf3aec9c2a443e6d0af7ddd37fcbccde46d976371
Python
59,423
1,534
from typing import Set, Dict, List import lark from .combinators import * from .derivation import * from .categories import * from .visualization import escape_latex_text def bwrap(s): return "(" + s + ")" def bwrap_tex(s): return "\\left(" + s + "\\right)" def is_simple(t): return isinstance(t, (Skol...
830e06cab22c3d9e91274ea9cc6aabc846f4db9e1a42867c413cea9b9d763bed
Python
59,478
1,288
import numpy as np import pandas as pd from bed_reader import open_bed from sklearn.preprocessing import StandardScaler import multiprocessing as mp from multiprocessing import Process, Manager from tqdm import tqdm from functools import partial import scipy.stats as stats from scipy.stats import norm import matplotli...
f921c2943f121b877d0d6ab07f191096018dc65f6a6cfaa27f6243d6ca071783
Python
59,686
1,924
#!/usr/bin/env python # coding: utf-8 ### Model with simplified training procedure ### # # Neural network # # In this notebook we set up the neural networks with VAMPNet scoring functions and train them for different output sizes and estimate errors by bootstrap aggregation. This notebook can be used with `papermill...
0c3671135d4ff42ae7a5c177aa430ade66482d42407fc603dfb941dd2a339957
Python
59,846
1,381
import math, itertools import torch from torch import nn from torch.utils.data import TensorDataset import torch.nn.functional as F import numpy as np import scipy.special as sps from plotting import plot_W, plot_B from net_utils import StatefulBase, Synapse, check_dims, random_weight_init, \ ...
5258655b84413b9a6029aae92adf87a3313c1ca694a68d1d7ef6a91a25099a4a
Python
59,897
1,380
import numpy as numx from scipy.signal import convolve2d import pydeep.base.numpyextension as numxExt from pydeep.base.activationfunction import Sigmoid class Weight_layer(object): ''' This class implements a weight layer that connects one unit layer to another. ''' @classmethod def ge...
c4dd4dffedfaf603401881b1c83da612ab437ac6a94d424ba3be706c39b15fe2
Python
60,197
1,439
#################################################################################### # # 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...
822dfa2a2ba12749a4c561f8a8fc781c32cb39d54e4bc9e13a92162183bed648
Python
60,290
1,184
import yaml import numpy as np import pickle import os import sys import simtk.unit as unit import logging import warnings from pathlib import Path from perses.annihilation.relative import HybridTopologyFactory, RESTCapableHybridTopologyFactory from perses.app.relative_setup import RelativeFEPSetup from perses.annihil...
bc56d65434f4b0429d6c35b17e8936236157ff83500a17d7b2be258229fd0444
Python
60,317
1,346
@Created by Bioelectronics Lab (2021-2022) class Recording: """Class for pre-processing and extracting spikes and HR from electroneurograms (ENG)""" def __init__(self, neural, fs, length, map_array, filename, column_ch): """Constructor of neurogram object. Takes parameters from classmethod open_record, an...
a6fb407592e86912aa4ce424d180ad23702984b5af7e17cd3bf33839e358c0e9
Python
60,442
1,430
""" Parameter assignment tools for the SMIRNOFF (SMIRKS Native Open Force Field) format. .. codeauthor:: John D. Chodera <john.chodera@choderalab.org> .. codeauthor:: David L. Mobley <dmobley@mobleylab.org> .. codeauthor:: Peter K. Eastman <peastman@stanford.edu> .. todo :: * Speed up overall import time by putti...
480dd32e744989acf31ef35bddc91ceb8aa3a5874c88e92c86ad83b8765a1bd6
Python
60,460
1,389
""" Module for OmicScope Object Visualization This module allows the user to extract and visualize information from OmicScope object. Here, it is possible to evaluate data normalization (MA-Plot, Volcano Plot, Dynamic range plot), individual protein abundance (barplot, boxplot), search for protein-protein interactions...
375941f99de9ff97b4d84e8ba6e8eec270fd59bff02c561f06bfc6af8e9990f3
Python
60,677
1,247
#!/usr/bin/python3 import matplotlib from bernn.utils.pool_metrics import log_pool_metrics matplotlib.use('Agg') CUDA_VISIBLE_DEVICES = "" import uuid import shutil import matplotlib.pyplot as plt import pandas as pd import numpy as np import random import json import copy import torch from torch import nn import o...
48ad7d7af9b8c58b97d162ec753f3529b97dfa1a8b39a58f2e859517086464e4
Python
60,722
1,457
#################################################################################### # # 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...
13e262d17ce21e6698c0875b5b6c90c8688f247de77993023811c440dfebeab3
Python
60,938
1,033
import numpy as np import pandas as pd from bernn.utils.utils import get_unique_labels from sklearn.model_selection import StratifiedGroupKFold, StratifiedKFold from dataset import MSCSV, MS2CSV, MSImages import multiprocessing import random def get_alzheimer(path, args, seed=42): """ Args: path: Path ...
6ed9d2b23a542c48ac36086af0862548c5568c1cd574b4ca05185a3b162dfdfd
Python
61,036
1,701
from abc import ABC, abstractmethod from functools import reduce from operator import mul from typing import Iterable, Optional, Union import torch class Nodes(torch.nn.Module): # language=rst """ Abstract base class for groups of neurons. """ def __init__( self, n: Optional[int]...
bb28689be1f00db10a55465cd4ecd6cf6fd244e979312bef29cfc733bc2571e3
Python
61,148
1,598
# Copyright Generate Biomedicines, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
fb5fa7085012a1304ae952b67dca5d552d6d42944dcd50ca1e4714ed0c0378bd
Python
61,291
1,705
"""Tests for `stream_events(version="v3")` (sync + async) and `ChatModelStream`.""" from __future__ import annotations import asyncio import contextlib import json from types import SimpleNamespace from typing import TYPE_CHECKING, Any import pytest from langchain_protocol.protocol import ( ContentBlockDeltaData...
bd6d6d2addbce04cb859210bab429c82bdbe0fb83aa6d985af026b6eb65d6eef
Python
61,558
1,795
"""Tests for the compat bridge (chunk-to-event conversion).""" from collections.abc import AsyncIterator from typing import TYPE_CHECKING, Any, cast import pytest from langchain_tests.utils.stream_lifecycle import assert_valid_event_stream from langchain_core.language_models._compat_bridge import ( CompatBlock, ...
436f4bdadb901388ce3f90403c0edbd9fed55e5ab4996d0676c353659229f39e
Python
61,661
1,764
"""Utilities for running language models or Chains over datasets.""" from __future__ import annotations import concurrent.futures import dataclasses import functools import inspect import logging import re import unicodedata import uuid from collections.abc import Callable from datetime import datetime, timezone from...
198573594621da93addea8f5f11a0d5b398dd5461026c9d19b596fd2f78424b9
Python
62,104
1,216
import yaml import numpy as np import pickle import os import sys import simtk.unit as unit import logging import warnings from cloudpathlib import AnyPath from pathlib import Path from perses.annihilation.relative import HybridTopologyFactory, RESTCapableHybridTopologyFactory from perses.app.relative_setup import Rel...
be0194320532c713852fa425b8b75c4d6101a473a25549356a471541c50eda97
Python
62,109
1,652
#!/usr/bin/env python import io import xml.etree.ElementTree as etree import pytest from skbase.utils.dependencies import _check_soft_dependencies from pgmpy import config from pgmpy.readwrite import PomdpXReader, PomdpXWriter @pytest.fixture(params=["numpy", "torch"]) def backend(request): if request.param ==...
d4e174622cf22ca58186a50c6f836f6160099f232e58a15caf046fb97dec4d4a
Python
62,133
1,792
"""Chain that takes in an input and produces an action and action input.""" from __future__ import annotations import asyncio import builtins import contextlib import json import logging import time from abc import abstractmethod from collections.abc import AsyncIterator, Callable, Iterator, Sequence from pathlib imp...
ed1240c42208a30b3e4105c45d9f7b41d8f26de034ef667e721eff48e5ca9b1a
Python
62,329
1,315
""" SegClassif dock widget module """ import functools import os import pickle import random from typing import Any import cv2 import matplotlib.pyplot as plt from napari_plugin_engine import napari_hook_implementation from napari.utils.notifications import show_info, notification_manager import time import numpy as ...
5d570e2c7a701f5625d8b1a2571a32bb1d166b0dc2d645af8b21dca85056de4b
Python
62,780
1,883
# 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...
b0db95c47de85c2126567f62b95d54da380d1869ce82acacd23aa9ef9233296a
Python
62,802
1,363
from __future__ import print_function import json, time, os, sys, glob import shutil 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 import torch.nn as nn import torch.nn.functional as F import random ...
64f795fc00d560cd85ef8bbe05412c35439654aa5fd86e4ccdaaab155ad46e21
Python
63,016
1,070
from perses.dispersed.utils import * from openmmtools.states import ThermodynamicState, CompoundThermodynamicState, SamplerState import numpy as np import mdtraj as md import simtk.unit as unit import logging import time from collections import namedtuple from perses.annihilation.lambda_protocol import LambdaProtocol ...
3543496ce3a40cb056f4295e7834655f019ed37153ac9af46313ea9a8f71d085
Python
63,027
1,069
from perses.dispersed.utils import * from openmmtools.states import ThermodynamicState, CompoundThermodynamicState, SamplerState import numpy as np import mdtraj as md import simtk.unit as unit import logging import time from collections import namedtuple from perses.annihilation.lambda_protocol import LambdaProtocol ...
1835d9682fbb86b7f3d018d1337c48559b7f240acb1f583ebc7234fcc2d02b1d
Python
63,070
1,756
"""========================================================= pipeline_peakcalling - Produce Peaklist from Bam Files ========================================================= Overview ======== The aim of this pipeline is to create peaklists in :term:`bed` files from aligned reads in :term:`bam` files that can then be ...
11ad86020f729a268ce1b1a351414210c86b8f65253f47ecad088bc884ffb9f8
Python
63,423
1,454
from scipy.signal import convolve2d import model as MODEL import pydeep.preprocessing as PRE #from unit_layers import * class Weight_layer(object): ''' This class implements a weight layer that connects one unit layer to another. ''' @classmethod def generate_2D_connection_matrix(cls...
74c8f9b7553422a7a0bbd705874844ee103c8926c2c96f154a87e0b824071e1b
Python
63,491
1,383
from __future__ import print_function import json, time, os, sys, glob import shutil 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 import torch.nn as nn import torch.nn.functional as F import random ...
2ec1b2811a6005c928b57ddf286173cf32b7c305a62d2fe7fa5443b4f112e5f7
Python
64,710
1,590
"""Per-message streaming objects for content-block protocol events. `ChatModelStream` is the synchronous variant returned by `BaseChatModel.stream_events(version="v3")`. `AsyncChatModelStream` is the asynchronous variant returned by `BaseChatModel.astream_events(version="v3")`. Both expose typed projection propertie...
faf42a68aeea7f73595022f39f7720a7270a45564ccdf579f52886f331e8c21b
Python
65,631
1,359
"""upload / templates / analyze / status / results / export / bundle endpoints. just a thin wrapper around craniumpy_core.pipeline - no actual algorithm code should live in here, just request/response stuff and the async job plumbing (see api/sessions.py). """ from __future__ import annotations import io from pathli...
f6bdd9ea26461ed2379210b3f7b9bb7419d1b38f7878f51bc4b71974779f856a
Python
65,779
1,900
"""===================== Peak calling pipeline ===================== :Author: Andreas Heger :Release: $Id$ :Date: |today| :Tags: Python The peak calling pipeline applies various peak calling algorithms on mapped reads. Overview ======== pipeline_peakcalling takes as input reads aligned to genomic sequence as :term:...
7dd90d6473a5e1aec0aeb50dbf5da220cf54585da4704b52152cf8d4f3b6d65d
Python
66,128
1,338
# network structure import math from itertools import cycle import numpy as np import ot import scanpy as sc import scipy import scipy.sparse as sp import torch import torch.nn.functional as F from easydl import AccuracyCounter, clear_output, one_hot, variable_to_numpy from scipy.stats import f, norm, ttest_ind from t...
f9074144551b36615aaa18cd61e911d4d1b732bd7c77a08fe3bbfeb062f22aff
Python
66,236
1,687
#!/usr/bin/env python3 from __future__ import annotations import itertools from collections import defaultdict from collections.abc import Hashable, Iterable from functools import reduce from operator import mul from typing import ( Any, ) import networkx as nx import numpy as np import pandas as pd from joblib i...
b1a5db6005abfd6090bacf80869e5776ba1415489d2b33216f7aeb2f13a400f3
Python
66,266
1,747
""" Utilities for testing. """ import collections import copy import functools import importlib import itertools import os import pathlib import pprint import textwrap from contextlib import contextmanager import numpy as np import openmm import pytest from openff.units.openmm import to_openmm from openmm import uni...
f78e3179497e3dc29483decb15bdc99462c31a9c334bce1217b22a1344d7b9c3
Python
66,413
1,487
import ast import datetime as dt import inspect import logging import os import shutil import time import warnings from functools import partial from pathlib import Path from typing import Union import click import humanize import numpy as np import yaml from colorama import Fore, init as init_colorama from prettytabl...
177fd3a15b8821fd949014ac7087ae73f5a11cf96c305e4767f6e1681639f513
Python
66,452
1,446
import warnings from typing import Sequence import numpy as np import torch from torch import nn from torch.nn import Parameter from torch.nn import functional as F from .base import ConfigurationError, Readout class Gaussian2d(Readout): """ Instantiates an object that can used to learn a point in the core ...
da4cde58dd539d3d846130b04a045327492e105fa8d8d4e2101ca840d1e64221
Python
66,558
2,267
"""===================== Read mapping pipeline ===================== The read mapping pipeline imports unmapped reads from one or more NGS experiments and maps reads against a reference genome. This pipeline works on a single genome. Overview ======== The pipeline implements various mappers. It can be used for * ...
505c62a684359b1f2a36f03e3c67c0a7161faf643993f45955c7c089ecab34fd
Python
66,687
1,406
""" Svetlana dock widget module """ import functools import os import pickle import random from typing import Any import cv2 import dask.dataframe import matplotlib.pyplot as plt from napari_plugin_engine import napari_hook_implementation from napari.utils.notifications import show_info, notification_manager import t...
7bad7fb40f33208882945a703d5d3349ead443ee29343a6f75a58951120ab3fc
Python
66,907
1,571
import pycircstat import numpy as np import pandas as pd import matplotlib.pyplot as plt import efel from scipy.signal import hilbert from matplotlib.backends.backend_pdf import PdfPages import seaborn as sn from scipy.stats import pearsonr from copy import copy from matplotlib.patches import Rectangle #PV...
4185c5de5cc4abf8c4bb43ef4d19dbbc0e59f9871cadf033ca04c8836d7ac44f
Python
66,908
1,316
#!/usr/bin/python3 # Allow direct execution from the repository root, e.g. # ``python bernn/dl/train/train_ae_classifier_holdout.py``. import sys from pathlib import Path _repo_root = Path(__file__).resolve().parents[3] if str(_repo_root) not in sys.path: sys.path.insert(0, str(_repo_root)) import os import matpl...
b83e2d1f53450f6f825b972fda24b4d5d2014a5d32b805a6842a255d82b9a769
Python
67,138
1,801
from abc import ABC, abstractmethod from typing import Optional, Sequence, Tuple, Union import numpy as np import torch import torch.nn.functional as F from bindsnet.utils import im2col_indices from torch.nn import Module, Parameter from torch.nn.modules.utils import _pair, _triple from bindsnet.network.nodes import ...
f031fae592aec4e17e56daf0e92cbbede9010461bc7460dcbf4e776f73e01798
Python
67,167
1,938
"""Test base chat model.""" import uuid import warnings from collections.abc import AsyncIterator, Iterator from contextlib import contextmanager from importlib.metadata import PackageNotFoundError from typing import TYPE_CHECKING, Any, Literal, get_type_hints from unittest.mock import patch import pytest from langsm...
9fcbe6010ac709a173fd2d612ca3617be6b7676395f74a477f200e3415575fcf
Python
67,339
1,871
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import json from pathlib import Path from statistics import mean import dash import dash_bio.utils.ngl_parser as ngl_parser import dash_bootstrap_components as dbc import numpy import numpy as np import plotly.graph_objects as go from dash import Input, Output, State, ht...
0e7e7cce96a6fe3e4f12b14adcd7ba90c0520c51c7392bf29c7440893866de6b
Python
67,464
1,421
"""Main training entry point for pre-training and downstream fine-tuning. """ import json import os import random import time import math from functools import wraps from typing import Callable, List, Sequence import fsspec import hydra import pytorch_lightning as pl import torch import torch.nn.functional as F impo...
411545fd4a2f8fd1db29899c4f404fb05eb1b2d74ade20c029492e990eb3bec5
Python
67,556
1,698
#################################################################################### # # 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...
2ceff28fbb3a57f14ac22aac8eb5c0b4a07f9f09ec12ad470a9356c7d126407f
Python
67,564
1,407
import json import logging import os import platform import random import shutil import time import traceback import warnings from distutils.version import LooseVersion from pathlib import Path from typing import Literal, Sequence, Tuple, Union import dask.array as da import numpy as np import scipy import scipy.ndima...
aa4c6d59adea1e7a0234e977c4ea2be3d03e862b46e5a18416f4ea36ce59373a
Python
67,572
1,698
#################################################################################### # # 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...
85fe2accb1d18b13981cda9ec0fb56375d6d58ec6669d03cf7682e74bfe4b091
Python
68,178
1,215
########################################### # IMPORTS ########################################### from simtk.openmm import app from simtk import unit, openmm import numpy as np import os import random from nose.tools import nottest from pkg_resources import resource_filename from perses.annihilation.relative import H...
3afc6b22ebbbb1b8b081c0f3b7aded68ebdf94fb58752f4614fdd61d81896f57
Python
68,378
1,844
import glob import inspect import logging import pickle import platform import random import shutil import tempfile import time import types from functools import lru_cache from pathlib import Path from typing import List, Literal, Tuple, Union import awkward as ak import dask.array as da import h5py import numpy as n...
40512bca609e99d8d6978b3a700869c4457ba24b65c1b7b36f920294b6ab7caf
Python
68,475
1,819
# Version: 0.18 """The Versioneer - like a rocketeer, but for versions. The Versioneer ============== * like a rocketeer, but for versions! * https://github.com/warner/python-versioneer * Brian Warner * License: Public Domain * Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, and pypy * [![Latest Version] ...
56a1a49cd22fbcec1a59bd5bd2866823714a2e02dcd31b32d361588d1374a788
Python
68,801
1,790
# 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...
7f3ef7f73f5b822148ed14ba861079c0cffb24986449afc8dff12c4e515d5d67
Python
69,327
2,164
"""Module that contains tests for runnable.astream_events API.""" import asyncio import sys from collections.abc import AsyncIterator, Mapping, Sequence from itertools import cycle from typing import Any, cast import pytest from pydantic import BaseModel from typing_extensions import override from langchain_core.cal...
18f0dcdf2884b58fa832e5570473bd159fd8cede6ac76b60d939413354cb53d6
Python
69,724
1,189
import numpy as np import pandas as pd from bernn.utils.utils import get_unique_labels from sklearn.model_selection import StratifiedGroupKFold, StratifiedKFold from bernn.dl.models.pytorch.utils.dataset import MSCSV, MS2CSV def get_alzheimer(path, args, seed=42): """ Args: path: Path where data is loc...
75899351026d0035fb8e8a0ad13559224caefc855145342ae3e7db4d47d375ce
Python
70,144
1,855
# Version: 0.19 """The Versioneer - like a rocketeer, but for versions. The Versioneer ============== * like a rocketeer, but for versions! * https://github.com/python-versioneer/python-versioneer * Brian Warner * License: Public Domain * Compatible with: Python 3.6, 3.7, 3.8, 3.9 and pypy3 * [![Latest Version][pyp...
8918b8a6d09c117932fac8f3188dbdf06892f95c7e45badaf45fc63337af7792
Python
70,989
1,649
import numpy as np import torch from scipy import stats import matplotlib.pyplot as plt import os import pickle from networks import SstVipNetworkFull from exc_vip_sst_net import SstVipExcNetwork from exc_vip_sst_net import SstVipExcNetworkComplete from exc_vip_sst_net import SstVipExcPvNetwork from stim_change_task...
6b45bbb1d6e4e5c8322a4740fc2743cda4c490cbd813c1e4ccbc0551598506e4
Python
71,132
1,256
########################################### # IMPORTS ########################################### from simtk.openmm import app from simtk import unit, openmm import numpy as np import os import random from nose.tools import nottest from pkg_resources import resource_filename from perses.annihilation.relative import H...
c42d56eebd66f3bda6abf3e9ae29ebc5ffaa1527518804dae6def376aa225825
Python
71,143
1,629
"""Wrapper classes for Cif input and output from Structures.""" from __future__ import annotations import math import os import re import textwrap import warnings from collections import defaultdict, deque from datetime import datetime from functools import partial from inspect import getfullargspec as getargspec fro...
8a791872f4ea07f64cb79a2331eed97969f3df93a8e8dae1eaa483b4ed5acd09
Python
71,579
1,693
#################################################################################### # # 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...
4ebcc461bc0013bb2a4f22f0dbaaf90a9d5b2551304868258788861350135f99
Python
71,604
1,487
""" Tools for computing atom mappings for relative free energy transformations. These tools currently require the OpenEye Toolkit, but will eventually be fully migrated to the OpenFF toolkit. .. todo :: This module should be migrated to openmmtools. """ from simtk import unit import copy import os import numpy as ...
a2f7b4f18aaa3f6db1399f224f6303691cb46ac3b9ba36bf1aa87704a504edd1
Python
71,669
1,948
"""Base classes and utilities for LangChain tools.""" from __future__ import annotations import functools import inspect import json import logging import typing import warnings from abc import ABC, abstractmethod from collections.abc import Callable, Mapping, Sequence from typing import ( TYPE_CHECKING, Anno...
14ae8727a15a96fd629e1cb589cea221c17ea3d3f0dadaecf18450a1b3e58858
Python
71,903
1,850
from collections import deque from collections.abc import Hashable, Iterable from itertools import combinations from typing import Any import networkx as nx import pandas as pd from pgmpy.base._algorithms import _GraphAlgorithms from pgmpy.base._mixin_roles import _GraphRolesMixin from pgmpy.base._plotting import _Gr...
52c05d1c846d6e34a5f44f5c831892b0e2db05fa49fd1f33b48811de146a5b6c
Python
72,071
1,264
import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib.lines import Line2D from matplotlib.patches import Patch from Articles.Sequential_Learning_Striatum.Figures.cfg_color import colors from Articles.Sequential_Learning_Striatum.Figures.FigureSequential \ import...
aeded5b19a93dfc568fa609cd225fa3e4e02ea308001a9b7fe5314131f2540a8
Python
72,204
1,457
""" Unit tests for NCMC switching engine. """ __author__ = 'John D. Chodera' ################################################################################ # IMPORTS ################################################################################ import copy from simtk import openmm, unit from simtk.openmm import ...
038bc9429296a777865ba91608abccb548c6b1a5b5e5643ddea2df440f08e7d0
Python
72,270
2,014
#!/usr/bin/python ############################################################################# #Package: stamp #Updated by Yiqin Wang #Usage: # # ############################################################################## #the path to the executables samtools = "samtools-1.6" bwa ="bwa-0.7.17" bamleftalign="bamle...
d9d9452efc1bd954d2cf145e443c2224e6b4e1e11d1758ae0608df87d83ca225
Python
72,673
1,475
# os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # CUDA_VISIBLE_DEVICES = "" import os from tensorboard.plugins.hparams import api as hp import tensorflow as tf from sklearn.metrics import silhouette_score, adjusted_rand_score, adjusted_mutual_info_score from bernn.dl.models.pytorch.utils.metrics import rKBET, rLISI import...
aa6292ead6e5deceaba2bdbe830d362ef071dda12365894d73e9f330d29b68b9
Python
73,020
1,815
""" A modified version of the original Scholar implementation by Dallas Card to support survival analysis supervision (Cox and several parametric AFT losses) and where we encourage sparsity via l1 regularization; note that currently the only topic model supported here is SAGE The original Scholar code that this file i...
91a86b63e2daec99498c5ec2b5be98ee1cd31df90d3abfe2ac36a6339d0aa981
Python
73,286
1,668
"""Wrapper classes for Cif input and output from Structures.""" from __future__ import annotations import math import os import re import textwrap import warnings from collections import defaultdict, deque from datetime import datetime from functools import partial from inspect import getfullargspec as getargspec fro...
6ff4975a882a5ae456f5843682b38dd846301f69a601775966c2d03fff429823
Python
73,646
1,942
# Copyright Generate Biomedicines, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
bf3d2eb1b27a71050e03433f53903d6ae326d836b29c1ced9aaeea0e07b65dc9
Python
73,695
1,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...
30dc271dcd02f7cef012f0935651a941c76eb6a4736824047aaa3dd7c2dcf854
Python
73,932
2,006
import re import warnings from pathlib import Path from typing import Any import pytest from packaging import version from pydantic import ValidationError from syrupy.assertion import SnapshotAssertion from langchain_core.load import dumpd, load from langchain_core.messages import ( AIMessage, BaseMessage, ...
b73f40d2131a7d72b1ed2b1926b0de0ea130fddefbe78af5f6c9853eb3216afb
Python
74,492
1,878
import warnings from collections import OrderedDict import numpy as np import torch from torch import nn as nn from torch.nn import ModuleDict, Parameter from torch.nn import functional as F from ..constraints import positive class ConfigurationError(Exception): pass # ------------------ Base Classes --------...
2ff3a2c9a4769984c3dd2072f922f75e9edfacb0737e374e2554ee72ae9ae0e6
Python
74,538
1,656
import inspect import logging import pickle import tempfile import traceback from collections import defaultdict from pathlib import Path from typing import Literal, Tuple, Union import fastcluster import hdbscan import networkx as nx import numpy as np import pandas as pd import seaborn as sns from dask import array ...
b75d37a69a1e05b0edb67c17e3e200da0ba8eec963be4c257ba063c8dd5e342c
Python
74,827
1,583
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri May 28 2021 @author: Simon Pelletier """ import os import csv from PIL import Image import torch import itertools import numpy as np from torch.utils.data import Dataset import random import pandas as pd from sklearn.preprocessing import minmax_scale as...
8d7dec4d681ea4a92583a72ceeeab4be9eab465dab94af23abb1e998eaef639d
Python
75,123
2,376
# -*- coding: utf-8 -*- """ Created on Thu Aug 6 00:21:15 2020 @author: Xingyan Liu Functions for handling AnnData: * I/O functions * preprocessing - normalization / z-scoring / ... - groups / ... * statistics computation """ import logging import os from pathlib import Path from typin...