sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
d1884e93b2ec286951d83e38fd3c1590124f57b6334c82834502d0f252394fbf | Python | 11,698 | 404 | # 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... |
4d5b56c8329f4fceca62a5a4ec8ecf3463d2040723eee2f2f81b94bc434df206 | Python | 11,702 | 437 | from __future__ import annotations
from dataclasses import dataclass, field
from typing import ClassVar
@dataclass
class FluorescenceV1Config:
"""
Parameters for MorphoGlia's first raw-image preprocessing preset.
Sequence
--------
MULTISCALE_TOPHAT
-> CLAHE
-> UNSHARP_MASK
-> NORMALI... |
7f84d46c97be0b6b64621adf05341c48a681879fc93afecabe37b49856b63f70 | Python | 11,705 | 275 | import copy
import shutil
import time
from typing import List, Tuple
import numpy as np
import os
import pandas as pd
from tabulate import tabulate
import torch
import torch.backends.cudnn as cudnn
from torch import optim, Tensor
from torch.utils.tensorboard import SummaryWriter
from constants import *
from src.train... |
eea5d77c27f46e7b2416a8891eed908c4bc4f7d4e6751d85cc88e21286c0263c | Python | 11,709 | 324 | # ----------------------------------------------------------------------
# Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/... |
b41f12e71b7a68eb94de2ff39fd17a866c4091342ec41e09fe301e04df4e0216 | Python | 11,711 | 347 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Copyright (C) 2012 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... |
f9ea269eaa1416f51000e1596e33a3de0dc6e43cbaf29691eb56aea880e6b9b3 | Python | 11,711 | 415 | # 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... |
2bcf50b0c2fb88d37578ee96db3e3a44110073954bbfdb2f50c92fcaee2542f5 | Python | 11,712 | 318 | """Schemas for VASP."""
from __future__ import annotations
import os
from logging import getLogger
from pathlib import Path
from typing import TYPE_CHECKING, cast
from ase.io import read
from emmet.core.tasks import TaskDoc
from monty.os.path import zpath
from pymatgen.command_line.bader_caller import bader_analysis... |
b0ad9acad89392fbd57048ad1bbcbec8042dd5736995879af7da2fb50d99a73d | Python | 11,712 | 466 | #!/usr/bin/env python
#
# Copyright 2009 Neal Norwitz All Rights Reserved.
# Portions Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... |
58f0cbfaf73c2236686648bca501920e13bc5571e9f7727b98ceb139a753efec | Python | 11,713 | 199 | # 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... |
b9f7d4e308cc866f5d3361f8e46bcaeab4af4f06f60296d2e70ff6a2fda5937a | Python | 11,716 | 349 | """
Quantify cell type subclass distribution by CCF region.
Used to generate Fig 5f"""
import math, os, re
import pandas as pd
import numpy as np
import json
import matplotlib.pyplot as plt
import matplotlib.patches as mpatch
import SimpleITK as sitk
import requests
import pathlib
import seaborn as sns
from anytree i... |
a5e3e76abcbb70814b896fde0dd679ad3f280278fdfa49e1d41f243ef109184a | Python | 11,717 | 446 | #!/usr/bin/env python
# coding: utf-8
# ## Analysis of feature selection for cell line mutation prediction; single-cancer holdouts
#
# This script is very similar to `02_cancer_type_classification/plot_univariate_fs_results.ipynb`, for analyzing the results of purity prediction on held-out cancer types. We analyze th... |
204a53dabab702f7a3df1974cad2fb16925bd717cbb067085370102018c705d0 | Python | 11,718 | 271 | # Script to actually run CCA on the data
# Using the meet package https://github.com/neurophysics/meet.git to run the CCA
# Apply CCA to anteriorly rereferenced data with 30Hz hpf applied
import os
import mne
import numpy as np
from meet import spatfilt
from scipy.io import loadmat
from Functions.get_channels import g... |
873bb34feeef659368f9986428288f65020e4ff05e4e2ca814bdb300fbc0ba88 | Python | 11,718 | 260 | # Copyright (c) MONAI Consortium
# 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 to in writing, so... |
09a8441432e60bb37b48e1ab258c44a0b5d9bd2e37883844198e954353e022dc | Python | 11,719 | 326 | #!/usr/bin/env python
#================================================================
# Copyright (C) 2021 Yufeng Liu (Braintell, Southeast University). All rights reserved.
#
# Filename : morphology_angles.py
# Author : Yufeng Liu
# Date : 2021-07-19
# Description :
#
#=============... |
74df5b3b0184adf4c1252d97a6a187701b5dc0bbc1b8f343c19d4f1b1d422aa2 | Python | 11,721 | 341 | """Concordance and midpoint imputation for interval-censored outcomes."""
from __future__ import annotations
import numpy as np
from SurvivalEVAL.nonparametric_estimator.single_event import TurnbullEstimatorLifelines
def _get_comparable_ic(
left: np.ndarray,
right: np.ndarray,
tol: float = 0.0,
) -> np... |
7f3db753e6bb876020d2b756bad46e40d41ab43b6746940e3848ee7de83afa9f | Python | 11,727 | 301 | import torch
import torch.nn as nn
from torch.nn import init
import torch.nn.functional as F
from layers.attention_layer import EncoderLayer
import time
import numpy as np
from scipy.linalg import block_diag
import dgl
from layers.graphsage_layer import GraphSageLayer, DenseGraphSage
from layers.contrastpool_layer imp... |
9dde2bbb9c16e0451827bd9fc368f333299e7c0c03876136818125f1111969ee | Python | 11,727 | 338 | """
helper functions used to manipulate and analyze MEA data.
"""
import h5py
import numpy as np
def load_signal(filename, well, channel):
# create an object h5 with the file structure from filename
h5 = h5py.File(filename, 'r') # 'r' = read
infoChannel = h5['Data']['Recording_0']['AnalogStrea... |
ed5744f3cded5318c0effcb99cf4222c8d6f7ac077381373a540c5d101f8878e | Python | 11,728 | 352 | import matplotlib
import os
matplotlib.use('Agg')
#from pylab import *
from pylab import exp, plt, hist, sqrt, diag, plot, legend, concatenate, normal
from scipy.optimize import curve_fit
import pickle
from matplotlib.backends.backend_pdf import PdfPages
#'''
#Marcin's version
#dataSetLocations = ["/work/projects/nn93... |
be166cf0bf93360817a8cd5b6e197e1696f11374eb201e93827c7c7e1dd2d871 | Python | 11,729 | 324 | import logging
import os
import re
from typing import List, Optional, Tuple
from pip._internal.utils.misc import (
HiddenText,
display_path,
is_console_interactive,
is_installable_dir,
split_auth_from_netloc,
)
from pip._internal.utils.subprocess import CommandArgs, make_command
from pip._internal.... |
3f8b88f1403e5f8199a0bacaa8fcf58499bdc81fc3c5784937cc4c05086c5589 | Python | 11,730 | 288 | # 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... |
a14ee6509ff7ee15d8cdcc2b84c43d9d8eb0388852eac156deccfb682650aa27 | Python | 11,732 | 349 | # -*- coding: utf-8 -*-
"""
Created on Feb 3 2023
@author: Jonas A. Thiele
"""
### Compute and visualize descriptives of the HCP and AOMIC (PIOP) samples
import pandas as pd
import numpy as np
import scipy.io as spio
import scipy.stats
import seaborn as sns
import matplotlib.pyplot as plt
from matpl... |
a3ac524240096e26f5d5aaab113fff2f7ef3392e5b804c900db34edc216ea981 | Python | 11,732 | 334 | # 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... |
86ea63c5fbd19fdb0bd041875b253e1bf149ed78973bbc97fad0cc28a015660e | Python | 11,733 | 300 | """
Author: David Kappel
Copyright (C) 2024, by the author.
See the LICENSE.txt file for more information.
Code snoopies:
Run the pattern classification experiment
"""
import numpy as np
import pylab as pl
from core.grammar import Grammar
from core.model import SPPNetworkModel
from core.uti... |
3e5524ef2edc5c0ab8fc7f0a79a4f3ae70099ccf9aa2d8c93cc1e978e7e3de65 | Python | 11,740 | 246 | """Random-weight tiny transformer tests validate hooks, not scientific outcomes."""
import numpy as np
import pytest
import torch
from scipy import sparse
from transformers import Qwen3Config, Qwen3ForCausalLM
from liquidaion_fly.llm import Coupling, SynchronousCoupling, compare_logits
from liquidaion_fly.reservoir imp... |
d797bd83407de46b96ec2ab99d4cf9496bef3bfccaa1b921d022a6f264114893 | Python | 11,740 | 322 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import json
import math
import biotite.structure
from biotite.structure.io import pdbx, pdb
from biotite.structure.residues import get_residu... |
17ab2c1966680e0d4a3c747cb0e58091fd390d5746ecc7cd1e6eee4824cc796f | Python | 11,741 | 264 | import pandas as pd
import numpy as np
import os
import matplotlib.ticker as plticker
from matplotlib.pyplot import Line2D
import matplotlib.pyplot as plt
from constants import *
from src.evaluate.utils import *
from src.utils import assign_bin
from src.analyze.utils import init_mpl
_CLASS_ITEM_COLS = [f"class_item_... |
707d96d5677a52c8f90d378fe4c07075924750eaece05d9699586823ca1f7116 | Python | 11,746 | 571 | import pytest
import os
import json
import pandas as pd
import numpy as np
import seaborn as sns
import utils as u
import analysis_utils as au
from fit_data import fit_data
@pytest.fixture
def get_fig_save_dir():
return os.path.join(
'Tests',
'test_fit_data',
)
@pytest.fixture
def get_relv... |
a1e592ec2e375130a084029cd50e75aa5d876386edc9bd02107cbf572550e8e7 | Python | 11,747 | 128 | colors=["#008941", "#FFFF00", "#1CE6FF", "#FF34FF", "#FF4A46", "#006FA6", "#A30059",
"#FFDBE5", "#7A4900", "#0000A6", "#63FFAC", "#B79762", "#004D43", "#8FB0FF", "#997D87",
"#5A0007", "#809693", "#FEFFE6", "#1B4400", "#4FC601", "#3B5DFF", "#4A3B53", "#FF2F80",
"#61615A", "#BA0900", "#6B7900", "#00C2A0", "#F... |
eed3fd65cb7cc4c72d0104c4f83c017c91e0eb65819d6bfac74016b90f945d1b | Python | 11,747 | 317 | """TransformerMIL in TensorFlow.
Matches PyTorch implementation exactly.
Copyright (c) 2024 University of Michigan. All rights reserved.
Licensed under the MIT License. See LICENSE for license information.
"""
import tensorflow as tf
from tensorflow import keras
import numpy as np
import logging
def gelu(x):
c... |
6ee76db7421cb6da4062e3950e36d6de60e3531a6f090b79adcfec32c41bba82 | Python | 11,748 | 269 | import os
import random
import json
import argparse
import xml.etree.ElementTree as ET
import math
import numpy as np
import carla
import pygame
pygame.init()
# constants used for visualization
PIXELS_PER_METER = 8
MAP_DEFAULT_SCALE = 0.1
HERO_DEFAULT_SCALE = 1.0
PIXELS_AHEAD_VEHICLE = 256
class MapImage(object):
... |
3e818f2aeadee0c89a75fcb5e995bf77be359b97d805b6d19f922c984e4dc448 | Python | 11,749 | 445 | #!/usr/bin/env python
# coding: utf-8
# ## Analysis of feature selection for purity prediction; single-cancer holdouts
#
# This script is very similar to `02_cancer_type_classification/plot_univariate_fs_results.ipynb`, for analyzing the results of purity prediction on held-out cancer types. We analyze the same 3 typ... |
79cfe49965d071e57bfa1b08f6ba0b53cf3f24b6e017b2514ffb849b458fd00d | Python | 11,750 | 337 | from nose.tools import *
from nltk.sem.logic import Expression, Variable, \
FunctionVariableExpression, AndExpression, NegatedExpression
from pyccg.logic import *
def _make_mock_ontology():
def fn_unique(xs):
true_xs = [x for x, matches in xs.items() if matches]
assert len(true_xs) == 1
return tru... |
7bc19c130369c1fcf92f25ac5622714efe4a6580d054595755d75e7245f5b625 | Python | 11,750 | 346 | import copy
import logging
import numpy as np
import scipy.signal
from datetime import timedelta
from importlib import import_module
from sleeplab_format.extractor.config import ArrayAction, ArrayConfig, SeriesConfig
from sleeplab_format.models import ArrayAttributes, SampleArray, Series, AASMSleepStage, Subject
from ... |
d77489dc3e6915da99f7344e13a1db5a7043c07bce184f0696c9aa1a1a6b469e | Python | 11,753 | 338 | """
pygments.formatters.terminal256
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for 256-color terminal output with ANSI sequences.
RGB-to-XTERM color conversion routines adapted from xterm256-conv
tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2)
by Wolfgang Frisch.
Formatt... |
30695c1423cb83dcec54a4d31e2cb5e2ef54e840ce7151a91b9bc21a3bf9f471 | Python | 11,756 | 318 | #
# 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,... |
c4623db4617f95ea5a11aebdc5c026c91d91fb05ee779edd78a1b198735a27fc | Python | 11,761 | 273 | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pyabf
import sys
import os
import datetime
from scipy.signal import find_peaks
from scipy.signal import peak_widths
from scipy import optimize
from ABFbot_functions import *
from ABFbot_det... |
49dae22de37cf24020bb80704e8bee95b5a2ffebff1ebc5cf593784563e3fafe | Python | 11,770 | 305 | # coding=utf-8
# Copyright 2020 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... |
604a29ee2acb124df94ce2743b992825195a2070bbc23116e0ee49078a8005f8 | Python | 11,770 | 320 | # 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... |
868936ab2b8f61385ceb39d2a040aff69ce372c7b15049cb28548ffcdf162610 | Python | 11,772 | 401 | """
Configuration settings for simulation: logger formatting, solver configuration, other flags
"""
import logging
from logging import config as logging_config
from dataclasses import dataclass, field
from enum import Enum
from typing import Any, Dict, Optional, Tuple, NamedTuple
from termcolor import colored
import ... |
03f1db12f259121313fac95bb198491873eabd2579fd25c305d80773f11d77cc | Python | 11,775 | 332 | import math
import numpy as np
import tensorflow as tf
from NARX import *
class EarlyStoppAveraged(tf.keras.callbacks.Callback):
def __init__(self, monitor, av_epochs, patience, min_delta=0.,
restore_best_weights=True):
"""
Early stopping the training if specified metric increases... |
dc603141aa91a89a2d4b9f956b17d54f70e1d7180f30b1469e0b3f3d2104e405 | Python | 11,775 | 268 | supervised_learning = False
doc = dict(
__class__="""Performs k-means clustering on an H2O dataset.""",
)
examples = dict(
categorical_encoding="""
>>> prostate = h2o.import_file("http://s3.amazonaws.com/h2o-public-test-data/smalldata/prostate/prostate.csv")
>>> predictors = ["AGE", "RACE", "DPROS", "DCAPS",... |
51a7b6ca36bfdb3f394db32d9fd37ce2608f86f0acebf79e5144313f4e70c325 | Python | 11,778 | 317 | # 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 to in writing, software
# distributed under th... |
7f9e096e0374da3765ed4dbcf37679dbd37cb0f7ab3c336e6b0e64cc42b9ad2f | Python | 11,781 | 258 | import numpy as np
import random
import torch
from basicsr.data.degradations import random_add_gaussian_noise_pt, random_add_poisson_noise_pt
from basicsr.data.transforms import paired_random_crop
from basicsr.models.srgan_model import SRGANModel
from basicsr.utils import DiffJPEG, USMSharp
from basicsr.utils.img_proce... |
5bfe7b706e534686e07b1a43fce4ab72493ebdd49d4e03e0fdf5b558b6353571 | Python | 11,782 | 247 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 22 12:39:05 2023
@author: felipe
"""
import sys
import os
sys.path.append(os.path.abspath('../../'))
sys.path.append(os.path.abspath('../'))
import plot.networks as pltn
import analysis.connectivityMatrices as connectivityMatrices
import numpy as n... |
bf6d9afd88904ce094c5e39364c15419ccd68018b516586899b401cdc2b3a9a6 | Python | 11,782 | 315 | import numpy as np
import pickle
#import sys
#sys.path.append(".")
#from scripts import rewire, indices, directed_modularity, initialization_params
import indices, directed_modularity
import os
os.chdir('../scripts')
f = open('./Output/boost_nor.pckl', 'rb')
A_nor = pickle.load(f)
f.close()
f = open(... |
2796baa3ec46a61bf56870e0e2360e919f5379edffc12d6ebf781151c60a12ae | Python | 11,793 | 282 | # coding=utf-8
# Copyright 2021 The Facebook Inc. and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... |
5e3fc31ea001859785a9b8de6c4f88278bf37e8e75e2089341ea3d92b0c0f5fd | Python | 11,794 | 302 | '''
Description:
Wrapper of running PRESCIENT model.
Codes are adopted from PRESCIENT source codes.
Author:
Jiaqi Zhang <jiaqi_zhang2@brown.edu>
Reference:
https://github.com/gifford-lab/prescient/blob/master/prescient/commands/process_data.py
'''
import torch
import numpy as np
import pandas as pd
im... |
cf8ecadb9b29e5788b39bdcbc2b65a65a9eda44be9c0678eda21b9d8b357c9a6 | Python | 11,795 | 274 | ##################
### Parameters ###
##################
import argparse
parser = argparse.ArgumentParser(description='singleDeep: prediction of samples phenotypes from scRNA-Seq data')
# Define the parameters and default values
parser.add_argument('--inPath', type=str, help='Folder with the input data (output of Pre... |
5811324a2dac2dee303c303ca872260588a5f010c998ce2b6047026d7b2277b3 | Python | 11,800 | 308 | """
Created on Fri Jun 17 23:00:01 2022
@author: Haotian Teng
"""
import os
import sys
import toml
import random
import argparse
import numpy as np
from typing import List
import itertools
from tqdm import tqdm
from xron.utils.seq_op import Methylation_DP_Aligner
def kmers2seq(kmers,idx2kmer,return_pos = False):
... |
3dac8c1565e1b770a16b1a602ba94a3e0a872cb1d0fa55c8e4c4b672c359f431 | Python | 11,806 | 345 | #
# 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,... |
01496fba13b85c1668730a95d215a776085e345dca1afd46f4a6dca7a1755b4e | Python | 11,808 | 227 | #!/usr/bin/env python3
__author__ = "Zoe Wefers"
__credits__ = ["Ryan Huang"]
__version__ = "1.0.0"
__maintainer__ = "Zoe Wefers"
__email__ = "zoe.wefers@mail.mcgill.ca"
""""Purpose: Executable script which reads annotated and non-annotated MAP2 max projections gif images and generates a print for every
annn... |
7f3136aaa3d5dd9ac050fc79b0805dc988675e085534b5e190794c5e3796d6f9 | Python | 11,809 | 276 | import torch
from base import BaseTrainer
from .tracker import MetricTracker
class DANN_Trainer(BaseTrainer):
'''
DANN Trainer
'''
def __init__(self, config, train_data_loader, valid_data_loader=None, test_data_loader=None):
'''
Initialize the DANN Trainer instance with parameters.
... |
a94ab4401d40c5f2cb679bfbf57cfa8c6303343c0fd564ea429d1e24d505c339 | Python | 11,811 | 409 | """
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2020 Pupil Labs
Distributed under the terms of the GNU
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
------------------------------------... |
fab86751145901f25248ea3deccdb523c17bb94fe49628527b09efd60d9a303c | Python | 11,811 | 238 | import random
import numpy as np
import math
from itertools import islice, cycle, count
from control_tools.execution import ArmTrajectory, Attach, Detach, Push
from perception_tools.common import get_type
from plan_tools.common import Control, Conf, ARMS, get_reference_pose, GRIPPER_LINKS, get_urdf_from_center
from pl... |
01b6c85bd79af479b336e5f320714086b1ecb8efc60e72c4dceb2fee44539fa6 | Python | 11,812 | 284 | """Tests for the report data layer.
Covers the three things most likely to break silently: point-file discovery
across layouts, threshold evaluation including the "not measured" case, and the
payload's run_state. Uses only unittest + the fixture builder.
python -m unittest port.test_report_data
"""
impo... |
817956f53ab90c8cb0284f8a86b78c4bd80148e9170835edf773ced0721c97f0 | Python | 11,813 | 320 | import os
import re
import logging
from typing import Dict, List, Optional, Union, Any
import ase.db
import numpy as np
import spainn
from spainn.properties import SPAINN
from spainn.asetools.aseutils import DatabaseUtils
__all__ = ["GenerateDB"]
log = logging.getLogger(__name__)
class GenerateDB(DatabaseUtils):
... |
f36fcfdf8a2007438c08eaea4a7378bb0e57005bc0ac3eeacf7f347afcfdf4b9 | Python | 11,813 | 288 | # EDR/WCP File reader (continuous/episodic data)
# From the Appendicis in John's manuals.
#
# It appears a WinEDR file is a mixture between MSDOS ASCII text containing the `header block' following by ADC data in
# little-endian (thankfully) signed integer 16-bit binary ADC data separated by channel.
# It seems WinWCP... |
978aaecaa2a0a5e5d728f136458c9cb17af843fa7510efdaec2885733297fede | Python | 11,814 | 281 | import time
import os
import subprocess
import sys
sys.path.insert(0, '/home/jupyter/repos/genformer')
import re
import argparse
import collections
import gzip
import math
import shutil
import numpy as np
import time
from datetime import datetime
import random
import seaborn as sns
import logging
os.environ['TPU_LOA... |
abc90a540fba20f59b8073c16dcf07bd6c118bd0d77ab8e7ca2320306d5fbbc0 | Python | 11,817 | 320 | """distutils.command.register
Implements the Distutils 'register' command (register with the repository).
"""
# created 2002/10/21, Richard Jones
import getpass
import io
import logging
import urllib.parse
import urllib.request
from warnings import warn
from ..core import PyPIRCCommand
from distutils._log import lo... |
b360e4d82e3053db7c4ef0c45b512d4064a50f617be162d3e66daccc4290e021 | Python | 11,817 | 320 | 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
from autoaugment import CIFAR10Policy, ImageNetPolicy
class clothing_dataset(Dataset):
def __init__(
self, sample_ratio,
root... |
d081ab51fdce5889b948bea25d4581e53656f0161b517415b16a7a13590f4bd7 | Python | 11,822 | 329 | from __future__ import annotations
from logging import getLogger
import numpy as np
import pytest
from ase.build import bulk, molecule
from ase.constraints import FixAtoms
from ase.md.npt import NPT
from ase.md.nptberendsen import NPTBerendsen
from ase.optimize import FIRE
from ase.units import bar, fs
from quacc.re... |
84a27fa6f675e9385c25bf5f80518a9fbdb2ff5cb447af059495f0a6e704defe | Python | 11,824 | 229 | #!/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 ... |
231fa34cd9838bc5b6789e5f8eeb22e40a281d5b6fa9f3feff01ec5658768fe1 | Python | 11,828 | 237 | """
INVARIANCE_LADDER_CELEGANS.py - written 2026-09-14.
THE POINT OF THIS FILE
----------------------
`03-CODE/INVARIANCE_LADDER.py` derived, and then confirmed on the fly, that the
published sign conventions split into two tiers:
EVEN in s ||W||_F, sigma_1(W), the left singular vectors -> sign-... |
e80de0a4cc1dbeac6e6c6d19e02495640c6d757da421e2045d0ecfbdfa207904 | Python | 11,829 | 284 | import os
import sys
import datetime
import numpy as np
import SimpleITK as sitk
from functools import cmp_to_key
from PIL import Image
from src.utils import sitk_utils as sutils
from src.registration.multichannel import MultiChannel
from src.utils import file_utils as futils
from src.utils import evalu... |
631bfc3f2866bd324843b3f67e9feb120d78e59512401a87b1d295614d9568c5 | Python | 11,837 | 337 | """
Author: David Kappel
Copyright (C) 2024, by the author.
See the LICENSE.txt file for more information.
Code snoopies:
Train a distribution of spike times into a feedforward network.
"""
import numpy as np
import pylab as pl
import time
from scipy.ndimage import gaussian_filter1d
from scipy.... |
0c283ff29a7b0262df7da3d91aec596a665ae805d462d959fe33974a438a71e2 | Python | 11,838 | 312 | import sys
import random
import os
import argparse
import sys
import pwd
import time
import subprocess
import re
import shutil
from sklearn import metrics
import re
from sklearn.metrics import roc_curve,roc_auc_score
import numpy as np
import glob
from sklearn.metrics import roc_curve,roc_auc_score
from sklearn.metrics... |
d25f48494b06331a7c19965c63245fea0fb493753f72817555a9b0a26f9b1e4e | Python | 11,842 | 341 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import sys
from lab.environments import LocalEnvironment, MaiaEnvironment
from lab.experiment import ARGPARSER
from lab.steps import Step
from lab import tools
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute impo... |
dd49477f1422eff0005c8eeeafc68fa4f6e6a8785e702b2e6e6907125fb4d0a5 | Python | 11,842 | 355 | """Orchestrator for building wheels from InstallRequirements.
"""
import logging
import os.path
import re
import shutil
from typing import Iterable, List, Optional, Tuple
from pip._vendor.packaging.utils import canonicalize_name, canonicalize_version
from pip._vendor.packaging.version import InvalidVersion, Version
... |
11ae5f61e52804cab311b215833c4d7179e4a04a0ce45fa63de4214a10737cc9 | Python | 11,843 | 313 | import sys
import random
import os
import argparse
import sys
import pwd
import time
import subprocess
import re
import shutil
from sklearn import metrics
import re
from sklearn.metrics import roc_curve,roc_auc_score
import numpy as np
import glob
from sklearn.metrics import roc_curve,roc_auc_score
from sklearn.metrics... |
726770ef4c3c3db1681d04d27e59fb4646f065ab8853ca88fc719cb7eb19049f | Python | 11,843 | 309 | #...............................................................................
#
# This file is part of the Doxyrest toolkit.
#
# Doxyrest is distributed under the MIT license.
# For details see accompanying license.txt file,
# the public copy of which is also available at:
# http://tibbo.com/downloads/archive/d... |
729c5ae77ae029a42065539db0a719223f90b32c1776f68bf9c6dfb3d5ad2952 | Python | 11,844 | 233 | """Registered public FlyWire anatomy with exact graph-index mapping in nm."""
from __future__ import annotations
import argparse
import csv
import gzip
import hashlib
import json
import re
import struct
import urllib.request
from concurrent.futures import ThreadPoolExecutor
from dataclasses import dataclass
from dateti... |
068666ceae7b5dc5a17ee33838bf7231376dfe1d0399c3c5568915d688e4f904 | Python | 11,845 | 329 | from __future__ import print_function,division
import glob
import json
from traceback import format_tb
import pandas as pd
import numpy as np
import csv
import os
import sys
import topaz.utils.star as star
from topaz.utils.conversions import boxes_to_coordinates, coordinates_to_boxes, coordinates_to_eman2_json, coord... |
d835a668f0237b7cdb51a22a356b9c5da7830d55319a35bc5058ee6fec900630 | Python | 11,849 | 353 | #!/usr/bin/env python
# coding: utf-8
# ### LASSO parameter range experiments
#
# We want to see whether smaller models (i.e. models with fewer nonzero features) tend to generalize to new cancer types better than larger ones; this script compares/visualizes those results.
# In[1]:
import os
import itertools as it
... |
da0df065678a55e645da823524f6d1e7da4cce4596c47f85d7e5d7c4ca73b5b9 | Python | 11,850 | 353 | """
Self-hosted Neuroglancer viewer for OME-Zarr volumes, NIfTI files,
TIFF directories, and precomputed point annotations.
Opens a local Neuroglancer instance in the default browser.
"""
import os
import glob
import inspect
import webbrowser
import threading
import numpy as np
from regtools.utils.io.v... |
75710086da72b99d43b9c2ffab8043d6a49ff7215998daf449b0ae5ec1f6980e | Python | 11,851 | 250 | # -*- coding: utf-8 -*-
import torch
import torch.nn as nn
from torch.optim.lr_scheduler import StepLR
from sklearn import metrics
import numpy as np
import argparse
import os
import sys
import time
import re
from .models import ModelBiLSTM
from .dataloader import SignalFeaData2
from .dataloader import c... |
4568a228a44f935ba48d6f6790f904734f77424b93f189247328b01e5c6776ca | Python | 11,852 | 434 | #!/usr/bin/env python
import argparse
import os
import sys
from functools import partial
from multiprocessing import Pool
from shutil import rmtree
from irescue._genomes import __genomes__
from irescue._version import __version__
from irescue.count import (
formatMM,
index_features,
run_count,
split_b... |
a755e5fff18956ee2be918caf03f445d6d029dee0cbcc7cfd05625d39e8fa090 | Python | 11,852 | 339 | # 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... |
bfea6c790233e17a91f776a2cf4b64549e20a0e9d6e01342e898fa2698a5ecb7 | Python | 11,852 | 260 | """
Script to run cross-cancer classification experiments (i.e. train on one
gene/cancer type, test on another) for all chosen combinations of gene and
cancer type.
"""
import sys
import argparse
import itertools as it
from pathlib import Path
import numpy as np
import pandas as pd
from tqdm import tqdm
import panca... |
8426a1c82e454116daffedeb7f550092226b96ae23c940e6973e6473018216a8 | Python | 11,853 | 373 | from collections.abc import Callable
from typing import Any, cast
import pytest
import elasticai.creator.ir.datagraph as dgraph
from elasticai.creator.graph.subgraph_matching import find_all_subgraphs
from elasticai.creator.ir import Attribute, AttributeMapping, Edge, Node
from elasticai.creator.ir.datagraph import D... |
5f091d9c4cd67cccd6bb11cdf4ac3cbe835e9e3e081a6d360ded3bf63a9fde70 | Python | 11,854 | 246 | import click
import csv
import logging
import gzip
import numpy as np
import deeplift
from lib.sequence import SeqFastaLoader1D, SeqClassificationDataLoader1D
# options
methods = [
'grad_times_inp',
'guided_backprop',
'integrated_gradients10',
'rescale_all_layers', 'revealcancel_all_layers',
'resca... |
90a6f65fafe555c7d5bb1eb544a428826cd577ada289d03beb05659556deace8 | Python | 11,854 | 323 | import MDAnalysis as mda
import numpy as np
from biotite.structure import AtomArray, AtomArrayStack
from MDAnalysis.coordinates.base import SingleFrameReaderBase
from MDAnalysis.coordinates.memory import MemoryReader
from MDAnalysis.core.topology import Topology
from MDAnalysis.core.topologyattrs import (
AtomAttr,... |
2a793ab4922041a592c7f3f53a62cdd4ce595514f549fd04c842305f3f6ba6ff | Python | 11,856 | 285 | from pathlib import Path
from pytorch_lightning.callbacks import LearningRateMonitor, ModelCheckpoint, StochasticWeightAveraging, EarlyStopping, \
ModelSummary
from pytorch_lightning.loggers import CSVLogger
# from pytorch_lightning.plugins.environments import SLURMEnvironment
from pytorch_lightning.trainer.states... |
c8d64031897e195b6c77886955e0dab0ff9c334d06feb68c79a5723e14718a6f | Python | 11,856 | 272 | import json
from multiprocessing import Process, JoinableQueue
import argparse
import os
import re
import shutil
import sys
import glob
import numpy as np
import math
from unicodedata import normalize
from skimage import io
from skimage.color import rgb2hsv
from skimage.util import img_as_ubyte
from skimage import filt... |
cc021780a383e959b604b0dcd351fcdccc03f678ce3df21e8bbb27633cbc1436 | Python | 11,857 | 325 | # 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... |
07d3927145da4381bfdbfc352aafde41f3198b7826e3d5eb3679263e30f54a7e | Python | 11,864 | 305 | from __future__ import division
import logging
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from func_unsupervised_CC import fit
from IterativeMethod import iterativeCC
"""
Created on Sat Oct 27 17:45:37 2018
@author: Hannah Choi
"""
"""
This code finds hierarchy scores of cort... |
144080878a3f35f75b7bab2556fe5a548fe807d6c247712cca0bcaebe05fbae6 | Python | 11,872 | 298 |
# -*- coding: utf-8 -*-
"""
Created on Jun 23 2023
@author: Jonas A. Thiele
"""
### Apply models build in main sample (610 subjects of HCP) to
### predict intelligence scores in the lockbox sample (196 subjects of HCP)
### For models that were trained with connections between specific nodes (from intelligenc... |
923f519a8d57ed67143cc337c2f189f830fd3a1b947034c5b21dc882fc82fb39 | Python | 11,872 | 426 | # 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... |
c4257d8ae50910e5269c8866b3cd74581acdead346a788367770338d6a097a52 | Python | 11,873 | 372 | #!/usr/bin/env python3
import logging
import numpy as np
import os
import time
import random
from collections import defaultdict
import torch
import PIL.Image as Image
from fvcore.common.file_io import PathManager
import cv2
from datasets import transform as transform
logger = logging.getLogger(__name__)
def retr... |
cd2d6f2ac6543f58830225c9fdb62f29daeb5325867722c68b3a98b33d037377 | Python | 11,873 | 394 | """
Module for building ResNet Module according to different config file
"""
from torch.nn import Module
import torch
import torch.nn as nn
import warnings
def conv2d(w_in, w_out, k, *, stride=1, groups=1, dilation=1, bias=False):
"""Helper for building a conv2d layer."""
assert k % 2 == 1, "Only odd size ke... |
f8ae8918c2bf2842775afc25da8b7c0ee42353bc96381229e7dd0b618020ef60 | Python | 11,874 | 363 | import os
import pandas as pd
import numpy as np
from pingouin import compute_effsize
from scipy.stats import goodness_of_fit, shapiro, skew, \
skew, uniform
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.colors import to_hex
from utils impor... |
91bc4f0c4496b53b3ec9de3fb79ff468c65692061f87a8a3316c53b09f67b1e8 | Python | 11,878 | 345 | # 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... |
ac29c960396c6e3952d8073e78bce8f3a4a6e76682b505c1df912342781717e3 | Python | 11,879 | 280 | # This script is written to include the operations including the coordinates mapping and transfer.
def reverse_mapping(t2g_dict):
"""Get the g2t_dict from t2g_dict, mapping genomics position to transcript position,
note that each genomics position can be mapped to multiple transcript positions.
param t2g_d... |
6b0b8114b3e518b2eaf2a3d4c15a030438b43822c223d673ed06a076a5a301fe | Python | 11,880 | 298 | # coding=utf-8
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... |
fdca307d984ab279678048ede0c2a5fcd82aadbd65881600c68fecd6be3c6cc6 | Python | 11,880 | 296 | #
# 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,... |
1195d975951da51f52f4324346e690a25fd4d89449b671b67be4471e44ded122 | Python | 11,882 | 330 |
import os
import csv
import numpy as np
import scipy.io as sio
import torch.nn.functional as F
from sklearn.linear_model import RidgeClassifier
from sklearn.feature_selection import RFE
from nilearn import connectome
from scipy.spatial import distance
# Reading and computing the input data
# Selected pipeline
pipeli... |
bf5af3405f728231610b4a6ee07ae4176aeb3e9ee25b8e13571c7719aecd88ca | Python | 11,888 | 319 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import subprocess
import sys
from lab.environments import LocalEnvironment, MaiaEnvironment
from lab.experiment import ARGPARSER
from lab.steps import Step
from downward.experiments.fast_downward_experiment import FastDownwardExperiment
from downward... |
5bb7d936f6d4952e2500cb17ee20f9e9080ae1dc05c76b5970f5011b9564841c | Python | 11,889 | 289 | #!/usr/bin/env python
#================================================================
# Copyright (C) 2023 Yufeng Liu (Braintell, Southeast University). All rights reserved.
#
# Filename : plot_features.py
# Author : Yufeng Liu
# Date : 2023-02-03
# Description :
#
#=================... |
d018d53df7ddc952bfefac4a29c9b6dd176d384df2924bdd7fed1264b4e2b818 | Python | 11,890 | 273 | # Script to actually run CCA on the data
# Using the meet package https://github.com/neurophysics/meet.git to run the CCA
# Apply CCA to data processed with signal noise suppression (SNS) and 30Hz hpf applied
import os
import mne
import numpy as np
from meet import spatfilt
from Functions.get_channels import get_chan... |
20c38b55fbee737f954ccda0f6f773016da2b0b46fc037cfba6e38c63318ff65 | Python | 11,893 | 256 | # 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... |
70cf7d0a762943c04ee95e47fe6a40a48c23c29175232aa81d24460591646afb | Python | 11,893 | 358 | from collections.abc import Sequence
from typing import Literal
import numpy as np
from numpy.typing import NDArray
from openmm import openmm
from openmm.unit import (
dimensionless,
kilojoules_per_mole,
nanometer, # pyright: ignore[reportAttributeAccessIssue]
)
RestType = Literal['harmonic', 'go']
GAS_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.