sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
03227ad20e29639832974192413b3740a5ded1db201a091bab88c531c45417c5 | Python | 24,724 | 630 | """
Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
- Analysis settings
Output: - Plots by tomograms:
+ Number of particles by list
+ ... |
2c41eeae9a6658b50aecd4d386b05f8d9e84910500fe7c9027166e6994459b1c | Python | 24,733 | 752 | #!/usr/bin/env python
'''
Hybrid LFP scheme example script, applying the methodology with a model
implementation similar to:
Nicolas Brunel. "Dynamics of Sparsely Connected Networks of Excitatory and
Inhibitory Spiking Neurons". J Comput Neurosci, May 2000, Volume 8,
Issue 3, pp 183-208
But the network is implemented... |
21ca27756979e4856960661e62c41b1d8ee60a102c539bcc222f4d4d4ff4302b | Python | 24,784 | 630 | """
Functions to estimate S0 and T2* from multi-echo data.
"""
import logging
import numpy as np
import scipy
from scipy import stats
from tedana import utils
LGR = logging.getLogger("GENERAL")
RepLGR = logging.getLogger("REPORT")
RefLGR = logging.getLogger("REFERENCES")
def _apply_t2s_floor(t2s, echo_times):
... |
c1ab654ee73c6613fff65bc2239cbc3fbceda5e29d6a7654523f35033ebf988e | Python | 24,802 | 629 | # coding=utf-8
# Copyright 2021 Google AI, Ross Wightman, The HuggingFace Inc. 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/license... |
c7b32413febe5d23cd549187c63b2d7fb9a435c096d74a804f220506f90c0b02 | Python | 24,812 | 927 | def plot_trajectory(file, file2, nc = 3, plottype = 'cognitive', prob = False, save = []):
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from scipy.signal import butter, filtfilt
data = np.load(file)
x = data["arr_0"]
c = data["arr_1"][:, nc-1]
b = data["arr_2"]-1
la... |
385e14833e00953b488cb7779ebb779441e7fdae1512519524a572a13541f600 | Python | 24,816 | 558 | # coding=utf-8
# Copyright 2018 The Google AI Language 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/LICEN... |
f39350855a5e6c2fe92ed664d622d6c33b535910c49ce4caa4dfd5b4980b9c5d | Python | 24,820 | 613 | #!/usr/bin/env python
import numpy as np
import BS_config as BS
from platform import system
import datetime
from PyQt5.QtCore import (QFile, Qt, QFileInfo, QTextStream, QDir, QSettings,QRectF)
from PyQt5.QtGui import QColor,QPalette, QPixmap, QFont, QPainter, QPen, QIcon
from PyQt5.QtWidgets import (QAction, QFileDia... |
4460b73004c2ab369348c8926088efa1f86e01002344f08ad8116eb1cfd25ce6 | Python | 24,832 | 650 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
#from visbrain.objects import BrainObj, ColorbarObj, SceneObj, SourceObj
import csv
import nibabel
from scipy.spatial import KDTree
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from pylab ... |
7279b1345099e4298a37656662ed2ca8fc8c00ada48e2fdeb239315b1656b528 | Python | 24,848 | 660 | """
m6A_ml_data.py
Author: Anupama Jha <anupamaj@uw.edu>
one-hot-encoding code adapted from bpnet-lite (https://github.com/jmschrei/bpnet-lite)
This module converts m6A SMRTMatrix format to training features and labels for ML modelling tasks.
"""
import pickle
import argparse
from tqdm import tqdm
import numpy as np
f... |
278e6638b3ed3f037a1de464fcc9900079ec60a879c9be129417e499dbe1cf4a | Python | 24,856 | 448 | """
Modules containing function works for transformation between config,
DetailedCircuit, AbstractCircuit, PointCircuit
config ---> DetailedCircuit: config2detailed
DetailedCircuit ---> AbstractCircuit: detailed2abstract
---> PointCircuit: detailed2point
---> DetailedCircuit (connectio... |
872a1c1dc486497b0600935bed0ae2ec5bf01d0827d25db0db4258f40b2e7ed0 | Python | 24,856 | 575 | """Simple tests such as t-test, wilcoxon."""
import warnings
from abc import abstractmethod
from collections.abc import Callable, Mapping, Sequence
from types import MappingProxyType
import numpy as np
import pandas as pd
import scipy.stats
import statsmodels
from anndata import AnnData
from fast_array_utils.conv imp... |
b1eca24057d3bf7eeefbbd5f6476b32579ecea1246b9b17b6acaaec781f9942b | Python | 24,868 | 607 | # -*- coding: utf-8 -*-
from __future__ import annotations
import contextlib
import os
import shutil
import sys
import tempfile
from contextlib import contextmanager
from datetime import datetime, timedelta
from typing import Any, Iterable, Union
import dill
import torch
import torch.distributed as dist
import torch... |
a01ba7ba0447d6725262762f6152e3c5d890e083f0aaa5ca9e95cf791d79e774 | Python | 24,870 | 661 | """PyTorch image datasets designed to work with OpenSRH.
Copyright (c) 2024 University of Michigan. All rights reserved.
Licensed under the MIT License. See LICENSE for license information.
"""
import os
import json
import logging
from collections import Counter
from typing import Optional, List, Union, TypedDict, Tu... |
f7a5d4311225d38820e68811800799641337a95b29618444e2963c475fdcd342 | Python | 24,873 | 676 | """
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.
TODO:
1. Simplify the case when `num_resolutions` == 1.
2. Remove indexing when the shape is the same.
3. Move some functions outsid... |
8394c18f06c64dcf020d91d5a77d7d639bc65704f7b8270d784b9b964a382691 | Python | 24,878 | 703 | #
# MIT License
#
# Copyright (c) 2022 GT4SD team
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... |
7faab642462b945f9fe99127b0a2faf349f4725cc42d9be8c1ef64b0df56ff8a | Python | 24,888 | 617 | """
Performs Bivariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference
- A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) to analyze
Output: ... |
60d729a69406dfbbc90400d03d1d5226836698d3aba71ac8d1ec65e48f653646 | Python | 24,892 | 630 | # -*- coding: utf-8 -*-
#
# Test functionality of SyNCoPy-container I/O routines
#
# Builtin/3rd party package imports
import os
import tempfile
import shutil
import h5py
import time
import pytest
import numpy as np
from glob import glob
# Local imports
from syncopy.datatype import AnalogData
from syncopy.io import s... |
964abdb5838ab116325a802539b86cfc4930da5fbb0636f832c26158ee0864f8 | Python | 24,900 | 816 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 30 14:01:27 2023
@author: felipe
"""
#Canonical Python libraries
import numpy as np
import scipy.signal as signal
from scipy.linalg import schur
#Matplotlib for tests and examples
import matplotlib.pyplot as plt
###################################... |
b5c67027ffba1f13b270b7959272ca755e39221dddd0a887a078edad478e5266 | Python | 24,901 | 509 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... |
ff253e27bf3bc5731111d292c3005b0b65bd3e2af165881de9e2c85595b1d2d8 | Python | 24,914 | 630 | """
Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
- Analysis settings
Output: - Plots by tomograms:
+ Number of particles by list
+ ... |
9271acf9d464d4a2bd568bc015fd65d2046f98338433a05937c01069783a13d2 | Python | 24,918 | 581 | import os
import shutil
import unittest
import pandas as pd
from hed.errors import HedExceptions, HedFileError
from hed.schema.hed_schema_io import from_dataframes, load_schema, load_schema_version
from hed.schema.schema_io import df_constants as df_constants
from hed.schema.schema_io.df_util import convert_filenames... |
090e71ba1574a5e0f11684d7d211d5f66c1cb7a0fe9f9758f050aef007aed658 | Python | 24,920 | 630 | """
Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
- Analysis settings
Output: - Plots by tomograms:
+ Number of particles by list
+ ... |
55f56c8ace858ef915bda4781d98a44f0d8ea525d0af08d70632fd2f0adbf5db | Python | 24,923 | 630 | """
Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
- Analysis settings
Output: - Plots by tomograms:
+ Number of particles by list
+ ... |
ac14eb89ef1d7bde972eccbb0ea47d7d427fa6957907fe7735f567d3f2339bda | Python | 24,957 | 630 | """
Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
- Analysis settings
Output: - Plots by tomograms:
+ Number of particles by list
+ ... |
b6bed15249f6aa2bbf00d669b92b70982f573c4653a5ccae8ab43045befe0068 | Python | 24,962 | 582 | import os
from PIL import Image
import numpy as np
import pickle
import torchvision
from torchvision import transforms as T
import torch
from torch.utils.data import Dataset, Sampler
from typing import Dict, List
import pandas as pd
import numpy as np
def get_lorenz_matrix(n, time=100, step=0.02, c=0.1, time_invar... |
eb454236603c9ecb1ead8f84b791e718146aa1c5033bcb93c3276b209f7b9d8a | Python | 24,987 | 429 | """
DeepLabCut2.0 Toolbox (deeplabcut.org)
copyright A. & M. Mathis Labs
https://github.com/AlexEMG/DeepLabCut
Please see AUTHORS for contributors.
https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS
Licensed under GNU Lesser General Public License v3.0
"""
import os
import argparse
# Dependencies for anaysis... |
34650e33d9172b37e9647b477cbf4a074c716081f62cc66ea878a9f185470f0b | Python | 24,997 | 413 | import pandas as pd
from json_loading_SV import *
from datetime import datetime
import os
import json
import gzip
import math
import sys
from openpyxl import Workbook
import itertools
from itertools import islice
import subprocess
version = '1.0'
#Creating a list of gene identifiers from the genes of... |
c00b2d816b815fe3c1c2239ebefb4b5d4334806696fc7eebb1a5e1eb123ce39d | Python | 25,004 | 521 | #!/usr/bin/env python3
"""
Copyright (C) 2018-2020 Intel Corporation
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... |
baae10027b22828345ede9206f1c8b180df484922c84c2fd32abefc378172c69 | Python | 25,010 | 604 | from __future__ import print_function
#from os.path import expanduser
import os
import re
import subprocess
import time
import sys
from collections import namedtuple
from pddlstream.algorithms.downward import TEMP_DIR, DOMAIN_INPUT, PROBLEM_INPUT, make_effects, \
parse_sequential_domain, get_conjunctive_parts, w... |
8fc4152d2a4cd62a5be2982dc6cbcf6c1d63889ff0b9373d72326772b88ef698 | Python | 25,015 | 641 | """
Script to decode whisker activity (wsk) from population activity projected
onto PCA space. Includes following functions:
- get_data: load and prepare spk and wsk data (subset of original, keeping
only rec with decent whiksing trials); standardise whisker data trials;
divide in pre- and post-drop, organise in one ... |
1ec38f13e1367ec14e0759ddbdfc6a9038122e020ecb77492e7bebc620dd1990 | Python | 25,018 | 655 | import pybullet as p
import numpy as np
from perception_tools.common import create_name
from plan_tools.common import ARMS, LEFT_ARM, RIGHT_ARM, TABLE, TOP, COFFEE, SUGAR, COLORS
from plan_tools.planner import Task
from plan_tools.ros_world import ROSWorld
from plan_tools.samplers.grasp import hold_item
from pybullet... |
48e7ecc4c6ed99f3884b8e146171c8e3a51d55d260e3dede3f61e14273d5eea3 | Python | 25,032 | 613 | import os
import numpy as np
import matplotlib.pyplot as plt
import nibabel as nib
import mne
from mne.datasets import eegbci
from mne.datasets import fetch_fsaverage
import logging
from xml.etree import ElementTree
from neurolib.utils.atlases import AutomatedAnatomicalParcellation2
class LeadfieldGenerator:
"... |
414c951be99766c2743e81e01150737f864f56ea3fa7372e61261f6033bc1e65 | Python | 25,037 | 767 | """
Contains class Affine2D for preforming affine transformation (general linear
transformation followed by translation) on points (vectors) in 2D.
# Author: Vladan Lucic (Max Planck Institute for Biochemistry)
# $Id$
"""
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ im... |
627efbb9796d3ce3c7c0b2fa740ab7e256ba494259be57d918e37d5fc020925f | Python | 25,048 | 772 | """
visualisation module
"""
# Copyright (C) 2021 Blue Brain Project, EPFL
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... |
c8121d0f55125bf264ab0643e68a14b7e19b1548f4a6aae235e7fc9c5a47439b | Python | 25,052 | 821 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:AUTHOR: Jens Petersen
:ORGANIZATION: Heidelberg University Hospital; German Cancer Research Center
:CONTACT: jens.petersen@dkfz.de
:SINCE: Wed May 17 14:29:20 2017
:VERSION: 0.1
DESCRIPTION
-----------
Create segmentation DICOMs for XNAT experiment
REQUIRES
-------... |
bd5410c8b5ce1e7961d64384f94388d18407b22b02780ec5f1dcaf2df7c66dde | Python | 25,061 | 636 | """
Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
- Analysis settings
Output: - Plots by tomograms:
+ Number of particles by list
+ ... |
36d128b557a45cabf18d9a9e1b94524af5527a5344aa08ab1f964bdc58bc8b85 | Python | 25,062 | 605 | #!/usr/bin/env python3
import os,sys
Eval = False
if len(sys.argv)>1:
if sys.argv[1].lower()=='eval':
Eval=True
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
os.environ['CUDA_VISIBLE_DEVICES']=""
# Only use one GPU for evaluations
if Eval:
os.environ['CUDA_VISIBLE_DEVICES']="1"
import tensorflow as tf
... |
d971930c00d9e4b8654d54985d9c25d5172c12b1e8f4be0e50e470458fc12b7f | Python | 25,070 | 610 | import pickle
import shutil
import tempfile
from pathlib import Path
import bpy
import MDAnalysis as mda
import numpy as np
import pytest
from MDAnalysis.transformations import boxdimensions
import molecularnodes as mn
from .constants import data_dir
bpy.utils.expose_bundled_modules()
class TestAnnotations:
@pyt... |
79bc63a08a10965bb3e0b24daf1ffaf5c957d9c42d9adae6c3a3357b283ff911 | Python | 25,077 | 578 | """Leave-one out cross-validation class.
Class
-------
LOOCV
"""
import copy
import itertools
import multiprocessing as mp
from collections.abc import Callable
from warnings import warn
import numpy as np
import xarray as xr
import hmp
from hmp.basedata import BaseData
from hmp.models.base import BaseModel
from h... |
f7a7a0963ecd957a06ee6b519039aa50bb12ec6f024de957e63cc4898ff3fa67 | Python | 25,083 | 608 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 8 13:09:02 2024
@author: deeperthought
"""
import tensorflow as tf
import os
import numpy as np
import matplotlib.pyplot as plt
import nibabel as nib
import pandas as pd
from sklearn.metrics import roc_curve
from sklearn.metrics import roc_auc_... |
25ea701561b15f3fb9ebda7f0fb2592955cda5a854a703cc8cccf47438465b5c | Python | 25,134 | 1,099 | from __future__ import annotations
# MG_RESUME_SEGMENTATION_V1
from ..checkpoint import (
CheckpointJournal,
file_identity,
fingerprint,
source_digest,
)
from ..io.preflight import (
canonicalize_label_storage_2d,
preflight_paths,
)
from ..core.instance_map import (
binary_to_foreground,
... |
26b1a8dbb8d6f0bd7293dbed6d6a8f123c429b8e77b3e7cd4ce2f0f7b9d2bcc3 | Python | 25,137 | 527 | # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/10_eval.ipynb.
# %% auto 0
__all__ = ['generate_points', 'generate_trajectories', 'generate_plot_data', 'get_points_from_trajectories', 'calculate_nn',
'generate_tjnet_trajectories', 'get_cell_indexes']
# %% ../nbs/10_eval.ipynb 3
import torch, numpy as np... |
b8422225ac9fa2b1cd3aad2a3db674c111399206f051801a954e6aabeccfc9d3 | Python | 25,139 | 592 | # ---
# jupyter:
# jupytext:
# cell_metadata_filter: -all
# custom_cell_magics: kql
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.2
# kernelspec:
# display_name: APT
# language: python
# name: python3
#... |
1edd6891b5869569adb367de8dedc73ed5ca09827d309fe21d4e9d36b2578a83 | Python | 25,146 | 494 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 20 12:10:18 2023
@author: MegNParker
"""
#%%
import numpy as np
import pandas as pd
import statsmodels.api as sm
import statsmodels as statsmodels
import os, os.path as op
from matplotlib import pyplot as plt
import seaborn as sns
import glob
impo... |
a683924c310fcce1fca9e83719a4a25cd95c60ae92dc374165848102a327ac97 | Python | 25,149 | 747 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 18 22:22:49 2022
@author: pcanalisis2
"""
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import scipy.io
import pandas as pd
import os
import h5py
import mat73
from scipy import signal
from scipy import stats
from sklearn... |
fbf69824de7482acb5e45f5c9d5127d27165cf21d94df8d75b735b22f4e4d141 | Python | 25,166 | 486 | """
Created on Wed Apr 28 23:03:36 2021
@author: Haotian Teng
"""
import os
import sys
import h5py
import toml
import numpy as np
import argparse
from matplotlib import pyplot as plt
from itertools import compress
import seaborn as sns
from tqdm import tqdm
from xron.utils.seq_op import fast5_iter,norm_by_noisiest_se... |
fa9b378eee2042ced1c80933a7248e72087080d125397f4e3dfda0075dfd7346 | Python | 25,167 | 589 | """
Analyzes filaments to membrane distances on list of tomograms
Input: - A STAR file with a set of ListTomoFilaments pickles (SetListFilaments object input)
- Settings for the measurements
Output: - Plots by tomograms
- Global plots
"""
################# Package import
impor... |
1475bd6bd21a41928c551d9f0aa0b10aa659aaaac42b9f67f2d3e5ac30037576 | Python | 25,170 | 652 | """
Performs Bivariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference
- A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) to analyze
Output: ... |
7fc5a86b61cf6910c7731930c3aa05c89075b4e2ff454f36bc49826a07e0b831 | Python | 25,193 | 616 | # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/05_train.ipynb.
# %% auto 0
__all__ = ['train', 'train_ae', 'training_regimen']
# %% ../nbs/05_train.ipynb 3
import os, sys, json, math, itertools
import pandas as pd, numpy as np
import warnings
# from tqdm import tqdm
from tqdm.notebook import tqdm
import torch
... |
eeda6f0bdb69c37daf7de8e63f9a0cdc3428342193ddaec31ebbefd9749a5444 | Python | 25,202 | 723 | from __future__ import annotations
import logging
from shutil import which
import pytest
from quacc import get_settings
settings = get_settings()
pytestmark = pytest.mark.skipif(
which(str(settings.ESPRESSO_BIN_DIR / settings.ESPRESSO_BINARIES["pw"])) is None
or which(str(settings.ESPRESSO_BIN_DIR / setting... |
1421fb59ac56b73f2d60086374468b44c1f45947537c862375e4905ca4278cca | Python | 25,209 | 532 | """Active-component editing mixin for the CCF boundary editor.
Carries the in-canvas editing lifecycle: activating / clearing the active
contour component, the brush-drag handlers (start / move / finish) and the
mirror-edit + audit-log machinery they drive, re-syncing the active curve
after a fill, and the brush-... |
dfe5c2c1bd2393aa3b49cc8e19f678b1a6dd5b3c92cee4e75a5ffef7a7373eb3 | Python | 25,218 | 751 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 17 09:58:02 2021
@author: leupinv
"""
## libraries
import numpy as np
import mne
from scipy import stats
from mne.stats import fdr_correction, f_mway_rm, permutation_t_test
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['svg.f... |
b7d6a82c14343097ed1958f1ccc3967c27a67aece249b647f14bfa6f50ed218b | Python | 25,223 | 715 | import torch
import numpy as np
import matplotlib.pyplot as plt
import time
def res_str_to_dict(res_str, loc):
""" Moves string of results separated by commata into a dictionary, where each
key in `res_str` is a variable. This can then be dumped into a pickle file...
Needs as input:
loc = loc... |
b13c927fd4d5870aad73332281e632d2997cf7b71e0a6d82a263151e52b96b15 | Python | 25,230 | 660 | """
Internal inspector for predictor introspection.
This module provides functions to inspect predictor classes and functions,
extract input/output type information, and validate inputs.
"""
import importlib
import inspect
import re
import sys
import typing
import warnings
from dataclasses import MISSING, Field
from ... |
5bbd5e9090cbd2e7b10d17bb190a0a52145331e4eebd70c831556c1d6ff4ecd8 | Python | 25,233 | 553 | """Tests targeting pandas 3.0 compatibility fixes.
Each test class is named after the specific change it validates, with docstrings
explaining why the old code broke and referencing the fix made.
Breakages addressed:
1. ChainedAssignmentError in shrink_defs (df[col][mask] = ...)
2. iloc/dtype preservation in _fil... |
880cb00a8b82045806463a827b683bd2f678c2391142c1e8159c14cb8b065525 | Python | 25,255 | 545 | # this lib, together with the preprocess_mice_trials script
# is used to process the raw excel files that have the tracking
# of the mouse in the arena looking for the hidden food
#
# the experiments were originally performed by Kelly Xu from Len Maler lab
#
# the original excel files are not going to be included in th... |
5d33aab3f9647e8a47c4189eb21d6a4f641d318bdd9277512a663cbeae02f179 | Python | 25,259 | 504 | # MEGIT manual cross validation GUI
import os
import copy
import tempfile
import csv
import h5py as h5
import numpy as np
import cv2 as cv
from ..fio import cjsh_read, read_roi_poly, read_crscsv_set
from ..data import draw_text, hml_plt, jsl_plt
from PySide6 import QtCore, QtGui, QtWidgets
from .dgn_chkres... |
d74bea98c1b1973808196da163b6570e92330610f5ae5191ad1ddde54108ad33 | Python | 25,261 | 834 | import numpy as np
import scipy.integrate as integrate
from scipy.special import beta as betaf # pylint: disable=no-name-in-module
from scipy.special import btdtri # pylint: disable=no-name-in-module
from scipy.special import btdtr, erf, erfinv
class Distribution:
"Template for distributions"
def __init__(... |
bc8c08a3506da2a7a07a158c01784dae92c6601ab6e39adc68236404c3e74d4f | Python | 25,277 | 688 | import csv
import email.message
import functools
import json
import logging
import pathlib
import re
import zipfile
from typing import (
IO,
TYPE_CHECKING,
Any,
Collection,
Container,
Dict,
Iterable,
Iterator,
List,
NamedTuple,
Optional,
Tuple,
Union,
)
from pip._ven... |
3c626c2b3dc0b8095736b0e808d800ae81c1cc6eff4150ac8600ef7f1500bc87 | Python | 25,294 | 622 | """
this code is adapted from:
https://raw.githubusercontent.com/lukemelas/EfficientNet-PyTorch/7e8b0d312162f335785fb5dcfa1df29a75a1783a/
efficientnet_pytorch/dataloaders.py
dataloaders.py - Helper functions for building the model and for loading model parameters.
These helper functions are built to... |
15d165c5eb670df60c04482588468f057b7cf6e063a6c235b1d9cba33325b297 | Python | 25,307 | 781 | """Pure unit tests for build_registration_cli_args.
Imports only ``cli_args`` (Qt-free); PyQt5 is not required. The package
``__init__`` guards Qt imports with try/except so this module remains
importable in headless environments.
"""
import pytest
from regtools.registration.gui.cli_args import build_registr... |
b26af897707c97f8840a447e6a8af87846c1700f8fc4e3e8286c3840c3695f11 | Python | 25,315 | 763 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
def compute_same_pad(kernel_size, stride):
if isinstance(kernel_size, int):
kernel_size = [kernel_size]
if isinstance(stride, int):
stride = [stride]
assert len(stride) == len(
kernel_size
), "Pas... |
64e3a152e1a73e4850e30e24cbb36d3f475ca02f2e2e8af5f5eaa7bc332ea88d | Python | 25,320 | 654 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
d53c542ca6cf84be4e083df83a0b66d4c887770c4842d9fa20fa0407babc7493 | Python | 25,372 | 892 | import analysis_utils as au
import utils as u
import random
import pandas as pd
import numpy as np
import seaborn as sns
import statsmodels.api as sm
import statsmodels.formula.api as smf
import matplotlib.pyplot as plt
from scipy import stats
import os
RB_CODE_DIR = os.environ["RB_CODE_DIR"]
# for import neurons_vi... |
960c396cfdd4a0d7ef50f8516b3d552007d116417da4a58dfbc501e87d16e44a | Python | 25,416 | 930 | """Imported from the recipes section of the itertools documentation.
All functions taken from the recipes section of the itertools library docs
[1]_.
Some backward-compatible usability improvements have been made.
.. [1] http://docs.python.org/library/itertools.html#recipes
"""
import math
import operator
import war... |
b6524b6c1831ed606cd3b443b8490d0a21bbf27d1c125b35b250aac2fd6b3878 | Python | 25,446 | 563 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import dill
import os
import time
import glob
import re
import seaborn as sns
from sklearn.decomposition import PCA
... |
119215dff33721789625a98c1b48035238d9dd50c39e7760e298f8308fa994a7 | Python | 25,454 | 618 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import inspect
from typing import Any, Callable, Dict, Optional, Text, Union, Iterable
import tensorflow.experimental.numpy as tnp
import tensorflow as tf
import tensorflow_addons as tfa
from tensorflow.keras i... |
ae513c973e7876457a38e0c7d10b948d962c43ebf51d8caf81d71b408f1958f5 | Python | 25,454 | 594 | import os
import pandas as pd
import numpy as np
import pybedtools
from Bio.Seq import Seq
from Bio.SeqUtils import gc_fraction
import subprocess
def read_gtf(path2gtf):
"""
Read gtf file into pandas
"""
df = pd.read_csv(path2gtf,
comment='#',
header=None,
... |
cfd70f2aab13608be5608f42799199392d609057d5570e0e236cf29c2dc1dff9 | Python | 25,459 | 707 | #!/usr/bin/env python
# Generates a stimulus video and saves it as "stimulus.h5"
# Make sure current directory is added in the PATH variable
import h5py
import math
import matplotlib.pyplot as plt
import numpy as np
import random
import os
from itertools import combinations
from scipy.signal import correlate
var_dic... |
853b8d4c942ab53f5f78c7210c016e13626f82cc3dd987e0a7f741e1585b3f76 | Python | 25,461 | 645 | """
Performs Bivariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference
- A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) to analyze
Output: ... |
8e64651cae1163049567b25db44330f4d4bc13a25eee7fc549eb17da6dc8d3c2 | Python | 25,462 | 573 | ##
# \file run_reconstruction_pipeline.py
# \brief Script to execute entire reconstruction pipeline
#
# \author Michael Ebner (michael.ebner.14@ucl.ac.uk)
# \date October 2017
#
import os
import re
import numpy as np
import pysitk.python_helper as ph
import niftymic.validation.simulate_stacks_from_rec... |
de6fe0a6186881bdf7e79c92e9701469b0e410d3bf2fd12c947d6f8348f3e421 | Python | 25,470 | 781 | """
Convert image volumes (TIFF directories, selected TIFFs, NIfTI) to OME-Zarr
format for viewing in Neuroglancer.
Independent from the legacy ng_viewer module.
"""
import os
import glob
import gc
import numpy as np
from natsort import natsorted
from skimage.transform import resize
from joblib import ... |
a8c3733a8967a13ba81c30e3853f6164e8b7f73cd2ba8e709ff00d4950221dd2 | Python | 25,479 | 616 | import os
import gzip
import json
import click
import logging
import os.path as op
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import nibabel as nib
from glob import glob
from copy import copy
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(threadName)-8s] [%(levelna... |
c148fe70dd09ab1d29a72da37b34298751fbfeea2c1d4404da137982d217c867 | Python | 25,493 | 661 | #!/usr/bin/env python
try:
from setuptools import setup
from setuptools.command.build_ext import build_ext
build_py = None
except ImportError:
from distutils.core import setup
try:
from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:
from distutils... |
0066ebe217ed831d2a810cd625234535774a1181b64771834023312ecfba9d49 | Python | 25,509 | 698 | """
Tests module image
# Author: Vladan Lucic
# $Id$
"""
from __future__ import unicode_literals
__version__ = "$Revision$"
from copy import copy, deepcopy
import os.path
import unittest
#from numpy.testing import *
import numpy
import numpy.testing as np_test
import scipy
from pyto.core.image import Image
from ... |
1a49940df56149f32d6850d3b4b7f278eaa2578326991741e3e09c68dc3d8ea2 | Python | 25,517 | 733 | import typing
from pathlib import Path
from functools import cached_property
from collections import Counter
import numpy as np
import pandas as pd
import plotly.graph_objects as go
import plotly.colors as colors
from plotly.subplots import make_subplots
from plotly.figure_factory._2d_density import make_linear_colors... |
b6c8ff20d3dd55d21b8b7e4378e78522252cbbbc38579f4a28d7becc7f00a48a | Python | 25,553 | 606 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
9b3b5eba48dd5c5e52b0f8cbf058b7c49981198993ff381ab6927d6b6b7eb9ca | Python | 25,558 | 705 | import pandas as pd
import numpy as np
from pyfaidx import Fasta
from copy import deepcopy
from kipoi.metadata import GenomicRanges
from kipoi.data import Dataset, kipoi_dataloader
from kipoi_conda.dependencies import Dependencies
from kipoi.specs import Author
from kipoi_utils.utils import default_kwargs
from kipoiseq... |
4d7a3d365de5ee7b8c2987142b75cc9fc34e6e77a6e72f4550d3b9d28d5b49d6 | Python | 25,567 | 706 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''plotting/analysis routines on output of example_parallel_network.py
Copyright (C) 2018 Computational Neuroscience Group, NMBU.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the ... |
f19cd9ba63eda634ad5bbd4d9e62f5e326869c33d7ad9e76a887137c22a656b7 | Python | 25,567 | 472 | # Class to load and analyze TVAT sensitivity data
from os.path import join
import pickle
import h5py
import numpy as np
import networkx as nx
class TVATAnalysis:
def __init__(self, dir_data, fname_sensitivity, fname_settings):
## Loading data and variable initialization
self.dir_data = ... |
b3bf4ff47c7902c123533d4ef6f14ba821a7aec0c02d0886423ca97f7783bdc0 | Python | 25,571 | 626 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 4 22:42:00 2023
@author: danie
"""
from pathlib import Path
import os
import gurobipy as gu
import cobra
from copy import deepcopy
import numpy as np
from pandas import read_csv
from dnngior.variables import *
from dnngior.reaction_class import Reaction
from dnngior.NN... |
6f0102f498ab00a507c0403ee3496c1702cacabd2d91b93b23a15d376549c3bf | Python | 25,580 | 601 | from maldi_nn.utils.data import *
import sys
from importlib.resources import files
import h5torch
import json
import os
import pandas as pd
import numpy as np
from maldi_nn.spectrum import *
import shutil
# Obtained from original DRIAMS publication Weis et al.
drug_to_class = {
"5-Fluorocytosine": "antimycotic sys... |
10ba44378aff321f2c82ddb074b4f7765d000bdfe25ab274e307bd43d46dae8e | Python | 25,581 | 583 | from __future__ import print_function, division
import random
import time
import numpy as np
import scipy
from scipy.stats import norm
from learn_tools import helper
from learn_tools.active_learner import ActiveLearner, format_x, THRESHOLD, tail_confidence, \
BEST, CONFIDENT, STRADDLE, VARIANCE, REJECTION
from l... |
e703e0cd2d0b52e174bcba5ef2c2d700e886fcb5260e7fdfee20c1ea32774507 | Python | 25,628 | 680 | from __future__ import division
from __future__ import print_function
import numpy as np
import h5py
import math
import json
import time
import os
import pickle
import logging
import csv
import datetime
import tensorflow as tf
from tensorflow.keras.callbacks import Callback, LearningRateScheduler
from tensorflow.kera... |
e65352f60f569ee282f5c7d410bc917dca3f7c2ed113d281b97de8bcd6285bd3 | Python | 25,635 | 586 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
bdb0df846a1e6eee65d33105a6c3c5525b714b1282a53882a0ae2bd68a6587ad | Python | 25,636 | 755 | """A single HED tag."""
from __future__ import annotations
import copy
from typing import TYPE_CHECKING
from hed.models.model_constants import DefTagNames
from hed.schema.hed_schema_constants import ANY_UNITS_CLASS, HedKey
from hed.schema.hed_schema_entry import pluralize
if TYPE_CHECKING:
from hed.models.hed_g... |
588fece6d625bd56eae1d87ca5e8e29cf9877e033bb59dac9759b6e417173253 | Python | 25,639 | 657 | """
Performs Bivariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference
- A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) to analyze
Output: ... |
3d56014832d282a529c8f433c3ab184836b872b25a4be1d58c1cf00643b6128e | Python | 25,646 | 637 | from collections import OrderedDict
import csv
from logging import Logger
import pickle
from random import Random
from typing import List, Optional, Set, Tuple, Union
import os
from rdkit import Chem
import numpy as np
import pandas as pd
from tqdm import tqdm
from .data import MoleculeDatapoint, MoleculeDataset
from... |
9ebe7b4a5fffe797d01f5621fdb30d0a37ebdd9925d863b89c20004843b76fa4 | Python | 25,652 | 565 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import dill
import os
import time
import glob
import re
import seaborn as sns
from sklearn.decomposition import PCA
... |
fec75002050a696853153b232c5a012e2374d0b813bb98a50479db7fb3ef9b23 | Python | 25,664 | 623 | #!/usr/bin/env python3
""""
-------------------------------------------------------
run.py Program to run vulnerability protocol
using Pacing at the End of the Refractory
Period (PEERP) as suggested in Azzolin et al.,
Frontiers in Physiology, 2021 (doi:10.3389/f... |
1ea89afab4526903760a1a6ab932334af4135799ae4379c1e9b2ba0c580074d1 | Python | 25,669 | 651 | """
Performs Bivariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference
- A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) to analyze
Output: ... |
b936275086ee2434b332870fd3ecdcf9f1953ffd3f73f75204c1a70f3e3b1544 | Python | 25,671 | 828 | #!/usr/bin/env python
# main code for disperseNN2
import os
import sys
import random
import argparse
from sklearn.model_selection import train_test_split
from disperseNN2.check_params import check_params
from disperseNN2.read_input import list2dict
from disperseNN2.read_input import read_list
from disperseNN2.read_in... |
4a386eae4a8eda0f493a78bf7dad47c0ffe2559332e4cf01e059efe08b262823 | Python | 25,691 | 585 | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. 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 r... |
7822987b112ca392dada4e81a3205024e2f669be7bbcb0a81aea689f964c7b1b | Python | 25,724 | 603 | from PyQt6.QtWidgets import QGraphicsScene, QApplication, QPushButton, QLineEdit, QVBoxLayout, QFormLayout, QDialog, QGridLayout, QDialogButtonBox, QTableWidget, QHeaderView, QMenu, QAbstractItemView, QSizePolicy
from PyQt6.QtGui import QIntValidator, QAction, QCursor
from PyQt6.QtCore import Qt
from gui_utils.drawing... |
7a96e95084015f2d5fe578aa1e1dfdb32920651e421c532df1e7eb595b5135ff | Python | 25,728 | 628 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
f408929919fa471cb638479c0d4ef60805c0d2a8081f3f1679fe5b7dd79fbc1a | Python | 25,732 | 802 | ################################################################################
# Copyright (c) 2021-2024, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
# Written by D. Jones <djones@llnl.gov> and UCSD collaborators in listed in CONTRIB.md
#
# All rights reserved.... |
a38420f2942197495dfe1c4093781893cb7f89b23eccc50277b4cec6c9fc95eb | Python | 25,748 | 648 | """
This module is used to create a HedSchema object from a .mediawiki file.
"""
import re
import pandas as pd
from hed.errors import error_reporter
from hed.errors.exceptions import HedExceptions, HedFileError
from hed.schema.hed_schema_constants import HedKey, HedSectionKey
from hed.schema.schema_io import df_cons... |
b1d09c6e4a37e24c47c069d31c2f9fd09d4d002e27d4b294ed4a5f186b0196fe | Python | 25,765 | 567 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import dill
import os
import time
import glob
import re
import seaborn as sns
from sklearn.decomposition import PCA
... |
f68c30dae81b08502abf609675d31a7851aa0010124ff81d59e65a5b3ddffbca | Python | 25,767 | 628 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Main simulation script for setting up the model producing the data shown in
figure 4, 5 and 6 in:
Multimodal modeling of neural network activity: computing LFP, ECoG, EEG
and MEG signals with LFPy2.0
Espen Hagen, Solveig Næss, Torbjørn V Ness, Gaute T Einev... |
9a6f2d7ebc2a86939ddf0cd9292e0d26a91805055c0df4ccd89890e5a5bddf61 | Python | 25,796 | 325 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.