sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
852100a9c5ab81afc47d3077214a7fec02875c7d7b3b013312a4a60467462835 | Python | 9,537 | 251 | #
# 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,... |
ba1872218cfcf9db88033415293018481dbe1cec327be2298b48d7eec41c8380 | Python | 9,538 | 232 | """
Pre-processing for mb2_graph_batch.py of two opposed membranes from TomoSegMemTV output
Input: - STAR file with 3 columns:
+ _rlnMicrographName: tomogram original
+ _rlnImageName: TomoSegMemTV density map output
+ _psSegImage: segmentation for the two membr... |
d7ef602d8998ca54169ad961134f8a33fee0150a75a44f8f3714d2bdcf3af89b | Python | 9,538 | 232 | import argparse
from loader import MoleculeDataset
from torch_geometric.data import DataLoader
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from tqdm import tqdm
import numpy as np
from model import GNN, GNN_graphpred
from sklearn.metrics import roc_auc_score
from ... |
dc67fca6f0bfff9d21396dc4a0c98362bf1b9761e35a1b3406511cfb4c93031f | Python | 9,538 | 262 |
"""
Created on Fri Jul 17 16:59:51 2020
@author: Leonardo Bonetti, Francesco Carlomagno
leonardo.bonetti@clin.au.dk
"""
#To use this script please do the following:
#-place the provided stimuli folders in your favorite directory
#-assign to the variable 'stimidr' (few lines below) such directory
#-define your log ... |
7dfc2dc825cf1de11a56516df073c5dae0672dcdb1f1da827f6ce20d00b3ddba | Python | 9,541 | 242 | # -*- coding: utf-8 -*-
from __future__ import print_function
""" Module for running planner portfolios.
Memory limits: We apply the same memory limit that is given to the
plan script to each planner call. Note that this setup does not work if
the sum of the memory usage of the Python process and the planner calls
i... |
caeb61d582a62a9fb1ecfb7a219a0984b51f1e298c940c1c671121254f5ddcca | Python | 9,541 | 274 | import numpy as np
import pandas as pd
from scipy.stats import pearsonr
from sklearn.metrics import roc_auc_score, f1_score, matthews_corrcoef, confusion_matrix, mean_absolute_error, mean_squared_error, median_absolute_error, max_error, r2_score, average_precision_score
from .molecular_featurisation import ecfp_invaria... |
11d3768ddf4187991b9e3ec006e69275f277cc7659bdcda4789a87b689baced8 | Python | 9,543 | 298 | """Schemas for storing thermo data."""
from __future__ import annotations
import logging
from pathlib import Path
from typing import TYPE_CHECKING
from ase.thermochemistry import HarmonicThermo, IdealGasThermo
from ase.units import invcm
from emmet.core.symmetry import PointGroupData
from pymatgen.io.ase import AseA... |
d3601acd20aab17da4c6534bb24184328acd49d5ef4dafc0dacd99546456dabf | Python | 9,543 | 234 | from optparse import OptionParser
import os
### help and usage ###
usage = "usage: %prog [options] args"
description = '''Function: calculate window nucleotide diversity'''
version = '%prog 09.05.2021'
parser = OptionParser(usage=usage,version=version, description = description)
parser.add_option("--in_snp",
... |
743c20ec48c59026678b8114bc97f8a6bef6c1aefbcf9ec67232f766915b9ea3 | Python | 9,548 | 274 | from __future__ import annotations
import numpy as np
import pandas as pd
import sklearn.linear_model._logistic
from sklearn.utils.validation import check_is_fitted
from typing import Iterable
from sklearn.exceptions import ConvergenceWarning
import warnings
warnings.simplefilter("ignore", category=ConvergenceWarning... |
c3b8e5d1e9eddddd35b0e1eb83942a6780383aa559ffc0e248b278a73fe0ca0c | Python | 9,548 | 261 | """
(*)~---------------------------------------------------------------------------
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.
------------------------------------... |
a41820ce39c78c2c8dce0479ca5652b9f18505a87979de9cb7a3baedf98045ba | Python | 9,549 | 193 | from neuron import h
import numpy as np
elements_name = ("minf_cca1", "hinf_cca1", "tm_cca1", "th_cca1", "m_cca1", "h_cca1",
"minf_egl2", "tm_egl2", "m_egl2",
"minf_egl19", "hinf_egl19", "tm_egl19", "th_egl19", "m_egl19", "h_egl19",
"mfinf_egl36", "mminf_egl36", "msi... |
6fe01a84efe09bea4001d7bcc09b332aad58eeca113c15747ce933e01bb62dc3 | Python | 9,550 | 265 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 26 11:55:28 2020
@author: hannekevandijk
"""
"""{
Import necesarry modules
}"""
import os
import sys
import pickle as pickle
import numpy as np
import seaborn as sns
import pandas as pd
from scipy.signal import find_peaks
import matplotlib.pyplot a... |
d3b8463bbff504e0a83112036861c5ad39f9cd552faef0db4828c99bc8c326f2 | Python | 9,550 | 266 | #
# 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,... |
55e2d27dfa0fba323d660b27d98330693e56f933f19dfb07d93154e4bfdf186c | Python | 9,552 | 302 |
# IMPORTS
import os
from argparse import ArgumentParser
import pytorch_lightning as pl
import torch
from pl_bolts import _HTTPS_AWS_HUB
from pl_bolts.models.autoencoders.components import (resnet18_decoder,
resnet18_encoder,
... |
44494985088f058d27dbb68773b08cd83506bccabc6348868be9a965e4565b75 | Python | 9,555 | 274 | import pytest
import torch
from torch.nn import Sequential
from torch.optim import SGD
from elasticai.creator_plugins.quantized_grads.base_modules import Linear
from elasticai.creator_plugins.quantized_grads.fixed_point import (
FixedPointConfigV2,
QuantizeForwHTEBackwHTE,
QuantizeParamToFixedPointHTE,
)
f... |
a93894c3493fb9df36c152242e4e9723319aca4fc4379eb0c1833896d19c58e5 | Python | 9,556 | 226 | # -*- coding: utf-8 -*-
# IMPORTS
# torch packages
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
from torchvision.models import resnet50, ResNet50_Weights, efficientn... |
6de0444f44d36c0d3fac5fab7680c657f436f00c65de2715ae2d0ed209ee9bd7 | Python | 9,559 | 266 | # 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... |
c38a4146e1f4e88ed459dff22499eafcdff6307a970d4876ee7d511dc087686a | Python | 9,559 | 224 |
import argparse
import numpy as np
import os
import networkx as nx
import torch
import ray
import smoothing_based_optimizer
import GNN_core
import time
parser = argparse.ArgumentParser(description="Simulate a Affinity training GNN with the appropriate hyperparameters.")
parser.add_argument('-d','--dataset', required... |
7da4d69f899f368706b34aa2fd76231043429a16336af2cb51b7ae82dbbbec55 | Python | 9,563 | 171 | """PHASE_MAP.py 2026-09-30. Pre-registration: 04-NOTES/PREREG-2026-09-30h-PHASE-MAP.md
Is the tipping line a property of the wiring or of one parameter? Excitatory share x gain on excitatory local-neuron
synapses (g) x receptor drive, on the antennal lobe cut out of Shiu et al.'s v783 file and of BANC.
usage: python... |
bed8c575b2163cff33f193f119590b5775c8301614c67cf7cc884cbcdf82b1db | Python | 9,566 | 299 | # 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... |
a71d6e9828c0cb019c2f864f2cb5fc721037c24db40c2179a589722b46383303 | Python | 9,567 | 287 | # 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... |
3f6e73d2d33965311c36e04df920f3da87c7402dcc9f05c2087edb589c755766 | Python | 9,569 | 296 | """
Extract FC values
"""
import numpy as np
import os
import click
import subprocess
import numpy as np
import datetime
import pandas as pd
import matplotlib.pyplot as plt
from joblib import Parallel, delayed
# from community import best_partition, modularity
from itertools import combinations, product
import networ... |
8e458803470044ecf2c706abf0a639d63eef18155c14399ba7a8ed50f53e66e9 | Python | 9,571 | 263 | import networkx as nx
import numpy as np
import torch, copy
from scipy.spatial.transform import Rotation as R
from torch_geometric.utils import to_networkx
from torch_geometric.data import Data
import math
import os
from Bio import PDB
class get_sidechain_torsion(object):
"""
Calculate side-chain torsion angl... |
b961db80e9a819d542f83f7908fdb218bdeda9c4b2123bd7467c3c61874bd068 | Python | 9,571 | 257 | from typing import Iterable
from unittest import TestCase
from codex.data.structured_search_filters import (
_make_predicate,
parse_search_query,
STRUCTURED_SEARCH_UNARY_OPERATORS,
STRUCTURED_SEARCH_NARY_OPERATORS,
STRUCTURED_SEARCH_BINARY_OPERATORS,
STRUCTURED_SEARCH_OPERATORS,
TYPE_BINARY... |
4a3d3a6e27eb273b9ce923896009b27d2231c2917dcb60678d599913374d2dd8 | Python | 9,572 | 273 | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 11 12:07:31 2024
@author: mpolonen
"""
from sklearn.model_selection import ParameterGrid
import numpy as np
import pathlib
from expyfun.io import read_hdf5, write_hdf5
import amp_models
import mne
from scipy.fftpack import fft, ifft
import scipy.signal as s... |
6d2777ae9df559a19df76a74e9e9c811b67460fc49b24d2c02691176779a20aa | Python | 9,573 | 312 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Input: DCE MRI (aligned), slice numbers or segmentations of cancer, or breast/exam-wide pathology for benigns
Output: Sagittal slices
Should work for both Sagittal and axial
Should use same pre-processing script as with inference.
Add option to include T2 or othe... |
e13b5b3c6a161b63d1808d75baab836bb79193c4dcc6f9d436eb8c19922d9d77 | Python | 9,573 | 255 | """Windows."""
from __future__ import annotations
import ctypes
import os
import sys
from functools import lru_cache
from typing import TYPE_CHECKING
from .api import PlatformDirsABC
if TYPE_CHECKING:
from collections.abc import Callable
class Windows(PlatformDirsABC):
"""
`MSDN on where to store app d... |
700214bddfea967c1b739616ee3c2125bc68c65fd7b2aceabaeeee34664a3986 | Python | 9,580 | 252 | """
Prosper_nn provides implementations for specialized time series forecasting
neural networks and related utility functions.
Copyright (C) 2022 Nico Beck, Julia Schemm, Henning Frechen, Jacob Fidorra,
Denni Schmidt, Sai Kiran Srivatsav Gollapalli
This file is part of Propser_nn.
Propser_nn is free software: yo... |
fd57229a983e75552f9cc01512253d5aaa015d9b92d8d819bbc08eb70bfa7b89 | Python | 9,580 | 247 | # 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... |
a770b5838418cdecc529d47b345f4484f6f3403bdd3d48464604b21861263e4a | Python | 9,584 | 232 | import re
from abc import ABC, abstractmethod
from typing import List, Union
from .text import Span, Text
def _combine_regex(*regexes: str) -> str:
"""Combine a number of regexes in to a single regex.
Returns:
str: New regex with all regexes ORed together.
"""
return "|".join(regexes)
clas... |
d40072ee19fe4c7f419f7b50d4b1d19cfc2c16fe5bc8e5f3750cdb529dcd5f8e | Python | 9,585 | 215 | import torch
from captum.attr import IntegratedGradients, KernelShap
import seaborn as sns
import matplotlib.pyplot as plt
import os
import numpy as np
def compute_attributes_from_a_dataloader(model, dataloader, transform, device, studied_class, method="Integrated_Gradients", n_steps=100, n_samples=10, baseline=N... |
7cb518903c042e06ded519b37d8e4a4523a5cff117e520cafe5d55a91ee09610 | Python | 9,586 | 248 | """
Generates ListTomoParticle objects from a previous one file (light particles version) and AP clustering
Input: - ListTomoParticle STAR file
- Particle vtkPolyData
- AP clustering settings
Output: - A ListTomoPaticles where previous particles have been substituted by culsters ... |
89d1cdf437eebfe2cf0e51ec72c2078de576265f3de0ec8f3e04e59d11c2ba62 | Python | 9,587 | 206 | """Preparing the Cam-CAN MEG data
[STEP 3-1] Source reconstruct preprocessed sensor space data (without sMRI files)
"""
# Install dependencies
import os
import glob
import numpy as np
from sys import argv
from osl import source_recon, utils
from dask.distributed import Client
# Set hyperparameters
if len(argv) != 2:
... |
b1830e1c4b48a68102f25cbc8b37c685385883a0d1dc72c1ec848e849867b54c | Python | 9,587 | 283 | """
Bonito Fast5 Utils
"""
import sys
from glob import glob
from pathlib import Path
from itertools import chain
from functools import partial
from multiprocessing import Pool
from collections import OrderedDict
from datetime import datetime, timedelta
import torch
import numpy as np
from tqdm import tqdm
from dateut... |
a41702d827e142f09749721590dfce6c37313dad60e8cd40682acd62ac25de6b | Python | 9,589 | 304 | # 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... |
a422defd78f63ec2ed02a600c5271d665e042d5afff657b82ab249315fb65452 | Python | 9,589 | 244 | import time
from collections import namedtuple
from unittest.mock import MagicMock
import pytest
import requests
import NDATools
from NDATools.upload.submission.api import SubmissionApi, CollectionApi, SubmissionPackageApi, PackagingStatus, UserApi
@pytest.fixture
def submission_api():
return SubmissionApi('htt... |
22b20c648f95f0b6da511706e076b61af93fa1b8c67c644e707a8141e67a8c53 | Python | 9,590 | 213 | from typing import Tuple, Union
import torch
import torch.nn as nn
import torch.nn.functional as F
from ...utils import LazyLoader as _LazyLoader
_pyg = _LazyLoader(
'torch_geometric',
install_hint='See https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html')
_scatter = _LazyLoader(
... |
d7ac92f58b378f8922d3b943cd9459688c5f5605f0a0335d562fcb5e0c60a9ea | Python | 9,593 | 272 | # 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... |
4d6daaf23f81fc6e119b6936c7bb83e756f3d1e1632eb1728581aa012fe2eb61 | Python | 9,597 | 263 | # Node-group asset "Animate Dihedrals" (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_CHEC... |
cea1acd5df85e6f585bed89b59823474dace56b2d1a9a4aad2c183c23a3aa9b3 | Python | 9,598 | 236 | import torch
from torch import nn
from elasticai.creator.nn.integer.design_creator_module import DesignCreatorModule
from elasticai.creator.nn.integer.math_operations import MathOperations
from elasticai.creator.nn.integer.quant_utils import (
AsymmetricSignedQParams,
GlobalMinMaxObserver,
SimQuant,
)
from... |
79c0b17c3199716dd598cdae392597ce7643dff9e1eff1291e865a3d1e50e778 | Python | 9,600 | 280 | #!/usr/bin/env python3
"""
Command-line script for extracting sidecar templates from BIDS datasets.
Logging Options:
- Default: WARNING level logs go to stderr (quiet unless there are issues)
- --verbose or --log-level INFO: Show informational messages about progress
- --log-level DEBUG: Show detailed debugging inform... |
d412f775f8eeeed838144fe61f16933d7fa1706e13f7d2cb01d9100b13366c07 | Python | 9,600 | 303 | # 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... |
40d134c975fd63f65273a1e6003a16fb8b3349af748a90536f0c0a41cc21fdd5 | Python | 9,601 | 258 | import numpy as np
import pytest
from scipy.integrate import trapezoid
from scipy.stats import kstwobign
from SurvivalEVAL import cr_d_calibration, cr_d_calibration_per_event
from SurvivalEVAL.evaluations.calibration.distributional import d_calibration
def _direct_curve(cifs, events, terminal, survival, cause, rho):... |
c4a5acbba37be1b0cddf2a89a4e158fe2f4f3c73a70239efdfa8cb001a606911 | Python | 9,601 | 190 | """
Unsupervised rCCA
=================
This script shows how to use unsupervised adaptive rCCA from PyntBCI for calibration-free decoding of c-VEP trials [4]_.
Unlike the supervised rCCA (see the rCCA example), the unsupervised variant needs no calibration data: each trial is
decoded by fitting a separate rCCA per can... |
44d17e66bcd03f6725d7ac881415cd58a661dba05a4afa17731bf223f5b662c6 | Python | 9,603 | 202 | #!/usr/bin/env python
import pybullet as p
import time
import warnings
import numpy as np
from control_tools.common import PR2_TOOL_FRAMES, BASE_FRAME
from control_tools.controller import Controller # TODO: wrong interface
from pybullet_tools.utils import get_movable_joints, control_joint, set_joint_positions, set_j... |
eaf5d32a693d3da0ef6f683f7aabe6f0ee88d45e41bdcb572d64ace96cd5f54e | Python | 9,603 | 286 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Documentation:
Defines class hybridLFPy.PostProcess for handling simulated output mainly by
class hybridLFPy.Population
"""
import numpy as np
import h5py
import os
import glob
import tarfile
from warnings import warn
from mpi4py import MPI
################# Initializ... |
bd75024de9889e196594a1b0e83e14192c29ef885252b8ae50e39208fb5d3bce | Python | 9,604 | 296 | import torch.nn as nn
import torch.utils.model_zoo as model_zoo
model_urls = {
'vgg11': 'https://download.pytorch.org/models/vgg11-bbd30ac9.pth',
'vgg13': 'https://download.pytorch.org/models/vgg13-c768596a.pth',
'vgg16': 'https://download.pytorch.org/models/vgg16-397923af.pth',
'vgg19': 'https://downl... |
21014ed7ab9e3d0a2b28072d930568b19521c23cacda8857cb606abd4ce43f08 | Python | 9,607 | 274 | #
# 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,... |
87abf8703772f8c4f170e55edea967c66a6bb96fa9060d296d32c6446399b3e8 | Python | 9,609 | 317 | """"""
import abc
import csv
import hashlib
import json
import collections
from pathlib import Path
import logging
import numpy as np
import pandas as pd
import msgpack
from pupil_recording_interface.externals.file_methods import PLData_Writer
logger = logging.getLogger(__name__)
class Unpacker:
MSGPACK_EXT_CO... |
919e9350e695db1c0295f787fbda1151e654ba5347863461f8e0cb8566c4ec33 | Python | 9,610 | 185 | """
D02_DENSITY_MATCHED_NULL.py - written 2026-09-04
THE CONTROL THAT DECIDES WHETHER CHAPTER 5 KEEPS ITS OPTIC-LOBE SENTENCE.
The radius sweep in d02_radius_sweep.txt showed that the optic-lobe / central-brain
gap in undetermined fraction is largely CREATED by the clustering rule:
radius 0 optic 2.28% ... |
e8b65b1d06a37473b9bb6e52a02af31d85db5c38c313eafb35de9fc049ba3c95 | Python | 9,610 | 254 | import argparse
from asb import ASBDataset
from trainer import LitModel, TrainingConfig
import lightning.pytorch as pl
from Bio import SeqIO
from Bio.Seq import Seq
from torch.utils.data import DataLoader
import torch
import numpy as np
from asb import read_asb
import os
import glob
def _asb_predict_one_strand(... |
59dd2078f29f6d9c84a08c30366d75083c5387e7c5dd2450bbfd7c2e8acf22da | Python | 9,612 | 165 | """ONE_INEQUALITY_CONFIRM.py 2026-10-02. Pre-registration: 04-NOTES/PREREG-2026-10-02p-ONE-INEQUALITY-CONFIRM.md
First tests, on data it has not seen, of the law found post hoc: a set of sign changes breaks the antennal lobe iff it lifts
s_Unu (the excitatory share of local-neuron synapses onto uniglomerular PNs, wei... |
52badacbed512807caf755847e2777960e94fba63b2a78bf40fddb043d95f30b | Python | 9,615 | 271 | """
Unit tests for regtools/utils/tiff_io.py
Covers:
- _orient_section
- read_tif_section
- is_multipage_tif / get_tif_page_count
- read_tif_page
- read_multipage_tif
- read_tif_wrapper
- get_stacked_data
"""
import os
import numpy as np
import tifffile
import pytest
DATA_DIR = os.pat... |
9117d1b3ff429b406554df67817a1b0438890c9d9f6b883f8ac313d6f4724858 | Python | 9,616 | 260 | #!/bin/env python3
"""
Helper functions: graphs
------------------------
Collection of functions for some basic graph analysis.
This builds upon the :py:mod:`networkx` module.
"""
from collections import deque
from scipy.spatial.distance import pdist, squareform
from typing import List, Tuple, Union
import networkx ... |
b042d9066178e00e258fe991a8afa31a4b487dcaa2ae0e91919f6042d534ad50 | Python | 9,616 | 237 | """"""
"""
Prosper_nn provides implementations for specialized time series forecasting
neural networks and related utility functions.
Copyright (C) 2022 Nico Beck, Julia Schemm, Henning Frechen, Jacob Fidorra,
Denni Schmidt, Sai Kiran Srivatsav Gollapalli
This file is part of Propser_nn.
Propser_nn is free softw... |
1283ca15b579089589e3d5b41e9460dd6eb8807aebd2f479f786547928c3bea1 | Python | 9,618 | 260 | #!/bin/env python3
"""
Helper functions: graphs
------------------------
Collection of functions for some basic graph analysis.
This builds upon the :py:mod:`networkx` module.
"""
from collections import deque
from scipy.spatial.distance import pdist, squareform
from typing import List, Tuple, Union
import networkx ... |
81e414ea23bd595f0dd3bd092d7fdfb2174fb3d2093af5a09e2f906f09cf3776 | Python | 9,619 | 278 | """DOS/ProjWFC recipes for performing dos calculations"""
from __future__ import annotations
from typing import TYPE_CHECKING
from quacc import flow, job
from quacc.calculators.espresso.espresso import EspressoTemplate
from quacc.recipes.espresso._base import run_and_summarize
from quacc.recipes.espresso.core import... |
f47a62a07c13dc95eae00e6fdea5da1e6843c00a2b553186059f230a661dad52 | Python | 9,619 | 252 | import argparse
from coverage import CoverageDataset, read_coverage
from trainer import LitModel, TrainingConfig
import lightning.pytorch as pl
from Bio import SeqIO
from Bio.Seq import Seq
from torch.utils.data import DataLoader
import torch
import os
import glob
import numpy as np
def _cov_predict_one_strand(tr... |
24358198cc7259fbac16dce3fbee3adebc234a6c9b03be45da32f181b9494600 | Python | 9,620 | 263 | """
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import os, warnings
import numpy as np
import scipy.io as sio
from scipy.stats import zscore
from scipy.sparse import csr_array
def _load_dict(dat, keys):
X, Usv, Vsv, xpos, ypos, xy = None, None, None, None... |
f0bcaa70f2ed013b2f14de366852707867dbf03fc079f99f375017f8330af5a3 | Python | 9,622 | 247 | from collections import defaultdict
from random import shuffle
from codex.data.structured_search_filters import (
OP_DOWNSTREAM,
OP_UPSTREAM,
OP_RECIPROCAL,
parse_search_query,
OP_PATHWAYS,
OP_SIMILAR_SHAPE,
OP_SIMILAR_CONNECTIVITY_UPSTREAM,
OP_SIMILAR_CONNECTIVITY_DOWNSTREAM,
OP_SI... |
1b5dc9dd9bc52d1a2f220e108f9b8d86d938f5937fced974feef9840cae4ef29 | Python | 9,625 | 303 | import os
from random import randint
from flask import (
Blueprint,
redirect,
request,
send_from_directory,
url_for,
)
from jinja2 import Environment, PackageLoader, select_autoescape
from codex.configuration import (
MIN_SYN_THRESHOLD,
)
from codex.data.faq_qa_kb import FAQ_QA_KB
from codex.d... |
1daa7d8332dd056d341d41ec08c0641d58f5492ce7d158d008c66e1b1c15c95e | Python | 9,625 | 267 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import analysis_params
from cellsim16popsParams_modified_spontan import multicompartment_params
from plot_methods import plot_signal_sum, plot_signal_sum_colorplot
import plotting_helpers as phlp
import h5py
import matplotlib.pyplot as plt
import os
import numpy as np
impor... |
35bdb64bd24202151643c4271de5f53fe9d4ccbc9b2a7b3dcefaf82011809ace | Python | 9,625 | 217 | import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from torch.autograd import Variable
from inv_vae.models.graph_conv import GraphConv
from inv_vae.utils.inv_loss import kl_conditional_and_marg
class INV_VAE(nn.Module):
'''
invariant variational auto-encoders.
... |
43d3bd3166c9d954cf3cb8e51644db1a4da1ead28f7f880f33fd6557f9f75df3 | Python | 9,626 | 285 | # # Example for system in Meyers, Craig and Odde 2006
#
# Geometry is divided into 2 domains; one volume and one surface:
# - PM
# - Cytosol
#
# This model has a single species, A, which is phosphorylated at the cell membrane.
# The unphosphorylated form of A ($A_{dephos}$) can be inferred from mass conservation;
# eve... |
c987e88b95981b99cf4d79ad123734ec176ff63c5773c2365bf39f882eeceb8e | Python | 9,626 | 268 | # -*- coding: utf-8 -*-
import os.path
import platform
from lab.environments import MaiaEnvironment
from lab.steps import Step
from downward.checkouts import Translator, Preprocessor, Planner
from downward.experiments import DownwardExperiment
from downward.reports.compare import CompareRevisionsReport
from downward... |
efe368b39a305d56be429216499f2ee78bd7bcf952439ef56bc9b43c1c65eef9 | Python | 9,626 | 186 | from __future__ import print_function
import time
from collections import Counter
from pddlstream.algorithms.algorithm import parse_stream_pddl, evaluations_from_init
from pddlstream.algorithms.common import SolutionStore
from pddlstream.algorithms.disable_skeleton import create_disabled_axioms, extract_disabled_clus... |
475d84f2d227aa9e5cdf8bdc058b370dbae1e6b1f30fe7118eae5566634a7cae | Python | 9,628 | 257 | # coding=utf-8
# Copyright 2021 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/LICENSE-2.0
#
# Unless r... |
b8d56db47c31f8c8edda13757ce3e7ee3d8fb242ee41f9809b7b7481c5c616b9 | Python | 9,630 | 315 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2022/9/26 15:41
# @Author : piaoyang cao
# @File : pcqm4mv2_mol_split.py
import os
import os.path as osp
import pandas as pd
import numpy as np
from tqdm import tqdm
import torch
from torch_geometric.data import Data
from sklearn import metrics
from torch.nn.... |
0c09533c86570a0f3e24f0b3c7d371ab0d049a23bec5fb78ed39f68adb9e4b12 | Python | 9,631 | 227 | #!/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>.
"""
Scenarios in which another (opposite) vehicle 'illegally' takes
priority, e.g. by running a red traffic light.
"""
from __future... |
d83b30a2a397c1c9f8c107278ce1593063238983f200ae3b94374a892026a381 | Python | 9,632 | 233 | import random
upper_case_list = [chr(i) for i in range(65, 91)]
low_case_list = [chr(i) for i in range(97, 123)]
angle_id_list = [str(i) for i in range(1, 21)]
spec_token_list = ['frac', 'pi', 'sqrt']
class Compose(object):
def __init__(self, transforms):
self.transforms = transforms
def __call__(se... |
849e956a211c93b093233e352f33ffd756e2089a3a0d549c53674e6b1a6adf13 | Python | 9,634 | 264 | from abc import ABC, abstractmethod
import numpy as np
import torch
from ConditionalDiffusionGeneration.src.util.img_utils import dynamic_thresholding
# ====================
# Model Mean Processor
# ====================
__MODEL_MEAN_PROCESSOR__ = {}
def register_mean_processor(name: str):
def wrapper(cls):
... |
3c6c12130d9c7e827dfb398942e6eef0791b9143b89b2eaf6714d6f4675c0404 | Python | 9,641 | 265 | ####################################################################################################
# Copyright (c) 2021-, NVIDIA CORPORATION. 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... |
5abc41e90c9e4fdd404e29fc852da7b57956250231f43fbe68df6a063dc64a0f | Python | 9,642 | 259 | """Qt dialog for picking an atlas + sub-mode for the CCF Boundary Editor.
Thin renderer over :mod:`atlas_choice`. The atlas list comes from
:data:`regtools.atlas.registry.ATLAS_REGISTRY` plus a special "Custom 3D
atlas..." entry the user can pick to supply their own paths. The default
selection is seeded from :at... |
89c9eb4c2c1fbead59b91cab25d450e9ae12a1f1a6d80690db09ade1fc38c1f5 | Python | 9,646 | 269 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 13 18:41:38 2021
@author: divyoj
"""
## importing libraries:
import numpy as np
import matplotlib.pyplot as plt
import os
# # note that this must be executed before 'import numba'
# os.environ['NUMBA_DISABLE_INTEL_SVML'] = '1'
from numba import njit
import time as proces... |
6ace54647985f9b3f084395ffaea32682d09ac329a1ebc6c9a0f664e7f12a269 | Python | 9,653 | 284 | from __future__ import annotations
import pytest
pytest.importorskip("sella")
pytest.importorskip("newtonnet")
from pathlib import Path
import numpy as np
from ase.build import molecule
from quacc import _internally_set_settings
from quacc.recipes.newtonnet.core import freq_job, relax_job, static_job
from quacc.rec... |
3772dc80d6df7a3f542a2ff49c7f45710464abfa89e91c4bb7d7ddc67ca7c505 | Python | 9,654 | 249 | """Fetch the Stæger et al. (2020) population-average B6 DAPI mouse brain.
Stæger FF, Mortensen KN, Nielsen MSN, et al. "A three-dimensional,
population-based average of the C57BL/6 mouse brain from DAPI-stained coronal
slices." Sci Data 7, 190 (2020). Data: GIN CTN/B6_dapi_template,
doi:10.12751/g-node.16wrxa, CC... |
3c4292762333d2d99c5e6f7f780e18b97858bb4759274afe09eb188c6929ccd3 | Python | 9,657 | 301 | # 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... |
578a4d76b5527c8ffc402992cf543db8eefae6a778bff500d99ffc4ff0b053e8 | Python | 9,660 | 284 | from cgi import test
from random import sample
from unicodedata import name
from black import out
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from tqdm import tqdm
from seq2exp import tools, trainner, data
from seq2exp import models
import torch.nn.functional as F
from t... |
5a13d038913a6860a3284a06da67cad554716b7723c4114134a63a45616af38f | Python | 9,660 | 214 | import h5py
import numpy as np
import torch
import random # Add this import
from torch.utils.data import DataLoader, TensorDataset
import torch.nn as nn
import torch.optim as optim
import h5py as h5
import matplotlib
# matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
#from torchsummary import summary
from autoe... |
8233c274383260a357f3d28683062f107426487bec846024aee60d4ba72c9d23 | Python | 9,662 | 226 | """Resolve the midsagittal plane for the annotation the editor has loaded.
The editor is in unusually good shape for this. It loads with ``pir=False``
(``viewer.py::_load_ccf_arrays_from_disk``) and keeps the file's own affine in
``self.affine``, so - unlike most consumers in this repo - the affine it holds
genui... |
95848d6c74f88f23a9465e55ee87e8bbf91ac1f8b8dd0a2129894124290020f8 | Python | 9,665 | 338 | import numpy as np
from minigrid.minigrid_env import MiniGridEnv
from minigrid.core.mission import MissionSpace
from minigrid.core.grid import Grid
from minigrid.core.world_object import Goal, Lava
from minigrid.wrappers import RGBImgPartialObsWrapper, ImgObsWrapper
from enum import IntEnum
class WmazeTasks(IntEnu... |
a3d4278a2418a37d7add2adf5d807348d46f7c23109b8a00afa577f880097753 | Python | 9,668 | 240 | """
From an input ListTomoFilaments generates tomogram density simulations
Input: - A STAR file with a set of ListTomoFilaments pickles (SetListFilaments object input) or a tomogram size
- Settings for simulations
Output: - The simulated tomograms
- A STAR file with the list of s... |
ff3aa88056c5e85a402568e204afd7d60f2ea53f25649292f7df2b61a91770e7 | Python | 9,671 | 246 | import numpy as np
import numba
from typing import Optional, Union
def simulateBOLD(Z,
dt,
rho: Optional[Union[float, tuple[float,float],list[float,float]]] = None,
alpha:Optional[Union[float, tuple[float,float],list[float,float]]]=None,
gamma: Optio... |
48c115eb329f5eae77785e1d6e4b1ca26ea960254f765c5baaf50cde5cdddcf8 | Python | 9,672 | 351 | # 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... |
10a9c3b69ae9ad2dd1372d38b2146731fffee12408b7e5c450275b850c191e22 | Python | 9,673 | 242 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 6 22:09:32 2022
@author: heavens
"""
import os
import re
import sys
import h5py
import numpy as np
import argparse
import pathlib
from tqdm import tqdm
from xron import __version__
FILE = pathlib.Path(__file__).resolve()
FLAGS = {"5mC":"C+m","5hmC"... |
35c919861197d7e18948e96a93766ce341a3efef37342ed90032c1479b20cf32 | Python | 9,674 | 281 | """DOS/ProjWFC recipes for performing dos calculations"""
from __future__ import annotations
from typing import TYPE_CHECKING
from quacc import flow, job
from quacc.calculators.espresso.espresso import EspressoTemplate
from quacc.recipes.espresso._base import run_and_summarize
from quacc.recipes.espresso.core import... |
006f2bc06024387816d46e49e411b64fa912833ab34bd5254b731a1898a13216 | Python | 9,675 | 278 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 26 13:05:23 2021
@author: joaquin
"""
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import scipy.io
import pandas as pd
import os
import h5py
import mat73
from scipy import signal
from scipy import stats
from sklearn.decomposition import FastI... |
cfd41015227fcddce4c110f612514a65a4526c94cc6c20b8497300562e896fdd | Python | 9,675 | 238 | import argparse
import yaml
import os
from tqdm import tqdm
import math
import matplotlib.pyplot as plt
parser = argparse.ArgumentParser(description='Input a config file.')
parser.add_argument('--config', help='Config file path')
args = parser.parse_args()
f = open(args.config)
config = yaml.load(f, Loader=yaml.FullLoa... |
4aa555a1b89a8ca7f0ddb12133e8dc34678bc9a7d392bc48f3e24436de02961c | Python | 9,677 | 354 | from functools import lru_cache
from codex.utils.parsing import tokenize
from codex import logger
LEFT = "Left"
RIGHT = "Right"
CENTER = "Center"
HEMISPHERES = [LEFT, RIGHT, CENTER]
REGIONS = {
# region abbreviation: [segment ID, description]
"AME_L": [56, "accessory medulla"],
"AME_R": [29, "accessory ... |
d68f28f66a2bb97071c4f48808e89b5369710e9b80558252812765b3fc9bb208 | Python | 9,677 | 178 | """CharValidator and CharRexValidator: the string, tag and value-class character checks."""
import os
import unittest
from hed import load_schema, load_schema_version
from hed.errors.error_types import ValidationErrors
from hed.validator.util.char_util import CharRexValidator, CharValidator
class TestGetProblemChar... |
1351248450e9716bc7ad4ce40cf72e817db39af04c0b1c2d20c1dc80747bda60 | Python | 9,678 | 320 | """Various utility functions."""
import numpy as np
import scipy.sparse as sp
import torch
from typing import Union
import networkx as nx
import random
from sklearn.preprocessing import normalize, StandardScaler
from collections import Counter
import pandas as pd
from scipy.stats import norm
from sklearn.decomposition ... |
4bd6e3f72e96491de9627534a29b9c2f7a9839b30f2ff4389875921fcd8011dd | Python | 9,678 | 198 | #!/usr/bin/env python
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Control Loss Vehicle scenario:
The scenario realizes that the vehicle looses control due to
bad road conditions, etc. and checks to see if the vehicle
regains control and c... |
82edcb168177aef73f12d5e9da8a02bbe5b94f5a2e9f8d8d7eb5be72674fd076 | Python | 9,678 | 156 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... |
9928b4011d8dc783334bf6443631adde047be82e67ba0f11f8135678e3f195d3 | Python | 9,678 | 225 | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'dgn_chkres_load.ui'
##
## Created by: Qt User Interface Compiler version 6.8.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
###... |
40a3f439d09dfbd5765abcafba6857023370d5c4e193dcf17dc0efe079b8ee39 | Python | 9,681 | 299 | # Implementation of ou bridge for the LIF neuron.
#
# Partially based on code retrieved from [1]. See [2] for details to firing intensity models.
#
# References:
# [1] https://math.stackexchange.com/questions/1287634/implementing-ornstein-uhlenbeck-in-matlab
# [2] https://neuronaldynamics.epfl.ch/online/Ch9.S4.html
#
... |
5ca976a0707f75508e99adcb696369b4e533a1a9792f695f3a2d33739bfd329d | Python | 9,682 | 194 | import scanpy as sc
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from pca import pca
import warnings
warnings.filterwarnings('ignore')
from sklearn.preprocessing import LabelEncoder
from utlis import softmax, reduce_dimensions, cal_ratio
import pandas as pd
imp... |
bbb9e63de23cb980fe9779c47128e4a93a4dd07e7f33b165e742de42ed0e1b27 | Python | 9,682 | 309 | __author__ = "Zoe Wefers"
__credits__ = ["Ryan Huang"]
__version__ = "1.0.0"
__maintainer__ = "Zoe Wefers"
__email__ = "zoe.wefers@mail.mcgill.ca"
"""Purpose: Function for obtaining folder paths, channel names and numerical values from user.Formats and saves txt and excel files."""
import re
import os
import glob
fro... |
78b3ad9f2db3d578fb872f089f9a621f082bf90e6b8a3b68b2cadf12ac60499f | Python | 9,688 | 208 | #!/bin/usr/python3
# Use example: python predict_densenet.py /home/melanie/sMRI_ASD/data/train1/BIDS_data_brain /home/melanie/sMRI_ASD/net2/MedicalNet/train1_models_lr_1e-3_densenet121_new_preproc_from_10ep/model_32_epochs.pth /home/melanie/sMRI_ASD/net2/MedicalNet/train1_models_lr_1e-3_densenet121_new_preproc_from_10... |
a0aaeeae68f3cd2e1570f1d94486ddf94e6739e3223537cc55473f7bbf06181b | Python | 9,690 | 281 | import torch
import numpy as np
from hdpy.model import get_model, train_hdc, test_hdc, encode_hdc
from torch.utils.data import TensorDataset
import hdpy.hdc_args as hdc_args
from tqdm import tqdm
from hdpy.utils import collate_list_fn
from torch.utils.data import DataLoader
from pathlib import Path
from dataset impor... |
7c9ca4a0ef9e37b7ba8bc3fa5e48549b7b7de60b2adf5e46236ad592a8a525a3 | Python | 9,694 | 191 | # SPDX-FileCopyrightText: 2024 Blue Brain Project / EPFL
#
# SPDX-License-Identifier: AGPL-3.0-or-later
'''Functions to select simulations, compute reliability and bootstrap samples'''
import numpy as np
import tqdm
import os
import time
import itertools
import h5py
import math
import random
from scipy.spatial import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.