repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
NooneBug/adapter_on_entity_typing | [
"b8d2850dbed47adbf21c9a8021cef69a9b5d60dd"
] | [
"result_scripts/generate_predictions.py"
] | [
"import configparser\nfrom adapter_entity_typing.network_classes.classifiers import EarlyStoppingWithColdStart\nfrom torch.utils.data.dataloader import DataLoader\nfrom adapter_entity_typing.network import load_model\nfrom collections import defaultdict\nimport torch\nimport json\nimport numpy as np\nfrom tqdm impo... | [
[
"torch.utils.data.dataloader.DataLoader",
"torch.topk",
"numpy.array",
"numpy.std",
"torch.nn.Sigmoid",
"numpy.mean"
]
] |
macthecadillac/Interacting-Fermions | [
"6122d2a7e67533b28e581929995ce8e2a2ad41fc"
] | [
"spinsys/time_dependent.py"
] | [
"\"\"\"\nThis file is part of spinsys.\n\nSpinsys is free software: you can redistribute it and/or modify\nit under the terms of the BSD 3-clause license. See LICENSE.txt\nfor exact terms and conditions.\n\"\"\"\n\nimport numpy as np\n\n\nclass TimeMachine():\n\n def __init__(self, eigvs, eigvecs, psi):\n ... | [
[
"numpy.exp"
]
] |
indutny/gradtype | [
"0e7e1290e6b4e669126e42339a739ec58dc1154e"
] | [
"tools/tsne.py"
] | [
"import matplotlib\nimport sys\nimport json\n\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport matplotlib.axes as axes\nimport numpy as np\nimport sklearn.decomposition\nimport sklearn.preprocessing\nfrom sklearn.manifold import TSNE\n\nCOLOR_MAP = plt.cm.gist_rainbow\nSEED = 0x37255c... | [
[
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gca",
"sklearn.manifold.TSNE",
"matplotlib.pyplot.show",
"numpy.array",
"numpy.linalg.norm",
"matplotlib.patches.Patch",
"matplotlib.pyplot.scatter"
]
] |
Fostereee/Transformer-MM-Explainability | [
"6dc4925b83a38e39069369da599b11d548128eb5"
] | [
"VisualBERT/tests/models/test_mmbt.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport unittest\n\nimport tests.test_utils as test_utils\nimport torch\nfrom VisualBERT.mmf.common.sample import Sample, SampleList\nfrom VisualBERT.mmf.models.mmbt import MMBT\nfrom VisualBERT.mmf.modules.encoders import (\n ImageEncoderFactory,\n ImageE... | [
[
"torch.jit.script",
"torch.ones",
"torch.randint",
"torch.rand",
"torch.no_grad",
"torch.equal",
"torch.zeros"
]
] |
zachary2wave/UAV-aid-communication | [
"801fe22d839261af43127e31db00f166ed6484a0"
] | [
"gym/envs/wlan/SingleAP.py"
] | [
"import gym\nfrom gym import spaces\nimport numpy as np\nfrom gym.envs.wlan import env_simulated as env\nfrom gym.envs.wlan import thought_out as tho\nfrom gym.utils import seeding\n\nclass ApEnv(gym.Env):\n\n def __init__(self):\n self.Num_AP = 1\n self.Num_UE = 50\n self.channel = [1]\n ... | [
[
"numpy.array",
"numpy.sum",
"numpy.argwhere",
"numpy.zeros"
]
] |
mattjshannon/mattpy | [
"52278419fcf56a5a0c25efb1bbc3ffe0f037c1bb"
] | [
"pennyspec/scripts/helpers.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nhelpers.py\n\nHelpers functions for analyze_pahs.py\n\"\"\"\n\nimport errno\nimport os\nimport pickle\n\nimport matplotlib.gridspec as gridspec\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom gaussfitter import onedgaussian, multigaussfit\nfrom scipy.integrate import simp... | [
[
"numpy.ones",
"numpy.sum",
"numpy.savetxt",
"numpy.polyfit",
"numpy.append",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gca",
"numpy.abs",
"numpy.where",
"matplotlib.gridspec.GridSpec",
"numpy.mean",
"numpy.sqrt",
"matplotlib.pyplot.subplots",
"numpy.ara... |
entslscheia/allennlp | [
"eeba62e34c8e211ed5963f830528c957f178607b"
] | [
"allennlp/data/fields/knowledge_graph_field.py"
] | [
"\"\"\"\n``KnowledgeGraphField`` is a ``Field`` which stores a knowledge graph representation.\n\"\"\"\nfrom typing import Callable, Dict, List, Set\nfrom collections import defaultdict\n\nimport editdistance\nfrom overrides import overrides\nimport torch\n\nfrom allennlp.common import util\nfrom allennlp.common.ch... | [
[
"torch.FloatTensor",
"torch.stack"
]
] |
vishalbelsare/py-bbn | [
"fe6848b4e0fe78d78af13cd06c0d29980ecd5d7f"
] | [
"pybbn/graph/factory.py"
] | [
"import itertools\nimport json\nfrom itertools import product\n\nimport networkx as nx\nimport pandas as pd\nfrom networkx.algorithms.dag import topological_sort\n\nfrom pybbn.graph.dag import Bbn\nfrom pybbn.graph.edge import Edge, EdgeType\nfrom pybbn.graph.node import BbnNode\nfrom pybbn.graph.variable import Va... | [
[
"pandas.Series"
]
] |
harrisonfeng/ray | [
"7b08db9f8cd85d185879e5bef778e8855f2a06cf"
] | [
"rllib/evaluation/sampler.py"
] | [
"from collections import defaultdict, namedtuple\nimport logging\nimport numpy as np\nimport queue\nimport threading\nimport time\n\nfrom ray.util.debug import log_once\nfrom ray.rllib.evaluation.episode import MultiAgentEpisode, _flatten_action\nfrom ray.rllib.evaluation.rollout_metrics import RolloutMetrics\nfrom... | [
[
"numpy.stack"
]
] |
zinechant/BERT-pytorch | [
"7c8bc555f29ff7ba336b38f2eddd072d7910e2bd"
] | [
"trainer/pretrain.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.optim import Adam\nfrom torch.utils.data import DataLoader\n\nfrom ..model import BERTLM, BERT\nfrom .optim_schedule import ScheduledOptim\n\nimport tqdm\nimport numpy\n\ndef hook(arr, l, iNo):\n def trace(module, input, output):\n if iNo:\n cid ... | [
[
"torch.nn.NLLLoss",
"numpy.save",
"torch.cuda.device_count",
"torch.cuda.is_available",
"numpy.array",
"torch.nn.DataParallel",
"torch.device"
]
] |
zxsted/PythonRobotics | [
"ed73b26db7eca9712dca696a9054f6ea2fcf26e9"
] | [
"PathPlanning/PotentialFieldPlanning/potential_field_planning.py"
] | [
"\"\"\"\n\nPotential Field based path planner\n\nauthor: Atsushi Sakai (@Atsushi_twi)\n\nRef:\nhttps://www.cs.cmu.edu/~motionplanning/lecture/Chap4-Potential-Field_howie.pdf\n\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# Parameters\nKP = 5.0 # attractive potential gain\nETA = 100.0 # repuls... | [
[
"matplotlib.pyplot.pause",
"numpy.hypot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.pcolor",
"matplotlib.pyplot.show",
"numpy.array",
"matplotlib.pyplot.plot"
]
] |
Westlanderz/AI-Plat1 | [
"1187c22819e5135e8e8189c99b86a93a0d66b8d8"
] | [
"venv/Lib/site-packages/caffe2/quantization/server/dequantize_dnnlowp_op_test.py"
] | [
"\r\n\r\nimport collections\r\n\r\nimport caffe2.python.hypothesis_test_util as hu\r\nimport hypothesis.strategies as st\r\nimport numpy as np\r\nfrom caffe2.python import core, dyndep, workspace\r\nfrom caffe2.quantization.server.dnnlowp_test_utils import check_quantized_results_close\r\nfrom hypothesis import giv... | [
[
"numpy.random.rand"
]
] |
LothairKizardjian/EfficientNeuralSearch | [
"45dd9c052fb74f9bb56efd9b914761dafb1a7ac9"
] | [
"enas/src/chess/data_utils.py"
] | [
"import os\nimport sys\nimport _pickle as pickle\nimport numpy as np\nimport tensorflow as tf\nimport chess.pgn\nimport pgn_tensors_utils\nimport bz2\n\ndef read_data(data_path, num_valids=20000):\n print(\"-\" * 80)\n print(\"Reading data\")\n\n nb_games = 200\n #nb_games = sys.maxsize\n boards, labels, resul... | [
[
"numpy.concatenate",
"numpy.reshape",
"numpy.transpose",
"numpy.asarray"
]
] |
NSLS-II-ISS/isstools | [
"54102529384f2c76633ca0393d637225a4104f93"
] | [
"isstools/widgets/widget_camera.py"
] | [
"import datetime\nfrom timeit import default_timer as timer\n\nimport numpy as np\nimport pkg_resources\nfrom PyQt5 import uic, QtWidgets, QtCore\nfrom PyQt5.QtCore import QThread, QSettings\n\nfrom matplotlib.backends.backend_qt5agg import (\n FigureCanvasQTAgg as FigureCanvas,\n NavigationToolbar2QT as Navi... | [
[
"matplotlib.figure.Figure",
"matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg",
"matplotlib.backends.backend_qt5agg.NavigationToolbar2QT",
"numpy.percentile"
]
] |
hlin09/metrics | [
"cceced613f4323a1f5124099a969f2cf32a80d7e"
] | [
"tests/classification/test_auc.py"
] | [
"# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"sklearn.metrics.auc",
"torch.tensor",
"numpy.argsort",
"numpy.random.rand"
]
] |
PEtab-dev/petab_test_suite | [
"1ff2d0c895dec90bd519e72ec226acb7573b54c9"
] | [
"petabtests/cases/0015/0015.py"
] | [
"from petabtests import *\nfrom petab.C import *\nimport petab\n\nimport pandas as pd\n\n\ntest_id = 15\n\n# problem --------------------------------------------------------------------\n\nmodel = DEFAULT_SBML_FILE\n\ncondition_df = pd.DataFrame(data={\n CONDITION_ID: ['c0'],\n}).set_index([CONDITION_ID])\n\nmea... | [
[
"pandas.DataFrame"
]
] |
shonaka/pytorch_challenge | [
"6e7d357e1ec1f01687664714efa2f04e64014f94"
] | [
"main.py"
] | [
"\"\"\"\nMain file for PyTorch Challenge Final Project\n\"\"\"\nfrom __future__ import print_function, division\nimport json\nimport yaml\nimport time\nimport torch\nimport optuna\nfrom torchvision import transforms\nfrom pathlib import Path\nfrom torchsummary import summary\nfrom torchvision import models\n# Custo... | [
[
"torch.nn.DataParallel",
"torch.cuda.is_available"
]
] |
PeterouZh/SemiNAS | [
"41e044b49bc7fbc3cfb832ebef988fb690024b2e"
] | [
"tts/tasks.py"
] | [
"import os\nimport sys\nimport json\nimport logging\nimport numpy as np\nimport pandas as pd\nimport matplotlib\nmatplotlib.use('Agg')\nimport torch\nfrom torch import nn\nimport torch.optim\nimport torch.utils.data\nimport torch.nn.functional as F\nimport utils\nimport logging\nfrom text_encoder import TokenTextEn... | [
[
"torch.utils.data.DataLoader",
"torch.nn.functional.mse_loss",
"numpy.sum",
"torch.no_grad",
"torch.cuda.is_available",
"torch.cat",
"torch.softmax",
"numpy.abs",
"torch.cuda.device_count",
"matplotlib.use",
"numpy.where",
"torch.nn.DataParallel",
"torch.sigmoid... |
elletech/practice_manim | [
"83671e9e801490ce84100da3a684e369860fda37"
] | [
"manim/utils/hashing.py"
] | [
"\"\"\"Utilities for scene caching.\"\"\"\n\nimport json\nimport zlib\nimport inspect\nimport copy\nimport numpy as np\nfrom types import ModuleType, MappingProxyType, FunctionType, MethodType\nfrom time import perf_counter\n\nfrom .. import logger\n\nALREADY_PROCESSED_ID = {}\n\n\nclass CustomEncoder(json.JSONEnco... | [
[
"numpy.resize"
]
] |
viniciusd/DCO1008---Digital-Signal-Processing | [
"a2756cb577bcdaf8852e2ef766732799cde7f5a3"
] | [
"projeto2/question2.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy.io import loadmat\nfrom scipy.interpolate import interp1d\n\n\ndef _load_signal(name):\n try:\n sig = loadmat(name)\n except FileNotFoundError:\n raise\n condition = name.split('_')[-1]\n sig['t'] = sig.pop('t_%s' % condition... | [
[
"scipy.io.loadmat",
"scipy.interpolate.interp1d",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"numpy.arange",
"matplotlib.pyplot.acorr",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.psd",
"matplotlib.pyplot.xlabel",
"numpy.mean"
]
] |
danmar3/twodlearn | [
"02b23bf07618d5288e338bd8f312cc38aa58c195"
] | [
"twodlearn/core/autoinit.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom . import variable\nfrom .options import global_options\n\n\nclass AutoinitType(object):\n ''' Base class to identify auto initializers '''\n pass\n\n\nclass AutoInit(object):\n ''' Indicates that the property should be auto initialized\n\n Example: ::\n... | [
[
"tensorflow.zeros",
"tensorflow.placeholder",
"tensorflow.convert_to_tensor",
"tensorflow.constant",
"tensorflow.random_normal"
]
] |
kamodulin/TRAILMAP | [
"1700eca3db070b02132ac1d9db8b9a80323d02cb"
] | [
"utilities/utilities.py"
] | [
"import numpy as np\nimport cv2\nimport os\nfrom os import listdir, makedirs\nfrom os.path import join\nfrom PIL import Image\nimport shutil\nimport sys\n\ndef crop_numpy(dim1, dim2, dim3, vol):\n return vol[dim1:vol.shape[0] - dim1, dim2:vol.shape[1] - dim2, dim3:vol.shape[2] - dim3]\n\n\ndef write_tiff_stack(v... | [
[
"numpy.array",
"numpy.zeros"
]
] |
pprachas/ABC_dataset | [
"61c915853c0229295e728f869b11b113ee59f098"
] | [
"Domain/subdataset1_domain/subdataset1_mesh.py"
] | [
"import numpy as np\r\n\r\nimport pygmsh\r\nimport meshio\r\n\r\nimport sys\r\n#---------------------Beam Parameters----------------------------#\r\nL = 40 # length of beam\r\nw = 5 # wdith of beam\r\nr_max = w/10\r\nr_min = w/15\r\n#----------------------------------Import Files---------------------#\r\n# Change t... | [
[
"numpy.load"
]
] |
kimhyeji/Mem2Seq | [
"6e6b7eacb4ae2e26517980c45046b0c519c918b7"
] | [
"models/enc_PTRUNK.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom torch import optim\nimport torch.nn.functional as F\nfrom utils.masked_cross_entropy import *\nfrom utils.config import *\nimport random\nimport numpy as np\nimport datetime\nfrom utils.measures import wer,moses_multi_bleu\nfrom tqdm im... | [
[
"torch.nn.LSTM",
"torch.nn.Linear",
"torch.nn.MSELoss",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.utils.rnn.pad_packed_sequence",
"numpy.transpose",
"torch.nn.functional.softmax",
"torch.rand",
"torch.save",
"numpy.array",
"torch.nn.Embedding",
"torch.nn.... |
m0r13/pytorch-ssd | [
"c92dc5228f8e12df907f0e6f06646e9a2ec94a73"
] | [
"vision/ssd/predictor.py"
] | [
"import torch\n\nfrom ..utils import box_utils\nfrom .data_preprocessing import PredictionTransform\nfrom ..utils.misc import Timer\n\n\nclass Predictor:\n def __init__(self, net, size, mean=0.0, std=1.0, nms_method=None,\n iou_threshold=0.45, filter_threshold=0.01, candidate_size=200, sigma=0.5,... | [
[
"torch.no_grad",
"torch.tensor",
"torch.cuda.is_available",
"torch.device",
"torch.cat"
]
] |
TorchSpatiotemporal/tsl | [
"da13493b0cf83826bf41fe78a67e8d4ce1d7a8a0"
] | [
"tsl/nn/base/dense.py"
] | [
"from torch import nn\n\nfrom tsl.nn.utils import utils\n\n\nclass Dense(nn.Module):\n r\"\"\"\n A simple fully-connected layer.\n\n Args:\n input_size (int): Size of the input.\n output_size (int): Size of the output.\n activation (str, optional): Activation function.\n dropout... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.Identity"
]
] |
sjk0709/Cartpole-DQN-pytorch041 | [
"439e5be4bd7b44dd923c46f24e62b46b7dadfba4"
] | [
"CartPole_DQN2015_tf140/network.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nSpyder Editor\n\nThis is a temporary script file.\n\"\"\"\n\n\nimport gym \nfrom gym.envs.registration import register\nimport sys, os\nimport tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport random as pr\n\n \nclass DQN:\n \n def __init__(self... | [
[
"tensorflow.placeholder",
"numpy.reshape",
"tensorflow.train.AdamOptimizer",
"tensorflow.variable_scope",
"tensorflow.contrib.layers.l2_regularizer",
"tensorflow.one_hot",
"tensorflow.square",
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.nn.softmax",
"tensorf... |
goerz-forks/qutip | [
"759759e85f61e3619b37253a6f981f71abc442d6"
] | [
"qutip/qobj.py"
] | [
"# This file is part of QuTiP: Quantum Toolbox in Python.\n#\n# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are... | [
[
"numpy.zeros",
"scipy.sparse.issparse",
"numpy.linalg.inv",
"numpy.any",
"numpy.abs",
"scipy.sparse.csr_matrix",
"numpy.shape",
"numpy.prod",
"numpy.sqrt",
"scipy.sparse.hstack",
"numpy.array",
"numpy.real",
"numpy.imag"
]
] |
biologioholic/sktime | [
"9d0391a04b11d22bd783b452f01aa5b4529b41a2",
"9d0391a04b11d22bd783b452f01aa5b4529b41a2"
] | [
"sktime/classification/interval_based/tests/test_drcif.py",
"sktime/annotation/adapters/_pyod.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"DrCIF test code.\"\"\"\nimport numpy as np\nfrom sklearn.metrics import accuracy_score\n\nfrom sktime.classification.interval_based import DrCIF\nfrom sktime.datasets import load_unit_test\n\n\ndef test_drcif_train_estimate():\n \"\"\"Test of DrCIF on unit test data.\"\"\"\n # ... | [
[
"sklearn.metrics.accuracy_score",
"numpy.argmax"
],
[
"numpy.where",
"pandas.Series",
"sklearn.base.clone"
]
] |
sasmirnov/numba-dppy | [
"6ec41a5adab3034ddcfba2df312117afd6e2327b"
] | [
"numba_dppy/dpnp_glue/dpnp_array_creations_impl.py"
] | [
"# Copyright 2021 Intel Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ... | [
[
"numpy.arange",
"numpy.ones",
"numpy.zeros"
]
] |
computerwala/tensorflow | [
"97164413d009aa6506f269eff7fb78411419146d",
"766eb63f2f3e43cd8b23c1cbb05fe63dd918ffa3"
] | [
"tensorflow/python/ops/ragged/ragged_math_ops.py",
"tensorflow/python/autograph/impl/api.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.ragged.ragged_util.get_positive_axis",
"tensorflow.python.ops.ragged.ragged_tensor.RaggedTensor.from_row_splits",
"tensorflow.python.ops.ragged.ragged_tensor.RaggedTensor.from_nested_row_splits",
"tensorflow.python.ops.ragged.segment_id_ops.row_splits_to_segment_ids",
"t... |
makoziol0/pyne | [
"660b1bdd608d9b227d6a432737303f7e82af4a25"
] | [
"pyne/transmute/origen22.py"
] | [
"\"\"\"This module implements an ORIGEN v2.2 transmutation solver.\n\"\"\"\nfrom __future__ import print_function, division\n\nimport os\nimport subprocess\nimport tempfile\nfrom collections import Mapping\nfrom warnings import warn\nfrom pyne.utils import QAWarning\n\nimport numpy as np\n\nfrom pyne import data\nf... | [
[
"numpy.array",
"numpy.empty",
"numpy.all",
"numpy.asarray"
]
] |
SkyAndCloud/Coursera-AndrewNG-ML-Python | [
"586edffdcc3e0811ac186a00b78897b0a75a07d0"
] | [
"ex7/computeCentroids.py"
] | [
"import numpy as np\n\n\ndef computeCentroids(X, idx, K):\n \"\"\"returns the new centroids by\n computing the means of the data points assigned to each centroid. It is\n given a dataset X where each row is a single data point, a vector\n idx of centroid assignments (i.e. each entry in range [1..K]) for... | [
[
"numpy.sum",
"numpy.bincount",
"numpy.zeros"
]
] |
YaxinCui/TorchSSL | [
"5603d16dfcb62e558c298f999a613f6f9d2c49de"
] | [
"pimodel.py"
] | [
"# import needed library\nimport os\nimport logging\nimport random\nimport warnings\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.distributed as dist\nimport torch.multiprocessing as mp\n\nfrom utils import net_builder, get_l... | [
[
"torch.multiprocessing.spawn",
"torch.manual_seed",
"torch.distributed.init_process_group",
"numpy.random.seed",
"torch.cuda.device_count",
"torch.nn.parallel.DistributedDataParallel",
"torch.cuda.is_available",
"torch.nn.DataParallel",
"torch.cuda.set_device"
]
] |
ioam/topographica | [
"1e097e2df9938a6ce9f48cefbf25672cbbf9a4db"
] | [
"topo/tests/unit/testplot.py"
] | [
"\"\"\"\nTest for the Plot class.\n\"\"\"\n\n\nimport unittest\nfrom topo.base.sheet import *\n#from testsheetview import ImageGenerator\n\nSHOW_PLOTS = False\n\n### JC: My new imports\nfrom topo.plotting.plot import make_template_plot\nimport numpy as np\n\nimport param\n\nfrom holoviews.core import BoundingBox, N... | [
[
"numpy.array",
"numpy.zeros",
"numpy.random.random"
]
] |
workprinond/Anti-Alignment | [
"12783fcc7f3c208007bf15d750a3659fd92506f0"
] | [
"anti_alignment/algo/graph_construction/search_tree.py"
] | [
"import numpy as np\nimport networkx as nx\n\n\nclass SearchTree:\n\n def __init__(self,net,i_m, f_m):\n self.net = net\n self.i_m = i_m\n self.f_m = f_m\n\n def compute_incidence_matrix(self,net):\n \"\"\"\n We compute the incidence matrix of a Petri Net. It provides us wit... | [
[
"numpy.array2string",
"numpy.array_equal"
]
] |
jkulhanek/viewformer | [
"9ad2c5a2f7abe4b7ff490ced0132bf3d2f07e29c"
] | [
"viewformer/evaluate/evaluate_transformer_multictx_allimg.py"
] | [
"from aparse import click, ConditionalType\nimport os\nimport tqdm\nimport json\nimport numpy as np\nfrom PIL import Image\nfrom typing import Optional\nfrom typing import List\nfrom viewformer.utils.tensorflow import load_model\nfrom viewformer.data.loaders import get_loaders\nimport tensorflow as tf\nfrom viewfor... | [
[
"tensorflow.stack",
"numpy.random.default_rng",
"tensorflow.reshape",
"tensorflow.shape",
"numpy.stack",
"tensorflow.zeros_like",
"tensorflow.cast",
"tensorflow.name_scope",
"tensorflow.image.convert_image_dtype",
"tensorflow.clip_by_value",
"tensorflow.concat",
"te... |
kdorichev/text2speech | [
"082ed9c222fa346f6c5ad6375477807df44ed45a"
] | [
"fastpitch/transformer_jit.py"
] | [
"# Adapted from\n# https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechSynthesis/FastPitch\n\n# Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.... | [
[
"torch.nn.Linear",
"torch.nn.functional.softmax",
"torch.nn.ReLU",
"torch.nn.Conv1d",
"torch.nn.LayerNorm",
"torch.nn.ModuleList",
"torch.arange",
"torch.einsum",
"torch.bmm",
"torch.nn.Dropout",
"torch.ger"
]
] |
a-chumagin/great_expectations | [
"969dacbd4e0fce74ce515e5f1dcd0918785bcd21"
] | [
"great_expectations/expectations/metrics/map_metric_provider.py"
] | [
"import logging\nfrom functools import wraps\nfrom typing import Any, Callable, Dict, List, Optional, Type, Union\n\nimport numpy as np\n\nimport great_expectations.exceptions as ge_exceptions\nfrom great_expectations.core import ExpectationConfiguration\nfrom great_expectations.core.util import convert_to_json_ser... | [
[
"numpy.count_nonzero"
]
] |
DarseZ/DL_hw5 | [
"6229ef6493e92b93e67e71058f90bc4a6b537796"
] | [
"q_learning/utils/schedule.py"
] | [
"import numpy as np\nfrom utils.test_env import EnvTest\n\n\nclass LinearSchedule(object):\n def __init__(self, eps_begin, eps_end, nsteps):\n \"\"\"\n Args:\n eps_begin: initial exploration\n eps_end: end exploration\n nsteps: number of steps between the two values... | [
[
"numpy.random.uniform"
]
] |
dennislwm/dtale-desktop | [
"1a034d505f6b45c1ece4c18b83af6ae367d16824"
] | [
"dtale_desktop/default_sources/dft_csv/get_data.py"
] | [
"import pandas as pd\n\n\ndef main(path: str) -> pd.DataFrame:\n return pd.read_csv(path)\n"
] | [
[
"pandas.read_csv"
]
] |
rjplevin/BEST-AIR | [
"40f4bb74f4a8a98b66a452f58596f4c425c9a51b"
] | [
"best_air/bin/extract_EPA_monitor_data_88101_2000_2017.py"
] | [
"import csv\nimport pandas as pd\n\nCALIFORNIA = 6 # State Code to keep\n\ndata_dir = '/Volumes/T7/Box Sync/BEST-AIR/Data/AQ Monitoring/EPA Criteria Pollutants/PM Daily Data/'\n\npathname = data_dir + '2017/daily_88101_2017.csv'\n\n# Create 'Monitor ID' = State Code + County Code + Site Num + Parameter Code\n# Dro... | [
[
"pandas.read_csv"
]
] |
pierrepo/buildH | [
"4870ffc4fb41deec2c8af5ba5b589795bbb99563"
] | [
"buildh/core.py"
] | [
"\"\"\"Module holding the core functions.\"\"\"\n\nimport pandas as pd\nimport MDAnalysis as mda\nimport MDAnalysis.coordinates.XTC as XTC\n\nfrom . import hydrogens\nfrom . import geometry as geo\nfrom . import writers\n\n\n# For debugging.\n# TODO: Remove it after implement logging feature\nDEBUG=False\n\n\ndef b... | [
[
"pandas.DataFrame"
]
] |
samuelstanton/lambo | [
"7b67684b884f75f7007501978c5299514d0efb75"
] | [
"lambo/models/mlm.py"
] | [
"import math\n\nimport numpy as np\nimport torch\nimport torchvision\nimport wandb\n\nfrom torch.nn import functional as F\nfrom torch import LongTensor\n\nfrom lambo import transforms as gfp_transforms, dataset as gfp_dataset\nfrom lambo.models.shared_elements import check_early_stopping\nfrom lambo.utils import s... | [
[
"torch.utils.data.DataLoader",
"torch.nn.functional.log_softmax",
"torch.utils.data.BatchSampler",
"torch.distributions.Categorical",
"torch.nn.functional.softmax",
"torch.multinomial",
"torch.tensor",
"torch.no_grad",
"numpy.take_along_axis",
"numpy.arange",
"torch.is_... |
mmr12/DeepLearning18 | [
"3e683c570ea8f5e224767a41a0e152267cfd08e7"
] | [
"data_loader/baseline_generator.py"
] | [
"import numpy as np\nimport os\nimport sys\n# To import from sibling directory ../utils\nsys.path.append(os.path.dirname(os.path.abspath(__file__)) + \"/..\")\nfrom data_loader.load_utils import load_obj\nfrom data_loader.load_utils import try_to_load_as_pickled_object\nfrom sklearn.model_selection import train_tes... | [
[
"sklearn.model_selection.train_test_split"
]
] |
Data-drone/scaling_deep_learning | [
"476346179c4575ad6aeecc8c6a1b427d00abde5a"
] | [
"tensorflow/SAM Model - Petastorm.py"
] | [
"# Databricks notebook source\n# MAGIC %md\n# MAGIC \n# MAGIC ## Training and packaging a Tensorflow 2.x model with Model Hub\n# MAGIC \n# MAGIC - based on: https://www.tensorflow.org/text/tutorials/classify_text_with_bert\n# MAGIC - Sentiment Analysis Model\n\n# COMMAND ----------\n\n# MAGIC %md\n# MAGIC \n# MAGIC... | [
[
"tensorflow.keras.utils.plot_model",
"tensorflow.get_logger",
"tensorflow.keras.callbacks.TensorBoard",
"tensorflow.sigmoid",
"tensorflow.metrics.BinaryAccuracy",
"tensorflow.keras.losses.BinaryCrossentropy",
"tensorflow.constant",
"tensorflow.debugging.experimental.enable_dump_deb... |
herrlich10/mripy | [
"df9a8e57a21163579af49c59a9dcd2da279cb9fa"
] | [
"mripy/afni.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function, division, absolute_import, unicode_literals\nimport sys, os, re, shlex, shutil, glob, subprocess, collections\nfrom os import path\nfrom datetime import datetime\nimport numpy as np\nfrom scipy import interpolate\nimport matplot... | [
[
"scipy.interpolate.interp1d",
"numpy.float_",
"numpy.diag",
"numpy.any",
"numpy.argsort",
"numpy.issubdtype",
"numpy.int_",
"numpy.atleast_1d",
"matplotlib.colors.to_hex",
"numpy.array",
"numpy.linspace"
]
] |
animesh-007/digit-identify | [
"236befc520af08ff838dfdf2ae0392d8afb7598a"
] | [
"app.py"
] | [
"import os\r\n#Define backend as tensorflow\r\nos.environ['KERAS_BACKEND']='tensorflow'\r\n#It is important to import keras after changing backend\r\nimport keras\r\nfrom flask import Flask, render_template,request\r\nfrom scipy.misc import imsave, imread, imresize\r\nimport numpy as np\r\n#import keras.models\r\ni... | [
[
"numpy.invert",
"scipy.misc.imresize",
"scipy.misc.imread",
"numpy.argmax"
]
] |
rozlana-g/FEDOT | [
"a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c"
] | [
"test/unit/data/test_data.py"
] | [
"import os\nfrom copy import deepcopy\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom sklearn.datasets import load_iris\n\nfrom fedot.core.data.data import InputData, OutputData\nfrom fedot.core.data.multi_modal import MultiModalData\nfrom fedot.core.repository.dataset_types import DataTypesEnum\nfr... | [
[
"numpy.random.shuffle",
"numpy.random.seed",
"numpy.asarray",
"numpy.arange",
"numpy.expand_dims",
"numpy.power",
"numpy.random.rand",
"numpy.array_equal",
"numpy.array",
"sklearn.datasets.load_iris"
]
] |
evelkey/vahun | [
"a7967ffd9d8e27911888057b4906fc4221c2a6fe"
] | [
"vahun_cmd.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\nimport tensorflow as tf\nimport sys\nimport numpy as np\nfrom vahun.corpus import Corpus\nfrom vahun.genetic import evolution\nfrom vahun.genetic import experiment\nfrom vahun.tools import Timer\nfrom vahun.tools i... | [
[
"tensorflow.train.AdamOptimizer",
"tensorflow.ConfigProto",
"tensorflow.Session",
"numpy.prod"
]
] |
arc144/siim-pneumothorax | [
"98fdb1fe08e9c001e0191d5024ba6c56ec82a9c8"
] | [
"See/Model_001_f00/submit.py"
] | [
"import pandas as pd\nfrom zipfile import ZipFile\nimport torch as th\nimport cv2\nimport numpy as np\nimport os\nfrom glob import glob\nimport pydicom\nfrom matplotlib import pyplot as plt\nfrom segmentation_model import FPNSegmentation\n\n\ndef main():\n train_image_fns = sorted(glob(os.path.join(\n 'dicom-... | [
[
"torch.load",
"torch.flip",
"torch.no_grad",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"torch.from_numpy"
]
] |
Gavin-Hoang/oneflow | [
"320038ff5efd948516f7259442190f9b31f75027"
] | [
"oneflow/python/test/ops/test_image_decode.py"
] | [
"\"\"\"\nCopyright 2020 The OneFlow Authors. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by ap... | [
[
"numpy.array",
"numpy.where",
"numpy.all",
"numpy.frombuffer"
]
] |
dutxubo/mmdetection | [
"607d2fc0bdff5a8f07e6a92da899505bd083dfc5"
] | [
"mmdet/models/bbox_heads/bbox_head.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.modules.utils import _pair\n\nfrom mmdet.core import (auto_fp16, bbox_target, delta2bbox, force_fp32,\n multiclass_nms)\nfrom ..builder import build_loss\nfrom ..losses import accuracy\nfrom ..registry import... | [
[
"torch.sum",
"torch.stack",
"torch.nn.Linear",
"torch.nonzero",
"torch.nn.init.constant_",
"torch.nn.functional.softmax",
"torch.nn.init.normal_",
"torch.gather",
"torch.from_numpy",
"torch.nn.AvgPool2d",
"torch.cat",
"torch.nn.modules.utils._pair"
]
] |
ITWSDataScience/EducationFundingAnalysisInCaliforniaGroup3Fall2021 | [
"1c7fb5265fb0a354c2a8a438fbe00f073667c397"
] | [
"data_manipulation.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Data Manipulation\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1dnbNHRyDzukEq2IVv2Bx2tdzVEbLZJc0\n\"\"\"\n\nimport pandas as pd\n\ndf1 = pd.read_csv(\"district_school_data.csv\")\ndf2 = pd.read_csv(\"district_... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
JarnoRFB/statsmodels | [
"9913b6a4f0243f94a6331c90a3951849f06720f7"
] | [
"statsmodels/tsa/statespace/tests/test_options.py"
] | [
"\"\"\"\nTests for setting options in KalmanFilter, KalmanSmoother, SimulationSmoother\n\n(does not test the filtering, smoothing, or simulation smoothing for each\noption)\n\nAuthor: Chad Fulton\nLicense: Simplified-BSD\n\"\"\"\nfrom __future__ import division, absolute_import, print_function\n\nimport numpy as np... | [
[
"numpy.arange",
"numpy.testing.assert_equal"
]
] |
salesforce/burn-after-reading | [
"939d969d67a9ba325eba9e1cb9c696908f9d88db"
] | [
"data_loader.py"
] | [
"'''\n * Copyright (c) 2021, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause\n'''\n\nfrom torchvision import datasets, transforms\nimport torch\nimport numpy as np... | [
[
"numpy.array",
"torch.utils.data.DataLoader",
"torch.manual_seed",
"numpy.random.seed"
]
] |
bjajoh/lidar_transfer | [
"9a6366264b1fd95d7a84e05bd41659524fd9fd32"
] | [
"auxiliary/np_ioueval.py"
] | [
"#!/usr/bin/env python3\n# This file is covered by the LICENSE file in the root of this project.\n\nimport sys\nimport numpy as np\n\n\nclass iouEval:\n def __init__(self, n_classes, ignore=None):\n # classes\n self.n_classes = n_classes\n\n # What to include and ignore from the means\n self.ignore = n... | [
[
"numpy.zeros",
"numpy.diag",
"numpy.stack",
"numpy.add.at",
"numpy.array"
]
] |
ssalopek/DFT_FFT_ImageDenoise | [
"9ced6175b39c0c8f205b84fcd7d3fbb16bdca8d8"
] | [
"FFT.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy import fftpack\nfrom matplotlib.colors import LogNorm \nimport cv2\nimport time\n\nstart = time.time()\n#Load input image\nimage_source = cv2.imread('C:/FaksGit/FourierFilter/TestImages/man.png')\ngray_image = cv2.cvtColor(image_source, cv2.COLOR_BGR2... | [
[
"matplotlib.pyplot.xticks",
"scipy.fftpack.fft2",
"matplotlib.pyplot.figure",
"numpy.abs",
"scipy.fftpack.ifft2",
"matplotlib.pyplot.title",
"matplotlib.colors.LogNorm",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.yticks"
]
] |
histolab/histolab | [
"e5e28846fada56d04b90cf32a2772fbdb2e0786a"
] | [
"histolab/filters/image_filters_functional.py"
] | [
"# encoding: utf-8\n\n# ------------------------------------------------------------------------\n# Copyright 2020 All Histolab Contributors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Lic... | [
[
"numpy.array",
"numpy.ones",
"numpy.percentile"
]
] |
paulchou0309/obj | [
"d7ae404fa73db60a6fe539d613e48f478b81dbef"
] | [
"object_detection/exporter.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.training.saver.Saver",
"tensorflow.python.platform.gfile.GFile",
"tensorflow.identity",
"tensorflow.train.ExponentialMovingAverage",
"tensorflow.Graph",
"tensorflow.python.pywrap_tensorflow.NewCheckpointReader",
"tensorflow.python.client.session.Session",
"tensor... |
lydia07/mdsearch | [
"a328e822d6d66869aeefef687887b0a39d4f4512"
] | [
"mdsearch/Similarity/sentence_similarity.py"
] | [
"import torch\nfrom scipy.spatial.distance import cosine\nfrom transformers import BertModel, BertTokenizer\nimport os\n\n\nclass SentenceSimilarity:\n\n def __init__(self, model_path='bert-base-uncased'):\n self.tokenizer = BertTokenizer.from_pretrained(model_path)\n self.model = BertModel.from_pr... | [
[
"torch.no_grad",
"torch.tensor",
"torch.device",
"scipy.spatial.distance.cosine"
]
] |
ParadoxZW/CIFAR100-PRACTICE | [
"175d9a72fc8e7d79ec3ef8670028d1efe830e5b9"
] | [
"Chanet.py"
] | [
"# just for fun, give channel some meanings about relations\n# between positions.\nfrom modules import *\nfrom torch import tensor\nimport torch\nimport numpy as np\nimport torch.nn.functional as F\nfrom torch import nn\n\n\n\nclass Group(nn.Module):\n \"\"\"\n resblocks with same input and output size.\n ... | [
[
"torch.nn.MaxPool2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.Linear",
"torch.nn.Sequential"
]
] |
JingweiToo/Machine-Learning-Regression-Toolbox | [
"77f2b1ee49cf5e5116102197064ce2dc13a23ed0"
] | [
"MLR/nn.py"
] | [
"import numpy as np\r\nfrom sklearn.neural_network import MLPRegressor\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.model_selection import KFold\r\nfrom sklearn.model_selection import LeaveOneOut\r\nfrom sklearn.metrics import r2_score\r\n\r\n\r\ndef jho(feat, label, opts):\r\n ho ... | [
[
"sklearn.model_selection.LeaveOneOut",
"numpy.concatenate",
"numpy.size",
"sklearn.model_selection.KFold",
"sklearn.neural_network.MLPRegressor",
"sklearn.metrics.r2_score",
"sklearn.model_selection.train_test_split",
"numpy.mean"
]
] |
xxelloss/Markov-Learning | [
"56b47f046fcc130b33aeaff7792fd73ee40f0501"
] | [
"Markov_comp.py"
] | [
"# Markov chain comparison class\n# create multiple Markov_learning classes, and conduct comparison\n\nimport numpy as np\nimport Markov_learning as ml\nimport copy\n\nclass Markov_comp(object):\n # attributes\n # it may have multiple Markov_learning objects\n # maximum, 10\n ML=[]\n # how many MLs? ... | [
[
"numpy.zeros"
]
] |
Shank2358/NPMMR-Det | [
"869f3f537af9bc656f2bfdfa97ebb95bf70847a7"
] | [
"model/layers/multiscale_fusion_blocks.py"
] | [
"import torch\nimport torch.nn as nn\nfrom ..layers.convolutions import Convolutional, Separable_Conv_dila, Separable_Conv, Deformable_Convolutional\nimport torch.nn.functional as F\nfrom ..layers.attention_blocks import SELayer\n\nclass SPP(nn.Module):\n def __init__(self, depth=512):\n super(SPP,self)._... | [
[
"torch.nn.MaxPool2d",
"torch.add",
"torch.nn.functional.max_pool2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.functional.softmax",
"torch.nn.Softmax",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.functional.interpolate"
]
] |
babak2520/ml-io | [
"d79a895c3fe5e10f0f832cfdcee5a73058abb7c7"
] | [
"src/mlio-py/mlio/integ/scipy.py"
] | [
"# Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in t... | [
[
"numpy.array",
"scipy.sparse.coo_matrix"
]
] |
MothVine/DESC | [
"8f18ca63b34dad07ec67a4d43945d39287b303b8"
] | [
"tests/test_configuration.py"
] | [
"import numpy as np\nimport pytest\nimport unittest\nfrom desc.equilibrium import Equilibrium, EquilibriaFamily\nfrom desc.grid import ConcentricGrid\nfrom desc.profiles import PowerSeriesProfile, SplineProfile\nfrom desc.geometry import (\n FourierRZCurve,\n FourierRZToroidalSurface,\n ZernikeRZToroidalSe... | [
[
"numpy.array",
"numpy.random.random",
"numpy.testing.assert_allclose"
]
] |
Sage-Bionetworks/Genie | [
"ce70861b0d3717cd5b57a393a16b4d6fea9500f3"
] | [
"genie/dashboard_table_updater.py"
] | [
"\"\"\"Updates dashboard tables\"\"\"\nimport argparse\nimport datetime\nimport logging\nimport os\n\nimport pandas as pd\nimport synapseclient\nfrom synapseclient.core.utils import to_unix_epoch_time\n\nfrom genie import process_functions\n\nlogger = logging.getLogger(__name__)\n\n\ndef get_center_data_completion(... | [
[
"pandas.read_csv",
"pandas.isnull",
"pandas.Series",
"pandas.DataFrame"
]
] |
shihchengli/APE | [
"c2f529b9e20959824317dbc3c018ce41702d67f6"
] | [
"ape/OptimalVibrations.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\nA module to find the optimizing vibrational coordinates to reduce intermode coupling\n\"\"\"\n\nimport os\nimport time\nimport logging\nimport numpy as np\nfrom copy import deepcopy\nfrom scipy import optimize\nfrom numba import jit\n\nimport rmgpy.constants as constants\n\nfrom ... | [
[
"numpy.matmul",
"numpy.linalg.norm",
"scipy.optimize.minimize_scalar",
"numpy.zeros",
"numpy.diag",
"numpy.linalg.inv",
"numpy.cos",
"numpy.sqrt",
"numpy.sin",
"numpy.identity"
]
] |
njcuk9999/apero-utils | [
"f77de4c9123874e5bb6ed6bd03a7de3b27057402"
] | [
"general/paper_plots/general.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nPlots for the apero drs paper\n\nCreated on 2021-08-01\n\n@author: cook\n\"\"\"\nimport matplotlib\nmatplotlib.use('Qt5Agg')\nfrom astropy.io import fits\nfrom astropy.visualization import imshow_norm, ZScaleInterval, LinearStretch\nimport glob\nimport matplo... | [
[
"numpy.zeros_like",
"numpy.roll",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.show",
"matplotlib.patches.Rectangle",
"matplotlib.cm.get_cmap",
"matplotlib.pyplot.close",
"... |
viantirreau/cupy | [
"cafe9af0e974ff88fc6aa43bf106e343a60fb983"
] | [
"tests/cupyx_tests/scipy_tests/sparse_tests/test_csr.py"
] | [
"import contextlib\nimport pickle\nimport unittest\nimport warnings\n\nimport numpy\nimport pytest\ntry:\n import scipy.sparse\n scipy_available = True\nexcept ImportError:\n scipy_available = False\n\nimport cupy\nfrom cupy.core import _accelerator\nfrom cupy import testing\nfrom cupyx.scipy import sparse... | [
[
"numpy.zeros_like",
"numpy.ones",
"numpy.dtype",
"numpy.isinf",
"numpy.issubdtype",
"numpy.arange",
"numpy.array"
]
] |
FelixAbrahamsson/zounds | [
"197c358acf3bea4252cfc2561da70cbe799e2c75"
] | [
"zounds/spectral/frequencyscale.py"
] | [
"\nimport numpy as np\nimport bisect\n\n\nclass Hertz(float):\n def __init__(self, hz):\n try:\n self.hz = hz.hz\n except AttributeError:\n self.hz = hz\n\n def __neg__(self):\n return Hertz(-self.hz)\n\n def __add__(self, other):\n try:\n other ... | [
[
"numpy.geomspace",
"numpy.arange",
"numpy.log",
"numpy.sqrt",
"numpy.dot",
"numpy.linspace"
]
] |
Pugavkomm/NS-analyst | [
"698af0e94f57b431fd77c17c49d4a23f11d21d3f"
] | [
"temp/maintestgraph.py"
] | [
"import sys\nimport time\n\nimport numpy as np\n\nfrom matplotlib.backends.qt_compat import QtCore, QtWidgets, is_pyqt5\nif is_pyqt5():\n from matplotlib.backends.backend_qt5agg import (\n FigureCanvas, NavigationToolbar2QT as NavigationToolbar)\nelse:\n from matplotlib.backends.backend_qt4agg import (... | [
[
"matplotlib.backends.backend_qt4agg.NavigationToolbar2QT",
"matplotlib.backends.qt_compat.QtWidgets.QVBoxLayout",
"matplotlib.backends.qt_compat.QtWidgets.QWidget",
"matplotlib.figure.Figure",
"numpy.tan",
"matplotlib.backends.qt_compat.is_pyqt5",
"matplotlib.backends.qt_compat.QtWidge... |
rjleveque/amrclaw | [
"d7acfe4a71b2515778b134540a015923ce77a3cd"
] | [
"examples/advection_2d_flagregions/setrun.py"
] | [
"\"\"\" \nModule to set up run time parameters for Clawpack.\n\nThe values set in the function setrun are then written out to data files\nthat will be read in by the Fortran code.\n \n\"\"\" \n\nfrom __future__ import absolute_import\nimport os\nimport numpy as np\n\n# used to create ruled rectangle:\nfrom clawp... | [
[
"numpy.array"
]
] |
pragupta/Inverse-Reinforcement-Learning | [
"e7bbb7bb0ad24ebc36d9e0d4b4e6c6788229fd9c"
] | [
"irl/mdp/gridworld.py"
] | [
"\"\"\"\nImplements the gridworld MDP.\n\nMatthew Alger, 2015\nmatthew.alger@anu.edu.au\n\"\"\"\n\nimport numpy as np\nimport numpy.random as rn\nimport matplotlib.pyplot as plt\n\nclass Gridworld(object):\n \"\"\"\n Gridworld MDP.\n \"\"\"\n\n def __init__(self, grid_size, wind, discount):\n \"\... | [
[
"numpy.zeros",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"numpy.argmax",
"numpy.random.random",
"matplotlib.pyplot.close",
"numpy.array",
"numpy.random.randint",
"matplotlib.pyplot.Rectangle"
]
] |
cfleschhut/virushack | [
"2fe7ded0be8672b066edef7fed52573794db2ba5"
] | [
"hystreet/hystreet_to_s3/compute_station_means.py"
] | [
"import pandas as pd\nfrom datetime import datetime, date\n\n\ndef compute_weekday(timestamp):\n date_str = timestamp.split('+')[0]\n date = datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%S.%f')\n return date.weekday()\n\n\ndata = pd.read_csv('data.temp.csv')\n\ndata['weekday'] = float(\"NaN\")\nfor index, r... | [
[
"pandas.read_csv"
]
] |
OtavioPiza/project-euler | [
"96ca6d5af85ab2c2b911e38d89a78ac2443fbc5f"
] | [
"utils/plotting.py"
] | [
"from matplotlib import pyplot as plt\nfrom typing import Any, NoReturn, Tuple, List\n\n\ndef plot_range(params: Tuple[Tuple[Any], ...], functions: Tuple[(Any, )], x_label: str = 'input',\n x_axis_labeling_function: (Any) = lambda i: i[0]) -> NoReturn:\n \"\"\"\n plots the time each function too... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel"
]
] |
skynetera/openpilot | [
"a7e099c946800c7a8b60c47678801d9a95f95549"
] | [
"selfdrive/controls/lib/radar_helpers.py"
] | [
"import numpy as np\nimport platform\nimport os\nimport sys\n\nfrom common.kalman.ekf import FastEKF1D, SimpleSensor\n\n# radar tracks\nSPEED, ACCEL = 0, 1 # Kalman filter states enum\n\nrate, ratev = 20., 20. # model and radar are both at 20Hz\nts = 1./rate\nfreq_v_lat = 0.2 # Hz\nk_v_lat = 2*np.pi*freq_v_lat... | [
[
"numpy.interp",
"numpy.zeros",
"numpy.asarray",
"numpy.clip",
"numpy.maximum"
]
] |
chw3k5/WaferScreen | [
"c0ca7fe939fe7cd0b722b7d6129b148c03a7505c"
] | [
"waferscreen/plot/band_and_keepout.py"
] | [
"# Copyright (C) 2021 Members of the Simons Observatory collaboration.\n# Please refer to the LICENSE file in the root of this repository.\n\nimport matplotlib.pyplot as plt\nimport matplotlib.transforms as mtransforms\nfrom ref import band_params, smurf_keepout_zones_ghz\n\n\ncolors = ['BlueViolet', 'Brown', 'Cade... | [
[
"matplotlib.pyplot.show",
"matplotlib.transforms.blended_transform_factory",
"matplotlib.pyplot.text",
"matplotlib.pyplot.subplots"
]
] |
andreas-eberle/agents | [
"27b9498689ea5b8f69fc77ada752e05e38192852"
] | [
"tf_agents/networks/network.py"
] | [
"# coding=utf-8\n# Copyright 2018 The TF-Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b... | [
[
"tensorflow.python.util.tf_inspect.getargspec",
"tensorflow.python.util.tf_decorator.make_decorator",
"tensorflow.nest.assert_same_structure",
"tensorflow.expand_dims"
]
] |
ryohachiuma/DFU-challenge | [
"08401bfde9bcb1abcb32ef060e89b8c135e7f3f1"
] | [
"mmdet/datasets/custom.py"
] | [
"import os.path as osp\n\nimport mmcv\nimport numpy as np\nfrom torch.utils.data import Dataset\n\nfrom mmdet.core import eval_map, eval_recalls\nfrom .builder import DATASETS\nfrom .pipelines import Compose\n\n\n@DATASETS.register_module()\nclass CustomDataset(Dataset):\n \"\"\"Custom dataset for detection.\n\n... | [
[
"numpy.where",
"numpy.random.choice"
]
] |
vanillagorillaa/rednose | [
"7e41d39b71f7888875a2fbf9cea770eabe0a8128"
] | [
"examples/live_kf.py"
] | [
"#!/usr/bin/env python3\nimport sys\nimport numpy as np\nimport sympy as sp\n\nfrom rednose.helpers import KalmanError\nfrom rednose.helpers.ekf_sym import EKF_sym, gen_code\nfrom rednose.helpers.sympy_helpers import (euler_rotate, quat_matrix_r, quat_rotate)\n\nEARTH_GM = 3.986005e14 # m^3/s^2 (gravitational cons... | [
[
"numpy.eye",
"numpy.ones",
"numpy.atleast_2d",
"numpy.zeros",
"numpy.diag",
"numpy.array",
"numpy.linalg.norm"
]
] |
ATMOcanes/tropycal | [
"10cad2e4ff5b9cb1949d315cb328878306a65a74"
] | [
"src/tropycal/recon/dataset.py"
] | [
"import os\nimport numpy as np\nfrom datetime import datetime as dt,timedelta\nimport pandas as pd\nimport requests\nimport pickle\n\nfrom scipy.interpolate import interp1d\nfrom scipy.ndimage import gaussian_filter as gfilt,gaussian_filter1d as gfilt1d\nfrom scipy.ndimage.filters import minimum_filter\nimport matp... | [
[
"scipy.interpolate.interp1d",
"matplotlib.colors.BoundaryNorm",
"numpy.isfinite",
"pandas.DataFrame.from_dict",
"matplotlib.pyplot.figure",
"pandas.to_datetime",
"matplotlib.dates.date2num",
"scipy.ndimage.gaussian_filter1d",
"matplotlib.dates.DateFormatter",
"pandas.concat... |
abditag2/DCGAN-tensorflow | [
"432b0d91bd8252c48869c205b86701993eb37618"
] | [
"utils.py"
] | [
"\"\"\"\nSome codes from https://github.com/Newmu/dcgan_code\n\"\"\"\nfrom __future__ import division\n\nimport math\nimport pprint\nimport random\nfrom time import gmtime, strftime\n\nimport numpy as np\nimport scipy.misc\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\nfrom six.moves import xrang... | [
[
"numpy.random.uniform",
"numpy.tile",
"numpy.zeros",
"numpy.random.choice",
"tensorflow.trainable_variables",
"tensorflow.contrib.slim.model_analyzer.analyze_vars",
"numpy.arange",
"numpy.array"
]
] |
scikit-spark/scikit-spark | [
"1b1291f14ce0c18d7ea358fe25687649a5b74ecd"
] | [
"python/test/sklearn_version_specific_utils.py"
] | [
"import sklearn\n\n\ndef sklearn_version_is(version):\n if sklearn.__version__.startswith(version):\n return True\n return False\n\n\ndef sklearn_is_at_least(version):\n if sklearn.__version__ >= version:\n return True\n return False\n\n\ndef get_refactored_tests_to_skip():\n \"\"\"Thes... | [
[
"sklearn.__version__.startswith"
]
] |
SIOS-Svalbard/darwinsheet | [
"7ac85861156ca195c8a3563df0f08a141d805384"
] | [
"scripts/get_niskin_data.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jul 21 08:24:22 2021\n\n@author: lukem\n\"\"\"\n\nimport pandas as pd\nimport os\nimport sys\nimport re\nimport uuid\nimport requests\n\nimport os.path\naen_config_dir = (os.path.abspath(\n os.path.join(os.path.dirname(__file__), '..')))\n\... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
NihalHarish/datasets | [
"67574a8d74796bc065a8b9b49ec02f7b1200c172"
] | [
"src/datasets/utils/py_utils.py"
] | [
"# coding=utf-8\n# Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.o... | [
[
"numpy.array"
]
] |
zhaogev5/BBAVectors-Oriented-Object-Detection | [
"b9e86404082761dd49a652670898f6d3a98c30aa"
] | [
"DOTA_devkit/DOTA.py"
] | [
"#The code is used for visulization, inspired from cocoapi\n# Licensed under the Simplified BSD License [see bsd.txt]\n\nimport os\nimport matplotlib.pyplot as plt\nfrom matplotlib.collections import PatchCollection\nfrom matplotlib.patches import Polygon, Circle\nimport numpy as np\nimport dota_utils as util\nfro... | [
[
"matplotlib.pyplot.cla",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.savefig",
"numpy.random.random",
"matplotlib.pyplot.imshow",
"matplotlib.patches.Circle",
"matplotlib.patches.Polygon",
"matplotlib.collections.PatchCo... |
mojones/pandas | [
"3d4f9dc19d784526f71a197bfb6e36b0409e0760"
] | [
"pandas/core/array_algos/transforms.py"
] | [
"\"\"\"\ntransforms.py is for shape-preserving functions.\n\"\"\"\n\nimport numpy as np\n\nfrom pandas.core.dtypes.common import ensure_platform_int\n\n\ndef shift(values: np.ndarray, periods: int, axis: int, fill_value) -> np.ndarray:\n new_values = values\n\n # make sure array sent to np.roll is c_contiguou... | [
[
"pandas.core.dtypes.common.ensure_platform_int",
"numpy.prod"
]
] |
sandialabs/Spitfire | [
"65670e3ba5d1ccb4ac72524b77957706345c5bf6"
] | [
"tests/tabulation/adiabatic_slfm/rebless.py"
] | [
"from os.path import abspath, join\n\n\ndef run():\n from spitfire.chemistry.mechanism import ChemicalMechanismSpec\n from spitfire.chemistry.tabulation import build_adiabatic_slfm_library\n import spitfire.chemistry.analysis as sca\n import numpy as np\n\n test_xml = abspath(join('tests', 'test_mech... | [
[
"numpy.logspace"
]
] |
me-grimjoww/Covid-Sutra | [
"ef07bf61ae3b1adc19affe5e040a9ba2f06fb5a8"
] | [
"Django_mask_attendance/main_base/face_verification.py"
] | [
" \r\nimport os\r\nfrom django.urls import path, include\r\nimport face_recognition\r\nimport cv2\r\nfrom imutils.video import VideoStream\r\nimport imutils\r\nimport numpy as np\r\nfrom tensorflow.keras.models import load_model\r\nfrom tensorflow.keras.applications.mobilenet_v2 import preprocess_input\r\nfrom tens... | [
[
"numpy.array",
"tensorflow.keras.preprocessing.image.img_to_array",
"tensorflow.keras.models.load_model",
"tensorflow.keras.applications.mobilenet_v2.preprocess_input"
]
] |
fgulan/masters-seminar | [
"cd14b305170fa619dc6e6cc9661fa213822e4faa"
] | [
"source/clcd.py"
] | [
"import sys\nimport cro_mapper\nimport os\nimport unicodedata\nimport numpy as np\nfrom scipy import misc\n\ndef _get_all_file_paths(path):\n file_paths = []\n for root, dirs, files in os.walk(path):\n for file_ in files:\n full_path = os.path.join(root, file_)\n if os.path.isfile... | [
[
"scipy.misc.imread",
"numpy.asarray"
]
] |
Praveenstein/bigGanMicro | [
"d669874c0226907fa41b2140cdc8c46bdef2a283"
] | [
"app/gan_app.py"
] | [
"import numpy as np\nimport os\nimport json\nfrom PIL import Image\nimport pickle\nimport streamlit as st\nfrom streamlit.hashing import _CodeHasher\nfrom streamlit.report_thread import get_report_ctx\nfrom streamlit.server.server import Server\nimport sys\nimport urllib\nimport torch\nimport random\nimport biggan\... | [
[
"torch.no_grad",
"torch.tensor",
"numpy.random.RandomState",
"numpy.array",
"torch.device"
]
] |
shivachawala/PumpItUp | [
"41c8f3be0808009dbd13fda7a6f6f1ebfd916646"
] | [
"Code/Final/GridSearch/SVM.py"
] | [
"\n# coding: utf-8\n\n# In[ ]:\n\n\n#[GridSearch] SVM Learning Classification\nimport pandas as pd\nimport numpy as np\nimport sys\n# Read dataset\ndata_values = pd.read_csv(\"../../../Datasets/train_values_processed.csv\")\ndata_labels = data_values[\"status_group\"]\ndata_values.drop(['status_group'], axis=1, inp... | [
[
"sklearn.svm.SVC",
"sklearn.metrics.classification_report",
"pandas.read_csv",
"sklearn.metrics.confusion_matrix",
"sklearn.model_selection.GridSearchCV",
"sklearn.model_selection.train_test_split"
]
] |
maskjp/mmdetection3d | [
"98f332372b1a4c82bc2d57588a5d764f4176c869"
] | [
"mmdet3d/datasets/lyft_dataset.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport os\nimport tempfile\nfrom os import path as osp\n\nimport mmcv\nimport numpy as np\nimport pandas as pd\nfrom lyft_dataset_sdk.lyftdataset import LyftDataset as Lyft\nfrom lyft_dataset_sdk.utils.data_classes import Box as LyftBox\nfrom pyquaternion import Qua... | [
[
"numpy.eye",
"numpy.linalg.inv",
"pandas.read_csv",
"pandas.DataFrame",
"numpy.array",
"numpy.concatenate"
]
] |
Martin36/FEVER2021_SharedTask | [
"4dd49e0ddf2909a93d44dab22eae988a067fc355"
] | [
"src/entailment/entailment_with_t5.py"
] | [
"import argparse\nfrom collections import defaultdict\nimport torch\n\nfrom transformers import T5ForConditionalGeneration, T5Tokenizer\nfrom tqdm import tqdm\nfrom util.util_funcs import load_jsonl\n\nmodel = T5ForConditionalGeneration.from_pretrained(\"t5-small\")\ntokenizer = T5Tokenizer.from_pretrained(\"t5-sma... | [
[
"torch.squeeze"
]
] |
wangyum/anaconda | [
"6e5a0dbead3327661d73a61e85414cf92aa52be6"
] | [
"pkgs/statsmodels-0.6.1-np110py27_0/lib/python2.7/site-packages/statsmodels/emplike/aft_el.py"
] | [
"\"\"\"\n\nAccelerated Failure Time (AFT) Model with empirical likelihood inference.\n\nAFT regression analysis is applicable when the researcher has access\nto a randomly right censored dependent variable, a matrix of exogenous\nvariables and an indicatior variable (delta) that takes a value of 0 if the\nobservati... | [
[
"numpy.sum",
"numpy.asarray",
"numpy.int_",
"numpy.copy",
"numpy.log",
"numpy.abs",
"numpy.delete",
"scipy.optimize.fmin",
"numpy.where",
"numpy.zeros",
"scipy.stats.chi2.ppf",
"numpy.lexsort",
"numpy.cumprod",
"numpy.arange",
"numpy.cumsum",
"scipy.... |
mberaha/ProjectedWasserstein | [
"20d19fc49f20124762eb497031cba0918b5eaadb"
] | [
"pwass/regression/simplicial.py"
] | [
"import numpy as np\nfrom sklearn.base import BaseEstimator\n\nfrom pwass.spline import SplineBasis\nfrom pwass.distributions import Distribution\n\n\nclass SimpliciadDistribOnDistrib(BaseEstimator):\n def __init__(self, fit_intercept=True, nbasis=-1, spline_basis=None,\n compute_spline=True):\n ... | [
[
"numpy.zeros_like",
"numpy.matmul",
"numpy.sum",
"numpy.ones"
]
] |
Ursinus-IDS301-S2020/Week9Class | [
"c8173f9f793fedb1cee6e71d272282766861a8eb"
] | [
"ClassMDS.py"
] | [
"\"\"\"\nPurpose: To show how to use \"Multidimensional Scaling\" (MDS)\nto find a set of coordinates in 2D that best respect a matrix.\n\nIn this particular example, students gave a distance matrix\nwhere they expressed how similar they thought different majors \nwere to each other. This code loops through all st... | [
[
"matplotlib.pyplot.scatter",
"sklearn.manifold.MDS",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"numpy.max",
"matplotlib.pypl... |
HiramHerrera/desisim | [
"3ae76e4c921f72b71ff7522462740e904136f428"
] | [
"etc/sim_quercus/mpi_newexp_random.py"
] | [
"\nfrom mpi4py import MPI\n\nimport sys\nimport os\nimport argparse\nimport traceback\n\nimport numpy as np\n\nfrom desispec.util import option_list\n\nfrom desispec.parallel import stdouterr_redirected\n\nfrom desisim import obs\n\nimport desisim.scripts.newexp_random as newexp\n\n\nflavors = ['arc', 'arc', 'arc',... | [
[
"numpy.random.randint",
"numpy.random.seed"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.