sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
2129b1d596785ee3a12035eb930a229089870f20358b74ba70191cce9ffd83fb | Python | 9,257 | 245 | """Lower bounding enum."""
__author__ = ["chrisholder", "TonyBagnall"]
__all__ = ["LowerBounding", "resolve_bounding_matrix"]
from enum import Enum
import numpy as np
class LowerBounding(Enum):
r"""Enum for various lower bounding implementations.
Bounding techniques constrain the indices a warping path ma... |
41ad1266f277a01c0c322f444ab3c93d26434286cf05a41b606f3b444215697c | Python | 9,258 | 69 | import requests
import pandas as pd
from collections import defaultdict
import re
#import constants
def get_rare_disease_umls():
#df = pd.read_excel("ORDO2UMLS_ICD10_ICD9+titles.xlsx", sheet_name="full sheet")
df = pd.read_excel("./ontology/ORDO2UMLS_ICD10_ICD9+titles_final_v3.xlsx",engine='openpyxl')
... |
bad1861d600a56eb9b3eb9e92e540b94d3ddd8d25c7ba849a2a3a7b4d1557247 | Python | 9,262 | 194 | import keras as kr
import numpy as np
from keras import layers
from keras.callbacks import ModelCheckpoint, TensorBoard
from keras.models import Model, Input, Sequential, load_model
import keras.activations as activations
class CNN:
def __init__(self, RNNconfig):
self.config = RNNconfig
self.inpu... |
ea5a7c3ec7f79faf2f4bff12b71d439f489e785cdc48317f8c47f882991b928e | Python | 9,268 | 261 | # Copyright 2019 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
69013c20a72f274d6fe8818e2c56b44f11a00e70e1e9f687ae336f21c1016ac1 | Python | 9,279 | 111 | """
Data structures for model_run
XM13 with cooperative nacn channels
"""
ChannelData = u"""
This table describes the REFERENCE ion channel densities (and voltage shifts if necessary)
for different cell types based on the Xie and Manis 2013 models for mouse.
The REFERENCE values are applied to "point" ... |
03e6a28f7be36e9313d75c461b8ed7194cc83a6d1ff5ffbe5a203aed48fe15c4 | Python | 9,282 | 299 | # Copyright (c) ONNX Project Contributors
# SPDX-License-Identifier: Apache-2.0
"""Filesystem-aware Atheris harness for ONNX external data.
The input selects a read, write, model-load, or ModelContainer operation and
mutates external-data paths plus offset/length metadata. All paths resolve in a
disposable workspace. ... |
aeeb82f966027bdd2aa4563c394151fe1d11060e0d7b7c93f0ecd26ea80b76a3 | Python | 9,284 | 274 | from __future__ import annotations
from collections.abc import Sequence
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Iterator
import networkx as nx
import numpy as np
import pyarrow as pyarrow
import pyarrow.compute as pyarrow_compute
import pyarrow.parquet as pyarrow_parquet
fr... |
09ca60c90ba18eec8712890d80225179755821a15b6e6797f898362297e9f19a | Python | 9,285 | 260 | import os
import numpy as np
import cv2 as cv
from Switches_Dynamic import get_rootpath
import Switches_Static as st_switches
import Switches_Dynamic as dy_switches
import utils.allen_functions as allen
from utils.allen_functions import get_volume
import utils.img_processing as img_utils
#from utils.smart_functions imp... |
69cb0df50a05af6227203c71f0820ab2b8f4372e59f0aa7f74e0af30eadf292c | Python | 9,285 | 274 | """
test_sgc_input_phaselocking.py
Test phase locking from an input sgc to a target cell type. Runs simulations
with AN input, and plots the results, including PSTH and phase histogram.
usage: test_sgc_input_phaselocking.py [-h]
[-c {bushy,tstellate,octopus,dstellate}]
... |
1a9a6cbb267905d8c375fcd7e8e8b0c328d21ec565698e94d4e70a98fac2e40d | Python | 9,299 | 195 | import keras as kr
import numpy as np
from keras import layers
from keras.callbacks import ModelCheckpoint, TensorBoard
from keras.models import Model, Input, Sequential, load_model
import keras.activations as activations
from keras.utils import to_categorical
class RNN:
def __init__(self, RNNconfig):
se... |
7496cb9902f3267f6b06e7e4ccebaa80a7ed1e88f3ae239682e1693bfd558255 | Python | 9,301 | 276 | """FreshPRINCE Classifier.
Pipeline classifier using the full set of TSFresh features and a RotationForest
classifier.
"""
__author__ = ["MatthewMiddlehurst"]
__all__ = ["FreshPRINCE"]
import numpy as np
from sktime.classification.base import BaseClassifier
from sktime.classification.sklearn import RotationForest
f... |
ad18949d799d7b7a971e53dcfcb1f2863615f5423fc805e185a5af1d68966b47 | Python | 9,308 | 307 | """
iterio from werkzug.contrib since it was deprecated and remove
ideally we can get rid of this in idlib
werkzug@2b2c4c3dd3cf7389e9f4aa06371b7332257c6289
"""
try:
import greenlet
except ImportError:
greenlet = None
def _mixed_join(iterable, sentinel):
"""concatenate any string type in an intelligent wa... |
1d73a4c7555491e62b35ed2c6f17a4170d0af660f4bd7830069b8023da8b6d39 | Python | 9,312 | 197 | # Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
d987e8720c92b3f75a8385949f903c1f3e254bb95b6b1a009d607992effb9351 | Python | 9,313 | 181 | """
check_numbers.py -- verify every number cited in the paper against results/*.json.
Invariants (exit nonzero if any fails) are the CONTRIBUTIONS. Setup results are
checked at looser tolerances. T6 is reported as a FLAG (conjecture not supported),
not a pass/fail. Run all t*.py first (or `python run_all.py`).
"""
im... |
5f85592d7057776f4734dbbaf00f88bcacc1226458422e64e029d8a91e637a63 | Python | 9,319 | 365 | '''
Created on Nov 9, 2012
@author: derricw
Reward.py
Simple reward class. Uses NIDAQ digital IO to trigger a reward (can be anything, we are currently
using this to flip a relay controlling a valve).
#TODO: rewrite this whole shitfest.
'''
from toolbox.IO.nidaq import DigitalOutput as do
from toolbox.IO.nida... |
685b4026278b8f28b5898b37673b6bd12bacd978260d803d8721a796d4233d21 | Python | 9,319 | 272 | # Copyright (c) ONNX Project Contributors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import typing
import pytest
import onnx
import onnx.parser
import onnx.shape_inference
class TestModelInference:
def _check(self, model_text: str, *expected: int):
"""Check that the model... |
a959726980800185e8baf6b81b2655574cf1c9ac93db8b8ad9f2dbd53cc26535 | Python | 9,320 | 234 | # 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... |
a2231e16e459624e4c5789b0f1922f7fc5c1fa686c588f1921285137fe27a1f8 | Python | 9,321 | 268 | # Copyright 2022 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
acd25de28fbc451a5962638d77c6519b64fcf06d48c75d1110f3c3936d68db44 | Python | 9,327 | 263 | import matplotlib.colors
_paradime_cmap_data = [
[0.000000, 0.128772, 0.139390],
[0.000000, 0.131266, 0.142105],
[0.000000, 0.133809, 0.144824],
[0.000000, 0.136401, 0.147548],
[0.000000, 0.139038, 0.150276],
[0.000000, 0.141716, 0.153009],
[0.000000, 0.144404, 0.155748],
[0.000000, 0.1... |
42eff3a245424caed497fc0a87d68c7bec65b98c07bd84bd1c5b0c486eb4bfca | Python | 9,328 | 221 | from typing import Union, Tuple
import torch
from torch import nn, Tensor
import numpy as np
class EMDLoss(nn.Module):
"""
Calculates the energy mover's distance between two batches of jets differentiably as a convex optimization problem
either through the linear programming library ``cvxpy`` or by conve... |
eda0b728ed657466c9b0fffcd65b69be2281871b0a2aa14a0d3de3a169c10bc5 | Python | 9,332 | 285 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 5 15:30:40 2019
@author: reiters
"""
import cv2
import numpy as np
import moving_least_squares
import os.path
import h5py
import matplotlib.pyplot as plt
import pandas as pd
import glob
import time
def norm(data):
with np.errstate(invali... |
ecb52dbb6ffcc4082c334973554d9fb7ccf07c087fb3598c9654d8910d18e90f | Python | 9,333 | 250 | """Tests for bcblib.tools.dataset_splitting."""
import numpy as np
import pytest
from bcblib.tools.dataset_splitting import (
_score_split,
permutation_balanced_splits,
)
# ---------------------------------------------------------------------------
# Shared fixtures
# ---------------------------------------... |
f7694cda8a5740a0dd9495cbb9ac472c46e349d6f3eb82c838153f2fe8d58fb8 | Python | 9,335 | 274 | # coding=utf-8
# 2021.03 added (1) logging;
# (2) BaseLearner;
# (3) NotearsMLP, NotearsSob;
# 2021.03 deleted (1) __main__
# 2021.11 added (1) NotearsNonlinear
# deleted (1) NotearsMLP, NotearsSob, MLPModel, SobolevModel
# Huawei Technologies Co., Ltd.
#
# Copyright... |
99d202448ffaf658a97c13af957257b6d71ac24e2e4ac04c3e161a9c366aa4a6 | Python | 9,340 | 245 | # -*-coding:utf-8-*-
# from __future__ import absolute_import
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
def conv1x1 (in_planes, out_planes, stride=1):
return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
def conv3x3 (in_planes, out_planes, stri... |
e4f764de88b98def5be33d864580d6fce80f2617e8a160da394375f84f3629e8 | Python | 9,340 | 268 | # Copyright 2019 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
8c1ab080c7ed3e178da0e4bf76b927a035a55175af02df5cb3dec257c0344fb5 | Python | 9,342 | 331 | import os
import pytest
import numpy as np
from os.path import join as pjoin
from PIL import Image
from matplotlib import pyplot as plt
from dnnbrain.dnn import algo as d_algo
from dnnbrain.dnn.base import ip
from dnnbrain.dnn.models import AlexNet
from dnnbrain.dnn.core import Stimulus
from dnnbrain.utils.util import... |
35cda620267f91eff2ac294a88910af170129cee911bc953fefcad39302a4bcb | Python | 9,345 | 113 | """
Data structures for model_run
XM13 with cooperative nacn channels
Active dendries: dendritic conductances are the SAME as the soma
"""
ChannelData = u"""
This table describes the REFERENCE ion channel densities (and voltage shifts if necessary)
for different cell types based on the Xie and Manis 2013 m... |
b9daff9e95642cb1df3475df80671aca12d22b8d865e269156bb08464dc1626a | Python | 9,348 | 276 | import logging
from abc import abstractmethod
from pathlib import Path
from typing import Generic, Optional, Union
import torch.utils.data.dataloader
from deprecated.sphinx import deprecated
from flair.data import DT, FlairDataset, Sentence, Tokenizer
from flair.tokenization import SegtokTokenizer, SpaceTokenizer
lo... |
f434e3de35f275ec6530209038666eaefbb3edbe5c699224af2e6fa2937a1bf5 | Python | 9,354 | 204 | """
This script generates figure S6f from the paper :
They are
LEFT PANEL: AP-Position vs choice prediction accuracy
MIDDLE PANEL: ML Position vs choice prediction accuracy
RIGHT PANEL : Mouse performance vs choice prediction accuracy
Internal notes:
This is from 3.20d-decoding-performance-and-behaviour-and-brain-loc... |
917c9bef9d55bd811154cc8815489f8ce64a0d1f7725789f755142a2ab999266 | Python | 9,356 | 242 | """
Mean folding index, curvedness, gyrification index, surface area, and volume for each species
"""
def FI_C_GI_SA_V(input_txt, subjects_name, output_folder, max_t, min_t):
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import os
from scipy.stats import skew
impo... |
969bd7def06def8f02bcec1388773b444d2832ebcaabe0bb29788c9ee8a6ca09 | Python | 9,357 | 275 | import json
import requests
from tqdm import tqdm
import os
def get_file_from_modac(fname, origin):
""" Downloads a file from the "Model and Data Clearning House" (MoDAC)
repository. Users should already have a MoDAC account to download the data.
Accounts can be created on modac.cancer.gov
Parame... |
7b67028d78c9833e18dee5cb3d54da8680e9d81178c66a75877be27398751e38 | Python | 9,359 | 254 | # SPDX-License-Identifier: LGPL-3.0-or-later
import types
from collections.abc import (
Callable,
)
from typing import (
Any,
)
import torch
from torch.fx.experimental.proxy_tensor import (
make_fx,
)
from deepmd.dpmodel.atomic_model.linear_atomic_model import (
LinearEnergyAtomicModel,
)
from deepmd.... |
75d027907af8acdfb0274a36c879582a9574975173db0cb4c09c6d3cf271c536 | Python | 9,363 | 268 | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
class Mod(Base):
@staticmethod
def export_mod_mixed_sign_float64() -... |
b67d9eff8f99bda0410e1b08c9460b03c9d8e55f5a2d230e2dfb653cffbde8d9 | Python | 9,365 | 113 | """
Data structures for model_run
XM13 with cooperative nacn channels
Passive Dendrites: The dendrites have LEAK channels only, no voltage gated channels.
"""
ChannelData = u"""
This table describes the REFERENCE ion channel densities (and voltage shifts if necessary)
for different cell types based on the ... |
79742078affe757d46e799a33d85374daf18c018fb00ee1dbfdc4875d00a2311 | Python | 9,366 | 246 | from argparse import Namespace
from pathlib import Path
from typing import Iterable, List, Tuple, Union
import torch
from torch.utils.data import DataLoader
from torch.optim import Optimizer
import logging
from utils.data import JetMomentaDataset
from models import Encoder, Decoder
def initialize_models(args):
en... |
5769061fab7d64bc912ab2417caec5a603a4fff91e0d0c31c0c30f818d37c59c | Python | 9,368 | 212 | import base64
import io
import itertools
import ipywidgets as widgets
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.stats as stats
import seaborn as sns
from IPython.display import display, Markdown, HTML
from explorer.explorer_utils import hist, retrieve_nested_path
from explore... |
2d2a7aa8292de203e4bb4c1086075144177ff9ed003d75d71ed757e0779e79a9 | Python | 9,370 | 273 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Common utilities for polars based data containers."""
from sktime.datatypes._base._common import _req
from sktime.datatypes._base._common import _ret as ret
from sktime.datatypes._dtypekind import _get_feature_kind, _polars_dtype_to_kind
def ... |
f804def2c38a24c3f87d6178b1addbf7a8b7018e3c7c529e1f134fe3a6fb0643 | Python | 9,377 | 297 | import numpy as np
def fnnls(Z, x, P_initial = np.zeros(0, dtype=int),
lstsq = lambda A, x: np.linalg.inv(A).dot(x),
epsilon=np.finfo(float).eps):
"""
Implementation of the Fast Non-megative Least Squares Algorithm described
in the paper "A fast non-negativity-constrained least squares al... |
9452d737ac97f458955e20cebc6ef14d92ea3099f0d20070d6c7bc27df210ae0 | Python | 9,379 | 241 | """Tests for sktime detectors."""
__author__ = ["miraep8", "fkiraly", "klam-data", "pyyim", "mgorlin"]
__all__ = []
import pandas as pd
import pytest
from sktime.detection._datatypes._check import _is_valid_detection
from sktime.exceptions import NotFittedError
from sktime.tests.test_all_estimators import BaseFixtur... |
04824b82d1d222e4296b793ab7801429ac18c04c6d744524c8fbbf96f3f89cbb | Python | 9,383 | 248 | import torch
import torch.nn as nn
import math
from networks.ShakeDrop import ShakeDrop
def conv3x3(in_planes, out_planes, stride=1):
"""
3x3 convolution with padding
"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False)
class BasicBlock(nn.Module):
ou... |
1fc2dca86ba2255a8bdb9056cb092a9d0a12e7d1574a80b160faea061bab531b | Python | 9,383 | 199 | """
@file: a0_resnet.py
Created on 04.08.22
@project: CrazyAra
@author: queensgambit
Description of the alpha zero architecture for pytorch:
Mastering the game of Go without human knowledge, Silver et al.
'The input features st are processed by a residual tower that consists of a single
convolutional block followed by... |
8c8688e130c2260253b411308e4327177fc3b284490f41de2c2bfb52c81e7bdf | Python | 9,383 | 138 | # get results from MedCAT to validate the results of SemEHR.
from test_google_medcat_api_util import get_entities_from_MedCAT_outputs,get_umls_desc,output_to_file,check_if_error,get_umls_desc_MedCAT
from sent_bert_emb_viz_util import get_context_window#, get_char_offset
import pandas as pd
from tqdm import tqdm
... |
ca41c58eb2ed3e1035b381e28404945dd889f2d1d93b82ba45edfe8bc46bf7b0 | Python | 9,388 | 268 | from __future__ import annotations
from enum import IntEnum
from typing import TYPE_CHECKING
import numpy as np
from onnx.reference.ops.aionnxml._op_run_aionnxml import OpRunAiOnnxMl
if TYPE_CHECKING:
from collections.abc import Callable
class AggregationFunction(IntEnum):
AVERAGE = 0
SUM = 1
MIN ... |
476b57ddf662860de3deebb8acf39c9f85aafd5fd4f0702dd5391f509b4b7d4a | Python | 9,391 | 344 | import numpy as np
import pytest
from mock_data_stream import MockStreamData
from pyxdf.pyxdf import _detect_clock_resets
# Test error condition
@pytest.mark.parametrize("n_clock_offsets", [0, 1])
def test_detect_resets_length_error(n_clock_offsets):
clock_times = list(range(n_clock_offsets))
clock_values =... |
02d74299f4c995dde436dbb25eecd4866562be2e8a12baf3454b5329ab72b3c5 | Python | 9,392 | 313 | import pickle
import numpy as np
import gzip
MIN_FREQ = 3
def invert_dict(d):
"""
Exchanges keys and values in a dictionary
:param d: dictionary for invertion
:return: inverted dictionary
"""
res = {}
for k, v in d.items():
res[v] = k
return res
def add_to_dictionary(dictionar... |
04dc1e6c9e19cbd3939f57efed6921d90687ce435798cbef04231a423d8436b1 | Python | 9,392 | 257 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Interfaces AutoReg Forecaster from statsmodels.
Available from statsmodels.tsa.ar_model.
"""
__author__ = ["jonathanbechtel", "mgazian000", "CTFallon"]
__all__ = ["AutoREG"]
from sktime.forecasting.base.adapters import _StatsModelsAdapter
... |
6bf7eb0fe4dfaf89e75c07d211bb7cda3b34db2c375d497bb174b006910db41f | Python | 9,395 | 265 | # Copyright 2019 DeepMind Technologies Ltd. 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 appl... |
62c107799e8fd296c9eed11178cbb259d91a9ca652fc056e9fd16003c5399fed | Python | 9,405 | 387 | # coding=utf-8
# Copyright (C) 2022. Huawei Technologies Co., Ltd. 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
#
# ... |
aab9f166ccc031221ffc42b92f093b34528518b83523b0ff47167d1574847daa | Python | 9,409 | 251 | import logging
import re
from argparse import ArgumentParser
from pathlib import Path
from time import time
from typing import OrderedDict
import numpy as np
import torch
from mmcv import Config
from mmcv.parallel import collate, scatter
from modelindex.load_model_index import load
from rich.console import Console
fro... |
2d3acb3f578613df647e475204fe0e7bc2693bd6863a7e37c38e18f332ded1bf | Python | 9,415 | 261 | import torch
import torch.nn as nn
from onmt.utils.misc import aeq
from onmt.utils.loss import NMTLossCompute
def collapse_copy_scores(scores, batch, tgt_vocab, src_vocabs=None,
batch_dim=1, batch_offset=None):
"""
Given scores from an expanded dictionary
corresponeding to a batc... |
6e7e74f10e38207d1152e5ca51014858a290734aa143f6f196495ac0f0a1bc19 | Python | 9,416 | 246 | import pandas as pd
from sklearn.linear_model import LinearRegression
class BensonGroup:
"""Definition of every Benson group consistint in a main atom bonded to
other atoms.
Args:
main (str, optional): Element of the central atom of the group.
Defaults to None.
connections (dic... |
7575467659e0647f3dfa1120610f8605898264405d85a822bd05ef655c63c6c3 | Python | 9,423 | 238 | __author__ = ["chrisholder", "TonyBagnall"]
from typing import Any
import numpy as np
from sktime.dists_kernels._numba_distances.base import (
DistanceAlignmentPathCallable,
DistanceCallable,
NumbaDistance,
)
class _LcssDistance(NumbaDistance):
r"""Longest common subsequence (LCSS) between two tim... |
20522aa6291b89439f069584bb64d429ca2cd297ac11b91221655ee1725aae68 | Python | 9,425 | 223 | import pickle
from collections import defaultdict, namedtuple
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from figures.clean_data import CELL_COUNT_THRESHOLD, prepare_data
from scratch.clean_data_amit import trash_density3d_outliers, remove_correlated_regions
from figures.figure1 import fin... |
a633cce0089fdab8a71730d1ec7cb5643a3e7810436e8349d37d0723d2029073 | Python | 9,427 | 221 | import pandas as pd
import numpy as np
import shutil
import json
import os
import glob
import csv
import subprocess
from email.parser import BytesHeaderParser
import logging
vu_logger = logging.getLogger(__name__)
def make_config_base(dst):
cellData_tsv = os.path.join(dst, 'data', 'cellData.tsv')
geneData_t... |
87d52d1216271925e13f8795efffd80389e46d504b1e8908682ae40a62ed0e94 | Python | 9,430 | 142 | '''
constants file
.. codeauthor:: Nicholas Browning
.. codeauthor:: Simon Duerr dev@simonduerr.eu
'''
import numpy as np
import pygmo as pg
element2mass = {'Ru': 101.904348, 'Re': 186.955744, 'Rf': 261.10869, 'Ra': 226.025403,
'Rb': 84.9118, 'Rn': 222.017571, 'Rh': 102.905503, 'Be': 9.012183,
... |
7d764824ca1a0e0c28f61b1250422f3abcb4d641b2ea245f8cabe9d49ff18b77 | Python | 9,431 | 163 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
import os
from scipy.stats import norm
import sys
from numpy import nan
import numpy.ma as ma
import seaborn as sns
from PIL import Image
sys.path.insert(1, "/Users/hyung/Research23_Network_Analysis/mBIN/Python/NetworkAnalysisGeneral/Co... |
01d7a444a13491e0e9a721ab3b587661fde60da3a7ec6e44e15223a8682f9979 | Python | 9,437 | 288 | import argparse
from keras.optimizers import *
from sklearn.preprocessing import MinMaxScaler, StandardScaler
from sklearn.compose import ColumnTransformer
'''
Model Types:
model1 - This is the original model, or the mixed model when 'enzyme'='multi_task'
Inputs: Sequence + biofetures
... |
8522ffe500104e15291fe6115ab2c023aa4425257b1475ead11e9a9fd03aac4f | Python | 9,437 | 274 | from __future__ import division, absolute_import, print_function
import sys, re, inspect, textwrap, pydoc
import sphinx
import collections
from .docscrape import NumpyDocString, FunctionDoc, ClassDoc
if sys.version_info[0] >= 3:
sixu = lambda s: s
else:
sixu = lambda s: unicode(s, 'unicode_escape')
class Sp... |
69f606ec3740ad79cce22f1427aef2829b9cff28c3e018b5282ab5934b4c9041 | Python | 9,438 | 220 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import collections
import numpy as np
import ray
from ray.rllib.optimizers.replay_buffer import ReplayBuffer, \
PrioritizedReplayBuffer
from ray.rllib.optimizers.policy_optimizer import Poli... |
ff39bd057cb4160d1d2e2adbfde010f5ed2af0957dbb61ebda23af345f5fae79 | Python | 9,445 | 252 | import math
import numpy as np
import pandas as pd
import seaborn as sns
import pingouin as pg
from scipy import stats
import matplotlib.pyplot as plt
from sklearn.metrics import roc_curve, roc_auc_score
sns.set()
def Spearman(X, Y):
'''
Calculates Spearman correlation coefficient between X and Y.
:para... |
47546eae17c0b756e96e341c04f2cab2078d1cd37323b9fbedfbc7324efe4949 | Python | 9,449 | 255 | from __future__ import division
import six
from keras.models import Model
from keras.layers import (
Input,
Activation,
Dense,
Flatten
)
from keras.layers.convolutional import (
Conv2D,
MaxPooling2D,
AveragePooling2D
)
from keras.layers.merge import add
from keras.layers.normalization impor... |
d0076fc12bd898c268d15bd00aaf874745d6fb8a3df2cd373d8073a9d00d8e21 | Python | 9,450 | 275 | import os
import sys
import time
import random
import pickle
import argparse
import torch
import numpy as np
import torch.nn as nn
from tqdm import tqdm
from torchvision import transforms
from torch.utils.data import DataLoader
sys.path.insert(0, '..')
from utils.func import *
from utils.metrics import Estimator
from... |
1c3da0d9c7bf748a1f9947b85730bec08ecb93e9ea4846565e07b61e5cb5630d | Python | 9,455 | 254 | import argparse
import datetime
import json
import os
import time
import tqdm
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from atom3d.datasets import LMDBDataset
from scipy.stats import spearmanr
from model import CNN3D_RSR
from data imp... |
3be46d2dc376f1a396238456f417dc7372a49dd66bd4e61bd3f52ccb5b11d856 | Python | 9,455 | 254 | import argparse
import datetime
import json
import os
import time
import tqdm
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from atom3d.datasets import LMDBDataset
from scipy.stats import spearmanr
from model import CNN3D_PSR
from data imp... |
636e1355e63eb5ec2f17e7f2386e17e7206e80082ea9a86da9caaf795e89d191 | Python | 9,455 | 213 | '''
Triplet loss modified from https://github.com/omoindrot/tensorflow-triplet-loss/blob/master/model/triplet_loss.py
Author: Olivier Moindrot from Stanford
'''
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
def _pairwise_distances(embeddings, squared=False):
"""Compute the 2D matrix of d... |
fd684baa85e4570334a0eec58bcbb0cf578baa2934e870d439206de0697cec42 | Python | 9,460 | 245 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from ray.rllib.agents.trainer import with_common_config
from ray.rllib.agents.dqn.dqn import GenericOffPolicyTrainer, check_config_and_setup_param_noise, setup_exploration, update_target_if_needed
from ray.rlli... |
cafcfc3b869778459518b92e6b0b7c7e99ddbc4fb55b052a02819b09bcf35ea6 | Python | 9,462 | 263 | import numpy as np
BOND_ORDER = {'C': 4,
'O': 2}
def bond_analysis(mol, comp_dist=False):
"""Returns a dictionary of frozen tuples containing information about
the bond distances values between the different bonds of the molecule.
Args:
comp_dist (bool, optional): If True, the voron... |
68f1e830bb02527b689dea3db19c30c511ab45570d16d9775930fb08e1bc7670 | Python | 9,468 | 279 | # coding=utf-8
# Copyright (C) 2022. Huawei Technologies Co., Ltd. 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
#
# ... |
7e4660ccdd0fcec22c60d6f3d750befc7a3f2fb2f067ecf6787233b01f73023a | Python | 9,470 | 217 | # Copyright 2019-2026 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
import tensorflow as tf
from numpy import pi
from .AbstractScoringLayer import ... |
4cf68ea6a1e2a5e45c8f5261c7524000a3a59c629636b304f10f728adc98496d | Python | 9,477 | 200 | """TODO: This code has been significantly re-written and should be tested."""
import math
import random
import numpy as np
import atom3d.protein.sequence as seq
import atom3d.util.file as fi
import atom3d.util.log as log
import atom3d.splits.splits as splits
logger = log.get_logger('sequence_splits')
##############... |
141ed3772dc11959c5f4961abf47f95757bcf309856a566cf4e4880ab8a461a8 | Python | 9,479 | 269 | """
Unit tests for scCODA
"""
import unittest
import numpy as np
import scanpy as sc
import tensorflow as tf
import pandas as pd
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))
from sccoda.util import cell_composition_data as dat
from sccoda.util import comp_ana... |
4413399df1ba514965302eac964565dc294b749c6840cc42c9b8d6225379ec65 | Python | 9,479 | 209 | """
@file: convert_to_onnx.py
Created on 07.02.20
@project: CrazyAra
@author: queensgambit
Utility script for cmd-line usage to convert a given MXNet model into the ONNX format.
The ONNX model can later be used to do inference with TensorRT or to load the model in a different DL-framework.
MXNet 1.5.1 only supports O... |
d92d2cb7d06f06a13f364c7289ec2c4c12b9e3296c7c0285257175c40e63c760 | Python | 9,479 | 296 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 11 14:26:04 2021
Main script to run Shepard et al., 1961's problems, including loading up and
plotting a big simulation
@author: robert.mok
"""
import os
import sys
import numpy as np
import torch
import matplotlib.pyplot as plt
import pickle
sy... |
7e0e483185bc8eb0e9189c7fdc7a2a5191d10e76e7691b6ff18c794f44dc6e32 | Python | 9,481 | 178 | """Run the eight manuscript methods on identical frozen benchmark partitions."""
from __future__ import annotations
import argparse
import gc
import json
from pathlib import Path
import sys
import traceback
import numpy as np
import torch
from threadpoolctl import threadpool_limits
from short2long import competitive... |
e94ab069f68c24cfac987ccff3e5b6f73d7c9322e2a6217faa84aa4670ad3218 | Python | 9,481 | 286 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
5674eeee5f04c81d4fa96e8bfc427d839769a0b560078dfe918977373af15730 | Python | 9,485 | 200 | """
@file: pgn_converter.py
Created on 09.06.18
@project: DeepCrazyhouse
@author: queensgambit
Converts a given board state defined by a python-chess object to the plane representation which can be learned by a CNN
"""
import numpy as np
import logging
import chess.pgn
from DeepCrazyhouse.src.domain.variants.constant... |
414829a0796395cd39a5eac2f9720c5e1269d4e1cfc328cdd940891c6fb24df2 | Python | 9,486 | 278 | #!/usr/bin/env python3
#!/usr/bin/env pypy3
"""Format ontology files using a uniform ttl serializer from rdflib
Usage:
ttlfmt [options]
ttlfmt [options] <file>...
Options:
-h --help print this
-v --verbose do something fun!
-a --vanilla use the regular rdflib turtle serializer
-y -... |
b308f05cfc053b8e9f1c9e7b4f56eb830246927860d2d40b0aec597fab0ee2d3 | Python | 9,488 | 258 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
# Ported from skchange (BSD-3-Clause), original authors: johannvk
"""Empirical distribution cost function."""
__author__ = ["johannvk"]
import numpy as np
from sktime.detection._utils import (
check_larger_than,
col_cumsum,
compute_f... |
c73d84b664783e4ffcab876b57b51f46661f7f5c580069627022728628fefbb5 | Python | 9,488 | 300 | import argparse
import os
import tqdm
from multiprocessing import Manager
import numpy as np
import cv2
import torch
import torch.nn as nn
from PIL import Image
import pretrainedmodels
from pretrainedmodels.utils import TransformImage
Q_FIN = "finished" # end-of-queue flag
def read_to_imgs(file):
"""Yield ima... |
4ae8e36d5c39ae608fc5ae4399cb8ff6a9d8982364b80dc3156e7a6411ea1457 | Python | 9,495 | 234 | """
This script produces Figure 4B of the paper.
This is the regression of a neuron during the active condition : Example fit
Internal notes:
This is from : 14.5d-active-only-3-plus-2-versus-4-plus-2-psth-fit-checkpoint
"""
import os
import numpy as np
import pickle as pkl
import pandas as pd
import src.models.kernel... |
7d396aeb654d333f556b19312b5261c1517b5929ed0acebfa2b37ab026b27a0b | Python | 9,495 | 266 | """Implementation of a SignatureClassifier.
Utilises the signature method of feature extraction.
This method was built according to the best practices
and methodologies described in the paper:
"A Generalised Signature Method for Time Series"
`arxiv <https://arxiv.org/pdf/2006.00873.pdf>`_.
"""
import numpy as... |
b741d0807ec8aafb533889dc4ed0367507bea2ee5b0d427b83a32caff428cd21 | Python | 9,495 | 294 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
# Ported from skchange (BSD-3-Clause), original authors: Tveten
"""Seeded binary segmentation algorithm for changepoint detection."""
__author__ = ["Tveten"]
__all__ = ["SeededBinarySegmentation"]
import numpy as np
import pandas as pd
from skti... |
1d2e62acf0935114c4ff3ed7dae20d8c234aa0e5d400636e28c1ce498e950566 | Python | 9,497 | 248 | #-------------------------------------------------------------------------------
# elftools: dwarf/datatype_cpp.py
#
# First draft at restoring the source level name a C/C++ datatype
# from DWARF data. Aiming at compatibility with llvm-dwarfdump v15.
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public dom... |
ec720b9edd956f600dd5767193b05c8055764316d99fc2bb93efdb2c55bbdaa7 | Python | 9,500 | 312 | import os
import os.path as osp
import sys
import time
import wandb
import dill
import pandas as pd
import torch
from sklearn.model_selection import train_test_split
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch_geometric.data import DataLoader
from molucn.dataset.pair import get_num_features
from ... |
a5ac767d0dcdf289108c7bb4a388f40c5e9daf49ad7a3fc6620290c5011a236c | Python | 9,508 | 231 | from __future__ import annotations
import numpy as np
import torch
from torch import Tensor, nn
class EMDLoss(nn.Module):
"""
Calculates the energy mover's distance between two batches of jets differentiably
as a convex optimization problem either through the linear programming library ``cvxpy``
or b... |
2e016962d997e3688c277d06863819cee3cc0ef24737e0e0310335b5dfa924a0 | Python | 9,511 | 182 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import copy
import json
import math
import os
from tqdm import tqdm
from google.protobuf.json_format import MessageToJson
import re
import numpy as np
import six
import tensorfl... |
f48a9f05baea790499f0db3f72c358c063cc5b2e715c0265f46bea0b31528f1f | Python | 9,523 | 287 | import argparse
from keras.optimizers import *
from sklearn.preprocessing import MinMaxScaler, StandardScaler
from sklearn.compose import ColumnTransformer
'''
Model Types:
model1 - This is the original model, or the mixed model when 'enzyme'='multi_task'
Inputs: Sequence + biofetures
... |
b101887acc5a57cde1cea2d9fe7218501a32f60cfe982a331e302eaeffb93efb | Python | 9,526 | 235 | # Copyright 2019 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
4ebeedef9b284c9dfe843a4f34343593ad8f5b2f335deb9ca3a7537889aff0ec | Python | 9,528 | 346 | import json
import logging
import os
import random
import sys
from itertools import combinations
from pathlib import Path
from typing import Dict, Tuple
import numpy as np
import pandas as pd
import torch
import wandb
from torch.nn.modules.loss import BCELoss
from torch.optim import Optimizer
from torch.utils.data imp... |
b6d05288c6b61b2863353d96019f04e567eed601417d11c924ff3f8637b0e5bd | Python | 9,546 | 314 | """Window Clustering Segmentation.
Implementing segmentation using clustering, Read more at
<https://en.wikipedia.org/wiki/Cluster_analysis>_.
"""
from collections import Counter
import numpy as np
import pandas as pd
from sklearn.base import clone
from sktime.detection.base import BaseDetector
from sktime.dists_ke... |
4cb7aad65c8f69a489b5be019d37bb067bc74240ed41667de8204b21c50c3549 | Python | 9,547 | 278 | """Fully Convolutional Network (FCN) for classification."""
__all__ = ["FCNClassifier"]
from copy import deepcopy
from sklearn.utils import check_random_state
from sktime.classification.deep_learning.base import BaseDeepClassifier
from sktime.networks.fcn import FCNNetwork
class FCNClassifier(BaseDeepClassifier):... |
5130c6b4c33683eff7f8eafbe9c19398a9dd0716310ac16e4afec42110afd58c | Python | 9,553 | 255 | # Copyright 2019 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
ed86afd94627ae9337c294944281ceb8c0b986bd43f0322d5f55b537a47f017f | Python | 9,553 | 262 | # Copyright 2019-2021 The ASReview Authors. 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 appl... |
5771de1f817022f47c96b12390a2b268141939f5a0aa9f3a5f8e99204753290b | Python | 9,554 | 284 | # -*- coding: utf-8 -*-
# Written (W) 2008-2012 Christian Widmer
# Written (W) 2008-2010 Cheng Soon Ong
# Written (W) 2012-2014 Daniel Blanchard, dblanchard@ets.org
# Copyright (C) 2008-2012 Max-Planck-Society, 2012-2014 ETS
# This file is part of GridMap.
# GridMap is free software: you can redistribute it and/or m... |
a66ab3cccd55c44f6d4d645974dad3f00fe935492bd9c6b9be213c7b84140caf | Python | 9,555 | 234 | # Copyright 2018-2026
# Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH
# 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/LICE... |
f5a493242fde96a43a4504d3dcb2722fa4c66bb87fe091e83bf0293862f90346 | Python | 9,556 | 380 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Collection of functions and classes used throughout the whole package."""
import warnings
from collections.abc import (
Callable,
)
from functools import (
wraps,
)
from typing import (
TYPE_CHECKING,
Any,
Union,
)
import numpy as np
import tensorflo... |
d4695ded7a2936b4e2b2c88a101734b4219691aef4d9b1b86ea4fa8686a75550 | Python | 9,558 | 296 | """
Helper functions to convert single-cell data to scCODA compositional analysis data
:authors: Johannes Ostner
"""
import pandas as pd
import anndata as ad
import os
import numpy as np
from anndata import AnnData
from typing import Optional, Tuple, Collection, Union, List
def read_anndata_one_sample(
adat... |
af8629fece014d4625752e6b4f1549d4a3f4c1d0861c52fbffe68a90f0a20ff0 | Python | 9,559 | 261 | # Copyright 2019 DeepMind Technologies Ltd. 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 appl... |
25f058fdcd0c4ed5070e0e0b873e26ea9baec2abfc3e5aad538bc1917edd2f9e | Python | 9,560 | 223 | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 8 12:06:23 2017
@author: tjp7rr1
"""
import numpy as np, sys, matplotlib.pyplot as plt
from scipy.spatial import distance
import time
def pairwise_distance_metrics_given_cdists(ground_truth, predicted, y, cutoff=10, verbose=True):
"""Function to calculate the pairw... |
bcfaecfe14630e2e47f67bbd1666714983c7a83b64e82571ef93744ac7d31364 | Python | 9,560 | 286 | # Copyright 2019 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.