sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b8faeeb45885eeab6f381050fd366fd3d0190dfed1bd9049ce35b896a42dd5c3 | Python | 11,142 | 458 | #%% [markdown]
# # Density-adjusted group connection test
#%%
import datetime
import time
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from pkg.data import load_network_palette, load_unmatched
from pkg.io import FIG_PATH, OUT_PATH, get_environm... |
3ad6c4368df1df666043482c06e8ad5603a10ad4fbfecefc2275eaadcdfab144 | Python | 11,146 | 399 | import math
import random
import functools
import operator
import torch
from torch import nn
from torch.nn import functional as F
from torch.autograd import Function
from op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d, conv2d_gradfix
from model import (
ModulatedConv2d,
StyledConv,
ConstantInput,
... |
0a657aaa573ed54c810c1c0aee208c5ff42a5fa4cf9c64a30990c57f20713647 | Python | 11,147 | 335 | #%% [markdown]
## Linking transcriptome and connectome via graph matching
# > A simple attempt to see if one 'ome can be aligned to the other 'ome
#
# - toc: true
# - badges: false
# - categories: [pedigo, graspologic]
# - hide: true
# - search_exclude: true
#%%
import os
import time
from pathlib import Path
import m... |
9cbfd14659d909f04f6fa7607d6c37a3fa939f105141ab7a46e22da5b2444d64 | Python | 11,148 | 353 | import numpy as np
import torch
import math
from utils.nnet import from_gpu
from scipy.spatial.distance import squareform, pdist
from scipy.stats import zscore, multivariate_normal
from sklearn.linear_model import LinearRegression
from scipy.io import loadmat
def compute_behav_taskfact(cmats_dict: dict) -> dict:
... |
0533347451f2e9f0af4033cd2eeda24c9afe0320038d71e9a189e28dd6aba717 | Python | 11,154 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
1bacb67264779f9b58e1847dec0e0c5778fe35f252a194ab3303874f7dfbce0b | Python | 11,154 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
2835e9192532863ce5fd48fde25c02d5b09022ba38c4d7c5ee6640313b4dbc17 | Python | 11,154 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
51bfa5085134f93bd9e5f126872a5b1ff18d48409a47500d44c60e087a447303 | Python | 11,154 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
8d3703cb2590efd3f3547559cef1004ec3d4716905872c8eff8dbc02d4e12cbd | Python | 11,154 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
c90cbbc70b94feeb531214fc327d252b5cddb27913cbadedc07b3f9857ba89f3 | Python | 11,154 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
e9b63b6375d99b9c2591a4c6d6c3b0f2f202afe149b914ebff2a1bea4ad40642 | Python | 11,154 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
5826a20ce7a27ac7668422d404bcf7b96ecd65a50bbdb3ea397305d5e806bd8e | Python | 11,155 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
4ae975439139b034bc62fdee3f3a489853d745066e0fd17d4a578ffc9fb32ea3 | Python | 11,157 | 260 | #!/usr/bin/env python3
"""
File: fill_gaps_mr_and_decon_table.py
Created: 2021/02/03
Last Changed: 2021/02/22
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
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
... |
b00cae5e7339f150ca499916fd6473c3c4af83ba50c4aed7c7f15afd306a614f | Python | 11,157 | 393 | # %% [markdown]
# ##
import os
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from scipy.integrate import tplquad
from scipy.stats import gaussian_kde
import pymaid
from src.data import load... |
428797266069493e3e78232c4133dc8cd075d68f9311226e4e370884b01a9908 | Python | 11,158 | 357 | """
Utilities for the OBOGraph Datamodel
------------------------------------
See :ref:`datamodels`
"""
import io
import json
import logging
import os
import shutil
import subprocess
import tempfile
from collections import defaultdict
from copy import deepcopy
from enum import Enum
from pathlib import Path
from typin... |
c252d781100bd77c4db78beffdf6fbadf8230db2e0abfe7d5e4ebb0e709db100 | Python | 11,161 | 480 | # %% [markdown]
# # THE MIND OF A MAGGOT
# %% [markdown]
# ## Imports
import os
import time
import warnings
from itertools import chain
import colorcet as cc
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import networkx as nx
import numpy as np
import pandas as pd... |
b166ec144bd18c77a3bc9922ea9da5d1c1d14e420d64239277a9e0086781b94f | Python | 11,164 | 272 | import csv
import os
import sys
from sklearn.cluster import KMeans
import numpy as np
# Court to circuit mapping, which maps from SCDB codebook to the actual Circuit number
# http://scdb.wustl.edu/documentation.php?var=caseOrigin
# http://scdb.wustl.edu/documentation.php?var=caseSource
court_circuit_map = {1: 13,
... |
bed787e003124aa1f214ed34fba40a9bcc05b668d5da1b02d9081ffcbaeaccb2 | Python | 11,168 | 352 | import torch
import torch.nn as nn
import torch.nn.functional as F
# https://github.com/joe-siyuan-qiao/WeightStandardization
# NOTE: apply this only for the conv layers before normalization.
class Conv3d(nn.Conv3d):
def __init__(
self,
in_channels,
out_channels,
kernel_size,
... |
b4cd9301944818f198649a3e9af7be0084a4f03021bac725a541acd58a023853 | Python | 11,169 | 295 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Xiangtai(lxtpku@pku.edu.cn)
# Implementation of Paper Learning a Discriminative Feature Network for Semantic Segmentation (CVPR2018)(face_plus_plus)
import torch
import torch.nn as nn
from torchvision.models import resnet50
#import torch.utils.model_zoo as model_zo... |
f2f93e835cff36db4bfc9d5177b4d34b776c93b8d694fc54d9a2957cc594fdc1 | Python | 11,170 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
44fbeb162de4cbdbda8763168a611bf275b00afabc0339dae28410a7557059fd | Python | 11,172 | 220 | import os.path
from datasets import load_file
from datasets import get_survival_y_true
from datasets.basic_dataset import BasicDataset
from util import preprocess
import numpy as np
import pandas as pd
import torch
class BDataset(BasicDataset):
"""
A dataset class for methylation dataset.
DNA methylation ... |
a04d819a55af30b3bccec5bbe4adef559283cfb6147ca3858df146238338bb3e | Python | 11,178 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
f3ee9c6f4cff906126df39c17ccd5795bae0963086803c6a5714c9f9933096ed | Python | 11,183 | 261 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = n... |
0f01c712ca1648c0f3f2b9198a5b469d87e7e340e0fbe6532c1a75fa4d8f8af6 | Python | 11,186 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
4ec46fd5160a5ab7b9572a2f2048646d747b6919c7ecc2089679ca9fb3d7dee5 | Python | 11,186 | 307 | import math
import numpy as np
from ._common import _truncate_sequence
from ._common import predict
VCF_REQUIRED_COLS = ["#CHROM", "POS", "ID", "REF", "ALT"]
# TODO: Is this a general method that might belong in utils?
def read_vcf_file(input_path,
strand_index=None,
require_st... |
e84c6ec1a44ae69b982736c1112e76354132c921f00a42d67d4c0bf922bb5dc5 | Python | 11,186 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
f0ff442720ff5a37d7c3699cfd0c25911d6e73601691fd1600e550ea1bb7efd8 | Python | 11,186 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
1a8b6fffab603c52f6a80c51f26b21c03e2d7f56699b95cea64fb240bf7074a8 | Python | 11,189 | 261 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
9182a45207f0379e462ae4823b4f4dc71c78db8289f1c3bdeb5f0baf561e1e40 | Python | 11,197 | 286 | #!/usr/bin/env python3
"""
File: do_pca_over_expression_matrix.py
Created: 20212/02/09
Last Changed:
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
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 ... |
c1fec1785b9d4b10d061533a40d8e6b8d97da3d122ba5c8d61efe6c3cae0e659 | Python | 11,197 | 227 | """Utility functions for Project, including functions for use in isolated processes."""
import os
import csv
import types
import slideflow as sf
import importlib.util
from os.path import join, exists
from slideflow.util import log
def _project_config(name='MyProject', annotations='./annotations.csv', dataset_config='.... |
c51db51f8c8dd3b8e84a13357c63f42191333165a610ae2352123d4931a8c1ba | Python | 11,197 | 299 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
f185d7c7b2c8f83fc8f97e46d454c3cd03c49092af8864a0770f1e9394620cfe | Python | 11,197 | 240 | import numpy as np
import torch
from torch.utils.data import TensorDataset
from int_data import generateInputVectors
import matplotlib.pyplot as plt
def generate_data(dataset_size, toy_params, out_size, auto_balance=False, verbose=True, raw_data=False, device='cpu'):
"""
Generates a contextual integration ... |
7c418c1bdd727627d8741006e9caba2fcef3e98f5ba191684556e1c4653247f1 | Python | 11,201 | 319 | """
Vowel In Noise Cooling - Analysis By Ferret
Plots the performance of ferrets (F1311, F1519 and F1706) discriminating vowels in
clean conditions and with noise during control testing, and testing with cortical
inactivation (cooling or light delivery / optogenetics).
In the manuscript, these plots make up Figure ... |
a7962933f65dc26ae9788435a4bc5cf49a688b48fccce781bd2832eea210a66b | Python | 11,203 | 318 | import os.path as osp
import mmcv
import numpy as np
from torch.utils.data import Dataset
from mmdet.core import eval_map, eval_recalls
from .builder import DATASETS
from .pipelines import Compose
@DATASETS.register_module()
class CustomDataset(Dataset):
"""Custom dataset for detection.
The annotation form... |
ee7e3adc1c0ccfa00041fa19021b45e5edea1fbcfabaa91367b8dcebc3f45fb2 | Python | 11,206 | 260 | #!/usr/bin/env python
# Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""Offline, server-free tests for lens_math_reference.py.
Run with:
pyte... |
9da8412b3dd78e3f5f5d2a6d7daaf4a21ac1ff51689ec84cf20ecd177029276c | Python | 11,207 | 267 | # Copyright 2020-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
4bd844f9f8cbdc80cd5e092e7e625f047cf71c15c8a2e9e232982dd727f42e55 | Python | 11,209 | 326 | """Functions to calculate static properties of time series data."""
import logging
from typing import Callable, List, Optional, Union
import numpy as np
from sklearn.covariance import LedoitWolf
from osl_dynamics.analysis import spectral
from osl_dynamics.utils import array_ops
from osl_dynamics.utils.progress impor... |
42d5b502ca498b27c2a151dfa0454bd41281e791f090f3fbfc64c5f732aba985 | Python | 11,212 | 317 | import os
from abc import ABC, abstractmethod
import numpy as np
import pandas as pd
from drugex.logs import logger
from drugex.parallel.interfaces import ResultCollector
class DataSplitter(ABC):
"""
Splits input data into multiple parts.
"""
@abstractmethod
def __call__(self, data):
"""... |
e36ae22d12eddc1e094c376b023c58d54d3fdc5a6140183d41f9ac710e0f23a3 | Python | 11,212 | 317 | from builtins import next
from builtins import object
# Unit tests for sima/sequence.py
# Tests follow conventions for NumPy/SciPy avialble at
# https://github.com/numpy/numpy/blob/master/doc/TESTS.rst.txt
# use assert_() and related functions over the built in assert to ensure tests
# run properly, regaurdless of how... |
447b628458f6a5251fdc21df94a5e9c9eb6d01acdf2aac2c459762443def4da2 | Python | 11,215 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
d6e03c75739bfe038446d5f0bb7b5544283d139a8e667fc8f5abe539a0bac158 | Python | 11,215 | 264 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
526f51ddaa486884093290b9e296821357c94bc2f7dc7d2d859439470f0cc0f2 | Python | 11,216 | 270 | import logging
import unittest
from oaklib.datamodels import obograph
from oaklib.datamodels.search import SearchConfiguration
from oaklib.datamodels.search_datamodel import SearchTermSyntax, SearchProperty
from oaklib.implementations import ProntoImplementation
from oaklib.resource import OntologyResource
from oaklib... |
805a87d8239dc4f9199984ddd9acbf36d1f8fbf3860c386f06a35a363ce12d19 | Python | 11,221 | 270 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Module containing useful functions for training with PyTorch.
Created on Mon Oct 22 13:54:19 2018
@author: nicolas
"""
import os, time, tempfile, shutil, copy
import numpy as np
import matplotlib.pyplot as plt
import torch
def train(model, dataloaders, loss_fn, op... |
7eb12ffe38a29aaef0ff15ccc6c28f823588f96fa3730f636ea4fd3a3a089664 | Python | 11,224 | 209 | import time
import argparse
import torch
import os
import models
from util import util
class BasicParams:
"""
This class define the console parameters
"""
def __init__(self):
"""
Reset the class. Indicates the class hasn't been initialized
"""
self.initialized = False
... |
f2cdf92dff35779dc765818e18c5d63fbb108bfedaad53c7210421205bf5bd74 | Python | 11,225 | 281 | #!/usr/bin/env python3
"""
File: create_correlation_heatmap.py
Created: 2021/12/08
Last Changed:
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
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 Soft... |
84f22f64a1189931fa53dba402fcc161211814275c5bd025c4f4b9b7b24d5655 | Python | 11,235 | 315 | import math
import torch
import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.cnn import build_conv_layer, build_norm_layer
from ..builder import BACKBONES
from .resnet import Bottleneck as _Bottleneck
from .resnet import ResNet
class Bottle2neck(_Bottleneck):
expansion = 4
def __init__(self... |
2595a0aa4f3548b540003592c0ec7eef77497b64e461b0107ded310715aa13a3 | Python | 11,236 | 312 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ i... |
d990e2cdb04ac8e7faa4252e359cca6eee5b0694e98a1fa615010ac953cc3c10 | Python | 11,238 | 350 | #%% Load
from operator import itemgetter
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from graspy.plot import gridplot, heatmap
from mpl_toolkits.axes_grid1 import make_axes_locatable
from src.data import load_networkx
from src.utils import meta_to... |
dc759314f5ad278ab8e7553bce64628e4869c7190473d51ed8893bfbe0848d53 | Python | 11,242 | 391 | from gratin.models.main_net import MainNet
from gratin.data.datamodule import DataModule
import pytorch_lightning as pl
from gratin.models.utils import get_predictions_of_dl
from gratin.training.callbacks import Plotter
import matplotlib.pyplot as plt
from pytorch_lightning.callbacks import (
EarlyStopping,
Lea... |
f443a455875bdab040ee7f4c0f29c1afc16d0f4034c7f356c783ce7a17a88945 | Python | 11,245 | 290 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import tensorflow as tf
from tflib.utils import session
import random
def batch_dataset(dataset, batch_size, prefetch_batch=2, drop_remainder=True, filter=None,
... |
c7f6326916896b3e26fe968885c92e4c996e6641e41c79d771de3d70da626404 | Python | 11,248 | 315 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.nn.modules.utils import _pair, _single
from mmcv.utils import deprecated_api_warning
from ..cnn import CONV_LAYERS
from ..utils import e... |
dadd8f83923e581e109678ca2061616ac9e8c6c6fe04f5f140229d812a2d02a4 | Python | 11,251 | 253 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
f4a0e9f74e91c8e6a1220efdd24760100afc5dcecc8116b3933462e5f0e4533a | Python | 11,253 | 321 | from pathlib import Path
from timeit import default_timer
from typing import List, Union
import numpy as np
# import open3d for io if built. Otherwise,
# the class will build, but no files will be loaded.
try:
import open3d as o3d
o3d_warn = False
except ModuleNotFoundError:
o3d_warn = True
import torch... |
e6c32df708dbefd85b0e21eeb43a6ef4b0102fea0811ae85a18227046fee323b | Python | 11,254 | 258 | import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import scipy.spatial as scsp
#not used - this was for finding the closest point to the click
def do_kdtree(combined_x_y_arrays, points):
mytree = scsp.cKDTree(combined_x_y_arrays)
return mytree.query(points)
def coordinatesMat(tw... |
ef3237c394e23a2055bc038dc9bc5b3c0f2e877b42f79bd5a2d8beef7a287dd0 | Python | 11,255 | 270 | #%%
from pymaid_creds import url, name, password, token
import pymaid
rm = pymaid.CatmaidInstance(url, token, name, password)
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
import numpy.random as random
import gzip
import csv
import connectome_tools.process_matrix as pm... |
50254d41f49ea0b03e1fe91f46ab8433f67b07518ffcd9fd8b8d964b3244f3cf | Python | 11,263 | 282 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
de2c7642c1ce264b891dfee257018fde15ce763d29b6023c4d914ed85496f3c3 | Python | 11,264 | 281 | """
Plot main sound localization figures
For each subject, show:
- Bilateral cooling results as:
- Bubble plots of response counts (normalized for total trial count) for each stimulus and response location, for control and bilateral cooling
- Bar charts of performance (% correct) during contr... |
423d75f10ae9b577b687bc546c2f7ad8d357a2db9ec3b9f425f25cdd582b49e8 | Python | 11,276 | 303 | from visualize import plot
from models.lstm import basic_lstm
from models.lstm_ae import lstm_autoencoder
from models import lstm_vae, cnn_vae
from process.evaluate import *
from process.embed_gen import EmbedGen
from process.dataloader import Data
from config.config import *
from util.util import *
from tensorflow.ker... |
8a5f430e710f0531f27a99c8b255185c887b55aff7576b50c26018ee1c3495ef | Python | 11,280 | 366 | #%% Imports and file loading
from pathlib import Path
import glob
import json
from os import listdir
from operator import itemgetter
import pandas as pd
import networkx as nx
import numpy as np
from graspy.plot import gridplot
from src.data import load_networkx
# File locations
base_path = Path("./maggot_models/data/... |
42e1cb9de075fcb17d53fbf44f2bf116c2d6c11b894fa6cb0870201ff3dc4b34 | Python | 11,282 | 251 | from dash import Patch
from dash_extensions.enrich import Serverside, Output, Input, State, callback, clientside_callback, ctx, no_update
from dash.exceptions import PreventUpdate
import RV.constants as c
from RV.callbacks.utils.bad_channels_utils import bad_channel_disagrees
def register_bad_channel_callbacks():
... |
8248402c60d65d332b839bcf43446bee57022d1708ccfbb48cdf7722eeaf6b2a | Python | 11,282 | 308 | import numpy as np
from copy import deepcopy
def mean(X, n_replications, seed=None):
"""Simulate the posterior distribution of the mean.
Parameter X: The observed data (array like)
Parameter n_replications: The number of bootstrap replications to perform (positive integer)
Parameter seed: Seed for ... |
a3a09120483b74d137bdce152a2f7fd6e16720dd045124e03363ce246a9b23bc | Python | 11,287 | 296 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import math
from ..builder import LOSSES
from .utils import weight_reduce_loss
def cross_entropy(pred,
label,
weight=None,
reduction='mean',
avg_factor=None,
... |
28a35ed568f7aeec460757bf709e7e811d3a1105327c651efd616c7bfc6b95eb | Python | 11,289 | 380 | import numpy as np
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import sys
from itertools import groupby
from multiprocessing import Pool
import os
import pickle
from pandas import DataFrame
import pandas as pd
import csv
import utils.general_utils as general_utils
import utils.sync_utils as sync_utils
i... |
51bf4c189ebe6a2041f9186b4e33377ce549462b1afa9a1301b1639a670f1410 | Python | 11,289 | 260 | """The persisted-path layer.
These guard the properties a new user depends on: a path recorded once survives
the session, an exported variable still wins, and the config beats a search list
so that a machine with several CARLA checkouts cannot silently get the wrong one.
"""
from __future__ import annotations
import ... |
dd7bc4cf987904fef9f95b70ae705382b75a7ae326dd7c05a815e83b85d61566 | Python | 11,296 | 356 | import os
import os.path as op
import numpy as np
import nibabel as nib
from dipy.reconst import dki
from dipy.reconst import dki_micro
from dipy.core.ndindex import ndindex
import AFQ.utils.models as ut
__all__ = ["fit_dki", "predict"]
def _fit(gtab, data, mask=None):
dkimodel = dki.DiffusionKurtosisModel(g... |
8f62b09c12d246ff7f7ab3dcd2b28dd0555ab4cfbbb68b72f8a894d7a3583c78 | Python | 11,308 | 267 | # Copyright 2020-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
ae91d7d4aa4239124fcb3bce44ea63ec9c68e6c21c0f7251d7a6337d71d8a8d3 | Python | 11,309 | 266 | ####################################################################################################
# Copyright (c) 2019 - 2023, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis>
#
# This program is free ... |
1afcb65a771ba5624b31f08cc02ae72a084f5490157aae31edaa2f773bb84206 | Python | 11,313 | 261 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
3a9ddc6e967377a6f41c2e16723fb1ba6575b3f86649a216b5bf11d0c6c014e4 | Python | 11,315 | 311 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
8f246990d97bb3f223a4923d75fad5457903e247bda8b27928473138e1d4921b | Python | 11,315 | 259 | #!/usr/bin/env python3
"""
File: print_mr_and_decon_table.py
Created: 2021/02/16
Last Changed:
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
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 Softwa... |
3e6fcca26b7e132838b7324cfb4bed99ae1d0d884d9f6c10e2932965313b54f2 | Python | 11,317 | 327 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
3506256b26504f708be08da816f1fceb61bf0dccc3f05619a1dbbb224bfab55e | Python | 11,325 | 318 | import urllib.request
import numpy as np
import time
import os
import sys
from os.path import dirname, realpath, join
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import pickle
import shutil
import requests
from .atlas_loader import process_atlas_raw_data
from .obj_items import r... |
522ec5f00b87586f526d135ac69cd76741849f639965f14292601154b52d72c5 | Python | 11,329 | 320 | import os.path as osp
import warnings
import mmcv
import numpy as np
from torch.utils.data import Dataset
from mmdet.core import eval_map, eval_recalls
from .builder import DATASETS
from .pipelines import Compose
@DATASETS.register_module()
class CustomDataset(Dataset):
"""Custom dataset for detection.
The... |
f5367097452f8c2b4147e109e0248e559e86c1e7acb2d7a2f2d88fc07b56065a | Python | 11,329 | 294 | import numpy as np
import nrrd
import torch
import os
import re
import time
import csv
import sys
from natsort import natsorted, ns
from openpyxl import Workbook, load_workbook
import utils
from os.path import join
"""
Returns:
PSMA/PET file paths as python3 list,
prostate contour file paths as python3 list,
Cancer in... |
fdacae4f793e05a1208d4d90f5842ca33805c27cbd2f5309396f293c905d4459 | Python | 11,341 | 328 | import numpy as np
from IPython.core.debugger import set_trace
import copy
from Bio.PDB import *
import os
from geometry.open3d_import import *
def compute_nn_score(
target_ckdtree,
target_patch,
source_patch,
target_descs,
source_patch_descs,
nn_model):
# Compute the score of the neural n... |
980a6101cde3b98cf0ddb6841aa07ca43a4633c0b206fc003a550fb0b9338215 | Python | 11,352 | 327 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import io
import json
import os
import shutil
import numpy as np
import tensorflow as tf
from PIL import Image
from tflib.data import tfrecord
__metaclass__ = type
_ALLOWED_TYPES = tfrecord._DECODERS.keys(... |
c7afecb96f3c6c22a120b258a43d075357a499e565d32dbd1c46bc853129fd35 | Python | 11,353 | 434 | #%% [markdown]
# # Layouts for an auditory connectome
#%%
import datetime
import time
from pathlib import Path
from adjustText import adjust_text
from graspologic import partition
import matplotlib.pyplot as plt
import colorcet as cc
import h5py
from networkx.generators import directed
import numpy as np
from numpy.lib... |
f8759431392672839af4d6a068e4edd6083588f0830d08608665c01946126543 | Python | 11,354 | 307 | import sys
import time
import torch
import random
import argparse
import numpy as np
from model import *
from utilities_gru import *
from torch_geometric.data import Data, DataLoader
def run():
# Parser options
parser = argparse.ArgumentParser()
parser.add_argument('--Nx', type=int, default=13)
parser.... |
b24b16cb01dca8befc01a7c02a7fd657dbf6207bd75bc2bedc0d74895a081fd3 | Python | 11,360 | 278 | """Implementation of optimization based attack,
CW Attack for cluster adding.
Based on CVPR'19: Generating 3D Adversarial Point Clouds.
"""
import pdb
import copy
import time
import torch
import torch.optim as optim
import torch.nn.functional as F
import numpy as np
from sklearn.cluster import DBSCAN
def get_cr... |
e1de8b000ddfe519a8ad7756d4848a3dce6e93905746f36c0c7452672ef25a3b | Python | 11,360 | 230 | import numpy as np
import matplotlib.pyplot as plt
import os
import json
from pygenn import genn_wrapper
from pygenn.genn_model import GeNNModel, init_connectivity, init_var
from OR import or_model
from synapse import pass_or, pass_postsyn, ors_orns_connect, orns_al_connect, pns_lns_connect, lns_pns_conn_init, lns_ln... |
8ed96f15f6efabafe03e31d92cbcbeab94f5097c1a6605149814aea300cf36e2 | Python | 11,363 | 259 | """
Copyright 2020 - by Jerome Tubiana (jertubiana@gmail.com)
All rights reserved
Permission is granted for anyone to copy, use, or modify this
software for any uncommercial purposes, provided this copyright
notice is retained, and note is made of any changes that have
been made. This softwar... |
fef586c6881a2c9486319d31d7914fe4db963cbbdac4309161982ef39780bd81 | Python | 11,369 | 250 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
b30efcd295bf254680e1e4e1dd479d5b8a1bc0f4e262472bf590e96db1388a25 | Python | 11,370 | 288 | # -*- coding: utf-8 -*-
from six.moves import xrange
from .core import *
from .. import _logging as logging
import tensorflow as tf
import numpy as np
__all__ = [
'transformer',
'batch_transformer',
'SpatialTransformer2dAffineLayer',
]
def transformer(U, theta, out_size, name='SpatialTransformer2dAffine... |
ea12071e619b4476f3566621dda32d6f07ef8b1e9ffc12d47ea464a2a37cd51b | Python | 11,371 | 266 | """The Node and Python servers must answer alike.
Two implementations of one protocol drift silently, and the symptom is one
server calling a skill available while the other says it is not. So run both over real stdio against the same skills and the same config, and diff
what comes back.
Skipped when no `node` is on ... |
0932531e13ddc68296e29fdddc4b2c8a967e7d1cdd5c666ea86326f709f610ac | Python | 11,373 | 268 | import sys, re, os
# usage: python createLEMS.py ChannelFile.nml Na/Kv/Cav/Kca/Ih integrationDtInMs
path = sys.argv[1]
channelClass = sys.argv[2]
DirName = os.path.dirname(os.path.abspath(path))
FileName = os.path.basename(path)
# want to perform each sub-protocol separatelly @ each concentration level
# need to cr... |
2da274244bff3384c68495e6e57cb31d2fea64ca67374cde7eda303f51b1299b | Python | 11,375 | 340 | import argparse
import logging
import warnings
import os
warnings.filterwarnings("ignore")
warnings.simplefilter("ignore")
import h5py
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
plt.rcParams.update({"font.size": 12})
import seaborn as sns
try:
from nlb_tools import make_tensors, nwb_... |
f4824a77ab2506fa146b462edd80861b10e250f6547e3f4df9d9a3744434fb3d | Python | 11,378 | 274 | #!/usr/bin/env python
# Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""A/B check: sensor.camera.wide_angle (cubemap resample, exact-distortion
re... |
bc577797ee64ee095a6edf0f22711780f74c7bd0dd3242667148d14dbfc9801b | Python | 11,380 | 241 | """
Set of standardized tests for the clustering function of RACCOON
F. Comitani @2020-2022
"""
import raccoon
def grid_test(data, labels=None, gpu=False):
""" Clustering test, euclidean grid, with checkpoints.
Args:
data (pandas dataframe, matrix): input test dataframe.
labels... |
2361ae6cb02e870dcf53c4ffeb652de5c321e8c6d282af784f28b2e42f97f494 | Python | 11,381 | 358 | """
.. _fourier_diff :
Fourier Differentiation
======================
This tutorial demonstrates Fourier-based differentiation methods for computing
derivatives of periodic functions. Fourier differentiation is crucial for:
- Computing derivatives of functions with spectral accuracy
- Implementing physics-informed l... |
7bf30c6b4c3555a4b6c942796e0a5451999bea237ffe3bd3ef84656236e385f3 | Python | 11,383 | 370 | import gzip
import os
import os.path
import shutil
import zipfile
from copy import deepcopy
from pathlib import Path
import gdown
import numpy as np
import pandas as pd
from scipy.stats import truncnorm
from sklearn.model_selection import GroupShuffleSplit
import spikebench.transforms as transforms
from spikebench.da... |
f4b48bfa9688ec97f62e029cc5b824c1dcb18c55b5b83f02f83fe49eca58dfe8 | Python | 11,388 | 356 | import sys
import os
import itertools
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import scipy.optimize as spopt
import scipy.integrate as spi
import scipy.stats as sps
import tensorflow as tf
import pandas as pd
import ndsvae as ndsv
import util
def init_points(m... |
ad56bd166b290619831458c4780173f9f96d382603d5b9f0e1978a7ffaa3fa96 | Python | 11,389 | 180 | import sys
import os
root=os.path.abspath("../../")+'/'
MCFO_data_dir=root+'Ascending_Project_public/04_mcfo_traced_singleAN_exp/'
VNC_neurites_filelist=[
##Walk
MCFO_data_dir+'MCFO/JRC_SS29579/JRC_SS29579_20180713_22_A2__REG_UNISEX_20x_HR_m_Brain-RG/JRC_SS29579_20180713_22_A2__REG_UNISEX_VNC_m_VNC-yellowExtractfi... |
7ce5e4bc4f6a0f6f26022ae20c61ace72931b9a173dd5cdacb50708bf87e2eef | Python | 11,390 | 268 | import sys, re, os
# usage: python createLEMS.py ChannelFile.nml Na/Kv/Cav/Kca/Ih integrationDtInMs
path = sys.argv[1]
channelClass = sys.argv[2]
DirName = os.path.dirname(os.path.abspath(path))
FileName = os.path.basename(path)
# want to perform each sub-protocol separatelly @ each concentration level
# need to cr... |
8b8a0724b7e3537ce0c45d8a5f3abd9047668d3183a349fcae79f68827cbaed5 | Python | 11,399 | 315 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models
try:
from torchvision.models.utils import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url
# Inception weights ported to Pytorch from
# http://do... |
aecdedda5e4d506a7eeead9dd6c43ab11bcd7accde58c90e836acee914962ebf | Python | 11,412 | 392 | #%%
import datetime
import os
import time
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from giskard.plot import matched_stripplot
from numba import jit
from scipy.optimize import linear_sum_assignment
from src.data import load_maggot_graph
from... |
8d72b52a0c43b6cc3c6d726040484f86ef6046b6016e0972fefb26b2f55c71f6 | Python | 11,422 | 272 | import os
import numpy as np
import sys
import time
import torch
import torch.nn.functional as F
from torchvision import transforms
from torch.optim.lr_scheduler import ReduceLROnPlateau
import torch.nn.init as init
from model.generative_network import Generator
from torch.autograd.variable import Variable
from model.... |
94737a013f9d97dae6967ed2b40dc2be4444ea7bccf1b91dbf37a23de6eba003 | Python | 11,422 | 259 | """Process input data to make merged CSVs with all data."""
import os
import string
from dmslogo.utils import AxLimSetter
import pandas as pd
import ruamel.yaml
def valid_year(year):
"""Return `True` if and only if valid year betweeen 2000 and 2030."""
if not isinstance(year, int):
raise ValueErr... |
2a73e75089a49adfccb39345bf4b9dbf45efddc1a62280ec54b55e2b4ba42d2e | Python | 11,435 | 224 | """Transfer 2.5 worker with the fake engine (CPU): job -> InferenceArguments mapping, outputs, guardrail block."""
import asyncio
import json
import subprocess
import sys
import time
import pytest
from carla_cosmos_server.config import default_run_dir
from cosmos_workers.common import protocol
from cosmos_workers.co... |
158676c5f1fd5c5a74f2fe8883b1e613b7e760c38bce2c66c556a6b042ef9997 | Python | 11,444 | 313 | from unicodedata import category
import pandas as pd
from pandas.api.types import is_numeric_dtype
import numpy as np
import pickle
import category_encoders as ce
import os
import sklearn
from typing import List, Dict
from copy import deepcopy
import tensorflow as tf
from tensorflow import keras
import math... |
fecac3a7731147eafd9c154cb4ec9fbd984c0ef172b1de8f81d520e5fd82724f | Python | 11,449 | 244 | import numpy as np
import pickle
import sys
import seaborn as sns
import pandas as pd
# import pkg_resources
# pkg_resources.require("scanpy==1.3")
import scanpy as sc
print(sc.__version__)
import os
import scipy.stats
import scipy.sparse
import matplotlib.pyplot as plt
import sklearn.preprocessing
from sklearn.metrics... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.