sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b5bf6d59abdd9ef9cafd774e4e198f0ae368f521d2603c55ad3938a92806bdf7 | Python | 18,509 | 540 | # 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... |
60b5cf2b0fa7b126c2b92f0850091cf850f6610f5f051dbab7dd9028d59201b9 | Python | 18,510 | 412 | import os
from typing import Callable, Dict, Tuple, Union
import mne
import numpy as np
import pandas as pd
from scipy.signal import butter, filtfilt, iirnotch
from ....utils import get_random_dir_path
from ..base_dataset import BaseDataset
def _apply_notch_filter(eeg_data: np.ndarray, sampling_rate: float) -> np.n... |
68fa1e39717e00e30795db5e5516f0fce9fbd5b7b2c17b334291f9bf5c7d8181 | Python | 18,512 | 440 | import sys
sys.path.append(r'..\..\..\..\pylib')
import swc_handler
import numpy as np
import os
from pathlib import Path
from multiprocessing.pool import Pool
from morph_topo.morphology import Morphology
from sklearn.cluster import DBSCAN
import math
from neuron_quality.find_break_crossing import find_point_by_distanc... |
af58a6001502b24a373ccb7a6c339a84a87fb9d593697b941440eaad7cef3e4f | Python | 18,526 | 487 | """
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... |
6bbefdd63bee9eba73d58f4ed2321cb24da08b68d694b773d302ef5fdf63b875 | Python | 18,531 | 356 | """Pure, Qt-free builder for the registration CLI argument list.
``build_registration_cli_args`` takes a plain :class:`RegistrationOpts` dataclass
and returns the portion of the command line that follows the
``[python_exe, -u, script_path]`` prefix - i.e. everything from
``--fixed_image`` onward.
The caller in... |
c9af1d70aca6fba940f03b05fc34272800d2bcf15d8175768c787207f3638563 | Python | 18,547 | 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... |
59066c0388de691daba2672f9da30b5777c724af42a57eb22c29b73178b699a0 | Python | 18,549 | 353 | #####################################
######## 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... |
53ffad6394dbbbfba5c2b6c1e8bb22762430b18c62448ac8d38f1a8287a72113 | Python | 18,553 | 474 | # Node-group asset "Style Ribbon" (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,... |
8fa3f8bc03ae27459d49f0cb07397ac585764ea99cb4a2d1cbb4e78edbb56bd4 | Python | 18,554 | 491 | """
Example code to train RECOLLECT on the pro-/anti-saccade task @author: A.R. van den Berg
Code based on AuGMEnT code @author: J.O. Rombouts
"""
from recollect import RECOLLECTNetwork
from task import GGSA
import matplotlib.pyplot as plt
import numpy as np
import logging
import pandas as pd
# Disable p... |
e8a3b6032fadb749b4b9ae29da0ac087bdc408712b1752a1921fedd4dd7fbcb7 | Python | 18,554 | 402 | 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... |
a0381eb137a641997bfa1b70078a18f09824f1564f4e105cb521776dc1f8c3ce | Python | 18,557 | 499 | """
Generates a filtered copy of a STAR file where miss aligned particles are filtered.
Miss alignment is computed by comparison against another reference STAR file.
Input: - STAR file to filter
- Reference STAR file
- Miss alignment parameters
Output: - A copy of input STAR ... |
903de43447028fe9b16ed7f97c9b12693f3a786a046290f75f4092829ce5ec13 | Python | 18,560 | 561 | """
requests.cookies
~~~~~~~~~~~~~~~~
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import calendar
import copy
import time
from ._internal_utils import to_native_string
from .compat import Morsel, MutableMapping, cookieli... |
5ce61cc78bef83f31c7d4509ce4a80b4b547157020e0ab35a3d476fbfc113b2d | Python | 18,574 | 473 | import os
import cv2
import numpy as np
from typing import Dict
from typing import List
from skimage import transform
from merlin.core import analysistask
from merlin.util import deconvolve
from merlin.util import aberration
from merlin.util import imagefilters
from merlin.util import imagewriter
from merlin.data impo... |
3de1bf733b950988dde3b42e277dd8f6376e59610d76ea23a2546804d32f8c4c | Python | 18,585 | 238 | # this script, together with the lib process_mouse_trials_lib
# 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 ... |
37e338cfd6dcbb9cbf8329e81922b7f61ffce82c5773aa6a91f6dd6f366155ac | Python | 18,593 | 472 | """Grouped fixed-time calibration for survival and competing-risk outcomes."""
from __future__ import annotations
import numpy as np
from scipy.stats import chi2
from SurvivalEVAL.evaluations.custom_types import Numeric
from SurvivalEVAL.evaluations.util import (
check_and_convert_event_data,
check_and_conve... |
332732cc8a522f708d558b0b4760507f4bd9f382120cb455d4a269a8bb69052f | Python | 18,596 | 355 | import os
import time
import cv2
import numpy as np
import pandas as pd
import imageio as iio
from control._def import *
import control.utils as utils
BACKLASH_USTEPS = 160
def multipoint_custom_script_entry(worker, current_path, region_id, fov, i, j):
print(f'In custom script; t={worker.time_point}, region={regi... |
eff865db6ab176ece98dd7545218e3384dd22ecd8cb1b0fa3fcd2384044d8609 | Python | 18,597 | 600 | import itertools
import io
import sys
import numpy as np
from numpy import unravel_index
from numpy import std
from numpy import arange
from numpy import absolute
from numpy import mean
from numpy import std
from array import array
from pandas import read_csv
import pandas as pd
from scipy import stats
from scipy.stats... |
ba1a2f77827b69b77462bda0e36eb20b8682e94c3554aad07e9cda96c10110cc | Python | 18,607 | 519 | """PipSession and supporting code, containing all pip-specific
network request configuration and behavior.
"""
import email.utils
import io
import ipaddress
import json
import logging
import mimetypes
import os
import platform
import shutil
import subprocess
import sys
import urllib.parse
import warnings
from typing i... |
4efaeaad2da19b48ebd9680767a89698c98c4129e7ef526c4599e45ecadd66bd | Python | 18,613 | 372 | import logging
import os
import re
from typing import Any, Callable, Dict, List, Tuple, Union
import numpy as np
import scipy.io as scio
from ....utils import get_random_dir_path
from ..base_dataset import BaseDataset
_log = logging.getLogger('torcheeg')
class AMIGOSDataset(BaseDataset):
r'''
A dataset for... |
0d7c3fa8be6906ab007f39da44a05407d071d4517d8465c9c1fe14cc495386f6 | Python | 18,628 | 470 | # Distill training data from basecalled alignments
# Immunoprecipitation result can be used ground truth training data
import os
import lmdb
import pickle
import pandas as pd
import pysam
import pod5 as p5
import numpy as np
import multiprocessing as mp
import queue as Queue
import time
from tqdm import tqdm
from funct... |
279f300b6317918ca26ceca6e9bf2b027608583dccf5420252fb912a9cfe1429 | Python | 18,642 | 372 | import unittest
from hed import HedString, HedTag, load_schema_version
from hed.errors import (
ErrorContext,
ErrorHandler,
ErrorSeverity,
SchemaWarnings,
ValidationErrors,
get_printable_issue_string,
separate_issues,
sort_issues,
)
from hed.errors.error_reporter import ROW_COUNT_KEY, g... |
b67bd5ef49009ea67ef41c259eca4c2be5cdfff2caddb423ddd8a4655024c7c0 | Python | 18,644 | 461 | """
Modified by Mayank Kabra
Original from 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, pick... |
a4eeb2793de04fda6db0eea2815b1e459cc943c35844aa6b5f49e6aaada11b07 | Python | 18,649 | 447 | from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import logging
import os
import sys
import glob
import re
import tensorflow as tf
tf.keras.backend.clear_session()
from callbacks import CallBacks
from model_factory import GetModel
from preprocess import Preprocess, for... |
cdec7d08e94d8ec3980ddd123d26b3052deba431e6db939e397181e5e55935da | Python | 18,655 | 619 | import numpy as np
import matplotlib.pyplot as plt
from help_funcs import load_exp_variables
# ----- #
# Hyperparameters.
metric = "rocauc"
if metric == "rocauc":
metric_str = "score"
elif metric == "accuracy":
metric_str = metric
band = "beta" # "beta", "mu"
if band == "beta":
band_letter = "β"
elif b... |
f74aac091af552286d613d139e484f04ccff490bf8d509162972d41b452dc94d | Python | 18,656 | 476 | #!/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... |
7f4dd82a01558c2b8cbf0e9ffeb0b3070a49b105a1a08318d962ec76930ab06f | Python | 18,660 | 485 | #!/usr/bin/env python3
"""Pre-flight data-quality report for a folder of dated tumor segmentation files.
Run this BEFORE tumor_tracking.py to surface issues that would otherwise
silently produce wrong results: mismatched shapes, scans that aren't
co-registered, non-binary label values, empty masks, corrupt files,
dupl... |
d2629907b54fa89402794d6d46eeeb02afde220e04832aacec583c6973ea850d | Python | 18,661 | 485 | import os
import sys
import pdb
import glob
import json
import pickle
import itertools
import functools
import multiprocessing
import scipy.stats
import numpy as np
import pandas as pd
import util
def func_to_parallelize_spkr_word(
dir_model,
dict_basename_eval={},
key_true_spkr='label_speake... |
610031d5aa2798575ba55fa6ff596a997e7daee1e162a19a10cf46c96fc6223b | Python | 18,669 | 348 | import copy
import os
import torch
import shutil
import warnings
warnings.filterwarnings("ignore")
import time
from argparse import ArgumentParser, Namespace, FileType
from rdkit.Chem import RemoveHs
from functools import partial
import numpy as np
import pandas as pd
import scipy
from Bio.PDB import PDBParser
from r... |
d075eeb694f19308ab1f9cd11a05bdbed1bd06464ba51fc5541a4858acc08ca7 | Python | 18,671 | 434 | import torch
import torch_geometric
import torch.nn.functional as F
from torch.nn import Parameter
import torch_geometric.transforms as T
from torch_geometric.nn import GCNConv, GATv2Conv, SAGEConv
import math
from utils import cosine_self_similarity, inv_softplus
EPS = 1e-15
def reset(value):
if hasattr(val... |
5d2361ba7270cbf4540b4c316239ad5cc2c62bcda0060f40a082e3e7c2b4ac48 | Python | 18,674 | 417 | # 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... |
ff911857c28ce17f538eb36745a8bc53eebaf3fc935e29b880553eb048ff0684 | Python | 18,705 | 406 | """
This module is used to create a HedSchema object from an XML file or tree.
"""
import xml
from functools import partial
import pandas as pd
from defusedxml import ElementTree
from hed.errors.exceptions import HedExceptions, HedFileError
from hed.schema.hed_schema_constants import NO_LOC_ATTRIB, NS_ATTRIB, HedKey... |
30a4e3bdaf47f19c96ac02fb8a0b4f0596543407175cdf1b3705f985b4ff4612 | Python | 18,706 | 598 | """Settings for quacc."""
from __future__ import annotations
import os
from contextlib import contextmanager
from functools import wraps
from pathlib import Path
from shutil import which
from typing import TYPE_CHECKING, Literal, Optional, Union
import psutil
from maggma.core import Store
from monty.serialization im... |
8ba86a57a4e339451cec1809313525e189889eeca24708d4220fa526953df6c2 | Python | 18,724 | 309 | #####################################
######## 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... |
7c6953a156d2cce39b882240482932b948430ad1f56db1d7b69105b03afe2791 | Python | 18,730 | 461 | import torch.nn as nn
import torch
import torchvision
from flytracking.detection.models.efficientnet import EfficientNet as EffNet
from flytracking.detection.utils.efficientnet import (
Swish,
MemoryEfficientSwish,
Conv2dStaticSamePadding,
MaxPool2dStaticSamePadding,
)
def nms(dets, thresh):
retu... |
91c90db458f0e657328192a5cbaa6f903f1f063416f22155583af45628e679be | Python | 18,730 | 447 | """Interactive tilted-CCF-slice dialog (in-process PySide6 + pyqtgraph GL)."""
import logging
import numpy as np
from PySide6.QtWidgets import (
QDialog,
QHBoxLayout,
QVBoxLayout,
QSlider,
QLabel,
QPushButton,
QSpinBox,
QDoubleSpinBox,
QWidget,
QFileDialog,
QC... |
b9d1138ffb4bcfc19a8c5e0236d0623c4c34ff5a84cc835448572394ce16999f | Python | 18,730 | 499 | import argparse
import cv2
import time
import numpy as np
import os
try:
import control.gxipy as gx
except:
print('gxipy import error')
from control._def import *
class Camera(object):
def __init__(self,sn=None,rotate_image_angle=None,flip_image=None):
# many to be purged
self.sn = sn
... |
31c1746b877ac12b35369c50ac0341b06d0d7c59f312eeb06719fc8350120b1d | Python | 18,731 | 540 | # In[ ]:
# pip install tensorflow-addons
# In[ ]:
import tensorflow as tf
from tensorflow import keras
import tensorflow_addons as tfa
import numpy as np
import h5py
from scipy import stats
import matplotlib.pyplot as plt
import os
# In[ ]:
with h5py.File('compressed_dataset_111.h5', 'r') as hf:
x_train =... |
8155a5142b4ecefdd89933cb20223f8dd0f74df7382c347647d1c9df24fe8afa | Python | 18,740 | 503 | from PIL import Image
import os
import PySpin
def configure_exposure(cam, exp_time):
"""
This function configures a custom exposure time. Automatic exposure is turned
off in order to allow for the customization, and then the custom setting is
applied.
:param cam: Camera to configure exposure f... |
0ca1bccf6b358e7d29fdf2cb1d4ce7de88dcffdee42365d08a0c203986dc7ae3 | Python | 18,741 | 320 | # -*- coding: utf-8 -*-
# @title Ionic channels states equations
# @file Ionrates.py
# @author Romain Beaubois
# @date 05 Dec 2022
# @copyright
# SPDX-FileCopyrightText: © 2022 Romain Beaubois <refbeaubois@yahoo.com>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# @brief Provide functions ... |
857199ee077e535e9ef5bcafdbcd5f63b9bb6b8696bd501f4a2dc1715820b399 | Python | 18,742 | 449 | # 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... |
8fd8e628964c31c2f311c92f96cf93ce300ff68dfc74c4c17e0fbbcab00a9d0e | Python | 18,750 | 379 | # Copyright 2022 HYBRID Team INCIA, UMR5287, CNRS, Université de Bordeaux
# 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 b... |
171a3edaeb7b5ac8af95fa82182a3b90f8fbde87b8b6489b2e04c7fb0c4c998e | Python | 18,755 | 534 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Written by Tong He and CBIG under MIT license:
https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
"""
import os
import time
import numpy as np
from scipy.stats.stats import pearsonr
import torch
from utils import load_graph, preprocess_adj, normalized_lapla... |
483644b57c16fb1bded54a54f95df3ac8b7cbac4e86995be719619a96d57093f | Python | 18,756 | 396 | """Validates sidecars."""
from __future__ import annotations
import copy
import itertools
import re
from hed.errors import ColumnErrors, DefinitionErrors, ErrorContext, ErrorHandler, SidecarErrors, ValidationErrors
from hed.errors.error_reporter import check_for_any_errors, sort_issues
from hed.models import df_util... |
84281ce0f33bfdcd31542e50765356a6dda5a21fb83314c8c29951686bc8ad2d | Python | 18,772 | 501 | import pandas as pd
import scipy.sparse
from pandas import CategoricalDtype
from cirrocumulus.anndata_util import ADATA_LAYERS_UNS_KEY, ADATA_MODULE_UNS_KEY
from cirrocumulus.dotplot_aggregator import DotPlotAggregator
from cirrocumulus.feature_aggregator import FeatureAggregator
from cirrocumulus.ids_aggregator impor... |
82a44a8504b3f6917a3b493f88c6cccfb73ec17d728e5d0967fa213420b8aafd | Python | 18,785 | 383 | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
55a999b2666c15927bc47ce0aed75e6e5fb14ec0c7d6b18790993b3e1620e98b | Python | 18,787 | 389 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
b2b3e51252378671187814a741056144b13befc6689326fd8ae20c34d743e8e4 | Python | 18,790 | 584 | """Widget to define channels, montage and filters.
"""
from copy import deepcopy
from json import dump, load
from logging import getLogger
from os.path import splitext
from PyQt5.Qt import Qt
from PyQt5.QtGui import (QColor,
)
from PyQt5.QtWidgets import (QAbstractItemView,
... |
16ff488d7cceb5aa540602c915fae279e17677e6bb1e4b8b843d3909d7c939d0 | Python | 18,792 | 559 | import logging
import pickle
from pathlib import Path
import numpy as np
import numpy.testing as npt
import pandas as pd
import pytest
from scipy import sparse as sp
from astrovascpy import bloodflow as tested
from astrovascpy import utils
from astrovascpy.exceptions import BloodFlowError
L = logging.getLogger(__nam... |
3249d9291185c6bf0342eb6c99629bc39838ae3689e9fa6fd9e1b7e146fa8c92 | Python | 18,793 | 559 | """
OXASL - module for generating human-readable output reports
Example usage:
report = Report()
page = ReportPage()
page.heading("Registration to standard space")
page.heading("Structural image", level=1)
page.text("This image was used as the registration source")
page.heading("Standard ima... |
e974ca51405b61396676a1cbc5ce6250188fc9a9ef843bbe373ab513b9dd9f6f | Python | 18,799 | 485 | from __future__ import division, unicode_literals, absolute_import
from builtins import int, range, dict, map, zip
import io
import sys
import numpy as np
from collections import defaultdict
if sys.version_info[0] > 2:
unicode = str
# import tombo functions
from . import tombo_stats as ts
from . import tombo_... |
f5a44fb2c042f7f0102161aeac562520a9e97ad2dd4e65bb47bcd5523706beeb | Python | 18,803 | 334 | #!/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 pickle
import dill
import os
import glob
import math
import seaborn as sns
from sklearn.decomposition import ... |
4085b1999df639f4a0fc317eb970c05a6508a98e995bc8e3a659e490bec0dc2f | Python | 18,808 | 483 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 15 12:09:54 2024
@author: felipe
"""
from scipy.io import loadmat
import numpy as np
import os
import sys
sys.path.append(os.path.abspath('../'))
try:
import analysis.connectivityMatrices as matrices
import analysis.dynamicModes as dmd
i... |
6d9eb35ea2dab021f3c006f88b3710517f986b6def1abecd882fb03fd5c6cad4 | Python | 18,810 | 438 | # 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... |
81f696cfff5153e33bcaedc7fa46ec3d63ad67fa6b425041ff0c1168259d041e | Python | 18,811 | 364 | import json
import os
import shlex
import shutil
from unittest.mock import MagicMock
import boto3
import pytest
from requests import HTTPError
from requests.structures import CaseInsensitiveDict
import NDATools
from NDATools.Download import Download, DownloadRequest
from tests.conftest import MockLogger
def get_pre... |
1f00ca549e665aec147e63bf2d276e13e9ce40a4eee68fe408a28c37f9a5ad85 | Python | 18,815 | 355 | # ABF File reader (episodic data)
# Nabbed from Harald Hentschke's and Forrest Collman's MATLAB code.
# Gary Bhumbra
import numpy as np
import struct as st
class SectionInfo:
def __init__(self, fh = None, offset = None):
if fh is not None and offset is not None:
self.readInfo(fh, offset)
def readInfo(... |
0bf1c4b9ac6f2faa1356b20eb60244edce7ee89cb4a74d7690622a77ee1c9598 | Python | 18,820 | 529 | # Copyright (c) 2022, Ko Sugawara
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... |
60338b3e281bc89bab7ef1566320f281297e9029cd51549510d8bbeaf77bde77 | Python | 18,820 | 548 | # 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... |
e9b6290189816f34a10607425617363ad274770507e05dbed387e12c9f33ad3f | Python | 18,822 | 502 | """
Unit tests for regtools/registration/core/align_utils.py
Covers the axis-alignment utility functions:
- preprocess
- bbox / bbox_vert
- find_lines
- process_lines / process_lines_vert
- create_line_img
- svd_fit
- align_rotation
- get_affine
"""
import math
import numpy as np
impor... |
a90fc0e81c5e79702628c1970d324438342a5398d8f77431279abf1b5dd9d191 | Python | 18,823 | 514 | 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... |
5136c00c99a8b3236dfe4e51cc8c2d953179c00cb9359d0f6d1e7998142bf2a4 | Python | 18,827 | 378 | import glob
import json
import os
from typing import Any, Callable, Dict, Tuple, Union
from torcheeg.io import EEGSignalIO, MetaInfoIO
import mne
import xmltodict
from ...constants.emotion_recognition.mahnob import (
MAHNOB_ADJACENCY_MATRIX, MAHNOB_CHANNEL_LOCATION_DICT)
from ..base_dataset import BaseDataset
c... |
c78024a4c0f2db47e123e5191345f8394c434ebe593962a49a3e8e5e6a98fa0e | Python | 18,829 | 610 | import os
import collections
from keras.applications import imagenet_utils
from keras.src.legacy.backend import int_shape
from classification_models_3D import get_submodules_from_kwargs
from ._common_blocks import GroupConv3D, ChannelSE
from ..weights import load_model_weights
backend = None
layers = None
models = N... |
c599789b16b1fddbd3215b0856268029eee2cb2564b76e9cbf7b08d61f53a07a | Python | 18,844 | 520 | # 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... |
0f32f1bc02bc149b7b9aea5cac806cd68bf07ddb3eb446c64e7a3a433cd81d30 | Python | 18,857 | 653 | import os
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from scipy.stats import gaussian_kde
from scipy.stats import ks_2samp
from compute_scaling_experiments_helpers import json_load, calc_mean_std
from compute_scaling_experiments_helpers impor... |
1586ec7d3cd8b016d69db751a31ba9297511baded2c5899b9fb0c0d8f06024e9 | Python | 18,861 | 415 | import numpy as np
import time
class ElecGrid:
def __init__(self, max_l, r_max):
self.eps = 0.0001*10**(-2)
self.max_l = max_l
self.r_max = r_max*10**(-2)
self.N_lat = 2*self.max_l+2
self.N_long = self.N_lat
self.long_phi = np.arange(0, 2 * np.pi, 2 *... |
3c4e1d4cad6890fd823e70c6dcd422b9b2371a01dbeb5c3920215ff821a427d7 | Python | 18,861 | 523 |
# morphoglia/io/html.py
from __future__ import annotations
from pathlib import Path
import base64
import warnings
import cv2
import numpy as np
from string import Template
import re
import json
from ..morphometrics.builtin import (
# canonical masks & features
make_qc_artifacts, QCArtifacts,
# Sholl mas... |
cce8902c1443e5f44a8cde17c1529ca144f324377d6962d58caac127bf99c703 | Python | 18,863 | 551 | #
# 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,... |
95e7d028c55788d9f8078731a74d1de1e0baa4ac827c922b2ac1fa10e7500c7e | Python | 18,870 | 570 | from __future__ import annotations
import threading
import pandas as pd
import logging
import os
import shutil
from functools import cached_property
from typing import Iterable, Optional
import sklearn.pipeline
from sklearn import clone
from sklearn.model_selection import StratifiedKFold
from sklearn.model_selection... |
6e6814051caf39aad0adc9f96155d066add06da81276cc8f1dd477c8ccd37480 | Python | 18,872 | 445 | # TODO
# resnet
# Now segment_coo have some bug in getting second-order derivative
# https://github.com/rusty1s/pytorch_scatter/issues/299
# from torch_scatter import segment_coo
# Different channel for different order?
# parameterdict cannot be scripted
# https://github.com/pytorch/pytorch/issues/128496
import torch... |
7f1268b8f7763acc1748e56e31603ee89c7057af7290ebc91bf7b06917c48168 | Python | 18,872 | 534 | from __future__ import absolute_import
import fnmatch
import os
import random
import multiprocessing
import multiprocessing.queues
import numpy as np
import gc
import math
basepairs = {'A': 'T', 'C': 'G', 'G': 'C', 'T': 'A', 'N': 'N',
'W': 'W', 'S': 'S', 'M': 'K', 'K': 'M', 'R': 'Y',
... |
8c09d88a0dd52a7a486997a1b578ed6b556cb8ccd6666d7c0bad21e606b59e5b | Python | 18,874 | 474 | #!/usr/bin/env python3
from __future__ import print_function
import os
import sys
# NOTE(caelan): must come before other imports
from learn_tools.common import map_general, get_max_cores
cwd = os.getcwd()
sys.path.extend([
os.path.join(cwd, 'pddlstream'), # Important to use absolute path when doing chdir
o... |
235935db86eac9879ce70811ac021476303609f9e420c60f1544c06a738802f2 | Python | 18,875 | 576 | # Copyright (c) 2023-2024 Blue Brain Project/EPFL
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed ... |
14b48a49d3d7a4c4afbfc4ca6618d15eaf5255ba02d40fcd8ee14ce8bcc7857a | Python | 18,877 | 270 |
import keras
import tensorflow as tf
import numpy as np
from keras.models import Model
from keras.layers import Input, Conv1D, MaxPooling1D, BatchNormalization, Dense, Flatten,Layer,Embedding,Bidirectional,CuDNNLSTM,Dropout,TimeDistributed,Lambda,Activation,GlobalAveragePooling1D
from keras.optimizers import Adam
from... |
c49c7d3e1910d5ec429118499e0d8e2ab1af74bbf3bf244d9dae640fb11721bf | Python | 18,895 | 545 | import pytest
import numpy as np
from ase.build import molecule
from ase.calculators.emt import EMT
from sella.peswrapper import PES, InternalPES, CellInternalPES, \
_range_space_projector, _rigid_motion_nullspace
from sella.internal import Internals
@pytest.mark.parametrize("name,traj,cons",
... |
1c9fe7006dda13c1b50e4d790475bd69906fe6bf0131d72f2efc9236aa23d433 | Python | 18,897 | 392 | from __future__ import print_function
import cProfile
import os
import pstats
import numpy as np
import pddlstream.algorithms.instantiate_task
pddlstream.algorithms.instantiate_task.FD_INSTANTIATE = True
from pddlstream.algorithms.focused import solve_focused
from pddlstream.language.constants import And, PDDLProble... |
7b3b390aa0386aa56c21bf897c78be1c08fbde49b9f5a79549d137e20177dec6 | Python | 18,900 | 580 | #!/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... |
59c9e57dd541e32feb9d839371345a9f23882ab3cf12008be0ab75313a30b3c0 | Python | 18,907 | 333 | # -*- coding: utf-8 -*-
"""
Created on Dec 12 2022
@author: BIONICS_LAB
@company: DZNE
"""
import h5py
import numpy as np
import os
"""change these parameters based on different datasets"""
threshold_low = 50 #uV
threshold_high = 4000 #uV
LFPMax= 30 # (Hz) - maximum acceptable LFP Rate(LFP events/min... |
0c46818f42fcc4ef8f72ed441efac56d23e9323ebcc45cea8b8d5b57ef00d57b | Python | 18,918 | 462 | """
Test for network class.
"""
import unittest
from copy import deepcopy
import numba
import numpy as np
import pytest
import symengine as se
import sympy as sp
from neurolib.models.multimodel.builder.base.constants import EXC, INH
from neurolib.models.multimodel.builder.base.network import (
Network,
Node,
... |
6b524e86bfa0f746d9d37ffa766ca9e918bf59089ce8f7f945e79c494f77a93f | Python | 18,919 | 516 | # 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... |
716ff3120af4ca75082c5032e82ee3a8a95dce250ffc70a7457022c0ac0c141f | Python | 18,921 | 430 | import torch
import torch.nn as nn
class GraphNorm(nn.Module):
def __init__(self,features):
super(GraphNorm,self).__init__()
self.weight = nn.Parameter(torch.randn(features))
self.bias = nn.Parameter(torch.randn(features))
self.alpha = nn.Parameter(torch.randn(features))
... |
479e84b96a18a38bebf7aa43da368a8fd65b60c023affdd588557d0d50024107 | Python | 18,927 | 387 | import numpy as np
from scipy.stats import gamma, norm, truncnorm, multivariate_normal
import matplotlib.pyplot as plt
from numpy.random import multivariate_normal as multi_norm
from scipy.misc import logsumexp
import sys
sys.path.append("../useful_functions/")
import useful_functions as uf
def ibis(actions, rewards, ... |
6d6a646bf8e518d26bcb5257bb45f99eb07d499581b330caaac291f39a205e80 | Python | 18,927 | 472 | import sys
from sys import stdin, stdout, stderr
import re
import os
import pathlib
import subprocess
import nibabel as nib
from PyQt5.QtWidgets import *
from PyQt5 import QtCore, QtGui
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import json
from threading import *
from os.path import exists
from matplotlib.ba... |
05b5cd40017dfed12b2261c27d2a2b8b7d7cf05c12c364d416a2c1bd4d412dd8 | Python | 18,928 | 559 | """Provide access to Python's configuration information. The specific
configuration variables available depend heavily on the platform and
configuration. The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys(). Additional convenience functions are a... |
cc0d4c42e09d67d414595bd911399a5ece54912a78b5234b7e1bae0ad670ddb2 | Python | 18,930 | 461 | try:
import binutil # required to import from dreamcoder modules
except ModuleNotFoundError:
import bin.binutil # alt import if called as module
from json.decoder import JSONDecodeError
from syntax_robustfill import SyntaxCheckingRobustFill
from image_robustfill import Image_RobustFill
import time
from dre... |
afd42fda416b3185ec8f2f538838e8215bad264b7fe3eb1ca68d6e7f25334b45 | Python | 18,935 | 392 | import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import warnings
warnings.simplefilter("ignore")
import time
import tqdm
import util
import pprint
import random
import torch
import scipy.stats
import numpy as np
import pandas as pd
from datetime import datetime
from torc... |
fce55f13a6f19a00a103e81bbaf25e06e603b8e9cfb176a13a137175075a8662 | Python | 18,953 | 350 | """Command-line interface to package treem."""
import argparse
import sys
from importlib.metadata import PackageNotFoundError, version
from treem.commands.check import check
from treem.commands.convert import convert
from treem.commands.find import find
from treem.commands.measure import measure
from treem.commands.m... |
cf7bdda04357f4190a292c74478c7e8bebf8aedff0df54291cf3505aff9f03ae | Python | 18,955 | 631 | # 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... |
6ae3fbc6b11aa7fef0dec80ad5f6bda8480924267bb154deed37f65d725b53c6 | Python | 18,969 | 338 | import torch
from torch.nn import functional as F
from torch_scatter import scatter_sum, scatter_mean, scatter_add
from torchdrug import core, tasks, layers, models, metrics, data
from torchdrug.data import constant
from torchdrug.layers import functional
from torchdrug.core import Registry as R
from torchdrug.models ... |
bb9994f7aa36967532f8e0d126fed67af79ed3109823a20a21735a9920509eca | Python | 18,969 | 555 | import logging
import sys
from typing import TYPE_CHECKING, Any, FrozenSet, Iterable, Optional, Tuple, Union, cast
from pip._vendor.packaging.utils import NormalizedName, canonicalize_name
from pip._vendor.packaging.version import Version
from pip._internal.exceptions import (
HashError,
InstallationSubproces... |
39607c17050fb33571bc7fb6820f1584d4c0be664d811c069fef469e93af3d0f | Python | 18,973 | 471 | from __future__ import print_function
import sys
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torchvision
import torchvision.models as models
import random
import os
import argparse
import numpy as np
import dataloader_clothin... |
2b649615fdb7365f3f0a179b2697b125aea27a4b968bec8af473405b2abf456e | Python | 18,986 | 460 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 13 18:51:40 2021
@author: divyoj
"""
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy as np
import seaborn as sns
import geomProperties as geomProperties
import math
import Vector_calculus as vc
sns.set_theme(context='notebook', styl... |
493231e68cb724ade83e93181a673676e8796885d2db82db76d61a01534b7cd4 | Python | 18,994 | 464 | #!/usr/bin/env python
# =============================================================================
# GLOBAL IMPORTS
# =============================================================================
import os
import math
import csv
import json
from collections import OrderedDict
import numpy as np
from simtk import ... |
87ba7e50c92efe7a6d16cbea33db933f5d8d8a8535162640790cfb06af87ffd6 | Python | 18,994 | 437 | import os
import glob
import copy
import collections
import pickle
import tarfile
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from pkganalysis.submission import (SamplSubmission, IgnoredSubmissionError,
load_submissions, plot_co... |
a1c4d1dd80e7d46c37c96197380e38aa49632b0d4241e3cf212c2caf9b253282 | Python | 18,994 | 346 | # http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.116.7379&rep=rep1&type=pdf
STANDARD_1005_CHANNEL_LOCATION_DICT = {
'FP1': [-0.0294367, 0.08391710000000001, -0.0069900000000000006],
'FPZ': [0.00011229999999999999, 0.088247, -0.0017130000000000001],
'FP2': [0.029872299999999997, 0.0848959, -0.00708... |
faac7f6cbd4a947696feae3efd5bd1bf2ecb92566c602bae3fe8e8af76ed8399 | Python | 19,000 | 572 | """Schemas for storing ASE-based data."""
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING, cast
import numpy as np
from ase.io import read
from ase.vibrations.data import VibrationsData
from emmet.core.symmetry import PointGroupData
from pymatgen.io.ase import AseAtomsAda... |
7f7cad5c8355f7fe052457958b39a355669cfdb2cd49abfb1c5727f37bb2bdee | Python | 19,007 | 389 | # Numpy implementation of the Lagrange model. Trainable only with single samples. Just for reference.
# Authors: Dominik Dold (dodo47@github) and Benjamin Ellenberger (benelot@github)
import numpy as np
from numpy.linalg import solve
import time
# network parameters
from model.network_params import ArchType, Activa... |
73ac863d674e8845f91572868340a36f8487f4407d2887b9b290a84b5c57082b | Python | 19,012 | 586 | """Utilities for reading, manipulating, and characterizing biomolecular sequences."""
import os
import random
import warnings
from collections.abc import Iterable, Mapping, Sequence
from typing import Literal, TypeAlias, cast
import numba as nb
import numpy as np
from Bio import SeqIO, SeqUtils
from Bio.Seq import Se... |
233f40c261bbcc9a517317696bb784a64b4664e0113d2d118284270165fee5dd | Python | 19,040 | 455 | import warnings
import torch
import torch.nn as nn
import numpy as np
import pandas as pd
import mudata as md
from geomloss import SamplesLoss
import ot
from scconfluence.base_module import BaseModule
from scconfluence.unimodal import AutoEncoder
from scconfluence.dataset_utils import (
format_batch,
inferen... |
a7a6f877ca4197a92f443532687eec334540afa536b5c550a642c2c7bc9255df | Python | 19,046 | 355 | # set QT_API environment variable
import os
import sys
os.environ["QT_API"] = "pyqt5"
import qtpy
import time
# qt libraries
from qtpy.QtCore import *
from qtpy.QtWidgets import *
from qtpy.QtGui import *
import pyqtgraph.dockarea as dock
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True) #enable highdpi sc... |
9eabe02ef83d5d32fe6102277468b324fab72d9f5d57671db0ca99ca75e484db | Python | 19,054 | 617 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from maldi_nn.models import MaldiLightningModule
from torchmetrics.classification import BinaryAUROC, MulticlassAccuracy
import maldi_nn.nn as maldinn
from maldi_nn.utils.data import DRIAMSSpectrumDataModule
from maldi_nn.spectrum imp... |
3ffb32d8c95899124e06d79ed9e7972add624429ab5ce0e01afc530ac06a631d | Python | 19,059 | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.