sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b99bc700d1d8b7ff094d1ff0a9a4ac2934a16568499f41602ba49f2aaf18773c | Python | 7,604 | 187 | # 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... |
e31cf3d6c55b48123da879e4a87e521372cd457532801de570f6c15153fe453c | Python | 7,604 | 202 | from anytree import Node
import numpy as np
from anytree import LevelOrderGroupIter, Node
from .traverse import BaseTraverse
def to_transmission_matrix(adj, p, method="uniform", in_weights=None):
neg_inds = np.where(adj.sum(axis=1)<0)[0] # negative edges indicate inhibitory connections
adj = adj.copy()
... |
1530abdb2cc4f62b88e692cdd257fe885f1757e731d7b55139ce3495cf44ee91 | Python | 7,606 | 220 | # 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... |
9e50c4d105639d6d097bb751ff1660ba48beff4d7c2b5efa578a679b156e4db2 | Python | 7,607 | 192 | import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__))+'/../LassoVariants/AlternateLasso')
# sys.path.append('../../LassoVariants/AlternateLasso')
import pickle
import numpy as np
from AlternateLinearModel import AlternateLogisticLasso
from sklearn.linear_model import LogisticRegression
from s... |
eac68d9655cbd2bfba9ed089d434fc6bfe9b8962dfc5c3b4066d04c53287b52a | Python | 7,607 | 228 | # -*- coding: utf-8 -*-
#
# HiC pipeline for iterative correction documentation build configuration file, created by
# sphinx-quickstart on Sat Mar 31 10:18:30 2012.
#
# 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... |
6fe990ccbef4ba2d47089979560ec63a3892aa2d7a84cc47f1949725d9f28e42 | Python | 7,608 | 198 | # %%
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import re
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_... |
2065c8539b5a5f8ff98a2ce6bad7b94f4eecf8b55ee656aa1d1b2bca9383ed13 | Python | 7,610 | 191 | import tqdm
import ipdb
import argparse, sys
import random as rand
import torch
from metrics import *
from graphxai.explainers import *
from graphxai.datasets import load_ShapeGGen
from graphxai.datasets.shape_graph import ShapeGGen
from graphxai.gnn_models.node_classification.testing import GIN_3layer_basic
def get... |
47a39fa4a0594e832baf237e2cd32371ed6003b0e5de591f902d5e28f7cf50cd | Python | 7,610 | 234 | import requests
import pickle
import itertools
import json
import argparse, glob, csv
from geopy.geocoders import Nominatim
from requests.api import get
from shapely.geometry import mapping, shape
from shapely.geometry.base import CAP_STYLE, geom_from_wkt
# --------------
# CONSTANTS
# --------------
HEADERS = {"Con... |
2bdd635833b572627e6e8e9365f2684f479cc6396e6757558ef14c53fad467e0 | Python | 7,611 | 181 | import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from .attention import Attention
from .zoneout import ZoneoutLSTMCell
class PreNet(nn.Module):
def __init__(self, channels, in_dim, depth):
super().__init__()
sizes = [in_dim] + [channels] * depth
... |
c1e226a3b46bd6257be0c2d48d92de3bc2c5c6ed8d800faf2d5f74d3271f4e6e | Python | 7,612 | 221 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import unittest
import numpy as np
import torch
from maskrcnn_benchmark.layers import nms as box_nms
class TestNMS(unittest.TestCase):
def test_nms_cpu(self):
""" Match unit test UtilsNMSTest.TestNMS in
caffe2/operators/... |
f7e0270ebdc39e186387387f5a4a26c43d33aa6f33afa3b1c6e6fea3d8cba19a | Python | 7,615 | 171 | # 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... |
0ef25b268719b79b60665d3f24f08015b0f4be0d80ad937040e0689ba1a8faa9 | Python | 7,616 | 207 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
import torch.nn.functional as F
from torch import nn
from maskrcnn_benchmark.modeling import registry
from maskrcnn_benchmark.modeling.box_coder import BoxCoder
from maskrcnn_benchmark.modeling.rpn.retinanet.retinanet import build_ret... |
4520fc289ac4cab523317ee1e5cb993b32521bd12626caae1019b9e57e6b61d3 | Python | 7,617 | 166 | # basic imports
import os
import pickle
import numpy as np
# framework imports
from cobel.agents.sfma import SFMAAgent
from cobel.interfaces.gridworld import InterfaceGridworld
# local imports
from sfma_memory import SFMAMemoryNonLocal
def define_run_patterns() -> dict:
'''
This function predefines run patter... |
8b04f722d036b3ac19d25581f7bbc300fceafdac727597cae61275731e5a3b34 | Python | 7,618 | 228 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
d112a30e42f03de735d62c43d434b833f12568de1131c80b8ec629b2f8a6a14a | Python | 7,618 | 288 | # %% [markdown]
# # THE MIND OF A MAGGOT
# %% [markdown]
# ## Imports
import os
import time
import warnings
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 anytree import LevelOr... |
b1ae90a4aa1f462b3fbf2d7343d03604a58ae17b41fea6d4e8c074ebb3285673 | Python | 7,620 | 216 | import argparse
import glob
import math
import ntpath
import os
import shutil
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
from datetime import datetime
import numpy as np
from mne import Epochs, pick_types, find_events
from mne.io import concatena... |
60b762557f2e169effd9faeddef6a2daffb80322eed3424b5ccda468738ddf8c | Python | 7,622 | 198 | #!/usr/bin/env python3
"""
File: visualise_deconvolution_covariates.py
Created: 2020/09/30
Last Changed: 2020/11/24
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 publis... |
f1086a40f4cadc5ccde4bcee3299cd43944bb5d0b54a34df3d64c1964ce0cd0c | Python | 7,623 | 206 | ####################################################################################################
# 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 ... |
e28d4e8033902a0d81e8e794b69a6c52203442effa33392cd001e722db8b6d30 | Python | 7,624 | 208 | # 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... |
7dce665c6d0090eedbca835d662d131340c7df344b1cf753bf86afa783735466 | Python | 7,625 | 224 | import functools
import inspect
import logging
import os.path as op
from time import time
import nibabel as nib
from dipy.io.streamline import save_tractogram
from dipy.io.stateful_tractogram import StatefulTractogram
try:
from trx.trx_file_memmap import TrxFile
from trx.io import save as save_trx
has_trx... |
f752815bcb516a13cd686d65d7c9dbea3d386b10bd6ef94c11e51abdaf17fec6 | Python | 7,626 | 174 | '''
Written by Nathan Neeteson
A module containing code for a modified UNet.
Layer is a class containing a repeating unit used in the UNet.
UNet is a class containing the full structure of the UNet, with a
configurable number of layers and number of filters in each layer.
'''
import torch
import torch.nn as nn
# the ... |
8d055a3c8c74f710bcf7a3fe794ea9315396320b008c0354e8203499a7303062 | Python | 7,629 | 193 | """A stand-in for `vllm serve --omni` exposing the videos API the Cosmos 3 worker uses.
Behaviour: ``POST /v1/videos`` (multipart) -> queued job that becomes ``in_progress``
then ``completed`` after ``--delay`` seconds; the "generated" mp4 is the uploaded
``input_reference`` if any, else the first ``control_path`` fil... |
9ed50eff5b88db8ba25816affe9ef40e178cce4d211b69ee47da46485cf93e82 | Python | 7,629 | 173 | from collections import defaultdict
import logging
from random import Random
from typing import Dict, List, Set, Tuple, Union
import warnings
from rdkit import Chem
from rdkit.Chem.Scaffolds import MurckoScaffold
from tqdm import tqdm
import numpy as np
from .data import MoleculeDataset, make_mol
def generate_scaff... |
3eedf23ede174751c515b0964a7344451e46ae267e4628d590d0a630e8f6cf0f | Python | 7,632 | 201 | import torch
from maskrcnn_benchmark.config import cfg
from maskrcnn_benchmark.modeling.box_coder import BoxCoder
from maskrcnn_benchmark.modeling.utils import cat
from maskrcnn_benchmark.structures.bounding_box import BoxList
from maskrcnn_benchmark.structures.boxlist_ops import cat_boxlist
from maskrcnn_benchmark.st... |
ebff17dec16c5e76691f6f3fcbf3e8a62ffbc16e096a813f46871ead05d956e1 | Python | 7,632 | 149 | ## python to divide datasets into each batch
import pandas as pd
import scipy.sparse
import os
import numpy as np
import scipy.io
import itertools
import pybedtools
from scipy.stats import zscore
from multiprocessing import Pool, Array, Process
import seaborn as sns
import subprocess
import matplotlib.pyplot as plt
imp... |
da8627b28a2176665b7edd30d77f65770fb56f53db61339c6ffccabadc1bb48a | Python | 7,634 | 303 | # %%
import numpy as np
import pandas as pd
from box import Box
import csv
from pathlib import Path,PureWindowsPath
import matplotlib.pyplot as plt
# %%
df=pd.read_excel("./Split times per file.xlsx",index_col=0)
# %%
def applyf(s):
if s[0]=='?':
return []
else:
return list(np.fromstring(s,sep=... |
99eb1bfcd6f77e399fe686440e38471b0a11ae6bb374fa340a8d3a37d787bfe3 | Python | 7,635 | 213 | #!/usr/bin/env python3
"""
@ Lina Teichmann
INPUTS:
call from command line with following inputs:
-bids_dir
OUTPUTS:
makes an overview plot of the eyetracking preprocessing steps
"""
# step1_eyetracking_preprocess.py>
from step1_eyetracking_preprocess import *
from matplotlib import grids... |
2ac8f18bcd21ef492ba79eb1a22820da45e809bf6cb2bafebe98f773b12f8dc3 | Python | 7,636 | 235 | # Built-in
import bz2
import pathlib as pl
import pickle as pickle
import zlib
from typing import Any
# Third-party
import numpy as np
import pandas as pd
from brian2.input.timedarray import TimedArray
from brian2.units import * # noqa: F403
# Local
from cxsystem2.configuration import config_file_converter as file_c... |
971dc4924f5c61ad1e7514d2bac98d85adfafa8d05e29cb974b245eed406b76c | Python | 7,638 | 167 | import os
import numpy as np
import sys
import time
import torch
import torch.nn.functional as F
from torchvision import transforms
import torch.nn.init as init
import random
import pandas as pd
from itertools import chain
from skimage.io import imread, imshow, concatenate_images
from skimage.transform import resize
f... |
8e840e89bca15815720e4517b1c680965a9bb8d1c94ba9260f7ccd0b8c1c313b | Python | 7,639 | 216 | #!/usr/bin/env python
# Interface to a fasta reference file.
import os
import sys
import re # for regular expressions
import math # for ceil
import cPickle as pickle
from tt_log import logger
VERSION = '20150623.01'
logger.debug('version %s loaded' % VERSION)
DEF_WINDOW = ... |
2728eed8b599e71c96d5885256503e21e5a050ebaae756661059b419a5b5fa0d | Python | 7,640 | 203 | from Lif_Parameters import *
from Lif_Equations import eqs_LIF
from math import ceil
import random
seed(val)
#####################################
# Initialize the neuronal populations
#####################################
# ------- Layer 0 -------
l0 = NeuronGroup(n_cells, eqs_LIF, method='exponential_euler', thresh... |
eb45c3504170d04c19d818c4204abcb02235985598ea351c7537dd6e0ead0599 | Python | 7,640 | 161 | # 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... |
057b9b450ca715c27d98a88ff3e9493026c1f136bce5c6b57d96e1610cba4f4a | Python | 7,642 | 228 | """GLM Permutations base class."""
import logging
from typing import Dict, Optional
import numpy as np
from scipy import stats
from osl_dynamics.glm.base import Design, GLM
from osl_dynamics.glm.ols import osl_fit
from osl_dynamics.utils.progress import parallel_map
_logger = logging.getLogger("osl-dynamics")
cla... |
4d4806a570482bee213d6e7570e4450ef41597c011ed143a1456ddc821a2c31a | Python | 7,644 | 238 | """Single-channel Dynamic Network Modes (SC-DyNeMo)."""
from dataclasses import dataclass
from typing import Dict
import numpy as np
import tensorflow as tf
from osl_dynamics.models.dynemo import Config as DynemoConfig
from osl_dynamics.models.dynemo import Model as DynemoModel
from osl_dynamics.inference.layers imp... |
4107d4550c346721f35925c8ce34ee00c664f67af5252015d8a911295bd46580 | Python | 7,647 | 222 | #%%
import os
import sys
try:
os.chdir('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
print(os.getcwd())
except:
pass
# %%
import sys
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/maggot_models/')
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
fr... |
02a1408d8769f3fc0bb336d014b70b53c745e874a403ecb5338eba82f7078d93 | Python | 7,654 | 181 | '''
collection of chemisorption models.
newns_anderson:
'''
import torch
import numpy as np
class Chemisorption:
def __init__(self, model_name, **kwargs):
# Initialize the class
if model_name == 'gnn':
self.model_num_input = 1
if model_name == 'newns_anderson_semi':
... |
c58ce210c012e6ddcb2fbff03647224dfa593789c10c35a00c85a16bdaa61016 | Python | 7,658 | 136 | __author__ = 'duarte'
from modules.parameters import ParameterSet, ParameterSpace, extract_nestvalid_dict
from modules.input_architect import EncodingLayer
from modules.net_architect import Network
from modules.io import set_storage_locations
from modules.signals import iterate_obj_list
from modules.analysis import sin... |
752892a6b8e0f6641316b1347a7307c55b167aa866850921011e0651c3bf3e6c | Python | 7,661 | 136 | # basic imports
import os
import pickle
import numpy as np
import pyqtgraph as qg
# framework imports
from cobel.agents.dyna_q import PMAAgent
from cobel.agents.sfma import SFMAAgent
from cobel.interfaces.gridworld import InterfaceGridworld
from cobel.analysis.rl_monitoring.rl_performance_monitors import EscapeLatencyM... |
f1c36def5475fbe32695090cbdb78dfda609278de982e9b9b83975458b9fc896 | Python | 7,662 | 229 | """
monitors
Created by: Martin Sicho
On: 02.06.22, 13:59
"""
import os.path
from abc import ABC, abstractmethod
import numpy as np
import pandas as pd
import torch
from drugex.training.interfaces import TrainingMonitor
class DictMonitor(TrainingMonitor, ABC):
def __init__(self, verbose=False, clean_after_epoc... |
77e5eb14251c6a639188e4184a9fb86b051de51610ca875adeb1b9d96e0aa761 | Python | 7,664 | 245 | import sys
import re
import json
import requests
from time import sleep
import numpy as np
import pandas as pd
def get_enrichr_results(gene_set_library, genelist, description):
"""Query Enrichr
Args:
gene_set_library (str): Enrichr gene set library
genelist (list): List of genes to query
... |
dc85f671fed38a7f6c713f978add920adedc206081e2c179f7b0581e53de13a0 | Python | 7,665 | 181 | # %%
from pymaid_creds import url, name, password, token
from data_settings import data_date, pairs_path
import pymaid
rm = pymaid.CatmaidInstance(url, token, name, password)
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from contools import Promat
# allows text to be ... |
b141ad9b39cb585bd88c6a1ebda37d6715c8920736912150d03fe3811d35640d | Python | 7,666 | 235 | # -*- coding: utf-8 -*-
import urwid
import json
import collections
import sys
import os
import readline, rlcompleter
import pathlib
class FileCompleter():
"""
For getting a file from the command line. Searchs the path relative
to a piece of text and offers suggestions. Uses readline.
"""
... |
29f85cc1c186b37067cbccbad6e26c4a9c5aa57328713e57c0fa94e7836fa2b9 | Python | 7,667 | 211 | from __future__ import print_function
from __future__ import division
from builtins import str
from builtins import range
import os
import numpy as np
try:
from bottleneck import nanmean
except ImportError:
from numpy import nanmean
import sima.misc
from .segment import SegmentationStrategy
from . import oPCA... |
5c246da071f731e7fa1ca2835db46858f6e68ac8622f97392bb5e9c67648babb | Python | 7,667 | 235 | """Functions to perform statistical significance testing."""
from typing import Dict, Optional, Tuple
import numpy as np
from osl_dynamics.glm import DesignConfig, MaxStatPermutation
def evoked_response_max_stat_perm(
data: np.ndarray,
n_perm: int,
covariates: Optional[Dict[str, np.ndarray]] = None,
... |
ada335387664462b0ea6f52dae82d643ae1214a80fed208872c6d2aa990ca516 | Python | 7,667 | 233 | # 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... |
6b8a0ef79a8338027ba3e9109134c51f27a28d5d7cc0a38e99f81dbcffd7a05b | Python | 7,668 | 172 | '''
Flagellum updated version.
- Keep track of material frame when making nodes on the circles.
- Calculate velocities using finite difference. Take into account rotation of material frame.
- Nodes on the circle are created around given centerline points
(before they were created right in the middle of two given po... |
66eed0d8e5234f29d93a61a9d2da898a5f0a91b2090a02efd54612cb96571a4e | Python | 7,669 | 224 | """
This package about data loading and data preprocessing
"""
import os
import torch
import importlib
import numpy as np
import pandas as pd
from util import util
from datasets.basic_dataset import BasicDataset
from datasets.dataloader_prefetch import DataLoaderPrefetch
from torch.utils.data import Subset
from sklearn... |
3aff113faef55c2b500520e5716a00b6b93645a4761f9e2c2616ee119d475d62 | Python | 7,673 | 240 | """
Written by Nathan Neeteson.
Training a U-Net on dataset of segmented images.
"""
# IMPORTS
import os
import yaml
import torch
from torch.nn import DataParallel
from torch.optim import AdamW
from torchvision.transforms import Compose
from models.UNet import UNet
from utils.error_metrics import (
HRpQCTEmbeddi... |
a004266aa7cd2a9bf21957269068aefefdb2ca53e833fc3ebf8e400f39ee0cb9 | Python | 7,673 | 190 | import torch
import torch.nn as nn
from .utils import InitWeights_He
class conv(nn.Module):
def __init__(self, in_c, out_c, dp=0):
super(conv, self).__init__()
self.in_c = in_c
self.out_c = out_c
self.conv = nn.Sequential(
nn.Conv2d(out_c, out_c, kernel_size=3, padding=... |
b4601b7cccd37232b818b4dd4e23769bc65a8f4039f8972fd39a5c063dd17fdf | Python | 7,673 | 292 | #%%
import os
import time
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from tqdm import tqdm
from giskard.plot import (
MatrixGrid,
axis_on,
confusionplot,
crosstabplot,
soft_axis_off,
stacked_barplot,
)
from graspologic.pa... |
c4dded5a0a9f3c287134efe8c9975a189631f3cf39288f80244bd00aa9717285 | Python | 7,673 | 209 | #!/usr/bin/env python3
"""
File: cellmap_reference_profile.py
Created: 2021/07/06
Last Changed: 2021/10/13
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... |
0a0b8bdb7c256e28f644c7a79b3e1b39face0ccce19a8b63cf3731b5d57d2b64 | Python | 7,674 | 155 | # 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... |
68722e9b10431e47844770093d61d2abcabe98da1eeb7879081e959dd42339b7 | Python | 7,674 | 203 | import os
from os.path import join
from datetime import date, datetime, timedelta
from joblib import load, dump
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.keras.backend import clear_session
from tensorflow.keras.callbacks import ... |
4a4c5a8e9c6bcf7bb28e9597ea125aca753b3c16ee40dfd311bb3c57f667e91a | Python | 7,675 | 249 | """
StyleMapGAN
Copyright (c) 2021-present NAVER Corp.
This work is licensed under the Creative Commons Attribution-NonCommercial
4.0 International License. To view a copy of this license, visit
http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
Creative Commons, PO Box 1866, Mountain View, CA 94042, U... |
8d59bb824cd8f730032bffd6f02353bae6df96c4541caad31063e3e5f635ffb3 | Python | 7,677 | 170 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and rel... |
9492c88981840af28d880327b0d1bf028dfa8262e64d7e23893b5fc50794ada3 | Python | 7,680 | 205 | # 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 a... |
f513c32b84cc6e28138ee9adf7a5454b10eee4aef5cec3b118ea526a6f4a99f3 | Python | 7,680 | 200 | import os
import sys
import logging
from types import ModuleType
from typing import Optional, Tuple
import numpy as np
from ..base import DatabaseBase, ALL, load_fids
########################################################################
class Database(DatabaseBase):
""""""
fids = load_fids(os.path.join(o... |
8b4611ac2dc318443465e894c4571974eb032572d32d54c4100898500209efa4 | Python | 7,681 | 258 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Variational Animal Motion Embedding 1.0-alpha Toolbox
© K. Luxem & P. Bauer, Department of Cellular Neuroscience
Leibniz Institute for Neurobiology, Magdeburg, Germany
https://github.com/LINCellularNeuroscience/VAME
Licensed under GNU General Public License v3.0
The ... |
5ceb8236ebb37a6ac8aad252bcdfa2269b240d6ef6724268456cee294b4aa27c | Python | 7,683 | 260 | import datetime
import time
from collections import defaultdict, deque
import numpy as np
import torch
import torch.distributed as dist
from fvcore.common.timer import Timer
import M2TR.utils.distributed as du
import M2TR.utils.logging as logging
from sklearn.metrics import roc_auc_score
logger = logging.get_logger(... |
40fa7590aa02ec5e903dcf70c753a8eaac093b5494e3110e131f1bb1b9abebb8 | Python | 7,685 | 240 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 1 10:49:09 2021
@author: user
"""
import numpy as np
from copy import deepcopy
from scipy.linalg import sqrtm, cholesky, lu
from scipy.special import gamma, digamma, gammaln
from numpy.linalg import slogdet
class vbEnKF_JansenRit:
def __init_... |
d284cb4ad2bdd42740250a7f219807d07d3a4817d99310d06b86fa992955892e | Python | 7,685 | 161 | import numpy as np
from nltk.tokenize import word_tokenize
from ArticleDataSample import ArticleDataSample, CommonSectionNames
class SummaryCreator:
"""
Given a data sample of a paper, and the durations (scores) of the paper's sentences, obtained using HmmArticle,
this class enables you to generate summa... |
ec8c55e3e8535933f73a9c3b728a7ce311a113babdcf214ea70e1da20a8e427b | Python | 7,686 | 171 | #!/usr/bin/env python3
"""Check a file is a usable input for the vehicle pipeline — the FIRST thing to run.
python3 check_input.py ~/models/SK_MyCar.fbx
Four gates, cheapest first, no editor involved (well under a second):
1. FORMAT it must be an FBX. Unreal imports FBX; .ma/.mb/.blend/.max/.c4d and
... |
ecb4ad0318829f12ddbbae6432d81b2eec7fcd87faa07aa54c6d7e0a2131cd9a | Python | 7,686 | 159 | from functions import *
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import copy
from datetime import datetime
import pickle
starttime = datetime.now()
pickledump = True #Should results of this run be saved (True), else load previously stored results (False)
#Load dictionaries from pkl files t... |
31abfc8aecef7852b47a9c98d16cedbd99a445a404a0ec00d086445e668130af | Python | 7,689 | 263 | # %% [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 matplotlib.patches import Circle
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from sci... |
a899955bc69fdc3f9a94346d4316f1f4fee2d68aeb507df6494fe7c702559bed | Python | 7,689 | 231 | '''
@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
import pickle
from torch.utils.data import WeightedRandomSampler, DataLoader, TensorDataset
import pandas as pd
import torch
def load_data(time_windo... |
aca054a9f2dc4f05f9097dda17c0648e0d881f555cd89fae11406bd3fc9f38b3 | Python | 7,689 | 231 | '''
@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
import pickle
from torch.utils.data import WeightedRandomSampler, DataLoader, TensorDataset
import pandas as pd
import torch
def load_data(time_windo... |
2dc8c41bcd17a86e0c25395b4dcd3fe9f87a44f9fe71386a9d3e16f8a77ce557 | Python | 7,690 | 207 | # 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... |
8346b6443c3ea03e32ad57180ccfd62d342f18bd6439457fd6a8c3972b0376fd | Python | 7,690 | 198 | from __future__ import print_function
'''
A camera using Lucam
'''
import collections
import os
import sys
import threading
import warnings
from time import sleep, time
import PIL
import imageio
from .lucam import Lucam, API, LucamError
__all__ = ['LucamCamera']
class FileWriteThread(threading.Thread):
def __init... |
322c96c937f46ea3c24246ee6ca5c387f0ad0d2198d71aa3e5139b2516c88e42 | Python | 7,694 | 228 | import logging
from dataclasses import dataclass, field
from typing import Dict, Iterator, List, Optional, Tuple
from oaklib.datamodels.obograph import (
DisjointClassExpressionsAxiom,
ExistentialRestrictionExpression,
)
from oaklib.datamodels.vocabulary import IS_A
from oaklib.interfaces import OboGraphInterf... |
e4dbb4d167017c66dfdc701ea62df801d86b9e883926a0a529378766989fa814 | Python | 7,699 | 226 | """This module provides the `Sampler` base class, which defines the
interface for sampling classes. These sampling classes should provide
a way to query some training/validation/test data for examples.
"""
from abc import ABCMeta
from abc import abstractmethod
import os
from selene_sdk.samplers.samples_batch import Sa... |
1ba3a8eca9082fe7e4e0c4892723add9cb30e5de79abf678fed8757c5e740788 | Python | 7,705 | 251 | import os.path as op
import pytest
import numpy as np
import numpy.testing as npt
import nibabel as nib
import dipy.data as dpd
import dipy.data.fetcher as fetcher
from dipy.stats.analysis import afq_profile
from dipy.io.stateful_tractogram import StatefulTractogram, Space
import AFQ.data.fetch as afd
import AFQ.re... |
8ab29a5935cafd54d48b249bf7a1c23afb1881aa2e275f4dad6b888830b90eeb | Python | 7,707 | 166 | # 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... |
14609801c3c8c2eb7cceecf9ebf63dba54aec5a25116fdb646a9c2d19d144c4b | Python | 7,711 | 227 | '''
Simulates Paramecium motion of a group of cells.
Uses quaternions for 3D motion.
The cell coordinate system is chosen so that the cell points upward (along positive z axis).
'''
import numpy as np
import quaternion
from numpy.linalg import norm
import imageio
__all__ = ['MovingCells', 'PlaneMovingCells']
class M... |
e611aa11342572b144379907b2fedb63c40d6ea1b9f0638f45d3dec5edd6e1c2 | Python | 7,711 | 226 | # @author: Miroslav Kuchta
# |---|---|
# | F I S |
# |---|---|
#
# The fluid and structure domains need to communicate to each other
# over interface or just talk to the interface. For this it is important
# to be able to restrict values to manifolds of codimension 1
from src.fem.utils.fem_eval import DegreeOfFreedom, ... |
948ea980b1b1947e47c8305fbae0b8cbc511503eac5868f79ae595d2a519124b | Python | 7,714 | 196 | import argparse
import time
import math
import torch
import torch.nn as nn
from torch.autograd import Variable
import dni
import data
import model
parser = argparse.ArgumentParser(description='PyTorch PennTreeBank RNN/LSTM Language Model')
parser.add_argument('--data', type=str, default='./data/penn',
... |
0de575d2842fd4c8a4ec2bd3f8cc9b663bbbd4f98039d4d39dd8fb6b7ba5351c | Python | 7,716 | 231 | import unittest
import carla
import numpy as np
from nurec_integration import NurecActor, NurecScenario
class _ActorInstance:
def __init__(self, x=0.0, y=0.0):
self.autopilot = False
self.location = carla.Location(x=x, y=y)
self.bounding_box = carla.BoundingBox(
carla.Locatio... |
4cc740e6e9125ea8f0a0d782a0944a4dabbbb7ef7f6ffef81ad19e469543f50f | Python | 7,716 | 228 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from a2c_ppo_acktr.distributions import Bernoulli, Categorical, DiagGaussian, BetaCustom
from a2c_ppo_acktr.utils import init
class Flatten(nn.Module):
def forward(self, x):
return x.view(x.size(0), -1)
class Policy(nn... |
58e2c8c98f1cba166be1ddf23455bdd9e39288435a0b4962dc20628580988874 | Python | 7,718 | 223 | #!/usr/bin/env python3
"""
File: plot_pca_outliers.py
Created: 2021/09/28
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 Software Foun... |
ebe259ad21df75cef3741a86714f6b2dd9a9d8cc13519aacd256a992d6df6fec | Python | 7,719 | 224 | import logging
import sys
from dataclasses import dataclass
from io import BytesIO, StringIO
from typing import Any, Dict, List, Optional, Tuple, Union
import rdflib
from oaklib.converters.data_model_converter import DataModelConverter
from oaklib.datamodels.obograph import Edge, Graph, GraphDocument, Node
from oakli... |
1fafec12048a278be6210ceee0bef0b5056f7377054fa985bf71356e6fce52fd | Python | 7,720 | 287 | # %% [markdown]
# #
import os
from itertools import chain
import colorcet as cc
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from graspy.cluster import AutoGMMCluster
from graspy.utils import pass_to_ranks
from src.data import load_metagraph
from s... |
72364e27e33679bd60768376de1b964ed75e442f8ba5219cb29294df58c776fd | Python | 7,720 | 171 | """
© 2022, ETH Zurich
"""
import os
from rescoss_logp_ml.utils import NUM_INNER_FOLDS, TEST_SET_FRACTION, SEED
from rescoss_logp_ml.two_d_models.chemprop_tools import scaffold_split
import chemprop
import pandas as pd
import random
import numpy as np
import argparse
os.environ["OPENBLAS_NUM_THREADS"] = "1" # neede... |
17678a22e424df3e0b92f9c064623196fe90baef69bc8e545346f72b14833e04 | Python | 7,721 | 196 | ####################################################################################################
# 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 ... |
73c4263b1f05de644e813728508f16790b2ac73211286bcacd38d1e5c87408b7 | Python | 7,722 | 287 | # Generic
import json
import pickle
import pandas as pd
import numpy as np
# Specific
from pathlib import Path
from pathlib import PurePosixPath
# Import json pickle
import jsonpickle
import jsonpickle.ext.numpy as jsonpickle_numpy
# Configure json pickle
jsonpickle_numpy.register_handlers()
# ---------------------... |
9ef1ac6b715c5a316b4f63c0418ac9869f9f866af6733d9010803c1d24b95915 | Python | 7,723 | 174 | # 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... |
bafbea74d0cf4e0669c675ae187e172cb9fd65608813c8ce37f06ca0225ae482 | Python | 7,723 | 225 | __author__ = "Jianfeng Sun"
__version__ = "v1.0"
__copyright__ = "Copyright 2023"
__license__ = "GPL v3.0"
__email__ = "jianfeng.sunmt@gmail.com"
__maintainer__ = "Jianfeng Sun"
from typing import Dict, List, Union
import json
import pandas as pd
import requests
from tmkit.util.Kit import tactic7
from tmkit.util.Re... |
16f400cf8e2e66006ebdb96aeed95b56f1c78e8dfff1911e19d9f0aaafabda04 | Python | 7,724 | 134 | __author__ = 'duarte'
from modules.parameters import ParameterSet, ParameterSpace, extract_nestvalid_dict
from modules.input_architect import EncodingLayer
from modules.net_architect import Network
from modules.io import set_storage_locations
from modules.signals import iterate_obj_list
from modules.analysis import sin... |
1b6858663f2add49f7e7bfd72ddddff08634942019e9d91e90694b77f436c9b0 | Python | 7,724 | 211 | # Code reused from https://github.com/jennyzhang0215/DKVMN.git
import numpy as np
import torch
import math
from sklearn import metrics
from utils import model_isPid_type
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
transpose_data_model = {'akt'}
def binaryEntropy(target, pred, mod="avg"):
... |
f7a2e4ecc9f6252b32016e4098feb666d0f32b17fe151e60141db97aac44415a | Python | 7,725 | 211 | '''
Mean-field Dyn
@YX 1210 Edit
'''
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 cmath import *
from scipy.optimize import fsolve,leastsq,minimize
import scipy.integrate
from math import tan... |
6324e33d2165689ed642ed838aa9771f617c9b5f1052912d979fbec418e67ee3 | Python | 7,727 | 153 | import numpy as np
import functions_basic_sak as funsak
import pandas as pd
from tqdm import tqdm
import os
from sklearn.cluster import DBSCAN
import inspect
import AIS_parameters
import re
import import_AIS
fname = os.path.split( inspect.getfile(inspect.currentframe()) )[1]
def get_timestamp_branch( df,... |
14aa5f1519e0718824333cd11248714fb818a095cda5d90e7318a5cb435fe301 | Python | 7,730 | 220 | """
.. _spectral_projection :
Divergence-Free Spectral Projection
========================================================
An example demonstrating spectral projection to enforce divergence-free constraints
in 2D velocity fields
"""
# %%
# .. raw:: html
#
# <div style="margin-top: 3em;"></div>
#
# Import the libr... |
e02e2054e768ea4ec5202911148a621852feeadf66aa1ff0d91d5aaf7fee8f9b | Python | 7,731 | 162 | import asyncio
import json
import subprocess
import sys
import time
import pytest
from carla_cosmos.synthetic import av7_clip
from carla_cosmos_server.config import default_run_dir
from cosmos_workers.common import protocol
from cosmos_workers.common.base import add_common_args
from cosmos_workers.transfer25_av.commo... |
7e00ebe919368b31403b95f54f6e75bd4bef938ccfe85c6b73bd2a4153edef78 | Python | 7,735 | 228 | """cxvisualize -- cxsystem visualizer
Usage:
cxvisualize (-h | --help)
cxvisualize [ -d | -c ] FILEPATH
cxvisualize --rasterplot-pdf FOLDERPATH TIMESTAMP [--sampling-rate SAMPLINGRATE]
A tool for visualizing `CxSystem` spike data in ViSimpl.
Arguments:
FILENAME Path ... |
c82260985a74f99f5ce820d3149637fd4246c772dbeb73df34d706cd9b42dc6d | Python | 7,741 | 202 | import torch
from torch.utils.data import Dataset, DataLoader
import numpy as np
from os.path import join, isfile, isdir
from os import listdir
class DecoyDataset(Dataset):
"""Rosetta 800k decoy dataset."""
def __init__(self,
targets,
root_dir = "/projects/casp/dldata/... |
c8c5f428af5085ad61969a7c00b0f8968fe5c84b70afaccac444e10ece064b61 | Python | 7,741 | 199 | import torch
import torch.distributed as dist
import torch.nn.functional as F
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.nn.modules.module import Module
from torch.nn.parameter import Parameter
from mmcv.cnn import NORM_LAYERS
from ..utils import ext_loader
... |
5765f54882c1945ecdcaa35f25b16c15a9ed3cc28188ea02d3ca3cbd70f560f5 | Python | 7,742 | 231 | '''
@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
import pickle
from torch.utils.data import WeightedRandomSampler, DataLoader, TensorDataset
import pandas as pd
import torch
def load_data(time_windo... |
a1dcc686442918b0cf119914504fe10549105dadcfdae25a292377c36eb4508a | Python | 7,746 | 197 | # 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... |
d4ee8c60ed20e04be709cbb03e2b4f3a21b2c7acffe42d49ba5087c61164a6f2 | Python | 7,748 | 186 | from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
def read(relative_path):
return (ROOT / relative_path).read_text(encoding='utf-8')
def test_file_import_controls_are_fomantic_menu_links_with_disabled_guards():
template = read('templates/roots/top_menu.html')
pipeline = read('fronten... |
b1340ed7067a7f8c5be940d9068b79b328fc43b394fff59c2b92789b816bd62b | Python | 7,750 | 167 | #!/usr/bin/env python
##########################################################################
#gcskew.py calculates gcskew values for a given chromosome
#Copyright (C) 2020 Jennifer Lu, jlu26@jhmi.edu
#
#This file is part of SkewIT
#
#SkewIT is free software; you can redistribute it and/or modify
#it under the term... |
0def98b16adfdfd6793c993da4264c73de87077ddeefb0abe1d591345b257f28 | Python | 7,753 | 203 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 3 11:25:33 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 spearmanr, mannwhitneyu, linregress, wilcoxon
from iEEG_STC import utils
imp... |
1266a89a2a724d6e04829aa68c1a32f49817b986b968ed0cccd9ff70aff3dbe2 | Python | 7,756 | 183 | import numpy as np
import pandas as pd
import torch
import torchvision
from torchvision import transforms
from torch.utils.data import Dataset
class OusterCrop(object):
def __init__(self, xmin=384, ymin=54):
self.height = 68
self.width = 264
self.xmin = xmin
self.ymin = ymin
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.