sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
965532b851736e3e23541a20f72b81ca5ad5c3c304ce7032afec16c1d4a504f4 | Python | 21,921 | 558 | """
New-style HDF5 trajectories
===========================
The purpose of the HDF5 reporter
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There are several reasons for migrating to the new HDF5 storage format:
* Saving each conformation as individual file is producing too many files
* Using pickle-based approaches (joblib) mak... |
c76223e88073ef1d2e654ea4238b22b26142a858b3172cde7b5e74b0f9feca29 | Python | 21,936 | 439 | import numpy as np
import pandas as pd
import h5py
from numpy.lib.arraysetops import isin
from scipy.special import erf
from scipy.special import erf
from scipy.signal import find_peaks, convolve
from math import floor, ceil
import time
import matplotlib.pyplot as plt
import multiprocessing as mp
#===================... |
f6b9f32cada20c66622105a4807c7cdc7d43ec36fc3545f2abb98f067a75fc5d | Python | 21,939 | 573 | import torch.nn as nn
import torch
import matplotlib.pyplot as plt
import matplotlib.image as img
from matplotlib.gridspec import GridSpec
#from config import Config
from utils import *
from model import simpleNet
from loss import GeneratorLoss
from loss import GeneratorLoss3
from loss import NormalLoss
from loss imp... |
62db708aab2d59be581bc0428e39f92f7419f0967d68fe2050deb3a38bccdcd5 | Python | 21,949 | 621 | """Some basic example datasets for testing."""
from distutils.version import LooseVersion
from itertools import product
import os
from pathlib import Path
import shutil
import string
import mne
from mne import minimum_norm as mn
import numpy as np
from .. import _info, load
from .._data_obj import Dataset, Factor, Va... |
b8e7d168880a61e119d12cd5030a090634ba960085bc82e423de6ca18ec90a82 | Python | 21,949 | 506 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Module containing useful functions/classes for data manipulation with PyTorch.
Created on Mon Oct 22 13:54:19 2018
@author: nicolas
"""
import os
import numpy as np
import scipy.ndimage as ndi
from skimage import measure
from torch.utils import data
from axoid.util... |
4e4edf24acb0879eeef86f433af5c9b5ebb2ee61ffe4ac026ba6d91ca2e68499 | Python | 21,974 | 585 | # 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... |
bca73837d96fc6ab1b5ae3e017dc5ffb5e9d0631d4832e8c0345f990a298be0a | Python | 21,977 | 672 | # This script is part of navis (http://www.github.com/schlegelp/navis).
# Copyright (C) 2018 Philipp Schlegel
#
# 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... |
61ebeb2b82460c16d41282165c23a2f51fd5a670d1b0bfc0a43e1ab5ad6b062c | Python | 21,978 | 610 | # This script is part of navis (http://www.github.com/schlegelp/navis).
# Copyright (C) 2017 Philipp Schlegel
#
# 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... |
46bb419d880e85588db5dbcf91ac544963e11a68ab0202be3e9b711416202a0d | Python | 21,982 | 627 | # -*- coding: utf-8 -*-
import tensorflow.keras as keras
from tensorflow.keras.models import load_model
from tensorflow.keras import backend as K
import unetsl.data
import unetsl.predict
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Conv3D, MaxPooling3D, UpSampling3D, Activation,... |
f6fede4522a4dc46e0f6395446c0ad8c86c5e2682edba1de1077bd18bf3386b9 | Python | 21,983 | 562 | #! /usr/bin/python
# -*- coding: utf8 -*-
import tensorflow as tf
import numbers
from tensorflow.python.framework import ops
from tensorflow.python.ops import standard_ops
## Cost Functions
def cross_entropy(output, target, name=None):
"""It is a softmax cross-entropy operation, returns the TensorFlow expressi... |
14ccac4d12d2098359fb31fcccb5f1eb445a484f5fc922eba471dae6555ca9ff | Python | 21,991 | 832 | """
Interactive application server.
Description:
"""
# Libraries
import os
import sys
import json
import numpy as np
import pandas as pd
# Flask
from flask import Flask
from flask import request
from flask import redirect
from flask import jsonify
from flask import render_template
from flask import send_from_direct... |
e2fb1d9b86f8b035a8ec1974a50ff82a0a6445bb143760ae3592e2923ca2f32f | Python | 22,008 | 520 | from model_config import VGG16, AlexNet, LeNet
import numpy as np
import copy
import os
import argparse
from power_sta import net_data, layer_data
import print_line
def delay_cpt(net_structure, stride, pooling_stride):
delay_list = [1]
k_idx = 1
p_idx = 0
max_delay = stride[0][1]
for i... |
65160024a600fa2f974aaf997e58334958dbf7250bc8275d9f166f3a97034aa8 | Python | 22,014 | 500 | import numpy as np
import os
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.unet import UnetN2Nv2
import random
import pandas as pd
#import matplotlib.pyplot as plt
impo... |
0e1eda5b591852f92e6a8119f05083d2cafb04c286f801163a331e0107ecc975 | Python | 22,035 | 573 | # %%
# significant portions below are from Ben Pedigo's script found here: https://github.com/neurodata/maggot_models/blob/052af5d5999b2ae689b9d4a8d398748858acfd3a/data/process_scripts/process_maggot_brain_connectome_2021-05-24.py
# parts of this script have been modified to make it more general
import json
import os
... |
ac2e6602de36e44395909f97f710fae480653b281a632ea534ef907b001ffedc | Python | 22,050 | 770 | # %% [markdown]
# ## The goal of this notebook:
# investigate regularization approaches, for now, just on the full graph
# these include
# - truncate high degree
# - truncate low degree
# - plus c
# - levina paper on row normalization
# - others?
# %% [markdown]
# ##
import os
import time
import wa... |
d76d1ef3061210dc4a8bc7cdb7834d2b831defc75a39a6c2e2de259a31276a3d | Python | 22,070 | 506 | # Copyright (c) # Copyright (c) 2018-2020 CVC.
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
This module implements an agent that roams around a track following random
waypoints and avoiding other vehicles. The agent also responds to traffic ... |
07e83d5f9fd8878b3f912f6d737d9c9d50d099188f88fef4d64e15bcb0bbb4cf | Python | 22,082 | 409 | import os, sys
import keras
currentdir = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(currentdir)
sys.path.append(parentdir) # PYTHON > 3.3 does not allow relative referencing
from datetime import datetime
from tensorflow.keras.callbacks import ModelCheckpoint, TensorBoard, EarlyStopping... |
ea1d7713300443f699568af417ac05308752d1a450e1da0432dd1d24c42401df | Python | 22,116 | 463 | ####################################################################################################
# Copyright (c) 2018 - 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 ... |
0dda42c811350260d190338224e145671d2d321ef5cbe67d0ac90c5f1fa60087 | Python | 22,124 | 441 | #!/usr/bin/env python3
"""
File: julienbryois2021_replication_plot3.py
Created: 2022/01/24
Last Changed: 2022/02/11
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 publish... |
286d2ac225c665c946cca023373e0f3e79948dc87996ec746dd640dafacf1430 | Python | 22,152 | 389 | from Lif_SpatialConfiguration import *
from ExternalFunctions import connecting_int, createWeightMatrix, connecting_3D
import random
seed(val)
# def conneting_population_l0(pop: NeuronGroup, exc: NeuronGroup, inh: NeuronGroup, p_max: float):
# """
# Connecting the single layer. Eliminates excessive connecti... |
ac7f3a3130d9b19a5e2bae1f7c6ba1f2b5584a8aa0d0a1c6ce9ba8099a57c3a0 | Python | 22,157 | 486 | # 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... |
dcf6f272a90be7cedc014785a358e6266aa81bfafdfebc8a67df4005356da10f | Python | 22,157 | 528 | # Copyright (c) 2019 Western Digital Corporation or its affiliates.
import warnings
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, normal_init
from mmcv.runner import force_fp32
from mmdet.core import (build_anchor_generator, build_assigner,
... |
73e14a9cd730f80232f942b992f7ab6a724bbacaf09959820769f73949c3b620 | Python | 22,180 | 527 | import operator
import numpy as np
from scipy._lib._util import check_random_state
from scipy.optimize import OptimizeResult, linear_sum_assignment
def _check_init_input(P0, n):
row_sum = np.sum(P0, axis=0)
col_sum = np.sum(P0, axis=1)
tol = 1e-3
msg = None
if P0.shape != (n, n):
msg = "`... |
31847b6e7e38f412391dfb61ba99444cc676364a9a0efe9a10f14c93b7bac810 | Python | 22,181 | 493 | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
import torch
import torch.nn as nn
from functools import partial
from timm.models.vision_transformer import Mlp, PatchEmbed , _cfg
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
from timm.models.registry import register_mo... |
43e4a25242b357b686d67c6031531c38f16b9a4b8853738ca9149752aa5bae37 | Python | 22,186 | 733 | # %% [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 scipy.stats import poisson
from graspy.embed import OmnibusEmbed, selectSVD
from graspy.models import DCSBMEstimator, SBMEstimator
from graspy.utils import (
au... |
31a41ca2129305f482a5e4304f98a2d0067691facbc399bd7cfc33ebddbce2e2 | Python | 22,197 | 426 | import os, sys
os.environ['CUDA_DEVICE_ORDER'] = "PCI_BUS_ID"
os.environ['CUDA_VISIBLE_DEVICES'] = "1" # Check availability before running using 'nvidia-smi'
currentdir = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(currentdir)
sys.path.append(parentdir)
import multiprocessing as mp
mp.set... |
fe7fccc4b05e0afab1cb75defe84dd0884701322254f1cd2dedc9f8a45e764cd | Python | 22,208 | 501 | #!/usr/bin/env python3
"""
File: visualise_permutation_interactions.py
Created: 2021/08/05
Last Changed: 2021/09/06
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 publish... |
c6ce93f410a0ad0fca1a69ee09eb358375f744184666da36efb4780f8c8ae941 | Python | 22,222 | 571 | ####################################################################################################
# Copyright (c) 2019, 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 softwar... |
7f68125ae25680a2479ad2c5e1bcafc314b0132e5ff564051d5870fb015a5c66 | Python | 22,229 | 531 | # 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>.
import carla
import unittest
import math
WGS84 = carla.GeoEllipsoid(a=6378137.0, f_inv=298.2572235... |
3c718ef9e8813fd5921263f7b504d1fc319965413fcdef5e71446da361f9375c | Python | 22,264 | 481 | #!/usr/bin/env python
# FAST-iCLIP
import os, cmath, math, sys, glob, subprocess, re, argparse, shutil, datetime, csv
from helper import *
import cfg
import numpy as np
import pandas as pd
from collections import defaultdict
from operator import itemgetter
import matplotlib as mpl
import matplotlib.pyplot as plt
from ... |
b086dfb23f6593f0a15d8d743b1c88fe6ffe5fa3ca40a61b4528607e1ed98592 | Python | 22,276 | 569 | from collections.abc import Iterator
from functools import reduce
from math import floor
from operator import mul
import numpy as np
import scipy.signal
from scipy.linalg import norm
from .. import _info
from .._data_obj import NDVar, Case, UTS, dataobj_repr, ascategorial, asndvar
from .._text import enumeration
from... |
99815ccc66e9e62d04223c6c36ee1a17ae721ce293b4ab6e878de1811d62de4b | Python | 22,285 | 537 | import os
import time
import logging
# Tensorflow
import tensorflow as tf
import tensorflow_probability as tfp
tf.compat.v1.disable_v2_behavior()
import numpy as np
import pandas as pd
from .layer import layer
from .layer import KL_divergence_normal
from .layer import create_variance
from .layer impor... |
ad7c94b26626e5eef1533a61d9899f0837cb332722dbb0a291588cbeaa33acc4 | Python | 22,295 | 796 | #%% Imports and file loading
import pprint
import sys
from pathlib import Path
import networkx as nx
import numpy as np
import pandas as pd
import pymaid
from src.data import load_networkx
from src.io import savecsv
from src.pymaid import start_instance
output_name = "2020-06-10"
output_path = Path(f"maggot_models/d... |
a3b85f4a43b41431151f0a5459aa27cd9266d98504ac9b37d91aed9312fa0c9c | Python | 22,320 | 518 | import tensorflow as tf
import numpy as np
class MaSIF_site:
"""
The neural network model.
"""
def count_number_parameters(self):
total_parameters = 0
for variable in tf.trainable_variables():
# shape is an array of tf.Dimension
shape = variable.get_shape()
... |
13627bddda27b7dbd360cfec2a7d063cc503732cf8db58b7629aa4336919893f | Python | 22,340 | 502 | import numpy as np
import pandas as pd
from scipy import stats
import networkx as nx
import matplotlib.pyplot as plt
import os, random
import pickle, json,itertools
import torch
from torch_geometric.data import Data
from torch_geometric.utils import train_test_split_edges
from torch_geometric.nn import Node2Vec
from sk... |
f0bcd66614f59968b515baa3cd15a0ac09d710a59840c8794a1a4a9fb75c4b6a | Python | 22,371 | 590 | # -*- coding: utf-8 -*-
from os import listdir, rmdir, remove
from os.path import isfile, join, exists
import logging
import time
import datetime as dt
import pandas as pd
import numpy as np
from PIL import Image
# local imports
from topological_bone_analysis import utils as ut
from topological_bone_analysis import p... |
81c41032e632321734caf01de3d5ef85410dc179a4ddd6b8aab4e2127fc32755 | Python | 22,403 | 570 | #!/usr/bin/env python
# A prototype of a stand-alone application for plotting the output of
# GENESIS 3 models. This uses a basic wxPython frame to hold a matplotlib
# figure for plotting. It defines some basic menu items, and a control
# panel of buttons and toggles, each with bindings to a function to execute... |
93cf4df12f21517986955e860f40a9ff933b0b836e227155d39e22aa890559df | Python | 22,421 | 603 | #!/usr/bin/env python3
"""
File: gtex_nnls_deconvolution.py
Created: 2020/06/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... |
6dfa73fe5527d965cc93e69d4fe55afdffbe0acc90161a5bef8aa2146617f869 | Python | 22,424 | 625 | # Copyright 2020-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 agre... |
72eece05a6a1c3084679c0a5bf6232eacd4fcdc4d0254410f6a378c65a649180 | Python | 22,459 | 862 | """
xTB wrapper functions
"""
import functools
import logging
import multiprocessing
import os
from collections import ChainMap
from collections.abc import Callable
from pathlib import Path
from typing import Any
import numpy as np
import rmsd # type: ignore[import-untyped]
from tqdm import tqdm # type: ignore[impo... |
7f6bde25332b2f1b572a2a2f59b2fdbd75c64fa95309f17b010b36cd75074b46 | Python | 22,492 | 669 | from __future__ import annotations
from typing import Any
import napari
from napari.layers import Image
from qtpy import QtCore
from qtpy.QtWidgets import (
QDialog,
QWidget,
QLabel,
QVBoxLayout,
QHBoxLayout,
QPushButton,
QSplitter,
QGroupBox,
QFileDialog,
QScrollArea,
QTabWi... |
875cf32c4502a485b0e83dcc80b14e215c814c3ec2928726463e3928d6705968 | Python | 22,519 | 430 | import json
import os, errno
import sys
import time
import shutil
import subprocess
from subprocess import Popen, PIPE
EXECUTABLE = 'hcbr_learning'
BUILD_FOLDER = '../build'
DATA_FOLDER = '../data'
KFOLD_SCRIPT = 'kfold_validation.py'
ACCURACY_ROW = 4
#METAOPTIMIZATION = '../tuning/hyperopt_wrapper.py'
#METAOPTIMIZAT... |
bf8a6af71b0383fc7e36e7743aea5d0638fdf6ff8b94dcb66c84fadbc0038f06 | Python | 22,540 | 629 | import os
import math
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.colors import Normalize
from matplotlib.gridspec import GridSpec
import seaborn as sns
import analysis.util as util
mpl.use('Agg')
# plt.style.use('ggplot') # 'seaborn-paper'
plt.st... |
7d9f2a2875178a88bf6a8b62a2383a79af1681c514cc6a11c079b8fd58ef411b | Python | 22,547 | 823 | # %% [markdown]
# ##
import os
import warnings
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import numpy as np
import pandas as pd
import seaborn as sns
from joblib import Parallel, delayed
from scipy.stats import poisson
from sklearn.exceptions import Convergence... |
7562e570d906a1e2559c8957de4c7342cc40e60121736106615ac8e40747b944 | Python | 22,560 | 635 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
"""Plot multidimensional uniform time series."""
import matplotlib as mpl
import numpy as np
from .._data_obj import Datalist
from .._names import INTERPOLATE_CHANNELS
from . import _base
from ._base import (
PlotType,
EelFigure, PlotData, LayerData, Lay... |
260918aa9b1337e4a10d328bd791fec880967c1dd017772e03f2bfc38fee04e9 | Python | 22,566 | 654 | import numpy as np
import scipy.signal
import matplotlib
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import sys
import pandas as pd
import os
import pickle
from multiprocessing import Pool
from itertools import repeat
import itertools
import utils.EventDetection_utils as EventDetection_utils
import util... |
d4f331ec40a4243cbfac2bb3f4e8163352909122050d6af490b00f42408f678c | Python | 22,574 | 640 | from json import dumps, loads
import logging
from os import path
import pandas as pd
import requests
import sys
from typing import Optional
from datetime import date
""" headers, in order, from template singleton report """
ALLOWED_FIELDS = [
"#position",
"ucsc_link",
"gnomad_link",
"ref",
"alt",
... |
5359a7e74a3f7b2cdc74191df826548cc02bf3471bf006d18829ef019801f16f | Python | 22,576 | 502 | #!/usr/bin/env python3
"""Import a pedestrian into CARLA on UE 5.8 as a spawnable walker.
import_walker.py donors what you can clone from
import_walker.py export --walker 0015 --out ~/w.fbx get a rig-conforming FBX
import_walker.py plan ~/w.fbx --name MyPed
impor... |
a47d3146e826c869672bfbfcc56454459cb9f7819dbfcf72c069d1d9054c143a | Python | 22,579 | 515 | # 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>.
from __future__ import print_function
import unittest
import glob
import os
import sys
import carla... |
e38b602eaa5f1a0e7b8fa6eb0cc31533aecd6411ef25baa314c9fff26a3e9bf9 | Python | 22,586 | 654 | import numpy as np
import scipy.signal
import matplotlib
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import sys
import pandas as pd
import os
import pickle
from multiprocessing import Pool
from itertools import repeat
import itertools
import utils.EventDetection_utils as EventDetection_utils
import util... |
5147fd7ecf1f494b52699b6399910745cb51360c8c75e6fb6e246c2787d667bd | Python | 22,614 | 566 | # 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... |
7bfbafb6c4d36a2ef0e4bc359c262dbb1c60ec920a4ea1de3fffc3cd54f657dd | Python | 22,615 | 637 | # Copyright 2020-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 agre... |
2a2009e6fd744ac17609a72f662e279a1373e4a5052ec77c9d3bb53be63439a2 | Python | 22,626 | 809 | # %% [markdown]
# ##
import os
import warnings
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import numpy as np
import pandas as pd
import seaborn as sns
from joblib import Parallel, delayed
from scipy.stats import poisson
from sklearn.exceptions import Convergence... |
dc4632e69087fe71e1f40c1547934bb44479963cbfbd38c77a7ae6631deccc34 | Python | 22,636 | 537 | #!/usr/bin/env python
# transcriptome_properties.py
# Calculate relevant properties of an input transcriptome (or subset thereof) specified in BED format
# Properties to calculate:
# GC content (done)
# length (done)
# exonct (done)
# optional (region-specific):
# - 5' UTR specific
# - structure at 5' end (for... |
ad9e8a1679eefcf3c255d63d684658a661cf7db6557cd5698fd55ac6ad9c942c | Python | 22,649 | 410 | # 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... |
837ad6d6b2b25ccc16bde7b8158636435ae2f72656d50b4fdd1c24b71dc0c147 | Python | 22,675 | 618 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 7 18:47:46 2021
@author: Fuyuki Asano
"""
import glob
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import sys
import os
from scipy import signal
import csv
import math
import statistics
import scipy
#mac
#pa... |
ddb6d645f8e4de94b3f5bffac2637a9839af26b8cea51d5ada126b4c1551b9ec | Python | 22,678 | 583 | #
# Copyright (c) 2018 Institute for Basic Science
#
# 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... |
d357d6a8daee81eca73f0541988f7dac498ad6c0e01e60982ac38c1be87279b9 | Python | 22,716 | 623 | import sys
import json
import csv
import time
import os
import io
import shutil
import threading
import logging
import cv2
#import multiprocessing_logging
import importlib
import multiprocessing as mp
import numpy as np
import slideflow as sf
from glob import glob
from os.path import join, isdir, exists, dirname
from... |
97e66fedfa3b37134215ddc49d625f0c9a62031e63bbd9885097da3bbce46503 | Python | 22,741 | 693 | # coding=utf-8
# Copyright 2020 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... |
b0c2308a844ad9cca183b67dec7b8ec0d190bb2b4a8eb8bbad1d8d14fe095c45 | Python | 22,751 | 548 | import itertools
import logging
import os.path as osp
import tempfile
import mmcv
import numpy as np
from mmcv.utils import print_log
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from terminaltables import AsciiTable
from mmdet.core import eval_recalls
from .builder import DATASETS
from... |
b37cf1fcc575142a98d2f5db9553cb757cae64f63adc568f01f51fdb875963d2 | Python | 22,754 | 814 | # %% [markdown]
# ##
import os
import warnings
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import numpy as np
import pandas as pd
import seaborn as sns
from joblib import Parallel, delayed
from scipy.stats import poisson
from sklearn.exceptions import Convergence... |
a40d491eb908b385ae87653f0aea9e8400bab3e51d10d30d3c886a802ae8a8ad | Python | 22,796 | 431 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
# Modifications Copyright 2018 Arman Cohan
#
# 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 Licens... |
65c9e2658dfefe22bea24b5821d8f9fb09c642ea84ae4aa4ae46d11fe1616a2b | Python | 22,803 | 551 | from functools import partial, partialmethod
from typing import Tuple, List, Union, Literal
Number = Union[float, int]
import torch
import torch.nn as nn
import torch.nn.functional as F
# Set warning filter to show each warning only once
import warnings
warnings.filterwarnings("once", category=UserWarning)
from .... |
018bf310e32aa847f24bd1189e78e8bb7c8bb61c46b23ce4af73afc3541f037f | Python | 22,804 | 874 | """
Interactive application server.
Description:
"""
# Libraries
import os
import sys
import json
import numpy as np
import pandas as pd
# Flask
from flask import Flask
from flask import request
from flask import redirect
from flask import jsonify
from flask import render_template
from flask import send_from_direct... |
7546710e50ccd8e1303ea654f33528a4c82961226ebab7e122d267cef39e0333 | Python | 22,867 | 585 | ####################################################################################################
# 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 ... |
32d2f73905a193ccfddfec2836764f00a4f2d6a736f69dbf44770c476431822a | Python | 22,880 | 388 | from Lif_SpatialConfiguration import *
from ExternalFunctions import connecting_int, createWeightMatrix, connecting_3D
import random
seed(val)
def conneting_population(pop: NeuronGroup, exc: NeuronGroup, inh: NeuronGroup, p_max: float):
"""
Connecting the single layer. Eliminates excessive connections
... |
da8eecac47d7a0a80635adcdb52ee36df5e7a8732659ec54ae8fa1ccdbcadb19 | Python | 22,888 | 697 | """Functions related to TensorFlow datasets.
Two routes produce the same batched dataset of dictionaries (keyed by model
input name):
- In memory / memory maps: :func:`sequence_index` lists every sequence as a
(session, start) pair, :func:`make_slice_fn` cuts a sequence out of the
arrays with numpy and :func:`dat... |
ca84eb98add3ffb01730cd4cbc504ed232b6a11254f1a96e68856ac0680df719 | Python | 22,896 | 603 | r"""
Building contact maps
=====================
This module is the main workhorse of tools to calculate contactmaps, both from polymer simulations and from other
simulations (e.g. 1D simulations of loop extrusion). All of the functions here are designed to be parallelized,
and lots of efforts were put into making th... |
2800217a1441b179695c7e4d16f79d00bac6218e45d82e01eeb9436fcac6c41c | Python | 22,906 | 563 | #%%
import numpy as np
import operator
from scipy.optimize import linear_sum_assignment, OptimizeResult
from scipy.optimize import quadratic_assignment
from scipy._lib._util import check_random_state
from scipy.stats import *
import itertools
from ot import sinkhorn
def quadratic_assignment_ls(A, B, method="faq", opt... |
25b08d8cd77f74778c1c971a39664705e493831cbb835fa0915b5380b2116ffa | Python | 22,929 | 651 | ## System
import os
import gc
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # no debugging from TF
os.environ['TF_CPP_MIN_VLOG_LEVEL'] = '3'
import time
import copy
## sklearn
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
## Maths
import math
import numpy as np
import pandas as pd
import logg... |
ea6f05b220edb0bfde725bf01a84b7ec505cd869c05209f400ec47376cdb5738 | Python | 22,945 | 424 | # Copyright (c) 2016, Konstantinos Kamnitsas
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the BSD license. See the accompanying LICENSE file
# or read the terms at https://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_im... |
51df2377dee4b94fe0c53006deb07808763efa3cbdcf383bc4b6b7d263b24fbb | Python | 22,959 | 610 | """Fluent builder for CROPro pipeline configuration.
``PipelineConfig`` is the easiest way to define a full CROPro pipeline in
pure Python. It covers the same settings as a TOML schema file — dataset
paths, naming suffixes, crop options, split ratios, pipeline flags, and
clinical metadata — but lets you set them with... |
8d9e68f2d555866cb304bbeb6a3b1c1e016e61429dd4940fb558b2a25a26cd4a | Python | 23,067 | 531 | import torch
import numpy as np
import networkx as nx
import matplotlib
import matplotlib.pyplot as plt
from collections import Iterable
from torch_geometric.utils import to_networkx, remove_self_loops, remove_isolated_nodes
from torch_geometric.utils.num_nodes import maybe_num_nodes
from torch_geometric.data import Da... |
608c64fbb7577d196c6cedb43add19b55f5228e2a5e29e979f320a81d9cab307 | Python | 23,076 | 562 | # 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... |
87ad68b8dc59be0464bda29dc682891d5979ee694851d0df23bc03f2b8283ebb | Python | 23,106 | 489 | # Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
import argparse
import datetime
import numpy as np
import time
import torch
import torch.backends.cudnn as cudnn
import json
from pathlib import Path
from timm.data import Mixup
from timm.models import create_model
from timm.loss import LabelSmoothin... |
425034d4eb4763e8f68492500275c26e22f3be01494a9a3049969bd2a365aef3 | Python | 23,112 | 639 | from collections import OrderedDict
import os.path as op
import logging
import numpy as np
import imageio as io
from PIL import Image, ImageChops
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.transforms as mtransforms
import nibabel as nib
import dipy.tracking.streamlinespee... |
d837baf61855fcf5e2c6c42ba4e194d832d5de2f8b86676d5110f12a4d3f7d37 | Python | 23,137 | 447 | import argparse, time, datetime, shutil
import sys, os, glob, json, re
import warnings
warnings.filterwarnings("ignore")
import numpy as np
import torch
from torch.utils.tensorboard import SummaryWriter
import nltk
nltk.download('punkt')
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics impo... |
73517f99e85a70fa77030d773b48ddc5959be81818f1b6116a623626b7a7e41a | Python | 23,143 | 791 | # %% [markdown]
# ##
import os
import warnings
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import numpy as np
import pandas as pd
import seaborn as sns
from joblib import Parallel, delayed
from sklearn.manifold import MDS, TSNE, Isomap
from sklearn.metrics import... |
b872bf581ac8c8a3c08823633155fc7d4bef76c94f7bdb5d95241625a40b0ac4 | Python | 23,151 | 676 | #%%
import os
import sys
try:
os.chdir('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
print(os.getcwd())
except:
pass
# %%
import sys
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/maggot_models/')
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
fr... |
cb714ddec4bcea2bd54eb205032f06297e8b5819e9ff12166c2e3bd79c348d7f | Python | 23,170 | 605 | #!/usr/bin/env python3
from __future__ import print_function
import os
import pysam
import numpy as np
import math
import sys
from scipy import stats
from collections import defaultdict
import pickle,os
def _initt(terminating_,_consensus_bamFile,_consensus_args):
global terminating
global consensus_args
global cons... |
53394678d11445e6bb1a134cdbcb5dbed94082704f26866173021c2fb31d39f2 | Python | 23,173 | 559 | from pathlib import Path
import random
from typing import List, Union
import pickle
import numpy as np
import torch
from torch.utils.data import DataLoader
from .dict_dataset import DictDataset
from ..transforms.data_processors import DefaultDataProcessor
from .web_utils import download_from_zenodo_record
path = Pa... |
b3581edcc19d8450dc8593df0ad4326f0c3bdd5d9ccec6f2fabfced80539ba2d | Python | 23,183 | 556 | #!/usr/bin/env python3
"""
File: check_shuffle.py
Created: 2021/07/28
Last Changed: 2021/09/07
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... |
4f5475007f8ef6b08a92bf753fcaf7b028a2551c6ad072f7e1dc8822a9adf423 | Python | 23,214 | 592 | import logging
import unittest
from copy import deepcopy
from kgcl_schema.datamodel import kgcl
from oaklib import get_adapter
from oaklib.datamodels import obograph
from oaklib.datamodels.search import SearchConfiguration
from oaklib.datamodels.search_datamodel import SearchProperty, SearchTermSyntax
from oaklib.dat... |
16ea1cd1ba41358066a38cfbd26b4d1c63556a5b0e95748b5b06d18c6d4adcca | Python | 23,222 | 815 | #!/usr/bin/env python
"""
findSpots.py -- detect spots in 2D images
"""
# Numeric
import numpy as np
# Real-valued FFT
from numpy.fft import rfft2, irfft2, fftshift
# Image processing / filtering
from scipy import ndimage as ndi
# Caching
from functools import lru_cache
# Custom utilities
from .helper import (
... |
b4e7f3731cbbd8680b309cd821ebbce8776f1e9e8979afeaf85288510d61d4ea | Python | 23,223 | 767 | """
A simple OBO Format parser.
This implements a "delayed parsing" strategy for OBO. The OBO file is treated as a loosely
specified toml-like structure, consisting of stanzas of tag-val pairs.
The precise parsing of each tag-val pair is delayed until precise semantics are required
"""
import logging
import re
from ... |
dc1bf9f9f58c0e35e791189eb364ca7794897db091489f5104f58577d0dac3eb | Python | 23,292 | 534 | import torch
import numpy as np
import networkx as nx
import matplotlib
import matplotlib.pyplot as plt
from collections import Iterable
from torch_geometric.utils import to_networkx, remove_self_loops, remove_isolated_nodes
from torch_geometric.utils.num_nodes import maybe_num_nodes
from torch_geometric.data import Da... |
4fbd7aaabdb3d005dcfe7889f38f1b757273bd2a91a8c902685b16acc6fef973 | Python | 23,325 | 494 | #%%
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from pymaid_creds import url, name, password, token
import pymaid
from contools import Celltype, Celltype_Analyzer, Promat, Analyze_Nx_G, Analyze_Cluster
from data_settings import data_date, pairs_path
import networkx as ... |
96742d98a6be1ebbb9b706e353b1de8af2663069336fc1e7c0b8d3af7dcf9bd0 | Python | 23,340 | 515 | """
This benchmark compares the performance of different models in
predicting tissue based on gene expression
"""
import argparse
import copy
import json
import os
from typing import Tuple
import numpy as np
import optuna
import pandas as pd
import sklearn.metrics
import torch
import yaml
from sklearn.preprocessing im... |
8ae55298bc38ab62fd506180642a58c1af6146ab9097e0d59c40492305461ca5 | Python | 23,348 | 825 | # %% [markdown]
# # EDA on full brain Drosophila larva connectome
# %% [markdown]
# ## Definitions
#
# **G**: the raw-weight graph for the full graph.
#
# **Gaa**: the raw-weight graph for axo-axonic synapses.
#
# **Gad**: the raw-weight graph for axo-dendritic synapses.
#
# **Gda**: the raw-weight graph for dend... |
1174b4a904232d1032241ec2a2bd7aec63acc4d0dd23565326309bcb97e69ad4 | Python | 23,349 | 581 | import json
import jsonlines
import glob
from typing import Dict, Any, Union
import re
import Levenshtein
import logging
import numpy as np
from scicite.constants import CITATION_TOKEN, NEGATIVE_CLASS_PREFIX
from scicite.helper import regex_find_citation
logger = logging.getLogger()
class Citation(object):
""" ... |
0c72480d8814f9e53d268740c7e68aef2bc18e201266c45b5ce0a0de7bdc8057 | Python | 23,358 | 531 | # Auto generated from obograph.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-05-02T15:30:42
# Schema: obographs_datamodel
#
# id: https://github.com/geneontology/obographs
# description: Schema for benchmarking based on obographs
# license: https://creativecommons.org/publicdomain/zero/1.0/
import datacl... |
4d4a4d942714a4996debfdff2b8d7e064911a7995d256318cfc673934a9ffa18 | Python | 23,378 | 664 | import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.cnn import (build_conv_layer, build_norm_layer, build_plugin_layer,
constant_init, kaiming_init)
from mmcv.runner import load_checkpoint
from torch.nn.modules.batchnorm import _BatchNorm
from mmdet.utils import get_root_logger
fr... |
8539b3859b1be44154fd8f26baf77c88187616cfd66cde35fc894a3f25dfa441 | Python | 23,401 | 588 | """Unified NuRec world/camera backend for the Alpamayo closed-loop demo.
NuRec owns the generated OpenDRIVE world and this module is its sole tick
owner. Running the standalone nurec_runner.py next to this module is invalid:
both applications would otherwise advance the same synchronous simulation.
"""
from __future... |
35efa9848356dc94d7d167b43009414915b4a6042196b3f47a7e56a0ffb1a9ca | Python | 23,419 | 647 | #! /usr/env/python
import copy
import glob
import io
import json
import os
import subprocess
from os.path import abspath
from os.path import join as pjoin
from os.path import pardir
import numpy as np
import nilearn
import pandas as pd
import cmasher as cmr
from scipy.io import loadmat
import requests
import scipy
f... |
b31c9ec04da7b0561256521f4af6748bf7052c3d081898eb40269a5e9a993c73 | Python | 23,422 | 567 | import torch
import torch.nn as nn
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',... |
bfa6202cdd042ca677afaee2cb7525e17c492ed048a77fbfc1de23816bf06c55 | Python | 23,430 | 432 | import os, sys
import keras
currentdir = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(currentdir)
sys.path.append(parentdir) # PYTHON > 3.3 does not allow relative referencing
from datetime import datetime
from tensorflow.keras.callbacks import ModelCheckpoint, TensorBoard, EarlyStopping... |
c8a7d0ea69a45793d42fdd5de434610129894e36d5a4c683411dafba82286394 | Python | 23,436 | 598 | ####################################################################################################
# Copyright (c) 2020, 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 softwar... |
3cecf279c840972af73f701b76d1ddf094e48da830f63230ac323da2f45ebc91 | Python | 23,444 | 404 | #!/usr/bin/env python3
"""
File: plot_df_per_column.py
Created: 2021/10/26
Last Changed: 2021/10/28
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 S... |
b86bcb0340480c7543a9123b2f81444b214ddeca4ad895ba4faa79bd0f99722a | Python | 23,481 | 697 | # Auto generated from synonymizer_datamodel.yaml by pythongen.py version: 0.0.1
# Generation date: 2024-03-27T14:21:27
# Schema: synonymizer_datamodel
#
# id: https://w3id.org/oak/synonymizer-datamodel
# description: A datamodel for specifying synonymization rules
# license: https://creativecommons.org/publicdomain/zer... |
48080457fd6b1bc9c1c021484ab149e79dcadb94beab63d36f7d1769e16c8255 | Python | 23,483 | 515 | import numpy as np
from PIL import Image, ImageDraw, ImageFont
from matplotlib import pyplot as plt
# from skimage import draw
import sys
import os
import logging
# from data import BratsIter, ConvertToMultiChannelBasedOnBratsClassesd
from heatmap_utlis import load_mri, ImageSliceViewer3D, read_bgmask_from_id
from ski... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.