sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
c01e5b946238fa6caedc0519b70dafe9aed4c0892dceb6af8c7e419fdbd2306e
Python
25,303
629
from collections import OrderedDict import csv from logging import Logger import pickle from random import Random from typing import List, Optional, Set, Tuple, Union import os from rdkit import Chem import numpy as np from tqdm import tqdm from .data import MoleculeDatapoint, MoleculeDataset from .scaffold import lo...
900230127132c6ffc79aef81b10f12590e915926690c94130bd71acb2c04ae40
Python
25,311
638
# Built-in import os import threading from pathlib import Path from typing import Any # Third-party from numpy.random import Generator, SeedSequence, default_rng # Local from cxsystem2.core.tools import load_from_file, write_to_file __author__ = "Andalibi, V., Hokkanen H., Vanni, S." """ The preliminary version of ...
3093f0526c6b5cd7c86b125cc5ef1bb76bcf48abc6163b7c92c1173aaa5069ba
Python
25,325
541
# tumor sim pipeline # Generate tumor according to different label, augment tumor and mask # Get healthy brain, augment # Combine tumor and brain to put in arbitrary position, with in certain threshold of (overlap area)/(tumor area) to avoid tumor outside brain; avoid tumor across midline import os os.environ['CUDA_VIS...
bbec0dc4bf0ba38c6e7bc6cac0200e911570ec47694224c1341889a23a82417c
Python
25,333
973
# %% [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...
ac521c861e88775d5cd7ddf8e743eea429677240887c85c9f171905dafbf3e0c
Python
25,363
455
# general class containing info about a transcribed region. Can come from UCSC Knowngenes (BED) or Ensembl GTF files currently # Stephen N. Floor # Fall 2014 class Transcript: def __init__(self): #properties defined in UCSC knowngenes self.name = '' self.chrom = '' self.stran...
c190968ae5a5ab004f569dfd08cce39f5fb49c536f2589a0cb3c7a50804afbfa
Python
25,373
676
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
5e56b531b0de2a0f7541df5364b0504d3d4b8a600a59fbdb6cf4fc4524ddf32d
Python
25,417
545
from typing import List, Tuple, Union from itertools import zip_longest from rdkit import Chem import torch import numpy as np from chemprop.rdkit import make_mol # Atom feature sizes MAX_ATOMIC_NUM = 100 ATOM_FEATURES = { 'atomic_num': list(range(MAX_ATOMIC_NUM)), 'degree': [0, 1, 2, 3, 4, 5], 'formal_cha...
1a1765199b14badea082c5d6a98058ed0cc6eac7c64bfc6b31169d4a82876bd9
Python
25,421
515
# module for processing networkx graphs in various ways import pandas as pd import numpy as np import csv import gzip from tqdm import tqdm import matplotlib.pyplot as plt import seaborn as sns import pymaid from tqdm import tqdm from joblib import Parallel, delayed import networkx as nx import networkx.utils as nxu ...
d739fca210fc4ebf37456de43ec8d336ddb9e967fb85289d457eaecc549c2516
Python
25,465
532
import logging import os import numpy as np from pprint import pformat from collections import namedtuple from argparse import ArgumentParser, Namespace from utime import Defaults from utime.utils.system import find_and_set_gpus from utime.bin.evaluate import get_and_load_one_shot_model from psg_utils.dataset.sleep_stu...
9ea8053f652cb069f82ae6d68473fe2b7030a81a3b517493700b936b433b309b
Python
25,480
690
import json import logging import os.path import tempfile import collections from unittest import TestCase import numpy as np import pandas as pd from drugex.data.corpus.corpus import SequenceCorpus from drugex.data.corpus.vocabulary import VocGraph, VocSmiles from drugex.data.datasets import GraphFragDataSet, SmilesD...
ed11b2f358e979deba62e7d618d523ad0f41c8f99b80b153fcd69782769c845a
Python
25,521
839
# torch import torch import torch.nn.init as init import torch.nn as nn from torchvision.transforms import ToTensor import torch import torch.nn as nn import torch.nn.functional as F import math # from .util import * # from ..siren.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d # debug from util import * impor...
3719d5e3c4d0e7d4a98605a80a98ebfadd48eb8e3716fcbef2806d120194c172
Python
25,526
555
#!/usr/bin/env python3 """Spawn vehicles that drive themselves via autopilot, and destroy them cleanly. Commands: spawn --count 40 [--filter vehicle.*] [--safe] [--seed 42] [--tm-port 8000] [--no-autopilot] spawn at map spawn points line --at X,Y,Z --count 5 --gap 15 [--backward] [...]...
8e08df7435c2a093bc77470ec6379e5dd62065737e5cf7036394c8f2bcb535c0
Python
25,527
609
""" File: main.py Created: 2020/04/23 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, either version 3 ...
7d010fe007ceaab66642eef7fa473041f4869949d14be122351b0385d5f36fc8
Python
25,553
574
import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import Scale, normal_init from mmcv.runner import force_fp32 from mmdet.core import distance2bbox, multi_apply, multiclass_nms from ..builder import HEADS, build_loss from .anchor_free_head import AnchorFreeHead INF = 1e8 @HEADS.regist...
26ad0676d50717aa7780f1baa200ddec410d17555dc7f391c875785bf8fce01f
Python
25,563
588
import mmcv import numpy as np import torch from torch.nn.modules.utils import _pair from .builder import ANCHOR_GENERATORS @ANCHOR_GENERATORS.register_module() class AnchorGenerator(object): """Standard anchor generator for 2D anchor-based detectors. Args: strides (list[int] | list[tuple[int, int]]...
0121f01de1c91ae21da624d58a4a473039592f51d5213d3afc5c9dfbf54a7ac5
Python
25,572
809
import tempfile import enum import logging import numpy as np import pandas as pd import AFQ.viz.utils as vut from dipy.tracking.streamline import set_number_of_points try: import plotly import plotly.graph_objs as go import plotly.io as pio from plotly.subplots import make_subplots import plotl...
ce88f31d44551d249168619eaf229533d71fe6c925bf01319d28e62e74a6d136
Python
25,574
786
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> """Plot sensor maps.""" from collections.abc import Sequence from math import sin, cos, asin import os import numpy as np import matplotlib as mpl from matplotlib.lines import Line2D from .._data_obj import Datalist, as_sensor from ._base import EelFigure, ImLa...
2647ddeb04ffa9bd9b983b9b2d13312629903a715d899c5b242603468fdb5c69
Python
25,576
929
#%% Imports and file loading import pprint import sys from pathlib import Path import networkx as nx import numpy as np import pandas as pd import pymaid from src.data import load_networkx from src.io import savecsv from src.pymaid import start_instance output_name = "2020-09-23" output_path = Path(f"maggot_models/d...
bd5e9867bb392dec283a4b447aa60c8db158dd1d671c216390b1c29d96af9acb
Python
25,577
930
#%% Imports and file loading import pprint import sys from pathlib import Path import networkx as nx import numpy as np import pandas as pd import pymaid from src.data import load_networkx from src.io import savecsv from src.pymaid import start_instance output_name = "2021-01-29" output_path = Path(f"maggot_models/d...
abb82cab33180379c0272cac37b3a4c2a6800ab809fabc4862956e08e229f5c0
Python
25,588
615
# SPDX-FileCopyrightText: © 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: MIT """ This file contains scripts to start the grpc server to render images. Example command line to start server: docker run --env "CUDA_VISIBLE_DEVICES=0" --name="nre_1" \ --gpus all --rm --net=host ...
d2b91f7865981bb3bea1c5afe847ca381e49e216c5fe70c3a6fa1dff03239be2
Python
25,588
619
#!/usr/bin/env python # compare_tripseq_clusters.py # Compare input lists of clusters against each other searching for genes that have transcripts in the different clusters. # Intended to be applied to fractionated polysome sequencing data (a la tripseq) but theoretically can work for any data involving transcript-s...
43e1cf8eeba1d5f6670e26d529d5cae868a36d5dfbf91acfb100dc9aa85317c9
Python
25,610
635
"""Datasets""" import os from cv2 import transform import torch from torch._C import dtype from torch.utils.data import DataLoader, Dataset from torchvision import datasets import torchvision.transforms as transforms import torchvision import glob import PIL import random import math import pickle import numpy as np ...
ad781a1e5cb21b207c1807b33bb3962e7085460eadc9d2f20cde4851cbf51545
Python
25,610
641
# Classification analysis of social perceptual features based on fMRI responses to audiovisual perception of these features # # Sections: # 1. Make dataset for full brain classification analysis # 2. Make dataset for ROI analysis # 3. Tune hyperparameters for neural network (full brain dataset) # 4. Run between...
d67932714af7a8a614a1e927f13eeb48d424b14fed8227fb274ff1395cccaaf6
Python
25,706
600
import jax.numpy as jnp import numpy as np import scipy.sparse as sp from scipy.sparse.linalg import eigs from .grid import YeeGrid from .typing import Size, Spacing, Optional, Tuple, Union, Callable, Size2 from .utils import poynting_fn, Box from .viz import plot_power_2d, plot_field_2d, plot_field_1d, hv_field_1d, h...
2f0b664121bf21ea185cfda67bf04d164406d610e08dd0bc303ade097cd1069f
Python
25,728
725
"""Multi-Dynamic Network Modes (M-DyNeMo). See the :doc:`model description </models/mdynemo>` for more details. See Also -------- `Example script <https://github.com/OHBA-analysis/osl-dynamics/blob/main\ /examples/simulation/mdynemo_hmm-mvn.py>`_ for training M-DyNeMo on simulated data (with multiple dynamics). """ ...
5e3cb9cd2532af3a192ce48027beed19d8202a68639531c707396c2c3fd33fa6
Python
25,737
526
# Copyright 2020-21 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...
bb7701528c1c8a01a120035fef1e9f53415ec6b5ea03aa26bf38d0709b148bea
Python
25,740
571
import math from dash import Patch, ALL from dash_extensions.enrich import Serverside, Output, Input, State, callback, clientside_callback, ctx, no_update from dash.exceptions import PreventUpdate import mne import pandas as pd import numpy as np import RV.constants as c from RV.callbacks.utils.annotation_utils impo...
6db641a1fde221b19313cec0abebbe1c2610d5bf35362363f79cefe1491f2f4b
Python
25,742
393
import os, sys import shutil import time import tkinter import h5py import matplotlib.pyplot as plt currentdir = os.path.dirname(os.path.realpath(__file__)) parentdir = os.path.dirname(currentdir) sys.path.append(parentdir) # PYTHON > 3.3 does not allow relative referencing import tensorflow as tf # tf.enable_eage...
73fe1df13f6ac9c088dbee2c4c8172abaa81fc6d56b04f0ec777726aa125c1a2
Python
25,749
661
#################################################################################################### # 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...
21cad4b74fce328dee378a294f72c00622689332aa3233a8209c8e34236f53bf
Python
25,782
771
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...
715e418cc9603453538d15d1b8dc36a4cc5916ae841605b46279da128c991d32
Python
25,795
970
# %% [markdown] # ## 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 sklearn.metrics import pairwise_distances from graspy.embed import ClassicalMDS from graspy.match import GraphMatch from graspy.plot import...
0aa9c384f64de7be05202b774cee7ec771b29b7f1c95f081a50074f73394a017
Python
25,835
613
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Module containing useful functions for fine tuning with PyTorch. Created on Mon Apr 8 14:13:08 2019 @author: nicolas """ import copy import numpy as np import matplotlib.pyplot as plt import matplotlib.widgets as widgets from skimage import measure, draw import cv2 ...
d7d4cb6d70421da8908c92748ef5e099112a29e5a84c6e21a58a5f962e841369
Python
25,838
734
"""Dynamic Network Modes (DyNeMo). See the :doc:`documentation </models/dynemo>` for a description of this model. """ import os import logging from dataclasses import dataclass from typing import List, Optional, Tuple import numpy as np import tensorflow as tf import osl_dynamics.data.tf as dtf from osl_dynamics.in...
6e892b90b550a434b496763af5e210525564289e276cbef01c976ef19a48ff9b
Python
25,849
488
"""Cosmos 3 worker: drives a ``vllm serve <Cosmos3> --omni`` process over its videos API. Mapping of a carla-cosmos job to vLLM-Omni's transfer request (``vllm_omni/diffusion/models/cosmos3/transfer.py``, verified 2026-08-26): * controls ``depth``/``seg``/``wsm`` -> ``extra_params[<hint>] = {"control_path": <worker-l...
86dfdcb73b58279ce161067588acb932f5fd408dfeb4a15f234d3d5c0024d000
Python
25,885
574
# 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 in...
9b420d00047774222636e1636438762d6f7aafe12551e5a4484119c591d20a11
Python
25,888
552
#!/usr/bin/env python3 """ File: visualise_ct_mediated_eqtl.py Created: 2020/09/23 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 th...
98d841d03526459a99edce821956930a67db3d6eb9ed3f9708193cd1f1c4da36
Python
25,896
590
#################################################################################################### # 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 ...
39a05600ebacd3b0f3d7f3bf6721291580886aa2eca3b5fbeb8f21d8d575b98a
Python
25,919
589
import torch import torch.nn.functional as F from mmdet.core import (bbox2result, bbox2roi, bbox_mapping, merge_aug_bboxes, merge_aug_masks, multiclass_nms) from ..builder import HEADS, build_head, build_roi_extractor from .cascade_roi_head import CascadeRoIHead @HEADS.register_module() class...
89b5c22677fc866a2f268c9ea666a23c7e2279333262150a4ee808805429ea1d
Python
25,933
723
# 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...
babb1149af9d9658f969f3e861b1018e8a31032ba5ace8531ff627084b438f3a
Python
25,947
708
""" This module provides the `TrainModel` class and supporting methods. """ import logging import math import os import shutil from time import strftime, time import numpy as np import torch import torch.nn as nn from sklearn.metrics import ( ConfusionMatrixDisplay, average_precision_score, confusion_matri...
30973011e5df878010482b1856a596a92aa7fcc05bd145cd25e1e26770b3db0e
Python
25,968
511
# 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...
fbf4f98e766de9ad0bf7b7e692bef74b014b88218d27396aa9dc9d4bddf02a03
Python
25,971
677
from src.utils.sanifix import AdjustAromaticNs from src.utils.tokenizer import smi_tokenizer from rdkit import RDLogger from rdkit import Chem import math import re import random import pandas as pd RDLogger.DisableLog("rdApp.*") def num_in_list(tokens): """ Create sequences with bond already exists error. ...
9c1287316c0f8bac6da6af4b4d45218c4d22c3ddc3855e94fccc496aca86bbb1
Python
25,975
715
""" This module provides the `TrainModel` class and supporting methods. """ import logging import math import os import shutil from time import strftime, time import numpy as np import torch import torch.nn as nn from selene_sdk.utils import ( PerformanceMetrics, initialize_logger, load_model_from_state_di...
8d6241d6d798cdf4eeb24c510a5dbb39270b8a8634654a068d973493f840f950
Python
25,998
743
from collections import defaultdict from numpy.core.defchararray import array import pytorch_lightning as pl from pytorch_lightning.metrics.regression import MeanAbsoluteError as MAE from pytorch_lightning.metrics.regression import MeanSquaredError as MSE from pytorch_lightning.metrics import F1 from pytorch_lightning....
23eda39f84dca77198d033ce35a68d0101c1f38c6ae933369fdd515363cc5929
Python
26,045
692
# SPDX-FileCopyrightText: © 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: MIT """ Track and Pose Interpolation Module This module provides classes for managing and interpolating object trajectories (tracks) in NUREC scenarios. It handles different pose representation formats ...
6ac7d482e2c7cf32e12df8513dcf706b839d4534f09d4a5fbd1b755e43abcc82
Python
26,047
458
import argparse import math from pathlib import Path import numpy as np import pandas as pd from tqdm import tqdm from pytransform3d.urdf import UrdfTransformManager from pytransform3d import rotations as pr from pytransform3d import transformations as pt from dataloading.model import Camera, TurnSignal SKIP = -1 ...
2fe029b83b82caa8c2b75d018425fb0cccce2e64d13957e634094ffb6516adf8
Python
26,109
727
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> """Plot uniform time-series of one variable.""" import operator import matplotlib as mpl import numpy as np from .._celltable import Celltable from .._data_obj import ascategorial, asndvar, assub, cellname, longname from .._stats import stats from . import _bas...
b9679be3bc47806d446978bc8165bed853178e600268f14d99c19d2115f635e0
Python
26,149
498
# %% from pymaid_creds import url, name, password, token from data_settings import pairs_path, data_date_A1_brain, data_date import pymaid rm = pymaid.CatmaidInstance(url, token, name, password) import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import matplotlib as mpl impor...
d822ef13c61859d333d259a1266fec18e19e862f43c29f68768f1c57a3455666
Python
26,168
721
# 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...
57aca7e1af5b14649ac5c83acd27117cfa49e2a9d8506d12a7f741aa0b430082
Python
26,205
596
#!/usr/bin/env python # coding: utf-8 import json import csv import PredysUtil8ans as pu import numpy as np import os from sklearn.svm import SVC from sklearn.svm import LinearSVC from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.metrics import accuracy_score impo...
51a123e8d97ebebb02eb183476620075e7c4300db3833046f892fc9ac2b415b1
Python
26,217
505
import collections import datetime import pandas as pd import inspect import os import numpy as np import itertools import tqdm import AIS_interp import functions_basic_sak as funsak from sklearn.cluster import DBSCAN from scipy.interpolate import interp1d import AIS_parameters import re import PIL imp...
d661902c0cc5f9316a8b80e62b571e91167a80f7d569de9437792bf34d3f6965
Python
26,250
764
import numpy as np import logging import nibabel as nib from dipy.segment.mask import median_otsu from dipy.align import resample from AFQ.definitions.utils import Definition, find_file, name_from_path from skimage.morphology import convex_hull_image, binary_opening __all__ = [ "ImageFile", "FullImage", "RoiIm...
9042463774e25c48bad3bca34c8fa936a8530abc246be1ac099bbb2c646a15f1
Python
26,270
773
""" Training script for UQNO (Uncertainty Quantification Neural Operator) on Darcy flow. This script implements a two-stage training process: 1. Train a base solution model on Darcy flow data 2. Train a residual model to predict uncertainty bounds 3. Calibrate the uncertainty predictions for reliable coverage The UQN...
1c2a9844add6ce890e110d011a1c6b4dd56b625a01d701f9e420e222ed07d913
Python
26,278
604
# 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...
2c3cbbe379339f4ff40b282a94ce981e5e66d8ad7249cc504c87d1da81059439
Python
26,289
400
#!/usr/bin/env python3 """ File: visualise_replication_opposite_effects.py Created: 2021/08/03 Last Changed: 2021/09/02 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 pub...
cff64a03468f192ed3e04fc7ec10592bb63503add1ce0dd415ccbc00a4fa712b
Python
26,301
837
# %% [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 graspologic.embed import OmnibusEmbed, selectSVD from graspologic.models import DCSBMEstimator, SBMEstimator from graspologic.ut...
37ee02a72aa6cce6689faa729699fad20efc5ab254aea7000943d2356ed8396c
Python
26,310
663
import time import os import sys from os.path import dirname, realpath, join from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * import pyqtgraph.opengl as gl import nrrd import pickle import shutil import requests import numpy as np import pandas as pd from .atlas_loader import process...
fb257b12ed4c886d936f0901914000b456c34110888e22fb12492511596c4e4c
Python
26,328
637
# Analysis # from numpy import NaN import numpy as np import pandas as pd # This computer git repos from cxsystem2.core.tools import ( change_anat_file_header_value, read_config_file, parameter_finder, ) # Builtins # from argparse import ArgumentError from pathlib import Path import shlex import subproces...
37e0dc130f2afc9b2382bbf0994b3eb47edf13514f60cce2c7765eb941897c76
Python
26,339
533
import argparse, sys import collections import torch import numpy as np import logging from pathlib import Path import data_loader.data_loaders as module_data import model.loss as module_loss import model.metric as module_metric import model.model as module_arch from utils.parse_config import ConfigParser from utils.t...
841424793e937a5f366d9688feca641fe50a0368191666b88d80466493ccb7be
Python
26,387
603
# -*- coding: utf-8 -*- import torch import numpy as np import pickle import time from utils.get_detected_info import get_anchor_nums, get_anchor_box_size prior_info = 0 min_area = None saved_matching = {} saved_conf_loc = {} prior_to_ratio = None matching_timer = 0. def point_form(boxes): """ Convert prior_boxes...
44288ae50bb601ee933a472f5020c9e95c616cd4464444331ffac94f1120d421
Python
26,445
714
import numpy as np import sys from modules.parameters import ParameterSet, copy_dict from defaults.paths import paths def set_kernel_defaults(run_type='local', data_label='', **system_pars): """ Return pre-defined kernel parameters dictionary :param default_set: :return: """ keys = ['nodes', 'ppn', 'mem', 'wall...
bce3d6a630b6755f074de178acd91d7886c3fd64ec28f8a9fc5dd1d66334715c
Python
26,474
725
# Auto generated from mapping_cluster_datamodel.yaml by pythongen.py version: 0.9.0 # Generation date: 2023-02-27T10:04:41 # Schema: mapping-cluster-datamodel # # id: https://w3id.org/oak/mapping-cluster-datamodel # description: A datamodel for specifying mapping clusters, such as those retrieved from boomer. A mapping...
4b12eff7050cf4895e67f1cc46f8d6e6a83640ebefecc3a01d365bc6f13f0c30
Python
26,504
449
import itertools import logging import os.path as osp import tempfile import numpy as np from mmcv.utils import print_log from terminaltables import AsciiTable from .builder import DATASETS from .coco import CocoDataset @DATASETS.register_module() class LVISDataset(CocoDataset): CLASSES = ( 'acorn', 'a...
2da2e7e5d3349aa3d79a0d10c245ab6613bd0a13a237ae62c5eb05a1f12135e7
Python
26,510
628
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 19 2022 @author: yuxiushao """ import numpy as np import matplotlib.pylab as plt import matplotlib from numpy import linalg as la from scipy import linalg as scpla import scipy # import seaborn as sb from mpl_toolkits.axes_grid1 import make_axes_l...
0cbd14d8ca996666878dcb0e7d0a49a84441f0d1aa10767e3d1b754655f18c2e
Python
26,538
639
#!/usr/bin/env python3 """ File: afr_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 Soft...
cc17eae4c64e2518b93c05dcd255aae68d6cbd358ed3b7d7e5f20d53b880c7ab
Python
26,540
565
import torch from torch import Tensor import torch.nn as nn import copy from typing import Callable, Tuple from torch_geometric.nn import GCNConv from torch_geometric.utils.loop import add_self_loops from torch_geometric.utils import k_hop_subgraph from torch_geometric.data import Data from ._decomp_base import _BaseD...
657aeb84951ce0a2db29b0e094e4a53a97c307cef79d7efc5cc3ce8bb7e8235d
Python
26,570
742
import itertools from typing import List, Optional, Tuple, Union from ..utils import validate_scaling_factor # Set warning filter to show each warning only once import warnings warnings.filterwarnings("once", category=UserWarning) try: from typing import Literal except ImportError: from typing_extensions i...
ea65c19736c474a543edc1f9f96393e456571e3057b59a0b555b93b84d3da8d2
Python
26,584
599
import os from functools import reduce from typing import Iterable, List, Union import numpy as np import pandas as pd from scipy.interpolate import interp1d from src.util.camera import ImagingSystem, transform_reflectance class CameraCalibration(object): def __init__(self, filename, sort=False, model="9.2.4.1")...
2f9c9b31c5704fdb2cf15e6c472efa7832723c39120c02edf9f054159b6419fc
Python
26,611
715
from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * import numpy as np from .uuuuuu import read_qss_file dialog_style = ''' QDialog { background-color: rgb(50, 50, 50); color: white; font-size: 12px; width: 50px; } QLabel { color: white; width: 50px; } ''' clas...
ccd49b5d0dc0fecbcde98b353b4a97c863db82c1ea3b79dc09fca3ef74774e70
Python
26,670
1,017
# %% [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...
8b90da59a2d575b7a75826d6de2c014fb81b9cc12347e08b499f6990585222aa
Python
26,688
768
# 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...
c09320b3c062d18f527438f4c7cfcfb8ef52c1fd557fd1b1a122dce26e547e18
Python
26,706
636
#!/usr/bin/env python3 """Listen to a CARLA sensor and save its data, show it in a window, or summarise it. Select an existing sensor (spawn one with the create-sensor skill first): --id N | --type sensor.camera.rgb | --attached-to hero Commands: info [--seconds 5] grab one reading and pr...
2629f7bf917f871b0be6e58bbbf029dfb888912c4019c2a9cf4b28ffed8193c5
Python
26,708
636
#!/usr/bin/env python3 """ File: visualise_sn_eqtl.py Created: 2021/01/28 Last Changed: 2021/02/22 Author: M.Vochteloo Copyright (C) 2020 M.Vochteloo This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free So...
d9abe841c976ec5cd11f285ecedc705e1215d78fc22ad5f1d0942774577ae9e4
Python
26,737
814
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """I/O objects for phys2bids.""" import logging import re from copy import deepcopy from itertools import groupby import numpy as np TRIGGER_NAMES = ["trig", "trigger"] LGR = logging.getLogger(__name__) LGR.setLevel(logging.INFO) def is_valid(var, var_type, list_typ...
ec615ff405fda162636545fcb23862539d0c40f4caff50cf98c03654199d0618
Python
26,745
642
#!/usr/bin/env python3 """ File: visualise_sn_eqtl.py Created: 2021/01/28 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 So...
9530f77e7b2a9b837ad62be7b3ef203127eaad51c9e35475ece75410b2d24744
Python
26,750
861
# %% [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...
251b92426a6d9335076bd6beb706bd014c6fcb97529f40e641f77bae85563d8e
Python
26,773
651
# 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...
b287dcb040118b16e64667908a4a9636d8598c053f0bc51a0d4c1329821e9208
Python
26,814
626
# 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...
f51409624c3d88c1f44e5e3a01219b88f7fc19d7a5e48d6d1a6df6fe612e5188
Python
26,880
709
import math import torch import torch.nn as nn from blitz.utils import variational_estimator from torchnlp.nn.attention import Attention from neural_networks.base_models import BaseModel from neural_networks.bayesian import ShallowBayesianRegressor, BayesianConvEncoder from neural_networks.custom_modules import ConvDr...
c425118e639051ce2e3ada125f7e20a6a038678ba998e97724a33d45a8812c30
Python
26,908
870
# %% [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...
661593bf24cc5a68e86e1f268c83972611d585bbd720797943bf757c08775206
Python
26,915
618
import numpy as np import torch import torch.nn as nn from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init from mmcv.runner import force_fp32 from mmdet.core import (build_anchor_generator, build_assigner, build_bbox_coder, build_sampler, images_to_levels, m...
a4da831d7afa1efe958d16bd6d99c3a9b40297c04faddd3b9ede28badacafb21
Python
26,937
635
from fileinput import filename import sys, argparse from cv2 import normalize sys.path.append('..') from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from ui.ui import Ui_Form from ui.mouse_event import GraphicsScene import cv2 import torch from ui.util import number_color, number_ob...
7e214c92bc522c999bafa368e2304793e4c92d78c93afb184ea2871ae400d913
Python
26,939
749
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> """Color tools for plotting.""" from collections.abc import Iterator from itertools import product, chain from math import ceil import operator import numpy as np import matplotlib as mpl from matplotlib.colors import LinearSegmentedColormap, Colormap, Normalize...
cd616cadc648bc8a971d614cf9156892b544839a143fe09f9641b8b99a5cfeac
Python
27,008
540
"""Frame-exact multi-camera capture from a live or replayed CARLA world. The world runs in synchronous mode at ``fixed_delta_seconds = 1/fps`` (previous settings are restored on exit). Every sensor image is matched to the frame id returned by ``world.tick()``; a missing or skipped frame raises :class:`FrameDesyncErro...
188302645b1b498d52fe2d934603ad09a48e064ec5ece37156b48e499c926fa4
Python
27,022
519
#!/usr/bin/env python3 """ File: pre_process_TPM_expression_matrix.py Created: 2021/11/23 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 Fr...
e2a2b60e424038bb6166d83d4a5d543d09e2a852f05d3675d6fbf00a544d190b
Python
27,070
639
#!/usr/bin/env python # coding: utf-8 import json import csv import PredysUtil5ans as pu import numpy as np import os from sklearn.svm import SVC from sklearn.svm import LinearSVC from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.metrics import accuracy_score imp...
f02a55e54a058e21f2fc34202d30f0729cfbc9228d7568cab0db42d709811032
Python
27,097
640
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2016 Johns Hopkins University (Author: Matthew Wiesner) # Apache 2.0 # ============ Make unicode-based graphemic lexicon ============= # # This script takes a list of either words or words and corresponding # morphemes and returns a graphemic lexicon in the ...
1d073ec511474539191b068f8c14748cf314055a6b58713a541e45831d31944a
Python
27,146
468
import numpy as np import itertools import os import pandas as pd from sklearn import preprocessing import torch from torch.utils.data import WeightedRandomSampler import torch.optim as optim from PrePro import sep_eight_channels, standardize from DataLoaders import DataLoaderLabels, DataLoaderNoLabels, init_data_loade...
19c450bcf12cb88c92a913e6e1e6040d875e3e884921205bb2c5f26f794ef56e
Python
27,156
631
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 mmdet.core import (anchor_inside_flags, bbox2distance, bbox_overlaps, build_assigner, build_sampler, distance2bbox, ...
8dd65165a1f3752b45a0c1e2ebbfe2bb32b4f6cb2ff33cd9327c7ec2e89e154d
Python
27,169
666
import math import torch import numpy as np import torch.nn as nn from pytorch_lightning.loggers import wandb from torch import Tensor from typing import Dict, Tuple import pytorch_lightning as pl import torch.nn.functional as F from constants.constants import * from utils.nilm_metrics import NILMmetrics from neural_ne...
de67190a8b00bd280ee32c810b9cb3f4ac61ce8ea87733c8fcab1363ee0eebca
Python
27,172
693
#!/usr/bin/env python # -*- coding: utf-8 -*- # conda version : 4.8.3 # conda-build version : 3.18.12 # python version : 3.7.6.final.0 # brian2 version : 2.3 (py37hc9558a2_0) from __future__ import annotations import sys from typing import Optional, Union import numpy as np from brian2.units import Quantity, ms, pA ...
77b60faace8e3cb39d182d16ce97823cdfdad01c75c0d0f5fe0efc4fb60c6275
Python
27,206
828
# %% [markdown] # ## 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_procrustes from scipy.optimize import linear_sum_assignme...
5c25a0571a5dc5f34cc9168eb1e4534957eda3db5696900d157d9b12e14478c0
Python
27,222
905
#%% 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...
08fdd03418e03a4fe2d1f7bb2e1497522d6a40dcd2c25bb289d266361fa5d04b
Python
27,274
597
"""HTTP client for the carla-cosmos server. :: client = CosmosClient("http://node:8000", token="cc_...") # or COSMOS_URL / COSMOS_TOKEN client.wait_ready() job = client.submit_clip(Clip.load("clips/abc"), "cosmos3-nano", prompt="golden hour, wet asphalt", ...
2bbcda57ea8dcaa5ea472f18473726295ea82dd01b87c03bc874f194be551a03
Python
27,292
635
#!/usr/bin/env python3 """ File: compare_decon_cell_profiles.py Created: 2021/09/17 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...
107a686c5262453587d7d9c5ae0d373915cb789735d3213bd702c0d5d057c110
Python
27,343
584
#!/usr/bin/env python3 """ File: visualise_main_eqtl_replication.py Created: 2021/08/03 Last Changed: 2021/09/02 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 ...
d46b428f6f1c2e9ff0663246ae82991c2fb110d25085c966b5f4479318869e8a
Python
27,381
644
import colorsys import os import sys import cv2 import copy import pyqtgraph.functions as fn import numpy as np import pyqtgraph as pg from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * from pyqtgraph.Qt import QtGui, QtCore import scipy.ndimage as ndi from .image_stacks import ImageSt...
556b8f71f0ef2ef6c432efc844cd5621ee7f38fc20c469665cedb3a3ace7dfa9
Python
27,389
754
import logging from abc import ABC from collections import defaultdict from copy import copy from dataclasses import dataclass, field from enum import Enum from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple, Union from sssom.constants import RDFS_SUBCLASS_OF, RDFS_SUBPROPERTY_OF from oaklib.datam...
594a279a55b17720141cbf9e68a1587c63cdffce92db682627af35de34066d08
Python
27,422
519
#%% import sys sys.path.append('/Users/mwinding/repos/maggot_models') 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 import numpy.random as random import cmasher as cmr import connectome_tools.process_mat...
d3f3eb8ff5d2290cd9b828eea9ea165b94b46d37a1af7200a4d80d8773fb28ea
Python
27,478
538
import os import time import numpy as np import pandas as pd import sklearn as sk from sklearn.preprocessing import label_binarize from util import util from util import metrics from torch.utils.tensorboard import SummaryWriter class Visualizer: """ This class print/save logging information """ def _...