sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
c9e444b5986eea17901f5b2bc1e39a828926872b89c2de364da70efe1889a8da | Python | 10,599 | 210 | # set QT_API environment variable
import os
os.environ["QT_API"] = "pyqt5"
import qtpy
# qt libraries
from qtpy.QtCore import *
from qtpy.QtWidgets import *
from qtpy.QtGui import *
# app specific libraries
import control.widgets as widgets
import control.camera as camera
import control.core as core
import control.m... |
f73a0ddc428a6110a4f3375c1930784d2fdb60f4ce559772738c6035fe9fa173 | Python | 10,601 | 276 | """Builds the data to be used in HMP model estimation."""
from dataclasses import dataclass
from typing import Callable
from warnings import warn
import numpy as np
import xarray as xr
from numpy.typing import DTypeLike
from scipy.signal import correlate
from hmp.basedata import BaseData, _check_basedata
from hmp.pat... |
6e8b9f3ed81d12b35500a1e80e275e6fd50edd11c8a9c443e5e1877bdaf20dcf | Python | 10,602 | 252 |
"""
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 wx
import os,sys,pydoc
import deeplabcut
medi... |
f72c61215cc7eaae92c359578b805bb090a1d825689be5bead07e716cb32e964 | Python | 10,602 | 276 | #!/usr/bin/env python
from irescue.misc import testGz
from irescue.misc import writerr
from irescue.misc import unGzip
from irescue.misc import run_shell_cmd
from irescue.misc import getlen
from pysam import idxstats, AlignmentFile, index
from gzip import open as gzopen
import requests, io, os
# Check if bam file is ... |
f5fb2525dcfcda38f3397de4889686a60daa4be04f22d6eb8c8149c821ecbba0 | Python | 10,607 | 297 | # -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
from PIL import ImageDraw, Image
def get_boxes_and_inputs_pb(frozen_graph):
with frozen_graph.as_default():
boxes = tf.get_default_graph().get_tensor_by_name("output_boxes:0")
inputs = tf.get_default_graph().get_tensor_by_name("i... |
b6416bc84cef48b27ac3968577edf3e8097fe1a477295432aa598fb73984cac2 | Python | 10,611 | 297 | # 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... |
9f7a45ec61c373d4b514c4cf20cb98f3a8b5918622e98dfaea961c94d696d21b | Python | 10,613 | 275 | """
Script for extracting an analyzing a GraphMCF with a segmented membrane
Input: - A STAR file with a list of (sub-)tomograms to process:
+ Density map tomogram
+ Segmentation tomogram
- Graph input parameters
Output: - A STAR file with the (sub-)tomograms and their co... |
ece8c00516a34b5fe3e3fa4d49cc49a604db7bafaeca3a6ec9c8da5d217ff615 | Python | 10,614 | 308 | """
Bonito Model template
using FP precision
"""
import numpy as np
from bonito.nn import Permute, layers
import torch
from torch.nn.functional import log_softmax, ctc_loss
from torch.nn import Module, ModuleList, Sequential, Conv1d, BatchNorm1d, Dropout
from fast_ctc_decode import beam_search, viterbi_search
clas... |
76a71a41ca0f7ae787e4e3a8e1bd40c7fafc3951e931a94d2ad91663c76a8deb | Python | 10,615 | 308 | """
Bonito Model template
using FP precision
"""
import numpy as np
from bonito.nn import Permute, layers
import torch
from torch.nn.functional import log_softmax, ctc_loss
from torch.nn import Module, ModuleList, Sequential, Conv1d, BatchNorm1d, Dropout
from fast_ctc_decode import beam_search, viterbi_search
clas... |
8d8803ccf8650a136de6a7f22597144dfe4de01fdb1e530a0e17282e92611b65 | Python | 10,616 | 281 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Example plot for LFPy: In vitro MEA slice set-up. It serves to demonstrate
class LFPy.RecMEAElectrode which incorporates discontinous extracellular
conductivity (MEA chip, slice, saline) in comparison to LFPy.RecExtElectrode
which incorporates an infinite homogeneous is... |
7df206045ad4e5b414adbca46931d47598b0b08be2f6e17a6e7f7df2ae50997a | Python | 10,620 | 359 | from __future__ import annotations
from logging import getLogger
from pathlib import Path
from typing import TYPE_CHECKING
import numpy as np
from quacc.utils.dicts import Remove
if TYPE_CHECKING:
from collections.abc import Mapping
from typing import Any
from ase.atoms import Atoms
from quacc.typ... |
82ac45fc668b83cc04a1b9e0901116e6edabef09343aaea6280cc5aa56b00280 | Python | 10,623 | 214 | import cbgt as cbgt
from tracetype import *
import matplotlib.pyplot as plt
import pylab as pl
import os
import pickle
import glob
def rename_columns(results,smooth=False):
results['popdata']['newname'] = results['popdata']['name']+'_'+results['popdata']['action']
new_names = dict()
for i in results[... |
93940ed21626e9fecdadd5662c5fcce847289d7674c4495fe4aaa3b785b20576 | Python | 10,623 | 250 | #""" Authored by: Neel Kanwal (neel.kanwal0@gmail.com)"""
# This file provides inference code for ensembles of binary DCNN or ViT models mentioned in the paper.
# Update paths to processed datasets
import os
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
warnings.simplefilter(ac... |
ec9e4052f2b9a06ef4e4a201899fdfbf0e682f8c8173950a8225192096386708 | Python | 10,630 | 296 | """
Created on Thu Mar 4 19:33:04 2021
@author: Haotian Teng
"""
import numpy as np
import lmdb
import torchvision
import torch
import pickle
from torch import nn
import torch.utils.data as data
from functools import lru_cache
from torchvision import transforms
from matplotlib import pyplot as plt
from typing import ... |
0ec8604c257e3f3a14c37f35b857fa836d4601484006cbd0e14bb8e6b7607164 | Python | 10,634 | 235 | from eppy import modeleditor
from eppy.modeleditor import IDF
import math
def create_office_cell_model(climate, obstacle, height, depth, orientation=0.0, heat_SP=21.0, cool_SP=24.0):
"""
This method creates an office cell model with the attached overhang
with <depth> m, that is positioned at <height> m a... |
3e3f3883ccb0670b90841c465e9572355b98c91c71218f7dbb20180e818d7ffb | Python | 10,635 | 281 | # 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... |
626643ac02c47a9159881767599b86032466c25caf62e5d85592ee96e4245e45 | Python | 10,635 | 307 | import torch
import torch.nn as nn
import torch.nn.functional as F
def initialize_weights(module):
if isinstance(module, nn.Conv2d):
nn.init.kaiming_normal_(module.weight.data,
mode='fan_out',
nonlinearity='relu')
elif isinstance(module, ... |
e794a5a8e94fd2599ecc532fd6810f00a9fe5476c70609ae78fdd31459b6e9a7 | Python | 10,639 | 327 | # 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... |
e285ea93692889a08ea7a6d0d9093b074de4abe7b146ff1d9f5071be614b0c1f | Python | 10,643 | 275 | """
Script for extracting an analyzing a GraphMCF with a segmented membrane
Input: - A STAR file with a list of (sub-)tomograms to process:
+ Density map tomogram
+ Segmentation tomogram
- Graph input parameters
Output: - A STAR file with the (sub-)tomograms and their co... |
0652d41ac26c3641d2d04db9d7e7debef4ece8785dcc162aca49012c8f279132 | Python | 10,644 | 278 | import math
import torch
from torch import nn
import time
from warnings import warn
from collections import OrderedDict
import numpy as np
class RNN_Net_lr(nn.Module):
def __init__(self, dim_in, dim_hid, dim_out, rank,
nonlin=torch.nn.Tanh(),
out_scale="large",
... |
e2deacef6c695a84e90ba558ab19a511fbf7902fb5b5fb1964a11c8aa257a084 | Python | 10,644 | 285 | """
LightsheetCorrection
====================
Module to remove lightsheet artifacts in images.
Adapted from https://github.com/ChristophKirst/ClearMap2
Kirst, et al. "Mapping the Fine-Scale Organization and Plasticity of the Brain Vasculature."
Cell 180.4 (2020): 780-795.
https://doi.org/10.1016/j.cell.2020.01.028
... |
e4d1cefac1273fbd06b3c0a48d18be03289fce84b386b5a954f0eb3f7c2c05e3 | Python | 10,644 | 216 | '''
Description:
Compare model predictions in recovering cell trajectories.
Author:
Jiaqi Zhang <jiaqi_zhang2@brown.edu>
'''
import torch
import numpy as np
from plotting import linearSegmentCMap, _removeAllBorders
from plotting.__init__ import *
from benchmark.BenchmarkUtils import loadSCData, tpSplitInd, tun... |
7c03ddb098804456e43c08a1e8d918af2d1da63e233ea7a5195325138c16156f | Python | 10,646 | 361 | # unicode.py
import sys
from itertools import filterfalse
from typing import List, Tuple, Union
class _lazyclassproperty:
def __init__(self, fn):
self.fn = fn
self.__doc__ = fn.__doc__
self.__name__ = fn.__name__
def __get__(self, obj, cls):
if cls is None:
cls = ... |
9cb3f8e799ad4331bbb7f792cd7e2ead9f7bcdceee992733daf4dc769db524d3 | Python | 10,647 | 193 | import numpy as np
from scipy.signal import find_peaks
from scipy.optimize import fmin
from pathlib import Path
import warnings
warnings.filterwarnings("ignore")
import read # pupillometry code
class PupilData:
def __init__(self,folder_path,machine,process_state,settings):
process_state[0],process_state[1... |
89c23ddebb1046ba163739d86aaa488765a842b427bb6a429cc383bbc892a51c | Python | 10,650 | 301 | from __future__ import division
import logging
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from func_unsupervised_TC import fit
from IterativeMethod import iterativeTC
"""
Created on Mon Oct 29 13:48:02 2018
@author: Hannah Choi
"""
"""
This code finds hierarchy scores of cort... |
0b44833b7190462dda3209202644704edcd7a3d958290878f3038d907de40b12 | Python | 10,652 | 324 | import numpy as np
import pandas as pd
import pickle
from src.file_handling import (
fname,
load_tiff,
write_tiff,
get_roi_zip_file,
get_matlab_files,
load_ball,
load_behavior,
save_params_json,
)
from src.processing import (
split_channels,
maxproj_z,
smooth_xy,
zscore... |
29a531a5d1942a42b99b44fa2dc4b490d61a45e503c87423656fa34de3e6b998 | Python | 10,653 | 317 | from typing import Optional, Callable, Tuple
import torch
from torch import Tensor
import torch.nn as nn
import torch.nn.functional as F # noqa
__all__ = ['reyregressor']
_DROPOUT_RATES = (0.3, 0.5)
_BN_MOMENTUM = 0.01
_NUM_ITEMS = 18
class ConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, n... |
6747691ac8e53f0aba7b99077e2b82b83c9bcaa7b98a84ef8118dcc46714a112 | Python | 10,653 | 262 | # -*- coding: utf-8 -*-
import warnings
import tensorflow as tf
from pinn.utils import pi_named, connect_dist_grad
from pinn.layers.bpsf import G2_SF, G3_SF, G4_SF
from pinn.layers import CellListNL, CutoffFunc, ANNOutput
@tf.custom_gradient
def _fake_fp(diff, fp, jacob, jacob_ind, n_pairs):
def _grad(dfp, jacob... |
2342e96c6cffbf22903c92750ff1691c91de945f7b2c0295f8e4e259b5c811aa | Python | 10,658 | 254 | # Copyright (c) 2020, Ko Sugawara
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... |
717f9c6f20a455ebc2f78c6cda0a3de16568fb0ea503655cf7a4b8729755cb11 | Python | 10,661 | 208 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""make_figure1.py —— 论文图 1:符号干预的对照与剂量-反应(只读归档结果,不重跑仿真)。
输入(均为已归档的冻结脚本输出):
game/docs/results/controls_runs.csv probe_controls.mjs 的逐次结果(E0b/E1/E1b/E2)
game/docs/results/probe_linear.txt probe_linear.mjs 的表(E3 扫描 + E3c 等质量检验)
输出:game/docs/img/fig1_controls.{pdf,pn... |
991f0dfe7bec2e03483ad305db402694ed67c3fa6881441740a108e8208eba9a | Python | 10,666 | 225 | #!/usr/bin/env/python
import argparse
import os
#options (lp,ds) only difference is train_only vs true validation
#TODO undo the way task controls other things... what if we want to change them?
task='ds'
# looks silly but we reuse in "change_task"
task_to_train_only={'lp':0,'ds':1}
train_only=task_to_train_only[ta... |
190b7304204dc839ca8dc5b2d86f04c325d649a7067f1ed9c862478e414a00f3 | Python | 10,667 | 288 | ###########################################################################################################################################################################################################
### Code from https://github.com/c/concise (c) 2016, Žiga Avsec, Gagneur lab ######################################... |
9bae6326e8b79cc4e013a6d5cd79bd19e127e6371464b6201e061233f4bec3fd | Python | 10,667 | 304 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# Contents of this file were adapted from the open source fairseq repository.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Dict, List, Optional
import torch
import t... |
03fef700bbd6e092d13a97a7a63275e8b8fb025a2d346e93c0516f7ca82e7255 | Python | 10,669 | 297 | import os
from typing import Any, Callable, List, Optional, Sequence, Tuple
from torch.utils.data import DataLoader
import torchvision.transforms as T
from PIL import Image
from torchvision.datasets import VisionDataset
import torch
from torch.utils.data import Subset
import random
import pytorch_lightning as pl
clas... |
5567db5c15dd899b8c7b4f5b8e133d299344becbd06ba59af2f8014e1e547d5d | Python | 10,670 | 253 | #!/usr/bin/env python3
"""
Recover per-chain intramolecular energies from an EXISTING flex ddG run.
No re-sampling is required. The backrub trajectory is the expensive part and you already ran
it: struct.db3 holds the coordinates of every backrub, wild type minimized and mutant minimized
pose. This script reads those ... |
b383f362612922cf3280d24c3527ee042ece15304a71e1dbfe124fd0fd1f58fd | Python | 10,671 | 339 | #
# 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,... |
af5ca2eb19691ed536c10d79f242d9a0455357486b23b90ef7b0deebe7a9abfa | Python | 10,672 | 243 | import multiprocessing as mp
import os
import pickle
import time
from datetime import timedelta
from functools import partial
from os import listdir
from os.path import isfile, join
from pathlib import Path
import numpy as np
import uptake.model.utils
import uptake.multiprocessing.datasets_definition as ... |
b1ef38de0b3664112b5667d7821fa50b269fb993838438f55fe1471872032f52 | Python | 10,673 | 314 | # Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
b84d69cff0390be8928bec801481339c453181ad6f1e36d9f9f88d675b200daa | Python | 10,673 | 216 | from optparse import OptionParser
import math
import sympy
### help and usage ###
usage = "usage: %prog [options] args"
description = '''Function: prepare the split input genotype data for BayeScEnv'''
version = '%prog 2.28.2022'
parser = OptionParser(usage=usage,version=version, description = description)
parser.add... |
f4cb6c14409c5e2da15711f095c85195dd0306b400b46e4dc91acb34151a6a45 | Python | 10,677 | 306 | from __future__ import annotations
import gzip
import itertools
import json
import math
import signal
from collections.abc import MutableMapping
from enum import Enum
from functools import wraps
import numpy as np
import ord_schema.message_helpers
from deepdiff import DeepDiff
from deepdiff.helper import NotPresent
f... |
44dec0221309e44a83b186828d5a3ea38bbc2730c3e2e9096e67af58a4bbd2b6 | Python | 10,678 | 294 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from io import StringIO, TextIOWrapper
from unittest import TestCase, main
try:
from contextlib import ExitStack
except ImportError:
# python 2
from contextlib2 import ExitStack
try:
from unittest.mock import MagicMock, Mock, pa... |
d94f7405b074ebe85f588c877516024b1274969580911171d3b6154b30bf35ca | Python | 10,678 | 256 | import os
import numpy as np
import argparse
import time
import copy
import torch
import torch.nn.functional as F
from torch.optim import lr_scheduler
from tensorboardX import SummaryWriter
from imports.ABIDEDataset import ABIDEDataset
from torch_geometric.data import DataLoader
from net.braingnn import Network
from ... |
9a01a5936955c5459479dc556f3873d9b7fc47ca7a68150fce5f77ee453bb1f6 | Python | 10,679 | 262 | """
Tests module distance_to
# Author: Vladan Lucic
# $Id$
"""
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
#from past.utils import old_div
__version__ = "$Revision$"
from copy import copy, deepcopy
import importlib
import unittest
import numpy
impo... |
be352e1b8fa3eba6c7eade2b87d657763e0c34c77578d71c45e0485cc56d622a | Python | 10,681 | 320 | # Written by Minh Nguyen and CBIG under MIT license:
# https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
from __future__ import print_function, division
import numpy as np
from scipy.interpolate import interp1d
import cbig.Nguyen2020.misc as misc
def typecheck(interp_func):
def func_wrapper(month_true,... |
84353ef0f3746c8c81ada4a61ab169060442ab8bf61bfe06dc1c606d51b4b861 | Python | 10,685 | 280 | import torch
import torch.utils.data as utils
import DCE_matt as dce
import copy
import numpy as np
import model
import pickle
import time
import train
from tqdm import tqdm
import matplotlib.pyplot as plt
def run_simulations(hp, args, SNR=15, eval=False):
print(hp.device)
if hp.network.nn == 'lsq':
h... |
8d2f22e69260d486c18cb5ade9d7d65d3e6788c9ef6a49f86fabb6c4e473c4ba | Python | 10,688 | 244 | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... |
a3e5e4051c6a38c581587b88d066f88870af4fa1c8f486700a945898dd07af63 | Python | 10,689 | 306 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 22 21:59:29 2024
@author: bernifoellmer
"""
import os, sys
import torch
from torch import nn, optim
from model import SegmentCACSModel
from glob import glob
import SimpleITK as sitk
import numpy as np
import pathlib
from scipy.ndimage import label, generate_binary_struc... |
cda2c36d8af10ce0349973731ee7bd23aff1d7b52f8c0abcb4b2274de6dbd2c5 | Python | 10,690 | 164 | from unittest import TestCase
from wikibaseintegrator.wbi_exceptions import ModificationFailed, SaveFailed, SearchError
class TestWbiExceptions(TestCase):
@staticmethod
def test_modification_failed():
error_dict = {'error': {'*': 'See https://test.wikidata.org/w/api.php for API usage. '
... |
ebf68f3a52c710d07aaac2f3ffccd215fcb57bdd5ec438cae6734d537680fe17 | Python | 10,691 | 220 | """Qt UI plugin system: docks, events across threads, lifecycle, layout, failures, end-to-end plugin."""
import json
import sys
import types
from pathlib import Path
from types import SimpleNamespace
import numpy as np
import pandas as pd
import pytest
import shiboken6
from PySide6.QtCore import QCoreApplication, QEve... |
5f0add8d71f4ef261875b3ccdc7e6030b0978954931ee5257f6619004d8c85c0 | Python | 10,692 | 341 | # 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... |
5a839cd37aff1120d955ad7c8d0daf14ba5b3e9ee5e0c90b58e0394d024c47ac | Python | 10,699 | 301 | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule, kaiming_init, normal_init, xavier_init
from torch.nn import init
def generation_init_weights(module, init_type='normal', init_gain=0.02):
"""Default initialization of network weig... |
1cf26dc8cf3a6d6f0364ce1e1537109ce62bbdef226e8ddf052a71b6f018fbce | Python | 10,702 | 328 | # Basic Temporal Difference vs Reward Basis learners and Successor Representations
import numpy as np
from copy import deepcopy
class BaseLearner(object):
def __init__(self, gamma, reward_function,env, learning_rate, beta):
self.gamma = gamma
self.reward_function = reward_function
self.env = env
self... |
8be240104cfa897f4c64067a0877637c6c631670c5baddb53c9e1409748051e2 | Python | 10,703 | 216 | """
PLACEMENT_DECISIVE.py written 2026-09-22.
Pre-registration: 04-NOTES/PREREG-2026-09-22-PLACEMENT-DECISIVE.md (written before this ran).
THE QUESTION
------------
Is the real excitatory/inhibitory partition placed non-randomly on the unsigned wiring,
beyond what each neuron's INPUT and OUTPUT synapse budgets exp... |
256f285b5335be9fc45c65157fc85915948ee366768533b8bc89adf574611982 | Python | 10,709 | 249 | import numpy as np
from scipy import linalg
import matplotlib.pyplot as plt
import random
# FINDS COMMUNITIES OR MODULES IN DIRECTED NETWORKS AND EVALUATES THEIR MODULARITY INDEX. THE ALGORITHM WHICH OPTIMIZES A MODULARITY FUNCTION AND MAKES CONTINUOUS BISECTIONS UNTIL NO FURTHER IMPROVEMENT ON THE MODULARITY FUNCTION... |
9db3d5273375d2a31d5e8d3a7be23f620bb2ce16ad34b73cbd4b0976346c2eda | Python | 10,715 | 302 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Docs here"""
__author__ = "Mitchell R. Vollger"
__credits__ = ["Mitchell R. Vollger"]
__maintainer__ = "Mitchell R. Vollger"
__email__ = "mrvollger@gmail.com"
__status__ = "Development"
MAX_ROWS = 100
import logging
import argparse
import sys
import ... |
ff375772a687040ac3e20f22d443c49616726ec202d7002586daac67d7486f0f | Python | 10,717 | 294 | import os
import shutil
from multiprocessing import Manager
from typing import Any, Dict
from joblib import Parallel, delayed
from torch.utils.data import Dataset
from tqdm import tqdm
from torcheeg.io import EEGSignalIO, MetaInfoIO
MAX_QUEUE_SIZE = 1024
class MockLock():
def __enter__(self):
pass
... |
334b37e8f599084f23fe3ed8f605493cbd27ac585ff50bf78f1f26199d357439 | Python | 10,720 | 269 | #https://andre-rendeiro.com/2016/01/04/survival_analysis_with_lifelines_part1
import numpy
from pathlib import Path
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from lifelines import NelsonAalenFitter, KaplanMeierFitter, CoxPHFitter
import itertools
from lifelines.statistics import logrank_t... |
27c4e61374ac9858b84f5ab4436f4a41747c17df6719512e1cc24eb9ffcd594b | Python | 10,722 | 325 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
762259797eae10771ba20c1975c5d2c390a4d1ef64ed85b1b80fea48a0f1863e | Python | 10,725 | 145 | """SIGN_CENSUS.py 2026-10-02. Pre-registration: 04-NOTES/PREREG-2026-10-02g-SIGN-CENSUS.md
Which of the brain's signs can break smell on its own? The crash test (CRASH_TEST.py) scored the 369 unlabelled inhibitory
local neurons; this scores every neuron that can reach the antennal lobe. Inside the lobe's circuit (the 3... |
18f7a7225b588fcce14d3eca021c66e4155cae6a55fa7b9359446134137addac | Python | 10,726 | 235 | import os
import json
import argparse
import math
import numpy as np
import carla
from utils import interpolate_trajectory, gen_skeleton_dict, gen_scenarios
SAMPLING_DISTANCE = 30
PRUNE_ROUTES_MIN_LEN = 10
PRECISION = 2
DOT_PROD_SLACK = 0.02
def generate_scenario_7_8_9(carla_map, world=None):
carla_topology = ... |
24d33e9670731acf1d4da54b0e6a815eec8aa35f0f5b1d309458f2b7205f6d05 | Python | 10,727 | 311 | """
Script for segmenting and quantifying the filaments attached to a post-synaptic membrane
Input: - Original tomogram (density map)
- Synaptic membrane segmentation tomogram (pre and post membranes)
Output: - TODO: STILL PENDING TO BE DEFINED
- vtkPolyData
- Statist... |
940619c850f90043ed75ce1802d1ceebe9d47df949f6e01ef077e0800e494bbc | Python | 10,732 | 236 | '''
@author: emma
code for defining PCA subspace sampling distributions for disease and subject effects
which are stratified between disease classes, bias groups, and train/val/test
* without this stratification, model evaluation is likely to show a significant
level of performance disparity even with no bias effect... |
109ef54b9ea92980c6d1da12f0e38cd2ac9e53d8160ad3ab48fd8ad7c034f9ab | Python | 10,734 | 314 | from __future__ import division, print_function
import numpy as np
import nitime.algorithms as ntalg
import scipy.stats
from scipy.signal import detrend
def cross_spectra(X):
"""For each pairwise combination of channels, compute cross spectra
For each chunk, taper, and channel pair (X, Y), compute
X... |
f082c7669b6f38b87fee820effbf670ffb950c0dca7f501fd05d7f8f613f2168 | Python | 10,734 | 328 | from __future__ import annotations
# built-in
from functools import reduce
from itertools import islice, permutations, repeat
from math import log
from typing import Sequence
# app
from .base import Base as _Base, BaseSimilarity as _BaseSimilarity
from .edit_based import DamerauLevenshtein
__all__ = [
'Jaccard'... |
91f4ad4491e31ea75407a52ed9a0722bce2569e900f6c0f4830a560a86101663 | Python | 10,735 | 375 | from collections.abc import Iterable
from elasticai.creator.ir import Registry
from elasticai.creator.ir2verilog import Code, Ir2Verilog, TemplateDirector, factory
class TestVerilogTemplate:
def test_can_set_localparam(self):
template = (
TemplateDirector()
.set_prototype("localpa... |
aa559983bc234b46a72a1530eb2c827a071a2fefe92d771c77699e61468aef56 | Python | 10,736 | 256 | #Mancy Chen 24/05/2023
################################################################################################################
# Merge data: Radiomics per ROI
import pandas as pd
import numpy as np
import glob
import os
from combat.pycombat import pycombat
# Specify the path to the directory containing the CS... |
1969c0d84de6e0682f2f5c81bf5726654a8163dd668404e11acb1574063262c9 | Python | 10,737 | 269 | import sys
import os
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PIL import Image
import io
from PIL.ImageQt import ImageQt
from PIL import Image, ImageEnhance
def pil2pixmap(im):
if im.mode == "RGB":
r, g, b = im.split()
im = Image.merge("RGB", (b, g, r... |
22ad1692f4870f6e3f9c4111aca4ae97c82a36ba96b28542c16a2c6db954b16e | Python | 10,744 | 255 | import torch
import numpy as np
from tqdm import tqdm, trange
import tifffile
import os
from core.load import load_data
from core.models.Model import create_model
from core.utils.misc import *
from core.utils.Coord import Coord
from glbSettings import *
torch.backends.cuda.matmul.allow_tf32=True
torch.backen... |
00d3ffbc140a7c8d87ff1dc2fc8141ef1e6fba2911555e57d0a04ebb0ad7a32b | Python | 10,745 | 336 | # 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... |
d23428683972e2423791a7c437bf33a5137ffe43ef74543e4b06fa97d4877dc5 | Python | 10,745 | 283 | import torch
from torch_geometric.data import Data, Batch
class BatchFinetune(Data):
r"""A plain old python object modeling a batch of graphs as one big
(dicconnected) graph. With :class:`torch_geometric.data.Data` being the
base class, all its methods can also be used here.
In addition, single graphs ... |
6f5218a37c006d7fb6e4b3f98ce7dbdbceaad60960c2ec0ca25ae2d9056992a5 | Python | 10,747 | 250 | """Interface class for acquisition data."""
import json
import logging
from dataclasses import dataclass, field
from datetime import datetime
from importlib.metadata import version
from pathlib import Path
from typing import Any
import h5py
import ismrmrd
import numpy as np
from console.interfaces.acquisition_paramet... |
003de143d24c19033a3d478025f0236b2975ee1593d56eda465f35b83da26083 | Python | 10,748 | 345 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
7b8b8341d11ea896c6e5eb38d283aac07de23f608532eae99db999c352d1d495 | Python | 10,749 | 323 | #!/usr/bin/env python
# coding: utf-8
# ### LASSO parameter range experiments
#
# We want to see whether smaller models (i.e. models with fewer nonzero features) tend to generalize to new cancer types better than larger ones; this script compares/visualizes those results.
# In[1]:
import os
import itertools as it
... |
21cbbb66bac1d8c40f8d66ecacf88ebc3680a4bc8b84362add95f4700a691eb9 | Python | 10,754 | 221 | from unittest.mock import MagicMock
import pytest
from NDATools.Configuration import ClientConfiguration
from NDATools.upload.cli import ValidatedFile
from NDATools.upload.submission.api import SubmissionHistory, NdaCollection, Submission, DataStructureDetails, \
SubmissionDetails
from NDATools.upload.submission.... |
40ea67e9f4a2df567e9a06e4de80c5ee90d55eda2526ac4dbf0c494b28aaffaf | Python | 10,754 | 263 | import numpy as np
import pandas as pd
from mnp.utils.chemistry import smiles_to_qed
from mnp.definitions import DATA_DIR, DOCKSTRING_DATAPOINT_SPLIT_DICT
from dockstring.benchmarks.original import (F2_score, promiscuous_PPAR_score,
selective_JAK2_score)
import pickle
import ... |
919fe0891709ec43429ee82df5987f64693ff36074659568d76b2e54c4f1ea9d | Python | 10,754 | 351 | """
Implementation of Task base class and some example Tasks
Main entry point in Tasks is do_step, which takes latest network action
and returns new Task state.
@author: J.O. Rombouts (see https://github.com/JRombouts/augment)
"""
import numpy as np
import logging
class Task(object):
"""
Bas... |
120471679925f3db4648edf4f3b1d08d631f4828343883e9affd10a83f49fa41 | Python | 10,757 | 364 | import numpy as np
import scipy.special as sp
from ..config import SPHERICAL_HARMONICS_LMAX
from ..from_gpaw.spherical_harmonics import Y
sqrt2 = np.sqrt(2)
'''
Real spherical harmonics follow the definition:
https://en.wikipedia.org/wiki/Table_of_spherical_harmonics#Real_spherical_harmonics
Work functions for ge... |
24fde8e81404abaf3238603ad2f0aa3a7f2c84ade050247e2c8caf381cb4e875 | Python | 10,760 | 420 | # 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... |
edf931d7dd3d84eb4c21bab88a2e8c3fabce7904852ee0a8701becf311b8a2b7 | Python | 10,761 | 363 | # kallisto.py
import numpy as np
import pandas as pd
import scipy.io
from pathlib import Path
from fba.utils import (
open_by_suffix,
get_binary_path,
get_logger,
run_executable
)
logger = get_logger(logger_name=__name__)
def fb2fa_kallisto(x, fasta_file, t2g_file):
"""Prepares fasta file, t2g ... |
f02291f61a427b6763129a02e5e0665ea459fb9c532d16db9be5ef38ff1d0134 | Python | 10,764 | 201 | import torch
import torch.nn as nn
from model.module import *
from utils import *
from torch.nn import functional as F
class DecoderRNN(nn.Module):
def __init__(self, cfg, tgt_lang):
super(DecoderRNN, self).__init__()
# token location
self.var_start = tgt_lang.var_start # spe_num + midvar_n... |
f02a17569b3bfd68bda5bff3672381274f3bfb8371a84eacc1737e08de319fd7 | Python | 10,766 | 314 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created by : Alpha Renner (alpren@ini.uzh.ch)
num_neurons is the number of neurons per population
num_layers is the number of unique populations
num_populations is the number of parallel populations, e.g. if you have 4 inputs x1,x2,x3,x4, then this is 4.
"""
import war... |
70fa791ae582c8a498a8c71cf83fe4c51f3928bcb8c26589638d256aa3af2252 | Python | 10,767 | 301 | # pylint: disable=invalid-name, no-member, missing-function-docstring, too-many-branches, too-few-public-methods, unused-argument
""" DICE model from https://github.com/UsmanMahmood27/DICE """
from random import uniform, randint
import torch
from torch import nn
from torch import optim
from omegaconf import OmegaConf... |
2218899386e7e031836b151c37c979c693dcdb3e6b6b2d8af68919048995eabc | Python | 10,770 | 174 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Modular prediction of off-target effects
@author: Wei He
@email: whe3@mdanderson.org
@Date: 05/31/2021
"""
__version__ = "1.0.0"
import os, argparse,textwrap,logging, sys,pkg_resources
from MOFF_prediction import *
def MOFFMain():
## Set logging format
loggin... |
16923e86a3376074ee0550745f122dc74864ddd2a9681af6eec1a7e916bbeb99 | Python | 10,771 | 217 | """
D02_RHOBAR_BETWEEN_BASELINE.py - written 2026-09-14. VERIFY V-68, second box.
THE PROBLEM THIS FIXES, found on 2026-09-14 while running V-68's kill test.
V-68 wants an honest design effect: rho_bar over a neuron's own synapse pairs, then
deff = 1 + (n_bar - 1) * rho_bar, then n_eff = n / deff. It pr... |
9354a1b58c8d49b05aad162d7319108489e527f2db25490d497351afc5f32d02 | Python | 10,773 | 277 | import argparse
import json
import multiprocessing as mp
import cv2
import numpy as np
import os
import pandas as pd
import random
from tabulate import tabulate
import time
from tqdm import tqdm
from src.utils import timestamp_human
from src.preprocessing.reyfigure import ReyFigure
from src.preprocessing.loading imp... |
a4f5c3a45ca4069e12ffa05d3efbfcd8a0a636da7515d7d4e9174a914f3f2311 | Python | 10,775 | 262 | # code reference:
# https://github.com/AntixK/PyTorch-VAE
# https://github.com/mhw32/multimodal-vae-public
import itertools
import torch
from torch import nn
import numpy as np
from typing import List
import matplotlib.pyplot as plt
import seaborn as sns
from torch import logsumexp
from torch.distributions import Norm... |
0c1165bb1bfbc7fcc30884d39150fd37105ddcec0fd3319cdadab4f70db658b2 | Python | 10,776 | 312 | # Copyright (C) 2017 Sarah Parisot <s.parisot@imperial.ac.uk>, Sofia Ira Ktena <ira.ktena@imperial.ac.uk>
#
# 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
# ... |
d730e51568448ea676c3864c851274584a60236e3329b349ff34825141e4138d | Python | 10,777 | 282 | # __main__.py
import sys
import importlib
from fba import __version__
from fba.parsers import parse_args
from fba.utils import open_by_suffix, get_logger
def main():
args = parse_args()
logger = get_logger(logger_name=__name__)
banner = """
█████▒▄▄▄▄ ▄▄▄
▓██ ▒▓█████▄ ▒████▄
▒████ ░▒█... |
9f4e488eaf741c89ad910db6cd7b1d2c7422a6ef1e3feda0ee4dced006aa82e3 | Python | 10,781 | 231 | from collections import defaultdict
from itertools import count
from pddlstream.algorithms.common import add_fact, INTERNAL_EVALUATION
from pddlstream.algorithms.downward import make_predicate, add_predicate, make_action, make_axiom, get_fluents
from pddlstream.language.constants import Head, Evaluation, get_prefix, g... |
e6f2196509eb0561d21ae4f2809c01d97b95929daf38662f6a7daab40e830c01 | Python | 10,782 | 367 | """
Helper functions for network simulations
"""
import numpy as np
from scipy.interpolate import interp1d
from src.metrics import compute_osi
## Basic network ##
def relu(x):
"""
Pointwise nonlinearity
"""
out = x.copy()
out[out < 0] = 0
return out
# Circular tuning inputs and weights (cou... |
406e0ccb128a4ecad485465fd43b4705d049beda9aca512376dd8c7d9c87719b | Python | 10,783 | 400 | # 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... |
06ccd006a7904967ec89ebf13f2f11b331eeb0e068cbfe72a1b089cc417a83a3 | Python | 10,790 | 262 | import drawsvg
import numpy as np
import io
cmap = [
'#252525', # black
'#0074D9', # blue
'#FF4136', # red
'#37D449', #2ECC40', # green
'#FFDC00', # yellow
'#E6E6E6', # grey
'#F012BE', # pink
'#FF871E', # orange
'#54D2EB', #7FDBFF', # light blue
'#8D1D2C',#870C25', # brown
'... |
d66c03e3182fe95a7acb2b1c5ef83ea324690ad7d9cb112b64fafeda4acc58fd | Python | 10,794 | 269 | """
This is the FID-Net-2 DNN archetecture.
If you use this, please cite:
Shukla, Karunanithy, Vallurupalli, Hansen
bioRxiv (2024),
https://doi.org/10.1101/2024.04.01.587635
Flemming, 2022-2024, flemming.hansen@crick.ac.uk / d.hansen@ucl.ac.uk
"""
import os,sys
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '... |
6f4e9a4320dabafe056eb8aa7473e1d89b97a2916ecec8621cb1b426fa4b944e | Python | 10,795 | 181 | from Bio import SeqIO
import pandas as pd
from torch.utils.data import Dataset, DataLoader
import pyranges as pr
import numpy as np
import torch
import lightning.pytorch as pl
import torch.nn.functional as Fun
import re
from scipy.ndimage.filters import gaussian_filter
import comparison_datasets
import hic_dataset
from... |
664462e8060627d2f724ca997b39181dcffdf9a9022cae224b2c2cc09aaab4ed | Python | 10,798 | 187 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 10 19:00:56 2022
@author: caroline
"""
import numpy as np
from matplotlib.colors import LinearSegmentedColormap
EXPERIMENTS = ['exp1', 'exp3']
COMPUTER = 'laptop'
SUBJECT_GROUP = 'Gorilla_V4'
DISTRIBUTIONS_RESOLUTION = 20
SIMULATION_OPTIONS_BOTH_... |
9546cc3afe38e6c19bde6600f7958b0a44abdafa58b8c3bd5e959353b844692e | Python | 10,799 | 340 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
LFPs from a population of cells relying on MPI (Message Passing Interface)
Execution:
<mpiexec> -n <processes> python example_mpi_2.py
Notes:
- on certain platforms and with mpirun, the --oversubscribe argument is needed
to get more processes than the number of... |
093a83063ae4c87a92c74cb8451fee212f3330274f02bb1f8f5a6eff70197f30 | Python | 10,800 | 332 | # 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... |
69c06129c16dd8077ae7384fa500877ae6ca9aab8d5854e355f5b568aac0e780 | Python | 10,803 | 270 |
import re
def section_text(text):
"""Splits text into sections.
Assumes text is in a radiology report format, e.g.:
COMPARISON: Chest radiograph dated XYZ.
IMPRESSION: ABC...
Given text like this, it will output text from each section,
where the section type is determined by th... |
832fab91b69c36518799b0a0f37903d1ad40aa937e6ef3bd2136ae362839c3ce | Python | 10,803 | 280 | # 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... |
ae6a8081cfa56acade3e635db6d84c5515e9d0b9b3aef7b3cfd1661c102ec775 | Python | 10,804 | 260 | """GUI layout + preview-aspect regressions for the Registration tab.
Two user-reported issues are covered:
1. The left controls column was CLIPPED (its widest rows - the 3-dropdown
method row, the atlas row, the atlas-name label - forced the form far wider
than the splitter gave it). The fix reflows... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.