sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
b26bd84c9686f7d0cb74aee751c2d9a822ee2719f3baa4140e60dfba31a5dea8 | Python | 11,005 | 334 | # Copyright 2015 Google Inc. 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 applicable law or a... |
1512e2d4c78703e9b1c8a6e095ed2834f593a312af9ec244f338902adda33080 | Python | 11,014 | 330 | # Authors: Christian O'Reilly <christian.oreilly@sc.edu>
# Scott Huberty <seh33@uw.edu>
# James Desjardins <jim.a.desjardins@gmail.com>
# Tyler Collins <collins.tyler.k@gmail.com>
#
# License: MIT
"""Classes to store information on artifactual channels, epochs, components."""
import numpy a... |
a11fbdc006df3ce28aae99317df03dc9674e83d2494231412039d1df6d9b076d | Python | 11,015 | 300 | """Utilities for manipulating colors.
BNF
---
.. highlight:: none
.. literalinclude:: ../../doc/bnf/colors.bnf
"""
from __future__ import annotations
import pathlib
import numpy as np
import matplotlib as mpl
import matplotlib.colors as mplcolors
import matplotlib.font_manager
import matplotlib.pyplot as plt
from ... |
f650ae83800d7fb647a8c777c7a59f8b652278767f547a735755b63333aecd5b | Python | 11,015 | 261 | import os
import sys
import joblib
from pathlib import Path
os.environ['WANDB_DIR'] = 'ADD YOUR DIRECTORY'
import math
import wandb
import numpy as np
import torch
from Images.utils import load_HVM8data
from baseModels.utils import get_model, load_transforms
from analysis.metrics import dPrime_model
import torchvision
... |
2997722adde007105d5215df9a1ac6303876ba65e52fd918ba4ba0fab2fb5572 | Python | 11,021 | 308 | # -*- coding: utf-8 -*-
# Copyright 2015 Google Inc. 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 require... |
b7791cb38fef71fe2cb5d8b66b7986daf2775499a2dd59d4bd2c7b642391244e | Python | 11,022 | 298 | """Export models with a config.toml that can be loaded by dorado."""
import collections
import os
import shutil
import zipfile
import toml
import torch
import medaka.common
import medaka.models
# Specifications of dorado model configuration files
# see dorado/dorado/secondary/architectures/model_config_spec.md
cla... |
eb8b81136e147e88c3755b34f49afc3ae5406efa24459d9a7d75376f729d71a2 | Python | 11,024 | 369 | from __future__ import annotations
import concurrent.futures
import shutil
import traceback
from pathlib import Path
from typing import TYPE_CHECKING
from typing import TypeVar
import pytest
from packaging.tags import Tag
from poetry.core.packages.utils.link import Link
from poetry.utils.cache import ArtifactCache... |
b1fb6995ae28d28fc0d54ac8aafd721cb1719804ab91f38c97bd163aa4d1cf4a | Python | 11,029 | 224 | import matplotlib.pyplot as plt
import matplotlib.tri as tri
from matplotlib import cm
import torch
import numpy as np
import copy
from pathlib import Path
from compute_energy import gradients, stress, compute_energy
from utils import parse_mesh
def plot_mesh(mesh_file, figdir):
X, Y, T, _ = parse_mesh(filename... |
bd1d87b663a2b6cfb3a53216b8ba963cef2775e47f0d51bc4d5a4ba8460aea4b | Python | 11,031 | 224 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
import torch.nn.functional as F
from fairseq import utils
from fairseq.criterions import FairseqCriterion, register_c... |
e11dadf59355728eb12f2feecfe6d083a66e5fdbe13bc8a7e7aa433e8c6aca2b | Python | 11,035 | 329 | """Shared plotting helpers used across the analysis notebooks."""
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
# 1 cm expressed in normalized (0-1) dish coordinates (15 cm dish).
one_cm_converted = 1 / 15
def calculate_significance_for_ANOVA_plot(
df, locs, means, stds, gts, step=0... |
40fca1948cb2b801df98304f4f6a542644de6d2fa066f510302104fd571fa66c | Python | 11,036 | 241 | import argparse
import numpy as np
import bigstream.io_utility as io_utility
from dask.distributed import (Client, LocalCluster)
from bigstream.configure_bigstream import (configure_logging)
from bigstream.configure_dask import (ConfigureWorkerPlugin,
load_dask_config)
from bigst... |
6c027d0e4df1ab0abf26a8776545e9f58120e392060b0b436c58bdb8bfa37c8b | Python | 11,046 | 261 | from __future__ import annotations
import json
from collections.abc import Callable
from pathlib import Path
from PySide6.QtCore import QPoint, Qt
from PySide6.QtGui import QHideEvent
from PySide6.QtWidgets import (
QComboBox,
QFrame,
QGridLayout,
QLabel,
QPushButton,
QSizePolicy,
QToolBut... |
d5325c4991ff2d337a70cb07508c1b1fb01d89e85db4b9f1df6fd170ec6b6054 | Python | 11,046 | 259 | import os
# os.environ["NCCL_DEBUG"] = "INFO"
os.environ["OMP_NUM_THREADS"] = "12" # export OMP_NUM_THREADS=4
os.environ["OPENBLAS_NUM_THREADS"] = "12" # export OPENBLAS_NUM_THREADS=4
os.environ["MKL_NUM_THREADS"] = "12" # export MKL_NUM_THREADS=6
os.environ["VECLIB_MAXIMUM_THREADS"] = "12" # export VECLIB_MAXIMUM... |
ce084acae18a3c1d7b4005e7f6989d6a192250dfc5f4b4cbb39a61cf4b8fd1b3 | Python | 11,053 | 284 | import torch
from torch import nn
class DeformConv2d(nn.Module):
def __init__(self, inc, outc, kernel_size=3, padding=1, stride=1, bias=None, modulation=True):
"""
Args:
modulation (bool, optional): If True, Modulated Defomable Convolution (Deformable ConvNets v2).
"""
s... |
c3d3ee1a1653c80700a7f92d59b03daccc76e9d2977bb6ca3aec4f347e6d0982 | Python | 11,056 | 246 | import pygam
import numpy as np
import statsmodels.api as sm
import sklmer
from pprint import pprint
from scipy import stats
from sklearn import linear_model
from sklmer import LmerRegressor
from statsmodels.stats.diagnostic import het_breuschpagan
from functools import partial
########################################... |
f74d4cc3c9a1f333e551fe5213dd9e8c7eead43ed1e672270a6153f470188eb0 | Python | 11,059 | 260 | """End-to-end comparison of selection methods on the OCE pipeline.
For each method:
1. Fit on the training design matrix (with 1+2+3 figures).
2. Predict on the test design matrix (re-projected onto train feature keys).
3. Report: n_features, CV-RMSE on train, RMSE/MAE on test, Spearman ρ,
Kendall τ... |
ee7487865759c15a0bc180ad3e86ca43f94e4cd57ead3de01378275b38229738 | Python | 11,061 | 294 | from __future__ import annotations
import logging
from typing import TYPE_CHECKING
import numpy as np
import pandas as pd
import torch
from lightning.pytorch.callbacks import Callback
from scvi import REGISTRY_KEYS
from scvi.data import AnnDataManager
from scvi.data.fields import (
CategoricalJointObsField,
... |
1d3bfd72247f7ba3baf2cf35661d82e768dc4e3fd5c746d674a48cd913c4c6c5 | Python | 11,066 | 275 | """Read raw fluorescence recordings stored in OFRS_RWD files."""
from __future__ import annotations
import math
import struct
from pathlib import Path
from typing import Any
import msgpack
import pandas as pd
_MAGIC = b"OFRS_RWD"
_BLOCK_EXT_CODE = 98
_CHANNEL_INDICES = (4, 5, 6)
_MAX_BLOCK_SIZE = 64 * 1024 * 1024
... |
3c0aea0fcae6a9697a3d15acf74de085dd4a60a54383933d4b160a93ac9b0670 | Python | 11,067 | 254 | #!/usr/bin/env python3
"""Create the data files that will be used to train the model.
This program reads in a genome file, a list of regions in bed format, and a set
of bigwig files containing profiles that the model will use to train. It
generates an hdf5-format file that is used during training. If you want to
train... |
13b810e5cdf246cb4a8ab7b47baa7699f21c344993e7e3c321c479d38bf7b85b | Python | 11,074 | 423 |
import os
import argparse
import sys
import torch.optim as optim
import torch
import pandas as pd
import yaml
import ast
####if __name__ == "__main__":
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(project_root)
# Simulate command line arguments in Spyder
s... |
21a16a1f347c2cad83beea3600ab40d211041dacc0f6f3247bfbaa6ff57d5bd0 | Python | 11,080 | 294 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import logging
import os
from pathlib import Path
import shutil
from itertools import groupby
from temp... |
be72f8f978474b7617938945939d2ac411cad0470e4788a500890b8396a5e4f2 | Python | 11,092 | 323 | from __future__ import annotations
import contextlib
import os
import sys
from functools import cached_property
from pathlib import Path
from typing import TYPE_CHECKING
from typing import NamedTuple
from typing import cast
from typing import overload
import findpython
import packaging.version
from cleo.io.null_io ... |
d6e56b0ebae499b29e99bd42c23dfb30ae38810b106ea0061d0f8f4353921d9a | Python | 11,094 | 368 | """
This script performs swap opt on the candidate features for the functional models.
Example usage:
python functional_swap.py --generate_features 1 --data_stem "testing_random_subset_random_positions" --date "01-01-2023" --layer "random_pos" --dataset_name "sine_gratings" --neighborhood_width 4.545454 --base "18... |
017e0f3ca34f4e9e47766d03a778d846488a4b2b7503ccd10c9386a46dea6c71 | Python | 11,102 | 381 | import subprocess
import pytest
import os
import shutil
import tempfile
import re
# Base configuration
config = '''
cpu_resources:
runtime: "2h"
mem_mb: 16000
gpu_resources:
runtime: "4h"
mem_mb: 50000
gpus: 1
slurm_partition: "kerngpu,gpu"
slurm_extra: "--gres=gpu:1 --constraint=a100"
random_seed: 1
c... |
0f5ac98414edc0c83e713f9807ff8ca44dd5ec805227c127b66d0c15987601db | Python | 11,108 | 334 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from collections import OrderedDict, defaultdict
import json
import os
import logging
from argparse import ArgumentError
from fairseq import... |
0e209d3a7687b3b4190becf6280aeedee72a75703ac45fd56bd798d488d4fbfc | Python | 11,110 | 261 | """Phase 1 full: site-percolation honeycomb at p_c, L ∈ {4, 6, 8, 12, 16}.
This is the production version of pipelines/phase1_smoke.py. It samples
more realisations, fits the OCE J_F coefficients with a parent-stratified
holdout (different L's on each side), saves matplotlib plots, and reports
the power-law exponent ... |
dd69438f2dfc8d18222e1c655c651b03ee5c1f379074b01c2ead48532f28adc2 | Python | 11,120 | 266 | import logging
import numpy as np
import pandas as pd
import torch
from anndata import AnnData
from scipy.sparse import csr_matrix, lil_matrix
from torch.utils.data import Dataset
from torch_geometric.data import Data
from torch_geometric.utils.convert import from_scipy_sparse_matrix
from .. import settings, utils
fr... |
bcc1904951db73afa49820f17a58c1ee86c0f433a2b808ecdc8899cdb54ce263 | Python | 11,134 | 369 | from __future__ import annotations
from collections.abc import Mapping
from typing import TypedDict, cast
import numpy as np
import pandas as pd
from numpy.typing import NDArray
from scipy.signal import find_peaks
from .df_common import analysis_option_from_frame
# --------------------------------------------------... |
8b3008dcf7abd241bd83844caca474e5d754bac3894fdbe45ba8194f413da1c5 | Python | 11,137 | 233 | import unittest
from unittest.mock import patch
import simplejson as json
from pyecharts import options as opts
from pyecharts.charts import Map
from pyecharts.faker import Faker
class TestMapChart(unittest.TestCase):
@patch("pyecharts.render.engine.write_utf8_html_file")
def test_map_base(self, fake_writer... |
d2d6eabadf2ce90d42eeefb533c5b36ba6fcd1a1c85ae7502f51e1dabfa2c4ee | Python | 11,149 | 311 | # coding=utf-8
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
#
# 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
#
# ... |
abd4dccda69a568790cf9fe6609e91fde573cff8f9edd4f8a08743f4d69bf04f | Python | 11,154 | 306 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from fairseq import utils
from fairseq.models import (
FairseqLanguageModel,
register_model,
register_model_architecture,
)
from f... |
eb0c0d4380c23122a20bd64b102e67104c5cddc452d43ec66c8a7acaff015908 | Python | 11,154 | 301 | """Abstaining a class head's document-level negative where the text
mentions the type anyway, without BRENDA linking it.
A real ``BrendaClassificationModel`` over the tiny injected BERT
(``patch_base_model``) and a hand-written token-label store — the model's
four classes are built in `BRENDA_SCHEMA`'s own declaration... |
24f2e958de25d78636d9be381e286932ed549760c2ee301447581e529f47a932 | Python | 11,158 | 290 | import os, sys
import glob, itertools
import pandas as pd
WORKDIR_ROOT = os.environ.get('WORKDIR_ROOT', None)
if WORKDIR_ROOT is None or not WORKDIR_ROOT.strip():
print('please specify your working directory root in OS environment variable WORKDIR_ROOT. Exitting..."')
sys.exit(-1)
def load_langs(path):
... |
1bf4979d5c048c7e5be90527a18914d0c84792a106804f03c0ad5e3b4deae35a | Python | 11,160 | 336 | # Copyright (C) 2025 ETH Zurich, Moritz Thürlemann, and other AMP contributors
import torch
import numpy as np
import torch.nn as nn
from torch import Tensor
from typing import Optional
import time
import yaml
from datastructures_calibration import Graph
def ff_module(
node_size,
num_layers,
input_size,
... |
960be449be89746b624f8a19759b4ab817cbf0e3072c81c9ed2cfc2c2b87288d | Python | 11,164 | 318 | import argparse
import enum
import os
import sys
import time
import Bio
import Bio.PDB
# import Bio.PDB.Vector
import numpy as np
import simtk
import simtk.openmm
import simtk.openmm.app
import simtk.unit
basepath = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(1, basepath)
import grid
def extract_ato... |
ce5d7fa6a614c8ef68eae4e23c097870576b26e322c5e5fdc777b8bdeffb8802 | Python | 11,164 | 303 | import logging
import os
import sys
from concurrent.futures import ThreadPoolExecutor
from typing import Any, List, Tuple
import numpy as np
import scipy.sparse as sparse
from numba import jit
from scipy.special import digamma, gammaln
from sklearn.model_selection import train_test_split
from tqdm import trange
from .... |
838fb5f154536777eb621346c8c7d5ac00fd5387f3a912def9d1833b51125f57 | Python | 11,165 | 314 | from __future__ import annotations
import hashlib
import json
import logging
import shutil
import sys
from functools import cached_property
from importlib import metadata
from pathlib import Path
from site import addsitedir
from typing import TYPE_CHECKING
import tomlkit
from poetry.core.packages.project_package im... |
4656ce38952bf220ff03506e3a2427fca7d9605de3645960ca12a29091d7ea05 | Python | 11,171 | 262 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import logging
from pathlib import Path
import shutil
from tempfile import NamedTemporaryFile
from collections import Counter,... |
c4919134c0869e0ecd16c6c4aa850436148ea7b53eb2462eb5b40b591fb76a2b | Python | 11,176 | 336 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
from dataclasses import dataclass, field
import numpy as np
from omegaconf import II, MISSING, OmegaConf
from fairs... |
148f33021b9e488148d7688901ec13613418ec1ceb39a3dbffa09c08a93c804c | Python | 11,179 | 340 | from lifelines.utils import concordance_index
import numpy as np
from sklearn.model_selection import StratifiedKFold
from sklearn.preprocessing import StandardScaler
from keras.models import Sequential
from keras.layers import Dense
from keras.regularizers import l1, l2
#from keras.optimizers import adam_v2, gradient_d... |
aedda4862459b93d0e125cfbdc6977a1de8fcc2cc773d83beb30876f67d1c212 | Python | 11,179 | 316 | """Implementation of the dynamics of RDD layers."""
import numpy as np
import numpy.typing as npt
from symmnet import (
RDD_eta,
RDD_init_window,
RDD_window,
alpha,
dt,
g_D,
g_L,
mem,
refractory_time,
spike_threshold,
tau_L,
tau_s,
u_window,
v_reset,
)
def kap... |
dfcfafa835b0902172587d5f0c3f90202d215d0e2923eb45529dc032491ff4ea | Python | 11,188 | 314 | # coding=utf-8
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
#
# 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
#
# ... |
ec8080e88ad34c06117a1668cd9a0409a34b1c7d1d13ae06865e333c320bc354 | Python | 11,189 | 265 | """
color_model.py — Actin filament orientation binning for ED Fig 10e
==================================================================
Single-file version. Takes one IMOD model in `.txt` format (already converted
from `.mod` via the IMOD command `model2point`), sorts each filament into one
of N angular bins relativ... |
fdb615a2466c6a3e51e453ae609603027d154118e49198de1740181e70cf15d2 | Python | 11,191 | 311 | # %%
# imports
# autoreload
# %load_ext autoreload
# %autoreload 2
import torch
import torch.nn as nn
from torch import Tensor
from dataset import SzDatasetRegs
import math
from dataset import SzDatasetRegs
from einops import rearrange, repeat
from torch.utils.data import DataLoader
from model_config import MODEL_CONF... |
9e24d02c3fd42809fd627ea6e53aacfc67a5d60356d2448bee358b4c47df264d | Python | 11,220 | 280 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
from dataclasses import dataclass, field
from typing import Optional
from fairseq import utils
from fairseq.dataclass import C... |
ad446ad4498af0e0c17b538566f08b5dd2070b461926d29a696bb5faac71f8c2 | Python | 11,221 | 256 | import torch
import copy
import torch.nn.functional as F
from torch.utils.data import DataLoader
import tqdm.notebook as tq
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from .model import CPSModel
from .utils_metrics import *
import os
import json
class CPSTrainer:
def __init__(self, a... |
9be30d1493986b617842420ec1aa53b186a42e7fd3a06c378f54ef2f5388648a | Python | 11,222 | 271 | from __future__ import annotations
import numbers
from collections.abc import Hashable, Iterable
from itertools import chain
from typing import Any
import numpy as np
import pandas as pd
from joblib import Parallel, delayed
from numpy.typing import ArrayLike
from pgmpy.base import DAG
from pgmpy.factors.discrete imp... |
347b78184fad7c7e2553f2890532330499e2e1f7cf8c1d9ce92cfbf86034493e | Python | 11,225 | 317 | from __future__ import annotations
import csv
import hashlib
import json
import os
import shutil
from base64 import urlsafe_b64encode
from pathlib import Path
from typing import TYPE_CHECKING
from poetry.core.masonry.builders.builder import Builder
from poetry.core.masonry.builders.sdist import SdistBuilder
from poe... |
16b6c943df40c67b00dec6d3195625012858a6bd0b1af9ce852c0f03a6107677 | Python | 11,227 | 288 | # code adapted from
# https://nipype.readthedocs.io/en/latest/users/examples/fmri_fsl.html
#
# This is supposed to simulate a FEAT run, but it doesn't actually use
# FEAT, it uses direct calls to all the constituent functions FEAT otherwise
# calls. Constructing this requires careful comparison with feat output
# logs ... |
c286cc3ac65867628e8bb013e490e3f8fb266b903a34d5a84037a57ef4246dea | Python | 11,234 | 269 | """
This module contains helper functions for the ´analysis´ subpackage.
"""
import scipy.sparse as sp
from sklearn.preprocessing import normalize
import numpy as np
import pandas as pd
import scanpy as sc
import anndata
from anndata import AnnData
## identify marker genes for each niche
## This is b... |
a563accff026bf7a87ed4ec788163ddaa7873bf4766b7b8f379ae692cd131097 | Python | 11,235 | 187 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'generate_roi_mask_tab.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_GenerateROIMaskTabContent(object):
def setupUi(self, ... |
c4291cadfbee96fa4a6f0557cf71a031c1b301d6df165a2ebdb8c81f5ddf90b1 | Python | 11,240 | 209 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ScheduleUI/beastScheduleUI.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtWidgets
class Ui_Form(object):
def setupUi(self, Form: QtWidgets.QWidget... |
d20ac512fe89f8842a5d8ba9e53129e4510a916fb2bd93e40a508345da9070ee | Python | 11,245 | 278 | from matplotlib import gridspec
import collections
import itertools
from os import makedirs
from os.path import join, exists
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import gridspec
from matplotlib import pyplot as plt, ticker
from mpl_toolkits.axes_grid1 import make_axes_locatable
... |
bccac07867f87b2f790005f5d827d0c026f8cb53ee3c70ff70ec670deb23219f | Python | 11,255 | 388 | from collections import namedtuple
from typing import Any, Dict, Generic, Mapping, Sequence, Tuple, TypeAlias, TypeVar
import jax
import jax.numpy as jnp
import jax_dataclasses as jdc
import numpy as np
from jax.nn import softmax
from typing_extensions import Self
Psi = namedtuple("Psi", "sign log")
Stats: TypeAlias ... |
aa3618aecb144874aaf39f9265d18b82f39133106b457bb4782f941e795b21e5 | Python | 11,257 | 227 | # coding=utf-8
import os
import sys
sys.path.append("..")
sys.path.append("../utils")
import numpy as np
import cv2
import random
import glob
import torch
from torch.utils.data import Dataset
import config.cfg_lodet as cfg
import dataload.augmentations as DataAug
import utils.utils_basic as tools
class Fs_Construct_... |
ca13b27d92dfdee49e3deef86f3cb7f1000354067fd42a5bca456f3173168344 | Python | 11,257 | 275 | '''
By K. Butenko
Runs OSS-DBS to compute 'VTRs' for sEEG
'''
import pandas as pd
import numpy as np
import sys
import os
import json
import subprocess
import re
from run_OSS4SEEG_Stim_no_shift import check_electrode_availability, get_geom_definitions, extract_index
from ossdbs.electrodes.defaults import defa... |
d79409e7af55239fb4c08e746f1e2ab0cca46e737d3ee959cb619fd02756d285 | Python | 11,259 | 252 | import SimpleITK
import time
from typing import Dict, List, Optional, Set, Tuple, Union
from moosez import system
from moosez import models
from moosez import constants
from moosez import image_processing
from moosez import predict
from moosez.benchmarking.benchmark import PerformanceObserver
# ---------------------... |
4c74caa2b82dcbdf96365423f2656c2c432672b6593167772e56f9177f01f158 | Python | 11,264 | 276 | import pandas as pd
from tqdm import tqdm
import os
import pickle
import numpy as np
import json
import torch_geometric
import torch
from .encode_structure import get_graph, add_edge_data
def process_graph(data_table,data_dir, struct_src='init', debug=False):
if debug:
df = pd.read_csv(data_table,... |
147c48c1600cd70417d694dd2c367c53b43d016ce1898d9feebe98b1db1134d5 | Python | 11,270 | 258 | from mot.lib.cl_function import SimpleCLFunction
from mot.lib.kernel_data import Array, Struct, LocalMemory
from mot.optimize.base import SimpleConstraintFunction
__author__ = 'Robbert Harms'
__date__ = '2017-05-29'
__maintainer__ = 'Robbert Harms'
__email__ = 'robbert@xkls.nl'
__licence__ = 'LGPL v3'
class Paramete... |
d63e1f5de195a8a5f224c4d4f75e1049b86299711a208813711d4eb4ba607b3b | Python | 11,275 | 277 | import matplotlib.pyplot as plt
import glob, os
from pathlib import Path
import pathlib
import numpy as np
from matplotlib.lines import Line2D
import matplotlib.patches as mpatches
# from scipy.interpolate import make_interp_spline, BSpline
import matplotlib.lines as mlines
import pandas as pd
import scipy as sp
import... |
2e6d5a4c50f80925ec102208a8c61d24a33d8b0b3a7148134ee88b84811c7b7c | Python | 11,279 | 284 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import torch
from omegaconf import DictConfig
from mattergen.diffusion.corruption.corruption import B, BatchedData, maybe_expand
from mattergen.diffusion.corruption.sde_lib import SDE as DiffSDE
from mattergen.diffusion.corruption.sde_lib import... |
387eec7c2b27904737f96c2d9585a2c9cc35d8650859a139c1d16df3e5d01c45 | Python | 11,280 | 274 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import torch
import os
import emoji
import pyfiglet
import platform
import json
import importlib.metadata
from halo import Halo
from datetime import datetime
from contextlib import contextmanager, redirect_stdout, redirect_stderr
from rich.console import Con... |
6419e83be7f8aa4a2287b963bcf2d84d06285678f119ea89127c33804cb7e203 | Python | 11,290 | 227 | #!/usr/bin/env python3
"""O que muda se o alpha for escolhido por CV interna AGRUPADA por familia?
Motivo (21/09/2026): sem as copias, trocar a CV interna aleatoria pela agrupada
MELHORA os tres modelos de referencia (1F -2,1 %, Magpie -9,1 %, wave15 -5,0 %),
o que derruba a justificativa da Sec. 2.3 para manter a ale... |
146e34ab73533ac3225944c860084d2c0c3f3355f5f4c84645cc4a2eb4756401 | Python | 11,291 | 344 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import functools
import unittest
from typing import Any, Dict, Sequence
import fairseq
import fairseq.options
import fairseq.tasks
import tor... |
c4dd92387f6e5ab6aea3ced80a83c85df34511ef2d4b1749cb55a2d835f93133 | Python | 11,291 | 283 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
A list of commonly used multiple correction routines
"""
from __future__ import print_function
from __future__ import absolute_import
import sys
import random
import numpy as np
import collections as cx
__copyright__ = "Copyright (C) 2010-2018, H Tang et al., All righ... |
30d202977a114d9ccf37223fe4234785ac75384029a3ee4e3ddb4c68ce758837 | Python | 11,295 | 265 | import theano
import lasagne
from theano import tensor as T
import numpy as np
from theano import config
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
import layers as ll
srng = RandomStreams(seed=1)
def clipped_binary_crossentropy(predictions, targets):
targets = T.clip(targets, 0, 1)
... |
c423240d370f2ca6ddffdc87d3b79e11465d973f6a637fd95415f6f1af08b3cb | Python | 11,296 | 278 | import numpy as np
import pandas as pd
from logging import warning
from syntheval.metrics.core.metric import MetricClass
from lightgbm import LGBMClassifier
from sklearn.metrics import precision_score, recall_score, f1_score
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestC... |
6711763b1df64a16e6bb21f4602448e67880fcbc4146331b6eb870249fef3d5a | Python | 11,299 | 308 | # We'll compute the J-integral and (K_I, K_II) from the user's K-field using autograd.
# This cell defines corrected utilities, evaluates J on a circular contour, estimates the phase angle,
# and prints the results.
import torch
import numpy as np
import matplotlib.pyplot as plt
# ===== Settings =====
DTYPE = torch.fl... |
5ee5ff37657ce6bbddff6ce101b4775236366d9c13f02cae185880c0761b7918 | Python | 11,308 | 339 | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 15 10:04:02 2019
@author: 俊男
"""
# In[] Import Area
import numpy as np
import pandas as pd
# In[] Loading Dataset
# USAGE: dataset = preprocessor.dataset("MyCSVFile.csv")
def dataset(file=""):
if file != "":
dataset = pd.read_csv(file)
else:
dat... |
722289d068c1d21d391d7fab604c2d5828f85403e8eaf8ad61a18fc0006c192c | Python | 11,312 | 364 | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Score raw text with a trained model.
"""
from collections import namedtuple
import logging
from multiprocessing ... |
d0cb432f7d3e4fdda39ec093b9719a8df187042435eeaf10bad7b373cec02cd3 | Python | 11,312 | 310 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from scipy.signal import find_peaks
import cv2
import scipy
import math
import tqdm
import time
from collections import defaultdict
from sklearn.metrics import roc_auc_score
import cmapy
from PIL import Image
from functo... |
de9f5165cba41ea66a06b533d06706f2e9a676aca2212fd38d96d76189e5aecb | Python | 11,322 | 266 | #!/usr/bin/env python3
"""A script to make predictions using a BPReveal model.
This program streams input from disk and writes output as it calculates, so
it can run with very little memory even for extremely large prediction tasks.
BNF
---
.. highlight:: none
.. literalinclude:: ../../doc/bnf/makePredictions.bnf
... |
dcfbb8a459491737fbf11d5432cdfba8a3e379d088adb58e3a2bef6d54a75035 | Python | 11,325 | 327 | import typing
import random
from pathlib import Path
import logging
from time import strftime, gmtime
from datetime import datetime
import os
import argparse
import contextlib
from collections import defaultdict
import numpy as np
import torch
from torch.utils.data import Dataset
import torch.distributed as dist
logg... |
63fa1d1b9767aaef1265f281737058d72bfe0ca3f66b3d2437381711f6c16cc4 | Python | 11,334 | 340 |
from mentor._version import __version__
import argparse
import os
import sys
import pandas as pd
import numpy as np
import logging
import warnings
import pathlib
from scipy.spatial import distance
from scipy.cluster import hierarchy
from mentor import _cluster as cluster
from mentor import _metrics as metrics
from men... |
596df3dafa822ccbfd87fcaf2539f43cc38a573228f9733889d5580ab8f9d94d | Python | 11,339 | 277 | import pandas as pd
import numpy as np
import sys
import os
import json
import subprocess
from scipy.optimize import dual_annealing
from Improvement4Protocol import ResultPAM
from ossdbs.api import run_PAM
TOTAL_CURRENT = 5.0
ABS_TOTAL_CURRENT = 5.0
CURRENT_EXCESS_LIMIT = 3.0
class PamOptimizer:
""" Class for c... |
71a4202e3cc5fa1e83754386db8426deadef0ba84379b9f040b2af4ef2bbf862 | Python | 11,340 | 407 | from __future__ import annotations
from datetime import date
import pandas as pd
import pytest
from src.processing.telemetry_processing import (
AmbiguousTelemetryAlignmentError,
apply_cluster_binning,
build_aligned_photometry_cluster_data,
calculate_mean_and_sem,
calculate_nighttime_periods,
... |
13f1657768de696da943e08aff6873e66204e8d2e74920fedf2982c5f34ef198 | Python | 11,343 | 295 | """Controller for graph/settings UI container setup and color selection."""
from __future__ import annotations
from PySide6.QtWidgets import (
QColorDialog,
QDialog,
QFrame,
QGridLayout,
QHBoxLayout,
QLabel,
QPushButton,
QVBoxLayout,
QWidget,
)
from src.features.behaviour_alignmen... |
982cd3e0323497cbd98453acb197dc3deeee5070f96700167ca173097d736585 | Python | 11,343 | 333 |
#%%
import os
import numpy as np
import pandas as pd
from scipy.stats import chi2_contingency, iqr, kruskal, mannwhitneyu
from statsmodels.stats.multitest import multipletests
# -- Helpers
def _mw(a, b, alternative="two-sided"):
a = pd.Series(a).dropna().values
b = pd.Series(b).dropna().values
if len(a)... |
3ecb0c9c55065591b8aa322b7dad20021617bc156613f58feb36e63e333deaf8 | Python | 11,344 | 297 | #!/usr/bin/env python3
from collections import defaultdict
from itertools import chain
from pgmpy.factors.discrete import DiscreteFactor, TabularCPD
from pgmpy.models import (
DiscreteBayesianNetwork,
DiscreteMarkovNetwork,
DynamicBayesianNetwork,
FactorGraph,
JunctionTree,
)
from pgmpy.utils impo... |
9d2816120029512d1ceb69d64916f78066af8c35ed783dd12bf3d7deea2b6c0a | Python | 11,346 | 282 | #!/usr/bin/env python3
"""
Author: Ken Chen
Email: chenkenbio@gmail.com
"""
import argparse
from tqdm import tqdm
import pickle
import os
os.environ["TOKENIZERS_PARALLELISM"] = "false"
import json
import sys
import shutil
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch ... |
a551673228296bf8d050664bbfc61c1596e9c109a43d68584f55eb48853ecb70 | Python | 11,346 | 323 | """Deprecated compatibility shims for :mod:`pgmpy.ci_tests`.
The CI test functions in this module are deprecated and will be removed in
v2.0. Each function is a thin wrapper delegating to its canonical class in
:mod:`pgmpy.ci_tests`; no test logic lives in this module anymore.
Legacy call convention: ``test(X, Y, Z, ... |
df1aa8e3be04a1ac19f44e560db9e19b7605fb4ca05ce74ef7606247ed0e0923 | Python | 11,348 | 324 | # ##############################################################################
# GPLv3 LICENSE INFO #
# ##############################################################################
"""Load and validate the bundled gmx_MMPBSA_test manifest.
Selector resolut... |
54f42e7c5d7464fa3466925f52315ab2d243dad36744339240a1050931ba3c15 | Python | 11,350 | 371 | from itertools import product
from pathlib import Path
from typing import Callable, TypeAlias
import matplotlib.pyplot as plt
import numba
import numpy as np
import numpy.typing as npt
import yaml
from scipy.special import xlogy
# declare my own types here
StrPath: TypeAlias = Path | str
ParamDict: TypeAlias = dict ... |
1c04ebe070de0d9fe179b4373685aef62fdfdc8d3449110000e1739ea9bcd892 | Python | 11,356 | 312 | #!/usr/bin/env python3
"""
For each transcript discovery tool, compute:
1. % of transcripts with all splice junctions supported by short-read RNA-seq
2. % of transcripts with 5' end within 100 bp of a CAGE-seq peak
Plot a grouped barplot comparing tools.
"""
import argparse
import sys
from pathlib import Path
imp... |
755123e2d4297c78cdfb23554a324d44fabf8acd7ea4b859dbfcbf21c228d84c | Python | 11,359 | 349 | # Copyright 2015 Google Inc. 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 applicable law or a... |
ed9fe613e34e6b6da3fcbebc8d2fa193147b3437d727c85d382f379fad49068d | Python | 11,360 | 284 | from __future__ import annotations
from collections.abc import Iterable
import numpy as np
import pandas as pd
def select_signature_markers(
signatures: pd.DataFrame,
*,
top_k: int = 25,
min_positive_markers: int = 10,
exclude_prefixes: Iterable[str] = ("drop_",),
) -> tuple[dict[str, list[str]]... |
8a12192064f77cdccc852ea548dc65b8ec24dfd2469b49a18d6a406ef4beeafc | Python | 11,364 | 344 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import io
import os
from pathlib import Path
from typing import Optional, List, Dict
import zipfile
import tempfile
from dataclasses import da... |
748fd6398b206ae4b07d3607e8ad296a5dd43b17c04fb2cfde36f45de3228996 | Python | 11,368 | 256 | """Given user GO ids and parent terms, group user GO ids under one parent term.
Given a group of GO ids with one or more higher-level grouping terms, group
each user GO id under the most descriptive parent GO term.
Each GO id may have more than one parent. One of the parent(s) is chosen
to best represent... |
09e5a452c174b7ff15b5d97976eda98bdd6f611ae972e59a16c5c76311e3a46b | Python | 11,370 | 239 | #!/usr/bin/env python3
# 11_inverse_scRNA_validation — generated from notebook spec
# ============================================================
# # 11 — Inverse-concordance validation in scRNA-seq (Python / scanpy)
#
# Take the inverse-concordant gene panel from notebook 09 and re-test it
# on every locally-ava... |
ee550ab2915f3bb8c27e95405ba8b39539774f2f6d4c2278ded08173ae95bd2f | Python | 11,371 | 295 | from __future__ import annotations
import logging
from typing import TYPE_CHECKING
import numpy as np
import torch
from torch import logsumexp
from torch.distributions import Beta
from scvi import REGISTRY_KEYS
from scvi.data import AnnDataManager
from scvi.data.fields import CategoricalObsField, LayerField
from scv... |
895ccc20f93d9aab8498a2a769701ad8aa45c81248938b2478a57275dacf58d9 | Python | 11,375 | 257 | """Phase 3 — LAMMPS+AIREBO relaxed clusters: scaling of E, V, E/V vs L.
Workflow per L ∈ L_VALUES:
1. Sample N_realisations site-percolation clusters at p_c on honeycomb.
2. AIREBO single-point + minimisation (LAMMPS).
3. Estimate volume of relaxed cluster (3 estimators for cross-check).
4. Average ⟨E_relaxed⟩... |
76ca7ff5d07a6f40c974fb88010467e8eb720a9a4f890955b8ddebbca9043339 | Python | 11,384 | 358 | """Regression tests for `sync_doc_db`: the dropped `store_strains` await,
and its worker-pool concurrency over the streamed BRENDA cursor.
"""
import asyncio
import pytest
from apiadapters.straininfo import AsyncStrainInfoAdapter
from apiadapters.straininfo.straininfo import StrainRef
from tinydb import TinyDB
from t... |
be53a6c6b2cc4d4099caec706cb778453baee97fbcecb96f6dd86f58e4f3c2b6 | Python | 11,389 | 272 | from __future__ import annotations
from math import ceil, floor
import numpy as np
import pytest
import torch
import scvi.dataloaders._data_splitting as data_splitting_module
from scvi import REGISTRY_KEYS
from scvi.data import synthetic_iid
from scvi.dataloaders import DataSplitter, SemiSupervisedDataSplitter
from ... |
3a9853a519b73065ff96e715e3d025d39a79f7b65fa79a7bbb73e0e640c0805c | Python | 11,396 | 343 | import importlib
import importlib.util
import inspect
import os
import re
import subprocess
import sys
import warnings
from pathlib import Path
from importlib.metadata import metadata
from datetime import datetime
from typing import TYPE_CHECKING
try:
from sphinx.deprecation import RemovedInSphinx90Warning
except ... |
b4008b29d1cbb75934828a5cba60756003ac4a400177068f297361aa450c7928 | Python | 11,397 | 381 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import typing as tp
from abc import ABC, abstractmethod
from collections import Counter
from dataclasses import datac... |
4418fcf2aa92609a72b97b279720f51727a30ecb89a1505aeb6be6e3e6a78807 | Python | 11,398 | 340 | #!/usr/bin/env python3
"""Calculate ROI-based inter-subject pattern similarity (ISPS) for one subject pair.
Subject-pair, single-ROI mode. Four input tables are required: subject A
behavior + neural pattern, subject B behavior + neural pattern. Computes
ISPS for one ROI between the two subjects.
WSLD: similarity to... |
9ef409cf2f815e2fc6fed6215c66cbb27ab1a1cdbd4de0ae5a32b3a24eeac119 | Python | 11,408 | 272 | """
Hyperparameter tuning for cell mapping using ray.
Installation:
pip install ray
pip install optuna
Example:
import ray
from ray import tune
ray.init()
metric = ["cell_map_consistency","cell_map_agreement","cell_map_certainty",
"gene_expr_consistency","gene_expr_correctness"]
... |
9694d4a598c22ebb5ece9c0b5c3f0145932b1cd0d857c2fafe5d2e01ec942bea | Python | 11,413 | 241 | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... |
a8e5e92faa6d1db2a0b86b6e8841950fa5241a5f54c2f0b657e7f87111de7acb | Python | 11,414 | 242 | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... |
b06921b8873cc487d932711864ee93745bd2f1f675f7ceff0dc4036f58a626f4 | Python | 11,414 | 258 | import pandas as pd
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import os
import sys
import argparse
"""
Run examples:
(1) Manhattan plot with one sumstats:
python plotgwas.py manhattan --config config.plotgwas.3.cfg --out manhattan.3.svg
(2) Miami plot with two sumstats ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.