sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
f32fdd8da61cb056765db42bb988fbc1157a99a5fdaa18d84629a56875a371f1 | Python | 35,518 | 1,802 | from __future__ import annotations
# MG_RESUME_MORPHOMETRICS_V1
import inspect
import json
from ..checkpoint import (
CheckpointJournal,
atomic_write_bytes,
file_identity,
fingerprint,
source_digest,
)
from dataclasses import dataclass
from pathlib import Path
from typing import TYPE_CHECKING
im... |
cad0a80aeb388ca9c4c0b6fd71298a35603d30962288c8e1dfc056b9fa3dc993 | Python | 35,575 | 769 | options = dict(
verbose=True,
model_extensions=[
'h2o.model.extensions.ScoringHistoryTrees',
'h2o.model.extensions.VariableImportance',
'h2o.model.extensions.Trees',
'h2o.model.extensions.SupervisedTrees',
'h2o.model.extensions.Contributions',
'h2o.model.extension... |
68cc71d0a4eda2511b940966caac741bda0914526a94ac151750c3ab2e5c2f14 | Python | 35,598 | 959 | '''
Classes for representing tomograms with segmentations
'''
import os
import copy
import numpy as np
import scipy as sp
from shutil import rmtree
from .utils import *
from pyorg import pexceptions, sub, disperse_io
from pyorg.globals.utils import unpickle_obj
from pyorg import globals as gl
try:
import pickle ... |
9fe654ceaeecbcccb631ace45c89bfc16e38e0a094626a0c442914821607db72 | Python | 35,598 | 697 | """
Script for a GUI allowing to organize one or more selected files in a BIDS-complieant folder structure. The main steps are:
1) BIDS project folder selection - the selected folder will be printed on the GUI
2) Selection of desired files - the selected files paths will be printed on the GUI
3) Manually fill in metada... |
3c8cc0ca294da9a4f34923f6b250c6d950cb137a8d8a85b2dab82d492a2f8ae2 | Python | 35,610 | 989 | """
pygments.formatters.html
~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for HTML output.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import functools
import os
import sys
import os.path
from io import StringIO
from pip._vendor.pygments.f... |
dbbc967c3969def6e8fc8007f1cc1ed0613358703893e1ed56e926aee9b852f1 | Python | 35,613 | 697 | """
Script for a GUI allowing to organize one or more selected files in a BIDS-complieant folder structure. The main steps are:
1) BIDS project folder selection - the selected folder will be printed on the GUI
2) Selection of desired files - the selected files paths will be printed on the GUI
3) Manually fill in metada... |
40d549e35b5c94d6cd362f3aab21d50bc942ac7aad1ea06d0d1df40171daa9a5 | Python | 35,620 | 756 | #!/usr/bin/env python3
"""Release a HED schema (standard or library) from hed-schemas; see docs/release_guide.md.
Two subcommands, run from the repository root:
python scripts/do_schema_release.py prepare score 2.2.0 --next 2.3.0 # steps 0-8, before the PR
python scripts/do_schema_release.py notes score 2.2... |
0d47ec88fe8d2809c546709634baf0fce88819d1803bce703314bbd2e16e6711 | Python | 35,629 | 836 | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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... |
c02e0c24931cc0ce17d9a75a01f66a380a417aae0dd72b9dc00b04a5990ec9cf | Python | 35,667 | 827 | from __future__ import annotations
from collections.abc import Iterator
import numpy as np
from SurvivalEVAL.evaluations.util import (
_check_control_definition,
_inverse_censoring_weights,
check_and_convert,
check_and_convert_event_data,
)
from SurvivalEVAL.nonparametric_estimator.single_event impor... |
1b1993ba34cafe0f8504f907da43923ac1451618bc24e0547ada2d713e153703 | Python | 35,671 | 590 | import copy
import numpy as np
from scipy.spatial.transform import Rotation
from scipy.stats import pearsonr, spearmanr
from torch_geometric.loader import DataLoader, DataListLoader
from tqdm import tqdm
from confidence.dataset import ListDataset
from utils import so3, torus
from utils.sampling import randomize_pos... |
3a9aba316e3ea861b9ae9756c8d1dab096f3c6f5d2bf692c83b77c5f4434c59e | Python | 35,691 | 620 | """ Authored by: Neel Kanwal (neel.kanwal0@gmail.com)"""
# This file provides training code for vision transformer models mentioned in the paper.
# Update paths to processed datasets
if __name__ == "__main__":
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
warni... |
f97287f6a8d3804a586e8491a0e278fcd31ca276e67d0b4493f09e4946e1e1ec | Python | 35,738 | 626 | import copy
import numpy as np
from scipy.spatial.transform import Rotation
from scipy.stats import pearsonr, spearmanr
from torch_geometric.loader import DataLoader, DataListLoader
from tqdm import tqdm
from confidence.dataset import ListDataset
from utils import so3, torus
from utils.sampling import randomize_pos... |
b361e4aa1303b6354ca47cd8fc3494bb2676718c2b1065b9b59549c8796bfe9f | Python | 35,756 | 985 | import logging
import os
import numba
import numpy as np
import symengine as se
from h5py import File
from jitcdde import input as system_input
from ....utils.stimulus import OrnsteinUhlenbeckProcess
from ..builder.base.constants import EXC, INH, LAMBDA_SPEED
from ..builder.base.network import Network, SingleCoupling... |
5143329d3d4d74311a67cf7d4a1fd26405bac20b468e6a520eca297cc871384b | Python | 35,786 | 806 | # 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... |
2f091cd0255237398ecaea685b08d6eabf1d3b60cdd3d0198b9ebf9a0fe0b64d | Python | 35,798 | 958 | import serial
from serial.tools import list_ports
import time
from typing import Tuple, Optional
import struct
class SerialDevice:
"""
General wrapper for serial devices, with
automating device finding based on VID/PID
or serial number.
"""
def __init__(self, port=None, VID=None,PID=None,SN=Non... |
d8d8218b3a4bf63379db319b1b300ae7ce863dbfd7d2cf2ab5db356f5db86ef3 | Python | 35,800 | 693 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 6 10:09:47 2023
@author: daltonm
"""
from pynwb import NWBHDF5IO
from nwbwidgets import nwb2widget
import ndx_pose
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.art3d import Line3DCollection
from mpl_toolkits.mplot3d... |
8c8d85d3d4f929ccb0fe3795b11bc9a75bb9360a4557ade4b63c642901d2936f | Python | 35,827 | 812 | """Fit the midsagittal plane of every installed atlas and commit the result.
MAINTAINER-ONLY. This is the only thing that ever fits a plane for a built-in
atlas: no fit runs on a user's machine, at install, at upgrade, or at run time.
The maintainer runs this once per atlas, LOOKS at the result, and commits
``reg... |
78b11837dc5568c36e03a1095589b8962ec774e1f10aa9952af9cea89a7216dd | Python | 35,852 | 994 | import builtins
import collections
import dataclasses
import inspect
import os
import sys
from array import array
from collections import Counter, UserDict, UserList, defaultdict, deque
from dataclasses import dataclass, fields, is_dataclass
from inspect import isclass
from itertools import islice
from types import Map... |
96f657932c75a8034da057cfbd4662c54b7ffe1afdf57f01e736cc7b232f981b | Python | 35,867 | 947 | """
General definitions for the graph package
# Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry)
# Date: 19.09.14
"""
__author__ = 'martinez'
from . import geometry
try:
import disperse_io
except:
import pyseg.disperse_io
import scipy.sparse as sp
try:
from globals import *
excep... |
11d72ad1a9449a68b60bfde34d8c9fef5e910710e6db3dd601a74f93ca4675f0 | Python | 35,870 | 916 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 26 13:05:23 2021
@author: joaquin
"""
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 statsmodels.tsa.stattools import gr... |
59560e383a535f8ef66e78bde0fdec972d5557e82d6ff35ee027f3d586f157ca | Python | 35,895 | 856 | import os
import ujson
from skimage.transform import rotate
import numpy as np
from torch.utils.data import Dataset
from tqdm import tqdm
import sys
from pathlib import Path
import cv2
import random
from copy import deepcopy
import io
from utils import get_vehicle_to_virtual_lidar_transform, get_vehicle_to_lidar_trans... |
3f458bce5cb6156f2e2a83f636b850cd860810b1f817cee441fa006198fab545 | Python | 35,906 | 819 | """
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import matplotlib.pyplot as plt
import os
import numpy as np
from rastermap.utils import bin1d
from rastermap.sort import compute_BBt, compute_BBt_mask
import metrics
from fig_utils import *
alg_cols = plt.get_... |
0c5c258d9612ed2dd9ecd3754fdd34646d3e46d33f24b3b460865c9da3a8b5bc | Python | 35,925 | 959 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Copyright (C) 2020 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 Free Software Foundation, either version 3 of the License, or
(at you... |
88ef0aae91e086251898e75346634fc901c57ad6eca45170241b08152c6743bb | Python | 35,944 | 844 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import csv
import random
from matplotlib.colors import LinearSegmentedColormap
import torch
import pickle as pkl
import numpy as np
import enum
import os
import DiscRisk_constants as CONSTS
import s... |
8a772dca7886d199a6c5312333ae35c93ff1f09112962470217922d2058328b6 | Python | 35,946 | 1,646 | from __future__ import annotations
from dataclasses import dataclass
import numpy as np
import pandas as pd
# ======================================================================
# RESULT
# ======================================================================
@dataclass
class ResolutionDecisionResult:
"""
... |
a4aac4e61115c1e6f92244e211af177a936811250f2ce79a0a613bb0032c8328 | Python | 35,986 | 877 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2024 Clinic for Diagnositic and Interventional Radiology, University Hospital Bonn, 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 ... |
2381e1d75b32455b14bdcfe28ff95786a736b6c1dff43b309a402c3c32b0f5c4 | Python | 36,083 | 598 | import json
import os
import torch
import pickle
import logging
import warnings
import numpy as np
import pandas as pd
from tqdm import tqdm
from torch.utils import data as torch_data
from torchdrug import data
from torchdrug.core import Registry as R
from cg_maml_steps import cg_protein
logger = log... |
e9e789c0a65477ea8d6982abfb1e962787c5036b271ba8de41f284e22f69289c | Python | 36,094 | 831 | # coding=utf-8
# Copyright 2020-present 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 ap... |
a6ee6d3581be18ee220ad5f83bd26b12ab8a0b60f3709eba713af0b6266d8ef4 | Python | 36,173 | 1,132 | # -*. coding: utf-8 -*-
# Copyright (c) 2008-2012, Noel O'Boyle; 2012, Adrià Cereto-Massagué
# All rights reserved.
#
# This file is part of Cinfony.
# The contents are covered by the terms of the GPL v2 license
# which is included in the file LICENSE_GPLv2.txt.
"""
pybel - A Cinfony module for accessing Open Babel
G... |
8c7dd14ccc034766c449ded121aed353298773bd2dee375c72f49ff656925196 | Python | 36,182 | 872 | # -*- coding: utf-8 -*-
#
# Syncopy connectivity analysis frontend
#
# Builtin/3rd party package imports
import numpy as np
import h5py
# Syncopy imports
import syncopy as spy
from syncopy.connectivity.AV_compRoutines import (
NormalizeCrossSpectra,
NormalizeCrossCov,
GrangerCausality,
)
from syncopy.conn... |
643e9ab2593c133bffd7fa0aeae5bf41c403ad1a89055d1c69c4999b3e03c8e6 | Python | 36,231 | 885 |
from sklearn.decomposition import PCA
from scipy.cluster.hierarchy import inconsistent
#k=2
#fcluster(Z, k, criterion='maxclust')
int_to_marker=['o','^','s','p','H','d','*','8','1','2','3','4']
pad=100
for p in range(pad):
int_to_marker+=['.']
def ints_to_marker(int_list,max_int=10):
markers = ["v",'^','<','>... |
2ccdaac47b21c8920eb7c2dd286e9b62db85e12df97642b76a5fce69b5a2f52a | Python | 36,282 | 999 | # 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... |
30f631af6fae721599a3d62c386d316724e339da9904cc29991acbd75985b6ba | Python | 36,293 | 952 | import glob
import os
import os.path as osp
import sys
import re
import copy
import time
import math
import logging
import itertools
from ast import literal_eval
from collections import defaultdict
from argparse import ArgumentParser, ArgumentError, REMAINDER, RawTextHelpFormatter
import importlib
import memory_profi... |
92a3a25e22245ff2b80cde887a688e6ed0523c127796228256b11a9c23f43d1e | Python | 36,329 | 543 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 30 18:52:32 2024
@author: James, Stellaxu, Lokha, Sethu
"""
import numpy as np
import math
import os
import csv
import sys
# CSV Writer turns arrays into CSV files with given headers at specified location
def write_csv(filename, dat... |
7b4a5c986d52dcef87a4e275398d271ccf2cb29f32e08eccd69cbb19b5e342d4 | Python | 36,337 | 783 | #!/usr/bin/env python
# =============================================================================
# GLOBAL IMPORTS
# =============================================================================
import os
import numpy as np
import pandas as pd
from typeIII_analysis import mae, rmse, barplot_with_CI_errorbars, plot... |
f99866f54d1068b09c756fcfdefc1ff28b7f47e64a79af2f74a5cff1cfaaa88e | Python | 36,391 | 1,112 | # 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... |
c4e1385e1d1d2a85e64e2f39082ef41a3cd36605a14d43df90010f422f35d31e | Python | 36,442 | 752 | import platform
import os, getpass, sys
import pytorch_lightning as pl
from pytorch_lightning import loggers as pl_loggers, seed_everything
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint, LearningRateMonitor, StochasticWeightAveraging
from pytorch_lightning... |
5ac68696a9275353f7ea0b47efb9183fcaa3ca61b3344382461234eceea810e7 | Python | 36,470 | 955 | from typing import Callable, Tuple, Any
import numpy as np
import netket as nk
import jax
import jax.numpy as jnp
import flax.linen as nn
from typing import Any, Tuple
from flax import struct
from netket.utils.types import DType, PyTree, Array, Callable
import copy
from functools import partial
import numpy as np
impor... |
486acab020b8423658b56a7f93c5eb33787c9e08ca3b1ee211f318c7831bf13b | Python | 36,572 | 1,073 | # 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... |
09d75f9a72485d748a346c7724469e3cd5cc799e51f7897ba5831aac38499cad | Python | 36,637 | 1,576 | from __future__ import annotations
# MG_RESUME_MAPPING_V1
from ..checkpoint import (
CheckpointJournal,
atomic_write_bytes,
file_identity,
fingerprint,
source_digest,
)
from ..core.instance_map import (
validate_instance_map,
)
from ..plots.style import (
cluster_display_order,
)
from d... |
d01ff903db9a8a6f41c3bb99c95dacccf84a2c498b4954453abe6a647d2ab575 | Python | 36,644 | 1,010 | import igraph as _ig
from . import _c_louvain
from .functions import _get_py_capsule
import sys
# Check if working with Python 3
PY3 = (sys.version > '3')
class MutableVertexPartition(_ig.VertexClustering):
""" Contains a partition of graph, derives from :class:`ig.VertexClustering`.
This class contains the basic... |
147f225712deb70f048be452932197442d69f2aac3fc4726653e8351746ce3ea | Python | 36,838 | 874 | from PyQt6.QtWidgets import QGraphicsScene, QApplication, QPushButton, QLineEdit, QVBoxLayout, QFormLayout, QDialog, QGridLayout, QDialogButtonBox, QTableWidget, QHeaderView, QMenu, QAbstractItemView, QSizePolicy, QStyle, QStyleOptionSlider, QSlider
from PyQt6.QtGui import QIntValidator, QAction, QCursor, QPen, QBrush,... |
1d25644554ebfdb1a7f3869392f52b7a364f48604bfcd9e6e3404bcdc820b8e6 | Python | 36,846 | 657 | from scipy import sparse
import torch
import numpy as np
import os
import subprocess
from ase import Atoms
from ase import neighborlist
from collections import Iterable
import schnarc
from schnetpack import Properties
from schnetpack.environment import SimpleEnvironmentProvider, collect_atom_triples
import torch
clas... |
0e327470f82f84e474bb60910280e72df46a8e44fc2cd7b58781bb62452cff7c | Python | 36,857 | 885 | # set QT_API environment variable
import os, sys
os.environ["QT_API"] = "pyqt5"
import qtpy
# qt libraries
from qtpy.QtCore import *
from qtpy.QtWidgets import *
from qtpy.QtGui import *
from control._def import *
import control.tracking as tracking
import control.utils.image_processing as image_processing
import con... |
429f3573b05800119151ad37d40361255d09955e5ad536b3ee0eb5c7da329312 | Python | 36,862 | 702 | # -*- coding: utf-8 -*-
# @title Generate configuration files for bioemum
# @file gen_conf_snn_hh.py
# @author Romain Beaubois
# @date 06 Oct 2023
# @copyright
# SPDX-FileCopyrightText: © 2022 Romain Beaubois <refbeaubois@yahoo.com>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# @brief Script to g... |
d9a9482c4d4b8797aa8852598f34643105e894d2511d8e6805077ebe66581453 | Python | 36,913 | 388 | ######################## 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... |
351a6c2cb260a6bafdb9e75b9c4784e8a5cc3a9baa8e55ff10813cad37d996d3 | Python | 36,923 | 972 | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 24 16:49:37 2021
@author: alpha
Roadmap:
- Improve the performance
- Migrate to npe2
- Do loading in separate thread
- Write the tests
"""
import random
import string
import napari
from magicgui import magic_factory
from napari_plugin_engine import napari_hook_implement... |
91c3cb96ef59d362f9e11c2fd73890c0f454f02da2167ff57deaa05b365d3149 | Python | 36,931 | 1,076 | # 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... |
e0cacb6af2b2a8c3fe46e1e4b57de2bbdc89261a422f447704ec8138ce6bec5a | Python | 36,939 | 877 | import argparse
import csv
import html
import json
import logging
import os
from calendar import month_name
from datetime import datetime
from functools import partial
from pathlib import Path
from zoneinfo import ZoneInfo
os.environ.setdefault("MPLCONFIGDIR", "/tmp/matplotlib")
os.environ.setdefault("XDG_CACHE_HOME",... |
3051089cac453d87b7c2a762c7f3f07eb0d82481ecf9c5e3a6587985880e7b96 | Python | 37,000 | 885 | import os
from collections.abc import Mapping
from datetime import datetime
from pathlib import Path
from typing import Any, TypeAlias
import mdtraj as md
import numpy as np
import openmm
from numpy.typing import NDArray
from openmm import app, unit
from tqdm import tqdm
from yaml import safe_load
from . import build... |
e8812d1f823d5a0483e853963ae42d6ad820b73de7f339f547a959e56bfa2ef2 | Python | 37,049 | 1,041 | #!/usr/bin/env python3
# ******************************************
#
# SHARC Program Suite
#
# Copyright (c) 2023 University of Vienna
#
# This file is part of SHARC.
#
# SHARC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... |
130025f0237198107726284d95190ade0311474c54bfd42319f49f09c516408a | Python | 37,055 | 812 | #!/usr/bin/env python
from PyQt5.QtCore import Qt, QSize, QSettings, pyqtSignal, pyqtSlot
from PyQt5.QtWidgets import (QApplication, QCheckBox, QComboBox, QDialog,
QGridLayout, QPushButton, QRadioButton, QColorDialog,
QDialogButtonBox, QFrame, QGroupBox, QHeaderView, QLabel, QLineEdit,
QTabWid... |
2edc4a1006f261e017c3b6cc50d86d021d74c801135b21c78357c7e2fcb69c64 | Python | 37,073 | 840 | #!/usr/bin/env python
from itertools import chain
from platform import system
import numpy as np
from Bio import AlignIO
from PyQt5.QtCore import QFile, QFileInfo, QPoint, QSettings, QSize, Qt, QTextStream, QDir
from PyQt5.QtGui import QIcon, QKeySequence, QFont, QColor, QPixmap
from PyQt5.QtWidgets import (QAction, ... |
ce7bad34e01b056095232c2dfe91fd7f3a4f865e20928d69c3867e2944926649 | Python | 37,078 | 818 | """
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
"""
from pathlib import Path
import os,sys
import numpy as... |
1f552aa33402992d269f1c3d24bd445a07c32e118768852aa73be772113c37fd | Python | 37,101 | 789 | from __future__ import annotations
from typing import TYPE_CHECKING, Literal
from pertpy._logger import logger
if TYPE_CHECKING:
from collections.abc import Iterable
from matplotlib.pyplot import Figure
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy import stats
from per... |
32aee05846ec5a31b3a827efc8e2e3cd755116947e1d134b68c65f48a92f799e | Python | 37,168 | 870 | """
Superclass representing a basic columnar file.
"""
import csv
import io
import os
import warnings
import openpyxl
import pandas as pd
from hed.errors.exceptions import HedExceptions, HedFileError
from hed.models.column_mapper import ColumnMapper
from hed.models.column_metadata import ColumnMetadata
from hed.mode... |
58881d060e861d72301f203add9b43a5d859db798eba4a8da3c9531080de759f | Python | 37,328 | 853 | import torch
from torch import nn
import numpy as np
from ConditionalNeuralField.cnf.components import BatchLinear, FeatureMapping, NLS_AND_INITS, FourierLayer, GaborLayer
from ConditionalNeuralField.cnf.initialization import *
# auto encoder: full projection
# siren based
# auto decoder: full projection
# in cons... |
c9fe174b64e7bc7da5fa52f6150d8e8479f2ae0f42834e0e2292cbfbd331eca2 | Python | 37,341 | 1,006 | # 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... |
920f2815a3f2dece883554b1701334eaf0d3d3303e8f13e022297d05b84fbb5e | Python | 37,379 | 866 | # 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... |
3f7d0bda168b7e8da5b3217076e95f6d3e6dad30db6c8d76be16f63455ec5050 | Python | 37,386 | 1,309 | # 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... |
64ebede492ecc280b825e8cb3ed64e6680aecacb043bdd4374bf053e5bf07966 | Python | 37,395 | 1,094 | from __future__ import division
from __future__ import print_function
import os
import math
import matplotlib.pyplot as plt
import numpy as np
import datetime
import tensorflow as tf
import json
import logging
import shutil
import argparse
import sys
import pickle
import importlib
import ast
import glob
import copy
im... |
fe0e94c4cf41af0a2847f28bebb047cefaa19d9b61d0baac3f4068f71cd8401f | Python | 37,448 | 974 | import logging
from copy import deepcopy
from itertools import chain, islice
import numpy as np
import symengine as se
import sympy as sp
from jitcdde import t as time_vector
from jitcdde import y as state_vector
from .....utils.collections import flat_dict_to_nested, flatten_nested_dict
from .backend import BackendI... |
c50ca214d3f7c4649b8b2e277648a48b092e95c163a5ba4df2c737da8d6734d8 | Python | 37,460 | 823 | # 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... |
1c03d2736021d8f215c0d8f31aaa7734a4315c7f067dd079fdc5ad3d01fa9664 | Python | 37,465 | 917 | """
Burst detection based on time-frequency decomposition.
Removal of aperiodic activity based on the FOOOF algorithm,
and estimation of true beta and mu bands based on the
periodic activity.
"""
import pickle
import numpy as np
from os.path import join, exists
from scipy.signal import peak_widths
from mne.time_freq... |
9a2b2714f5ff041e05e8c0509c9e792d4f2cc806b51b6e30d3191d7f4b3290bc | Python | 37,478 | 725 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 6 10:09:47 2023
@author: daltonm
"""
from pynwb import NWBHDF5IO
import ndx_pose
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.art3d import Line3DCollection
from mpl_toolkits.mplot3d.axes3d import Axes3D
from importl... |
396ba737f9ca95080edce24ce14c71957e08c630337183621cba781979d1f473 | Python | 37,479 | 854 | from typing import Dict, Union
import torch
import numpy as np
from sklearn.decomposition import PCA
from torch.fft import fft, ifft
from torch.nn.functional import pad
from ..base_transform import EEGTransform
class RandomEEGTransform(EEGTransform):
def __init__(self, p: float = 0.5, apply_to_baseline: bool = ... |
382ada77afda9211c9a4a01a8cdf142037d0cd21eb0020ee8d79c73ba8fb411b | Python | 37,548 | 724 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 6 10:09:47 2023
@author: daltonm
"""
from pynwb import NWBHDF5IO
import ndx_pose
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.art3d import Line3DCollection
from mpl_toolkits.mplot3d.axes3d import Axes3D
from importl... |
77d713c1843c5f00cc2a89bf1f818f406c486ca4d535be5925c7050dc6825909 | Python | 37,584 | 1,225 | # 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... |
87b63aedbdec32b9a5efcd0ee2614b2188b68337f2a87ad3d46c8c749257a906 | Python | 37,593 | 1,089 | # 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... |
26ef1e073ce1b252f10493c705a414e5f654b8d2231850fd390031e402b244ae | Python | 37,606 | 701 | ########################################################################
# ------CRISPRspec and CRISPRoff scores computation Pipeline----
#
# Copyright (c) 2018 by the contributors (see AUTHORS file)
#
# This file is part of CRISPR-OFF webserver.
# This is a free software: you can redistribute it and/or modify
# ... |
2e942215142fe99d79dfd10daea810a79cb8b015886aa60543ac47dfe0d7ca96 | Python | 37,610 | 1,079 | from __future__ import annotations
import argparse
from pathlib import Path
import pandas as pd
import json
from dataclasses import dataclass
from typing import Any
from itertools import cycle
import numpy as np
import re
import matplotlib.pyplot as plt
import dendritic_spine_args
ntasks_pattern = re.compile("ntasks... |
3f3a807b969d8421e228946cf1a63d4b4ff6e69f559245242406959153e829fe | Python | 37,610 | 701 | ########################################################################
# ------CRISPRspec and CRISPRoff scores computation Pipeline----
#
# Copyright (c) 2018 by the contributors (see AUTHORS file)
#
# This file is part of CRISPR-OFF webserver.
# This is a free software: you can redistribute it and/or modify
# ... |
7eb015209c2dc099fe69e1ce410e4c006e3c4aebe28b0631351943d747926dea | Python | 37,622 | 846 | """
Mesaures metrics to analyze membrane particles relationships
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
+ Each TomoParticles object must contain the membrane segmentation as meta-information indexes by the
key omMbSegment... |
2b0e465aa643daf10f951cb1e8e274664d77a2935f2002ed69c1103b6a717744 | Python | 37,661 | 1,169 | """Tools for generating E3FP fingerprints.
Author: Seth Axen
E-mail: seth.axen@gmail.com
"""
from __future__ import division, print_function
import os
import logging
import numpy as np
from rdkit import Chem
import mmh3
from python_utilities.io_tools import touch_dir
from python_utilities.scripting import setup_loggi... |
2af334be581574a6587dc634a2a0d69e0288cc22a0c49eb83e2faf89937af131 | Python | 37,704 | 951 | # 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... |
f1c8f45270969683fe0f010cd2604372bfc4ca699e7d637abf7719e1dbc78fa5 | Python | 37,836 | 1,111 | import implementation
def run_figure_4(seeds):
# Touch-evoked
for seed in seeds:
# Hierarchical
model, model_ema = implementation.train_model(
seed = seed,
dataset = "touch-evoked",
training_data_ablation = None,
architecture = "hierarchical",
... |
a14fe48fabd44e8d54e3c20e79e0c3403a94eda5694c76725fe8966638765169 | Python | 37,841 | 794 | """
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
"""
####################################################
#... |
89a911115ffa5d9920c54acc7e2bbcee36a8dd23ecd5c737dde0ced659e8ceed | Python | 37,848 | 787 | """
Functions to create meshes for mechanotransduction example
"""
from typing import Tuple
import pathlib
import numpy as np
import dolfin as d
from mpi4py import MPI
from sympy.parsing.sympy_parser import parse_expr
from smart.mesh_tools import implicit_curve, compute_curvature, gmsh_to_dolfin, facet_topology
def c... |
308a73a9a2f840dbd52cf4e6a5fbf4717d58563037e8e31b453c6a7aaa5c9da5 | Python | 37,856 | 734 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 6 10:09:47 2023
@author: daltonm
"""
from pynwb import NWBHDF5IO
import ndx_pose
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.art3d import Line3DCollection
from mpl_toolkits.mplot3d.axes3d import Axes3D
from importl... |
34c983b44d430bbe3518c5df61fccf488f54ea8a46694ca78b97048e52cad1c4 | Python | 37,864 | 749 | """
Comprehensive tests for schema extras sections across all formats.
Tests that extras (Sources, Prefixes, ExternalAnnotations) are correctly:
1. Read from all formats (XML, JSON, MediaWiki, TSV) with in_library tracking
2. Have consistent internal representation across formats
3. Round-trip correctly (read → write ... |
836dc376ca08ff7657bbc3ea206cda8e8b3bad86fa4187e3705107e69523d2c7 | Python | 37,866 | 736 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 6 10:09:47 2023
@author: daltonm
"""
from pynwb import NWBHDF5IO
import ndx_pose
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.art3d import Line3DCollection
from mpl_toolkits.mplot3d.axes3d import Axes3D
from importl... |
aeb530e2f8fb404fde32dd36da3c3efb04222b39cc694815064275502ad5531a | Python | 37,873 | 1,029 | """Routines related to PyPI, indexes"""
import enum
import functools
import itertools
import logging
import re
from typing import TYPE_CHECKING, FrozenSet, Iterable, List, Optional, Set, Tuple, Union
from pip._vendor.packaging import specifiers
from pip._vendor.packaging.tags import Tag
from pip._vendor.packaging.uti... |
0db93a6c6bd158f5d565596d3f9ae633c70e2e1e39b9704fe3c6b5fe8c2f58b2 | Python | 37,883 | 1,234 | import os
import clio
import hashlib
import requests
import numpy as np
import pandas as pd
import datetime as dt
import neuprint as neu
import seaserpent as ss
import caveclient as cc
from pathlib import Path
from fafbseg import flywire
from urllib.parse import urlparse
from functools import lru_cache
CACHE_DIR = "... |
2814eaef0076207bfa024157ca746eba48b2a1a46e8af537c518768f27809d63 | Python | 37,895 | 871 | #!/bin/env python
import argparse
import re
import os
import tempfile
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
## Importing gzip or pgzip module for file compression
print("------------------------------------------")
print(f"Compression Library Use:")
try:
import pgzip as gzi... |
6c6a069d040bac94630c042d6cab8f41dcbedb9f353208116ab1b42a89619ced | Python | 37,896 | 733 | #!/usr/bin/env python
# =============================================================================
# GLOBAL IMPORTS
# =============================================================================
import os
import numpy as np
import pandas as pd
from logD_analysis import mae, rmse#, barplot_with_CI_errorbars
from lo... |
378c6495f89b485c5df519a69de6d48ceecf4034a0225c7a57b0ca7f8a242882 | Python | 37,902 | 950 | from __future__ import annotations
import pickle
import warnings
from pathlib import Path
import numpy as np
import pytest
from scipy.optimize import NonlinearConstraint
from bayes_opt import BayesianOptimization, acquisition
from bayes_opt.acquisition import AcquisitionFunction
from bayes_opt.domain_reduction impor... |
6beced00d878d5d1d9207c6ea119a9900ae52bb9e668449505e39430c52812fc | Python | 37,949 | 888 | # 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... |
4a118562fd0c81c36f48e066828068f56df5e01d28fa1fe60bf95575ddd02fff | Python | 37,973 | 952 | from __future__ import annotations
import warnings
import numpy as np
import pandas as pd
from lifelines import WeibullAFTFitter
from scipy.integrate import simpson, trapezoid
from SurvivalEVAL.evaluations.custom_types import Numeric
from SurvivalEVAL.evaluations.util import (
_inverse_censoring_weights,
che... |
70ae110f051c4b241f528c4f19c408f2e985b402e3dff19b37e1b7319f34a1f9 | Python | 38,047 | 1,005 | from importlib.util import find_spec
import numpy as np
import pandas as pd
import pytest
import scanpy as sc
import scipy.sparse as sp
from anndata import AnnData
from mudata import MuData
import pertpy as pt
from pertpy.tools._milo import _nb_lrt, _tmm_factors
@pytest.fixture(params=["edger", "pydeseq2"])
def sol... |
e92c2d25b0b80a24e70944aca8797afb8cc0531e09b01319647f5d09efc1a0cb | Python | 38,069 | 858 | import logging
# no need to set handler here, since we already set handler in root logger (utils.py), this child logger inherit that.
logger = logging.getLogger(__name__)
logger.info('Import sem.py')
import numpy as np
import tensorflow as tf
from scipy.special import logsumexp
from tqdm import tqdm
from .event_models... |
25d3940c40c158b94c168d03a69f0f4da0e76fb646e92abe60b56a3305ad6f99 | Python | 38,140 | 990 | # 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... |
3c52fc1118a44e0ced059d8b88a7923d7ae10cca977c5e80d5baf55369a8edb6 | Python | 38,140 | 1,119 | # -*- coding: utf-8 -*-
import collections
import os
import random
import re
import subprocess
import tempfile
import warnings
import numpy as np
import tensorflow as tf
from six.moves import urllib, xrange
from tensorflow.python.platform import gfile
from . import _logging as logging
__all__ = [
'generate_skip... |
dc6440c673d3df19112012aea70470f69add616dd62711aa3154821a8cc087ab | Python | 38,162 | 998 | import time
import numpy as np
from control._def import *
import threading
import control.toupcam as toupcam
from control.toupcam_exceptions import hresult_checker
def get_sn_by_model(model_name):
try:
device_list = toupcam.Toupcam.EnumV2()
except:
print("Problem generating Toupcam device l... |
8b645dd4926f4b119e6969b4adde0b3910e32ee5fd1b1282a9ef449fbcf791a1 | Python | 38,211 | 1,035 | # 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... |
060609b4be0b6c281e2a1a7faf18caac8cc786712b5d9615e499b51756d45d1e | Python | 38,234 | 926 | # coding=utf-8
# Copyright 2018 Salesforce and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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
#
# h... |
56bae7f776ae98c0f3747c6c43ac2868c196fe684431b7c1f550464cd7472ae5 | Python | 38,275 | 911 | # Node-group asset "Style Surface" (GeometryNodeTree), dumped by nodebpy.assets.dump_library.
# Rebuild the library with nodebpy.assets.build_library (nodebpy build).
# _build_group() is the source of truth: the docstring, __init__ and accessors are regenerated from it on the next dump.
from typing import TYPE_CHECKING... |
6435bcf69735b107664e0c915b1d5ac89d57d336369a9aecc083c2813880d0a1 | Python | 38,278 | 1,152 | """
This script calculates the statistics for the memorization and regularization results.
A path to the folder with all results (mem_data.csv and reg_data.csv) is required.
The script will output the results in a subdirectory of the same folder.
"""
import argparse
import glob
import os
from typing import Tuple, Union... |
f9e37b731a6c0d6b5914ec7b7e0da0167a2c4048ee03749f943d096228150db3 | Python | 38,293 | 817 | # -*- coding: utf-8 -*-
"""
Functions for mapping AHBA microarray dataset to atlases and and parcellations
"""
from functools import reduce
import logging
import warnings
import nibabel as nib
import numpy as np
import pandas as pd
from . import (correct, datasets, images, io, matching, probes_, reporting,
... |
538ac383dabb8e38fce93a04f5ffc7ac0f8d8f69a550b77c06ee49b65a7478eb | Python | 38,323 | 576 | #!/usr/bin/env python
import os, sys, argparse, random;
import tensorflow as tf;
from tensorflow.python.keras import backend as K
import numpy as np;
import pandas as pd
from sklearn import preprocessing, metrics
from sklearn.linear_model import RidgeCV
import scipy
from scipy.io import mmread
import math
... |
6112a86833e0096e7c15e9de1b0b6b34d9585e04ed0fbff80600b080a2731285 | Python | 38,323 | 961 | """
Tests class Segment.
Only the layers related methods tested in the moment.
# Author: Vladan Lucic
# $Id$
"""
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
#from past.utils import old_div
__version__ = "$Revision$"
from copy import copy, deepcopy
i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.