sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b65f80a6bf92605a14be56ea7ca614f845dfe30b69ddcc5ef1aab18f1615aaaf | Python | 4,364 | 76 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from downward import suites
from lab.reports import Attribute, gm
import common_setup
def main(revisions=None):
SUITE = suites.suite_optimal_with_ipc11()
B_CONFIGS = {
'rl-b50k': ['--search', 'astar(merge_and_shrink(merge_strategy=merge_linear(variable_... |
da6b19f1e0bd753f8bc2f1f80a78109982ae7f9f5df391b4bc9d4af45ee523e3 | Python | 4,364 | 89 | """
ISN_ACROSS_CONVENTIONS.py written 2026-09-07
THE QUESTION. Every published sign convention is applied to the SAME wiring diagram.
Do they only shift numbers, or do they put the fly brain in a different DYNAMICAL
REGIME?
The regime that matters is inhibition stabilisation. A network is an ISN when its
excitator... |
46ed4a4a0fe5f83b15de20fa8e2cd7cbbf6faa37f5e5fbed2ed9fd3fe6911baa | Python | 4,365 | 129 | # multisim.py
# A class designed to collect statistics on many simulations.
# TODO: Add docstrings
# imports
from os import PathLike
from pathlib import Path
from typing import Iterable
from rich import print
from simulation import Simulation
class MultiSim:
def __init__(self, mat_files: list[PathLike] = Non... |
b496215a9ff98a57ac5f9572b4a3b379de68b359f19bf3df57375c3214081cc0 | Python | 4,365 | 136 | # Node-group asset "Stagger Value" (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... |
7c567f3f71c808d9aa4ee50d1870c4327753805e822106ae719edc61417a9eeb | Python | 4,366 | 159 | #!/usr/bin/env python
# coding: utf-8
# In[63]:
import warnings
warnings.simplefilter("ignore", RuntimeWarning)
import numpy as np
import math
import matplotlib.pyplot as plt
import time
start_time = time.time()
plt.rcParams.update({'font.size': 18})
get_ipython().run_line_magic('matplotlib', 'notebook')
# load th... |
7d7ec25bd4df7eb5e89d3d6a1e925c73df7a9dc7ec1fb9465db904e4a21fead8 | Python | 4,366 | 109 | import os
import unittest
import pandas as pd
from hed import schema as hedschema
from hed.models import HedString, Sidecar, TabularInput
from hed.models.df_util import expand_defs
from hed.tools.analysis.hed_tag_counts import HedTagCounts
# noinspection PyBroadException
class Test(unittest.TestCase):
@classmet... |
e7a2bb28d787aad0d66861635d6cefb5f6cbb7376a25a08545af69ec68ef7124 | Python | 4,366 | 141 | # 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... |
403031e8ceff17d7297b4b573984940b410b3cc4a0bfe145630e58630308e484 | Python | 4,367 | 120 | """A QTabWidget whose current tab can be popped out into its own larger window.
Used for the registration tab's preview panes (input/atlas preview, foreground
init, log). Popping out MOVES the tab's widget into a resizable window - the tab
is removed while detached, so there is never a duplicate pane - and docking... |
50171a7a4593925a8862b9950c46c79437b69e0888aa0e8a704624e1d1a40616 | Python | 4,367 | 105 | # 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... |
f40142169f85b28446a90607e218d1c9dfbbe9a6b1c9a71d19524e6b27d0b075 | Python | 4,367 | 136 | from torchvision.models.resnet import resnet50
from torchvision.models.vgg import vgg19_bn
from torchvision.models.swin_transformer import swin_t
from .autoencoder import AutoEncoder
from .convnet import SimpleConvNet, RecurrentConvNet
from .linearnetworks import ShallowLinear, DeepLinear
from .mlp import MLP
from .sof... |
79b56dc4c1e4ac0b54b78dff93938ee235f6be0e5b3d2c9e32a11759a1a3c3cc | Python | 4,368 | 64 | """AL_FIX.py 2026-09-25. Pre-registration: 04-NOTES/PREREG-2026-09-25-AL-FIX.md"""
import sys, os, time
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import numpy as np, pandas as pd, scipy.sparse as sp
import SHIU783_SIM as S
R = 'D:/eucys'; L = []
def p(m=''): L.append(str(m)); print(m, flush=True)
d... |
1fc4f1e5225be0c5d86b528abd69144caa4d89d601233e5e72b7c9361aa7d380 | Python | 4,370 | 87 | # 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... |
9327465613052c0c390c4bb1ac087b7b2f74f8089137aea18119fa2737c7819a | Python | 4,370 | 141 | # 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... |
af6f189c17208a00eb24801845d0a55c9ce3a4a853df33bf58d8ab0c7076fde3 | Python | 4,370 | 148 | import re
import numpy as np
from matplotlib import pyplot as plt
from sklearn.metrics import accuracy_score, f1_score
def camel_to_snake(name):
s = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s).lower()
# -----------------------------------------------------------... |
b299e46920568fb559a9da827921c612489f6fc7c164f4eacb173f1beba2b670 | Python | 4,370 | 118 | # 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... |
f6ea78be9823080aa40ddd70ca24f01e38f4603499008a9e063cba8a7cfd6c01 | Python | 4,370 | 99 | from typing import Optional, Union
from segmentation_models_pytorch.base import (
SegmentationModel,
SegmentationHead,
ClassificationHead,
)
from segmentation_models_pytorch.encoders import get_encoder
from .decoder import FPNDecoder
class FPN(SegmentationModel):
"""FPN_ is a fully convolution neural... |
0b801d0350714faa3d4e9996b56af085cf084bc18d9ba3bf77a01172f21b7820 | Python | 4,373 | 114 | """Compare predictive accuracies between runs with and without subject sMRIs
"""
# Set up dependencies
import os
import pandas as pd
from utils.data import load_data
from utils.statistics import stat_ind_two_samples, stat_ind_one_samples
from utils.visualize import plot_grouped_bars
if __name__ == "__main__":
#... |
5b64c5a66da9451888f2b5be18e8e51b2b2e06bca950de1b0306e194ef1375d2 | Python | 4,373 | 134 | import numpy as np
from .basic_euclidean import eucl_dist, eucl_dist_traj, point_to_trajectory
from .basic_spherical import point_to_path, great_circle_distance, great_circle_distance_traj
######################
# Euclidean Geometry #
######################
def e_spd(t1, t2, mdist, l_t1, l_t2, t2_dist):
"""
... |
86a5d357ea2cb6ab41e38c74afe18f07ad517bb87bdfce04ed275d07c22ea306 | Python | 4,373 | 85 | """
TIMING ALGORITHM AND FUNCTIONS
This file contains the necessary tools for keeping track of the duration of various types of self timesteps.
WE ONLY MEASURE DETECTOR 1 AND INFER DATA FOR DETECTOR 2 FROM THAT.
"""
import time as timelib
def init_timer(self):
self.timesteps_dur = list()
self.avg_dur_normal... |
ec4d425b80a48e0bb6533c0795f86c077e4464983f3a0668dc94f91663ed3c69 | Python | 4,373 | 132 | import torch
from torch import nn
from einops import rearrange, repeat
from einops.layers.torch import Rearrange
# helpers
def pair(t):
return t if isinstance(t, tuple) else (t, t)
# classes
class PreNorm(nn.Module):
def __init__(self, dim, fn):
super().__init__()
self.norm = nn.LayerNorm(d... |
38ccb505a34d79d048b9ae4eacb982e7e272352f64b617b3d7ba734331da7bff | Python | 4,374 | 136 | '''MIT License
Copyright (c) 2020 Duncan Forster
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, publish,... |
1d8b56d9dcd384c1841601097a8e3052b1042f6cfd9ae8b137d76eb89f9acef9 | Python | 4,375 | 114 | #!/usr/bin/env python
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Basic CARLA Autonomous Driving training scenario
"""
import py_trees
from srunner.scenarioconfigs.route_scenario_configuration import RouteConfiguration
from srunner.scena... |
ae73605ec7f85109231fa5daa79d59302f267fd17dc744f36459e160488d56bf | Python | 4,375 | 121 | from __future__ import annotations
import numpy as np
import pytest
from ase.build import bulk
from ase.md.andersen import Andersen
from ase.md.bussi import Bussi
from ase.md.langevin import Langevin
from ase.md.nose_hoover_chain import MTKNPT, IsotropicMTKNPT, NoseHooverChainNVT
from ase.md.npt import NPT
from ase.md... |
3f12edc9a9361d1ed1fe206186ad5eb4e77dc5c5785c0b3ee0a37102fe72bbc5 | Python | 4,376 | 125 | """
Script for a classification in a reference (comparison is made by rlnImageName indexing)
Input: - The STAR files with the classification to compare
- The STAR file with the ground truth particles
Output: - An histogram with the fraction of particles per class in the reference classificat... |
6b808407ca162a3fd03237449740a6bfc10d47160ae1cb1c2f4d86ef82a51967 | Python | 4,377 | 102 | r"""Test OpenBabel executables from Python
Note: Python bindings not used
On Windows or Linux, you can run these tests at the commandline
in the build folder with:
"C:\Program Files\CMake 2.6\bin\ctest.exe" -C CTestTestfile.cmake
-R pytest -VV
You could also "chdir" into bu... |
fca1a063fa9ceef84c1a9a2ab2cdb99f68622c234a46dbf3f660ab4bb824ab27 | Python | 4,378 | 136 | """PEP 656 support.
This module implements logic to detect if the currently running Python is
linked against musl, and what musl version is used.
"""
import contextlib
import functools
import operator
import os
import re
import struct
import subprocess
import sys
from typing import IO, Iterator, NamedTuple, Optional,... |
b4c889965f1b58546ab4640901c01cf95d05b9b722c36e195c586050a15aee21 | Python | 4,380 | 123 | #!/usr/bin/env python
#
# 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... |
eba91d401704dc506f470d9d9dc37981eaf5f898c8b83bac29432f32eaff3c42 | Python | 4,380 | 127 | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 23 11:17:28 2021
@author: u0139894
"""
import cobra
from dnngior.MSEED_compounds import Compounds
from dnngior.MSEED_reactions import Reactions
#Use script from ModelSEED biochemistry to parse all metabolite/reaction info
compounds_helper = Compounds()
compounds_dict = ... |
f76a6219f164c42c7fd42b67297431d1eb159bb86949bac50621b75836c61da3 | Python | 4,380 | 111 | import os
import sys
import time
datadir = sys.argv[1] # should point to the directory where the fast5 & reds dir exist
model_name = sys.argv[2]
print("Model Name: " + model_name)
# Python Script Paths
exedir = "../run_scripts/" # the path to HierarchyCall's test/run_scripts dir
minimap_script_path = exedir + "ru... |
bed8240adf7b7530b2537d939e9fc55fe7fef186942e571c13fe0faa98ef2ff9 | Python | 4,381 | 117 | # 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... |
7adb0043fc8640f329ed81388025db6c20a6360da7b0f891f8cdb93a824005f4 | Python | 4,382 | 167 | from __future__ import annotations
from typing import TYPE_CHECKING
from quacc.wflow_tools.customizers import strip_decorator
from quacc.wflow_tools.decorators import job
if TYPE_CHECKING:
from typing import Any, Callable
@job
def partition(list_to_partition: list, num_partitions: int) -> list[Any]:
"""
... |
e893cae9648784db28158fe938c4dccd1bd16931d9b23f7c81f1c6277108f08a | Python | 4,382 | 157 | from contextlib import ExitStack
import cocotb as ctb
import pytest
from cocotb.clock import Clock
from cocotb.triggers import RisingEdge
from elasticai.creator.file_generation.resource_utils import get_file_from_package
from elasticai.creator.testing import eai_testbench
pytest_plugins = "elasticai.creator.testing.... |
311f8642cb3532bcd7dd7b2a4f0ee439e61bbc0865147bf0044b3fcae3ec25d2 | Python | 4,383 | 99 | """rotate_image is the single rotation primitive shared by counting and
registration. These tests pin it to the behaviours each call site relied on, so
centralizing doesn't silently change any of them (the one intended change - the
colour direction matching grayscale - is covered separately in the registration
test... |
5b24c568fce89cad12f49eadb4c0457f7db83903176f2d587b0d998b3ca55925 | Python | 4,383 | 128 | #!/usr/bin/env python
__author__ = "Harold Grosjean"
__email__ = "haroldgrosjean@gmail.com"
import numpy as np
import pandas as pd
import rdkit
from rdkit import DataStructs, Chem
from rdkit.Chem import Descriptors, rdMolDescriptors, SaltRemover, Draw
import matplotlib.pyplot as plt
def calculate_descriptors(smiles)... |
bd1a186e3bc2a337e8c899a5b79abc7deb12079acfaf50267e786af0698d70ac | Python | 4,383 | 119 | # 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... |
5f97d3b633d678e8456fd08210fd4654938fa58825918f6369041feea3c78559 | Python | 4,384 | 150 | # ----------------------------------------------------------------------
# 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/... |
81b49e65fb69343f67a7d9d14b86c30972cdb3a90039cf637074c37ba1a7c1c8 | Python | 4,384 | 126 | import numpy as np
import pytest
from ase import Atoms
from ase.build import molecule
from ase.calculators.calculator import Calculator, all_changes
from ase.calculators.lj import LennardJones
from ase.constraints import FixAtoms
from sella import Constraints, IRC
# A first-order saddle of the 6-atom Lennard-Jones ... |
9c18c34a76340a46fdf4972ce77280a5f891086a62e1778a52232ff325e4edf4 | Python | 4,384 | 160 | import numpy as np
import pytest
from ase import Atoms
from ase.build import molecule
from ase.calculators.lj import LennardJones
from sella import Sella
def _assert_refined_optimizer_can_step(
optimizer, expected_initialization_evals=None
):
H = optimizer.pes.H.asarray()
assert H.shape == (optimizer.pe... |
18d386237489f369860e00142322c1db9e7aebf2b1be44d49fc4e26fe90f1d5c | Python | 4,385 | 140 | # Node group "Find Connected" (GeometryNodeTree), dumped by nodebpy.assets.dump_library.
# Rebuild the library with nodebpy.assets.build_library (nodebpy build).
# Shared by several assets, which import it; not an asset itself.
# _build_group() is the source of truth: the docstring, __init__ and accessors are regenerat... |
a548040c43319e77727d71595d4fd4dcb1b4f34f4a222edfb287d0c6a761906e | Python | 4,385 | 105 | import torch # 导入 PyTorch 库
from torch import nn
import torch.nn.functional as F
# 定义 Transformer 模型
class TransformerModel(nn.Module):
def __init__(self, input_size, num_classes):
super(TransformerModel, self).__init__()
# 定义 Transformer 编码器,并指定输入维数和头数
sel... |
0e648267176fc2364f92855e6f32f0b6be225202c3a0e02396ee4dbe71a72b0d | Python | 4,386 | 135 | ##
# \file stack_mask_morphological_operations.py
# \brief { item_description }
#
# \author Michael Ebner (michael.ebner.14@ucl.ac.uk)
# \date May 2017
#
import sys
import itk
import numpy as np
import SimpleITK as sitk
import pysitk.simple_itk_helper as sitkh
import pysitk.python_helper as ph
import... |
a3248e97246bb745c4a18324be6798309012d246a39e6eb686cc20c3fe7ab994 | Python | 4,386 | 157 | # 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... |
4e266d363e4fc7d3f1bf3baa3a0137cee90d6b7c454dd34a3c698045d0d7d528 | Python | 4,387 | 127 | import argparse
import csv
import numpy as np
from numba import njit, prange
from numba.core import types
from numba.typed import Dict
from scipy.ndimage import zoom
from skimage.segmentation import find_boundaries
from plantsegtools.utils.io import smart_load, create_h5
def parse():
parser = argparse.ArgumentP... |
ee359e442f21fbed3a0b9ca305dc28ad27af23870babd6b8ad1478042eed34a3 | Python | 4,388 | 122 | from elasticai.creator.file_generation.savable import Path
from elasticai.creator.file_generation.template import (
InProjectTemplate,
module_to_package,
)
from elasticai.creator.nn.integer.ram.design import Ram
from elasticai.creator.vhdl.auto_wire_protocols.port_definitions import create_port
from elasticai.c... |
b96d1202e6701a218dad2d4942a5cc3cc42afc717faa85a0fa6c3ac90c0b0997 | Python | 4,390 | 112 | import os
import SimpleITK as sitk
from yacs.config import CfgNode
class sitkTile:
# 1. estimate transformation between input volumes
# 2. warp one volume with the transformation
def __init__(self, cfg: CfgNode):
self.elastix = sitk.ElastixImageFilter()
self.transformix = sitk.TransformixIm... |
021c708db6d7b59369c59e2a0a0b5a3c196b956c80a1011f1f3d6e6773bb6bf2 | Python | 4,391 | 115 | import tensorflow
import numpy as np
import keras
from keras.models import Model,load_model
from keras.layers.advanced_activations import PReLU
from keras.layers.convolutional import Conv2D, MaxPooling2D
from keras.layers import Dropout,GaussianNoise, Input,Activation
from keras.layers import BatchNormalization
... |
9b3d5fc083186f26a55309a308fab623bbf8a7c347332563a1b905251b67e4e6 | Python | 4,391 | 145 | import os
import cc3d
import numpy as np
import cv2 as cv
from tqdm import tqdm
from tiffile import imread
from yacs.config import CfgNode
from scipy.spatial.distance import cdist
from skimage.measure import label, regionprops
class PointCloud:
"""
Various point cloud utility options, main one being
the g... |
755b8bcfb8476e32101118e94cd485d8e9a280621a6b0f7b37ceea4e90038ef9 | Python | 4,392 | 118 | #!/bin/env python3
"""
Phase is like a clock
"""
import ithildin as ith
import numpy as np
import matplotlib.pyplot as plt
import sys
from typing import Union, Dict, List
sd = ith.SimData.from_stem("results/pdl-detection/phasealpa_7")
# sd = ith.SimData.from_stem("results/pdl-detection/phase_68")
dt, dz, dy, dx = sd.... |
1ca35ee8b20b6ab9a7f9d42c7a3c37f4d36204efe204fa7320170b9a76925e38 | Python | 4,393 | 119 | import matplotlib.pyplot as plt
from matplotlib import cm
from scipy.optimize import minimize
import autograd.numpy as np
import autograd.numpy.random as npr
from autograd import value_and_grad
from autograd.scipy.stats import t
def make_ica_funs(observed_dimension, latent_dimension):
"""These functions implemen... |
320ef93e9ce6400fc864317e5a9e4430724ed95b59cc218fec07c230473a3170 | Python | 4,393 | 137 | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 22 16:11:11 2020
@author: au571303
"""
from random import shuffle
from psychopy import prefs
prefs.hardware['audioLib'] = ['PTB']
#prefs.hardware['audioLib'] = ['pyo']
from psychopy import visual, core, sound, event, gui, logging
import os
import numpy as np
#from trigger... |
66423312d88eca6e4c4839a02f4a6ac0c24772ba414fe82df5deb8b7ed116d3a | Python | 4,393 | 105 | # 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... |
9ae5f3be69293ea339e153d19fb2f7921000d57d25db8057206f4f934dfe5f01 | Python | 4,393 | 133 | """Manager for type factors and type definitions."""
import json
import pandas as pd
from hed.tools.analysis.hed_type import HedType
class HedTypeManager:
"""Manager for type factors and type definitions."""
def __init__(self, event_manager):
"""Create a variable manager for one tabular file for a... |
d0e4b26fe82c7029504b2d90d2b14c5ebdeace03f441129c3a95d5417dd4d410 | Python | 4,396 | 115 | import json
import os.path
from google.protobuf import json_format
from loguru import logger
from ord_schema.proto.reaction_pb2 import Reaction
from ord.evaluation.evaluate_functions import evaluation_message_level, get_pair_evaluators, \
evaluation_document_level, get_summary_table_message, evaluation_leaf_level... |
28fe14571bf6bd6af1feb7d7211c26652eff4b5bf92c4460d1cb91e53a293504 | Python | 4,397 | 133 | # 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... |
fee7324c84f0bd367663e1e26c79333d57386847dff00f7ec28b866ad414daf1 | Python | 4,397 | 128 | # -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from PIL import Image
import torch
import torchvision
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.utils.data as data
from torch import optim
from torchvision import datasets, transforms, models
import torchvision.transforms.funct... |
ac25c64e8daba054025cc9081ff9cd6aecea46a8f220d35ac3c9ae772ad1e400 | Python | 4,398 | 99 | import distutils.command.build_clib as orig
from distutils.errors import DistutilsSetupError
from distutils import log
from setuptools.dep_util import newer_pairwise_group
class build_clib(orig.build_clib):
"""
Override the default build_clib behaviour to do the following:
1. Implement a rudimentary time... |
bc51ad25cf0295e00587d1b456e10c0ee9853e918bfa24d1ba94e82b10b97be1 | Python | 4,398 | 122 | # Librairies
import os
import sys
code_path = os.path.split(os.path.split(os.getcwd())[0])[0]
sys.path.append(code_path)
import numpy as np
import random
import torch
from joblib import load
import argparse
from setting import *
from utils import *
from loader import *
from evaluate import *
from models import *
device... |
37cad7ce3675cbc06abfd09e561f63fa1169e4525dbe50e418115f14f74a73db | Python | 4,399 | 50 | """AL_FIX_V630.py 2026-09-25. Pre-registration: 04-NOTES/PREREG-2026-09-25b-AL-FIX-REPLICATION.md (test R)"""
import sys, os, time
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import numpy as np, pandas as pd, scipy.sparse as sp, SHIU783_SIM as S
R = 'D:/eucys'; L = []
def p(m=''): L.append(str(m)); p... |
4f68e2881c6c3b2b6ba04ed6d9ab3b430a32cb697abe4bc2c26d8cff3c1fef4d | Python | 4,399 | 136 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Shared parameters for analysis
"""
import matplotlib.pyplot as plt
# global flag for black and white figures
bw = False
colorE = 'r'
colorI = 'b'
colorP = 'r'
class params():
def __init__(self,
textsize=6,
titlesize=7,):
... |
82f062ec4137cc77cc9070714e19b47d8b5f421f198f71ce71c52acf2f70c738 | Python | 4,399 | 167 | # 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... |
8e4780358476dd41dfd737d3b24399b997033eb8bf72fcb46a3f47c0547e1007 | Python | 4,401 | 136 | import h5py
import numpy as np
import torch
from torch.utils.data import DataLoader, TensorDataset
import torch.nn as nn
import torch.optim as optim
import matplotlib
# matplotlib.use('Agg')
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch
impo... |
979b3bacd8f5abdd9d57e359921241d6d587bf034c2153bb9314d5a5bab0a833 | Python | 4,401 | 130 | import os
import json
from functools import partial
from tqdm import tqdm
import numpy as np
import torch
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
import torchvision
import torchnet as tnt
from protonets.engine import Engine
import protonets.utils.data as data_utils
import proton... |
b83688497a6c2c1a98c21d07b48021c694a9a9aec37976e49436eaa5a23f4c19 | Python | 4,401 | 116 | """
toposampling - Topology-assisted sampling and analysis of activity data
Copyright (C) 2020 Blue Brain Project / EPFL & University of Aberdeen
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation... |
484fff176398b7c68d3d8b48f64d0605b65db50693d54af5ff4cd365d197cce5 | Python | 4,402 | 115 | # 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... |
76c614eedba734d7afe085edde8b1fc50edbc1f7d3b7c8fc3b081085f764453a | Python | 4,402 | 65 | from setuptools import setup, find_namespace_packages
setup(name='nnunetv2',
packages=find_namespace_packages(include=["nnunetv2", "nnunetv2.*"]),
version='2.1.1',
description='nnU-Net. Framework for out-of-the box biomedical image segmentation.',
url='https://github.com/MIC-DKFZ/nnUNet',
... |
79b9b127e044e3fc26a68a2f678c427cab30e1234e72fbb45d54b9490a3e71cb | Python | 4,402 | 122 | # 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... |
675b942b1a96e9c07e36a7c076fef67c96c68ae9e23d0905b4da75720568c3ee | Python | 4,403 | 119 | """
CRITERIA FUNCTIONS FOR EXTREME VALUES OF WS AND AP
These functions detect signs of too high or too low values of the WINDOW_SIZE and AGE_POWER parameters.
"""
def check_anom_flap(self, time, anom, patt):
# calculating database
if time - self.SIGNAL_DATABASE_LEN + 1 <= self.B:
database_beginning =... |
a26e0db6dc08d51ab1b5925224d3154c2fc1c06ffc9d8e305c26c8531313638c | Python | 4,403 | 119 | import os
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from datasets.SequenceDatasets import dataset
from datasets.sequence_aug import *
from tqdm import tqdm
signal_size = 1024
#Three working conditions
dataname= {0:["ib600_2.csv","n600_3_2.csv","ob600... |
2704624ef6b6c1d376b2ec3962a267b38bb78210c550d3138db032b5263308e8 | Python | 4,404 | 141 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
a2c57624018aa9604a0e11537d7ea024b86c321320e5e0d8b1f4fa3e466d78bc | Python | 4,404 | 74 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from downward import suites
from lab.reports import Attribute, gm
import common_setup
def main(revisions=None):
SUITE = suites.suite_optimal_with_ipc11()
B_CONFIGS = {
'rl-b50k': ['--search', 'astar(merge_and_shrink(merge_strategy=merge_linear(variable_... |
7a2bab13fc12cc8e7dcd4fdbe4d5fceb8803ec0c09cbf609f673c0890d994a10 | Python | 4,405 | 112 | from __future__ import print_function
import sys
import pddl
import pddl_to_prolog
class OccurrencesTracker(object):
"""Keeps track of the number of times each variable appears
in a list of symbolic atoms."""
def __init__(self, rule):
self.occurrences = {}
self.update(rule.effect, +1)
... |
bb7fba267e6cf6b38a621937041967e7d63c5a13230ed37ad7db25eb02e6fe4f | Python | 4,405 | 110 | __author__ = 'martinez'
import numpy as np
from unittest import TestCase
from pyorg.spatial.sparse import UniStat, PlotUni, gen_sin_points, gen_rand_in_mask
from pyorg import disperse_io
# ### Test variables
# Global
RES = 0.684 # nm/pixel
# Mask
MASK_R = 2000 # nm
SIZE = (200, 100, 5) # pixel
# Pattern 1
N_PST_1 ... |
4861ff5efbfcf5210629e4ff96c91101da1a28eb2fe048bca54c1b8ead2a1beb | Python | 4,406 | 143 | # Node-group asset "Geometry Field Remap" (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_C... |
715586c657d58ad1ddebbadc172899f1541e94268261322314a7f70499e988c5 | Python | 4,408 | 145 | import numpy as np
from . import linecell as linec
def owd_grid_brut(traj_cell_1, traj_cell_2):
"""
Usage
-----
The owd-distance of trajectory t2 from trajectory t1
Parameters
----------
param traj_cell_1 : len(t1)x2 numpy_array
param traj_cell_2 : len(t2)x2 numpy_array
Returns... |
36959fe80d263866aad96e9648905e4241e13d95c7f25f9f7dfd7015d1fa19a2 | Python | 4,409 | 102 | """
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
from scipy.stats import zscore
import numpy as np
import argparse
import os
from rastermap import Rastermap
from rastermap.io import load_activity, load_spike_times
try:
from rastermap.gui import ... |
13db3801025b0c1a741651aa58a45a60ce56386aafb8e8215a06fe5b041b35fc | Python | 4,410 | 132 | """
version 1.0
author: Felix Plasser
description: Superposition of two sets of weighted coordinates using a quaternion fit, C.F.F. Karney, J Mol Graphics and Modelling 25 (2007) p.595.
"""
import sys
try:
import numpy
except:
print('numpy not installed')
sys.exit()
class superposition:
"""
Class ... |
c47bc4ef6428abd68ad73015b422768ced0cba78aae022b20521e5c8e311336b | Python | 4,410 | 78 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from downward import suites
from lab.reports import Attribute, gm
import common_setup
def main(rev1, rev2):
REVS = [rev1, rev2]
LIMITS = {"search_time": 1800}
SUITE = suites.suite_optimal_with_ipc11()
B_CONFIGS = {
'rl-b50k': ['--search', 'astar(me... |
45ec321b8e06d5d8f4558dd34a40117425644c624b45eddb572e4c0c86a17203 | Python | 4,411 | 143 | #
# 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,... |
96bbf11db8ea6fe26c587fb59cf438f70b8fa7c5436d456d01483760601a01d5 | Python | 4,411 | 146 | """Plot correlation between performance and decoding time for stimulation on and off."""
from __future__ import annotations
from pathlib import Path
import pandas as pd
import pte_stats
import scipy.stats
import seaborn as sns
from matplotlib import pyplot as plt
import motor_intention.plotting_settings
import motor... |
e4db6f507076b424dab50e39382b45e34e85f81629b9d8e84c537cb7c5f73e80 | Python | 4,411 | 123 | import torch
import scipy
import numpy as np
import pandas as pd
from typing import ClassVar
from torch.utils.data import Dataset
from .utils import BHI_Seq2Tensor
"""
230407 BHISeqDatasetProb edited
- use_single_channel, use_reverse_channel, use_multisubstate_channel => False
- Target standardization
"""
class ... |
02e7a85874dbdb22fdb2a8496748c3b6f87c1230a7ea5a07f7735a8412d86342 | Python | 4,412 | 142 | """Plot decoding times."""
from __future__ import annotations
import csv
from enum import Enum
from pathlib import Path
import numpy as np
import pandas as pd
import pte_decode
import scipy.stats
import motor_intention.plotting_settings
import motor_intention.project_constants as constants
import motor_intention.sta... |
f9b9cb3bc0bb48b7c8386de297ffbbf29546498baaba3a3683be75edbd5a449c | Python | 4,413 | 100 | import os
import mne
from scipy.signal import hilbert
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import sem
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
from matplotlib.ticker import StrMethodFormatter
plt.gca().yaxis.set_major_formatter(StrMethodFormatter('{... |
25f1512b3e7009a106fb8159b56c84027c019d8e2d080fd225f0aa553acceea5 | Python | 4,414 | 108 | from ..region_1020 import (FRONTAL_REGION_LIST, GENERAL_REGION_LIST,
HEMISPHERE_REGION_LIST)
from ..standard_1005 import STANDARD_1005_CHANNEL_LOCATION_DICT
from ..utils import (format_adj_matrix_from_adj_list,
format_adj_matrix_from_standard,
format_... |
4d08c048fa9d0a3a2f63426141bd5ba34e355d01b7db2f8f80f451b6d1ad8f48 | Python | 4,414 | 108 | from ..region_1020 import (FRONTAL_REGION_LIST, GENERAL_REGION_LIST,
HEMISPHERE_REGION_LIST)
from ..standard_1005 import STANDARD_1005_CHANNEL_LOCATION_DICT
from ..utils import (format_adj_matrix_from_adj_list,
format_adj_matrix_from_standard,
format_... |
99211bdec48ce8f57ca1283e4ea904cec6ba9203d1894878878786dcb70bf107 | Python | 4,416 | 127 | import os, json, time
from tqdm import tqdm
from collections import defaultdict
from rdkit import Chem
PATT = {
'HETEROATOM': '[!#6]',
'DOUBLE_TRIPLE_BOND': '*=,#*',
'ACETAL': '[CX4]([O,N,S])[O,N,S]'
}
PATT = {k: Chem.MolFromSmarts(v) for k, v in PATT.items()}
def get_fg_set(mol):
"""
... |
8c72317c17919708c93770261385c9909dfc7fea3a78ce1d53efb083b1c4b712 | Python | 4,417 | 118 | # 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... |
9009cd6071cce579299443f492b54ac7874ecb0c804ac9b4b8bd6fb1ab401850 | Python | 4,417 | 133 | import torch.nn as nn
def create_encoder(channels):
# Create convolutional encoder.
in_channels = channels[0]
encoder_modules = []
for out_channels in channels[1:]:
encoder_modules.extend([
nn.Conv2d(
in_channels, out_channels,
kernel_size=4, stride=2... |
06ffee483fa6aa747f3d2fa90b3aea79592b411e2435e2043043b1acba5874dd | Python | 4,418 | 136 | extensions = dict(
extensions = dict(
validate_params="""
# Required maps for different names params, including deprecated params
.gbm.map <- c("x" = "ignored_columns",
"y" = "response_column")
"""
),
set_required_params="""
parms$training_frame <- training_frame
args <- .verify_dataxy... |
a8c96d47a9ce82375d14cded0fd821dedef78f2d3093245b9f8ae6c7e44cfd44 | Python | 4,419 | 156 | """
Small auxiliar function to load the data
so that for all the figures and tables values
it is consistent
"""
import pandas as pd
import numpy as np
from functools import reduce
def return_asterisks_p(pval):
"""
For a given pvalue, return a string with a number of asterisks according to:
ns: p <= 1.00... |
f03cef8a78746835d5a3ef146905ec41ca29d7de6099aa9243c7fb4d2c75f8d9 | Python | 4,419 | 135 | import pandas as pd
import requests
import io
import random
import os
from dotenv import load_dotenv
from PIL import Image
def download_image(url):
response = requests.get(url)
return response.content
def save_image(content, file_name):
with open(file_name, 'wb') as f:
f.write(content)
def pad_i... |
aa0e94adc4502e9fffe02c5d557de1dd19e57dc6d310fcf04d9851940d7d3457 | Python | 4,420 | 103 | import os
import sys
import argparse
import json
import numpy as np
import pandas as pd
import torch
import random
from constants import *
from src.models.tdrg import get_model
from src.dataloaders.tdrg_dataloader import get_dataloader
from src.training.tdrg_trainer import Trainer
from src.training.train_utils import ... |
a08a57869edb60ebe61003f733fd1c241b3a92dc40964e1565e271fc4a0da71d | Python | 4,422 | 99 | # 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... |
2e093bdea03b50a662eab1bb510a614a3818e1f9ae7813a7adf9e10c1cb2bc94 | Python | 4,423 | 171 | #!/usr/bin/env python3
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from nltools.data import Brain_Data, Adjacency
from nltools.mask import expand_mask, roi_to_brain
from nilearn import plotting as nplot
from sklearn.metrics import pairwise_distances
# -----------------------------... |
b50eedc409bd123ab31c74eee2818b1307c343adc7f50fbf59d75a2c09219ddb | Python | 4,423 | 99 | import os
import numpy as np
import mne_bids
BIDS_ROOT = "numbers_BIDS"
PLOT_DIR = "."
EXTENSIONS = ["tiff", "png"]
SUBJECTS = [
f.replace("sub-", "")
for f in os.listdir(BIDS_ROOT)
if "sub-" in f
and mne_bids.BIDSPath(
subject=f.replace("sub-", ""), task="numbers", suffix="ieeg", root=BIDS_ROO... |
3b2295dbcc88e2f6503e252a31781d93d96d2a6eb11facc042903ea2693935c8 | Python | 4,424 | 95 | import threading
import queue
import numpy as np
import pandas as pd
import control.utils as utils
def default_image_preprocessor(image, callable_list):
"""
:param image: ndarray representing an image
:param callable_list: List of dictionaries in the form {'func': callable,
'args': list of positional a... |
110e9b7317f74d51a1c859bb672ff9e9ca7016a389b7abf0491228fb528c0d59 | Python | 4,425 | 135 | '''DLA in PyTorch.
Reference:
Deep Layer Aggregation. https://arxiv.org/abs/1707.06484
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicBlock(nn.Module):
expansion = 1
def __init__(self, in_planes, planes, stride=1):
super(BasicBlock, self).__init__()
sel... |
809b085c865e4a8deeacecb14548ece95ae15f9099ac0d0dc4843e7718429f0a | Python | 4,425 | 132 | from types import TracebackType
from typing import Optional, Type
from .console import Console, RenderableType
from .jupyter import JupyterMixin
from .live import Live
from .spinner import Spinner
from .style import StyleType
class Status(JupyterMixin):
"""Displays a status indicator with a 'spinner' animation.
... |
85caf441fc8b801f379a0516c175d87ce83c3a430c5b00520055b857b490f070 | Python | 4,425 | 78 | import os.path as path
import numpy as np
from eworm.utils import *
from eworm.network import *
from eworm.network.process import *
import pickle
import time
if __name__ == "__main__":
np.random.seed(42)
config_dir = path.join(path.dirname(__file__), "config.json")
config = func.load_json(config_dir)
i... |
763dc0fd8aec434ac92c9e965c8ce2a5f37464f8ae479f511dd08bc7d8c4b797 | Python | 4,426 | 137 | # Manuel A. Morales (mmoraleq@bidmc.harvard.edu)
# Beth Israel Deaconess Medical Center
# Harvard Medical School
import os
import glob
from typing import Tuple
import torch
import torch.utils.data as data
import torchvision.transforms
from torch import Tensor
from Config import *
import numpy as np
import pandas as ... |
b28526efc43b0f869818ee7ff23e9995d62755b36939bdf55874fa735cc708dc | Python | 4,426 | 82 | ##Exp_loc_of_predicted_DTP
df = pd.read_csv('Exp_varified_organelle.csv') ##list of experimentally varified proteins for each speices
# Initialize an empty dictionary to store the results
gene_dict = {}
# Iterate over each column and row to populate the dictionary
for column in df.columns:
species, organelle = c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.