sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
cb3d671695e9b510981f22ea6635f1190342d89de1d10251bda836de78087b0a | Python | 20,587 | 536 | """Adapted from:
@longcw faster_rcnn_pytorch: https://github.com/longcw/faster_rcnn_pytorch
@rbgirshick py-faster-rcnn https://github.com/rbgirshick/py-faster-rcnn
Licensed under The MIT License [see LICENSE for details]
"""
from __future__ import print_function
import torch
import torch.nn as nn
import to... |
867154e8f06f23d56d88ff4404cdef89ab9a60e2a982fc198a6c2802de2d24fd | Python | 20,590 | 649 | """a collection of functions to process multi-neuron spike trains using pandas DataFrames"""
import numpy as np
import numba
import pandas as pd
ms_to_s = .001
class Sorting:
"""a way to sort indexable items. For example, for neurons in raster plots.
A sorting is just a map from a set of real indices (for ... |
e9be91b8cfaf6a80ff1f30fcb6dd0a5c192c5de958dc87b2601a45d11febefd2 | Python | 20,647 | 315 | # Auto generated from summary_statistics_datamodel.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-03-29T19:03:43
# Schema: summary-statistics
#
# id: https://w3id.org/linkml/summary_statistics
# description: A datamodel for reports on data
# license: https://creativecommons.org/publicdomain/zero/1.0/
impo... |
ebc77848119352d7cc7a43663845faab951b2b3c6fb2ad390807b3482fef59d5 | Python | 20,647 | 825 | # %% [markdown]
# ##
import os
import time
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import scipy
import seaborn as sns
from scipy.optimize import curve_fit
from graspy.match import GraphMatch
from graspy.plot import heatmap
from graspy.simulations import sbm
from src.data import loa... |
8bc56ed0a99436b5e291d3e9ca24875cddb8ff14191e8bca9e325f8e30936993 | Python | 20,650 | 446 | #!/usr/bin/env python3
"""Import an FBX vehicle into CARLA as a spawnable vehicle.<make>.<model>.
python3 import_vehicle.py ~/models/SK_MyCar.fbx \
--make ford --model transit --base-type truck --generation 3 \
--wheel-radius 40
The FBX must be a SKELETAL mesh whose wheels are bones named
`Wheel_F... |
c2e13f2123f17c1eb9b3f1cd6cbc907f1951e4f1a2f5761303227382e1fa9de3 | Python | 20,676 | 448 | """
Script which predicts on a set of data and saves the results to disk.
Comparable to bin/evaluate.py except ground truth data is not needed as
evaluation is not performed.
Can also be used to predict on (a) individual file(s) outside of the datasets
originally described in the hyperparameter files.
"""
import loggi... |
6a2fa3986bf433f39c00a4c3aa29f371b8e0249dcff6671b20f59a505b5b38f8 | Python | 20,677 | 626 | import warnings
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.colors import Normalize
from scipy.interpolate import interpn
import seaborn as sns
from scipy import stats
from . import modelling, u
COLORS = plt.rcParams["axes.prop_cy... |
710b56273ec0f208a73e9729272ec73a9fcaebe15aaf9c16f9b654558a07753e | Python | 20,691 | 533 | """
Constants
"""
import tensorflow as tf
import os
import datetime
import numpy as np
# RUN CONFIG
REMOTE = False # os.popen('hostname').read().encode('utf-8') == 'medtech-beast' #os.environ.get('REMOTE') == 'True'
# Remote execution
DEV_ORDER = 'PCI_BUS_ID'
GPU_NUM = '0'
# Dataset generation constants
# See batch... |
94e58eb4b1e2fbd0433407af36e4d9737861b80ae3cdc2f088324a859b93c645 | Python | 20,696 | 684 | #%% 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 networkx as nx
import numpy as np
import pandas as pd
import navis
import pymaid
from src.io import savecsv
from src.pymaid import ... |
2653d6d9ba277e6b51c4c7fb54e9fb18e6880ab5141cb54882f844b41e82427a | Python | 20,702 | 564 | #!/usr/bin/env python3
"""
Phys2bids is a python3 library meant to set physiological files in BIDS standard.
It was born for Acqknowledge files (BIOPAC), and at the moment it supports
``.acq`` files and ``.txt`` files obtained by labchart (ADInstruments).
It requires python 3.6 or above, as well as the modules:
- `n... |
587df5466654308e0daf6b13f684d8c85e30cb9bd8bcbb8dbe8c73929c3a72b6 | Python | 20,706 | 494 | import warnings
import time
import numpy as np
from tensorflow import keras
import os
import h5py
import random
from PIL import Image
import nibabel as nib
from nilearn.image import resample_img
from skimage.exposure import equalize_adapthist
from scipy.ndimage import zoom
import tensorflow as tf
import ddmr.utils.con... |
fd446c76e95a98c385fb4722c4f9ef5608d6149c450191e3b9d046a0696e5080 | Python | 20,726 | 584 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 23 15:28:50 2021
@author: alexandra
"""
import pandas as pd
import matplotlib.pyplot as plt
import scipy as sp
import numpy as np
import os
import seaborn as sbn
from statannot import add_stat_annotation
import itertools
########################... |
7f43a9d4e3a3e00c6ea90eec2a858f3e3b74cf7fe5dd3aa82895568f90ccd7b7 | Python | 20,731 | 473 | import dataclasses
from functools import lru_cache
import jax.numpy as jnp
import numpy as np
import scipy.sparse as sp
from .typing import Size, Size3, Spacing, Optional, List, Union, Dict, Op, Tuple
from .utils import curl_fn, yee_avg, fix_dataclass_init_docs, Box
try:
DPHOX_IMPORTED = True
from dphox.patt... |
0b81c59076e15d041847a3ea252e2aaca27699692c887d985977aafe25b22d5a | Python | 20,744 | 548 | import torch
import torch.nn as nn
from torch.nn import init
import functools
from torch.autograd import Variable
from torch.optim import lr_scheduler
import time
import numpy as np
###############################################################################
# Functions
############################################... |
9dbbcff1ecbbbfa6e051bed2a63ba222c07ea9b351f6963ed9645e930d69d6b5 | Python | 20,773 | 625 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""phys2bids interfaces for loading extension files."""
import logging
import warnings
from copy import deepcopy
from itertools import groupby
import numpy as np
from phys2bids.physio_obj import BlueprintInput
LGR = logging.getLogger(__name__)
OPEN_ISSUE = (
"The f... |
bc52f9b6ecbef5f10522cd69e42b465f263eecf279920fc04499728c522a5a45 | Python | 20,803 | 533 | ######################################################################################88
import sys
import os
from os.path import exists
import pickle
from collections import OrderedDict
from sys import exit
import numpy as np
import pandas as pd
import tensorflow as tf
import train_utils
import random
from timeit impo... |
410b19d8dae4face988ff73a1cf4f1a1eff2e3934174e2db5a33d48fdd40bcfe | Python | 20,834 | 376 | import logging
import os
import cv2
from tqdm import tqdm
import numpy as np
import cupy
from sklearn.preprocessing import normalize
from skimage.exposure import equalize_adapthist
from termcolor import colored
from typing import Union, List, Iterable, Dict
import re
import pandas as pd
from src.util.track import CSR... |
7439c361606d6af18f80fc790225d6046163209ed167204d69ea0a915f29f357 | Python | 20,838 | 604 | import SimpleITK as sitk
import nibabel as nib
import matplotlib.pyplot as plt
import numpy as np
import statsmodels.api as sm
from sklearn.covariance import MinCovDet
from sklearn.neighbors import KernelDensity
from scipy.signal import argrelmax,argrelmin
import os
from scipy.optimize import curve_fit
from sklearn.mix... |
4fc9c103c9286268bc5fbc695a282b24d6fc04fc2d8767c865362e3beef3872a | Python | 20,854 | 452 | from drugex.logs import logger
from drugex import DEFAULT_DEVICE, DEFAULT_GPUS
import sys
import os
import os.path
import json
import numpy as np
from datetime import datetime
import joblib
import pandas as pd
import optuna
import math
from sklearn.cross_decomposition import PLSRegression
from sklearn.naive_bayes imp... |
bea111b30d1e3e88dac2d3611b7286980c5639487a937eefbda670042f049bf3 | Python | 20,857 | 417 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 5 21:42:12 2020
This script will take different FASTQ files and plot the porcentage of predicted reads per class
@author: labuser
"""
from Bio import SeqIO
import random
import os
import numpy as np
import pandas as pd
from keras.preprocessing.s... |
e22d550c4192f823a71cfd73ba4ca2295a782722708853ebad62ac2ad18888b2 | Python | 20,857 | 608 | from __future__ import annotations
import json
from typing import TYPE_CHECKING, Any, Callable, List
import os
import warnings
import pandas as pd
import numpy as np
import trackpy as tp
import logging
from glob import glob
import dask.array as da
import dask_image.ndfilters
from skimage.filters import sato, threshold_... |
e912336f6991436ee44541755bf1fbbbe8cb8f7f5aa4520d914f098541d8ea73 | Python | 20,858 | 742 | # %% [markdown]
# ##
import os
import warnings
from itertools import chain
import matplotlib as mpl
import matplotlib.gridspec as gridspec
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 sc... |
0d89fc2e95813fbb0f520e2194f361abae92f8345593c720a49950c666da070b | Python | 20,871 | 547 | ####################################################################################################
# Copyright (c) 2019 - 2021, 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 ... |
ede5ea166249d2478e49a1df42054b8fef4afb9d710a3eb26937cb9763af9c88 | Python | 20,896 | 503 | # 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... |
a97c79cc58d0973755353bf2fe6970490f7e325e5fdb3b85fba26022bd71b997 | Python | 20,917 | 532 | #!/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>.
"""
Raycast sensor profiler
This script can be used to test, visualize and p... |
8bb2a6fac7ca0827cad13e51e27fdd5fb213849f1357aeb9f24fd025415ae28a | Python | 20,936 | 534 | # ----------------------------------------------------------------------
# LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
# https://www.lammps.org/ Sandia National Laboratories
# LAMMPS Development team: developers@lammps.org
#
# Copyright (2003) Sandia Corporation. Under the terms of Contr... |
1f8497d925c81e677e7097bef3c5ccc14a6839fff041f3c42a5535d3b6285309 | Python | 20,942 | 500 | #%%
import os
import sys
try:
os.chdir('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/maggot_models/')
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
except:
pass
from pymaid_creds import url, nam... |
4618a394d8c68308f9e39db0268d9488e8ddd722c011aa0ee0a09949d1c0390f | Python | 20,942 | 421 | #!/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>.
"""Visualize the skeleton of a pedestrian"""
import math
import argparse
impo... |
04296548a3afbd49b76defed5d91a20b5956bea35d1ab87d45117b7bb18f6ff6 | Python | 20,943 | 565 | # 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... |
d22b2648c83fff1a4875161309d38cdb5d9a4ed611507612ad5892df0d518dda | Python | 20,948 | 568 | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
'''
@author: Mahbub Ul Alam (mahbub@dsv.su.se)
@version: 1.0+
@copyright: Copyright (c) Mahbub Ul Alam (mahbub@dsv.su.se)
@license : MIT License
'''
import numpy as np
from sklearn.metrics import accuracy_score, precision_score, recall_score, confusion_matrix
from sklear... |
ef96ca9fcf8e20a24525e7ec8851fb6a79b7da4e559077de02268429c566bc77 | Python | 20,952 | 468 | import os
import itertools
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.colors
from matplotlib.gridspec import GridSpec
import seaborn as sns
from tqdm import tqdm
from .seqbaseline_generation import normalize_ig_contributions_total, apply_quality_check_conv... |
78c021db2e74e8c419efa430241ab4420038f9759ca91503b8549673dba07fad | Python | 20,958 | 567 | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
'''
@author: Mahbub Ul Alam (mahbub@dsv.su.se)
@version: 1.0+
@copyright: Copyright (c) Mahbub Ul Alam (mahbub@dsv.su.se)
@license : MIT License
'''
import numpy as np
from sklearn.metrics import accuracy_score, precision_score, recall_score, confusion_matrix
from sklear... |
181f5945f09b3bfc56df4fded01e97a6413626877d8a398d7661019e9fe4bd30 | Python | 20,962 | 461 | #!/usr/bin/env python3
"""
File: compare_bulk_expression.py
Created: 2021/11/25
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... |
739aa4a1dfb57283c222dbf07072ec0077b31aea18315ea587fbf47227ee8dd6 | Python | 20,980 | 636 | import os
import time
import numpy as np
import random
import glob
import matplotlib
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
import torch.nn.functional as F
import torch.optim as optim
from sklearn.metrics import f1_score
import scipy.ndimag... |
961f133f9dac09e6ec1d8177b06ad6bcf022807726d374c33c07691aa6f13974 | Python | 20,981 | 465 | # %%
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
from data_settings import data_date, pairs_path
import pymaid
rm = pymaid.CatmaidInstance(url, token, name, password)
from contools import Celltype, Celltype_Analyzer, P... |
ac29c75fefe46767238aa17c1de5019b3b2e537432d926bf60808e52c1f77c50 | Python | 21,010 | 598 | # -*- coding: utf-8 -*-
"""Main module."""
from typing import Dict, Tuple
from typing import Iterable, List
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal, Poisson
from torch.distributions import kl_divergence as kl
from scvi._compat impor... |
6f21c36bba61d74698c14e739171de445d5797078f52471c3ff0a1cc54930079 | Python | 21,017 | 656 | # -*- coding: utf-8 -*-
"""Parser for phys2cvr."""
import argparse
from phys2cvr import __version__
def _get_parser():
"""
Parse command line inputs for this function.
Returns
-------
parser.parse_args() : argparse dict
"""
parser = argparse.ArgumentParser(
description=(
... |
f17aa34285a88b97f911b107dba2d7342a8019a9867777f1a5082df15c9ad3bf | Python | 21,031 | 467 | import sys
from pathlib import Path
import cv2
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset
import torchvision
from torchvision import transforms
import torchvision.transforms.functional as F
from skimage.util import random_noise
from dataloading.model import Camera
cla... |
21161192e9764c42ff6ae1840f558efa77fa116217d87c0d4511c85f84c22c64 | Python | 21,037 | 480 | import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader, Dataset
import pandas as pd
import numpy as np
import torchvision
import torchvision.transforms as T
from torchvision import models
import pytorch_lightning as pl
from pytorch_lightning.loggers import ... |
c2c9ff36fec4cffd70f2035a03a6ba10643b5a5672103b501d7d458dcc32bf08 | Python | 21,038 | 482 | 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.dense_ed import DenseED
import random
import pandas as pd
#import matplotlib.pyplot as plt
im... |
c35aee833d14b3bf977405828f3f5bd2b270a0660f0f8b09f298be1275dce0e2 | Python | 21,039 | 570 | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
'''
@author: Mahbub Ul Alam (mahbub@dsv.su.se)
@version: 1.0+
@copyright: Copyright (c) Mahbub Ul Alam (mahbub@dsv.su.se)
@license : MIT License
'''
import numpy as np
from sklearn.metrics import accuracy_score, precision_score, recall_score, confusion_matrix
from sklear... |
23908e6b73f01d5c0123a3dcbfe76c47eae0ee4c276281e089ccd624daf60db7 | Python | 21,073 | 583 | # Modified from flops-counter.pytorch by Vladislav Sovrasov
# original repo: https://github.com/sovrasov/flops-counter.pytorch
# MIT License
# Copyright (c) 2018 Vladislav Sovrasov
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... |
47172113adef21adb1717724b9bc5ec7cd611f33240988b34e6de4345cf197a1 | Python | 21,122 | 573 | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
'''
@author: Mahbub Ul Alam (mahbub@dsv.su.se)
@version: 1.0+
@copyright: Copyright (c) Mahbub Ul Alam (mahbub@dsv.su.se)
@license : MIT License
'''
import numpy as np
from sklearn.metrics import accuracy_score, precision_score, recall_score, confusion_matrix
from sklear... |
1b60867c90262e5ab7555c28273ccad79a75936d1ce99ded786e21de739d980f | Python | 21,160 | 485 | """
Implementation of UTime as described in:
Mathias Perslev, Michael Hejselbak Jensen, Sune Darkner, Poul Jørgen Jennum
and Christian Igel. U-Time: A Fully Convolutional Network for Time Series
Segmentation Applied to Sleep Staging. Advances in Neural Information
Processing Systems (NeurIPS 2019)
"""
import logging
i... |
c7b98bbf205e4495f61884bedf195e971bc70923b484ab6e9413d9a737d204a5 | Python | 21,160 | 587 | # 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... |
2a8238f4ffa5c1b964a484fa0832f856ebc5d899f91055932235e0e9871ebdcf | Python | 21,165 | 472 | #!/usr/bin/env python3
"""Spawn pedestrians that wander via WalkerAIController, and destroy them cleanly.
Commands:
spawn --count 30 [--speed-min 1.0 --speed-max 1.8] [--cross-factor 0.1]
[--seed 42] [--no-wander] spawn walkers + AI controllers
destroy ... |
386c9ee10ad2a1ea753361343fbb8172ffb0b3ca138827e451018e179d9122be | Python | 21,180 | 557 | """
Lexical Utilities
-----------------
Various utilities for working with lexical aspects of ontologies plus mappings
"""
import logging
import re
import typing as t
from collections import defaultdict
from pathlib import Path
from typing import Collection, Dict, List, Optional, Tuple, Union
import curies
from cur... |
8aeb94a6d40f517f4e0a3f8472e7c2a57a4717cb8e410c552326efcf772c9c07 | Python | 21,187 | 487 | from ExternalFunctions import crea_e_o_apri, savelookuptable, savepeaktrain
import os
from datetime import date
from Lif_Initialization import *
seed(val)
###########################################
# User defined simulation parameters
###########################################
# ---------- Simulation --------... |
649a119db0fa36e2e50bdeb202e00d4482b4164a8ac1ee5e312a5cdafb6242c9 | Python | 21,194 | 394 | #!/usr/bin/env python3
"""
@ Lina Teichmann
INPUTS:
call from command line with following inputs:
-bids_dir
OUTPUTS:
epoched and cleaned data will be written into the preprocessing directory plus the metadata
NOTES:
Preprocessing is done for every run separately and is based on Kr... |
f96a40a4f65e6704ee13947393cb3f52f9d30e66928d11eb2e207eb8996bb320 | Python | 21,199 | 881 | #%% [markdown]
# # Comparing edge weight thresholds
#%%
import datetime
import time
import matplotlib as mpl
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib.patches import Circle, FancyArrowPatch
from pkg.data import load_network_palet... |
907fb32188dab2480d015fd564a6bac8f3d47516caee90b0e7f0d2efe931804c | Python | 21,249 | 571 | """
This module provides the `PerformanceMetrics` class and supporting
functionality for tracking and computing model performance.
"""
from collections import defaultdict, namedtuple
import logging
import os
import warnings
import pandas as pd
import numpy as np
from sklearn.metrics import average_precision_score
from... |
ad7fce4c3db0129751a16d32e26fe92d10de6fa12378ec730177b81277b67bf7 | Python | 21,264 | 440 | # 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 provides GlobalRoutePlanner implementation.
"""
import math
import numpy as np
import networkx as nx
import carla
from agents.navigati... |
05f28fdbaa4aced0e433c47fdac6307dacb9c5786237b60ed25036d0a05fad6b | Python | 21,272 | 520 | import numpy as np
from tqdm import tqdm
import pandas as pd
import ciso8601
from pandas.api.types import union_categoricals
from grispy import GriSPy #https://grispy.readthedocs.io/en/latest/api.html
import re
import AIS_parameters
import collections
import os
earth_radius_km = 6378
earth_radius_m = 6378E... |
47855b4cbef6b5133d729b2c9dd398129a50df55dc5f5368a1915f7b06e990e5 | Python | 21,283 | 790 | import logging
import os
import tempfile
from collections import ChainMap
from pathlib import Path
from typing import Any
import numpy as np
from ppqm import chembridge, constants
from ppqm.calculator import BaseCalculator
from ppqm.chembridge import Mol
from ppqm.utils import linesio, shell
GAMESS_CMD = "rungms"
GA... |
e3d9142d40af7916544572a2d79be9b6a307db3dac102113fc4ff66b1b507576 | Python | 21,301 | 592 | import logging
import multiprocessing
from abc import ABC
from collections import defaultdict
from dataclasses import dataclass
from typing import Any, Dict, Iterator, List, Optional, Tuple
import kgcl_schema.datamodel.kgcl as kgcl
from kgcl_schema.datamodel.kgcl import (
AddNodeToSubset,
Change,
ClassCrea... |
b85ddac6a183b669bcb7ccd06ca339a390efc9f47db6b9f933ce1605b900dfe3 | Python | 21,333 | 597 | """Adapter for AmiGO solr index."""
import json
import logging
import math
import re
from dataclasses import dataclass, field
from time import sleep
from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple
import pysolr
from oaklib.datamodels.association import Association, NegatedAssociation
from oak... |
a749fc84274e51c9e1639fbdfeb7a15a23c605224d185b3e6f1b26c28580f025 | Python | 21,340 | 451 | #!/usr/bin/env python3
"""Import an FBX+XODR map into a CARLA source build, and verify the cooked
artifacts.
The map's source directory is an argument: pass the path the user named. It can
be anywhere on disk.
Handles both variants of the same pipeline:
* standard map — one <name>.fbx + <name>.xodr
* large map ... |
ee4172df66520c17b3e425f166a9870040e7ad9d9ca54a8d133485ee7066dfb6 | Python | 21,351 | 815 | #%% [markdown]
## Maggot embedding alignment
# > Investigating alignments of the maggot data embeddings
#
# - toc: false
# - badges: false
# - categories: [pedigo, graspologic, maggot]
# - hide: false
# - search_exclude: false
# %%
# collapse
import os
import pprint
import time
import matplotlib.pyplot as plt
import n... |
f6b424b7da82be0860831e73c58198da41e4fc93685ed3f92714ac9f1be4fba2 | Python | 21,356 | 483 | #!/usr/bin/env python3
"""Scaffold and validate a new ScenarioRunner scenario.
scaffold_scenario.py --name MyCutIn --town Town04 [--template T] [--out DIR]
scaffold_scenario.py --list-templates
scaffold_scenario.py validate --name MyCutIn [--out DIR]
Writes two files whose names ScenarioRunner requires to... |
27cdccec6d8adf5751906d0efe55bc57529a37a4d06df7c2a8a3dd5b8d45bc22 | Python | 21,366 | 447 | #%%
import os
import sys
try:
os.chdir('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/maggot_models/')
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
except:
pass
from pymaid_creds import url, nam... |
a377dfd39f03c87a1e6d2703fe1630f1fd1cd877f0be11bdfe608807a679f750 | Python | 21,409 | 683 | """Create tables from data-objects"""
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
import re
from warnings import warn
import numpy as np
from . import fmtxt
from ._celltable import Celltable
from ._data_obj import (
Categorial, Dataset, Factor, Interaction, NDVar, Scalar, UTS,
Var, ascategorial, ... |
24ef93fa11cb4bfcdeaaa32c70cdda3c704e878e87b54b5679366f35019ecb4f | Python | 21,424 | 625 | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... |
9a5e67a3bee9e13dc509e74f1893203a57d492f4cfe11314bbfa04ebd4de04e3 | Python | 21,436 | 591 | import glob
import json
import os
from typing import Any, Dict, Iterator, List, TypedDict, Union
import numpy as np
import numpy.typing as npt
import tensorflow as tf
from multi_phase import RANDOM_SEED
from multi_phase.utils.patch_utils import extract_patches, generate_indices
HU_MIN = -500
HU_MAX = 2500
# -------... |
9a68386993f238d6a250fe864f4024d3ab9f7c278cb9b46aa0ff53a2f19a9eac | Python | 21,450 | 509 | import collections
import math
import re
from functools import partial
from typing import Optional, Sequence
import torch
from mmcv.cnn import constant_init, kaiming_init
from torch import nn
from torch.nn import functional as F
from torch.nn.modules.batchnorm import _BatchNorm
from torch.utils import model_zoo
from m... |
61e555a59110b0ca1b2006c2110a0b1d60ce7ec40251666182a24c6bf02f32ef | Python | 21,460 | 550 | import logging
import unittest
import pronto
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.datamodels.voca... |
a51523111cc79839b08a681c323366f08b622d6a0e0c15bc7f2dcee6243ff373 | Python | 21,493 | 400 | # Import libraries
import math
import os
import numpy as np
import matplotlib
matplotlib.use('Qt5Agg')
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import cv2
import pickle
from collections import OrderedDict, Counter
from tabulate import tabulate
from scipy.spatial import distance
# 3d Bra... |
0c6ecb5e68e48d1f0df7c119b10a072f645343703f3bc72a060da8fcb5f20306 | Python | 21,510 | 504 | import json
import requests
from datetime import datetime
from bds_queries import IndividualDetailsQuery, ListAllAllenIndividuals, GetOntologyMetadata, ListAllTaxonomies
from bds_api.utils.taxonomy_config_utils import *
ALL_CELLS = "All cells"
CROSS_SPECIES = "Euarchontoglires"
today = datetime.today().strftime('%Y... |
4aca4ae49856f67f4624afd2742285952a164be5372178ccde860f989871ca88 | Python | 21,513 | 506 | #!/usr/bin/env python3
"""
File: plot_cell_fraction_for_snp.py
Created: 2022/05/02
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 Sof... |
cc476a0e1fcf3fc841335d92caa78d8ca692b7578450325ac75b38faf0c42278 | Python | 21,518 | 514 | '''
Define coupling and driving force based on hydrodynamic simulations of cilia.
- Sum up pair-wise interactions
- Assume that self-friction doesn't depend on phases of neighbouring cilia.
- This version is about x17 times faster than the old one, if max(order_g11) = max(order_g12), otherwise about x12 times.
Can po... |
0b6ed054ac559d9f250af5b04eb97cbd435ab814621ea904a39c07291fa2ff26 | Python | 21,547 | 539 | """Format one connectivity measure's result as a labeled xarray object."""
import inspect
import warnings
from collections.abc import Callable, Mapping
from typing import Any
import numpy as np
import xarray as xr
from numpy.typing import NDArray
from spectral_connectivity._input_handling import _SignalMetadata
from... |
9f83ef2ac0d3820c22e81faa8865950c6a937fdc6fd4299beffc7de651367788 | Python | 21,547 | 522 | #! /usr/bin/python
# -*- coding: utf8 -*-
import tensorflow as tf
import tensorlayer as tl
from . import iterate
import numpy as np
import time
import math
import random
def fit(sess, network, train_op, cost, X_train, y_train, x, y_, acc=None, batch_size=100,
n_epoch=100, print_freq=5, X_val=None, y_val=None,... |
5933f7a34def98ba9a7478379426a70632d2fd3a487da18c93f292b645870666 | Python | 21,548 | 506 | """
File: main.py
Created: 2020/10/14
Last Changed: 2020/10/27
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 ... |
539f64b987c96040b864d4f50ed4d8a8d04fe97f78faa4e2d38f7e1a325385d4 | Python | 21,584 | 613 | """
.. _finite_diff :
Finite Differences
==================
This tutorial demonstrates the use of finite difference methods for computing
derivatives of functions in neural operators. Finite differences are crucial for:
- Computing gradients and higher-order derivatives
- Implementing physics-informed loss functions... |
02f6f0c2ef7710db818aca1bdd7e8824c0e57f355dd8a2b4e54d10586ed8ff53 | Python | 21,616 | 496 | 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.dncnn import DnCNN
import random
import pandas as pd
#import matplotlib.pyplot as plt
import ... |
800e403e229eb74c4f2785313db102c5f0a37f19288b1724c82b8a1caff76ad2 | Python | 21,617 | 527 | import itertools
import json
from pathlib import Path
from typing import Dict, List, Optional
import datasets
import tomli
import torch
import torch.nn as nn
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.cuda.amp import GradScaler
from torch.o... |
c62731bb2bcb60ecc2b082e754785d71dacc0f2d05465c0800357a0cb3bdf6e9 | Python | 21,618 | 496 | 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 UnetN2N
import random
import pandas as pd
#import matplotlib.pyplot as plt
import... |
f7d854753fc06749c1b9a6e666dd194176699fb4cb57568737539bdb33ec9409 | Python | 21,630 | 559 | import os
import nibabel as nib
import sys
import numpy as np
import warnings
from os.path import join as jph
from bruker2nifti._getters import get_list_scans, nifti_getter
from bruker2nifti._utils import (
bruker_read_files,
normalise_b_vect,
from_dict_to_txt_sorted,
set_new_data,
apply_reorienta... |
ac773fd9c89bb7eba1726a65a68e12289b2539cddb498d20f2e691eee3192517 | Python | 21,635 | 306 | # 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... |
34358edf33695ab6e2eaba36420cc14b81402aabc9775b0c3d831f9f6e9fd24e | Python | 21,645 | 633 | # Auto generated from text_annotator.yaml by pythongen.py version: 0.0.1
# Generation date: 2023-09-16T18:49:46
# Schema: text-annotator
#
# id: https://w3id.org/oak/text_annotator
# description: A datamodel for representing the results of textual named entity recognition annotation results. This draws upon both SSSOM ... |
39a5e3fe7e9bbf65e1dfcdaaed4d115486dcf4ac70d38c830f332df6fe53fb24 | Python | 21,647 | 459 | ####################################################################################################
# Copyright (c) 2019 - 2021, 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 ... |
5431cb4080ca46961d2b101269b0a279dfd33373c922b781093cec636b63b05b | Python | 21,647 | 496 | 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... |
2f04a6bd13c9d8bfd6d0ee618942834222d68dd7b76082f425bf27f90cfba243 | Python | 21,674 | 638 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
"""Tools for loading data form eyelink edf files."""
from glob import glob
import os
import re
import shutil
import subprocess
import tempfile
import numpy as np
from .._data_obj import Dataset, Datalist, Var
from .._utils import ui
from .._utils.subp import ge... |
9bb2b49195c8d2b824157c9bfbdea27915c0bd071773da0816ccd5703ab35395 | Python | 21,674 | 564 | # 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... |
0c56dd03312aaebf945c907d70227b12fb0d65fc31a587ccdb3de46914ae1937 | Python | 21,676 | 760 | # notes
# ask michael if we can get the locations of the different cells
# this thing (LSE) but on the whole brain
# compare to the omni one
# bic curves for both
# compute ARI
# slides for tomorrow
# when we present (seems like it should be obvious)
# then show the result, know whether it is what they would have exp... |
6eb5e25e788878fec8f9db13d7a1f8df1c82f557ce0d0e51e0149be53372387a | Python | 21,678 | 498 | 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.dense_ed import DenseED
import random
import pandas as pd
#import matplotlib.pyplot as plt
im... |
b19ce53e7730e2d27e0796c82d404597d38f90d8a2c2edd63e3be8f3f59027fd | Python | 21,679 | 442 | import torch
import torch.nn as nn
import torch.nn.functional as F
from lib.models.core import BaseSequentialModel
from lib.distributions import Normal
from lib.models.loss import compute_label_loss, compute_decoding_loss, compute_contrastive_loss
class TREBA_model(BaseSequentialModel):
name = 'TREBA_model'
... |
b066d8b3ed55db4526500a9ffac6feac2c19baad10c87045da9743f1feb892fc | Python | 21,693 | 531 | #!/usr/bin/env python3
# Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
# de Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""Offline Traffic Manager navigation benchmark.
Runs a single TM-controlled... |
8d3c37e1df6096391ac56b3a11e5652766ee17a096ef4657c96c6617c328d40e | Python | 21,698 | 583 | # 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... |
8c4b08ef29ad50e0b3ecb4764769a86708011d0822a0da1e4b35c9d678091933 | Python | 21,717 | 716 | # %% [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... |
8d26b7854d9a4e50c55d8d6aeceb86a8242eec2a3c714dab7248bf8db0f62741 | Python | 21,737 | 881 |
# import matplotlib.pyplot as plt
import numpy as np
import sys
import math
import scipy.stats
from multiprocessing import Pool
from itertools import repeat
import more_itertools as mit
import matplotlib.pyplot as plt
plt.switch_backend('agg')
# from skimage.filters import threshold_otsu
# from skimage.filters import ... |
c6dfc86f0e06aaed0bbc215e8c5ae1a5696c8d1a462b77cb03531336bf29d1b8 | Python | 21,745 | 516 | # Auto generated from oxo.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-04-12T11:15:58
# Schema: oxo-schema
#
# id: https://w3id.org/sssom/oxo
# description: Schema for OLS OXO payloads
# license: https://creativecommons.org/publicdomain/zero/1.0/
import dataclasses
import sys
import re
from jsonasobj2 i... |
6b085e643b4011a890a743f7065c638ff35147a6c77c001ba9d0eae9a6d85bd6 | Python | 21,746 | 380 | 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 connections
... |
dc3a591542c5ac44d125b2b365670637dbb1303cd932518ede8f03d95cf1b129 | Python | 21,749 | 572 | # 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... |
a0cc55f724276bc91d0dc5cd6d6283e74f108bd38563a07e726e9d4ebd19fdd0 | Python | 21,776 | 500 | import torch
import torch.nn as nn
from mmdet.core import (bbox2result, bbox2roi, bbox_mapping, build_assigner,
build_sampler, merge_aug_bboxes, merge_aug_masks,
multiclass_nms)
from ..builder import HEADS, build_head, build_roi_extractor
from .base_roi_head import BaseR... |
7bc8090c16be7a63fc17d7745347e7750f1d004ff5ffaf877b783a8444167c02 | Python | 21,797 | 451 | """
File: Decomposition.py
Created: 2020-04-29
Last Changed: 2021-01-08
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 G... |
391ca9a531ceaa06180916083ae8b991f6bebd31c8d360a37136e54ed936b13c | Python | 21,821 | 447 | """``carla-cosmos`` command line.
carla-cosmos health|status|models
carla-cosmos submit --clip DIR --backend cosmos3-nano --prompt "..." --control depth=clip --control edge=derive [--wait [--out DIR] | --no-download]
carla-cosmos jobs [--status running] [--mine] [--out DIR]
carla-cosmos watch JOB [--ou... |
88e43b641e32c647e3eb7575a988415c6cf7725ed896eedf355a8c458e71614c | Python | 21,847 | 517 | """
Script which predicts on a set of data and evaluates the performance by
comparing to the ground truth labels.
"""
import logging
import os
import numpy as np
from argparse import ArgumentParser
from psg_utils.dataset.queue import LazyQueue
from sklearn.metrics import f1_score
from utime import Defaults
from utime.... |
206f5bcf1c79c754b2868a2de36d4431e17860fbce22c06389b6fb7d883f9d41 | Python | 21,887 | 571 | 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 .loss import GeneratorLoss3
from .loss import NormalLoss
from .loss import L1_loss
import mrcfile
import os
from torch.utils.... |
6c7cbc7b369bd131eaf3dea5c736cf77b744679e0b3dc9be07d54c3c2ab7db68 | Python | 21,914 | 783 | # Auto generated from oxo.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-04-12T11:15:58
# Schema: oxo-schema
#
# id: https://w3id.org/sssom/oxo
# description: Schema for OLS OXO payloads
# license: https://creativecommons.org/publicdomain/zero/1.0/
import dataclasses
from dataclasses import dataclass
from... |
f9492c16403c7fd5335c8a521ee697cb5e7accc1a11419d8a2e9b833f714acda | Python | 21,915 | 580 | """
Copyright 2020 - by Jerome Tubiana (jertubiana@gmail.com)
All rights reserved
Permission is granted for anyone to copy, use, or modify this
software for any uncommercial purposes, provided this copyright
notice is retained, and note is made of any changes that have
been made. This softwar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.