sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
28c5e8e096c471b33cefda1d06849f44cafb55c856b29018e49cba3e52a78b7f | Python | 34,691 | 894 | #!/usr/bin/env python3
import argparse
import os
import sys
import platform
import pickle
from collections import defaultdict, Counter
from contextlib import closing
from multiprocessing import Pool
from functools import partial
from scipy.spatial.distance import cdist
from itertools import combinations, product
from ... |
768b7be683ae71f05bd636c58041fbf30406b7669e05f647b3760bcba2109e17 | Python | 34,720 | 992 | # eda_handler.py
import json
from datetime import datetime
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy
import seaborn as sns
from scipy import stats
from .visuals import VisualizationTools
class EDAHandler:
"""
A class to handle Exploratory D... |
c78fb96fad166eb990e61736970881dbcd416114fe48531a8b8db930c3b1c18d | Python | 34,736 | 852 | import dataclasses
import logging
import math
from collections.abc import Iterable
from pathlib import Path
from typing import Literal, Self, overload
import numpy
import openmm
import openmm.app
import openmm.unit
import openmmtools.mcmc
import openmmtools.multistate
from openff.toolkit import Quantity
from openff.un... |
645d4079ed31033de258f9a8ac5f4cecba2c724892fa66aad040f9caf46c4826 | Python | 34,887 | 882 | # -*- coding: utf-8 -*-
"""
Created on Sun Jan 7 17:29:14 2024
@author: ashle
"""
import tensorflow as tf
import numpy as np
from matplotlib import pyplot as plt, rcParams
from scipy.optimize import minimize
from scipy.stats import norm
import time
from scipy.integrate import quad
rcParams['figure.... |
bee473983562478da9bb9caee20b7e0bfe257ec2751ddba2fc0af8ec380136e8 | Python | 34,931 | 895 | # Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
0c724f60f1f34690b57ea659b5893c3dcb0248a4df446d03d056933e094b579a | Python | 34,934 | 1,036 | # Copyright 2022 Google LLC.
#
# 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 to in writing,... |
b07cde138b52c57c5f7c26a97467faf70025edb4405d895da1c9d4498764fa59 | Python | 35,020 | 598 | import multiprocessing
import itertools
import logging
import os.path
import traceback
import sqlite3
import csv
import pandas as pd
from math import ceil
from functools import partial
from tqdm import tqdm
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor, as_completed
from ..Computation.dice_com... |
81b470c47057c9303b1c7f3a299532fbd8f6179cda278ba85c29f91d69d65075 | Python | 35,133 | 888 | import warnings
from importlib.metadata import PackageNotFoundError, version
from typing import Dict, Iterable, List, Optional, Tuple, Union
import pandas as pd
from .biomart import Biomart
from .enrichr import Enrichr
from .gsea import GSEA, Prerank, Replot
from .gsva import GSVA
from .msigdb import Msigdb
from .par... |
09974106d1d5fd455262d67de512c7aa984456bb8eec0e3f936c4183361caf33 | Python | 35,200 | 1,018 | import copy
from dataclasses import dataclass, field
from functools import cached_property
from refs import llm_base_refs
from truesight import list_utils
from truesight.dataset.nums_dataset import PromptGenerator
import numpy as np
from refs.paper.preference_numbers_experiment import (
build_raw_dataset,
eval... |
0699eec3c3addbe499825f5955e0eea02f405ff325884206a92c78e63df29c92 | Python | 35,256 | 694 | """
Analysis code for processing trained networks
These are callbacks, called by Pytorch Lightning functionality at various points in training
Results are stored in the logs folder
"""
from __future__ import annotations
from logging import getLogger as get_logger
from pathlib import Path
import torch
from lightning... |
ba0ae18f4c34ceffa77692ace09f34dd32d7a762278134bbf30de860e90cfb3b | Python | 35,373 | 892 | """
Model Queue Manager for automated sequential model training.
This module provides functionality to train multiple models sequentially
with different hyperparameters and generate comprehensive comparison reports.
"""
import json
import logging
import time
from datetime import datetime
from pathlib import Path
from... |
423101cb16f647fa55b9a9dd5c88c313c12b3f8662821e82df9eae5f2f7be740 | Python | 35,392 | 1,040 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
General utility functions for the repo.
"""
# ================================================================... |
40b2a58bd5f89bcbfc7dc03c927deabcf8b4ae200de41deb05a123066b40cfec | Python | 35,402 | 969 | ##############################################################################
# pymbar: A Python Library for MBAR
#
# Copyright 2016-2020 University of Colorado Boulder
# Copyright 2010-2020 Memorial Sloan-Kettering Cancer Center
# Portions of this software are Copyright (c) 2010-2016 University of Virginia
# Portions... |
22026bfa54f8745240a738f9931e1ed11a55f5dd173c10025b0fc976e773f753 | Python | 35,483 | 983 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import copy
import os
import sys
from importlib import resources
from pathlib import Path
from unittest import mock
import numpy as np
import openfe
import pooch
import pytest
from gufe.sett... |
f5a6f660d1ef832beef4ef632d306819a41e50bca75b14fecc931d33806f4b50 | Python | 35,519 | 990 | """
Main data loading functions for Ethopy analysis.
This module provides user-friendly functions to load behavioral data
and return it as pandas DataFrames or DataJoint expressions ready for analysis and visualization.
"""
from typing import List, Optional, Union, Tuple, Any, Dict
import pandas as pd
import numpy as... |
b375525c9f3f151c006d6eb2eb7898a204c834c603eb8d48b1e8a02841dd0f2a | Python | 35,551 | 970 | ##############################################################################
# pymbar: A Python Library for MBAR
#
# Copyright 2016-2020 University of Colorado Boulder
# Copyright 2010-2020 Memorial Sloan-Kettering Cancer Center
# Portions of this software are Copyright (c) 2010-2016 University of Virginia
# Portions... |
dc62c0003695a9e0bcbabc93c50a173d340cab6ae3323fb5224debd4540c38c8 | Python | 35,554 | 947 | """
Bootstrap Effect Size Analysis for Nested Experiment Data
Computes bootstrap confidence intervals on effect sizes for synaptic weight
differences between excited and suppressed cells, properly accounting for the
hierarchical structure of nested experiments (connectivity * MEC patterns).
Key statistical property:
... |
17f88e91886910f5ac7300e0324ec6f546352e5bea46e7a00da9962ffa7a4a53 | Python | 35,605 | 865 | import os
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from scipy.stats import friedmanchisquare, wilcoxon, rankdata
from statsmodels.stats.multitest import multipletests
from itertools import combinations
from matplotlib.colors import LinearSegmentedColormap
from pathlib... |
600a39de6b07e7c2c1bf9ecc99d24977ce57cb40f1f361f30bd271c617a2b8c9 | Python | 35,627 | 442 | #!/usr/bin/env python
from __future__ import print_function
from forcebalance import parser, optimizer
from forcebalance.objective import Implemented_Targets
import re
""" The OptionDoc dictionary is a key : dictionary dictionary.
Each variable can have several parts of the documentation: 'pert' =
"""
GenOptionDoc ... |
a9b10ba542aea4796ab8fa0742c91da2e97e924edaf813d8b7a520c7d9564cb4 | Python | 35,697 | 838 | import os
import numpy as np
import pandas as pd
import glob
import re
import torch
from torch.utils.data import Dataset, DataLoader
from sklearn.preprocessing import StandardScaler
from utils.timefeatures import time_features
from data_provider.m4 import M4Dataset, M4Meta
from data_provider.uea import subsample, inter... |
913ad45dc15b3c977246069f688374849ba78ceb658297f356d210a50dc83240 | Python | 35,702 | 1,040 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
General utility functions for the repo.
"""
# ================================================================... |
66024bc1071d6a31e0e7d18d25f2c7059cbfafa6848ea2ee81393e8a0e9b5db7 | Python | 35,712 | 709 |
import os, sys
import pdb
from copy import deepcopy
from typing import Optional, Callable, List, Union, Tuple, Dict
from itertools import repeat, product
import numpy as np
import scipy.sparse as ssp
import torch
from torch.utils.data import IterableDataset
from torch_geometric.data import Data, Dataset, InMemoryData... |
af176b4a65da58dd8d528aadf56ee2d73ca5a26c034e93f4dbe5ee6f82d6799b | Python | 35,867 | 791 | #!/usr/bin/env python3
"""
Test script for RhizoVision CLI
Tests all argument combinations and validates output
Usage:
# Test with conda-installed RVE
python test_rve_cli.py ~/apps/miniforge3/envs/rve/bin/rv
# Test with custom binary and images
python test_rve_cli.py ./rv --test_images_dir /path/t... |
5b7d80c563c0b8ec466f7dbbac219278780348894a78c01eedf992c4b79dcc51 | Python | 35,911 | 803 | import sys
import getopt
import os
import pandas as pd
import numpy as np
import random
import copy
import multiprocessing
import time
from scipy.integrate import solve_ivp
from dynamics import *
from distance_functions import *
from GRN import GRN
from mutation_functions import *
from population_functions import *
f... |
b4959c130bf3cc9f88d1a6c458d9384bbfdd42d3eaa01b3e7add0512c8920918 | Python | 35,972 | 880 | #!/usr/bin/env python3
"""
Enhanced SAMMY-seq Chromatin State Analysis Pipeline
This script processes SAMMY-seq data to identify heterochromatin and euchromatin regions
Features:
- Processes all four SAMMY-seq fractions (S2S, S2L, S3, S4)
- Implements SPP-like methodology for ratio calculation
- Performs quantile nor... |
b93e8350e48008fad4d97e4bdc7f5cdef9605a29321915f534729476dbfda34e | Python | 36,178 | 1,005 | """
Test MBAR by performing statistical tests on a set of of 1D harmonic oscillators, for which
the true free energy differences can be computed analytically.
A number of replications of an experiment in which i.i.d. samples are drawn from a set of
K harmonic oscillators are produced. For each replicate, we estimate ... |
4eb1d69fe9dffd5c0d69cdeb25bc47530a05cbec4735f25686e08c004a1c6a6a | Python | 36,196 | 798 | #!/usr/bin/env python3
"""
Enhanced Gene Body MeCP2 Binding Analysis
This script provides comprehensive analysis of MeCP2 binding patterns in gene bodies,
including position-specific analysis, length normalization, and detailed genomic context.
Key Features:
- Position-specific analysis (5', middle, 3' regions)
- Len... |
5ed7588f8d82ad4d6b2886c3f7686c025bb00bb7bf6b09b6e127cdb3486052d4 | Python | 36,271 | 835 | import math
from html import escape
from typing import Any, Dict, List, cast
from multiqc.plots import bargraph, linegraph, table
from multiqc.plots.table_object import ColumnDict, SectionT
from multiqc.utils import mqc_colour
from natsort import natsorted
def _format_indexing(value: str) -> str:
"""Render "10 +... |
36d82c48a97225c841e1d84b7400439115c0c016f06fc240647d28a7700a758d | Python | 36,289 | 626 | # This script trains a decoder taking in neural data from past X ms with a stride of Y ms.
# The results provide the trial-averaged decoding accuracy across time (each time point has a separate decoder).
import argparse
import os
import numpy as np
import scipy
from pathlib import Path
import math
from functions impor... |
eabb93335cd591cc27a2c108f080097172ee6b975bbfd9a18561c189b8e69028 | Python | 36,484 | 948 | import logging
import os
import sys
import warnings
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import shap
from scipy.sparse import issparse
from sklearn.exceptions import UndefinedMetricWarning
from sklearn.metrics import (
ConfusionMatrixDisplay,
auc,
con... |
649dca713321b191391b2151386f1f55fb05b9d0c0f9074ef5af8f469fc9f6e6 | Python | 36,505 | 896 | """MultiQC functions to plot a linegraph"""
import json
import logging
import math
import os
import random
from typing import Any, Dict, Generic, List, Literal, Mapping, Optional, Sequence, Tuple, Type, TypeVar, Union, cast
import plotly.graph_objects as go # type: ignore
import polars as pl
from natsort import nats... |
ecb445d4566a0be78a802aa5cd27395baa74d45212e9de48dcf27127fd9f4502 | Python | 36,511 | 861 | from matplotlib import rcParams
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import welch, savgol_filter, coherence
try:
from scipy.integrate import simpson as simps # SciPy >= 1.14 renamed simps -> simpson
except ImportError:
from scipy.integrate import simps # older SciPy
from scipy.... |
8d6253910ca5704bfa8ade23fe06768b309b8c5eda9563656b76fc3afbf58632 | Python | 36,598 | 1,007 | import logging
import warnings
from functools import wraps
import numpy as np
# Optimize imported here and below as the jax-optimized one is jax or passthrough, but this is required regardless
import scipy.optimize
from pymbar.utils import ensure_type, check_w_normalized, ParameterError
logger = logging.getLogger(__... |
5ca39f8823fa5e48b2615a8b980846cadb76b1c8d3da08003c79e08142f4add4 | Python | 36,795 | 1,017 | import logging
import os
import warnings
from functools import wraps
import numpy as np
# Optimize imported here and below as the jax-optimized one is jax or passthrough, but this is required regardless
import scipy.optimize
from pymbar.utils import ensure_type, check_w_normalized, ParameterError
logger = logging.ge... |
16f158a1e601cd3b1d857e378d36d610adb7dbe39216bd35ba65514e6752465e | Python | 37,013 | 899 | #!/usr/bin/env python3
"""
Batch Dentate Gyrus Circuit for Efficient GPU Parallel Evaluation
Extends the single-circuit model to support batch dimension for evaluating
multiple parameter configurations simultaneously on GPU.
Design principles:
- Connectivity matrices are shared across batch (same circuit topology)
- ... |
c0a8fd2096e051a93ae0b5056c871fce9e917c835d2a971da6bca365a06cd224 | Python | 37,048 | 911 | # Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
20aa1eb89658f580189b418ae2af8c5c08725d6d0cfc59ef69b61a36c0c847e1 | Python | 37,133 | 1,067 | from __future__ import absolute_import
import errno
import logging
import socket
import sys
import warnings
from socket import error as SocketError
from socket import timeout as SocketTimeout
from .connection import (
BaseSSLError,
BrokenPipeError,
DummyConnection,
HTTPConnection,
HTTPException,
... |
75330da700c899ff34e9fb83d097399c2f8028cfbef88aea0b9d3232986ca872 | Python | 37,203 | 838 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import os, shutil, ctypes, multiprocessing
from os import path
import ast
from itertools import chain
from scipy import spatial
import numpy as np
from .. import six, afni, io, utils, _with_p... |
c28ddb70dcdb575db377e808b032d5d8badcba7a2474523bbd11dbc8b3d860cb | Python | 37,207 | 1,011 | # Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
9fb1eebe27b580443cced295bb0df5522f370dd424dc2fc92bb36870a062fa3a | Python | 37,246 | 850 | import numpy as np
import seaborn as sns
import pandas as pd
from matplotlib import pyplot as plt
import sys
sys.path.append('/home3/ebrahim2/beyond-brainscore/run_reg_scripts/')
from helper_funcs import return_network_idxs
from scipy.stats import pearsonr
import matplotlib
from scipy.stats import ttest_rel, ttest_1... |
dc9f51cead4d00eda9ff30dbe1fbf7dc6781041398bac57d917b409f68fa7825 | Python | 37,294 | 1,012 | """Routines related to PyPI, indexes"""
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
import functools
import itertools
import logging
import re
from typing import FrozenSet, Iterable, List, Optional, Set, Tuple, Union
from pip._vendor.packaging import specifier... |
c55b9b524ed6075a665f00108c3bdec9bc0eb6ef047e11dd445e4c3fc60b6f5c | Python | 37,390 | 869 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 2/18/2022
Full Model class
Author: dzhi, jdiedrichsen
"""
import time, warnings
import numpy as np
import torch as pt
import pandas as pd
from copy import copy, deepcopy
from torch.utils.data import Dataset, DataLoader
import HierarchBayesParcel.emissions a... |
ac4677356e95a26bbd34543245a43f9747832102344e1d257a03caca78f27145 | Python | 37,478 | 933 | import cv2
import numpy as np
import os
from scipy.fft import rfft, irfft
from shapely import concave_hull, MultiPoint, intersects_xy
import shapely.geometry as shpgeo
from shapely.affinity import affine_transform
from skimage.feature import peak_local_max
from itertools import combinations
from feabas import common, ... |
95fc292315208bd6773b01a1cd31c1902908c14b882bfc8d1344e842f1cde84b | Python | 37,589 | 713 | #!/usr/local/bin/env python
# ==============================================================================
# MODULE DOCSTRING
# ==============================================================================
"""
SamsSampler
===========
Self-adjusted mixture sampling (SAMS), also known as optimally-adjusted mixture ... |
c0139d341323acf60395604a3993d32aec7787988e5170c13b9ed5fbd01c0d6d | Python | 37,615 | 1,011 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 12/14/2021
Evaluation - implements evaluation of emission, arrangement, or full models
Assumes that data, likelihoods, and estimates comes as NxKxP tensors
First are basic functions for save evaluation -
Second are more complex functions that use different c... |
45170511fe623866b8e89de2d4a55cecc702fad3f7cf662eee02fa0ffe734ac0 | Python | 37,632 | 669 | from __future__ import print_function
import argparse
import HTSeq
import os
import pyfaidx
import regex
from statsmodels.distributions.empirical_distribution import ECDF
import sys
""" Tabulate merged start positions.
Identify genomic coordinates for reads mapping across 151/152 bp position.
Add positions t... |
cf6cf215f3c2f8a40da9bf8396910f5a1037bd282470de6774c2bb4eb45ed1d9 | Python | 37,657 | 713 | #!/usr/local/bin/env python
# ==============================================================================
# MODULE DOCSTRING
# ==============================================================================
"""
SamsSampler
===========
Self-adjusted mixture sampling (SAMS), also known as optimally-adjusted mixture ... |
59ca02739ad491bdf411961f8f1598583e12d1886094ed61a793724785986bc6 | Python | 37,724 | 969 | #!/usr/bin/env python3
"""
Network Clamp Testing Framework - Conductance-Based Version
Uses biophysically realistic conductance-based dendritic-somatic transfer
with comprehensive testing of dendritic integration mechanisms.
"""
import sys
import torch
import numpy as np
import matplotlib.pyplot as plt
import seaborn... |
2da17f69a506c9d5ec3f95958041bdb8873014be8a1882f895366a011ec994d0 | Python | 37,776 | 911 | """
Adaptive Particle Swarm Optimization.
This module provides a PSO implementation with:
- Opposition-Based Learning (OBL) for initialization and escape
- Diversity-adaptive parameter control
- Dynamic Multi-Swarm (DMS-PSO) with regrouping
- Intelligent restart mechanisms
- Optional metadata tracking from objective f... |
e0601e2c0b30e9b5e94e5341c127962e60358d9f1cd1637f6bd0fdc02ceda93e | Python | 38,012 | 1,042 | # Copyright 2022 Google LLC.
#
# 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 to in writing,... |
8530961716644f7c1de9110823d6072c2987f88fced345cef34876f96379cfaa | Python | 38,021 | 866 | import numpy as np
import pandas as pd
import os, glob, sparse
from Bio import SeqIO
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras import layers, models, regularizers
from tensorflow.keras.utils import Sequence
from tensorflow.keras.optimizers import Adam
from sklearn.linear_mo... |
775e25f05a3240812f089f15c1f11ca02d0d687724ed13998667c2f63656eee5 | Python | 38,110 | 944 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
"""OpenMM Equilibrium Solvation AFE Protocol --- :mod:`openfe.protocols.openmm_afe.equil_solvation_afe_method`
================================================================================... |
68def54ee1711381d7b14330715aaee8f9ac8ad8c4f2d72dfef2e9e7b8f3e332 | Python | 38,421 | 898 | def SCVELO(adata=None, h5ad=None, group_by=None, palette=None,
linear_reduction=None, nonlinear_reduction=None,basis=None,
mode=["deterministic","stochastic","dynamical"],fitting_by="stochastic",
magic_impute=False,knn=5, t=2,
min_shared_counts=30, n_pcs=30, n_neighbors=30,
... |
163f2f535b148f1a0a5a2e5e25f74ad6ced04edebdc2178b771b10e6f69c73a4 | Python | 38,440 | 831 | #!/usr/bin/env python3
"""
Validated D4D Agent Wrapper - Processes downloaded files with validation steps:
1. Assesses whether downloads succeeded
2. Verifies each file contains specific information about the project in its column
3. Generates D4D YAML metadata using the Anthropic Claude API
"""
import asyncio
import ... |
02efa02036e0756a6ceb652adbf72775808166e27ed91a3af134e1a2e53c56f2 | Python | 38,542 | 1,080 | import logging
from copy import deepcopy
from pathlib import Path
import numpy as np
import pytest
from hypothesis import HealthCheck, Phase, given, settings
from hypothesis import strategies as st
from kimmdy.parsing import TopologyDict, read_top
from kimmdy.recipe import Bind, Break
from kimmdy.topology.atomic impo... |
50329db6f4f092c04ef42cacf9701baab9ef5f0bc5d8e68374cfa23b3b681a50 | Python | 38,763 | 1,205 | #!/usr/bin/env python3
# ----------------------------------------------------------------------------
# Copyright (c) 2020--, Qiyun Zhu.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------... |
392bbb2dbea152dbb67caeabe9bd968347177f00cb9a70a13adf8c8914ad8c96 | Python | 38,845 | 991 | import click
from collections import defaultdict
import pathlib
import json
import tqdm
from rdkit import Chem, DataStructs
from rdkit.Chem import AllChem, rdFreeSASA, rdMolDescriptors
from rdkit.Chem.AtomPairs import Pairs, Torsions
import gufe
from gufe import SmallMoleculeComponent, LigandAtomMapping, AtomMapping
fr... |
4e3953fb5f5d7afb0a0f729053e8a3691f1a2383ed8ed44df82826d3c23cf339 | Python | 38,855 | 1,189 | # Copyright 2022 Google LLC.
#
# 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 to in writing,... |
4c8d025e4780516357b256913e83c9c134b234a3aa8d460c7400d29fa10fb7cf | Python | 38,905 | 866 | import argparse
import os
import numpy as np
import pandas as pd
import torch
import matplotlib.pyplot as plt
import pickle
from model_risk import SNN_RISK
from dataset_survival import RNAseqSurvivalDataset
from scipy.stats import ttest_1samp, pearsonr, spearmanr
from statsmodels.stats.multitest import multipletests
fr... |
75e0cf42aa63f76486ea902dc0b6e0287ac8b25cbb840646f94ea0db2ee1c867 | Python | 38,954 | 1,057 | import datetime
import io
from os import linesep
import re
import sys
from pip._vendor.toml.tz import TomlTz
if sys.version_info < (3,):
_range = xrange # noqa: F821
else:
unicode = str
_range = range
basestring = str
unichr = chr
def _detect_pathlib_path(p):
if (3, 4) <= sys.version_info:
... |
cf628fcb7877b5c0e76fd5ecee702a4393b3d1baa358050598a59c14a468a1d8 | Python | 38,962 | 1,056 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Implementation of the Metadata for Python packages PEPs.
Supports all metadata formats (1.0, 1.1, 1.2, 1.3/2.1 and withdrawn 2.0).
"""
from __future__ import unicode_literals
import codecs
from ... |
a6f15d524cd3403509dc271440bf47055cef79e8b04ef2e5f91a8103bbcd6f88 | Python | 38,987 | 860 | """
twinc_reg_data.py
Author: Anupama Jha <anupamaj@uw.edu>
Generate regression labels for trans-contacts.
This version takes a mcool file as input.
Adaptive coarse-graining adapted from
Orca (https://github.com/jzhoulab/orca_manuscript).
"""
import os
import gzip
import cooler
import argparse
import configparser
impor... |
bcc301ec9103f235ddb2ecc82a0ce0f1c92f6e745aacd1f8a2682fb494b9372a | Python | 39,179 | 1,000 | #! python
# -*- coding: utf-8 -*-
import logging
import os
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
import numpy as np
import pandas as pd
from pandas.api.types import is_object_dtype, is_string_dtype
from gseapy.enrichr import EnrichrAPI
from gseapy.plot import GSEAPlot, TracePlot, gseap... |
6a6d220a4b837c95a6651bb00ced5ca608d402c86e044a47368dae96e9bd3e63 | Python | 39,284 | 1,074 | from pathlib import Path
import numpy
import openmm
from openff.toolkit import ForceField, Molecule, Topology
from openff.units import unit
from openmm import app
from openmm import unit as openmm_unit
from openmmforcefields.generators import EspalomaTemplateGenerator
from proteinbenchmark.force_fields import force_f... |
46da6d55e1b05fb957134f06f6e2c2fad16f27d954222c1705073dd8bb40c21e | Python | 39,330 | 691 | import numpy as np
base = '/home3/ebrahim2/beyond-brainscore/'
from sklearn.metrics import mean_squared_error
import sys
sys.path.append(base)
from plotting_functions import plot_across_subjects, plot_2d_hist_scatter_updated, load_into_3d, save_nii
from trained_untrained_results_funcs import calculate_omega, load_perf,... |
291e2e0eccf8af158bd3522b6a35d5b46ac2abd39bed592dbca7b02411ea7743 | Python | 39,439 | 871 | import argparse
import os
import numpy as np
import pandas as pd
import torch
import matplotlib.pyplot as plt
import pickle
import shap
from model_risk import SNN_RISK
from dataset_survival import RNAseqSurvivalDataset
from scipy.stats import ttest_1samp, pearsonr, spearmanr
from statsmodels.stats.multitest import mult... |
81f95552a1e307ce1b9be7caf805b4d19ff9c432221597bae0c7bfdfdad62406 | Python | 39,492 | 1,031 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import xml.etree.ElementTree as ET
from copy import copy
from pathlib import Path
from typing import Any, Dict, Hashable, List, Optional, Tuple, Union
import dask.array as da
import numpy as np
import xarray as xr
from dask import delayed
from fsspec.implem... |
b481875fcde322c11eb9536c97eadaafcb17361b2d612f08612a25a7c4205dcb | Python | 39,497 | 1,086 | """
Main data loading functions for Ethopy analysis.
This module provides user-friendly functions to load behavioral data
and return it as pandas DataFrames or DataJoint expressions ready for analysis and visualization.
"""
from typing import List, Optional, Union, Any, Dict
import pandas as pd
import numpy as np
imp... |
e4375e00bef7b346ab6bf2427d156f1b0993c5377963d095836413ef3067a4c9 | Python | 39,768 | 753 | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 21 13:33:46 2020
@author: nwh5j
"""
#To do: save "snapshots" of the subset of hdf5 files used when making a jupyter report
#want to be able to run through photometry data and save the jupyter report
#look at https://github.com/LernerLab/GuPPy/blob/main/GuPPy/sav... |
d8642b19d1af948bb5756f43d41ab6d1354d4651544a815c5b0420b8d75c63ac | Python | 39,839 | 1,016 | from omegaconf import OmegaConf
from typing import Callable, Optional, List, Tuple
from pathlib import Path
from contextlib import redirect_stdout, redirect_stderr
from textual import work, on
from textual.app import App, ComposeResult
from textual.message import Message
from textual.screen import Screen, ModalScreen
f... |
de894c3d96b8113527d9e21a8efff22394494fe6313fba2ad1fe0ffad5dff8a4 | Python | 39,943 | 1,080 | import base64
import io
import logging
import multiprocessing as mp
import os
import shutil
import threading
import time
import warnings
from abc import ABC, abstractmethod
from datetime import datetime
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from multiprocessing import Pool
from pathlib imp... |
0fde0c31872e4ead4e719108535b51a2412bb1b3e682960975d5edd3c4286f04 | Python | 40,018 | 1,021 | import logging
import re
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, linegraph, violin
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
The module parses logs generated by the BISCUIT quality control script, `QC.sh`... |
2ea4da525df6c13dc77ca9b6f3e24ae48929c27762f18c8e9d9beb76c10eaa0e | Python | 40,129 | 863 | """ Target base class from which all ForceBalance fitting targets are derived. """
from __future__ import print_function
from builtins import str
from builtins import range
import abc
import os
import subprocess
import shutil
import numpy as np
import time
from collections import OrderedDict
import tarfile
import forc... |
6f08bf3d0aff20aeae8e9a726d1a61054b67f175af7e8919e960404faba79431 | Python | 40,132 | 900 | """
WhoBPyT Jansen-Rit model classes
---------------------------------
Authors: Zheng Wang, John Griffiths, Andrew Clappison, Hussain Ather, Sorenza Bastiaens, Parsa Oveisi, Kevin Kadak
Neural Mass Model fitting module for JR with connections from pyramidal to pyramidal, excitatory, and inhibitory populations for M/... |
68b23b5e8abaecf2965e57d442a72225fe1f28ae779908363a14745db68a9485 | Python | 40,149 | 1,323 | """
:mod:`alchemiscale.interface.api` --- user-facing API components
================================================================
"""
from collections import Counter
from fastapi import FastAPI, APIRouter, Body, Depends, HTTPException, Request
from fastapi import status as http_status
from fastapi.middleware.gzi... |
b186094068c6d38cc427cad515f2020787c9141c7d2bab28f058c5b611d1a692 | Python | 40,150 | 1,324 | """
:mod:`alchemiscale.interface.api` --- user-facing API components
================================================================
"""
from collections import Counter
from fastapi import FastAPI, APIRouter, Body, Depends, HTTPException, Request
from fastapi import status as http_status
from fastapi.middleware.gzi... |
0bf1529ca9bb599334c1eca9359353652f62f48ebdc2d97707313ea917778d20 | Python | 40,173 | 1,128 | """PyPI and direct package downloading"""
import sys
import os
import re
import io
import shutil
import socket
import base64
import hashlib
import itertools
import warnings
import configparser
import html
import http.client
import urllib.parse
import urllib.request
import urllib.error
from functools import wraps
impor... |
f496a5eb596a5e2e92e4b0dc9a044b5cfefab9b90ca6a0a06e9c8e117bdb8d79 | Python | 40,241 | 774 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import pandas as pd
import scipy.sparse
import umap
from tqdm import tqdm
from INSPIRE.networks import *
class Model_GAT():
def __init__(self,
adata_st_list, # list of spatial transcr... |
1e6ff92843782daf0d8a59d9074a06f6eb4444c923ebbe764bd2e62397833060 | Python | 40,274 | 730 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Script of evaluate the individual parcellation results
Created on 18/10/2024 at 4:22 PM
Author: Caro Nettekoven
"""
import numpy as np
import numpy as np
from pathlib import Path
import nibabel as nb
import Functional_Fusion.atlas_map as am
import Functional_Fusion.da... |
0ef6e2a52d03855c38a2c1459973611ecb78eb146e1a49498b4afd66d29fe975 | Python | 40,287 | 876 | import argparse
import os
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
import pickle
from captum.attr import DeepLift
from model_risk import SNN_RISK
from dataset_survival import RNAseqSurvivalDataset
from scipy.stats import ttest_1samp, pearsonr, spearmanr
f... |
a7a4358b06d3f304e19cfe2029bc9b2553aa5026d1c36d818c6841bb895aa3db | Python | 40,427 | 851 | import re
import os
import io
import toml
import tempfile
import tarfile
import pandas as pd
from pathlib import Path
from dataclasses import dataclass, field
from omegaconf import OmegaConf
from rich import table, console
from rich import print as rprint
from typing import List, Dict, Optional, Any
from collections im... |
e7d653fbc7d523f6cabba555abbb7b222dc913bee26eb47a8905a9c36f69bb46 | Python | 40,489 | 1,093 | """Fidelity and disclosure risk evaluation for generated samples.
Implements three evaluation metrics from the JMIR paper (doi:10.2196/47862):
1. Dimensionwise Probability (DWPro) — Bernoulli parameter comparison
2. Dimensionwise Prediction (DWPre) — LR F1-score comparison
3. Disclosure Risk — kNN attack precision/sen... |
f9c83790cd92cd540618391dfd9b57a9ffd6721b840481b59162e90ca7d9ab00 | Python | 40,612 | 954 | import gc
import os
import random
from pathlib import Path
from typing import Dict, Optional, Tuple, Union, List
import numpy as np
import polars as pl
import pydicom
import time
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.checkpoint import checkpoint
from torch.utils.data import Da... |
1e9d4923ff907f54d3ef4ef6d8f7dafb6dbed4ce4e6ff95fbf1bac9d43f08a5e | Python | 40,617 | 1,166 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import importlib
import logging
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Type, Union
import dask.array as da
import numpy as np
import xarray as xr
from ome_types import OME
from . import dimensions, exceptions, transforms, types
from... |
18513aa01267c660a0bc72c094094cbeccb40f918c5b8576675ba40cf026f69f | Python | 40,732 | 1,165 | """List of benchmark targets specifying observables and thermodynamic state."""
from pathlib import Path
from openff.units import unit
from proteinbenchmark.utilities import package_data_directory
observable_directory = Path(package_data_directory, "observables")
pdb_directory = Path(package_data_directory... |
30aad4dda2b6afe6221169b3e4b40bf957c8cf22beb89acf63e141e6ff085ae8 | Python | 40,770 | 1,154 | # Copyright 2024 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
a2eedc4c707be4d73b975e71d1e33b77c88863b0fc5641173101aecbd58d40f0 | Python | 40,952 | 928 | import json
import logging
import textwrap
from collections import defaultdict
from typing import Any, Dict, List
import multiqc
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, linegraph, table
log = logging.getLogger(__name__)
PHRED_SCORE_EXPLANATION = te... |
46f49a11a9619cc92a6128fbb4cbbc817fe4f60bf06cef6b739ebf6373aa171c | Python | 41,064 | 894 | import argparse
import os
import numpy as np
import pandas as pd
import torch
import matplotlib.pyplot as plt
import pickle
import shap
from model_risk import SNN_RISK
from dataset_survival import RNAseqSurvivalDataset
from scipy.stats import ttest_1samp, pearsonr, spearmanr
from statsmodels.stats.multitest import mult... |
bfa0e7c13aa1347c2b11516bf3f61e8935ba1b87ed3ff7afb32c0d82b99d6f6a | Python | 41,144 | 1,018 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2017 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import base64
import codecs
import datetime
import distutils.util
from email import message_from... |
b2e5bba48cc63ec1e5e7aa58157035016451034d14b5cd38387315b1a39b75dc | Python | 41,269 | 521 | import logging
import os
import shutil
import time
import traceback
import json
import pandas as pd
import glob
from tmp_dependencies.utils.data_structures.ReportingStructure import ReportingType
from utils.data_structures.UserPreferencesStructure import UserPreferencesStructure
from utils.data_structures.MRIVolumeStr... |
e1a1015609029127b36e06501ed1f7339cb8caeb87d93726efa90216992ca6e4 | Python | 41,348 | 1,062 | from typing import Any, Iterable, Mapping, Sequence, Tuple, Union, Optional, Callable, Literal, List
import math
import numpy as np
import pandas as pd
import scanpy as sc
import anndata
import scipy
import umap
from sklearn.preprocessing import LabelEncoder, MinMaxScaler
from sklearn.metrics import confusion_... |
003039eb1880c5aaf7994eaa7a694184d6ecac53e8b174613b8e11cec6c93ea9 | Python | 41,408 | 1,120 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2017 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import absolute_import
import os
import re
import sys
try:
import ssl
except ImportError: # pragma: no cover
s... |
e63472a7c282bb29216fdfb1f977553a406e7b904f4cadb73107f8a12b89f418 | Python | 41,423 | 912 | import argparse
import os
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
import pickle
from model_risk import SNN_RISK
from dataset_survival import RNAseqSurvivalDataset
from scipy.stats import ttest_1samp, pearsonr, spearmanr
from statsmodels.stats.multitest i... |
3e43258ec6bfb9a13a6e7ac9409c94ed981c48baa77f6ae777c3ca336d662baa | Python | 41,470 | 1,047 | import click
from cinnabar.plotting import _master_plot, plot_DGs
from cinnabar import FEMap
import pandas as pd
import pathlib
from openff.units import unit
import json
from gufe.tokenization import JSON_HANDLER
import numpy as np
import tqdm
from typing import Literal
import pymbar
from pymbar import MBAR
import shut... |
52c98e804a613479f84ce3529a689eba1b02d787f7897d0d0f569464da4738e0 | Python | 41,482 | 1,194 | """ Code to process the data for Figure 3. """
import os
import logging
import itertools
from pathlib import Path
from typing import List
import numpy as np
import pandas as pd
import seaborn as sns
import scipy.stats as stats
import matplotlib.pyplot as plt
# Disable matplotlib logger
logging.getLogger("matplotlib.... |
5aade7f4b0c2c3a76bb4ebc83fa933c23be96ea9c96f4a53c0679da0e4236d58 | Python | 41,488 | 892 | """
Emission models that are still being developed and tested -
not yet ready for use
"""
import numpy as np
import torch as pt
import pandas as pd
import pickle
from scipy import stats, special
from torch import log, exp, sqrt
from HierarchBayesParcel.model import Model
from HierarchBayesParcel.depreciated.AIS_test i... |
b5850bac14ec9fe125c9758588e89436a83075726e68e16e828330c58ebb08eb | Python | 41,565 | 922 | import torch
import torch.nn as nn
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pickle
from captum.attr import IntegratedGradients
import argparse
import os
from model_genomic import SNN
from dataset_survival import RNAseqSurvivalDataset
from scipy.stats import mannwhitneyu, pearsonr, s... |
37882062ecb25db45071359d83fb7c103c15b2b6751ebb0b737fb51768f866af | Python | 41,686 | 1,067 | """A comprehensive logging system.
Managing experimental data, database connections, and data flow control in an
experimental setup. It includes functionality for establishing database connections,
managing logging sessions, handling data insertion, and synchronizing setup status.
Classes:
Logger: Manages logging... |
051c47726e4292a8c92693f2fb06bf0fc0e2ba7aa84d91eca1c7a4dc841a7fa7 | Python | 41,958 | 1,121 | """Core experiment module for experiment control.
This module provides the base classes and functionality for running behavioral
experiments. It includes:
- State machine implementation for experiment flow control
- Condition management and randomization
- Trial preparation and execution
- Performance tracking and ana... |
e679fdb4d70c9d1e27d4677ff1a3f560aa117c307ab6f44a5c9765262d90af03 | Python | 41,963 | 925 | import shap
print(shap.__version__)
import argparse
import torch
import torch.nn as nn
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import pickle
from model_genomic import SNN
from dataset_survival import RNAseqSurvivalDataset
from scipy.stats import mannwhitneyu, pearsonr, spearmanr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.