sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
e8789efc76c1e6e46e986fe8820604c3e2192652127e91a3d31e27cd4edd184c | Python | 54,340 | 1,263 | import importlib.util
import json
import logging
import os
import time
from pathlib import Path
from typing import Any
from timeflies.data.loaders import DataLoader
from timeflies.data.preprocessing.data_processor import DataPreprocessor
from timeflies.data.preprocessing.gene_filter import GeneFilter
from timeflies.di... |
515c2cd184335e6e321d7f510b0d9840c7d5e757fde6ce86bbfd99d55e19a858 | Python | 54,791 | 984 | """
01/11/2023
Ourania Semelidou
Théo Gauvrit
Recording object classes
"""
import json
import os
import matplotlib
import numpy as np
import pandas as pd
import scipy.signal as ssig
import matplotlib.pyplot as plt
from percephone.utils.io import read_info, correction_drift_fluo, get_idx_frame_mesc, extract_analog_from... |
82b22bf383de836f3cd8613bc4a9f704400fe7e4dd7697291f050b52de138a8b | Python | 55,077 | 1,357 | """
The Runmanager is the main entry point of the program.
It manages the queue of tasks, communicates with the
rest of the program and keeps track of global state.
"""
from __future__ import annotations
import logging
import queue
import re
import shutil
import time
from copy import copy, deepcopy
from dataclasses ... |
120f6544a0ec264d73536b895ba72a173a547e34097e0821f188b3699198750f | Python | 55,323 | 1,616 | import textwrap
from tempfile import TemporaryDirectory, mkdtemp
import matplotlib
import numpy as np
import pandas as pd
import pytest
matplotlib.use("Agg")
import matplotlib.pyplot as plt # noqa: E402
from gseapy.__init__ import enrich, enrichr, gsea, gsva, prerank, replot, ssgsea
from gseapy.plot import DotPlot,... |
c09a4cc740e774ae4ad52cc4bdaf80c5a1a3bafc44d82d8585b403320cacbddb | Python | 55,479 | 1,632 | """
NWB File Export Module for Ethopy Data
This module provides functionality to export experimental data from DataJoint tables
to NWB (Neurodata Without Borders) format files.
"""
import logging
import os
from datetime import datetime, date
from dateutil.relativedelta import relativedelta
from typing import Any, Di... |
390266bfab6d3e47333bd4971b93877cf2ad1ad96c0cd052bebb28b795c58b57 | Python | 55,492 | 1,186 | """ @package forcebalance.abinitio Ab-initio fitting module (energies, forces, resp).
@author Lee-Ping Wang
@date 05/2012
"""
from __future__ import division
from __future__ import print_function
from builtins import zip
from builtins import range
import os
import shutil
from forcebalance.nifty import col, eqcgmx, fl... |
9cb3cacb0fcdb3b8418cded5588d1449ac376b08b2d9df49916ce42975d31f64 | Python | 55,936 | 1,358 | from collections import defaultdict, OrderedDict
import cv2
import numpy as np
import shapely
import shapely.geometry as shpgeo
from shapely.ops import unary_union, linemerge, polygonize
from feabas import dal, common, material
import feabas.constant as const
from feabas.config import data_resolution, get_numpy_threa... |
ee779b256ae8564f310ce0647f44169082328108a8757782667c99a43a535827 | Python | 56,161 | 1,611 | """Class to execute the LEiDA pipeline."""
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.utils import Bunch
from itertools import combinations
import warnings
warnings.filterwarnings("ignore")
from .dynamics_metrics import (
group_transition_... |
3114557beac93c09fc6cfb23140b05a46dd9dbad22e1b8ae3c4b10f64e96b5cf | Python | 56,185 | 1,352 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Custom OpenMM Forces classes and utilities.
"""
# ============================================================... |
fc7902d0958275672463f51bbbb736d2c418ea31a582990e35fa0e86c7429524 | Python | 56,521 | 1,352 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Custom OpenMM Forces classes and utilities.
"""
# ============================================================... |
7c4da2c58bce03a4099555939735fbbd028a6f981e276e4cdc18f89d28e7b6c3 | Python | 56,969 | 1,364 |
# sphinx_gallery_thumbnail_path = '../_static/momi2023__Figure_2.PNG'
"""
.. _ex-momi2023:
===================================================================
The Role of Recurrent Network Feedback in TMS-EEG Evoked Responses
===================================================================
This example gives a ... |
2e00d8d595f7ddb0978cee6a92b4a4141aed38f50fa934891ebbe7a5067464b9 | Python | 57,587 | 1,056 | """
Théo Gauvrit 18/01/2024
Different plots link to behavior
"""
import mplcursors
from scipy.stats import stats
from sklearn.linear_model import MultiTaskLasso
import statsmodels.api as sm
import percephone.core.recording as pc
import percephone.analysis.utils as pu
import percephone.plts.stats as ppt
import percepho... |
d86f20ccb423927f6dd9c571f8ad1ae8fa5f03f2bc1c70a1b81d62a04b3cc73a | Python | 57,762 | 1,275 | import numpy as np
import pandas as pd
import os, glob, sparse, yaml
from Bio import SeqIO, Seq
BASE_TO_COLUMN = {'A': 0, 'C': 1, 'T': 2, 'G': 3, '-': 4}
import sklearn.metrics
import sklearn.utils
from sklearn.preprocessing import StandardScaler
import scipy.stats as st
data_utils_dir = "./data_processing/data_utils... |
f80e2ddfc2683aa4326b54bf76f2f91547af89442a8db5733b3c13ff02201852 | Python | 57,980 | 1,288 | """
特征重要性稳定性分析脚本
功能:分析同一癌症内、同一XAI方法下,跨不同模型的Top-k特征稳定性
作者:AI助手
日期:2025-10-14
"""
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
from scipy.stats import rankdata
from itertools import combinations
from pathlib import Path
from collections i... |
cd42104873c2d01a132d285bccf1bccca284965b665e07fbc4ed2197f3946675 | Python | 58,290 | 1,584 | # 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,... |
b05dffebd87ff94cf737aca54b503fb343decae2d3b8873394fa9dd9e54f54da | Python | 58,459 | 1,614 | """Methods that yield new objects not derived from set-theoretic analysis."""
import numpy as np
from shapely import lib
from shapely._enum import ParamEnum
from shapely.algorithms._oriented_envelope import _oriented_envelope_min_area_vectorized
from shapely.algorithms.cga import _orient_polygons_vectorized
from shap... |
06722180ec7f0cef2fc0a187be37c5e6a76d3478b656a6a0caa960725171a024 | Python | 58,504 | 1,434 | import json
import os
import sys
import dill as pickle
import numpy as np
import xgboost as xgb
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from ..utils.gpu_handl... |
78257e620acfbb5756e463649ca46099b07673525708a96c0344b86759ee5e3b | Python | 58,514 | 1,629 | # Copyright 2026 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,... |
f7fe959ddfae9dafd7d32e96fa0126fd9d6f7a084be22e2d4683a789ae42626a | Python | 58,779 | 1,595 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import copy
import gzip
import logging
import os
import sys
from importlib import resources
from pathlib import Path
from unittest import mock
import numpy as np
import pytest
from gufe.comp... |
394e3fc3fb862a78ee6391a3cbf603a8a4916472e3924d28ccc46e66aaccad85 | Python | 60,311 | 1,309 | import os
# set environment variable to limit the number of threads for scikit-learn
os.environ["OMP_NUM_THREADS"] = "4"
os.environ["OPENBLAS_NUM_THREADS"] = "4"
os.environ["MKL_NUM_THREADS"] = "4"
os.environ["VECLIB_MAXIMUM_THREADS"] = "4"
os.environ["NUMEXPR_NUM_THREADS"] = "4"
from functools import partial
import ... |
18791ebf136109a552ca500203217fb99152d31a003e91eb5800346f825794cb | Python | 60,478 | 1,614 | # src/analysis/visualization.py
"""
Visualization functions for correlation matrices and training metrics
"""
from __future__ import annotations
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.cluster.hierarchy as hc
from collections import Counter, defaultdict
# =============... |
5a218fde7fe3f188ff0b6584abff624dd4f8b0539428fff913a1bfbca75cc11e | Python | 60,834 | 1,585 | import sys
import math
import warnings
import xml.etree.ElementTree
import pathlib
import jnius_config
import numpy as np
import scipy.spatial.distance
import scipy.fft
import skimage.util
import skimage.util.dtype
import skimage.io
import skimage.exposure
import skimage.transform
import sklearn.linear_model
import net... |
c11b432f612ee97641ae9252f53817b65de69132fedab7aafb67be585baaa2e7 | Python | 61,030 | 1,265 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2014 David Emms
#
# This program (OrthoFinder) is distributed under the terms of the GNU General Public License v3
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... |
01cfd21142658ab394aa34a5b9c8a399ab22026c2a5858c6e2bbccf03cd6b85f | Python | 61,664 | 1,620 | #!/usr/bin/env/python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Module which houses all the handling instructions for reading and writing to netCDF files for a given type.
This... |
5500c50ff26d1bf35b26fe67a959baa7ac99d117f608f6c663ed0a531119998f | Python | 61,804 | 1,387 | """
MultiQC datatable class, used by tables and violin plots
"""
import logging
import math
import re
from html import escape
from collections import defaultdict
from dataclasses import dataclass
from typing import Any, Callable, Dict, List, Mapping, NewType, Optional, Sequence, Set, Tuple, TypedDict, Union, cast
from... |
1641e765f04512de0925e40657ef972e72a47605a73666a07f033565b1e9c7f6 | Python | 61,858 | 1,652 | # -*- coding: utf-8 -*-
import operator
import sys
import textwrap
import warnings
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import numpy as np
import pandas as pd
import scipy.cluster.hierarchy as sch
from matplotlib... |
fcad61b2fd5274c1aac2ec2da9864ebccd8ac3d8231f8ac4d05adfe9d714fefa | Python | 61,931 | 1,620 | #!/usr/bin/env/python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Module which houses all the handling instructions for reading and writing to netCDF files for a given type.
This... |
7086daea6f3955b2029cff5cef5287a1c11d498e357e60b803d76079a94798be | Python | 62,785 | 1,558 | from abc import ABC
from collections import OrderedDict
from functools import partial
import gc
import json
import os
import re
import cv2
import numpy as np
from rtree import index
from scipy.interpolate import interp1d
import tensorstore as ts
from feabas import common, caching
from feabas.storage import File, join... |
b1ea80fb10f0815a4dbb2633d8b5ec0ef9652ffe0f70d7ed97263a3aee99a15b | Python | 63,049 | 1,710 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
"""OpenMM AFE Protocol base classes
===================================
Base classes for the OpenMM absolute free energy ProtocolUnits.
This mostly implements BaseAbsoluteUnit whose methods... |
e42f0e053aacdbce775522ca84a339ba17140409742ad9ba1dbf0cc203fe4b4f | Python | 63,050 | 1,422 | """
Aging-Specific Metrics Module
Specialized evaluation metrics for aging research in Drosophila.
"""
import logging
from typing import Any
import numpy as np
import scipy.stats as stats
from sklearn.dummy import DummyClassifier, DummyRegressor
from sklearn.metrics import (
accuracy_score,
classification_re... |
0d9f102209f0ef544628fbd3ce2c3057b27ec41bf96cb8d7fe320f220ab7aeb1 | Python | 63,286 | 1,198 | """ @package forcebalance.liquid Matching of liquid bulk properties. Under development.
author Lee-Ping Wang
@date 04/2012
"""
from __future__ import division
from __future__ import print_function
from builtins import str
from builtins import zip
from builtins import range
import abc
import os
import shutil
from for... |
c9cd4c2e08c1b7231ee48f38f8f92b8d59a22a601cb0ff234692a521be6c2c51 | Python | 63,756 | 1,364 | """
Bootstrap特征重要性稳定性分析脚本
功能:分析同一癌症内、同一XAI方法下,跨不同bootstrap模型的Top-k特征稳定性
作者:AI助手
日期:2025-10-23
"""
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
from scipy.stats import rankdata
from itertools import combinations
from pathlib import Path
... |
becc58e6daf5af95362a24e2c92a4bdc40c862489f8e0903d509ea66266e8edb | Python | 63,834 | 1,145 | from typing import *
import velocyto as vcy
import numpy as np
import abc
class Logic(metaclass=abc.ABCMeta):
"""Base class from wich all the logics should inherit
"""
def __init__(self) -> None:
self.name = "Logic"
@property
def layers(self) -> List[str]: # This should be overridden if... |
b189caae5dd0335baa500b377a7e1e56295c01f650c26d9662f5c7f3e873a896 | Python | 63,998 | 1,345 | """ @package forcebalance.abinitio Ab-initio fitting module (energies, forces, resp).
@author Lee-Ping Wang
@date 05/2012
"""
from __future__ import division
from __future__ import print_function
from builtins import zip
from builtins import range
import os
import shutil
from forcebalance.nifty import col, eqcgmx, fl... |
eeb71827ba0422525961c1b37aef87bdc4a4377b42a62089c64c668775aca217 | Python | 64,012 | 1,869 | import sys
import numpy as np
import pytest
import shapely
from shapely import (
Geometry,
GeometryCollection,
GEOSException,
LinearRing,
LineString,
MultiLineString,
MultiPoint,
MultiPolygon,
Point,
Polygon,
geos_version,
)
from shapely.errors import GeometryTypeError, Uns... |
f14e964176e1bf40ceca4beed4d0b17ac38f5c2c498b0e8ea14386cd7283e000 | Python | 64,084 | 1,425 | # -*- coding: utf-8 -*-
import glob, os, shutil, json, scipy, math
import nibabel as nib
import numpy as np
import pingouin as pg
import pandas as pd
# Time computation libraries
from joblib import Parallel, delayed
import time
from tqdm import tqdm
# Nilearn library
from nilearn.maskers import NiftiMasker
from nilea... |
694995b3cdb29fde98eff6b8308f0876869c07e176e1d7150a450536f6845cc3 | Python | 64,182 | 1,479 | #!/usr/bin/env python33
"""
Dentate Gyrus Circuit with Dendritic-Somatic Transfer Function
Integrates the biophysically realistic two-stage dendritic-somatic transfer
function into the main dentate gyrus circuit model.
"""
import math
import json
import torch
import torch.nn as nn
import torch.nn.functional as F
fro... |
27113346bf8cf3b01a646f181d05825ed4bc8ce8686a6c706359a31c33fa707c | Python | 64,280 | 1,706 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
"""
ProtocolUnits for Hybrid Topology methods using OpenMM and OpenMMTools in a
Perses-like manner.
Acknowledgements
----------------
These ProtocolUnits are based on, and leverage component... |
718bc79cf51a932c59dff3cca9e9889aab9ec415051d4ce2f988e185001b9dfd | Python | 64,529 | 1,858 | # -*- coding: utf-8 -*-
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://ete.cgenomics.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public ... |
869238c39abd6c9810a5bc80d1305b9bc8b4bf6e556f6c23058a467b97376625 | Python | 64,642 | 1,616 | """@package forcebalance.nifty Nifty functions, intended to be imported by any module within ForceBalance.
Table of Contents:
- I/O formatting
- Math: Variable manipulation, linear algebra, least squares polynomial fitting
- Pickle: Expand Python's own pickle to accommodate writing XML etree objects
- Commands for sub... |
be24c8a918ae9979928fc350eaf227f4eee2322cad5e52e82dde2b6079da525a | Python | 65,231 | 1,088 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 11:25:10 2015
@author: david
"""
import os
import sys
import time
import types
import datetime
import unittest
import subprocess
import shutil
import filecmp
import glob
import random
import csv
import argparse
import numpy as np
from itertools ... |
c069b3ac229503d47e5b540008aad4a3c16fa18bef88920c493672866fb25b33 | Python | 65,284 | 1,607 | import logging
import textwrap
from copy import copy, deepcopy
from pathlib import Path
from typing import Callable, Optional, Union
from kimmdy.constants import (
ATOM_ID_FIELDS,
ATOMTYPE_BONDORDER_FLAT,
FFFUNC,
REACTIVE_MOLECULEYPE,
RESNR_ID_FIELDS,
)
from kimmdy.parsing import TopologyDict, empt... |
fa1b73d2083c2bc6e7c0b9968b0e98c29d21f4cc79d327d4e1e39c06b6e6bd9f | Python | 65,304 | 1,774 | #!/usr/bin/env python3
import argparse
import sys
from pathlib import Path
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
from scipy.stats import friedmanchisquare, wilcoxon
CANCER = "BRCA"
METRIC_COL = "total_hit_same_any"
N_SAMPLED_MODELS = 50
XAI_DISPLAY_NAMES = {
... |
c8b5afc4f95caf4a68c3d83733630b6cd7a0375ca047818a995cefb62212d2ae | Python | 65,453 | 1,617 | """
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/... |
a0cfa6ff6dcc13f9dd6bab344859c2ad33383c0bfacb3ba256bf6c4e44474288 | Python | 65,593 | 1,615 | #!/usr/bin/env python3
"""
Enhanced Analysis and Visualization Tools for Optogenetic Optimization
Extends the baseline optimization analysis to support optogenetic stimulation
objectives, including rate increases, Gini coefficient changes, and population-
specific effects during PV and SST stimulation.
"""
import tor... |
79de92794d4d77496373c6ee4d6fc0f0954766202ef95f42885a237717bc390d | Python | 65,629 | 1,485 | """
MultiQC modules base class, contains helper functions
"""
import dataclasses
import fnmatch
import io
import itertools
import json
import logging
import mimetypes
import os
import re
import textwrap
from collections import defaultdict
from pathlib import Path
from typing import (
Any,
Callable,
Dict,
... |
bee693bf9c04630c12ac1a50a194da5dd3db7ce26d20b8a374d1879180dc8b16 | Python | 67,207 | 1,287 | # Copyright 2023 The HuggingFace Team. All rights reserved.
#
# 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 applicabl... |
128eec48da848c36dfd098f4818223fc262f282e520433524f89b4570c260d39 | Python | 67,321 | 1,557 | import os
# set environment variable to limit the number of threads for scikit-learn
os.environ["OMP_NUM_THREADS"] = "2"
os.environ["OPENBLAS_NUM_THREADS"] = "2"
os.environ["MKL_NUM_THREADS"] = "2"
os.environ["VECLIB_MAXIMUM_THREADS"] = "2"
os.environ["NUMEXPR_NUM_THREADS"] = "2"
import argparse
import json
import co... |
84313f4f95ee173e22c700cbf3ee1ff476694ea9f622be3417d0ec16657accac | Python | 67,610 | 1,469 | from collections import defaultdict
from functools import partial
import matplotlib.tri
import numpy as np
import json
from scipy.sparse import csgraph
import shapely
import shapely.geometry as shpgeo
from shapely.ops import unary_union
import tensorstore as ts
import time
from feabas.caching import CacheFIFO
from fea... |
c1e27a09caba5c8e7bcb8ad19be1482741923300ec8307caf66929027bd42657 | Python | 67,958 | 1,576 | import sys
import math
import pickle
from datetime import datetime
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from dataclasses import dataclass, field
from typing import Dict, Tuple, Optional, NamedTuple, List
import numpy as np
import matplotlib.pyplot as plt
from scipy... |
418e2eab7f51eac395b2f272b469a7eb047400c71ecb8d54ca26f142073841fd | Python | 68,132 | 1,262 | import os
import configparser
import datetime
import dateutil
import shutil
import traceback
from os.path import expanduser
import nibabel as nib
import SimpleITK as sitk
from copy import deepcopy
import time
import rtutils
import numpy as np
import json
import logging
from typing import Union, Any, Tuple, List, Dict
f... |
723037bc00b31a90077b727478f02c58a272484379e50c7b7aaa44806dd6b064 | Python | 68,413 | 1,829 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
"""OpenMM Equilibrium SepTop Protocol base classes
==================================================
Base classes for the equilibrium OpenMM SepTop free energy ProtocolUnits.
This mostly i... |
053f270c36b27d776c490b932820969ec49c85c9ad90218a338ecc37535f8a33 | Python | 68,610 | 1,822 |
# 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]
... |
f1928d00aef8e5e764ed606861785d3a2cb13ef2565d57bed6d42008eda922cc | Python | 68,616 | 1,822 |
# 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]
... |
e1d6204adbea1fb643ef392f292c9087a5c5bc5a7f0ba7301aa875c2d4da40b8 | Python | 68,648 | 1,057 | import os
# set environment variable to limit the number of threads for scikit-learn
os.environ["OMP_NUM_THREADS"] = "4"
os.environ["OPENBLAS_NUM_THREADS"] = "4"
os.environ["MKL_NUM_THREADS"] = "4"
os.environ["VECLIB_MAXIMUM_THREADS"] = "4"
os.environ["NUMEXPR_NUM_THREADS"] = "4"
import argparse
import json
import co... |
3b86a70816d95e8efbba7b6684250816799ccc0add83c37f6c8924756fe5e20f | Python | 69,110 | 1,855 | import warnings
from contextlib import nullcontext
from itertools import groupby
import torch
import torch.nn as nn
import torch.optim.lr_scheduler as lr_scheduler
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from tqdm import tqdm
from ptmelt.blocks import (
BayesianBlock,
DefaultO... |
fe78afc0e59266896fcaed1f0075435d2357246473d554e48b59e40cb0e45a23 | Python | 69,999 | 1,696 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import sys, os, subprocess
import re, glob, shlex, shutil, tempfile, gzip, warnings
import collections, itertools, copy
import random, string
from os import path
from datetime import datetime... |
c7989bbe18cbadb88358d77217b260c7c55feef1154e88a1832d34641eaa6d85 | Python | 70,401 | 1,478 | import numpy as np
import pandas as pd
import torch
import torch.optim as optim
from torch.nn.parameter import Parameter
from sklearn.metrics.pairwise import cosine_similarity
import pickle
class ParamsModel:
def __init__(self, model_name, **kwargs):
param = {'g': [100, 0]}
if model_name == 'RWW... |
cae8c2ed1fdfb9f481d82267b267c7d3635c35dbd20fef604a78b598d8a3849c | Python | 70,923 | 1,641 | """Semantic segmentation data generators."""
import os
import numpy as np
from skimage.transform import rescale, resize
from tensorflow.keras import backend as K
from tensorflow.keras.preprocessing.image import array_to_img
from tensorflow.keras.preprocessing.image import Iterator
from tensorflow.keras.preprocessin... |
1e96db7568631c4c9f93b6001a1ade96bdbe2cae6cdcce7c22388c5493e24f1d | Python | 71,000 | 1,841 | #! /usr/bin/env python
from __future__ import absolute_import, print_function, unicode_literals
import sys
# ------------------------------------------------------------------------------
def to_nary_string(arity):
return str(arity) + '-ary'
# ---------------------------------------------------------------------... |
ba7bc0d68e6f0cfdee75a49926993b405f82dc49e7cb982b826de445deb76762 | Python | 71,081 | 2,096 | # 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... |
bb8a7236c52bab5fd1ea6d9c90afbba00caeed7946d78bbd00cd6ae8266585a3 | Python | 71,264 | 1,624 | import math
import numpy as np
import torch
from torch.nn import (ModuleList, Linear, Conv1d, MaxPool1d, Embedding, ReLU,
Sequential, BatchNorm1d as BN)
import torch.nn.functional as F
from torch_geometric.nn import (GCNConv, SAGEConv, GINConv,
global_sort_pool, glo... |
c732567c3a71b30bc5baebf13cef4322f701e66ca952dba6e2d9903c2e218c89 | Python | 71,283 | 1,274 | import re
import sys
import gzip
import logging
import random
import string
from typing import *
from collections import defaultdict
from itertools import chain
from collections import OrderedDict
from collections import Counter
import velocyto as vcy
import h5py
import pysam
import numpy as np
import os
import sys
c... |
1cee6e2726e4d0c19dc144253eff2641440f9ae813dec4596a5be273e2389cb8 | Python | 71,527 | 1,648 | """
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import os
import shutil
from glob import glob
import cv2
import numpy as np
import pyqtgraph as pg
import torch
from matplotlib import cm
from qtpy import QtCore, QtGui
from qtpy.QtGui import QColor
from qtpy.QtWidget... |
9ab5c0abbbb9c4ed99e3f02b8e1c4167331619d545d31487549b89789af4095e | Python | 71,977 | 1,531 | ############################################################
###### LOOKING FOR AN EXAMPLE OF HOW MULTIQC WORKS? ######
############################################################
#### Stop! This is one of the most complicated modules. ####
#### Have a look at Kallisto for a simpler example. ####
###############... |
ab83c774ae7bd30fec251c32ffa3db0171e923357c1b55b5b09dcfbb7f37c470 | Python | 72,797 | 1,950 | import itertools
import math
import pickle
import subprocess
import sys
from concurrent.futures import ThreadPoolExecutor
import numpy as np
import pytest
from numpy.testing import assert_array_equal
import shapely
from shapely import LineString, MultiPoint, Point, STRtree, box, geos_version
from shapely.testing impo... |
80a0756b08d094ff12b4d1a24200042a8d7f3755da99d2893632c5e69e3aebfe | Python | 73,499 | 2,030 | """
:mod:`alchemiscale.interface.client` --- client for interacting with user-facing API
====================================================================================
"""
import asyncio
from typing import Any
from collections.abc import Iterable
from itertools import chain
from functools import lru_cache
from... |
3b4dd8ab48a234e5ff285af8ccfe20914a0766a71afd6b1d19553e41eca99abd | Python | 73,752 | 1,935 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 12/14/2021
Arrangement models class
Author: dzhi, jdiedrichsen
"""
import numpy as np
import torch as pt
from torch import exp,log
from HierarchBayesParcel.model import Model
import pandas as pd
import warnings
class ArrangementModel(Model):
""" Abstra... |
2c8382b7efb8895a13de2d4e09821de099ebb868395627cf6aebde2239c29e7b | Python | 74,467 | 1,555 | from datetime import datetime
from pathlib import Path
import numpy as np
import pandas as pd
# flake8: noqa: E501
def hand_grip_strength(
dominant_hand,
left_meas1,
left_meas2,
left_meas3,
right_meas1,
right_meas2,
right_meas3,
mean_max="mean",
):
if mean_max == "mean":
... |
9137f213908d8cd3ee7b23471dce31150b9875cfc5d7443f37386dc2bdf0edf5 | Python | 74,651 | 1,430 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2014 David Emms
#
# This program (OrthoFinder) is distributed under the terms of the GNU General Public License v3
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... |
d8c0072d6c662122bfc0f3d1f390c48e9cc5f94fc9d7c4d86bc0683743ad22ab | Python | 75,705 | 1,620 | """
Enhanced WMH Segmentation with U-Net - Journal Paper Implementation
Three-class segmentation: Background vs Normal WMH vs Abnormal WMH
Professional results saving and visualization for publication
This relates to our article:
"Incorporating Normal Periventricular Changes for Enhanced Pathological
White Matter Hype... |
93668db21979fdacf2d2f4ce88f56903c68bc4c89cdedfb087b31ab4a7234bb3 | Python | 75,744 | 1,621 | """
Enhanced WMH Segmentation with U-Net - Journal Paper Implementation
Three-class segmentation: Background vs Normal WMH vs Abnormal WMH
Professional results saving and visualization for publication
This relates to our article:
"Incorporating Normal Periventricular Changes for Enhanced Pathological
White Matter Hype... |
daec3b7c3eb2381e258547ecf6b71ec648f7fd614468e5c024f035a1c463e94c | Python | 76,345 | 1,535 | # Copyright 2023 The HuggingFace Team. All rights reserved.
#
# 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 applicabl... |
9de93f90a1671f060c2cf402c0d20c68031eb8367ef7b0b9b561b963b52b8c5f | Python | 76,631 | 1,806 | '''"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
This module gathers coverage metrics data and prepares it for the output report.
It relies on the following official sources:
https://support.illumina.com/content/dam/illumina-support/help/Illumina_DRAGEN_Bio_IT_Platform_v3_7_1000000141465... |
d389a0036b0d4e78aeb65d9fc45bfe7a2e5b9ece2245a3f15575c787f1eb57fe | Python | 77,040 | 1,735 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import unichr as chr
from collections import deque, OrderedDict
from sys import version_info
from .constants import spaceCharacters
from .constants import entities
from .constants import asciiLetters, asciiUpper2Lower
from .const... |
e6cbcbeeff3aeffdb9cdda8eb37e1efded79799e4389d21d580ab852109dbe08 | Python | 77,454 | 1,592 | """ @package forcebalance.forcefield
Force field module.
In ForceBalance a 'force field' is built from a set of files containing
physical parameters. These files can be anything that enter into any
computation - our original program was quite dependent on the GROMACS
force field format, but this program is set up to... |
bbba6d101d164105ae27893a615fceee42acbb90e63ffe2d3f8f8776c3e140d2 | Python | 77,515 | 1,574 | ##############################################################################
# Medical Image Registration ToolKit (MIRTK)
#
# Copyright 2017 Imperial College London
# Copyright 2017 Andreas Schuh
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... |
2b7cc5f7110f65ac89c62a35cebe718937c0308806a5272a6960c2bba8673e1c | Python | 77,808 | 1,929 | #!/usr/bin/env python
"""
COPYRIGHT AND LICENSE
@author John D. Chodera <jchodera@gmail.com>
All code in this repository is released under the MIT License.
This program is free software: you can redistribute it and/or modify it under
the terms of the MIT License.
This program is distributed in the hope that it wi... |
17c8fdeab5d7a0e78ffd0dc3206ab1a5e90bc8ab796b603a974df0bedf63a1e3 | Python | 77,871 | 1,920 | #!/usr/bin/env python
"""
COPYRIGHT AND LICENSE
@author John D. Chodera <jchodera@gmail.com>
All code in this repository is released under the MIT License.
This program is free software: you can redistribute it and/or modify it under
the terms of the MIT License.
This program is distributed in the hope that it wi... |
b3b782ebc59bfb67659e7959d3836f072141e347836a0111ebefc6a7cdea75cf | Python | 78,298 | 2,169 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import copy
import logging
import numpy as np
import pytest
from gufe import SmallMoleculeComponent, SolventComponent
from numpy.testing import assert_allclose, assert_equal
from openff.int... |
089bc9d2472a56a5242619ad4d364c655db7fac2324abf9f5b1e8c95e385ed9a | Python | 78,463 | 1,591 | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 1 09:11:11 2017
@author: david
Perform directed 'reconciliation' first and then apply EggNOG method
1 - root gene trees on outgroup: unique one this time
2 - infer orthologues
"""
import os
import sys
import csv
import glob
import argparse
import operator
import iterto... |
bb34783214acd6ab413fe06fe349c2dff1d56c8f9b4f7e9ee5d369ca0dcf9874 | Python | 78,570 | 2,175 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import copy
import logging
import numpy as np
import pytest
from gufe import SmallMoleculeComponent, SolventComponent
from numpy.testing import assert_allclose, assert_equal
from openff.int... |
078b98dda5b5a2131b8b40ac189bf1d215923299aff033ea9ac009d7f8b1912a | Python | 79,784 | 1,846 | """
=====================
WhoBPyt Model Classes
=====================
For each model 'M', two classes are defined:
- `M_Params` - Parameters class. Parameters to be fit should be overwritten after initialization as PyTorch parameters.
- `M_Layer` - Model implementation. Includes in particular a `forward()` method ... |
7d6fa1dd5e6ba555cce943391c1362bf29414fd4ec6e73c4113468c0dea99c6e | Python | 80,008 | 1,732 | """
twinc_data.py
Author: Anupama Jha <anupamaj@uw.edu>
In this script, we generate labels for
trans-contacts
"""
import gzip
import hicstraw
import numpy as np
import _pickle as pickle
class TransContacts():
def __init__(self,
chromA,
chromB,
chromA_len,
... |
cb684a5b9e5bff1dbd8a90da8cc54e5612ce713e1ac552f72753104f56a36072 | Python | 81,586 | 2,008 | #!/usr/bin/env python3
"""
Connection Parameter Optimization Framework
Uses PyTorch optimization or global optimization to find
connection_modulation parameters that achieve target firing rates for
given input conditions.
Automatically selects evaluation strategy based on device:
- GPU -> Batched parallel evaluation... |
251ca7c99571870d40ac58c46909521044ef1569c1aab8aef934699ff61bea0a | Python | 82,158 | 1,621 | import os
import numpy as np
import pandas as pd
import seaborn as sns
import torch
from tqdm import tqdm
import matplotlib.pyplot as plt
from matplotlib.legend_handler import HandlerTuple
from matplotlib.patches import PathPatch
from matplotlib.colors import to_rgb
import CloMu
from sklearn.preprocessing import Standa... |
a7c00ba32bce16c5b45273388a41b01f0201be7e88fdd7f2b66e61542e2cefd8 | Python | 82,263 | 1,637 | from collections import defaultdict, OrderedDict
from functools import partial
import hashlib
import itertools
import json
import numpy as np
import os
from scipy.ndimage import distance_transform_cdt
from scipy import sparse
import scipy.sparse.csgraph as csgraph
import shapely
import yaml
import time
f... |
498f6eac9e6f9cb9df0ef5bf2c17b3c78511ca6a18695976aa3db2f2f340afef | Python | 82,479 | 1,862 | import os
import torch
from torch_geometric.nn import GCNConv
from torch_geometric.nn import global_mean_pool
import torch.nn.functional as F
import numpy as np
import optuna
import seaborn as sns
import matplotlib.pyplot as plt
import utils as Utils
from torch_geometric.loader import DataLoader as GeoDataLoader
from t... |
4369cec9bb42d19d022153803ba300bf440f8f1e6d8a225c27f852108ef94d85 | Python | 82,491 | 1,582 | """ @package forcebalance.optimizer Optimization algorithms.
My current implementation is to have a single optimizer class with several methods
contained inside.
@author Lee-Ping Wang
@date 12/2011
"""
from __future__ import division
from __future__ import print_function
import shutil
from builtins import str
from ... |
39e0dc9bb18cff713da00c65b5bd54b2468f4b5a24978ebafec07a006950e1d5 | Python | 82,804 | 1,816 |
import argparse
import time
import os, sys
import os.path as osp
import shutil
import copy as cp
from tqdm import tqdm
from functools import partial
import psutil
import pdb
import numpy as np
from sklearn.metrics import roc_auc_score, confusion_matrix, accuracy_score, precision_score, recall_score, f1_score
import ... |
da371ccf4f2172efd2ee98dc2618522c35a71f091460cefeb86a86a92560c2ae | Python | 83,073 | 2,260 | """
:mod:`alchemiscale.interface.client` --- client for interacting with user-facing API
====================================================================================
"""
from __future__ import annotations
import asyncio
import json
from enum import StrEnum
from typing import Any, Literal
from collections.abc... |
2e5fb2ccb53f8dc8f2008fe1e7bce4a99eda416139b79c40e32fe3420a14521c | Python | 83,464 | 2,946 | from __future__ import absolute_import, division, unicode_literals
import string
EOF = None
E = {
"null-character":
"Null character in input stream, replaced with U+FFFD.",
"invalid-codepoint":
"Invalid codepoint in stream.",
"incorrectly-placed-solidus":
"Solidus (/) incorrectly ... |
36a2642451b835fbc199d85ea42157db9e6f17430ab6e5c5c446d58520828e47 | Python | 83,544 | 2,272 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import copy
from math import sqrt
import numpy as np
from numpy.testing import assert_allclose
import gufe
import json
import xml.etree.ElementTree as ET
from importlib import resources
from ... |
4477aad45fe07e320cb9354c9527cddf7a04cd5924dc7c7cc01812a2d7f217ee | Python | 83,607 | 2,205 |
# Version: 0.28
"""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 (Unlicense)
* Compatible with: Python 3.7, 3.8, 3.9, 3.10 and pypy3
* [![Latest... |
b7a7910e324badb2781b0097df65f80f5d08fbf9c11a4fe461682d585f61750c | Python | 83,609 | 1,851 | """
Nested Weights Analysis Framework
Extends the single-connectivity weight analysis to properly handle hierarchical
structure of nested experiments (connectivity instances x MEC patterns).
Key principles:
- Classify cells within each connectivity instance (averaged across MEC patterns)
- Extract weights for excited... |
f7795f663610f5fbbdaa640a24112e48932e899f95b75e4d6cabb1139c5b3692 | Python | 84,474 | 2,149 | """
Written by: Pete, 2023, (peterlionelnewman @ github)
Helpful for students
1. GUI interface to:
2. search a folder for .czi files
3. export mips of various kinds for each czi channel
4. morphometrics about the images
Go check out the Allen Institue of Cell Science package !!!
This exists to help students with mip ge... |
59eeca0df21805694559d3c1a14c7b223f3b077850e45015bcaa965500d34ef2 | Python | 84,529 | 1,971 | ##############################################################################
# pymbar: A Python Library for MBAR
#
# Copyright 2017-2022 University of Colorado Boulder
# Copyright 2010-2017 Memorial Sloan-Kettering Cancer Center
# Portions of this software are Copyright (c) 2010-2016 University of Virginia
# Portions... |
6787b2199563adcb958af0110cceddf7eb1dc838d1279cb2ca7da5c813b3b106 | Python | 84,755 | 1,680 | # -*- coding: utf-8 -*-
import os, glob, shutil, re
import json
import pandas as pd
import numpy as np
import nibabel as nib
import fnmatch
import matlab.engine
from joblib import Parallel, delayed
import brsc_utils
#plotting:
import matplotlib
import matplotlib.pyplot as plt
from nilearn import image
class Prepr... |
d77069534616d1434963e9353925423e3ec49c26747a9e5f6424b4b8ab99d266 | Python | 85,308 | 2,290 | """
Easy Install
------------
A tool for doing automatic download/extract/build of distutils-based Python
packages. For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.
__ https://setuptools.readthedocs.io/en/latest/easy_install.html
"""
from glob import gl... |
948ca422d7faabcc93047ce9c6c83288b89e194bb8992a863c0736cde98bcca8 | Python | 85,726 | 2,061 | # Create TaskFile file for different tasks
# March 2021: First version: Ladan Shahshahani - Maedbh King - Suzanne Witt,
# Revised 2023: Bassel Arafat, Jorn Diedrichsen, Ince Husain
import pandas as pd
import numpy as np
import random
import MultiTaskBattery.utils as ut
import itertools
def shuffle_rows(dataframe, k... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.