sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
2a81b7617afa6a49995990662bfcbfcc4d4e7d7dd12a8771242d4d82f1aeb415
Python
3,971
122
import torch from .manifold import Manifold from diff_frech_mean.frechetmean.utils import EPS, cosh, sinh, tanh, arcosh, arsinh, artanh, sinhdiv, divsinh class Poincare(Manifold): def __init__(self, K=-1.0, edge_eps=1e-3): # print(K,'K') # print(self) # print(Manifold) # sadsd ...
a0cb4bf5f8f500e4cb22bd1bf3e57361eb4bf76e2a8d6d58e0139e2a42d9b646
Python
3,971
131
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Fig4c usage: python Fig4c_soma_viz.py --p /Users/jiangshengdian/Desktop/Daily/PhD_project/Platform/fullmorpho/py/soma_marker_in_vtk/soma_0_vs_1.marker ''' import pandas as pd import numpy as np import os import math import argparse import vtk import vtkmodules.vtkInte...
ec68c8971217e12b64cf9f8d0d912cbded162e6396b9b42648ab026d1b5f72cb
Python
3,971
123
"""Linear model fitting utilities. Port of fitLinearPRModel.m and PhotoreceptorModelLinWrapper.m """ from dataclasses import dataclass, field import numpy as np from scipy.optimize import minimize from scipy.signal import lfilter from scipy.signal.windows import gaussian from .biophys_model import BiophysModel from...
5da3cc04ab9d4225a0105220f78100c1f18a9e9f94e589270caa7fbcc23d47f8
Python
3,972
104
# -*- coding: utf-8 -*- """Basic functions for dataset loaders""" def sparse_batch(batch_size, drop_remainder=False, num_parallel_calls=8, atomic_props=['f_data', 'q_data', 'f_weights', 'oxidation']): """This returns a dataset operation that transforms single samples into sparse batched sampl...
b25985361bf1921209de02fdd393cca95b8614ae538a8976f431256a4c636961
Python
3,972
142
# 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...
44a33ad3d48bdd96b9de13cda9b2138992faae60f9ac5d10e7ae04c03a780048
Python
3,973
132
import random from pathlib import Path import cocotb import pytest from cocotb.clock import Clock from cocotb.triggers import RisingEdge import elasticai.creator_plugins.bram as dut from elasticai.creator.arithmetic import int_arithmetic from elasticai.creator.testing import CocotbTestFixture, eai_testbench from elas...
a4e2484f642db6956a912fa0ef2c02f99ecb439e0e07e93c0735f88bdef3f215
Python
3,973
117
""" Optuna example that demonstrates a pruner for Keras. In this example, we optimize the validation accuracy of hand-written digit recognition using Keras and MNIST, where the architecture of the neural network and the learning rate of optimizer is optimized. Throughout the training of neural networks, a pruner obser...
048ba1bce6ed719691bccdce4cd16e661c17ef6fa4a105519987393d4fcdf344
Python
3,974
160
""" Misc. utility methods """ import argparse import hashlib import inspect import os import numpy as np import bifrost SYNTHMORPH_SHAPE = (160, 160, 192) def update_image_array(image, updated): """Update ANTs.Image image array but preserve metadata Args: image - ants.ANTsImage updated: array...
28570e345711c4287b66916b9d0f03eeb8991e9bc94ce343f11dd0a9c98a896f
Python
3,974
114
import numpy as np from .pr2_utils import DRAKE_PR2_URDF, set_group_conf, REST_LEFT_ARM, rightarm_from_leftarm from .utils import HideOutput, load_model, base_values_from_pose, has_joint, set_joint_position, \ joint_from_name, get_box_geometry, create_shape, Pose, Point, STATIC_MASS, NULL_ID, CLIENT, set_pose, \ ...
2d8f3259478b4503e8e9005e9042adbd7ba84dece0f91e0260120c177f868547
Python
3,974
107
# 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...
46142c37987b9d47494645c62a8047c29c2df37cd7e661a76626665db87d3380
Python
3,974
118
# # 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,...
88fddf3c78678953c91caece53f095edabfe47ff18b217ec9a31a245b2830931
Python
3,976
142
"""Radiation pattern of a dipole in vacuum using Brillouin-zone integration.""" import argparse from enum import Enum from typing import Tuple import math import matplotlib.pyplot as plt import meep as mp import numpy as np RESOLUTION_UM = 50 WAVELENGTH_UM = 1.0 NUM_POLAR = 30 NUM_AZIMUTH = 50 FIELD_DECAY_THRESHOLD...
2cf5394014ced5b7dae517c6c605c229d87986d8b475ee8e103a6d401332a164
Python
3,977
106
import torch import time import h5py from collections import OrderedDict from network import ddnn_run import net_parameters, net_setup from network import config_params from torchvision import transforms from utils.loaders import save_object import matplotlib.pyplot as plt from utils.complex_utils import comp...
d3af39185e84eab7e3498d9021c184e26b15d3f08006d4b7703db608df5b89ec
Python
3,977
113
# # Copyright (C) from 2009 to Present EPAM Systems. # # This file is part of Indigo toolkit. # # 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 # ...
3837937246e3a2d4067c4bf7098e835c759ce066aa1f8c37920f8c9c1433d0bd
Python
3,978
127
# Node-group asset "Find Bonds" (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 fr...
1561c2dbec2faf4646d90daa4990beb57c124f83cc4c3f46db3ee7c100862bdf
Python
3,979
99
# QM40data_search.py # Created by Ayesh Madushanka # Created on: June 4, 2024 import os import pandas as pd from rdkit import Chem # help function generation def help_func(): print("Welcome to the QM40 dataset data seraching modular!!!!") print("QM40 dataset includes a main dataset which has 163K molecules...
7bbdc3ba47535b1fadf83cb6b48fcbf51aaf71a2780a6f5cd0f7cd6eaf735c92
Python
3,979
107
# Node-group asset "Boolean Last" (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 ...
4117e20929fd7e38047603981cab7c834f2ea17eadd15b09bdd326eef92cac6c
Python
3,980
132
# %% Package Imports import sys, os sys.path.append(os.path.abspath("..")) sys.path.append(os.path.abspath(".")) import torch import torch.nn as nn import torch.optim as optim import prosper_nn.models.hcnn from prosper_nn.utils import sensitivity_analysis from prosper_nn.utils import visualize_forecasts import prosp...
790a0406d678c8d86f7e2119f2d6bae505f0fd588518dd0cedda6b3b1c9e74b1
Python
3,980
130
from collections.abc import Callable, Iterable from dataclasses import dataclass from types import FunctionType from typing import Any, Protocol, override import pytest import elasticai.creator.function_dispatch as FD import elasticai.creator.plugin as pl from elasticai.creator.plugin import PluginLoaderBase @datac...
eb5972efac06375bf861353bb38f8c01a0f7206dfaff9e4e85c52aad41fffdf4
Python
3,980
96
#!/usr/bin/env python # Purpose: Create a .csv file of Nx17 dice coefficients to assess similarity between MSHBM parcs # Input: ind_parcellation output from Kong2019 pipeline # Output: 1 Nx17 .csv file with dice coefficients # # Note: Users may need to run 'which python' and paste the correct path following the shebang...
2dee67cccf80f57b491388af6701b24388057d5e0ecc552db7fa61d5dc3f2a3e
Python
3,981
131
""" Script for computing the RDF of a Graph Input: - A pickle file with GraphMCF - RDF parameters Output: - New properties to are added to the Graph - Fgiures with the RDF """ __author__ = 'Antonio Martinez-Sanchez' # ################ Package import import gc import os import...
41819941e192f379d399b5f9eb4d0daa90073a520009cf992007709e290df502
Python
3,981
138
import pytest import tensorflow as tf import numpy as np import numpy.testing as npt import random from pinn.networks.pinet2 import DotLayer, ScaleLayer, PIXLayer from utils import rotate class TestPiNet2: @pytest.mark.forked def test_pixlayer_rank2(self): n_atoms = 10 n_dims = 3 n_c...
4308986a3c0a1d0610a0d7c77127405d4d4026e6923a8b45e58a987b48a7794b
Python
3,981
128
# Node-group asset "Transparent Outline Internal" (ShaderNodeTree), 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 ...
fa7b370ed9050a62cb9fdea99d80b21ad11e5ad50d21ec9240c6ff77619808a3
Python
3,982
122
""" Benchmarks for loading structures and evaluating the node groups that style them. Run locally with `uv run pytest benchmarks --codspeed`, which reports wall-clock times. In CI they run under CodSpeed's CPU simulation, which tracks results over time and reports changes on pull requests. """ import itertools from p...
602699148bcf6fb641f589c601844307bc318a3a81bef29ff0b5a7745d32527a
Python
3,983
61
import argparse import sys import subprocess import os from nilearn import image as img import pandas as pd import glob # Main function if __name__ == '__main__': usage = """post_fmriprep.py <path_to_BOLD.nii.gz> <path_to_confound.tsv> <list_of_confounds_to_regress> e.g. post_fmriprep.py /m/nbe/scratch/braindata/e...
7c4040c2cd49c5716d4b6c81a7fdb237ada5cdfe4e802104c4be3a865d9ff84f
Python
3,983
153
""" Original Author: Samuel Blau Modifier: Anup Kumar Module for adding calculations to a FireWorks LaunchPad. Includes functions to add transition state and IRC (Intrinsic Reaction Coordinate) calculations to a LaunchPad for QChem using the FireWorks workflow management tool. """ import toml import glob import jo...
537c3df896f6b9d32e314ec8f82440000b45b4bae9f5aded310463a90c141f87
Python
3,985
139
# 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...
d9fae072171ef861391a1f528c4255f8c4dca71cb71bdf84b3c9a97baea71edb
Python
3,986
121
import sys import textwrap from optparse import Values from typing import List from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import SUCCESS from pip._internal.utils.misc import get_prog BASE_COMPLETION = """ # pip {shell} completion start{script}# pip {shell} completion end ""...
0941688e2769e364f00b00782ad09b6fae8e65609d26b460cf33f2563cd82c15
Python
3,988
80
### algorithm predicted v. homology inferred - to get protein IDs and orthogroup IDs and compare them #orthology based organelle protein families and species trees retrived from 10.1371/journal.pbio.3002608 import pandas as pd ###COMPARE TARGETP with OGs and PLOT at the same time- comparision takes time, so ...
6e78e97ffc917186b507b4876bf0ece6135eafbaec152f28644e0bd751ea72bf
Python
3,988
127
# 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...
9af07442888e825d3a48bd0870d686178b8b246d8d1a3f112a3bf26df694977d
Python
3,988
128
# # 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,...
a7a630c48b48ce2e6fe2093593131027c149a1ca7cfb1c082c6fb236192b2a55
Python
3,988
116
""" oxasl.gui.dist_corr_tab.py Copyright (c) 2008 University of Nottingham """ import wx from oxasl.gui.widgets import TabPage class AslDistCorr(TabPage): """ Tab page containing options for distortion correction """ FIELDMAP = 0 CALIB_IMAGE = 1 def __init__(self, parent, idx, n): T...
ca52b9390c81969ac98f907881b793f8bdbcc2d6d9dcac78b0ac26946fcf28f9
Python
3,988
116
# 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...
ec997fbc6eb1935ab63992da9d1465d10bf19eb16068aa84632e95883f5970b8
Python
3,988
121
# Node-group asset "Break Bonds" (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 f...
024fd2332212ea399faf5ba1565fe8f2f01ea3baf5865dfbca1610cbcf7be11f
Python
3,989
150
import numpy as np import random import pickle import warnings warnings.filterwarnings('ignore') import numpy as np from torch.utils.data import Dataset class S2R_Dataset_train(Dataset): def __init__(self, mode, args): super().__init__() self.args = args self.mode = mode self....
e24fda2f3c9cacb683b2b659a4a9f85fdbbef037366a877b59ed231432cd5943
Python
3,989
108
"""Physical-unit measurements and summary rollups for cellpose detections. Pure functions — no cellpose, no Qt. The only I/O is reading a TIFF's resolution tags. Unit-testable without a GPU or the cellpose model. """ from __future__ import annotations import pandas as pd __all__ = ["resolve_pixel_size_u...
1163efd9a2a18c1231a8068a1f3c4e58039e7978cd6dd426c779efde540a406d
Python
3,991
101
# 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...
336733e5874dfb5ccf84611f02d5ba7dda939d9acd87fb08faf97cb710482087
Python
3,992
119
"""GUI wiring for the "Affine method" dropdown -> --affine_method. Two layers, mirroring test_reg_effort_cli_args.py (pure) and test_parameters_tab_ants_overrides.py (Qt introspection + live widget). """ import inspect import os import sys PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file_...
bd54582b8c7f50537561de55c42be1b9793c4f9e775a285bda08cb211720fc0e
Python
3,992
112
import os import glob import numpy as np import pandas as pd from sklearn.utils import class_weight from tensorflow.keras.utils import plot_model as tf_plot from sklearn.model_selection import GroupShuffleSplit def get_files(base_dir, resolution): ext = ['jpg', 'jpeg'] ret_files = [] for f in glob.glob(f'...
ed5b049af4a4d7e9b0149c7cf04c8b32659a3530c0e19ef91929ee930a66efe0
Python
3,992
94
"""Batch 2D reuses the single-run tab's advanced registration options through one shared mapping (ParametersTab.registration_opts_dict), snapshotted into the batch config so a saved batch is self-contained and can't drift from a single run. row_to_opts + BatchConfig are pure (no Qt); the ParametersTab mapping is c...
fcc8bc6c920a8c31235f43fc169983f0ad762a7ce76a1cb8ace2c4f2a0e89152
Python
3,992
170
import pytest from sleeplab_format.models import * from sleeplab_format import writer @pytest.fixture(scope='session') def subject_ids(): return ['10001', '10002', '10003'] def subject_metadata(sid): return { 'subject_id': sid, 'recording_start_ts': '2018-01-01T23:10:04', 'age': 24....
6d3cf5ae37d9bea016ccbb7b0890889f8b088984f4464c722074b54af209a248
Python
3,993
120
# ---------------------------------------------------------------------- # 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/...
c7d229e2489c3e971e929fea50059144e12767487dac52f0bc08b9777dc45d3e
Python
3,993
108
""" t-SNE: Plots We observe a tendency towards clearer shapes as the preplexity value increases. The size, the distance and the shape of clusters may vary upon initialization, perplexity values and does not always convey a meaning. For further details, "How to Use t-SNE Effectively" http://distill.pub/2016/misread-t...
e3ecd9aed3c61e3a42e6739c23b21314d9890710733ccdbb3ee2db8e4d9f7db2
Python
3,993
106
"""Configure the logging of pyprep.""" # Authors: The PyPREP developers # SPDX-License-Identifier: MIT import logging import sys LOGGER_NAME = "pyprep" DEFAULT_FORMAT = "%(asctime)s [%(levelname)s] %(name)s: %(message)s" class _StreamHandler(logging.StreamHandler): """Marker subclass identifying the handler th...
47c71d19ae2568f19361dcec4bd827f9ff5bc070e63ef491dd2ececff755fac5
Python
3,994
130
import os import toml import glob import shutil import logging from ase.io import read from ase.atoms import Atoms from quacc import get_settings from quacc import strip_decorator from typing import List, Dict, Any from quacc.recipes.newtonnet.ts import ts_job, irc_job, neb_job def neb_ts_hess_irc_newtonnet( ...
f4e153e228b356e38b2ff51e2e4779778e03763f6e8d8e52f5ff15d7dfc0d88a
Python
3,994
96
"""Evaluate the end-to-end pipeline on a split and print the paper's metrics. python -m src.evaluate --data-dir data --split splits/split.json --subset test \ --seg-weights weights/mnuv3_seg_train_no_test_no.pth \ --cls-weights weights/classifier.pth --arch mnuv3 Reports accuracy, sensitivity, spe...
ec5c676485320ddb77ab8f39aad89dce01cbc81c0b8f40e336f1a4559d85614d
Python
3,995
94
# 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...
53f2871218e1c00ae165beb48a4abe2ed08408c62361662f4f546a2f43f9e4fa
Python
3,996
107
import os.path import re from collections import defaultdict from ckg.graphdb_builder import mapping as mp, builder_utils ######################### # Reactome database # ######################### def parser(databases_directory, download=True): config = builder_utils.get_config(config_name="reactomeConfig.yml",...
7e5ee484da7e7886f7e048f0b854dee3ffa5eaa5caa4cfd4dd41e4ca165c3f62
Python
3,996
107
# 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...
b3bb6d384e1e6fbeb4e7752b7b4074ecfb9db273564f13a13a0eda6527b274a2
Python
3,996
146
import os import json import csv import numpy as np from tqdm import tqdm import argparse import torch from torch.utils.data import DataLoader, SequentialSampler import transformers from transformers import ( DNAKmerConfig, DNASubConfig, LongformerForSequenceClassification, LongformerModel, BertFo...
657e12a5b001b832eb58a3598e04efc7e491b30c46faaf7d5f007ca1ea698fda
Python
3,997
111
import sys import os # Get the current script directory current_script_directory = os.path.dirname(os.path.realpath(__file__)) # Get the root directory of your repository root_directory = os.path.abspath(os.path.join(current_script_directory, os.pardir, os.pardir)) # Add the root directory to sys.path sys.path.appen...
0a4bd3d81fc327e7ab3844aeb97d6703c4a145be342a585669ffd43e977dccb9
Python
3,998
96
import os import numpy as np from yacs.config import CfgNode from .interpolate import getAllIdx from skimage.transform import warp from tiffile import imread, imwrite from scipy.interpolate import RBFInterpolator def rbf_interpolate(source: np.ndarray, target: np.ndarray, cspace: np.ndarray, indices: list, dim: int): ...
ba7b049e8229d115888f8c404113e46b6eef74054b3178dd309897fd9448be28
Python
3,999
134
"""Plot community detection performance on empirical networks as box/strip plots.""" import sys import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import color_palette as cp # --- I/O configuration --- if "snakemake" in sys.modules: result_file = snakemake.input["input_file"] output_fi...
5ba7b692b05fb0ec98a5c939a20b3bf3219f9510dc2286d371bc65d0935f55d4
Python
4,000
80
import os import sys sys.path.append(os.path.dirname(os.path.dirname(__file__))) import util import time import torch import pprint from torchdrug.utils import comm from torchdrug import core, models, tasks, datasets, utils from siamdiff import dataset, model, task, transform # new added import for performing CG-scal...
95caf484d2ce5097fdc0f4b3be1652eb0788a7bca01d0f19d3f998e3a062727b
Python
4,002
113
import tensorflow as tf import keras from keras import layers from keras import ops import keras_nlp image_size = 2000 # We'll resize input images to this size patch_size = 20 # Size of the patches to be extract from the input images 10, 20 num_patches = (image_size // patch_size) projection_dim =128 num_heads = 12 ...
abc277660731522c3761f5d204d54b9fd77f42e82b4604648de667da6ed6077f
Python
4,002
116
# Node-group asset "Attribute Run" (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...
d5d0cb4811b7813df4cb51f027846f96e0bb6093f681bc07c72a0095553a0b59
Python
4,003
124
# Node-group asset "Outline" (CompositorNodeTree), 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 fro...
0a74621b72d9325b9c714903bc94691a39e0f8d7ea152227eaabcf7887f7c446
Python
4,004
117
#!/usr/bin/env python # # Copyright 2008, 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...
c14bac9573ce6a431f0b46bcf51a681949ce38d39e88ec3e44a1d364c7509771
Python
4,004
116
#!/usr/bin/env python3 """ Bonito training. """ import os from argparse import ArgumentParser from argparse import ArgumentDefaultsHelpFormatter from pathlib import Path from importlib import import_module from bonito.data import load_numpy, load_script from bonito.util import __models__, default_config, default_dat...
efdf120ed4a20e4236d1ef60fbad7fc0fbff413f3cacb4ebce5557864bfa03ef
Python
4,004
146
# 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...
239d41fbbfff46cce06dde5432cfa110d287153aa0ca0038cbd4a16bc2618eb1
Python
4,005
139
"""Configure Sphinx.""" # Authors: The PyPREP developers # SPDX-License-Identifier: MIT import sys from datetime import datetime from pathlib import Path from intersphinx_registry import get_intersphinx_mapping from sphinx.config import is_serializable import pyprep # If extensions (or modules to document with aut...
2a1a38f17eb9c44d2c705ca521d7898ccd9b71bbd1befd21d1651b316ac90f70
Python
4,006
102
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
5efbf9fc4a1f22c7ff667d5605696a857b96846fa0349c117479e7b7f1a5d3c5
Python
4,006
110
import matplotlib.pyplot as plt from Functions.f_AnalysisStatistics import * from Functions.f_AnalysisFunctions import * from Functions.f_SignalProcFuncLibs import * from Functions.f_AnalysisGraphs import * import os import pandas as pd import scipy.io import numpy as np import scipy as sci import matplotli...
e096c6f7e8d596342ce467105694e2af457f46533455249e2f8ab2c9f2d657f8
Python
4,006
105
""" Keeps track of the model configurations """ from sitetack.app.enums import PtmKind, OrganismKind, LabelKind from sitetack.app.alphabet import Alphabet from pathlib import Path import importlib.util import pandas class Model: """ Given a set of PTM, organism and label, this class represents a model """ d...
6aa42e7cccd1c38e99a45973998698793dbe9f398a6fe86672b029a6927ceb69
Python
4,007
105
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
68446400d797d31dc67b7b1f0b81ac044d24f62486d22f92170443fb037f20e3
Python
4,008
94
import json import matplotlib.pyplot as plt import numpy as np import os import pandas as pd from src.analyze.utils import init_mpl from src.analyze.performance_measures import PerformanceMeasures from constants import N_ITEMS _FIG_SIZE = (18, 6) colors = init_mpl() def make_plot(results_dir1, results_dir2=None, l...
45031bec5763e678825a2b8a3b8ed891369e55aba8e8c41ae03ccb2b2500d00f
Python
4,009
94
import pandas as pd import pickle import numpy as np import copy import glob import argparse def used_classifier(CLF_HCSO,CLF_CHT,DF): Index_RF = ['S_smooth_5 max','S_smooth_5 min','S_deriv_smooth_5 max','S_deriv_smooth_5 min','eig_smooth_5 max', 'eig_smooth_5 min','eig_deriv_smooth_5 max','eig_deriv_smooth_5 mi...
84291562e3c1813b2a3c6d0bfe9b8ddc6b1bd49123ec120cb680101a9138fe69
Python
4,009
105
#!/usr/bin/env python import sys import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from pathlib import Path from PIL import Image import shap from tensorflow.keras import models, backend as K from tensorflow.keras.preprocessing import image import argparse # Set log level for 'numba' impo...
a4efcb625dc4d208330d5f2ae8db68778170929cbd40b96c96013ab696cc78c5
Python
4,009
135
from contextlib import ExitStack from pathlib import Path 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 = "e...
f92cccddcbe69381cc182e6aee718974e104468b417e87f5514f0f164900249d
Python
4,009
106
#!/usr/bin/env python """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 your option) any later vers...
77efb9d36829a040784b05acddffb802f8b049733cbf53a4a3debedffc287f51
Python
4,010
152
# 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...
95dd3d0e3f15b467a4de7e778a7b5e4a16ed2bf195c32ee2b798560611736fac
Python
4,011
125
# 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...
14047334f0e273e81c1b9147d07bfc8b911944fc705125b4198fac872363a06a
Python
4,015
122
# Node-group asset "Separate Atoms" (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_CHECKIN...
26ccb6fd1543302be99eed6326f008fb489d15d998bdae078235f905d6000938
Python
4,015
65
### Anikets bottom view dataset # commands derived from cmd =['/groups/branson/home/kabram//bransonlab/apt_cache_2/aniket_bottom/combinedSideViewMA/20250808T015629_20250808T015637.json', '-name', '20250808T015629', '-train_name','gaussian_noise','-json_trn_file', '/groups/branson/home/kabram/bransonlab/apt_cache_2/ani...
2ebbf2454922b26123bf29eeaa4d92a166768bb090e9513ed3b11ae32c99fe9f
Python
4,015
109
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright (C) 2020 Computational Neuroscience Group, NMBU. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at yo...
dcfbdc2df65a8518d0bad4810ea52c091bb9e3154fb2ba252b729798561c2917
Python
4,015
98
"""Routing tests for antsRegistration's affine_method split. antsRegistration calls the two-stage split via the *module* attribute (``two_stage.run_ants_intensity_split``), not a name imported into ants.py's own namespace, so both tests monkeypatch ``two_stage.run_ants_intensity_split`` directly on the ``two_stag...
dbe7ffee99cc27283576f1fa750f7b4dd33f9037ab583734273ab92450c940db
Python
4,017
131
# 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...
8e133ce001672102e92bdf5300f6580ed5f25e1763a33ad9b880dfa1da714401
Python
4,019
120
# # 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,...
9ca513afbf307ad05c5d0957db2f8d9c115a0efbeee98f96a4d8132b39d1af38
Python
4,019
124
try: from Tkinter import Tk, Canvas, Toplevel, LAST except ModuleNotFoundError: from tkinter import Tk, Canvas, Toplevel, LAST import numpy as np class PRMViewer(object): def __init__(self, width=500, height=500, title='PRM', background='tan'): tk = Tk() tk.withdraw() top = Toplev...
ae36f48aaa3ffca3b13c315a65d442011cba084318f365b011ec4385fb36b819
Python
4,019
160
# utils.py import logging import gzip import bz2 import subprocess from pathlib import Path def open_by_suffix(file_name, mode='r'): """Opens file based on suffix.""" # noqa modified from https://stackoverflow.com/questions/18367511/how-do-i-automatically-handle-decompression-when-reading-a-file-in-python ...
0231d9c2d8de88f4328952cbe8846cd0628f99d70f3046fbfd9bd4407b6a753f
Python
4,021
123
import math import torch def quaternion_to_matrix(quaternions): """ From https://pytorch3d.readthedocs.io/en/latest/_modules/pytorch3d/transforms/rotation_conversions.html Convert rotations given as quaternions to rotation matrices. Args: quaternions: quaternions with real part first, ...
342bd01fa9cbd2d32135698c7edf246e3e4f86c0c9cce9fcae79ba81aab272b3
Python
4,021
114
import numpy as np 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_p...
57dd3b19bf1923ed164f3f5dcfe389917b15500ccc2bce791ada28c6c47ffdbd
Python
4,021
92
""" 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 from deeplabcut.utils import auxiliaryfuncti...
8a9eee7a4b85cd40a4233b5ee3ff156d4a66c29cbd1b1dc775fee2a7f2460faf
Python
4,021
151
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt from matplotlib import colors from PIL import Image import os ### Animate Kuramoto model results### def remove_img(fp_in): """ Remove all .png files inside the fp_in list Use with caution. Param...
91033823f1235f348165d85c4814c5443e0babe8fb6798d91c9ac470add80d8c
Python
4,021
106
"""Assign nodes to communities via Voronoi (nearest-centroid) clustering in embedding space.""" import sys import numpy as np import pandas as pd from scipy import sparse if "snakemake" in sys.modules: emb_file = snakemake.input["emb_file"] com_file = snakemake.input["com_file"] output_file = snakemake.ou...
dba83181984e378113434e56e5bb3a38ae9aaddb6f6703695c9327daf6f2eb0f
Python
4,022
126
from collections.abc import Callable from itertools import chain from typing import ParamSpec import elasticai.creator.hdl_ir as ir from elasticai.creator.hdl_ir import IrFactory, Node, Shape from elasticai.creator.ir import Registry as _Registry from .filter_params import FilterParameters from .index_generators impo...
2607466479f4a2141fafc80b54947459c010bfe832c7abb13a7c8b4c4a9242f7
Python
4,023
82
import os import sys sys.path.append(os.path.dirname(os.path.dirname(__file__))) import util import time import torch import pprint from torchdrug.utils import comm from torchdrug import core, models, tasks, datasets, utils from siamdiff import dataset, model, task, transform # new added import for performing CG-sca...
8845f9271b011c3a37a79bec08fc0585c1a1fd080382967c59360c1a4ed9447b
Python
4,023
101
# Dataset Size: 46469 # Unique Labels: 195 # Dataset Shape: (46469, 89, 89) # Labels Shape: (46469,) import gdown import numpy as np import os np.random.seed(1234) def get_raw_dataset(): url = 'https://drive.google.com/uc?id=1-IqQIFQ8X2wM0KU1qyIYZOvur8C_KdVh' output = '../output/dataset.txt' gdown.downl...
ae881e7822a92cfdd46d089e310fab57539ccb354aef30fc07eea84686d169c2
Python
4,023
95
#!/usr/bin/env python # Copyright (c) 2018-2020 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ This module provides additional atomic evaluation criteria required to analyze if a scenario was completed successfully or failed...
5780cfd4b3fd1375d729a99b05503f5cdccf869a1387268598dccaedbf92ecb2
Python
4,025
103
"""SupCon / SimCLR loss function Adapted from HobbitLong/SupContrast. See THIRD_PARTY for third party license info. https://github.com/HobbitLong/SupContrast/blob/master/losses.py Author: Yonglong Tian (yonglong@mit.edu) Date: May 07, 2020 """ import torch import torch.nn as nn class SupConLoss(nn.Module): """...
5581f743da288cbbcf829dda8aedc96a2cad7ce29dc4c78d524ff95b5bd14c16
Python
4,026
91
# SPDX-FileCopyrightText: 2024 Blue Brain Project / EPFL # # SPDX-License-Identifier: AGPL-3.0-or-later ''' Compute neighborhood complexity of (E-E) MICrONS connectome and controls Note: This script generates some duplicated data. I have decided to keep it, because the files are small and potentially useful in case ...
a1ea45be3565b2e4e1773e598eaf207e57d65580a00fe8ece7ec206ffafc1e32
Python
4,026
112
import optuna import joblib from datetime import datetime import filenames import anomaly_detection_metrics import optimiser_config as oconf import optimiser_func as ofunc import main_config as conf import printer def objective_andeped(trial, algorithm, dataset, mode, test_id: str, omegas: list, modes_paths: list):...
cefd296fb0775bb2b8fdaa3c6dd383a26630b26e7d0606f4aa44668c21bb59ec
Python
4,027
90
import json import os import subprocess from dreamcoder.domains.arithmetic.arithmeticPrimitives import k1, k0, addition, subtraction, multiplication from dreamcoder.frontier import Frontier, FrontierEntry from dreamcoder.grammar import Grammar from dreamcoder.program import Program from dreamcoder.task import Task fro...
fedff5b3888a7c6ca5361a194d3a541aa6f41f67e0215ed0ca1a6f3b302fbba9
Python
4,027
112
import numpy as np from types import * from pyclamp.dsp.channel import chWaev from pyclamp.dsp.fpfunc import * from pyclamp.dsp.wffunc import * # An active channel modules class feature(deltaxy): # step and ramp provider def rety(self, _x = 0, _i = 0): if isnum(_x): _x = [_x] x = _x if type(_x) is np.ndarra...
2f6284a652ba444c74ccd19e5ea30e1a1cb4c2dd98a9bea796c9b2ab8cdf9bec
Python
4,030
89
from pddlstream.algorithms.downward import apply_action, get_conjunctive_parts from pddlstream.algorithms.instantiate_task import get_goal_instance from pddlstream.utils import MockSet from pddlstream.language.optimizer import UNSATISFIABLE import pddl import instantiate def reinstantiate_action(state, instance, neg...
6bc682a340a0718d1f3c61cf9d3dd710eeb7a764849d8273a32f18502c44fcaf
Python
4,030
132
""" Optuna example that optimizes multi-layer perceptrons using Tensorflow (Estimator API). In this example, we optimize the validation accuracy of hand-written digit recognition using Tensorflow and MNIST. We optimize the neural network architecture as well as the optimizer configuration. As it is too time consuming ...
76c3c56d269eb839fca63a095ae5c89a3d08033d2d433f6fe42b385693744d9e
Python
4,030
78
""" HEMIBRAIN_CONF_CONTROL.py - the control the conf test needs. Tightening the conf cut removes T-bars. Removing T-bars lowers n and n_eff, which RAISES the standard error and should make MORE neurons undetermined, not fewer. So the observed fall (7.83% -> 6.18% of synapses at conf>=0.95) is a NET figure fighting a...
35e4373908d6422e1fb62bacab72fbd30e354d0ef3abd72849bc5afbaae96051
Python
4,031
98
import torch import torch.nn.functional as F from typing import Dict, Callable from .utils import expand_to class Loss: atom_prop = ["forces", "spin_torques"] structure_prop = ["energy", "virial", "dipole", "polarizability"] def __init__(self, weight : Dict[str, float]={"energy": 1.0, ...
89a135940029bbad280ebe9940aec1f28fe6def3a13af44a90fc5698177d5f8e
Python
4,031
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...
96a049f47069afca7ea50c91dd7911a8f56120219a247d74c3859389943a7949
Python
4,031
100
from lib2to3.pgen2.token import AWAIT import os import shutil import numpy as np path = "/home/zhaomengdi/Project/eworm/Celegans_as_deep_net_net/chemotaxis_net/components/param/cell/" files= os.listdir(path) s = [] params_AWCL = np.array([380, 2, 3e-05, -75, 1.6e-03, 0.0002, 0.0001, 0.001...