sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
154687555833b2e4d32928f43f944d136052f0250fb67a9d3887341872ebccc6 | Python | 12,236 | 328 | # --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick
# --------------------------------------------------------
from __future__ import absolute_import
from __... |
2135fa30bb763dc2eee338ec0418ff177c960ebe8b241dff24909476c61e4179 | Python | 12,244 | 409 | import abc
import copy
import matplotlib.pyplot as plt
import numpy as np
from scipy.signal import fftconvolve
from scipy.optimize import leastsq
from . import Tools
class Filter:
"""
Abstract class defining an interface for a linear filter defined as a linear combination of basis functions {f_j(t)}.
... |
7aba31280690df3ba0fae07b33f4b8aad88a762c85f88b96592f499afe8c6bbb | Python | 12,244 | 290 | import torch
from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler
from ..builder import HEADS, build_head, build_roi_extractor
from .base_roi_head import BaseRoIHead
from .test_mixins import BBoxTestMixin, MaskTestMixin
@HEADS.register_module()
class StandardRoIHead(BaseRoIHead, BBoxTestMixin,... |
d86313775e744c8ec8551fab8c6d213f4771f1c7573e0502009f6ebb4a56c1e8 | Python | 12,246 | 204 | from pathlib import Path
import pytest
from carla_cosmos_server.config import DEFAULT_PROFILES_DIR, default_run_dir, detect_image_variant
from carla_cosmos_server.profiles import (
AUTO_LATENCY_MAX_GPUS,
GpuInfo,
load_profiles,
nano_parallel_args,
parallel_of,
plan_layout,
resolve_mode,
... |
a46945bfdfcd3c6a9403ec9a84b7e1311d432912046b17761effc6f76c3cb2d5 | Python | 12,250 | 375 | import numpy as np
from csbdeep.internals.blocks import conv_block2, resnet_block
from csbdeep.utils import _raise, backend_channels_last
import tensorflow as tf
def conv_block(n_filters,
kernel_size=(3,3),
strides=(1,1),
activation="relu",
batch_norm=False,... |
c075e9f65e987529203162ea673fe27cf58d428aeeb2e14e08d4d49cf12ed94b | Python | 12,251 | 375 |
try:
import PIL.Image as Image
except ImportError:
import Image
import numpy as np
import os
import functools
import operator
import struct
import array
def parse_idx(fd):
"""Parse an IDX file, and return it as a numpy array.
Parameters
----------
fd : file
File descriptor of the IDX... |
5374ae76888d3f38517412363cdf6cb1188c5c941f7aa1642d667d557abf1aeb | Python | 12,254 | 254 | #!/usr/bin/env python
# coding: utf-8
import warnings
import numpy as np
import pandas as pd
import requests
from timezonefinder import TimezoneFinder
from datetime import datetime, timedelta
from dark_ships.data_utils import s3_utils
pd.set_option('display.max_columns', 20, 'display.width', 1500)
DEFAU... |
e0caa95caa4fe30baa5941920af2f41b26b03de149e5f6c52eea9ffbe11d54ff | Python | 12,254 | 306 | import numpy as np
import torch
import random
import os
import argparse
from pathlib import Path
from configparser import ConfigParser
from torch.utils.data import DataLoader
import aug_accuracy as util
from aug_accuracy import InputError
def load_data():
input_glob = "../../../Data/Real/AugNN/p_t6/training/input... |
c30f595b488e26a014e6ef9ddcbe21d098cc42b9ba9f8c26bc42d275741f3da1 | Python | 12,258 | 467 | """
Training an FNO with TensorGRaD
==============================
This example compares three optimizers on Darcy-Flow:
- AdamW baseline
- TensorGRaD low-rank gradients with a 25% budget
- TensorGRaD low-rank + sparse residual gradients with a matched 20% + 5%
budget
The example follows the standard FNO Darcy wor... |
a87b283f79fa92cc1fc35a790f1628286baaf088bceee237b999d172aa402105 | Python | 12,265 | 327 | # coding=utf-8
"""
Copyright (c) 2021. Huawei Technologies Co., Ltd. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless requ... |
5bedc92a67e58526ef49ac7b166742d4a04f66560c28284a7f8d80aaa817cdc7 | Python | 12,271 | 320 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
34f6f6b54c15b7943dc1edf9d9f9464605f0e59b766116648328c759243765ba | Python | 12,279 | 301 | ####################################################################################################
# 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 ... |
c24ddd5a9a45c03aec61ec76682d7e49c55eb527611084d0f7867e79349176e1 | Python | 12,286 | 234 | import matplotlib.pyplot as plt
import numpy as np
from grispy import GriSPy
import datetime
from tqdm import tqdm
# import import_AIS
import os
import AIS_parameters
import import_AIS
import pandas as pd
import inspect
import itertools
import functions_basic_sak as funsak
fname = os.path.split( inspect.... |
ee5468724d6b3a49627c9b9478a74a2c728eb0725b348f8128221bf8b91771b3 | Python | 12,286 | 290 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#############################################################
# File: train.py
# Created Date: Monday December 27th 2021
# Author: Chen Xuanhong
# Email: chenxuanhongzju@outlook.com
# Last Modified: Friday, 22nd April 2022 10:49:26 am
# Modified By: Chen Xuanhong
# Copyrig... |
44a9afd7f162e4c64fd4f26bd794a64284282fee93d550442b1508467395289f | Python | 12,289 | 437 | import numpy as np
import pytest
from conftest import RESOURCES
from rdkit import Chem # type: ignore
from ppqm import chembridge, tasks
def test_axyzc_to_molobj() -> None:
atoms = ["C", "H", "H"]
charge = -1
coord = np.array([[1.0, 0.0, 0.0], [2.0, 0.0, 0.0], [3.0, 0.0, 0.0]])
mol = chembridge.axy... |
5d420233a0f3673eda6aaa016dbbe66ecd5037747369682adc38f218a255530c | Python | 12,290 | 357 | import logging
import tempfile
import os
import torch
from collections import OrderedDict
from tqdm import tqdm
from maskrcnn_benchmark.modeling.roi_heads.mask_head.inference import Masker
from maskrcnn_benchmark.structures.bounding_box import BoxList
from maskrcnn_benchmark.structures.boxlist_ops import boxlist_iou
... |
87cc66570422ec024a7384c487f32e4c2c0109583d9a4be64adcaf40f1e31e55 | Python | 12,297 | 315 | import numpy as np
import matplotlib
import pycircos
import mne
from matplotlib import pyplot as plt
########################################################################
class CircosConnectivity:
""""""
Garc = pycircos.Garc
Gcircle = pycircos.Gcircle
# --------------------------------------------... |
cda4ca48b23d67f477bebf38d70c818662a6c84df6df6d7b67007a45db1eeedc | Python | 12,297 | 312 | import os
from os.path import join
from datetime import date, datetime, timedelta
from joblib import load, dump
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.keras.backend import clear_session
from tensorflow.keras.callbacks import ... |
c1fb1d52eebd4460717af2444c91f530b3953c1ba6afec3548929f306eeaf37f | Python | 12,320 | 502 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
"""Statistics functions that work on numpy arrays."""
import re
import numpy as np
import scipy.stats
from scipy.linalg import inv
from .._data_obj import asfactor, asmodel, Model
from . import opt
from . import vector
FLOAT64 = np.dtype('float64')
def _as_... |
5d50e68cfb3ea51075febec5296d19a5eeeb73a32b191be034526ac01c1cbe7f | Python | 12,321 | 246 | # Auto generated from similarity.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-05-13T10:39:24
# Schema: similarity
#
# id: https://w3id.org/linkml/similarity
# description: A datamodel for representing similarity between terms or lists of terms.
# license: https://creativecommons.org/publicdomain/zero/1.0... |
fcd4d1a959d6dca2c8b1d29883b4bd5eefaf0af8c1bcca54859c914181f97d13 | Python | 12,322 | 271 | """
MODULE VERSION:
Module that handles production simulations and energy calculation LJ+coul CHOL_Prot/(CHOL_Prot+POPC_Prot)
"""
import os
import core.settings as CoreSettings
import core.system as System
import core.gromacs as Gromacs
import core.gromacs_commands
import user.usersettings as UserSettings
... |
fe912d83768c61a866ef0ae6645864243f218039e3585b44c8ef7a1dcd450ae3 | Python | 12,324 | 341 | """
Plots the bootstrapped performance of ferrets (F1311, F1519 and F1706) discriminating vowels as a function of SNR, and across SNR during control and test conditions (cortical inactivation via cooling or light delivery / optogenetics) in clean conditions and with noise.
Performance across SNR is shown as a scatter... |
f32bf4042d49f387d83c7d5c2425f497cf23eef9f8f235e86d9e4877f549a125 | Python | 12,326 | 349 | """
Code for localizing category selective regions of interests. The nipype implementation can exploit running on multiple CPU,
the number of which can be specified with <n_processors>
Usage:
python localizerGLM_FSL.py <subject_ID> <bids_path> <n_processors>
Example:
python betas.py 01 /home/user/thingsmri 8
"""
imp... |
f8e854b5c9531ef89fa38626d8d9717392c0a30dfa6ef1188a4bb8092310e147 | Python | 12,327 | 316 | ####################################################################################################
# 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 ... |
d92e2d9cbd260271efb4b451631b6a79b4f42b602b610f4ae4adbe568c7c78b8 | Python | 12,330 | 243 | import json
import pytest
from conftest import submission, upload
def _submit_ok(server, clip, backend="cosmos3-nano", controls=None, priority="interactive"):
cam = clip.manifest.camera_names[0]
rgb = upload(server, clip.video("rgb", cam))
ctrls = controls or {"depth": {"blob": upload(server, clip.video... |
c7ad22cfee967bd4918e85ab68210f81fc01b6c0c62519402c2e166581b17679 | Python | 12,334 | 310 | '''
Functions to load Fourier series of hydrodynamic friction coefficients from a file
- Used in `physics.friction_pairwise.py` and also kept for compatibility.
MAYBE:
- rewrite define_right_side_of_ODE - s.t. gii is not calculated twice
in Gamma_glob and Q_glob - implemented, but the speed remained equal
- Cubic in... |
2964225429093d39979de57c1b831a6e809906d3613f5b62d6cdb9895547c875 | Python | 12,335 | 230 | # 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... |
ccfe0a904e550908dbb69743da78f0c9c62c31222dec634e8429155365bfe372 | Python | 12,335 | 300 | #!/usr/bin/env python3
"""Decode a CARLA pedestrian navmesh (Nav/<map>.bin) into inspectable geometry.
Prints a report by default -- tile grid, polygons per area, bounds -- which is
enough to tell an empty or truncated navmesh from a real one. With --obj, writes
the walkable polygons as a mesh grouped by Recast area, ... |
245087155acf363f5ecd414757edba24bb283db0ae18fedc9ba9fb493a47f8c1 | Python | 12,345 | 303 | # 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... |
7491c68f1ce74a0e068e16e435c82582b6d26648b27b971495f128ab93c63a98 | Python | 12,354 | 275 | # Copyright 2020 Google Research. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
e0506673900a3bbb2fc536fc135b0657c179dd8e7d4c0dcabfb4ca95d87f21db | Python | 12,360 | 279 | # 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... |
ab06fea37ff46528e9ffaab37bed0efc2b058f1c6017957f123893008c235a7b | Python | 12,364 | 343 | # 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... |
36502cbda794ed442f6f4de698fdae62cb308638bd8a4d1918f8941897a3eee1 | Python | 12,378 | 389 | #%% Load data
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from mpl_toolkits.axes_grid1 import make_axes_locatable
from sklearn.covariance import EmpiricalCovariance
from sklearn.model_selection import ParameterGrid
from graspy.plot import gridplot,... |
2901ce2c324564de710cce5ea7f4c1376b70338171e58f94f4a1682eab8d5c28 | Python | 12,388 | 303 | # Header variables and parameters.
import os
import numpy as np
from IPython.core.debugger import set_trace
import importlib
import sys
from default_config.masif_opts import masif_opts
from masif_modules.MaSIF_ligand import MaSIF_ligand
from masif_modules.read_ligand_tfrecords import _parse_function
from sklearn.metric... |
28bb714179c9150fb6aaac72c08e303f6522165b79cc604edcc42b5d0e45c0f3 | Python | 12,389 | 289 | ##########################################################
## ccAF: cvClassification_FullAnalysis.py ##
## ______ ______ __ __ ##
## /\ __ \ /\ ___\ /\ \/\ \ ##
## \ \ __ \ \ \___ \ \ \ \_\ \ ##
## \ \_\ \_\ \/\_____\ ... |
ce24e3c2add87c5c3d5622836f2ea29300dc58ca5f10a90cfc38cac50f26871e | Python | 12,390 | 348 | import math
from abc import abstractmethod
from typing import Tuple, Union
import torch
from dataclasses import dataclass
from artemis.general.should_be_builtins import bad_value
from spiking_eqprop.eq_prop import ISimpleUpdateFunction, IDynamicLayer, LayerParams, \
drho, rho
@dataclass
class StochasticQuantize... |
599ff83a9dfcc06fe2e10b3d9ec125843ddfec1a45610e80590d15b3de64e4bf | Python | 12,396 | 309 | """
File: main.py
Created: 2020/03/13
Last Changed: 2020/04/10
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 Software Foundation, either version 3 ... |
764b456bc53cfb1b612204ec089929d395c71b13a108000bf1149cb0abd826a4 | Python | 12,399 | 315 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import Conv2d, ConvModule, build_upsample_layer
from mmcv.ops.carafe import CARAFEPack
from mmcv.runner import auto_fp16, force_fp32
from torch.nn.modules.utils import _pair
from mmdet.core import mask_target
from mmdet... |
eae0a33a19c8ad3c2143df63c787cd84282ed6a37b68d4349acff2cfcc1275f1 | Python | 12,399 | 340 | # 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... |
86c251f8712e9c2cfe55c6638bb5d9009da35f11ec33a5d34e6f22d3532e858c | Python | 12,405 | 370 | import os
import numpy as np
import torch
from util.datasets import TrajectoryDataset
from .label_functions import label_functions_list
from .augmentations import augmentation_list
from util.logging import LogEntry
import pickle
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from matplotlib i... |
3d5c9589038557aa42a8e8972adc4eddb96a64c0aab5a251ba9ca66ab9803ea9 | Python | 12,407 | 327 | ####################################################################################################
# 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 ... |
66fad6e568550ae3953c2050766a40b624f97a238c375a112b96c0568f4dfdb2 | Python | 12,410 | 260 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 2 13:37:38 2021
@author: paulmueller
"""
import glob
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from scipy.stats import wilcoxon
from iEEG_STC import utils
import os
sns.set_palette("tab10")
sns.se... |
208af9a90593a248c2b8e6c6728053efbef0ec63a05309bd7ed3f617dedb1a11 | Python | 12,411 | 394 | #!/usr/bin/python
####################################################################################################
# Copyright (c) 2021, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis>
... |
18b213bb24d0b927daa75b8d6f10296f03c0c15fa32325bcd1322bcd464ebc5f | Python | 12,412 | 430 | # %% [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... |
1ee95e5f0a95cf11fbade4e58897a543c6c7e3b5274eba5e5f7f827cdf2d1f76 | Python | 12,412 | 285 | import os
import sys
import core.system as System
import getopt
import subprocess
import numpy as np
##############
## Settings ##
##############
# PDB generator #
pdb_gen = "PeptideBuilder" # "Modeller"
# Force field #
ff = "martini3001"
# Input #
filena... |
9ffaf0b6001b34f449481f994664daabee8c7f5d9158427e1e0d558c2cc7a371 | Python | 12,412 | 309 | """
File: main.py
Created: 2020/03/13
Last Changed: 2020/04/10
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 Software Foundation, either version 3 ... |
cd13aa091fc3cf8a8ccb86aaf459457b8d7773fc887bc8084bb8edfba275b7c9 | Python | 12,418 | 317 | import os
from os.path import join
from datetime import date, datetime, timedelta
from joblib import load, dump
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.keras.backend import clear_session
from tensorflow.keras.callbacks import ... |
e8f4e62fad36542cb93fc9071fda43a7583d80d680cd89f2a00db347d8ea0046 | Python | 12,419 | 357 | import random
import torch
from torch.utils.data import Dataset
TRAIN = 1
EVAL = 2
class TrajectoryDataset(Dataset):
# Default parameters
mode = TRAIN
subsample = 1
_state_dim = 0
_action_dim = 0
_seq_len = 0
# Ground-truth labels
hasTrueLabels = False
train_labels = None
... |
e7ac3d86e35725e9a98552646bc21b33d38d662738952d1df48ff8d247c242b6 | Python | 12,423 | 306 | import tensorflow as tf
import numpy as np
class MaSIF_ligand:
"""
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()
... |
5669f8e226b201753bfca15dd3e784b9e319fed4559dde49877216f408a44aa7 | Python | 12,431 | 343 | from recurrent_rsa.rsa_utils.numpy_functions import (make_initial_prior,
uniform_vector)
from recurrent_rsa.recursion_schemes.recursion_schemes import ana_beam
import sys
sys.path.append("models/")
from recurrent_rsa.bayesian_agents.joint_rsa import RSA
from utils i... |
04be53d7017dffe84495aa58322cd0e6e23d5a758b5b36fb932649f07c6e4c50 | Python | 12,435 | 317 | import time
import os
import tensorflow as tf
import tensorlayer as tl
import numpy as np
import matplotlib.pyplot as plt
from model import UNet_A, UNet_B
from model.util.losses import *
from dataset import Dataset
from utils import write3d
from config import config
#from train_multi_gpu import MutilDeviceTrainer
##... |
b12bf96d414e20a0cebdae5c63448bdf72ff2410944ba0e4ba46d15cab3c9ba1 | Python | 12,437 | 240 | #!/usr/bin/env python3
"""Exact f-theta rendering on the cube-map fisheye sensors (camera_model=lut).
Reads the f-theta polynomial of a NuRec camera from the engine, tabulates R(theta) in pixels, and
renders `sensor.camera.rgb_fisheye`, `depth_fisheye` and `semantic_segmentation_fisheye` with that
table at the recorde... |
2cd2a029d8fbb917856f39bd47df5547091ef43a0226c8942ebb573c2b8bb6b0 | Python | 12,438 | 314 | """Calculate residual antibody binding after some mutations.
This module can be downloaded from
`https://github.com/jbloomlab/SARS2_RBD_Ab_escape_maps/blob/main/bindingcalculator.py <https://github.com/jbloomlab/SARS2_RBD_Ab_escape_maps/blob/main/bindingcalculator.py>`_
The module defines :class:`BindingCalculator` w... |
8469a3c2ad8411b2d824e929863c8713142fb8bfe7684ed8da9405594da8728c | Python | 12,438 | 303 | # YOLOv5 PyTorch utils
import datetime
import logging
import math
import os
import platform
import subprocess
import time
from contextlib import contextmanager
from copy import deepcopy
from pathlib import Path
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as F
imp... |
eea450e3774e49d0bca05bf8c523d152c8e0ae2a2c60b8b9d4d6519c3e8d4e12 | Python | 12,439 | 325 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Script to train a network.
Created on Thu Nov 1 10:45:50 2018
@author: nicolas
"""
import os, sys, time, shutil
import argparse
import random
import numpy as np
import matplotlib
matplotlib.use('Agg')
from skimage import io
import imgaug.augmenters as iaa
import t... |
7a5106d825f482b310f27e744b23fe0e35e68f83467e42bdd6e03fecc437e9d1 | Python | 12,446 | 373 | #Authors: Ceyao Zhang, Renjie Li, May 2022, CUHKSZ
import os
from time import time
from datetime import datetime
from tqdm import tqdm, trange
from collections import deque
import numpy as np
import scipy.signal
import torch
import torch.nn as nn
from torch.optim import SGD, Adam
from torch.utils.data import TensorDa... |
2f49983071a39b6aba7fc6868359020a7a78912d57d721380436b45bce6af088 | Python | 12,447 | 272 | # -*- coding: utf-8 -*-
# Allow self reference in class definitions
from __future__ import annotations
from collections import namedtuple
from typing import Iterable, Iterator, List, Optional, Union
import numpy as np
from scipy.stats import entropy
from rdkit import Chem
from rdkit.ML.Descriptors import ... |
445877d1ddc5240130fbfceb0ac23eb933dfbb634a542c0a2ad341e45ecabe63 | Python | 12,450 | 319 | import ipdb
import torch
from torch_geometric.nn import GCNConv, GINConv, BatchNorm, SAGEConv, JumpingKnowledge, GATConv
from torch_geometric.nn import Sequential
import sklearn.metrics as metrics
from sklearn.metrics import f1_score, accuracy_score, precision_score, recall_score
class GCN_1layer(torch.nn.Module):
... |
71b37c23aa277f9b34b8ae83f433b47f40f561e378625d7a39247acdaeb7bf6f | Python | 12,470 | 341 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
##################### IMPORTS #######################
import os
import sys
from keras.models import model_from_json
from matplotlib import pyplot as plt
import numpy as np
from keras.callbacks import ModelCheckpoint
from rdkit.Chem.Draw import IPythonConsole
import os,... |
bd2a335eca7cfcbbe36baf58b395d87c4eaa9c7b67b0e24a6750a7ffa467b666 | Python | 12,473 | 324 | """Rust implementation of semantic similarity measures."""
import inspect
import logging
import math
from dataclasses import dataclass, field
from typing import ClassVar, Dict, Iterable, Iterator, List, Optional, Tuple, Union
from oaklib.datamodels.similarity import (
BestMatch,
TermInfo,
TermPairwiseSimi... |
44ac730345f4a43daa2a2382bb69baeb07b0f9f8020481cc8ffe403c174c662c | Python | 12,474 | 345 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
from torch.optim.lr_scheduler import CosineAnnealingLR
import torch.optim as optim
from tqdm.auto import tqdm, trange
import numpy as np
import sklearn.metrics as m... |
57e52932a48c17cf36a0e08222891f98d5620afdd39f85f982050e637dbcc39c | Python | 12,485 | 238 | #!/usr/bin/env python3
# -*- coding: utf-8 -*
"""Gait study preprocessing file.
"""
from functools import reduce
import pandas as pd
import os
import glob
import preprocessing_utils as proc_utils
from sklearn.preprocessing import scale
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use('ggplot')
pl... |
5cfaf84e106811690b2523fcf5584204447ad27679f1eb13268a9391f6b2b092 | Python | 12,489 | 332 | from dash import dcc, html
import plotly.graph_objs as go
import mne
import RV.constants as c
from RV.callbacks.utils.annotation_utils import merge_annotations
from RV.callbacks.utils.bad_channels_utils import bad_channel_disagrees
def get_amount_annotated_data(merged_annotations: list):
"""Calculates amount o... |
57a02e8c3fc2a094869382671efa67abf813e70ece5c02007958d64c5d9ef113 | Python | 12,490 | 308 | import os
import numpy as np
import pandas as pd
from datetime import datetime
from operator import itemgetter
INPUT_DIR = os.path.join(os.getcwd(), "inputs")
OUTPUT_DIR = os.path.join(os.getcwd(), "outputs")
def import_ais(input_dir: str, num_files: int) -> pd.DataFrame:
"""
Parameters
----... |
6f06b027ddfac94b32ae748a149c0b44ca7902e1867a43ba22fcd3261e0663f8 | Python | 12,493 | 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 agreed to... |
fa273ee60e4ec3cb8c53c3fa10e63a807b6d7bdef6653726741ec5d239a9c859 | Python | 12,509 | 311 | import os
import sys
from timeit import default_timer as timer
from datetime import timedelta
from pathlib import Path
path = str(Path(Path(__file__).parent.absolute()).parent.absolute())
sys.path.insert(0, path)
from os import walk
from datetime import datetime
import numpy
import tensorflow as tf
import numpy as np
i... |
692798c960a45ff92a47330cb235eb5de3789fd4e3041b23665c45e45e54442d | Python | 12,521 | 343 | #!/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>.
"""Standalone numpy ground-truth for the sensor.camera.rt_lens lens models.
... |
111475fa218d0bb1325a42d5c2f63e45696b4c34b51b0bf23e9244b4af003c78 | Python | 12,525 | 319 | #!/usr/bin/env python3
# -*- coding: utf-8 -*
"""Utility functions to help with preprocessing of StretchSense and Motion Capture data.
A collection of helper functions to be used in various analysis scripts.
"""
from typing import List
import matplotlib
from matplotlib.colors import LinearSegmentedColormap
impo... |
4b2861ec92f53d1123b3d56ba7c7eeca61db565c8daab0b06d49c5e443fb0d6f | Python | 12,529 | 313 | # -*- coding:utf-8 -*-
import random
from os import listdir
from os.path import isfile, join
import numpy as np
from math import floor
from scipy.ndimage.interpolation import zoom, rotate
import imageio
import face_recognition
## Face extraction
class Video:
def __init__(self, path):
self.path = path
... |
56113974e6af90608a57a33e288f1e2de5323803276765b9ef2efbdecf1c79ef | Python | 12,539 | 298 | # Ref: https://github.com/victoresque/pytorch-template/blob/master/trainer/trainer.py
import numpy as np
from numpy import inf
import torch
from torchvision.utils import make_grid
from abc import abstractmethod
from .visualization import TensorboardWriter #import TensorboardWriter
from .util import inf_loop, Metri... |
171266ac37627b795d9ab39e274764a407b30295ae78e54a3114be9ab6d4b8c8 | Python | 12,545 | 449 | # %% [markdown]
# ##
import os
import time
from pathlib import Path
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from anytree import Node, NodeMixin, Walker
from graspy.embed import OmnibusEmbed, selectSVD
from graspy.models import DCSBMEstimato... |
6b0e53e22a3ba5e3b53e4787ad789b1690ac1836ebf2a2aa8421bb787fc08075 | Python | 12,546 | 330 | import argparse
import json
import os
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
# Change working directory to access the trained encodings in "save"
os.chdir('../../')
# For faster runs, can modify this just to run on a single training data amount
train_amount_list = [... |
a7cd3f24c659ee2a3fda8550bf1b88f035a4cc999fb3371a6a356ab8374473f3 | Python | 12,549 | 313 | import unittest
from pathlib import Path
import yaml
from sssom.parsers import to_mapping_set_document
from sssom.writers import write_table
from sssom_schema import Mapping
from oaklib import get_adapter
from oaklib.datamodels.cross_ontology_diff import EntityReference
from oaklib.datamodels.mapping_rules_datamodel ... |
5e9e022bd9f3b2f1ec291162a83c809e9c9a6eb96a0be69f038ed22fba14eb4f | Python | 12,550 | 511 | # %% [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... |
dde4eaf538ff90416ab58d2676a26c184b32ef635baa60a6f87e22e52486ff55 | Python | 12,564 | 360 | import torch
from torch import nn
import torch.nn.functional as F
import os
import torchvision
# print(torchvision.__version__)
# import torchvision.ops.misc.MLP as MLP
import warnings
from typing import Callable, List, Optional
from torch.autograd import Variable
class TripletLoss(nn.Module):
def __init__(self, m... |
db6dff3b10e44e03dd881fc576d26ee5cc225a3920ca2ea90f093f27ef72fadd | Python | 12,574 | 331 | """Adapter for NCBIGene solr index."""
import logging
from dataclasses import dataclass
from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple
from xml.etree import ElementTree # noqa S405
import requests
from oaklib.constants import TIMEOUT_SECONDS
from oaklib.datamodels.association import Associa... |
71aaed059891df576880528ddc9071e01f9b63d93d8bcfe0cfab9a6dd9c9fad4 | Python | 12,576 | 276 | from .cmseq import CMSEQ_DEFAULTS
from .cmseq import BamFile
from .cmseq import BamContig
from cmseq import __version__
import os
import pysam
import math
import pandas as pd
import numpy as np
import argparse
import sys
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
__author_... |
0d0dbeaf1eec40d894a0356f0679475be7e3d649c6a0b6a8dfafa0e3351fb8d8 | Python | 12,579 | 272 | #%%
from pymaid_creds import url, name, password, token
from data_settings import pairs_path, data_date
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
# allows text to be editable in Illustrator
plt.rcP... |
1edbb46c6249c3199f4d2097340df16b10328ab388a3a107f8d4f60f1e35f102 | Python | 12,583 | 324 | #!/usr/bin/env python3
"""
File: compare_fim_vs_decon_eqtl.py
Created: 2021/12/21
Last Changed: 2022/02/10
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... |
abeb552b1f8a96151ed15bafa2537a02f0d3c7e7a9cffd23144dfae77de63405 | Python | 12,585 | 294 | import copy
import torch
import numpy as np
from typing import Callable, Union
from scipy.special import comb
from itertools import combinations
import torch.nn.functional as F
from torch_geometric.utils import to_networkx
from torch_geometric.data import Data, Batch, Dataset, DataLoader
#from .utils.testing_datasets i... |
bbfacb5f1279118674926830f75695fd59d541312756c9ec15c317360d9e6e8a | Python | 12,586 | 292 | import time
from typing import List, Tuple, Iterator
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from fuzzywuzzy import fuzz
from nilmtk import DataSet, MeterGroup
from pandas import DataFrame
from datasources.paths_manager import UK_DALE, REDD, REFIT
from exceptions.lab_exceptions import L... |
8bb43444819dc84dbcd1a8b36c6d0bc88d52dc6ae1d96fb2457b2504c790bd56 | Python | 12,589 | 376 | ###########################################################################
# Created by: Tianyi Wu
# Email: wutianyi@ict.ac.cn
# Copyright (c) 2018
###########################################################################
import torch
import torch.nn as nn
import torch.nn.functional as F
__all__ = ["Context_Guided_... |
29155b50f27303e7092908cd2a5ff7fcffaf0b45a6dbc5934670dd3829602cba | Python | 12,592 | 372 | """
compute_polar_coordinates.py: Compute the polar coordinates of all patches.
Pablo Gainza - LPDI STI EPFL 2019
This file is part of MaSIF.
Released under an Apache License 2.0
"""
import sys
from sklearn.manifold import MDS
import networkx as nx
import numpy as np
import scipy.linalg
from IPython.core.debugger imp... |
07be9ffd6529555737afaacc3db0c63d9dee3ae10b584cfdac443cf22e8304e5 | Python | 12,593 | 337 | """
File: utilities.py
Created: 2020-04-29
Last Changed: 2020-04-29
Author(s): H.H.Wiersma
Code to create distribution plot and a mask image used in the research plan
Copyright (C) 2019 H.H.Wiersma
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Gener... |
26a3d54e05825fa23b54a9ba63f4d5de0dd02dfe5c419b3ebd35fff9502c9bf7 | Python | 12,594 | 280 | ###################################################################
####
#### Version: 1.1.7
#### Date: 6/24/2023
#### Description: This file contains the functions used for loading .nrnez files
#### Author: Evan Cobb
#### ... |
14462c7a7c200c4031f9e053d07492f28091e8114861e539973f8fbb37eb1c36 | Python | 12,596 | 324 | # randomisation significance testing
import numpy as np
import scipy.stats as stats
import matplotlib.pyplot as plt
import seaborn as sns
import random
import copy
import pandas as pd
import matplotlib.pyplot as plt
import logging
from itertools import combinations, product
from statsmodels.stats.multitest import mul... |
84cd58667f88ca0f562cf75b2f1550d46a872729e497ac85b4e430a3304340a9 | Python | 12,607 | 182 | import os
from PIL import Image
from collections import OrderedDict
from dash import dcc, html
##### Conversion variables #####
# CONVERSION_VALUE_MICROVOLTS_TO_VOLTS = 1e-6
CONVERSION_VALUE_VOLTS_TO_MICROVOLTS = 1e+6
##### Default plotting variables #####
DEFAULT_Y_AXIS_OFFSET = 40
DEFAULT_SEGMENT_SIZE = 10
#####... |
b1762b138184aa0b8372f72ca5cd191e06c4b14259891ec52677805b41532488 | Python | 12,610 | 456 | # %% [markdown]
# ##
import warnings
def noop(*args, **kargs):
pass
warnings.warn = noop
import os
import time
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy
import seaborn as sns
from joblib import Parallel, delayed
from scipy.ndimage import gaussi... |
bed2a45da1d0c9d65935c9917884da5c9afb3fce4994ba6d34bf3ec4188855d2 | Python | 12,617 | 283 | #!/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>.
"""Calibration refit: take captured checkerboard images (from
calibration_sce... |
957ade25c982e5f690a5df2e4332f265d94a9f5396ecf32ac9a3f89e83a930c1 | Python | 12,620 | 271 | #!/usr/bin/env python
"""
Pseudo-bulk profile computation
"""
__author__ = "Kawaguchi RK"
__copyright__ = "Copyright 2021"
__credits__ = ["Kawaguchi RK"]
__license__ = "MIT"
__version__ = "0.1"
__maintainer__ = "Kawaguchi RK"
__email__ = "rkawaguc@cshl.edu"
__status__ = "Development"
import Catactor
from .mini_catac... |
9aae1cdeea16591f74e3c473da757d103c98bfa2280249a7b2039d05a2024969 | Python | 12,624 | 284 | import descarteslabs as dl
import functools
import geopandas as gpd
import h3
import matplotlib.pyplot as plt
import numpy as np
import os
import rasterio as rs
import shapely
from rasterio.windows import Window
from skimage.feature import blob_doh
from skimage.feature.peak import peak_local_max
from sklearn.neighbors ... |
2307bca9361086add2e9238998329b3faac5ff6b9ac5f59763ac9185e7ecfab2 | Python | 12,625 | 388 | from typing import NamedTuple, Optional, Tuple, Union
import numpy as np
from cgtasknet.tasks.reduce.reduce_task import (
_generate_random_intervals,
_generate_values,
ReduceTaskCognitive,
ReduceTaskParameters,
)
class GoTaskParameters(NamedTuple):
dt: float = ReduceTaskParameters().dt
trial... |
969654adb5d60a5e123ca4e00bbd7f34bff2d36497a29c396b8616136f972360 | Python | 12,625 | 341 | """PantherDB implementation for OAK."""
import logging
from collections import defaultdict
from dataclasses import dataclass
from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple, Union
import requests_cache
import sssom
from sssom.constants import SEMAPV
from sssom_schema import Mapping
from oakli... |
1fa7050bb0d0aa340465447ed8582c7e47adb478dc5000efb81ca7ac2640b6d4 | Python | 12,630 | 352 | # python 3.7
"""Contains the implementation of encoder for StyleGAN inversion.
For more details, please check the paper:
https://arxiv.org/pdf/2004.00049.pdf
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
__all__ = ['StyleGANEncoderNet']
# Resolutions allowed.
_RESOLUTION... |
7cd5fccbc41751f03a8f3812a0511bbfa443a86f2a46d638fd2ca1556a2b3d41 | Python | 12,641 | 404 | """
Pixel RNN on MNIST
Ishaan Gulrajani
"""
import os, sys
sys.path.append(os.getcwd())
try: # This only matters on Ishaan's computer
import experiment_tools
experiment_tools.register_crash_notifier()
experiment_tools.wait_for_gpu(high_priority=False)
except ImportError:
pass
import numpy
numpy.rando... |
222e61e142a88456107d95e1dea5b4c0d84f795a4270fe2a7548516d7333d02d | Python | 12,644 | 365 | from abc import ABC, abstractmethod
from copy import deepcopy
import numpy as np
from scipy.stats import gmean
import torch
from torch import nn
from tqdm import tqdm
from drugex import DEFAULT_GPUS, DEFAULT_DEVICE
from drugex.logs import logger
from drugex.training.interfaces import Model
from drugex.training.monit... |
d5cb151d5ee9bfcde403d7fb54c90043ed5a00933a1c5549c4dfc0c5c24a8b96 | Python | 12,644 | 372 | from curses import A_CHARTEXT
import os
import re
import time
from matplotlib.pyplot import delaxes
import numpy as np
import pickle
import glob
import random
import matplotlib.pyplot as plt
# audio
import librosa
import librosa.display
import sklearn
import torch
from torch.utils.data import Dataset,D... |
0956970c7b02666e98cb61a0de0785c853dee5a30d55cfcfb8f6c082fce01fb6 | Python | 12,645 | 263 | """Cosmos 3 worker against the fake vLLM-Omni server (CPU only)."""
import asyncio
import json
import subprocess
import sys
import time
from pathlib import Path
import pytest
from carla_cosmos_server.config import default_run_dir
from cosmos_workers.common import protocol
from cosmos_workers.common.base import add_c... |
64265d0015b435741a868fec11d33cc379d5c8705730d33c0e274d0f12e0540a | Python | 12,665 | 321 | #!/usr/bin/env python3
"""
File: visualise_deconvolution_matrix.py
Created: 2020/09/04
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... |
f8c3d89291109ea1ae2cd383f5e63357785eeb3332db62c3310852618fbd88f1 | Python | 12,682 | 395 | #%%
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.