sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
65554844180e314789b10219c3b1484aa4b0f1d5cb0e296652dd6e0d70ba0545 | Python | 18,059 | 403 | #===========================================================================
# Import, Set up MPI Variables, Load Necessary Files
#===========================================================================
from mpi4py import MPI
import time
tic_0 = time.perf_counter() #script runtime calculation value
import os
from o... |
a00482b97f033562dfd96a21ad36878a2ad70a5794aad9b3e9c189b38fc937ef | Python | 18,059 | 467 | #!/usr/bin/env python
# Copyright (c) 2018-2019 Intel Corporation.
# authors: German Ros (german.ros@intel.com), Felipe Codevilla (felipe.alcm@gmail.com)
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
CARLA Challenge Evaluator Routes
Provisio... |
958de0fa2187d03346d0a1e7a409ea7adb9f7be983f61eef9777cf579af52e1f | Python | 18,062 | 410 | """
Generates a ListTomoParticle object from a input STAR file (translocon project version)
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import vtk
impor... |
7ce2a76557e2537a1cf423d2ce3254b0c9395537e039fa4d856a1b507d2c0258 | Python | 18,065 | 546 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
import logging
import platform
import subprocess
import sys
import sysconfig
from importlib.machinery import EXTENSION_SUFFIXES
from typing... |
a63f0d01bd7c704fb44cec700f0768fbc85acc30ac0bfb29015467eff63dbb78 | Python | 18,065 | 445 | # -*- coding: utf-8 -*-
#
# Test proper functionality of Syncopy's `BaseData` class + helpers
#
# Builtin/3rd party package imports
import os
import tempfile
import h5py
import time
import pytest
import numpy as np
# Local imports
from syncopy.datatype import AnalogData
import syncopy.datatype as spd
from syncopy.sha... |
52544a0dd403979f3e7143a1b63c4985b2c2097e6cf211aa04327c395c0cf77b | Python | 18,080 | 401 | import argparse
import os
from collections import namedtuple
import numpy as np
from learn_tools.active_gp import ActiveGP, POUR_MLP_HYPERPARAM_3000, SCOOP_MLP_HYPERPARAM_3000
from learn_tools.collect_simulation import start_task, complete_task, get_parameter_result
from learn_tools.learnable_skill import load_data
f... |
fe50318306d99f15fde6b8c2e6b16d132c41a63ab676c58fd189bf453d809186 | Python | 18,084 | 379 | #!/usr/bin/env python3
"""Generate ``schema_versions.json`` - a single manifest of every HED schema version.
The manifest is a *listing* only: it records, for the standard schema and every library, which
versions exist (released / prerelease / deprecated) together with each XML file's git blob SHA and
last-commit date... |
6de7fe67f8f45f33d4d84d401c940dbc660da2f4b176224c6b72486da9d09bb8 | Python | 18,099 | 513 | """distutils.util
Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
"""
import importlib.util
import os
import re
import string
import subprocess
import sys
import sysconfig
import functools
from .errors import DistutilsPlatformError, DistutilsByteCompileError
from ... |
0669132a68939389b6723fa2b9e9626adc33deeb7ff52b000415b9d6f9d09d95 | Python | 18,102 | 437 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
import time
from zipfile import ZipInfo
from .compat ... |
5223471b0feb400c5381ca3e86474eb261d2efbf25b4d4f93f70fb1e5c9f6c88 | Python | 18,103 | 515 | # -*- coding: utf-8 -*-
import copy
import tensorflow as tf
from .. import _logging as logging
from .core import *
__all__ = [
'PoolLayer',
'MaxPool1d',
'MeanPool1d',
'MaxPool2d',
'MeanPool2d',
'MaxPool3d',
'MeanPool3d',
'GlobalMaxPool1d',
'GlobalMeanPool1d',
'GlobalMaxPool2d... |
ff580b5fc8754a0a6301d6023fd5ea537ef34635ed539665886cb720cf967123 | Python | 18,106 | 546 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
import logging
import platform
import subprocess
import sys
import sysconfig
from importlib.machinery import EXTENSION_SUFFIXES
from typing... |
9a3870b9d0b1f5694b364c59ebf90e2a6b9e174acba14da2d7178048a17aca24 | Python | 18,116 | 526 | import logging
import os.path
import pathlib
import re
import urllib.parse
import urllib.request
from typing import List, Optional, Tuple
from pip._internal.exceptions import BadCommand, InstallationError
from pip._internal.utils.misc import HiddenText, display_path, hide_url
from pip._internal.utils.subprocess import... |
e4c50f2b739c0ac761b1ba335446c27ccd79b71f1b0b58a1725535f53ebb0f4d | Python | 18,121 | 517 | from types import ModuleType
from typing import Generic, Literal, TypeVar, overload
import bpy
from nodebpy import TreeBuilder
from nodebpy import geometry as g
from nodebpy import shader as sh
from .nodes._assets import link_asset_groups
from .nodes.materials import (
ambient_occlusion,
default,
flat,
... |
2f450b31991a884576aafb3adcd606042ad307af741dff148b354715f7a6069a | Python | 18,125 | 466 | # 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... |
b1b9abc2ca7196740ec45fc27eb63ab9cc6dcdda2c814c56154226dac0c6daa2 | Python | 18,130 | 518 | import os
import logging
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.colors import Normalize
import logging
import tqdm
from scipy import stats
from ...utils import functions as func
from ...utils import paths as pat... |
2ea4c3b68e96f767618114b2f2f14198f5387f05b518bb54f5501f971ccf8158 | Python | 18,133 | 543 | import json
import os
import yaml
import numpy as np
import pandas as pd
from scipy.io import loadmat
from scipy.stats import gaussian_kde
state_lower_e_to_i = {
'groundstate': '04d270ef4972dcc9e4e6938202b000d7',
'bestfit': '4030a96f4369bd3ea2844d0427d1e4d7',
}
state_scaling_lichtman_chii2_sm... |
e9882611ea5e9624db1fed40be702c41e63a7c96e93cc58a2052f1a51a9f5c7b | Python | 18,134 | 574 | #
# 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,... |
fe0f48b1bed3b970565325460313ebb01c2e040a3671ad387d2c50c7660a4993 | Python | 18,145 | 405 | """GUI tab for the Cellpose model-training launcher.
The tab is intentionally thin: it shows the human-in-the-loop training steps and
launches the **Cellpose GUI** (``python -m cellpose``) in its own Python
subprocess. Cellpose's GUI is a Qt application and, like napari, must not run
in-process alongside this la... |
b355333c19ff69526c035c7704df048ec11aa0741efdc08dece7e0e63aa403de | Python | 18,155 | 333 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 5 2024
@author: MegNParker
"""
#%%
import numpy as np
import pandas as pd
import statsmodels.api as sm
import statsmodels as statsmodels
import math
from scipy.stats import skew
from scipy.stats import kurtosis
# Import date class from datetime ... |
f7fd07374f5df8f72c1bc3356b2cb415fe7981152c0f3fab0a6d3cb6dd709b77 | Python | 18,157 | 423 | """Atlas family + variant sub-dropdown.
The main atlas dropdown lists FAMILIES (Allen CCF, Waxholm, Custom). When the
selected family has more than one installed variant (Allen CCF: 25 µm / 10 µm,
plus Nissl once downloaded), a variant sub-dropdown appears. ``selected_atlas``
stays the variant-level registry key ... |
c26d686cce789e8871b2b52df264bee9f2a472e6d31cea9cc191f146435e76cd | Python | 18,164 | 437 | from __future__ import annotations
from abc import abstractmethod
import numpy as np
import torch
from torch.utils.data import DataLoader
import model as module_model
import utils.runner.loss as module_loss
import utils.runner.metric as module_metric
import utils.runner.plot as module_plot
from base import BaseModel
... |
75a8e518d951e560c35c4eca278968b2f16dabd23f94590e1e3b728fd720b515 | Python | 18,166 | 307 | """Command-line interface to package treem."""
# pylint: disable=too-many-statements
# pylint: disable=ungrouped-imports
# pylint: disable=unused-import
import argparse
import sys
from treem.io import SWC
from treem.commands.check import check
from treem.commands.view import view
from treem.commands.find import fin... |
8b91289e0e54c95079853f32a24008f48b551773a1c4b311e742416639d8121c | Python | 18,173 | 386 | import torch.nn as nn
import torch
import torch.nn.functional as F
from typing import Callable, Optional
from torch import Tensor
import numpy as np
import math
def get_transformer_encoder_module(seq_len, seq_dim, n_layers, d_model, n_heads, d_ff, dropout, norm_type='bn',
activatio... |
a84633e8785ebfaa590cac20f17949c71701c45591a1d481e4d8824a15ec0546 | Python | 18,175 | 400 | from torch.utils.data import Dataset, DataLoader
import torchvision.transforms as transforms
import random
import numpy as np
from PIL import Image
import json
import torch
import os
from autoaugment import CIFAR10Policy, ImageNetPolicy
from torchnet.meter import AUCMeter
import torch.nn.functional as F
from... |
337599dca8573dcf3ee3f88874b19c9242288ba0fdf4670f91dd30a99129cf31 | Python | 18,176 | 449 | #
# Computational scaffolding for user-interface
#
# Copyright © 2020-2025 Ernst Strüngmann Institute (ESI) for Neuroscience
# in Cooperation with Max Planck Society
# Copyright © 2026 Ernst Strüngmann Institute (ESI) of the Max Planck Society
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Builtin/3rd party package imp... |
ebb7ebaed81e296e7c5378460f68379ec9a2b41f903805d8e02f1e425f5ca98c | Python | 18,191 | 446 | # -*- coding: utf-8 -*-
from __future__ import annotations
import os
from typing import TYPE_CHECKING, Iterable, List, Optional, Tuple, Union
import nltk
import torch
from supar.models.const.crf.transform import Tree
from supar.utils.common import NUL
from supar.utils.logging import get_logger
from supar.utils.toke... |
1fb5b0002d3052fb6996d73631c1dba3e474838abdef05321adbabadd5eac423 | Python | 18,193 | 391 | import argparse
import collections
import gzip
import math
import os
import random
import shutil
import subprocess
import sys
import time
import numpy as np
import pandas as pd
import utils
import tabix as tb
import tensorflow as tf
import pybedtools as pybt
import pyximport; pyximport.install()
import cython_fxn
f... |
1766a6a3ae5d94536b76a2e424b97ff12f07f68dcc416cd3c10830b39f5e23a1 | Python | 18,200 | 450 | """
An example that uses TensorRT's Python api to make inferences.
"""
import ctypes
import os
import shutil
import random
import sys
import threading
import time
import cv2
import numpy as np
import pycuda.autoinit
import pycuda.driver as cuda
import tensorrt as trt
CONF_THRESH = 0.5
IOU_THRESHOLD = 0.4
def get_img... |
21e754c3fac50e8f077a6a1cbbec91713bb8d32fe152e1157053bbfb34805f45 | Python | 18,206 | 515 | import importlib
from unittest.mock import patch
import numpy as np
import pytest
from SurvivalEVAL import CompetingRisksEvaluator, auc, auc_cr, auc_cr_per_event
@pytest.fixture
def cr_auc_data() -> dict[str, np.ndarray]:
return {
"predict_probs": np.array([0.8, 0.9, 0.4, 0.3, 0.6, 0.99]),
"even... |
834f61924e50c1c4e89533bb1b2b9fa1e359fa652c4b8632c1360571174772e1 | Python | 18,207 | 566 | # Auto-generated by nodebpy.assets.dump_library — do not edit manually.
from .accumulate_axis_rotation import AccumulateAxisRotation
from .angstrom_to_world import AngstromToWorld
from .animate_action import AnimateAction
from .animate_dihedrals import AnimateDihedrals
from .animate_frames import AnimateFrames
from .an... |
0890317e542800b95b3f694c4e98d6411c83daab57ee7d21dd14a91ed3845e82 | Python | 18,212 | 465 | import torch
import numpy as np
import pandas as pd
import scanpy as sc
import matplotlib
import matplotlib.style
import matplotlib.pyplot as plt
import anndata
import seaborn as sns
from scipy import sparse
from scipy import stats
# from models.scgen_model import SCGEN
# from models.gimVi_model import gimVi_model
# fr... |
ffec32afb41f9d4775819b1c5040dd684ace69d931a95d4fdc02395e59119351 | Python | 18,212 | 491 | ##
# \file intensity_correction.py
# \brief Class containing functions to correct for intensities
#
# \author Michael Ebner (michael.ebner.14@ucl.ac.uk)
# \date Nov 2016
#
# Import libraries
import sys
import SimpleITK as sitk
import numpy as np
from scipy.optimize import least_squares
import time
impo... |
96b8698c3477b617d78539d83e12a0d556e5092893c8e57ae24d050a3b9dbce1 | Python | 18,217 | 501 | import os
import sys
import string
import re
import json
import collections
voltage_scales={"V":0.001,"mV":1,"uV":10**3}
current_scales={"uA":10**(-3),"nA":1,"pA":10**3}
features_scales={"V":0.001,"mV":1,"uV":10**3, "uA":10**(-3),"nA":1,"pA":10**3}
scales={"voltage" : voltage_scales, "current" : current_scales, "featu... |
68a21a6016a5bc28dd9e91d8a308c4e49160cc5068e41ea1776ec08582cede21 | Python | 18,221 | 440 | """functions of referencing part of PREP."""
# Authors: The PyPREP developers
# SPDX-License-Identifier: MIT
import logging
import numpy as np
from mne.utils import check_random_state
from pyprep.find_noisy_channels import NoisyChannels
from pyprep.removeTrend import removeTrend
from pyprep.utils import _eeglab_int... |
76df560bb1bd73a7a9432627b0e2aff5451865fcf543eed46777f9c07ff42c85 | Python | 18,221 | 556 | # 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... |
8b5d54cfe115557158554cb5e5dc9c6eb1651e2b45cf0de1c62f8b99571f19da | Python | 18,221 | 455 | """PyQt5/pyqtgraph GUI for 2D slice-to-CCF geometry registration.
GUI-only: all compute is delegated to the framework-free ``pipeline`` module,
run on a background ``QThread`` so the UI stays responsive.
"""
from __future__ import annotations
import logging
import os
from typing import Optional
import n... |
f4687de7c5377fbe5655d2d3782d14f679064e7da7d309e88caa49ea34049081 | Python | 18,224 | 622 | import platform
import re
from colorsys import rgb_to_hls
from enum import IntEnum
from functools import lru_cache
from typing import TYPE_CHECKING, NamedTuple, Optional, Tuple
from ._palettes import EIGHT_BIT_PALETTE, STANDARD_PALETTE, WINDOWS_PALETTE
from .color_triplet import ColorTriplet
from .repr import Result, ... |
33461ea32297e0a2c4417a75e5e9f84e5fd18800e14d29039fb17df27dcf436c | Python | 18,241 | 421 | import torch
import copy
import random
import networkx as nx
import numpy as np
from torch_geometric.utils import convert
from loader import graph_data_obj_to_nx_simple, nx_to_graph_data_obj_simple
from rdkit import Chem
from rdkit.Chem import AllChem
from loader import mol_to_graph_data_obj_simple, \
graph_data_ob... |
0ea9cf9f0b22fbfd485c6aefa405b392195424b00dedbc516cfd56ab477f6c3f | Python | 18,243 | 502 | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
# ------------------------------------------------------------------------------
from __future__ import absolute_import
from __futu... |
d290073f5e986bcd175e1f622055c80895ac1454e96371f0d7cab4042b4eaa5a | Python | 18,250 | 448 | import os
import pickle
from random import seed, shuffle
import numpy as np
from sklearn.decomposition import PCA
from decisionTreeDimReduction import DecisionTree
#NEEDS TO BE ABLE TO CONVERT OTHER POINTS INTO THE SAME PCA REFERENCE. THIS REQUIRES IT TO THROW OUT THE SAME NAS
#AND TO STORE THE PCA WEIGHTS.
#NEEDS TO ... |
64e48b7c902c9b06296bb92e7aefea05174340572182f9a1a8f65b5e3bfb31a0 | Python | 18,252 | 401 | #!/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 importlib import sys
import neo
import elephant
from quantities import s
fro... |
83beb9c6a1f06d9761d141870db29ccfe2a8db02b24465c18955bc7f15cd26a0 | Python | 18,252 | 511 | # 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... |
54e5633ff30100e24db4875a66cdc96ac55fa4d38d56e756c0d538a9bce8dc25 | Python | 18,253 | 410 | import os
import time
import logging
import itertools
import math
import numpy as np
import random
from PIL import Image
import importlib
from tensorboardX import SummaryWriter
from matplotlib import pyplot as plt
import torch
import torch.nn as nn
from torch.nn.parallel import DistributedDataParallel
from torch.autogr... |
eb04f53cdf2e4952ee3e8bdabeb6ce7fcacac98df2cf06dc635f2bd76ff08852 | Python | 18,254 | 572 | from typing import NamedTuple, Dict, Any
from pathlib import Path
import pandas as pd
import argparse
import matplotlib.pyplot as plt
import numpy as np
import re
import json
import phosphorylation_parser_args
ntasks_pattern = re.compile("ntasks: (?P<n>\d+)")
cmap = plt.get_cmap("tab10")
linestyles = ["-", "--", "-.",... |
42019e85c51ed55e14f998bab86ec17414e97ad93c815a5f60209603203d9d1b | Python | 18,258 | 540 | from turtle import forward
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Conv1d, MaxPool1d, Linear, GRU
import math
import os
from torch.autograd import Function
EXTRACT = False # save graph feature vector
def sample_gumbel(shape, eps=1e-20):
... |
a8e4965f3622a74b42f851c8c1eb9c125b87e8aadccec270417a550f80f06b8b | Python | 18,259 | 492 | """
Wrapper around dolfin mesh class to define parent and child meshes for SMART simulations.
"""
from typing import Dict, FrozenSet
import logging
from pathlib import Path
import dolfin as d
import numpy as np
from cached_property import cached_property
logger = logging.getLogger(__name__)
class _Mesh:
"""
... |
e8f2eb7e9b8ad13dc1bd67c264d54d4fc2bdfc99f513836fbc199cb9fc329dda | Python | 18,271 | 481 | from __future__ import print_function
SAS_FILE_VERSION = 3
DEBUG = False
class SASTask:
"""Planning task in finite-domain representation.
The user is responsible for making sure that the data fits a
number of structural restrictions. For example, conditions should
generally be sorted and mention ea... |
ab9236037241094380476378f15c9ad7cb29bd379c59587f9bc9b632b7fa3d14 | Python | 18,279 | 399 | """
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 __future__ import print_function
import wx
impor... |
536ce42ed02751eeadd887f954a9b5a0e0e64310b80b2644de96849b53dbfbbb | Python | 18,289 | 556 | # 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... |
c387ffb541687c5bc6451913b7bdeb4390cec6445e9d4e9a195956ec4f20bd0f | Python | 18,289 | 493 | # 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... |
62ab9fe45e445b256648e53a54a2d52cf565086eeba39e04b0d7eb118adb2610 | Python | 18,305 | 460 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 15 11:28:26 2020
@author: David Quiroga-Martinez
"""
#################### Load libraries and set directories #######################
from random import shuffle
from psychopy import prefs
prefs.hardware['audioLib'] = ['PTB']
#prefs.hardware['audioLib'] = ['pyo']
from psych... |
7d12bf9fc90a43b991a336b8a2f38e29d23c83c4ea04a4996d522f66d5e73107 | Python | 18,307 | 543 | # This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... |
78e70b4ed596347c31d156eea083bfb6ca5ecce5b45959639678c3ea4ed6dbc9 | Python | 18,309 | 321 | from unittest.mock import MagicMock, patch
import boto3
import pytest
from botocore.exceptions import ClientError
from NDATools.upload.submission.api import SubmissionStatus, Submission, NdaCollection, SubmissionApi, UploadProgress, \
AssociatedFile, AssociatedFileStatus, AssociatedFileUploadCreds
from NDATools.u... |
dd847d9df31577cda8f08a3d3495fe1494eab67911f5cbb47d3cd871b00a4a9f | Python | 18,312 | 480 | """
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... |
54a003c5c8937603feef7788229ee2abf23972b6b2f5e4a8d4d621bba807f922 | Python | 18,318 | 192 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import suites
from lab.reports import Attribute, gm
from common_setup import IssueConfig, IssueExperiment
try:
from relativescatter import RelativeScatterPlotReport
matplotlib = True
except ImportError:
print 'matplotlib not availabe, scatter plots ... |
f04c7fc6116eac19a7415a854d2559333be17bae2247d903c7aa3bb93cd82018 | Python | 18,327 | 538 | """The atlas key contract: names are permanent, and so are their meanings.
A registry key is not just a UI value - it is written into registration output
metadata (``reg_meta["atlas"]``) and into saved batch-2D settings, then read back
later to resolve an annotation and count regions. ``get_atlas()`` WARNS and fal... |
b3c7bed67ab08223a84b1cc520a0f81552a394371b4f48fcfd30443eb1baff75 | Python | 18,328 | 468 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 15 11:28:26 2020
@author: David Quiroga-Martinez
"""
#################### Load libraries and set directories #######################
from random import shuffle
from psychopy import prefs
prefs.hardware['audioLib'] = ['PTB']
#prefs.hardware['audioLib'] = ['pyo']
from psych... |
171094e9f9758dad16e97e81501dfc35ed2450a830f8a106e3b9929f3b07dbb5 | Python | 18,329 | 435 | # 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... |
aea311bbcfbfbd33004a300fa9dcf87045714e1f122412d135166175899ae305 | Python | 18,341 | 303 | """
Advanced network metrics on ConnectivityMatrix (now in `conntility`)
authors: Daniela Egas Santander, Nicolas Ninin, András Ecker
last modified: 01.2023
"""
from tqdm import tqdm
import numpy as np
import pandas as pd
from scipy.stats import binom
import assemblyfire.discrete_random_variable as drv
from conntilit... |
2c798244cba3b168ade80eaea41fa21d5576a3cab3179cb2931c06e54cb93ce5 | Python | 18,348 | 460 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 15 11:28:26 2020
@author: David Quiroga-Martinez
"""
#################### Load libraries and set directories #######################
from random import shuffle
from psychopy import prefs
prefs.hardware['audioLib'] = ['sounddevice']
from psychopy import visual, core, sound... |
069b50334bdd6542c46e930b0ed1ef87e97c67816806989d5276b723548b8e59 | Python | 18,352 | 510 | import copy
import numpy as np
import pandas as pd
import neuprint as neu
import networkx as nx
from pathlib import Path
from .janelia import JaneliaDataSet
from .ds_utils import (
_get_manc_meta,
_get_neuprint_manc_client,
_get_manc_types,
_get_manc_sides,
_add_types,
_get_clio_client,
_... |
844d0ace2c4804d5ff4f6cf75764ef6d13132bedc66f0928a98cccbaab261346 | Python | 18,352 | 446 | import numpy as np
import torch
import logging
from dataclasses import dataclass, field
from typing import List, Optional
from skimage.filters import threshold_otsu
from scipy.signal import find_peaks
from .utils import crop_center
from . import const
@dataclass
class PaddedMovieTorch:
t_padding: int
x_padd... |
b7acc1160954d2bd7edb2f234930c1994915296f3aee67738d9f0b4d4e0c7b28 | Python | 18,357 | 396 | from __future__ import division
import logging
from builtins import object
#from past.utils import old_div
from operator import floordiv as old_div
import os
import re
# import localSetup
import numpy as np
import copy
class config(object):
# ----- Names
DATAAUG_FLDS = {
'adjust_contrast': ['adjust_co... |
9d62c6cc3537354ae5415908ed54babf272e3f8d922ad50cf8a6c54bcc54faac | Python | 18,364 | 377 | import os
import re
import pandas as pd
import numpy as np
from ckg import ckg_utils
from ckg.graphdb_builder import builder_utils
def parser(projectId, type='clinical'):
data = {}
experiments_directory = ckg_utils.read_ckg_config(key='experiments_directory')
project_directory = os.path.join(experiments_d... |
886434a383785d256fba7fb6d8d7cd006527717e1b2498f6fe99f1cc321e3e26 | Python | 18,365 | 360 | #!/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 importlib import sys
import neo
import elephant
from quantities import s
from os.path import join as pjoin
fro... |
1c8574e4ec6f1b7cd1b375637f954e3d0adbe68eb4124411b8508e915df06664 | Python | 18,366 | 508 | import site
from typing import Callable, List, Dict, Optional, Literal, Tuple
import torch
from torch import nn
from hotpp.layer.radial import ChebyshevPoly
from .base import AtomicModule
from ..layer import EmbeddingLayer, RadialLayer, ReadoutLayer
from ..layer.utils import ElementLinear
from ..layer.equivalent impor... |
679a81f323d3dbac9179e5199b8cf7e6be1baa436d8c868926fd905b4f659581 | Python | 18,370 | 584 | """Module to detect slow waves.
"""
from logging import getLogger
from numpy import (argmin, concatenate, diff, hstack, logical_and, newaxis,
ones, percentile, roll, sign, sum, vstack, where, zeros)
from scipy.signal import firwin, kaiserord, lfilter
try:
from PyQt5.QtCore import Qt
from P... |
ccc67bf7e24ca4ca27138d1d66103139783a40e52960c37bfa847d4848217006 | Python | 18,377 | 526 | # 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... |
81b67a7801cb2c9bd65dcaa0481b0a76a695fafc50c238afd7672b272cf18713 | Python | 18,385 | 510 | import itertools
from jax import numpy as jnp, random, jit, vmap
import functools
from functools import partial
def solarize(image, threshold):
"""Applies solarization to an image.
All values above a given threshold will be inverted.
Args:
image: an RGB image, given as a [0-1] float tensor.
threshold: ... |
5519e2c7b077a92a18c0037c349787dca52160d29a18447e29327f486a1286b9 | Python | 18,391 | 453 | """
An example that uses TensorRT's Python api to make inferences.
"""
import ctypes
import os
import shutil
import random
import sys
import threading
import time
import cv2
import numpy as np
from cuda import cudart
import tensorrt as trt
CONF_THRESH = 0.5
IOU_THRESHOLD = 0.4
def get_img_path_batches(batch_size, im... |
8d7d2c69f2a3d5bd1bd4717ece384db3ae12aa87faf988f6f7032b358deaf6b2 | Python | 18,396 | 649 | #!/usr/bin/env python
# coding: utf-8
# ### LASSO parameter range experiments, summary across all genes from Vogelstein et al. 2013
#
# `scikit-learn` has two different implementations of logistic regression: [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegressio... |
51e6afe887bfa8919a64e92f44a8fcebdb4a844ee2aa8ee452264e4d4f909c38 | Python | 18,398 | 374 | import argparse
import re
import json
import csv
import os
import sys
from os import walk
import xml.etree.ElementTree as ET
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib.lines as lines
parser = argparse.ArgumentParser()
parser.add_argument('--xml', type=str, default='./l... |
a3d0fba95361d2b935db90eab88885ee7730551408d254525ff4f0c40ae2ced5 | Python | 18,404 | 713 | import numpy as np
import os
from pyclamp.dsp.strfunc import *
from pyclamp.dsp.dtypes import *
def listcurdir():
return os.listdir(os.curdir)
def copyarray(x):
if not(isarray(x)):
raise ValueError("Cannot copy an array when input is not an array")
if type(x) is np.ndarray:
return np.copy(x)
return x[... |
f80b5bae8bacb40e59b21b2b82ee9af2191d7bb9b89ea2f186f992877e382bfe | Python | 18,404 | 615 | # 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... |
c49ab505bb560ceae9e56e76614c99f8c01a8782c6fc2a2319c0a33152fdf327 | Python | 18,408 | 547 | import glob
import os
import sys
from abc import ABC, abstractmethod
from typing import List, Tuple, Union
import numpy as np
import h5py
import torch
from topaz import mrc
from topaz.utils.data.loader import load_image
class DenoiseDataset(ABC):
''' Dataset of paired images for noise2noise model training
''... |
18936b6aebf3e6ee74eeb1fb152d193b009df04f824d93cd99412344f76af86b | Python | 18,425 | 374 | import torch
import torch.nn as nn
from utils import *
from model.module import *
from torch.nn import functional as F
import copy
class TreeNode: # the class save the tree node
def __init__(self, embedding, left_flag=False):
self.embedding = embedding
self.left_flag = left_flag
class TreeEmbeddi... |
8e7d2e429387ae73621e72e3527fe4d6cf536086bfb1478c9016b17cf347649e | Python | 18,434 | 509 | import os
os.environ['CUDA_LAUNCH_BLOCKING'] = "1"
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
import numpy as np
import matplotlib.pyplot as plt
from itertools import cycle
import matplotlib.gridspec as gridspec
import os
from torch.autograd import Variable
impor... |
1aa4bd8e478792d3b2eb34730baba171163b49e967015d4b67a39f4bf80d7049 | Python | 18,440 | 508 | """Contains the Command base classes that depend on PipSession.
The classes in this module are in a separate module so the commands not
needing download / PackageFinder capability don't unnecessarily import the
PackageFinder machinery and all its vendored dependencies, etc.
"""
import logging
import os
import sys
fro... |
291dbbd5f9e331db40448a726daadc8a91cf0e89a65f24a1b237708d547c58a4 | Python | 18,444 | 450 | #!/usr/bin/env python
#
# Copyright (c) 2019 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
"""
This module provides a ROS autonomous agent interface to control the ego vehicle via a ROS stack
"""
import math
import os
import ... |
58206b3be650f626c04d53847df121e6f54ef618be82545fea17869bd2a885fc | Python | 18,445 | 501 | # Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
4addd6b1df9995db8ad01eda5ea21d086741d2ac21e22ac38a61c65912b7d06b | Python | 18,447 | 834 | from __future__ import annotations
from dataclasses import dataclass
from pathlib import Path
from .config import NomenclatureConfig
@dataclass
class FilenameInterpretation:
"""
Result of interpreting one raw filename.
"""
original_filename: str
status: str
metadata: dict[str, str]
cano... |
917ac693541d504c54e5ce72144ae4c4951936851ecc041575654d5c83b79304 | Python | 18,448 | 400 | from __future__ import print_function, division
import argparse
import math
import os
import sys
import numpy as np
from sklearn.metrics import mean_squared_error, confusion_matrix, precision_score, recall_score
sys.path.extend([
os.path.join(os.getcwd(), 'pddlstream'), # Important to use absolute path when doing... |
f11b77e5b25de3340ef644ce1395352ec5fa42284ee782f5450d9ba01777808b | Python | 18,455 | 352 | import lavaset.best_cut_node as best_cut_node
import numpy as np
from sklearn import datasets
from sklearn.neighbors import KDTree, NearestNeighbors
from sklearn.decomposition import PCA
import pandas as pd
from numpy.linalg import svd
from sklearn.preprocessing import StandardScaler, normalize
import pandas as pd
from... |
07899a5fd7ab4fa6d1eb3be3936a07f007c75a9e01f4294cc986bb60dfe63cfd | Python | 18,459 | 473 | # Contents of this file are from the open source code for
#
# Jing, B., Eismann, S., Suriana, P., Townshend, R. J. L., & Dror, R. (2020).
# Learning from Protein Structure with Geometric Vector Perceptrons. In
# International Conference on Learning Representations.
#
# MIT License
#
# Copyright (c) 2020 Bowen Ji... |
c89c9605654cd5abcc0be846c8b991ae79db9cc8cc30a8d65d7bc222cd13717e | Python | 18,460 | 349 | #####################################
######## Paper Draft Cartoon ########
#####################################
#%%# Catalyzer
import os
import sys
path = os.path.dirname(os.path.realpath(__file__)) + '/../Resources'
sys.path.append(path)
path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(path)
impo... |
bef52e50934e957b3727533c6f67f384cef3472f6c87b635004ca9f9d933dead | Python | 18,462 | 483 | import os
import glob
import numpy as np
TRACKING_CONFIG = 'XY_Z'
# TRACKING_CONFIG = 'XZ_Y'
# TRACKING_CONFIG = 'XTheta_Y'
USE_HARDWARE_SWITCH = False # for switching on/off stage tracking
class TriggerMode:
SOFTWARE = 'Software Trigger'
HARDWARE = 'Hardware Trigger'
CONTINUOUS = 'Continuous Acqusition'... |
ddf4600c835035f1b5f1379c9066a9a1935efae11660cb03417ada926c7880e5 | Python | 18,469 | 416 | import numpy as np
import itertools
from skimage import transform
from typing import Dict
from typing import List
import pandas
from merlin.analysis import decode
from merlin.util import decoding
from merlin.util import registration
from merlin.util import aberration
from merlin.data.codebook import Codebook
class O... |
ee600422c9d85c127654bc0f4005e6bea5e143435e3b6af9ea3d6ff9ace8b464 | Python | 18,470 | 433 | """MobileNet v1 models for Keras.
MobileNet is a general architecture and can be used for multiple use cases.
Depending on the use case, it can use different input layer size and
different width factors. This allows different width models to reduce
the number of multiply-adds and thereby
reduce inference cost on mobil... |
86acd6e20243a8de4e71b9c73697f1f972455b10c59bfc17e118adee50cd1c22 | Python | 18,475 | 571 | #!/usr/bin/env python
# coding: utf-8
# ### LASSO parameter range experiments, single gene
#
# `scikit-learn` has two different implementations of logistic regression: [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) (using the `liblinear` coordinate... |
8d03f64b49a4bad2c026000f9501c63160b2807ca9808fa61e64cf9afa64f4db | Python | 18,476 | 511 | import time
import reram_register
import globals.global_func as gf
import apps
import numpy as np
import arrayparams
import math
CMD_CFG_REG = 0x01
CMD_MAP_FLOW = 0x02
CMD_MAP_PROGRESS = 0x03
CMD_MAP_ABORT = 0x04
CMD_MAP_RESULT = 0x05
CMD_SEQ_READ = 0x06
CMD_SET_TARGET = 0x07
CMD_RESET_TARGET = 0x08
CM... |
1bbb89cb7c4797a42a9d4ff6c52e9d84998c19718ec294cb097a367fb6b88fd8 | Python | 18,484 | 532 | from __future__ import division, print_function
import copy
import operator
from matplotlib import patches
from matplotlib.colors import LinearSegmentedColormap
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
from .stats import compute_R2
def multi_plot(the_data_list, plo... |
31fe764655de0cccfb623039eb601a56f7bfee1feb672b8937c8bb44b816b6ad | Python | 18,485 | 405 | import subprocess
import sys
from multiprocessing import Pool
from pathlib import Path
import json
import zmq
sys.path.append(sys.path[0] + "/..")
import os
import math
import swc_handler
from morph_topo.morphology import Morphology
import numpy as np
from scipy.interpolate import interp1d
from scipy.stats import tt... |
d369b6d93b301cca9972d6672faebcc507b75f6130f83b87c2b27009992b8216 | Python | 18,486 | 451 | #!/usr/bin/env python
#
# Copyright (c) 2019 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
"""
This module provides a ROS autonomous agent interface to control the ego vehicle via a ROS stack
"""
import math
import os
import ... |
4df4c7e6abf4ed7530ae9316ce93750032efe96f46120a4922650a3b9409a4cf | Python | 18,491 | 425 | import os
import sys
import argparse
import glob
import copy
import h5py
import json
import pickle
import time
import signal
import pdb
import numpy as np
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
import tensorflow as tf
import util_tfrecords
import util_stimuli
import util
... |
86bc1ad8a2e5cb0cd33315e296015fe45db8eb4cb6dc70026147ce943b95af4a | Python | 18,491 | 319 | import gc
import math
import os
import shutil
from argparse import Namespace, ArgumentParser, FileType
import torch.nn.functional as F
import wandb
import torch
from sklearn.metrics import roc_auc_score
from torch_geometric.loader import DataListLoader, DataLoader
from tqdm import tqdm
from confidence.dataset impor... |
0273d280b45be759f1780e799eb40078cab167380824175a00324be9831da22d | Python | 18,494 | 560 | """"""
import abc
import sys
import time
import logging
from time import monotonic, sleep
import cv2
from pupil_recording_interface.decorators import device
from pupil_recording_interface.device import BaseDevice
from pupil_recording_interface.reader.video import VideoReader
from pupil_recording_interface.errors impo... |
99a6208c0f69f53e6a5fa3670a065b654147f27e96ab58d37a575344eb041392 | Python | 18,496 | 534 | import torch
from torch_scatter import scatter_add, scatter_mean, scatter_max
from torch_scatter.composite import scatter_log_softmax, scatter_softmax
from torch.nn import functional as F
def multinomial(input, num_sample, replacement=False):
"""
Fast multinomial sampling. This is the default implementation i... |
f693002e3fe724b88a4b7a1e4bbfec8277ce21cae4dbac6b405320f21946d3b7 | Python | 18,501 | 453 | """
Coronal TIFF Export
===================
Export a 3-D volume (NIfTI or any format ``load_volume`` understands) to a
folder of per-slice **coronal** TIFFs, so the slices can be masked / painted /
corrected in an external editor (GIMP, ImageJ/Fiji, Photoshop) and inspected
downstream.
Two parallel sets are ... |
3619d1b4f1c0669129fbc925142e00851f2d9235d1cb3759f1f6bc83240d9bcf | Python | 18,505 | 520 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
146479c392014e619833e991b9bd0253faeb460591aef41f298beb1103cc68d1 | Python | 18,507 | 468 | # -*- coding: utf-8 -*-
import argparse
import os.path
import re
import sys
from . import aliases
from . import returncodes
from . import util
DESCRIPTION = """Fast Downward driver script.
Input files can be either a PDDL problem file (with an optional PDDL domain
file), in which case the driver runs both planner ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.