sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
cb8fd0dded8af83d1cfb11d920e66ed8301c5e7b174e44e29bd28e895386c622
Python
14,367
298
from collections import defaultdict from .utils import fix_dataclass_init_docs from .sim import SimGrid from .typing import Optional, Callable, Union, List, Tuple, Dict import jax import jax.numpy as jnp from jax.config import config from jax.example_libraries.optimizers import adam import numpy as np import dataclas...
2d675a80928b4e96c6c3f5add3b9a7b28ffbc36eedbc488e87165161e8b8a3db
Python
14,385
336
#!/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>. """ Runs two independent, asynchronous weather cycles against a live CARLA s...
05bee663055614d66045b918635a24b0b8d4ffb107fb362205138ed38615e89b
Python
14,387
401
#!/usr/bin/env python """ Convert DICOM neuroimaging data into a BIDS dataset with validation Authors ---- Mike Tyszka, Caltech Brain Imaging Center Remya Nair, Caltech Brain Imaging Center Julien Dubois, Caltech and Cedars Sinai Medical Center MIT License Copyright (c) 2017-2019 Mike Tyszka Permission is hereby gr...
fafaf3da7a67b258ccc16ae87be50af80f8ad4a9062d1320b44847cc34a43c36
Python
14,390
403
# 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...
5ec16b2d408829ca0a2db404fd2965156eef7d1dede2b49975dda5a00c3e29a7
Python
14,393
378
# System imports import os import copy # Blender imports import bpy # Internal imports import vmv import vmv.consts import vmv.enums import vmv.interface import vmv.skeleton import vmv.bbox import vmv.rendering #################################################################################################### # @...
ace9e4486ea6d8f8c52310a8ddf27212022136eda719c12d8204fab1bfcfdc67
Python
14,396
360
import torch from torch import nn from torch.nn.init import xavier_uniform_ from torch.nn.init import constant_ from torch.nn.init import xavier_normal_ import math import torch.nn.functional as F from enum import IntEnum import numpy as np device = torch.device("cuda" if torch.cuda.is_available() else "cpu") class ...
a884eba304df57ae49614b11ae5be4fa918412354a43cfd894c9af81123d1cd0
Python
14,398
300
import os import json import time import argparse import pandas as pd from drugex.data.corpus.corpus import SequenceCorpus, ScaffoldGraphCorpus, ScaffoldSequenceCorpus from drugex.data.processing import Standardization, CorpusEncoder, RandomTrainTestSplitter from drugex.data.datasets import SmilesDataSet, SmilesFragD...
7ea0814b1cf1c9e0119bdaa96f5bacaf9d12092dfae86f34a7d030c78cc15fee
Python
14,401
406
from abc import ABC, abstractmethod from typing import List import torch from torch import nn class Embedding(nn.Module, ABC): def __init__(self): super().__init__() @property @abstractmethod def out_channels(self): pass class GridEmbedding2D(Embedding): """GridEmbedding2D appl...
7574b8dddb0504b2ec2fd59f626929d0bf5d29ba2d2f72bc64d227b7b5701836
Python
14,403
265
"""Cosmos Transfer 2.5-2B general worker (``Control2WorldInference`` in a torchrun rank group). Runs inside the ``transfer25`` venv (cosmos-transfer2.5 v1.5.x, torch cu130). At start-up it launches one rank per GPU given to the worker (``torchrun --nproc_per_node N -m cosmos_workers.transfer25.ranks --context-parallel...
1359d1a7d73348a70c27088c84429c0b26a8e5b457d39a4324154dd7875a96d5
Python
14,415
342
import torch import torch.nn as nn from mmcv.cnn import ConvModule, normal_init from mmcv.ops import DeformConv2d from mmdet.core import multi_apply, multiclass_nms from ..builder import HEADS from .anchor_free_head import AnchorFreeHead INF = 1e8 class FeatureAlign(nn.Module): def __init__(self, ...
354d2041b228f761943496f2ec5045bc6e2d8569eedf92b9fc50def559e0beb6
Python
14,422
355
import sys sys.path.insert(0, '.') import loadData as ld import os import os.path as osp import torch import numpy as np from torch.autograd import Variable import torch.backends.cudnn as cudnn import transforms as myTransforms import dataset as myDataLoader import time from argparse import ArgumentParser from IOUEval ...
a73665aff3571a6b90bcdd53547b550f7d239966aa604e19cf4d384137599723
Python
14,439
552
#%% import os from pathlib import Path import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from matplotlib.lines import Line2D from graspologic.utils import binarize from src.data import load_metagraph from src.io import savefig from src.utils import get_paired_inds from src.v...
6acd527c9f40da01b1392239c5b73fc14032fb8bbecb4b0a43a35ca2ce71c271
Python
14,448
561
# %% [markdown] # ## 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 import seaborn as sns from anytree import LevelOr...
c2213c009dff535ef33b271fba86a2651d2825cef9ec37025a7909e364c43066
Python
14,450
319
import logging from collections import defaultdict from copy import deepcopy from typing import List, Iterator, Tuple, Collection, TextIO from oaklib.datamodels.taxon_constraints import SubjectTerm, TaxonConstraint, Taxon from oaklib.datamodels.vocabulary import IS_A, NEVER_IN_TAXON, ONLY_IN_TAXON, IN_TAXON, PRESENT_I...
2a6cb2cf5df9344e31488830dda380f8382d3884aa40b7f0428b18e940d66b3d
Python
14,454
382
#################################################################################################### # 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 ...
14f8b55bdc572715212ef0ebc165b02205a1ff130b35b8a30d1dd6fc0922da27
Python
14,460
375
""" ----------------------------------------------------------------------- Author: Brin Rosenthal (sbrosenthal@ucsd.edu) ----------------------------------------------------------------------- """ #import matplotlib.pyplot as plt #import seaborn import networkx as nx import pandas as pd import random import nump...
eb020777b37d471513a7a249b03d85a7f572df3e5e41da52b38443713c332106
Python
14,463
487
# %% [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...
a8e951f7bb2ec3711e55b5a15c24e091f9e36100b3a50d644017b3d8745bfe3a
Python
14,468
361
"""Static-obstacle export: what the level bounding boxes are allowed to become. No CARLA server - only ``carla``'s value types (``BoundingBox``, ``Location``) plus a stub world whose ``get_level_bbs`` returns whatever the test wants. """ import types import numpy as np import pytest import carla from carla_cosmos....
c11394f000654309bfa7b49beeef6be8fe2c0ecf60f49305440e5e1a283d976f
Python
14,487
244
import os import numpy as np import pandas as pd from datetime import datetime import pytorch_lightning as pl import wandb import torch from constants.constants import* from torch.utils.data import DataLoader from lab.training_tools import TrainingToolsFactory from utils.nilm_reporting import save_appliance_report fro...
ecaa7accaa4153dbce0e3215f132d9adff6eba436edf5cd85c328d42b5382888
Python
14,495
394
## 2021/10/13 # Gene Regulatory Network Simulation Using Simple Multivariate Gaussian ## System import os import shutil ## Plots import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib import offsetbox from matplotlib import cm impor...
796f1e2c03031b5c4347e25fdee60a636d9eb15082f1d250721c8aae4285d52d
Python
14,500
467
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. """ Variant of the resnet module that takes cfg as an argument. Example usage. Strings may be specified in the config file. model = ResNet( "StemWithFixedBatchNorm", "BottleneckWithFixedBatchNorm", "ResNet50StagesTo4", ...
97bf0c5d44c82bc008fe492ae7f08db54418b624908a7f0b53bf6e7473f90f94
Python
14,504
319
# Copyright (c) # Copyright (c) 2018-2020 CVC. # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ This module implements an agent that roams around a track following random waypoints and avoiding other vehicles. The agent also responds to traffic...
cf1894e58ec97f227664bc9a1aee9806f9ba878f7907658ebe35d33ca71be00b
Python
14,517
412
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> """Statistical Parametric Mapping""" from operator import mul import numpy as np from .. import _info, fmtxt from .._data_obj import Dataset, Factor, Var, NDVar, Case, asmodel, asndvar, assub, combine, dataobj_repr from .._exceptions import DimensionMismatchErr...
d2cefc90bcceeb79377ffa9f0f4d2600f292048edfc998b78802f81b6a149846
Python
14,517
335
# 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...
bfe6420aba3707658c8feefe52e88612f18f36ade389ace3b42903d82644f2a2
Python
14,520
360
#%% 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...
142e512a59f4d41f7f0715bef02cd634cf6ac53ead2a4844ec953845723eb3de
Python
14,527
414
import numpy as np import jax.numpy as jnp from jax import jit, lax from jax.ops import index,index_update from jax.random import split,uniform,PRNGKey from functools import partial from matplotlib import pyplot as plt from .figures import panels, performance, plot_dXs, compare_pfc_dysfunction dms_ctx_gain = .4 pfc_...
660ed80d7dcfd711106e54bc11227d89cb0a79b99318c61096f52a89e5cd14bc
Python
14,534
455
from itertools import starmap import numpy as np import torch import torchvision class PermuteSequenceChannels(torch.nn.Module): """ Permute channels of retrieved encoded DNA sequence. Permutes axes of `np.array` of shape `(sequence_length, alphabet_size)` to obtain `np.array` of shape `(alphabet_si...
903c8a18eb3e917c97267f3a979e755db3b0313499b72f3af855fea0795fa163
Python
14,536
386
""" 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...
0c732d6b3a919eeac04b27e52edced9be768b1d0967b8dcb09c0736776ba09dc
Python
14,541
377
""" This class contains methods to query a file of genomic coordinates, where each row of [start, end) coordinates corresponds to a genomic feature in the sequence. It accepts the path to a tabix-indexed .bed.gz file of genomic coordinates. This .tsv/.bed file must contain the following columns, in order: chrom (...
15dd5eb6e9fab62dc278784c4795fd5181ccdae1da832b161d82b4f721ce01e0
Python
14,545
260
# basic imports import numpy as np import pickle import matplotlib.pyplot as plt def load_data() -> dict: ''' This function loads simulation data and prepares it. Parameters ---------- None Returns ---------- data : The prepared simulation data. ...
dd75700cd14c8993eb44352e7064b132ab7edd3db8a20eeccfd1cb5d1e034b9a
Python
14,547
418
from abc import ABCMeta, abstractmethod import torch from neuralop.training.patching import MultigridPatching2D import torch from neuralop.training.patching import MultigridPatching2D class DataProcessor(torch.nn.Module, metaclass=ABCMeta): def __init__(self): """ DataProcessor exposes fun...
f2674b1b3d78c3785a434084ad12a8017e9e5110accb585505e7d930b4c09816
Python
14,554
518
#!/usr/bin/env python """ subpixel.py -- localize PSFs to subpixel resolution """ # Numeric import numpy as np # Dataframes import pandas as pd # Image processing from scipy import ndimage as ndi # Low-level subpixel localization utilities from .helper import ( assign_methods, ring_mean, rs, I0_is_c...
389ddf47467305a6a9c75eb8253b79505ca196528a95e931887779b9cb68375f
Python
14,559
384
# -------------------------------------------------------- # Pytorch multi-GPU Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick # -------------------------------------------------------- from __future__ import absolute_import ...
aa6ba6f0733780c3266bd60e08361e73a9ff981f2c693e257c4435949365b405
Python
14,566
461
# Auto generated from input_specification.yaml by pythongen.py version: 0.9.0 # Generation date: 2023-04-13T08:19:53 # Schema: inputspec # # id: https://w3id.org/oaklib/input-specification # description: A data model for representing a set of inputs to OAK # license: https://creativecommons.org/publicdomain/zero/1.0/ ...
f3392309fc61ac443c0c52ccbdb8fe13eef615660b89eb302dda7d3ca924779f
Python
14,574
335
import torch class Regressor(object): def __init__(self, model, criterion, optimizer=None, lr=0.001, betas=(0.9, 0.999), ws=30, itrtn=50, pred=1): """ Notice max_pred_step include now step prediction. So, for example, if you set two on max_time_step, only now and one step ...
c64be6e1cb64645100056b7f8302a3d17e0b66c0a99a74710e6349930e5fb5f9
Python
14,579
415
""" code to track produced figures or results and classify them """ import contextlib import numpy as np import logging import os import socket import sys import inspect import datetime import yaml import argparse from tctx.util.defaults import DEFAULTS from pathlib import Path import filelock logging.getLogger('py-f...
1115ed937e02921add3cd88c375eed5ad938f23b08a57c38be21d7463bca0418
Python
14,580
376
from tokenizer.mof_tokenizer import MOFTokenizer from model.transformer import TransformerRegressor, Transformer, regressoionHead from model.utils import * from datetime import datetime, timedelta from time import time from torch.utils.data import dataset, DataLoader import os import csv import yaml import shutil imp...
79f915e51f477366c46893c6cbc5f3288bf4f591ac5a7369e4f79ee745599e3b
Python
14,582
487
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # navis documentation build configuration file, created by # sphinx-quickstart on Sun Jul 9 22:17:00 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # auto...
788ed2efec18966c2cb50cfc7ba27ec517106a7719d09663e33510fc28a277a1
Python
14,585
349
import json from logging import Logger import os from typing import Dict, List import numpy as np import pandas as pd from tensorboardX import SummaryWriter import torch from tqdm import trange from torch.optim.lr_scheduler import ExponentialLR from .evaluate import evaluate, evaluate_predictions from .predict import...
baf6591b4cab8ac5d7c3e52b4fa879b50cb38dcceb03e650a35db814898fa5c0
Python
14,603
305
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Sep 2 13:37:38 2021 @author: paulmueller """ import glob import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import numpy as np from scipy.stats import wilcoxon from iEEG_STC import utils import os sns.set_palette("tab10") sns.set...
caa29eece0b68a46fd0b9729a9678c47a5598b31c0d161584c1b302721ad9f31
Python
14,607
401
""" Refer to https://github.com/rosinality/stylegan2-pytorch/blob/master/lpips/dist_model.py Refer to https://github.com/richzhang/PerceptualSimilarity/blob/master/lpips/trainer.py """ from __future__ import absolute_import import sys import numpy as np import torch from torch import nn import os from collect...
3ffd2fea66a4385966cd01629c7361707c3633029174b3009e7b4855c71f3590
Python
14,622
357
""" Tests for C++ polymer topology functions in _polymer_math module. """ import numpy as np import pytest try: from polychrom import _polymer_math # noqa: F401 HAS_POLYMER_MATH = True except ImportError: HAS_POLYMER_MATH = False pytestmark = pytest.mark.skipif(not HAS_POLYMER_MATH, reason="_polymer_ma...
2090915bd6d0df6f322dc1423e8b5e4cc5a54a9a7c18b25640231b49f65e2241
Python
14,636
387
#!/usr/bin/env python # Script to build windows installer packages for LAMMPS # (c) 2017,2018,2019,2020,2021,2022,2023,2024,2025,2026 Axel Kohlmeyer <akohlmey@gmail.com> from __future__ import print_function import sys,os,shutil,glob,re,subprocess,tarfile,gzip,time,inspect,hashlib try: from urllib.request import urlr...
3d79e5176aecb3820a3eb6cbea4e37f03298448feb05ddb3f842b04776cd52a6
Python
14,639
443
import math import numpy as np import networkx as nx import scipy.spatial as sp def addNode(p,nodes,tol=1e-1): """ Auxilliary function for adding node to a preexisting list """ for idx,n in enumerate(nodes): if abs(p[0]-n[0]) > tol: continue if abs(p[1]-n[1]) > tol: continue ret...
6bc13cc8eaca25bd207abdc7a4b643fa6fd5a0bb96ac83e5b31635bcd82dc25d
Python
14,639
304
# Part of the convolution layers and l-DDT computation are modified from DeepAccNet # Improved protein structure refinement guided by deep learning based accuracy estimation # Naozumi Hiranuma, Hahnbeom Park, Minkyung Baek, View ORCID ProfileIvan Anishchanka, Justas Dauparas, David Baker # Nature Communications doi: 1...
35ddb64b6c8cd4618d0f8e5013fa9eb6c77e204bce1c7ed5868b3cf1ff2c73ac
Python
14,653
576
# %% [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 graspy.match import GraphMatch from graspy.plot import heatmap from graspy.simulations import sbm from src.data import load_metagraph from src.graph import pre...
7a67aeb63e01eed7e6fdb5748dadb866853238638958da92fbb72848eb2488ec
Python
14,674
462
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import os import time import numpy as np import warnings import scipy import SimpleITK as sitk from ..utils.utils import get_unet import os from nipype.interfaces.base import ( ...
0fca18df30631351791243dab058eaba90c010648c2334c38e9109ce926fc15c
Python
14,681
356
import pysam import debarcer.umi_network_collapse as network from debarcer.utilities import get_umi_from_name def umi_count(contig, region_start, region_end, bam_file, truncate, separator): ''' (str, int, int, file, bool, str) -> (dict, dict) :param contig: Chromosome, eg chrN :param region_start...
6e4e6758690a89d874e7916f6dadec4d6a498323142e09e6a8e8f200eb1f13ef
Python
14,681
412
from fnmatch import fnmatchcase from itertools import combinations import numpy as np from ._data_obj import ( NDVar, Case, Dataset, ascategorial, asdataobject, assub, cellname, dataobj_repr, ) from ._stats.stats import variability from ._utils.numpy_utils import FULL_SLICE class Celltable: """Divid...
7f4f83124dc3d53d7d6f94ad12f4a6d0d02bee04bd646a728b5c7d0127e951c7
Python
14,681
432
import numpy as np import sys import datetime import warnings from csbdeep.utils import normalize from scipy.ndimage.filters import gaussian_filter from scipy.ndimage import map_coordinates, zoom from scipy.optimize import minimize_scalar from skimage.measure import regionprops, label from skimage.feature import corner...
180dc9a64c329fab3abf9a67315dc7c425578e39314f9ee4b4416fd36de6d70e
Python
14,691
480
#%% Imports and file loading from pathlib import Path import glob import json from os import listdir from operator import itemgetter import pandas as pd import networkx as nx import numpy as np from graspy.plot import gridplot from src.data import load_networkx # File locations base_path = Path("./maggot_models/data/...
76fc0267145f7596626cfb129d9fee7aefee4b8ff069cfb320d3586378017c4c
Python
14,696
328
#!/usr/bin/env python3 """Query the live CARLA world: actors, level bounding boxes, raycast, snapshot. This is the RESOLVER skill — use it to turn an ambiguous description ("a prius", "the nearest walker", "the 3rd one") into a concrete actor id that the action skills (telemetry, bounding-boxes, control-vehicle, contr...
958f567cfa6e4d7bde302301bf9f336c54971cf59d9bd26e1495e018087c4e41
Python
14,703
382
import math from math import inf from typing import List, Optional, Tuple import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence from transformers import AutoModel PAD_ID = 0 class SentenceLevelEncoder(nn.Module): """BiLSTM att...
66de3bbdba4447fd356fdcbd4a8e964a42978af3d407939e3e2541bcdee97073
Python
14,708
405
from logging import handlers import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator import matplotlib.ticker as mtick import math color_list = ['royalblue', 'orange', 'limegreen', 'crimson', 'mediumorchid', 'dimgray', 'mediumpurple', 'chocolate', 'lime', 'lightpink', 'maroon', 'nav...
88ca634b580aa3d764b9fecf59c9caf99120c562be1927fb0bea5093840e1f91
Python
14,715
511
# %% [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 joblib import Parallel, delayed from scipy.optimize import curve_fit from graspy.match import GraphMatch from graspy.plot import heatmap fr...
96dd7a19c7de4f13520ccfc1075ded3350ff4946493be3561b9918a46218f415
Python
14,719
525
import torch import torch.nn as nn import torch.nn.functional as F class REBNCONV(nn.Module): def __init__(self,in_ch=3,out_ch=3,dirate=1): super(REBNCONV,self).__init__() self.conv_s1 = nn.Conv2d(in_ch,out_ch,3,padding=1*dirate,dilation=1*dirate) self.bn_s1 = nn.BatchNorm2d(out_ch) ...
9eb49da3b1b93bbb7c09b0e82fc5e5df3b0d64f5548340aebae4b32a3755f1aa
Python
14,741
322
""" File: create_matrices.py Created: 2020/10/08 Last Changed: 2021/12/07 Author: M.Vochteloo Copyright (C) 2020 M.Vochteloo This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either ...
d94e4da91af96a919061bc190edf22140d33946187bb2a481f7dc211db182eb9
Python
14,741
395
#################################################################################################### # 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...
e7dbee99bc346560484b20a0883dfa731a86812269900316a9a76033bf3853d7
Python
14,742
483
#%% Imports and file loading from pathlib import Path import glob import json from os import listdir from operator import itemgetter import pandas as pd import networkx as nx import numpy as np from graspy.plot import gridplot from src.data import load_networkx # File locations base_path = Path("./maggot_models/data/...
57a11bc8d5a1149c2288bea4a7e70f8316ce53f71e9d4bf517aa69cb62a05e98
Python
14,743
383
""" Adapter for UniProt endpoint (experimental). .. warning :: this is currently highly incomplete This is an adapter for the uniprot triplestore, which includes: - entries for individual proteins - triples connecting these proteins to other IRIs, including vocabulary terms The adapter treats all entries as on...
d0cdc2ad1bf83c2df0239620a58fad5e77021a73c9b0d7125adba5353d8b8af5
Python
14,750
541
# %% [markdown] # ## The goal of this notebook: # investigate regularization approaches, for now, just on the full graph # these include # - truncate high degree # - truncate low degree # - plus c # - levina paper on row normalization # - others? # %% [markdown] # ## import os import time import wa...
97d36e79fd7fca03681a608267947da180aec314c076b922fe1c3ae9f9aace78
Python
14,763
113
#!/usr/bin/env python3 """ File: partial_deconvolution.py Created: 2020/06/29 Last Changed: 2020/11/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 Fr...
32d5efcebfad6c36771cf247f7adb6f4313651ac5e186a49666e855e226c4d36
Python
14,765
467
# 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...
edb437bd546765c5cc7c76a972e8a58b2d4c9ea62efca8509acc42386f1ab556
Python
14,775
347
from typing import Sequence, Union, Tuple, Callable import numpy as np import torch from matplotlib import pyplot as plt from tensorflow.examples.tutorials.mnist import input_data from sklearn import utils import os from artemis.experiments import ExperimentFunction from artemis.experiments.experiment_record import...
294640b83853b884f48ce875a2f88b5b4e14de91ca401977cb3defd568e4bb84
Python
14,786
378
""" This work heavily relies on the implementation by Icarte: https://bitbucket.org/RToroIcarte/bnn/src/master/ """ import gurobipy as gp from gurobipy import GRB import numpy as np from helper.misc import infer_and_accuracy from globals import INT, BIN, CONT, EPSILON, GUROBI_ENV, LOG, DO_CUTOFF vtypes = { INT: GRB....
d50f82bc6993fd9480705a4462276f7e5ec47d68a96ba7697b5f198bfd891f2e
Python
14,801
286
# -*- coding: utf-8 -*- """ Created on Tue Nov 24 10:18:25 2020 @author: jacks """ # %% Imports import time from numpy import pi import pandas as pd pd.options.mode.chained_assignment = None #suppresses a warning that shows up in the genodock preprocessing # defs contains all of the circuit definitions as well as au...
8f1bc94af144e9dd8d91acc737371e889798bb818d664a257cf63b1f866416a6
Python
14,824
378
import argparse import random import time import warnings import torch import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.optim import torch.multiprocessing as mp import torch.utils.data import torch.utils.data.distributed import torchvision.transforms as transf...
607951badf9c7363ffec07c0f8ef29e351ff0ba91745ed1364f20c08b10aab4a
Python
14,832
484
#%% Imports and file loading from pathlib import Path import glob import json from os import listdir from operator import itemgetter import pandas as pd import networkx as nx import numpy as np from graspy.plot import gridplot from src.data import load_networkx # File locations base_path = Path("./maggot_models/data/...
bdad6685ceff17a48319534ad1a5c0ea61f4d1bb12a04026017dac4372c24f6f
Python
14,835
445
import torch from torch.autograd import Variable from torch.nn import functional as F from torch.nn import init from contextlib import contextmanager from functools import partial class UnidirectionalInterface(torch.nn.Module): """Basic `Interface` for unidirectional communication. Can be used to manually p...
49570a0f5f188ec683784bd897e5540b1050c67cd22595415f0d0434ed4d0be2
Python
14,841
366
# 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...
e9295f2551db756d3fe853d560a75215da5338e8d9d988b6ba46bf8b02a486f0
Python
14,844
356
import os import sys import datetime import stat from collections import defaultdict import numpy as np from pycocotools.coco import COCO from pycocotools.cocoeval import COCOeval from mindspore.train.callback import Callback from mindspore import log as logger from mindspore import save_checkpoint from model_utils.con...
12fe595c19091f09102873f51c7933cfcf8bdb0dfbdfb5ef2e0d77ccb2e22d9a
Python
14,851
420
import hashlib import json import os import tempfile import typing as tp import numpy as np import PIL.Image from backend import postprocessing from backend import jobs import backend from base.backend.pubsub import PubSub from base.backend.app import get_cache_path, get_models_path import torch SEGMENTATION_CACHE_...
0a963e63ae81b23eb225f720988b59b78cc3959f04be88b03e23a06187135f6b
Python
14,864
331
"""Live check of the path-traced tag AOV (sensor.camera.rt_lens_instance). The sensor renders through the same lens as sensor.camera.rt_lens but outputs, per pixel, the CARLA tag of the primary hit in the byte layout sensor.camera.instance_segmentation already uses (R = semantic label, G = actor id low byte, B = actor...
916235c6d6f7a2957a068e08cdd1292f8da8f94bc27e1c0fb124d9cbef28b608
Python
14,870
430
from copy import deepcopy import os import re import mne from .._mne import combination_label, labels_from_mni_coords, rename_label, dissolve_label from .definitions import DefinitionError, Definition, tuple_arg SEEDED_PARC_RE = re.compile(r'^(.+)-(\d+)$') class Parcellation(Definition): DICT_ATTRS = ('kind',...
99dc131c321fedfd08fcf723a34edb5172fcd90626380d310420336259011b98
Python
14,871
428
import torch import torch.nn as nn from torchnlp.nn import Attention from neural_networks.base_models import BaseModel from blitz.modules import BayesianLinear, BayesianConv1d from neural_networks.custom_modules import ConvDropRelu, LinearDropRelu, BayesianConvDropRelu, BayesianLinearDropRelu from blitz.utils import v...
14197ab131342b88875e9a43a893139e1decdd3cba3c761cae8e6b797fe4b979
Python
14,890
408
import pandas as pd from drugex.data.corpus.vocabulary import VocSmiles, VocGraph from drugex.logs import logger from drugex.data.interfaces import DataSplitter, FragmentPairEncoder from drugex.molecules.converters.interfaces import ConversionException from drugex.molecules.interfaces import MolSupplier from drugex.pa...
a348adfdb9db138f925e6e87096256a75ba0181ef70e93473ddd352cfa6ac285
Python
14,903
265
from __future__ import division import os import numpy as np import pymworks import matplotlib.pyplot as plt from collections import Counter from mw_parse_initial_170623 import get_animals_and_their_session_filenames def analyze_sessions(filepath): animals_and_their_session_filenames = get_animals_and_their_sessi...
42de769e25179d313468b6674c023bea420073d96553890f2906ea8b8e01c7e0
Python
14,906
539
# coding: utf-8 # In[51]: from __future__ import print_function feature_count = 42 predict_column = -2 target_cluster = 0 pop_size = 25 max_fitness = 3.0 max_gens = 80 pool_size = 15 seed_with = None #[0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
6e1551c8cf16d8e8f98ca2ddf11852d481234fbc29d5552015699aedc5b069d8
Python
14,908
266
# 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...
4f27a6944ea88360f5ea0905e55d0e0cebf1efbfe11963cc37fcf0f7d8e0be5d
Python
14,912
280
#%% 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...
16c48e397c387cf7375c64cc0194c8ed8ae43004ee409681dbaad59e9e60e4af
Python
14,920
391
"""Test cases for the command line client in __main__ module.""" import glob import json import os import shutil from pathlib import Path from typing import List from typing import Optional from typing import Tuple from unittest import mock from unittest.mock import MagicMock import pytest from _pytest.fixtures import...
a88d0986e5898f9e7993cf8a2d6f2167307fdf32ca810f8cf1027c50b5c3cef4
Python
14,924
467
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Apr 5 21:42:12 2020 This script will train PACIFIC and save the model, training and validation plos in specified folders. @author: Pablo Acera """ import argparse parser = argparse.ArgumentParser(description= """ ...
a76083073991527de81b2eb23bb7c3e6b0518a67e3757c2677924995e8638e61
Python
14,928
447
# -*- coding: utf-8 -*- from unetsl.cerberus.cerberus_config import getDefaultCerberusPredictionConfig, getTrainingConfig, HeadConstants import click import unetsl import unetsl.model import re import numpy import time import scipy.ndimage import tensorflow.keras.models import tensorflow.keras.layers from tensorflow ...
f45833766d5a04f7dbfddea8911a63f2921e9705cda3ffce80caa44a3a8e7b01
Python
14,937
416
"""code to interface with nest simulator""" import numpy as np import pandas as pd import logging from tctx.util import sim from tctx.util.profiling import log_time from tctx.util.defaults import DEFAULTS from tqdm.auto import tqdm as pbar ############################################################################...
3d57c31a702750551cb889f396163d7f1426a28b18287b85f1638559f56b5451
Python
14,942
376
from __future__ import print_function from __future__ import absolute_import # -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # ----------------------------------------------------...
4f81486609a6f8359d25f9f982f937864f3f246d845851bea64f679660f313e4
Python
14,950
352
import torch import random import numpy as np from itertools import compress from rdkit.Chem.Scaffolds import MurckoScaffold from collections import defaultdict from sklearn.model_selection import StratifiedKFold # splitter function def generate_scaffold(smiles, include_chirality=False): """ Obtain Bemis-Murc...
a70aecdafeda455077fa06a42201d76bdeda31d056ae7b2ff4ac9a5161883269
Python
14,955
421
from __future__ import print_function, division import random import sys from matplotlib import rcParams import matplotlib.pyplot as plt import pandas as pd import numpy as np import h5py # Pytorch packages import torch import numpy as np import torch.optim as optim from torch import nn from torch.utils.data import ...
2511c85ca867d771ece71815ec4f68ce1124656cf6cd3d7b665a7b32de5b3a4e
Python
14,969
334
from . import config import torch import torch.nn as nn import numpy as np from collections import namedtuple ModelParams = namedtuple( 'ModelParams', [ 'vocab_size', 'token_embedding_dim', 'hidden_dim', 'encoder_layers_cnt', 'decoder_layers_cnt', 'latent_dim', 'device', 'x_dim']) ModelParams._...
d549174a06c16c8f22d5d374906c116a2efc37678974abdcc015a4c8578ec59f
Python
14,971
376
# # Copyright (c) 2018 Institute for Basic Science # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge...
87e8d10652a13a9b0af60149e40ce7410afee1f562270f89b5b903ffadf19d9e
Python
14,972
374
import mne import numpy as np from itertools import combinations, product import pandas as pd import re import torch from torch.nn import NLLLoss from torch.nn import functional as F import csv from os.path import join import matplotlib.pyplot as plt from matplotlib.patches import Rectangle import matplotlib from datet...
82c8bb9a53a3936db202f3a684f161834983cd97e479150d3e17c60dd7c0d486
Python
14,975
559
# %% [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 numpy as np import pandas as pd import seaborn as sns...
96388cac5695ee0daf41b55ab9bf8d91c2ced4b1f5f87efb9527d56aebb9fe96
Python
14,975
373
# Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma de # Barcelona (UAB). # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. from . import SyncSmokeTest from . import SmokeTest import carla import time import math import num...
e50258c049d1102fb6555e0c0fc2b38858e88174eab80a32649385bde8b9a32a
Python
14,981
361
from data import * from utils.augmentations import SSDAugmentation from layers.modules import MultiBoxLoss from ssd import build_ssd import os import sys import time import torch from torch.autograd import Variable import torch.nn as nn import torch.optim as optim import torch.backends.cudnn as cudnn import torch.nn.in...
93f6cea947b1ae6fd624d05da107b8b6e93db19128cf44d7c424a431e1893062
Python
14,986
334
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # Modifications Copyright 2017 Abigail See # # 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...
22a402c175d415b22b9fc4ac2197eeaae613b6828f138554a4e33c13e32edc4e
Python
15,006
295
# 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...
6c8885734259b05275839ab2aae4a000356c351ad549477ee437f3cdcb1438b4
Python
15,012
318
#!/usr/bin/env python3 """ File: correlate_align_metrics_with_genes.py Created: 2021/12/07 Last Changed: 2022/03/31 Author: M.Vochteloo Copyright (C) 2020 M.Vochteloo This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publish...
9181d5c182384983f69f3e47e21881304b86a661f873c99692b6f87464ec72c1
Python
15,020
367
"""Implementation of optimization based attack, CW Attack for object adding. Based on CVPR'19: Generating 3D Adversarial Point Clouds. """ import pdb import copy import time import torch import torch.optim as optim import torch.nn.functional as F import numpy as np from sklearn.cluster import DBSCAN from util.po...
cc9eca44e000d55e127b51b1fc270379d1dd31609e8f3f436d8d261a6834256a
Python
15,021
637
#!/usr/bin/env python # -*- coding: latin-1 -*- # # Copyright 2016-2019 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/LICEN...
73f8ce0850a1e70915980d42397655fbccdbe9ece0f01e3ecf1d5922008e9484
Python
15,028
387
#!/usr/bin/env python # coding: utf-8 # In[1]: ##################### IMPORTS ####################### import os import sys from keras.models import model_from_json from matplotlib import pyplot as plt import numpy as np from keras.callbacks import ModelCheckpoint from rdkit.Chem.Draw import IPythonConsole import os,...
c00592f405655c257eb93a560d1d891451822b6e5bf80240fba46271ab264499
Python
15,039
392
from __future__ import annotations from typing import TYPE_CHECKING, Callable, Dict, Iterable, List import os import pandas as pd from palm_tools.utils.read_file import check_file_and_read import logging import glob import numpy as np if TYPE_CHECKING: from palmari import Acquisition from palmari import Expe...