sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
87ae1a838fab16a52b79c3d9f19a7856021578a3ff3c08a805d9ba01ce23c166 | Python | 27,483 | 639 | import torch
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, Scale, bias_init_with_prob, normal_init
from mmcv.runner import force_fp32
from mmdet.core import (anchor_inside_flags, bbox2distance, bbox_overlaps,
build_assign... |
537f12ff0387f4a0c281450fc6e0bc31f4947540e9ab9218c4080b2e235dc477 | Python | 27,497 | 628 | import numpy as np
import torch
from mmcv.runner import force_fp32
from mmdet.core import multi_apply, multiclass_nms
from mmdet.core.bbox.iou_calculators import bbox_overlaps
from mmdet.models import HEADS
from mmdet.models.dense_heads import ATSSHead
eps = 1e-12
try:
import sklearn.mixture as skm
except ImportE... |
7f763a4c100ea9e85743a26d2ac9e7945045bc3c6b68828e52c788876021ae34 | Python | 27,498 | 895 | #!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# Copyright 2020 Blaise Frederick
#
# 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.... |
a9bd5cd2d20eaf33f47cc5594b0d7dbe91cba42b68612099f43d3b40fb543dc9 | Python | 27,519 | 799 | """Helpful functions related to observation models."""
from typing import Tuple
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow_probability import bijectors as tfb
from osl_dynamics.inference import regularizers
from osl_dynamics.inference.initializers import (
Wei... |
fdb909a47e8c8e3ba918496d45625157c865ea1df4dfe3d9d8bf70df21f85ff7 | Python | 27,527 | 892 | # %% [markdown]
# ##
import os
import time
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.match import GraphMatch
from graspy.models import DCSBMEstimator... |
e9026846f535dce7f9eaafb3f6ffbcbdf2e3a4b28d535e1a721ad2cbc31613d9 | Python | 27,573 | 895 | # %% [markdown]
# ##
import os
import time
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.match import GraphMatch
from graspy.models import DCSBMEstimator... |
262e7807af4d20d8d3b1f95edc93057cb2bf37f4c0e0b3dffc6ec038beddc804 | Python | 27,640 | 679 | #%%
from pymaid_creds import url, name, password, token
from data_settings import data_date, pairs_path
import pymaid
rm = pymaid.CatmaidInstance(url, token, name, password)
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
import numpy as np
import pandas as pd
from contools import Prom... |
65eb08fcc4b5e209dfc18989edb59d2c1b28cef89d4b162ed30979bcff1ba30f | Python | 27,693 | 826 | # %% [markdown]
# # THE MIND OF A MAGGOT
# %% [markdown]
# ## Imports
import os
import time
import colorcet as cc
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 scipy.linalg import orthogonal_procrus... |
b26302b9b01d30e7aecadb19eca774979a535447f1e78724a40eb96658b42478 | Python | 27,705 | 679 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import numpy as np
from skimage.util import view_as_windows
import warnings, logging
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.ops import nn_grad, mat... |
91cd0427b82807b37290c0a87421aec4ed7f32d2551ee388c359a39cd15dbec3 | Python | 27,707 | 629 | import fnmatch
import logging
from collections import defaultdict
from typing import Dict, List, Optional, Tuple, Union, cast
from multiqc import Plot, config
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.modules.qualimap.QM_BamQC import genome_fraction_helptext
from multiqc.plot... |
f8c9f17ea5efb1882137840a9e59b9eeba1f571722115b93caf4494109823374 | Python | 27,715 | 639 | import torch
import torch.distributed as dist
import torch.nn as nn
from mmcv.cnn import ConvModule, Scale, bias_init_with_prob, normal_init
from mmdet.core import (anchor_inside_flags, build_assigner, build_sampler,
force_fp32, images_to_levels, multi_apply,
multiclass_... |
ecdf20ca1ccc7e17839a69e653e3f03286b2fa5eebfa820365a56584d474387d | Python | 27,791 | 645 | #%%
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... |
56e31665549413d9db3f4a5b1b774312516a9fd1c51dbe9e7ec67cfd926ad911 | Python | 27,795 | 785 | from distutils.version import LooseVersion
from logging import getLogger
import select
import sys
from threading import Thread
from time import sleep
import webbrowser
import wx
from wx.adv import TaskBarIcon, TBI_DOCK
from .._utils import IS_OSX, IS_WINDOWS
from ..plot._base import CONFIG
from .about import AboutFra... |
f9ec80eb09287e7039cd8a11a32ea13c72aa434cf0e8d20bb6dd47c6652f7a6b | Python | 27,806 | 754 | # python 3.7
"""Contains the implementation of generator described in StyleGAN.
For more details, please check the original paper:
https://arxiv.org/pdf/1812.04948.pdf
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
__all__ = ['StyleGANGeneratorNet']
# Resolutions allowed.... |
50410316128157d79cbc3a32c41d5e4cab8c81ad24a033bcd55806e3dbd7356d | Python | 27,831 | 802 | # Copyright 2021 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... |
b624923f172c863eb2ed929ab34beed9015c0801df028ae7a5370838668e1711 | Python | 27,850 | 738 | #!/usr/bin/env python3
"""
Main file for phys2cvr.
Attributes
----------
LGR :
Logger
"""
import datetime
import logging
import os
import sys
from copy import deepcopy
import numpy as np
from peakdet.io import load_physio
from phys2cvr import _version, io, signal, stats
from phys2cvr.cli.run import _check_opt_c... |
d21e2a6684675390212418708702d5b69a4e31baf58fe8b941de13c5e560fe89 | Python | 27,943 | 682 | #!/usr/bin/env python3
"""
File: bryois_replication.py
Created: 2022/02/11
Last Changed: 2022/05/26
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... |
4a69d5aa8591eaa43799b677701e1d6e5fc7183c364d361d37eee3ea42399e1d | Python | 28,005 | 591 | import torch.nn as nn
import torch.nn.functional as F
import torch
import numpy as np
from ..layers.channel_mlp import ChannelMLP
from ..layers.spectral_convolution import SpectralConv
from ..layers.skip_connections import skip_connection
from ..layers.padding import DomainPadding
from ..layers.coda_layer import CODALa... |
019466ce101b0653e6205ea1d651eaa95bc1d69aac558772aa63aab4ba5d6217 | Python | 28,016 | 871 | # Auto generated from similarity.yaml by pythongen.py version: 0.9.0
# Generation date: 2023-08-21T16:44:57
# Schema: similarity
#
# id: https://w3id.org/oak/similarity
# description: A datamodel for representing semantic similarity between terms or lists of terms.
# license: https://creativecommons.org/publicdomain/ze... |
754ce90b3bea98a41ab357f1aa93030de005662e14952d26d756bfaecbee0c9b | Python | 28,045 | 717 | ####################################################################################################
# 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... |
c6903bd7a0e9427e495fdb4181fa5c429b2659ab5667e0d33cda2686f9698a5d | Python | 28,068 | 934 | # %% [markdown]
# # THE MIND OF A MAGGOT
# %% [markdown]
# ## Imports
import os
import time
import warnings
import colorcet as cc
import matplotlib as mpl
# mpl.use("Agg")
import matplotlib.pyplot as plt
#
# import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import numpy as np
import pandas ... |
f40173b43a1715de43775ada2cfea5668eff38b1b5e7605d3dc0f3c1db9b6232 | Python | 28,081 | 581 | """The side-by-side viewer: input RGB | control(s) | Cosmos result, per camera — and its video export.
``demos/viewer.py`` is the command line around this module. Everything that decides what a frame
*looks like* lives in :class:`Composer`: which tiles a layout has, how they are fitted and labelled,
the footer with t... |
16bc3b7153f98ae060b4c88f7d13347d70933467a80bdb8966674104686f2d2b | Python | 28,086 | 722 | """
Implementation of the ICA denoising procedure.
- run_melodic_wf runs the additional preprocesisng and ICA.
- EvalMelodic is used to calculate each ICs features and generate visual reports for the raters.
- write_noise_tsvs then produces the final noise regressors based on the chosen thresholds.
This module is mea... |
835966637fcfa01c17aab17e3f2319a49f56c00ef90f4893e5a01f24724db3aa | Python | 28,094 | 779 | # 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... |
dad6f9e8ea4a629ebdcf9416358d30dfdb82c9ee3f11a890c3f9e2af44f055c7 | Python | 28,100 | 684 | # %%
from data_settings import data_date, pairs_path
from pymaid_creds import url, name, password, token
import pymaid
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
from contools import Promat, Celltype, Celltype_Analyzer
# allows text to be editable in Illustrator
plt... |
45183ca218a2ef4798b3ffe07de62208f48597ef901538279f2f5ba82a583f9b | Python | 28,125 | 627 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import BiblioAlly as ally
from functools import reduce
# Styling MatPlotLib
plt.style.use('tableau-colorblind10')
plt.rcParams.update({
'font.size': 13,
'figure.figsize': (9, 7),
'grid.color': '#D8D8D8'
}) # set font and plot size to b... |
dd0a1fc9594728d01db45b5a786bc888884aa83c8f0b74f74ac3dc6590d05fbf | Python | 28,165 | 687 | import bisect
import numpy as np
import torch
from selene_sdk.sequences import Genome
from selene_sdk.targets import GenomicFeatures, qGenomicFeatures
from src.transforms import PermuteSequenceChannels
from torch.utils.data import RandomSampler
import gc
_FEATURE_NOT_PRESENT = -1
class EncodeDataset(torch.utils.dat... |
df6a6abebc687102f4c07b653aea8b9799b97eb0dd021428024bcf3233fb54fe | Python | 28,176 | 972 | #%% [markdown]
# # Joint embedding of connectivity and morphology
# > Here I try to accomplish this on the maggot data using the MASE approach.
#
# - toc: true
# - badges: true
# - categories: [pedigo, maggot, graspologic]
# - hide: false
# - search_exclude: false
#%%
# collapse
import logging
import os
import time
fro... |
3af2eb816b8b455cce9539385a77f89e1de096216fc3258afe5e08cd290b19e9 | Python | 28,186 | 257 | """Import the prepared Model 3 into a separate UE5 content folder."""
import unreal,json,re,traceback
from pathlib import Path
import os
P=Path(os.environ.get('CARLA_MODEL3_WORKDIR',Path(__file__).resolve().parents[4]/'artifacts/tesla-model3'));D=P/'export';manifest=json.loads((D/'manifest.json').read_text())
DEST='/Ga... |
5e5768050f57c3c7ac1915eafd2aebd5097c45d463bfe0d70094013a33d81078 | Python | 28,187 | 632 | import random, sys
from typing import Union, List
import os
from networkx.classes.function import to_undirected
import networkx as nx
import ipdb
import torch
import numpy as np
import matplotlib.pyplot as plt
import torch.nn.functional as F
from numpy import ndarray
from torch_geometric.utils import to_networkx
from t... |
2362eeea3a84c8f2034310c0ef064092c7b4d1e1294eb17fa9d6fc4167e428ac | Python | 28,209 | 714 | # 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... |
7a83fbd16649fb4c2b6cf8c3785b87db7ab6466a5213c55cb6f8e7210cd11faa | Python | 28,223 | 589 | import argparse
from genericpath import isdir
import math
import os
from pickle import NONE
from unicodedata import normalize
from numpy.core.numeric import identity, normalize_axis_tuple, zeros_like
from torch._C import TensorType
from torchvision.utils import save_image
import glob
import torch
import numpy as np
fro... |
98669f2d894b5e39bc618b0e4b0b02b76f9f80846f379d4f885ac0737f469376 | Python | 28,225 | 737 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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 os
import yaml
import re
import doc_gen_snipet... |
cab1538b95afc7c820a783529941c59d4d1a84c884293b18d91eca142d05dfa3 | Python | 28,309 | 705 | #! /usr/bin/python
# -*- coding: utf8 -*-
import itertools
import os
import time
import numpy as np
import tensorflow as tf
from datetime import datetime
from sklearn.metrics import confusion_matrix, f1_score
from tensorflow.python.framework import tensor_shape
from tensorflow.python.ops import array_op... |
ef49227cdce795d260915d9e0728a8f02cc15eea0a9f5f4e3470fff4d4f0260c | Python | 28,339 | 943 | #%% [markdown]
## Modeling the distribution of neural networks
# > An attempt to characterize the distribution of neural network parameters that are learned on the same task
# - toc: true
# - badges: true
# - categories: [pedigo, graspologic]
# - hide: false
# - search_exclude: false
#%%
# collapse
import os
import wa... |
51be8c63a2324b579623cb3dcd1839785769aaa5532f04714a25863e58c26484 | Python | 28,352 | 731 | # This script is part of navis (http://www.github.com/navis-org/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... |
9c190ec94307f650a55338870385fe9740d7a7cca3efe3d843d9d24e0ce35a15 | Python | 28,362 | 654 | import torch
import torch.distributed as dist
import torch.nn as nn
from mmcv.cnn import ConvModule, Scale, bias_init_with_prob, normal_init
from mmcv.runner import force_fp32
from mmdet.core import (anchor_inside_flags, build_assigner, build_sampler,
images_to_levels, multi_apply, multiclass_n... |
4b6c4f398fd63aa2bbc4877cffa071c230b3b2dc85864484dd517ec7467b4164 | Python | 28,434 | 697 | import os
import math
import time
import unittest
import vtk, qt, ctk, slicer
import numpy
from slicer.ScriptedLoadableModule import *
import logging # NOTE: logging is slow!
#
# CM_Tracking_Analysis
#
class CM_Tracking_Analysis(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, avail... |
6ef476cf52ee5c8b6c7934a68e9a8fcbca496d050409f5aa78455a39471b9eb1 | Python | 28,478 | 763 | import tensorflow as tf
import numpy as np
from numpy import (zeros, where, diff, floor, minimum, maximum, array, concatenate, logical_or, logical_xor,
sqrt)
from tensorflow.python.framework import tensor_shape
from tensorflow.python.keras.utils import conv_utils
from tensorflow.python.keras.engine.b... |
34c69647b29eec2d32e97baf2a9bce4bb8506db81c49448a1007429711d3a317 | Python | 28,502 | 554 | import argparse
import math
import os
from re import I
from unicodedata import normalize
from numpy.lib.utils import deprecate
from torchvision.utils import save_image
import torch
import numpy as np
from PIL import Image
from tqdm import tqdm
import numpy as np
import skvideo.io
import imageio
import curriculums
imp... |
b18f2f19798bddbfa36dc7cc40703fbf32c9edb5d03b22b291800cb557632019 | Python | 28,541 | 656 | # coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import logging
import math
from os.path import join as pjoin
import torch
import torch.nn as nn
import numpy as np
from torch.nn import CrossEntropyLoss, Dropout, Softmax, Linear, ... |
781d77f23be362f7f5eb8df6bcc70d8e0cea634b06647af83a61341eb4d35e9f | Python | 28,575 | 822 | from timeit import default_timer
from pathlib import Path
from typing import Union
import sys
import warnings
import torch
from torch.cuda import amp
from torch import nn
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel as DDP
# Only import wandb and use if installed
wandb_availa... |
1ac56bb99d6f7bb0f9694f5eec995e20e762e9e53c0e3cca6af7798f695a9b67 | Python | 28,604 | 734 | from typing import List, Optional, Tuple, Union
from ..utils import validate_scaling_factor
import torch
from torch import nn
import tensorly as tl
from tensorly.plugins import use_opt_einsum
from tltorch.factorized_tensors.core import FactorizedTensor
from .channel_mlp import ChannelMLP
from .einsum_utils import e... |
f99ee07ea9d57fb568344b4ba0840463070da8f7c17a79da49c2774634b0d1bd | Python | 28,608 | 862 | #%% [markdown]
# # Comparing methods for SBM testing
#%%
import csv
import datetime
import time
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib.transforms import Bbox
from pkg.data import load_network_palette, load_unmatched
from p... |
9720aa2508f35cac48132466fcdb4bb5dc263107e3d343ccae6c31e2faaa4d54 | Python | 28,671 | 671 | """
File: combine_and_plot.py
Created: 2020/03/30
Last Changed: 2020/06/09
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, eithe... |
3d77e3a9521cd3d4b76385ed4ef38d62035af0823e57e429495db9b10fab7b39 | Python | 28,678 | 823 | """Parser for phys2cvr."""
import argparse
from phys2cvr import _version
__version__ = _version.get_versions()['version']
def _get_parser():
"""
Parse command line inputs for this function.
Returns
-------
parser.parse_args() : argparse dict
"""
parser = argparse.ArgumentParser(
... |
c7f7434eec762d85d722b5b4af787319dd1f67548b7215f1ae38e5598d6c168b | Python | 28,723 | 767 | import numpy as np
import pandas as pd
import sqlite3
import os
import subprocess
from pybedtools import BedTool
from collections import defaultdict
from enum import Enum, auto
# original code written by Dennis Kao: https://github.com/ccmbioinfo/crg/blob/master/SVRecords/SVAnnotator.py
class SVTYPE(Enum):
def _ge... |
99d9a741757e7ef951905a023fa0f7190b927597bbb5b1f654eb6c5314459c82 | Python | 28,725 | 598 | #%%
import os
import sys
try:
os.chdir('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
print(os.getcwd())
except:
pass
from pymaid_creds import url, name, password, token
import pymaid
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# allows text... |
839f25ba13ef8c704acefa77761c262651264253ecc4d47da791e588864afe00 | Python | 28,781 | 621 | # Built-in
import csv
import json
import os
from pathlib import Path
# Third-party
import pandas
import pandas as pd
"""
This file converts the two types of configuration files, i.e. CSV and JSON to each other.
"""
class ConfigConverter:
def __init__(self, input_data: dict | str | Path) -> None:
if ty... |
33b2840002ca59b7e8e4a206470ab163bb097aa6eab0a100ae483d7eefbc0c85 | Python | 28,806 | 741 | import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import time
import pickle
import matplotlib.path as mpath
import matplotlib.lines as mlines
import matplotlib.patches as mpatches
from matplotlib.collections import Pa... |
d8de277ed7fdfcf06896b09d478fd5e7a438eab682696b57a0a981d5192ed3f7 | Python | 28,879 | 676 | import datetime
import os
import cv2
from dateutil.relativedelta import relativedelta
import descarteslabs as dl
import geopandas as gpd
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
import rasterio as rs
import requests
import shapely
from shapely.validation import make_valid
from tensorflo... |
ef2fec5b1dbde636644253290961dad5a4c48400ef7d0fe5f49aa271e8606494 | Python | 28,903 | 629 | #Author : Maria-Anna Trapotsi, Layla Hosseini-Gerami and Lewis Mervin
#Emails : mat64@cam.ac.uk and lh605@cam.ac.uk
#Supervisor : Dr. A. Bender
#All rights reserved 2021
#Protein Target Prediction using on SAR data from PubChem and ChEMBL_28
#Molecular Descriptors : 2048bit circular Binary Fingerprints (Rdkit) - ECFP_... |
d41aa183cfaf4d60d547646902a281add473487fa2afe669546e99aadcba85ac | Python | 28,907 | 769 | # 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... |
420867f6868d29ef3a6e3c1da9235d16e413fd7435b09f6303bf78eca3bd8d69 | Python | 28,921 | 694 | """
# Copyright 2019 by Gorka Munoz-Gil under the MIT license.
# This file is part of the Anomalous diffusion challenge (AnDi), and is
# released under the "MIT License Agreement". Please see the LICENSE
# file that should have been included in the repository containing the file
# (github.com/gorkamunoz/ANDI)
This f... |
fd15344708df2d7a655a033001a091336f52fbfdf8c7cd5fb6e6e5d0c0f38093 | Python | 28,926 | 879 | """
data_losses.py contains code to compute standard data objective
functions for training Neural Operators.
By default, losses expect arguments y_pred (model predictions) and y (ground y.)
"""
import math
import warnings
from typing import List
import torch
from .differentiation import FiniteDiff
# Set warning ... |
3c8fb414a3841f26eec482830a163bb2815f6d3cbdffb90ffbc56814777c798e | Python | 28,928 | 684 | import threading
from collections import OrderedDict
from random import Random
from typing import Dict, Iterator, List, Optional, Union, Tuple
import numpy as np
from torch.utils.data import DataLoader, Dataset, Sampler
from rdkit import Chem
from .scaler import StandardScaler
from chemprop.features import get_featur... |
6844be8f3e36522e3d5849b09c32f059074f2e07220f47a86e3aa86f2bc3f389 | Python | 28,939 | 847 | """
========================================================================================================================
Input/Output Module
========================================================================================================================
(adapted from NeuroTools.io)
Handle all the inputs an... |
04421e2a13d32b1f89427489a710d614725e8deefe644810f72ea6e51fbcdf7a | Python | 28,948 | 898 | # %% [markdown]
# # THE MIND OF A MAGGOT
# %% [markdown]
# ## Imports
import os
import time
import colorcet as cc
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 scipy.linalg import orthogonal_procrus... |
4ed21761720670baf71048deaf8133b8d8c064ec1c4c8a2bb5732006b77a6ae2 | Python | 28,966 | 739 | # System libs
import os
import time
# import math
import random
import argparse
from distutils.version import LooseVersion
import math
# Numerical libs
import torch
import torch.nn as nn
import torch.utils.data as data
import matplotlib.pyplot as plt
from data.augmentations import Compose, Scale, RandomSizedCrop, Adjus... |
5ee547b33c51c6fdf90182f22eabd24a3c1b81e6f80a80aeaf36f1d423a38a1a | Python | 29,020 | 730 | # Visualization
import matplotlib.pyplot as plt
# Builtin
from pathlib import Path
import sys
from math import nan
import pdb
# This computer git repos
from project.project_manager_module import ProjectManager
"""
Use keyword substring "file" in filenames, and "folder" in folder names to assert that they are turned ... |
b10f625acb04d54f60345c73f561583951f791310ffc65bbd677c33a1310329d | Python | 29,035 | 715 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Main functions of AxoID with the full pipeline.
It runs AxoID on experiment, detecting and tracking ROIs, then
extracting fluorescence traces and saving outputs.
Created on Wed Jun 26 13:30:52 2019
@author: nicolas
"""
import os, os.path, sys
import subprocess
import... |
bd7f19d0f53a005e54d6d1f5509556ae34c10258b9c1f7b1b14c8e6aed3f1564 | Python | 29,043 | 838 | """Code to determine branches of strong connections from activity"""
import logging
import numpy as np
import pandas as pd
from tqdm.auto import tqdm as pbar
import matplotlib.ticker
import matplotlib.cm
import matplotlib.colors
from tctx.util import spike_trains as spt, plot, parallel, plot_graph
from tctx.analys... |
cfddcb55e974b1a33dff2ca9d7164de5384a79758ae09704f87afc487b967fb4 | Python | 29,065 | 593 | import os
import imghdr
import numpy as np
import random
import torchvision
import torch
import threading
import multiprocessing as mp
import slideflow as sf
from os import listdir
from tqdm import tqdm
from os.path import isfile, join, dirname, exists
from slideflow.tfrecord.torch.dataset import MultiTFRecordDataset,... |
9678c7a0625895d4002fe84db45540cfe0cc0fbff331678f132fad56a0faeedc | Python | 29,069 | 681 | #!/usr/bin/env python3.9
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 13 09:14:45 2021
@author: paulmueller
"""
import numpy as np
import scipy.signal as scs
import pandas as pd
from datetime import date, datetime, timedelta
from scipy.spatial.distance import cdist
import scipy.optimize as sco
from sklearn.metrics i... |
c16f402119908742a4a25349b0dee0d3f5f3c30cb281bb018fb925559483544e | Python | 29,069 | 765 | import glob
import mne
import nirsimple as ns
import numpy as np
import scipy.io
from mne.channels import combine_channels
from pandas import DataFrame
from pathlib import Path
from sys import stdout
from tqdm import tqdm
PATH_HERFF_2014 = '../../data/dataset_herff_2014/'
PATH_SHIN_2018 = '../../data/dataset_shin_20... |
d88dd095aad71508f720fd6fbac03daa8e6adce2bfa1628a46cdc1cca612aaac | Python | 29,106 | 654 | #!/usr/bin/env python3
"""
File: decon_eqtl_ols.py
Created: 2021/09/27
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 Free Softw... |
43626792f6b64c49a1d81a90246f9cfe1026b448b3f1c59b7aee4676263816ec | Python | 29,117 | 696 | import torch
from blitz.utils import variational_estimator
from torch import nn
from numbers import Number
import torch.nn.functional as F
from torchnlp.nn import Attention
from constants.constants import GPU_NAME, CAUCHY_DIST, NORMAL_DIST, LOGNORMAL_DIST, STUDENT_T_DIST, LAPLACE_DIST
from neural_networks.base_models ... |
cd6f22e7d32d5d8c3a056edcad7b442d40ea69ad6279013630a9052f2326ba1b | Python | 29,117 | 783 | # Built-in
from typing import Any
# Third-party
import numpy as np
import pandas as pd
from brian2.units import * # noqa: F403
from cxsystem2.core.exceptions import ParameterNotFoundError
__author__ = "Andalibi, V., Hokkanen H., Vanni, S."
"""
The preliminary version of this software has been developed at Aalto Un... |
0dec6c0f2fd7d8f8b9110c65f5b3aafb02a8ee4d1fe0f6c1f9b004cfb5c796c9 | Python | 29,124 | 749 | # System libs
import os
import time
# import math
import random
import argparse
from distutils.version import LooseVersion
import math
# Numerical libs
import torch
import torch.nn as nn
import torch.utils.data as data
import matplotlib.pyplot as plt
from data.augmentations import Compose, RandomSizedCrop, AdjustContra... |
68d6953b81ddc5f72c034f9d3d6aca7ec95cfe0562e9ee2a367189d9956838cb | Python | 29,126 | 987 | #%% Imports and file loading
import json
import os
import pprint
import sys
import time
from collections import defaultdict
from datetime import timedelta
from pathlib import Path
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import navis
import pymaid
from src.pymaid im... |
cb95d143162cf2fb1c6d641af389f69e50e554160d2882a2d92eb8dfb7c30e87 | Python | 29,129 | 730 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import warnings
import grpc
import nre.grpc.protos.common_pb2 as nre_dot_grpc_dot_protos_dot_common__pb2
import nre.grpc.protos.sensorsim_pb2 as nre_dot_grpc_dot_protos_do... |
56e1243aefecbf3c28ae1bf6bbdd26ea6598d79468762ab8179d061bff1bb057 | Python | 29,190 | 630 | from __future__ import absolute_import, division, print_function
import torch, math, os, sys
import numpy as np
from torch.nn import Parameter
from torchnlp.nn import WeightDrop
from functools import wraps
from copy import deepcopy
from torch import nn
import torch.utils.data as data
from torch.nn.utils.rnn import pad... |
685197599e77b924d3333cd7dc2edd0647ad91cc70d2458d59e0ef078c438899 | Python | 29,197 | 952 | # %% [markdown]
# ##
import os
import time
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.match import GraphMatch
from graspy.models import DCSBMEstimator... |
cc14a2af570710346c9dbf463bcf83b533b3df241d524c0c62bbfc916a20817d | Python | 29,221 | 778 | # ----- IMPORTS and STUFFS -------------------------------------------------------
from flask import Flask, request, jsonify, render_template, flash, redirect, url_for, send_file, send_from_directory, abort, session
from flask_cors import cross_origin
from werkzeug.utils import secure_filename, safe_join
from werkzeug.... |
3537c09c40c4958b27b79e630bc5edf24f0cc5c33d388c329773841501789f30 | Python | 29,246 | 988 | #%% Imports and file loading
import json
import os
import pprint
import sys
import time
from collections import defaultdict
from datetime import timedelta
from pathlib import Path
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import navis
import pymaid
from src.pymaid im... |
c4ad45a708cf5d0c734e2e54137657568cbe7e1f7039b431838874a0753f36d0 | Python | 29,262 | 797 | import os
import pickle
import nrrd
import csv
import nibabel as nib
import numpy as np
import pandas as pd
import cv2
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
import pyqtgraph.opengl as gl
from .uuuuuu import read_qss_file, make_contour_img, read_excel_file, hex2rgb
from .o... |
094ee3777df6884560bf16007550d79167a14e01dd8cf9a5bdb2eed317a30da4 | Python | 29,293 | 848 | # Time-stamp: <2025-02-15 14:28:29 Tao Liu>
"""Module Description
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file LICENSE included with
the distribution).
"""
# ------------------------------------
# python modules
# -------------------------------... |
7e2dce03403ac382ac55796d3719ca1f572aca529803b5e8de4b25899750943f | Python | 29,316 | 558 | '''
Model Inference:
- Load data
- Load model
- Get heatmaps
- Evaluate on heatmaps
Based on submit_prediction.py
'''
import collections
from datetime import datetime
import numpy as np
import pandas as pd
import os
import pickle
import sys
import json
import argparse
from pathlib import Path
import torch
import tor... |
faeaa173c58d1168a76ce4675a2ad0d8431e3a981a3ebe2366c1d5b4da0c8e28 | Python | 29,320 | 733 | # Built-in
import decimal
import itertools
import math
import multiprocessing
import os
import shutil
import sys
import time
from multiprocessing.connection import wait
from pathlib import Path
from typing import Any
# Third-party
import numpy as np
import pandas as pd
from numpy.random import SeedSequence
# Local
fr... |
19a7a137d29664375811d8c573bbeac4c97ebbe63345629a1fe0e57f8240fae6 | Python | 29,324 | 805 | """
This module provides the `TrainModel` class and supporting methods.
It has been modified to retrieve the cell type embeddings used during training.
It also works with RPKMFileSampler to pass cell targets to the model as input,
which specify the cell types to train on for each sequence in the mini-batch.
The bat... |
bda9974414dbf94e12bf0845696b5660121b9a0e4a243d63aa71acd817072996 | Python | 29,326 | 767 | 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 utils.EventDetection_utils as EventDetection_utils
import utils.general_utils ... |
67ad12b8ee6efc0e0cfbe3bac5d8ec2f240919bd77e4e38c46646ec3b037a324 | Python | 29,353 | 1,004 | # Builtin
import os
import sys
import shutil
from copy import deepcopy
# Testing
import pytest
from pathlib import Path
# Analysis
import pandas as pd
import numpy as np
# Dev
import pdb
import matplotlib.pyplot as plt
# Current package
from project.project_manager_module import ProjectManager
from data_io.data_io... |
b96f101370280b940212cd6c71ce07d27ad2cdcd85a45398e4cfbc384b2d36db | Python | 29,353 | 628 | """
Genereate ablated modality images. One time use code.
Modality ablation experiment. Generate and save the ablated brats images
Generate dataset with
Save in the directory: Path(brats_path).parent / "ablated_brats", and can be loaded with the script:
T1 = os.path.join(image_path_list[0], bratsID, bratsID+... |
b4081988d3b8269403fc64af454d95b5155b831c54626c0c3afbd93382ec594e | Python | 29,371 | 697 | import collections
import itertools
import logging
from abc import ABC
from dataclasses import dataclass, field
from typing import Any, ClassVar, Dict, Iterable, Iterator, List, Optional, Tuple, Union
from urllib.parse import quote
import requests
from ontoportal_client.api import PreconfiguredOntoPortalClient
from pr... |
97fe9c854a71a6c672939c57c642ea037f03ee0ababbe4d0262062582a354dd5 | Python | 29,403 | 631 | #!/usr/bin/env python
from abc import ABC, abstractmethod
from copy import deepcopy
import random
import torch
from torch import nn
from torch.optim import Adam
from drugex import utils, DEFAULT_DEVICE, DEFAULT_GPUS
import time
from torch.utils.data import DataLoader, TensorDataset
from tqdm import tqdm
import numpy a... |
59db0ed1f8b79738ac3429748d43b9a591afce5b652c2f087d9b4e21908c7d1c | Python | 29,418 | 993 | # Auto generated from cx.yaml by pythongen.py version: 0.9.0
# Generation date: 2023-04-09T14:06:51
# Schema: cx
#
# id: https://w3id.org/oaklib/cx
# description: NDEX CX datamodel
# license: https://creativecommons.org/publicdomain/zero/1.0/
import dataclasses
import re
import sys
from dataclasses import dataclass
fr... |
2e1dd5d32090358d676b439b44c97fc87f9f060a8ec6c88478d221ecbb5c3bb6 | Python | 29,426 | 2,163 | """Finnish Parliament Data Tools.
The MP id filter below lists former MPs that have quit before the first publicly available
recordings in autumn 2008. Therefore, they will not appear the Finnish Parliament datasets.
The filter is used when building the MP data table.
"""
MPID_FILTER = [
"102",
"104",
"10... |
77001ae28eb90652897bf3191f51883a3ecf1b73de9edc69417c4710d9eb5df7 | Python | 29,448 | 502 | # import pydevd
# pydevd.settrace('10.211.55.3', port=4200, stdoutToServer=True, stderrToServer=True)
db_server = "spike.asu.edu"
db_name = "neuroml_dev"
#model_csv_file = "ChannelsReformat.csv"
#model_csv_file = "ChannelsReformatConcModel.csv"
model_csv_file = "Traub2005_NT.csv"
import MySQLdb
import splinter
import... |
6543889f522a0d5b38b80ac70d922cbd150994ce514fd1f946b43557529c2bc6 | Python | 29,503 | 763 | ####################################################################################################
# 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 ... |
d030c5a6b79da25f806f2816ddbc8296bd1bba331c39734c9db6cfbe1bf419e9 | Python | 29,504 | 451 | """Scenic-driven hybrid capture: a Scenic scenario controls the ego and every other agent on the proxy road of a NuRec
scene, the ego carries the recorded camera, and every frame is composited by hybrid_video_finish.py exactly like a
hybrid_video.py run (same A_/B_/E_ npz layout and meta.json).
Where hybrid_video.py r... |
4031853520d7a7efad6f39f5a0fda478fd16c344778bf24682fd88f13a5c7996 | Python | 29,541 | 770 | # SPDX-FileCopyrightText: © 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: MIT
"""
NUREC Multi-Camera Replay Script
This script demonstrates comprehensive camera setup for NUREC scenario replay in CARLA.
It showcases how to:
- Set up multiple NUREC cameras (front, left cross, ... |
9ad9cf219ca74e1b4336b21a473f53ef6ff99e4a2fbfbcb183e1d695abfa936d | Python | 29,646 | 616 | # 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... |
070f341acae5815dc224f835cb332664a964b6a82587526925ac0aaff3ce4a32 | Python | 29,664 | 616 | # 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... |
60ff89ab40b05cc53e714b0ff06e4ec89154df027c7424d281490232194bc05c | Python | 29,683 | 856 | import pytest
import torch
from mmcv.ops import DeformConv2dPack
from torch.nn.modules import AvgPool2d, GroupNorm
from torch.nn.modules.batchnorm import _BatchNorm
from mmdet.models.backbones import RegNet, Res2Net, ResNet, ResNetV1d, ResNeXt
from mmdet.models.backbones.hourglass import HourglassNet
from mmdet.models... |
1d008fa4a131d34bcd984b85070e9a587d6c8fd8fe1a5f7cf935959606dc3196 | Python | 29,752 | 749 | '''
Helper classes and functions used for plotting.
'''
from typing import Callable, Dict, Optional, List, Tuple
from functools import partial
import pickle
import numpy as np
import pandas as pd
import neo
import quantities as pq
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLoc... |
860911ecd008e23f6f733d754e1454051f890febb8296f776d61f98b7c055d98 | Python | 29,813 | 653 | import torch
import torch.nn as nn
from mmcv.cnn import normal_init
from mmdet.core import (anchor_inside_flags, build_anchor_generator,
build_assigner, build_bbox_coder, build_sampler,
force_fp32, images_to_levels, multi_apply,
multiclass_nms, un... |
57af0e13650862a3db21aa2101bd436c28c12380d7aee5ea2fc7bcea7f2e5f77 | Python | 29,875 | 823 | """Tests for the CROPro pipelines (crop vs resample) and bpMRI alignment check."""
from __future__ import annotations
import argparse
import json
import zipfile
from pathlib import Path
import numpy as np
import pytest
import SimpleITK as sitk
from cropro import CropConfig
from cropro.cli import (
_build_crop_r... |
ca7e0a90759391fc1e1c6c73d7a9302878bada709b0405e4f6d8e641f4ebf246 | Python | 29,886 | 1,061 | """
Implements forward-mode automatic differentiation for TensorFlow.
Author: Mengye Ren (mren@cs.toronto.edu)
Usage:
Example 1:
x = Variable(1.0)
y = build_model(x)
grad = forward_gradients(y, x) # Gradient of y wrt. x, same shape as y.
Example 2::
# When x is a vector, we compute the gradient of y wrt. a... |
5d24d7f8b05917567addb1887bfd56f7ea75957e203729e2214e8f4361910dd3 | Python | 29,893 | 642 | # SRC: https://github.com/tensorflow/tensorflow/blob/a4dfb8d1a71385bd6d122e4f27f86dcebb96712d/tensorflow/python/ops/image_ops_impl.py
from tensorflow.python import nn_ops
from tensorflow.python import math_ops
from tensorflow.python import array_ops
from tensorflow.python.framework import dtypes
from tensorflow.python.... |
0387d87ca8f48d0092f620ae3e477505521dba2f8cdc811f1de0bc0855138ad5 | Python | 29,915 | 743 | # Author: Proloy Das <proloy@umd.edu>
"""2d projections of an ROI/mask image visualization via nilearn.plotting.glassbrain
Contains code from nilearn governed by the following license (3-Clause BSD):
Copyright (c) 2007 - 2015 The nilearn developers.
All rights reserved.
Redistribution and use in source and binary f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.