repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
asarvi/aspect-extraction | [
"b34f9917fc311b2d9e5ae99bb24a7d935c1c0260"
] | [
"recommender.py"
] | [
"\nfrom aspectEx import aspectExtractor\nimport random\nimport tensorflow as tf\n\n#a counter for list\ndef countX(lst, x):\n count = 0\n\n for ele in lst:\n if (ele == x):\n count = count + 1\n return count\n\n#function for search in list\ndef listContains(list , object):\n j =0\n ... | [
[
"tensorflow.reset_default_graph"
]
] |
dimartinot/Text-Semantic-Similarity | [
"f9bdc80027151a85505ba812a7cea537de35fc1a"
] | [
"src/main.py"
] | [
"import os\nimport sys\n# Ignore warnings\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\n# Used to import libraries from an absolute path starting with the project's root\nmodule_path = os.path.abspath(os.path.join('../'))\nif module_path not in sys.path:\n sys.path.append(module_path)\n\nfrom PIL impo... | [
[
"torch.zeros",
"numpy.ceil",
"torch.cat",
"torch.stack",
"torch.utils.data.dataloader.DataLoader",
"numpy.array",
"numpy.random.seed",
"torch.FloatTensor",
"torch.no_grad",
"numpy.random.shuffle",
"torch.manual_seed",
"sklearn.linear_model.LogisticRegression",
"... |
jeejakp12/pytorch | [
"043cf1f9c746b4dda2c404ba6c76c6ccad5e2cbe",
"043cf1f9c746b4dda2c404ba6c76c6ccad5e2cbe"
] | [
"test/onnx/test_pytorch_onnx_caffe2.py",
"torch/ao/quantization/fx/qconfig_utils.py"
] | [
"# Owner(s): [\"module: onnx\"]\n\nimport io\nimport itertools\nimport sys\nimport unittest\nfrom typing import Tuple\n\nimport model_defs.dcgan as dcgan\nimport model_defs.word_language_model as word_language_model\nimport numpy as np\nimport onnx\nimport verify\nfrom debug_embed_params import run_embed_params\nfr... | [
[
"torch.ops._caffe2.BoxWithNMSLimit",
"numpy.random.rand",
"torch.nn.MaxPool3d",
"torch.nn.AdaptiveAvgPool1d",
"torch.nn.MaxPool1d",
"torch.nn.AvgPool2d",
"torch.nn.ConvTranspose2d",
"torch.tensor",
"torch.cuda.manual_seed_all",
"torch.min",
"torch.nn.ReplicationPad2d",
... |
aijournal/generative-models | [
"afc900bc9d796e4e2a964a4b280d5b1cafd55507"
] | [
"gans.py"
] | [
"from __future__ import print_function, division\nimport tensorflow as tf\nimport numpy as np\n\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\n\nget_ipython().run_line_magic('matplotlib', 'inline')\nplt.rcParams['figure.figsize'] = (10.0, 8.0) \nplt.rcParams['image.interpolation'] = 'near... | [
[
"numpy.array_equal",
"tensorflow.ones_like",
"numpy.load",
"tensorflow.ones",
"tensorflow.global_variables_initializer",
"tensorflow.random_uniform",
"tensorflow.global_variables",
"tensorflow.ConfigProto",
"tensorflow.variable_scope",
"tensorflow.constant",
"numpy.sqrt... |
Guangyun-Xu/mmdetection3d | [
"75c5c6cd590386bd1539a686c5fd2cc45c5480d5"
] | [
"tests/test_utils/test_merge_augs.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport mmcv\nimport pytest\nimport torch\n\nfrom mmdet3d.core import merge_aug_bboxes_3d\nfrom mmdet3d.core.bbox import DepthInstance3DBoxes\n\n\ndef test_merge_aug_bboxes_3d():\n if not torch.cuda.is_available():\n pytest.skip('test requires GPU and torch... | [
[
"torch.allclose",
"torch.all",
"torch.cuda.is_available",
"torch.tensor"
]
] |
brianlorenz/COSMOS_IMACS_Redshifts | [
"d8cb4fcd9c9b920f0b837806bed415053db4817d"
] | [
"PlotCodes/Plot_O32_R23.py"
] | [
"#Creates an R23 diagram - see Kewley and Ellison (2008)\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom astropy.io import ascii\nimport sys, os, string\nimport pandas as pd\nfrom astropy.io import fits\nimport collections\n\n#Folder to save the figures\nfigout = '/Users/blorenz/COSMOS/Reports/2018/Ima... | [
[
"numpy.logical_not",
"numpy.log",
"numpy.not_equal",
"pandas.DataFrame",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"numpy.where",
"numpy.logical_or.reduce",
"numpy.logical_and.reduce"
]
] |
oscii-lab/tagger | [
"d22980c8b518fb7c4c48682a8086e07ced292e5b"
] | [
"tagger.py"
] | [
"# Part-of-speech tagger\n\nimport itertools\nimport functools\nimport json\nimport os\nimport shutil\nimport sys\nfrom datetime import datetime\n\nfrom argparse import ArgumentParser\nimport numpy as np\nnp.random.seed(1337) # for reproducibility\nimport tensorflow as tf\n\nfrom keras.preprocessing import sequenc... | [
[
"numpy.random.seed",
"numpy.append"
]
] |
DocBO/mubosym | [
"31776d95a2ce683aea3585769e935402f1f14a5f"
] | [
"mubosym/interp1d_interface.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat May 16 18:33:20 2015\n\n@author: oliver\n\"\"\"\n\nfrom sympy import symbols, lambdify, sign, re, acos, asin, sin, cos, bspline_basis\nfrom matplotlib import pyplot as plt\nfrom scipy.interpolate import interp1d\n\nimport numpy as np\n\n\ndef read_kl(filename):\n ... | [
[
"matplotlib.pyplot.show",
"scipy.interpolate.interp1d",
"matplotlib.pyplot.plot",
"numpy.linspace"
]
] |
akuhnregnier/wildfires | [
"4d31cbdd4a1303ecebc391a35c73b8f07d8fe400"
] | [
"tests/test_climatology.py"
] | [
"# -*- coding: utf-8 -*-\nimport iris\nimport numpy as np\nfrom numpy.testing import assert_allclose\n\nfrom wildfires.data.datasets import MonthlyDataset, dummy_lat_lon_cube\n\n\nclass DummyDataset(MonthlyDataset):\n \"\"\"Dataset with repeating (time axis) data.\"\"\"\n\n def __init__(self):\n np.ran... | [
[
"numpy.random.seed",
"numpy.random.random",
"numpy.roll"
]
] |
AllenDowney/ElementsOfDataScienceBook | [
"52c5b9f407e346990f9ebd4b0fd2abb098fc5ec8"
] | [
"convert/utils.py"
] | [
"\"\"\"\nPart of a [Recidivism Case Study](https://allendowney.github.io/RecidivismCaseStudy/)\n\nby [Allen Downey](https://allendowney.com)\n\n[Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)](https://creativecommons.org/licenses/by-nc/4.0/)\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport mat... | [
[
"numpy.array",
"scipy.interpolate.interp1d",
"scipy.integrate.simps",
"pandas.crosstab",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"numpy.linspace",
"numpy.where",
"matplotlib.pyplot.tight_layout",
"pandas.Series",
"matplotlib.pyplot.gca"
]
] |
UW-Advanced-Robotics-Lab/densefusion | [
"8784af40a954421dab9c9648f2d6a739de4c706c",
"8784af40a954421dab9c9648f2d6a739de4c706c"
] | [
"datasets/arl_affpose/dataset_aff.py",
"affpose/YCB_Aff/dataset/test_dataloader.py"
] | [
"import torch.utils.data as data\nfrom PIL import Image\nimport os\nimport os.path\nimport torch\nimport numpy as np\nimport torchvision.transforms as transforms\nimport argparse\nimport time\nimport random\nfrom lib.transformations import quaternion_from_euler, euler_matrix, random_quaternion, quaternion_matrix\ni... | [
[
"numpy.concatenate",
"numpy.random.normal",
"numpy.array",
"numpy.dot",
"numpy.delete",
"numpy.add",
"numpy.ma.masked_not_equal",
"scipy.io.loadmat",
"numpy.str",
"numpy.random.shuffle",
"numpy.ma.masked_equal",
"numpy.transpose",
"numpy.repeat",
"numpy.uniq... |
devinpleuler/mplsoccer | [
"c9d4afd6a7caba82a247710f8b2fa54e7e7e9dae"
] | [
"mplsoccer/_pitch_base.py"
] | [
"\"\"\" Base class for drawing the soccer/ football pitch.\"\"\"\n\nimport warnings\nfrom abc import ABC, abstractmethod\nfrom collections import namedtuple\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib import rcParams\n\nfrom mplsoccer import dimensions\nfrom mplsoccer.cm import grass_cma... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.tile",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.arctan",
"numpy.abs",
"numpy.repeat",
"numpy.insert"
]
] |
moinnabi/acl2019-commonsense | [
"0dab6ac8cb58ba724a4b091172656b922dafc740"
] | [
"MAS.py"
] | [
"import numpy as np\nimport torch\n\ndef format_attention(attention):\n squeezed = []\n for layer_attention in attention:\n # 1 x num_heads x seq_len x seq_len\n if len(layer_attention.shape) != 4:\n raise ValueError(\"The attention tensor does not have the correct number of dimension... | [
[
"torch.zeros",
"torch.stack"
]
] |
irshadbhat/wikiHow_MoRR | [
"ae4ad7d00c9fcf2f8ae2238c784e4413794650b3"
] | [
"predicting_revision_requirements/lstm_classifier.py"
] | [
"from __future__ import unicode_literals\n\nimport dynet_config\n#dynet_config.set(random_seed=127, autobatch=1)\n\nimport io\nimport re\nimport sys\nimport time\nimport random\nimport pickle\n\nfrom argparse import ArgumentParser\nfrom collections import Counter, defaultdict\nfrom sklearn.metrics import f1_score\n... | [
[
"numpy.zeros",
"numpy.random.seed",
"sklearn.metrics.classification_report",
"numpy.argmax",
"sklearn.metrics.f1_score"
]
] |
davisyoshida/transformers | [
"794889f0aea28df30efe9d35358ed8cf335cc2f3"
] | [
"transformers/modeling_tf_distilbert.py"
] | [
"# coding=utf-8\n# Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, Inc.\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:/... | [
[
"tensorflow.range",
"tensorflow.keras.layers.Activation",
"tensorflow.matmul",
"tensorflow.ones",
"tensorflow.keras.layers.LayerNormalization",
"tensorflow.reshape",
"tensorflow.keras.layers.Dropout",
"tensorflow.transpose",
"tensorflow.squeeze",
"tensorflow.name_scope",
... |
netdrones/ml-agents | [
"7d7d6f149c92ea2067d7cea364d92c8c3b8db3f4"
] | [
"ml-agents/mlagents/trainers/policy/policy.py"
] | [
"from abc import abstractmethod\nfrom typing import Dict, List, Optional\nimport numpy as np\n\nfrom mlagents_envs.base_env import ActionTuple, BehaviorSpec, DecisionSteps\nfrom mlagents_envs.exception import UnityException\n\nfrom mlagents.trainers.action_info import ActionInfo\nfrom mlagents.trainers.settings imp... | [
[
"numpy.sum",
"numpy.isnan",
"numpy.zeros"
]
] |
haoxintong/byteps | [
"495f1372af5f6fd4832393d5e52d4b02b42a7a03"
] | [
"example/tensorflow/tensorflow_mnist.py"
] | [
"#!/usr/bin/env python\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 agreed to in w... | [
[
"tensorflow.logging.set_verbosity",
"numpy.reshape",
"tensorflow.train.LoggingTensorHook",
"tensorflow.argmax",
"tensorflow.losses.softmax_cross_entropy",
"tensorflow.reshape",
"tensorflow.ConfigProto",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"tensorflow.name... |
ysl0/dcgan-completion.tensorflow-master | [
"7d31d427bbc5054a925eb66ab6bfba36bd5f4146"
] | [
"ckpt.py"
] | [
"import tensorflow as tf\nimport os\n\nlogdir='./checkpoint/'\n\nfrom tensorflow.python import pywrap_tensorflow\n# checkpoint_path = os.path.join(model_dir, \"model.ckpt-9999\")\nckpt = tf.train.get_checkpoint_state(logdir)\nreader = pywrap_tensorflow.NewCheckpointReader(ckpt.model_checkpoint_path)\nvar_to_shape_m... | [
[
"tensorflow.train.get_checkpoint_state",
"tensorflow.python.pywrap_tensorflow.NewCheckpointReader"
]
] |
shixiongjing/DeepRobust | [
"276a7048aded2cf3a190d3851ffd4587b7d1dd49"
] | [
"deeprobust/graph/rl/q_net_node.py"
] | [
"'''\n Adversarial Attacks on Neural Networks for Graph Data. ICML 2018.\n https://arxiv.org/abs/1806.02371\n Author's Implementation\n https://github.com/Hanjun-Dai/graph_adversarial_attack\n This part of code is adopted from the author's implementation (Copyright (c) 2018 Dai, Hanjun and Li,... | [
[
"torch.nn.Linear",
"torch.Size",
"torch.cat",
"torch.nn.ModuleList",
"torch.max",
"torch.ones",
"torch.mm",
"torch.nn.functional.relu",
"torch.mean",
"torch.LongTensor",
"numpy.sqrt",
"torch.spmm",
"torch.Tensor",
"torch.set_grad_enabled"
]
] |
xupei0610/nvidia-end-to-end-self-driving-car | [
"389c8bd99e66805f1bb145559c8ed6b2a68ace03"
] | [
"sim.py"
] | [
"#!/usr/bin/env python3\n\nimport tensorflow as tf\n\nfrom drive import Simulator, PIController\nimport model\nimport config\nfrom utils import *\n\nif __name__ == \"__main__\":\n\n X, keep_prob, pred = model.build_net(trainable=False)\n sess = tf.Session()\n sess.run(tf.global_variables_initializer())\n ... | [
[
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.train.get_checkpoint_state",
"tensorflow.global_variables_initializer"
]
] |
kozistr/rcan-tensorflow | [
"e2d8d61dfbfb64f93cd455d3ca813dc4381d4226"
] | [
"model.py"
] | [
"import metric\nimport tfutil as tfu\n\nimport numpy as np\nimport tensorflow as tf\n\n\nclass RCAN:\n\n def __init__(self,\n sess, # tensorflow session\n batch_size=16, # batch size\n n_channel=3, ... | [
[
"tensorflow.clip_by_value",
"tensorflow.identity",
"tensorflow.layers.BatchNormalization",
"tensorflow.concat",
"tensorflow.Variable",
"tensorflow.train.Saver",
"tensorflow.constant",
"tensorflow.variable_scope",
"tensorflow.split",
"tensorflow.nn.sigmoid",
"tensorflow.... |
Bsingstad/FYS-STK4155-oblig2 | [
"81a587e3a64dd8f7ff1ca5868c09db2d4dccf896"
] | [
"Scripts/NeuralNetwork.py"
] | [
"import numpy as np\nfrom IPython.display import clear_output\nimport matplotlib.pyplot as plt\n\n\nclass Layer:\n \n #A building block. Each layer is capable of performing two things:\n #- Process input to get output: output = layer.forward(input)\n \n #- Propagate gradients through itself... | [
[
"numpy.dot",
"numpy.random.choice",
"numpy.exp",
"numpy.mean",
"numpy.zeros_like",
"numpy.eye",
"numpy.argmax",
"numpy.arange",
"numpy.sqrt",
"numpy.matmul",
"numpy.zeros",
"numpy.random.randn",
"numpy.shape",
"matplotlib.pyplot.show",
"numpy.sum",
"... |
batu/incubator | [
"11f0f60de24102af4356c9738cbb9793ea6aa334"
] | [
"entity_gym/entity_gym/examples/cherry_pick.py"
] | [
"from dataclasses import dataclass, field\nimport numpy as np\nfrom typing import Dict, List, Mapping\n\nfrom entity_gym.environment import (\n DenseSelectEntityActionMask,\n Entity,\n EntityID,\n Environment,\n EpisodeStats,\n ObsSpace,\n SelectEntityAction,\n SelectEntityActionSpace,\n ... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.zeros"
]
] |
AndreasAlbert/dm_functions | [
"05a84c496d511e5073f51ec6fdb85cdc2482bb9f"
] | [
"dmsimp/mediator_width.py"
] | [
"\"\"\"\nCollection of functions for the calculation of DMsimp mediator width.\n\nAll functions are obtained from the LHC DMWG report:\n\nhttps://arxiv.org/abs/1703.05703\n\nPlease cite accordingly.\n\"\"\"\n\n\nfrom __future__ import division\nimport math\nimport numpy as np\n\n# Quark and lepton masses are consta... | [
[
"numpy.complex",
"numpy.sqrt"
]
] |
ziranl16/UROP_KMTE | [
"537606277544716699f708f51b6d9461695cf259"
] | [
"time_proj.py"
] | [
"from models import *\nfrom helper import *\nfrom random import *\nfrom pprint import pprint\nimport pandas as pd\nimport scipy.sparse as sp\nimport uuid, sys, os, time, argparse\nimport pickle, pdb, operator, random, sys\nimport tensorflow as tf\nfrom collections import defaultdict as ddict\nfrom sklearn.metrics i... | [
[
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.nn.embedding_lookup",
"tensorflow.tile",
"tensorflow.global_variables_initializer",
"tensorflow.set_random_seed",
"pandas.DataFrame",
"tensorflow.train.Saver",
"tensorflow.ConfigProto",
"tensorflow.constant",
"tens... |
lyubov888L/stellargraph | [
"cc15f176c6658d122d30cf7af3e08d3e139b3974"
] | [
"tests/mapper/test_padded_graph_generator.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# Copyright 2020 Data61, CSIRO\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 ... | [
[
"numpy.allclose",
"numpy.array",
"numpy.sum",
"numpy.fill_diagonal"
]
] |
viclafargue/cugraph | [
"1a636029db9cafcbb746837ac21ff1c30d1bc479"
] | [
"python/cugraph/tests/test_hypergraph.py"
] | [
"# Copyright (c) 2020-2021, NVIDIA CORPORATION.\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... | [
[
"pandas.DataFrame",
"pandas.Timestamp"
]
] |
Andrew1021/Comparison-QRS-Detectors | [
"6f77b7aa6b48fc79c5aa62f2546cbfb0a794ab9d"
] | [
"comparison_qrs_detectors/comparison_qrs_detectors/test_preprocess.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\ncomparison_qrs_detectors\r\n-------\r\nA toolbox for comparison of the Pan-Tompkins, Engelse-Zeelenberg and Christov QRS detector written in Python.\r\n:copyright: (c) 2021 by Open Innovation Lab\r\n:license: BSD 3-clause, see LICENSE for more details.\r\n\"\"\"\r\nimport trace... | [
[
"numpy.array",
"pandas.set_option",
"numpy.set_printoptions",
"pandas.Series",
"numpy.linspace"
]
] |
collector-m/BtcDet | [
"80bee34f2f40931600f812a6edbcb27e51cb7ec3"
] | [
"btcdet/datasets/finddiff.py"
] | [
"import copy\nimport pickle\nimport sys\nfrom pathlib import Path\nfrom sklearn.cluster import KMeans, DBSCAN\nimport numpy as np\nfrom skimage import io\nimport mayavi.mlab as mlab\nimport os\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"2\"\nfrom ..ops.roiaware_pool3d import roiaware_pool3d_utils\nfrom ..utils import... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros"
]
] |
stefantaubert/life | [
"14fe8c0d631eb22f6c3f9e41430dbcfcd1718012"
] | [
"geo/analysis/group_analysis.py"
] | [
"import pandas as pd\nimport numpy as np\nimport data_paths_analysis as data_paths\nfrom tqdm import tqdm\nfrom collections import Counter\nimport os\nimport settings_analysis as settings\nimport math\nimport pickle\nimport SimilarSpeciesExtractor\nimport networkx as nx\nimport matplotlib.pyplot as plt\nimport main... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.pie",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure"
]
] |
monte-flora/wofs_ml_severe | [
"2a7b59578b5039b88ad537a325eafc89d4339e54"
] | [
"wofs_ml_severe/utils/get_model_object.py"
] | [
"from sklearn.linear_model import LogisticRegression\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.ensemble import GradientBoostingClassifier\nfrom sklearn.calibration import CalibratedClassifierCV\nfrom xgboost import XGBClassifier\n\n\"\"\"\nimport keras\nfrom keras.models import Model, save_... | [
[
"sklearn.utils.check_X_y",
"sklearn.calibration.CalibratedClassifierCV",
"numpy.zeros",
"sklearn.utils.indexable",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.linear_model.LogisticRegression",
"sklearn.utils.check_array",
"sklearn.preprocessing.LabelBinarizer",
"sklearn... |
NiWaRe/PySyft | [
"b5abe66ea949d60be14a08d2e4e32e9587c7bf5c",
"b5abe66ea949d60be14a08d2e4e32e9587c7bf5c"
] | [
"test/serde/serde_helpers.py",
"syft/frameworks/torch/tensors/interpreters/native.py"
] | [
"from collections import OrderedDict\nimport numpy\nimport torch\nimport traceback\nimport io\n\nimport syft\nfrom syft.serde import msgpack\nfrom syft.workers.virtual import VirtualWorker\nfrom syft.generic.abstract.syft_serializable import SyftSerializable\nfrom syft.execution.translation.torchscript import PlanT... | [
[
"torch.Size",
"torch.device",
"torch.rand",
"numpy.array",
"numpy.array_equal",
"torch.nn.Linear",
"torch.save",
"torch.nn.functional.log_softmax",
"torch.abs",
"torch.tensor",
"numpy.random.random",
"torch.Tensor",
"torch.randn"
],
[
"torch.no_grad",
... |
Namburger/edge-security | [
"a77cbc4c1068ac5cbb44e5a13800445bd93784be"
] | [
"camera/camera.py"
] | [
"import cv2\nimport numpy as np\n\nclass VideoCamera(object):\n def __init__(self, src, threshold, label_path, detector):\n self.id = src\n self.camera = cv2.VideoCapture(self.id)\n self.threshold = threshold\n self.labels = self.load_label(label_path)\n self.detector = detecto... | [
[
"numpy.expand_dims"
]
] |
Louise-LuLin/DeepRobust | [
"a91b2d321f45cd7b24873220bd62a60911829d2c"
] | [
"deeprobust/graph/global_attack/spectral_attack.py"
] | [
"\"\"\"\nOur attacking based on spectral of graph Laplacian\n\n\"\"\"\n\nimport numpy as np\nimport scipy.sparse as sp\nimport torch\nfrom torch import optim\nfrom torch.nn import functional as F\nfrom torch.nn.parameter import Parameter\nfrom tqdm import tqdm\n\nfrom deeprobust.graph import utils\nfrom deeprobust.... | [
[
"torch.zeros",
"scipy.sparse.issparse",
"torch.symeig",
"numpy.random.binomial",
"torch.no_grad",
"torch.tril_indices",
"torch.clamp",
"torch.nn.functional.mse_loss",
"torch.autograd.grad",
"torch.tensor",
"torch.eye",
"numpy.sqrt",
"torch.ones_like",
"torch... |
norikinishida/DiscourseConstituencyInduction--ViterbiEM | [
"588eee5626dfa5bdd9a24a2dbefa555d1bc36b8f"
] | [
"src/models/spanbasedmodel.py"
] | [
"import numpy as np\nimport chainer\nimport chainer.functions as F\nimport chainer.links as L\n\nimport utils\n\nclass SpanBasedModel(chainer.Chain):\n\n def __init__(self,\n vocab_word,\n vocab_postag,\n vocab_deprel,\n word_dim,\n ... | [
[
"numpy.ones",
"numpy.asarray"
]
] |
SajawalChopra/Facebook-Scraping | [
"089dfd84a7caa255de75b3733deed5a1e3f10543"
] | [
"3 Facebook scraping.py"
] | [
"from bs4 import BeautifulSoup as Bs4\r\nfrom time import sleep\r\nfrom selenium import webdriver\r\nfrom selenium.webdriver.common.keys import Keys\r\nimport pandas as pd\r\n\r\ndef scroll(driver, timeout):\r\n scroll_pause_time = timeout\r\n\r\n # Get scroll height\r\n last_height = driver.execute_script... | [
[
"pandas.DataFrame"
]
] |
tjczec01/micro | [
"320e2375f5730b06373724b3b6153e95148816de"
] | [
"HW 2 Clean B.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sat Sep 11 06:10:39 2021\r\n\r\n@author: tjczec01@gmail.com\r\n\r\n\r\n\"\"\"\r\n\r\nimport math as mt\r\nimport numpy as np\r\nimport matplotlib.pylab as plt\r\nimport os\r\nimport IPython\r\nfrom IPython.display import display, Latex\r\nfrom scipy.constants import ... | [
[
"numpy.array",
"matplotlib.pylab.ylabel",
"matplotlib.pylab.ioff",
"matplotlib.pylab.legend",
"matplotlib.pylab.close",
"matplotlib.pylab.grid",
"matplotlib.pylab.show",
"matplotlib.pylab.figure",
"numpy.exp",
"matplotlib.pylab.xlabel",
"numpy.linspace",
"numpy.aran... |
MengLcool/RefineMask | [
"75be6fccfe64c3d3f82fad2056acf194df461ac1"
] | [
"tools/test.py"
] | [
"import argparse\nimport os\n\nimport mmcv\nimport torch\nfrom mmcv import Config, DictAction\nfrom mmcv.parallel import MMDataParallel, MMDistributedDataParallel\nfrom mmcv.runner import get_dist_info, init_dist, load_checkpoint\nfrom tools.fuse_conv_bn import fuse_module\n\nfrom mmdet.apis import multi_gpu_test, ... | [
[
"torch.cuda.current_device"
]
] |
qinzzz/texar-pytorch | [
"d66258a599a291418004170e62864b001b650926",
"d66258a599a291418004170e62864b001b650926"
] | [
"tests/data/data/scalar_data_test.py",
"tests/data/data/data_iterators_test.py"
] | [
"# Copyright 2019 The Texar 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 required... | [
[
"numpy.linspace"
],
[
"torch.device",
"numpy.asarray",
"numpy.testing.assert_array_equal",
"numpy.random.randint",
"torch.tensor",
"numpy.all",
"numpy.linspace"
]
] |
wei2374/model_compression | [
"bf3e9a11396ace3c6845f44f6aa02b38364e2ec8"
] | [
"demo/speechcmd/dataset/kws_util.py"
] | [
"# please find original here https://github.com/mlcommons/tiny/tree/master/v0.5/training/keyword_spotting\n\nimport os\nimport argparse\nimport matplotlib.pyplot as plt\nimport math\nimport tensorflow as tf\nfrom tensorflow import keras\n\n\ndef parse_command():\n parser = argparse.ArgumentParser()\n parser.a... | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.subplot"
]
] |
jesnyder/scraped_guts | [
"aa9fb3adcdbdda6c52e55d52be2c30fdc4b01698"
] | [
"code/python/a0300_targeted_count.py"
] | [
"from bs4 import BeautifulSoup\r\nimport datetime\r\nimport json\r\nimport lxml\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport os\r\nimport pandas as pd\r\nfrom serpapi import GoogleSearch\r\nimport re\r\nimport requests\r\nimport time\r\n\r\n\r\nfrom a0001_admin import clean_dataframe\r\nfrom a... | [
[
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"pandas.read_csv",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.su... |
andrewbowen19/ClusterEclipsingBinaries | [
"e554cb6bb613e0d3703314e50fcf5289f50bf572"
] | [
"code/old/occCorner.py"
] | [
"'''\nQuick & dirty corner script for colCrowd scenario\n'''\n\nimport corner\nimport numpy as np\nimport pandas as pd\nimport matplotlib\n# matplotlib.use('Agg') # uncomment if running on Quest\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nimport matplotlib.colors as colors\nimport os\n\ndef corner... | [
[
"pandas.read_csv",
"matplotlib.pyplot.close"
]
] |
Avmb/lm-robustness | [
"b5417d9aac01bff0d2a56b506eabed899fd718d4"
] | [
"code/evaluate_rnd_tuned_by_sentence.py"
] | [
"import argparse\r\nimport os, sys\r\nimport time\r\nimport math\r\nimport pickle\r\nimport numpy as np\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom torch.autograd import Variable\r\n\r\nimport gc\r\n\r\nimport data\r\nimport model\r\n\r\nfrom utils import batchify, get_batch,... | [
[
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.no_grad",
"torch.manual_seed",
"torch.scalar_tensor",
"torch.cuda.is_available"
]
] |
5966466/SIMLR-python | [
"0ceb42ea4e766fd1a1bcbb1ee17af369dbc890c9"
] | [
"SIMLR/SIMLR_large_scale.py"
] | [
"import numpy as np\nfrom sklearn.cluster import KMeans\nimport time\nimport sys\nimport warnings\nfrom scipy import sparse\nfrom src import *\nimport pdb\neps = np.finfo(np.double).eps\n\n\ndef SIMLR_large_scale(X, c, k=10, ifimpute=False, normalize=False):\n # the type of X must be np.ndarray or list(double)\n... | [
[
"numpy.max",
"numpy.zeros",
"numpy.sum",
"sklearn.cluster.KMeans",
"numpy.ones",
"numpy.min",
"numpy.mean",
"numpy.nonzero",
"numpy.finfo",
"numpy.arange",
"numpy.abs",
"numpy.mat"
]
] |
RobertLucey/osmnx | [
"8a184bf5580bc848061a7ede23a2695f2bd08fb3"
] | [
"osmnx/elevation.py"
] | [
"\"\"\"Get node elevations and calculate edge grades.\"\"\"\n\nimport multiprocessing as mp\nimport time\nfrom hashlib import sha1\nfrom pathlib import Path\n\nimport networkx as nx\nimport numpy as np\nimport pandas as pd\nimport requests\n\nfrom . import downloader\nfrom . import utils\nfrom . import utils_graph\... | [
[
"pandas.DataFrame",
"numpy.array",
"numpy.abs"
]
] |
icaros-usc/dqd | [
"262c31f56cd4704b76ddaf9b9eb024afdbb209d6"
] | [
"experiments/figures/gen_cdf.py"
] | [
"import pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\nplt.rcParams[\"pdf.fonttype\"] = 42\nplt.rcParams[\"ps.fonttype\"] = 42\n\ndata = pd.read_csv('cdf.csv')\n\ny_label = \"Threshold Percentage\"\n\nplt.figure(figsize = (12,12))\n\n# Color mapping for algorithms\npalette ={\n \"CMA-MEG... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel",
"pandas.read_csv",
"matplotlib.pyplot.xticks"
]
] |
erinxi/chika | [
"570cd8c85da734cf61e035fe6a78627817f99a15"
] | [
"align_video.py"
] | [
"import cv2\nimport glob\nimport numpy\nimport os\nimport skimage.measure\nimport sys\nimport time\n\n# ffmpeg -i \"chika.mp4\" -q:v 1 \"frames/%05d.jpg\"\n# cp frames/00001.jpg frames/00000.jpg\n\nALIGNMENTS = [\n { # 0\n 'mask': [311, 1208, 420, 1730, 622],\n #'tracker': [311, 1010, 616, 1142, 697], too sm... | [
[
"numpy.array",
"numpy.matmul",
"numpy.zeros",
"numpy.append",
"numpy.hstack"
]
] |
lilanyu/biosteam | [
"b025bbe138bfd0b016af58583792fb4f3ff9186e"
] | [
"biosteam/biorefineries/lipidcane/_plot_uncertainty.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Sep 2 01:28:21 2019\n\n@author: yoelr\n\"\"\"\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom biosteam.utils import DoubleColorCircle\nfrom biosteam.evaluation.evaluation_tools import plot_single_points, \\\n plot_montecarlo_acros... | [
[
"matplotlib.lines.Line2D",
"numpy.array",
"matplotlib.pyplot.xlim",
"numpy.asarray",
"matplotlib.pyplot.xlabel",
"pandas.read_excel",
"matplotlib.pyplot.sca",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.figure",
"matplotlib.patches.Patch",
"numpy.arange",
"matplotl... |
poncho6296/k-means-constrained | [
"504d945f3aead1e27c70788c62a89474264ca702"
] | [
"setup.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"\nBased on template: https://github.com/FedericoStra/cython-package-example\n\"\"\"\n\nfrom setuptools import dist, find_packages\n\ndist.Distribution().fetch_build_eggs([\"cython>=0.29\", \"numpy>=1.13\"])\n\nimport os\nfrom setuptools import setup, Extension\n\ntry:\n from nump... | [
[
"numpy.get_include"
]
] |
RaiAnant/Flatland-rl | [
"5d5704458c0f4ee32277f564aa3672e7dfe23f53"
] | [
"src/util/global_graph.py"
] | [
"\"\"\" ###################### EDGE ####################\"\"\"\nimport numpy as np\n\n\nclass g_edge:\n def __init__(self, node1, node2, node1_id, node2_id, traj):\n \"\"\"\n\n :param node1:\n :param node2:\n :param node1_id:\n :param node2_id:\n :param traj:\n \"... | [
[
"numpy.max",
"numpy.count_nonzero",
"numpy.zeros"
]
] |
EmiyaNing/OpenPCDet | [
"41ff28209cb000b51626a0ed8593b0adbe3dd447"
] | [
"pcdet/models/roi_heads/target_assigner/proposal_target_layer.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom ....ops.iou3d_nms import iou3d_nms_utils\n\n\nclass ProposalTargetLayer(nn.Module):\n def __init__(self, roi_sampler_cfg):\n super().__init__()\n self.roi_sampler_cfg = roi_sampler_cfg\n\n def forward(self, batch_dict):\n \"... | [
[
"torch.cat",
"numpy.random.rand",
"torch.max",
"numpy.round",
"numpy.random.permutation",
"torch.from_numpy"
]
] |
porschebest/Pybook | [
"af19ecb32ce1aa19d1f349ff6d4bf172b9f5643b"
] | [
"Ch3-Data Exploration/describe.py"
] | [
"# -*- coding: utf-8 -*\nimport pandas as pd\n#倒入路径\ncatering_sale = '../data/catering_sale.xls'\n#倒入Excel\ndata = pd.read_excel(catering_sale, index_col = u'日期')\n#描述基本资料\ndata.describe()\n"
] | [
[
"pandas.read_excel"
]
] |
u93/multa-metrics-collector | [
"68b64043d1e4e1cb6455badfdd524e9ffa4a7d99"
] | [
"src/jobs/poc/variables.py"
] | [
"import pandas as pd\n\n\ndf = pd.read_csv(\"Data.csv\") # creando dataframe Un DataFrame es una estructura de datos con dos dimensiones\ndf = pd.DataFrame(df)\n"
] | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
ascheben/bn_gbs | [
"cb70234e81874392f041ac51f7cb695ce183e252"
] | [
"scripts/vcf2gt.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import division\nimport argparse\nfrom cyvcf2 import VCF\nimport csv\nfrom scipy.stats import chisquare\n\n# This script outputs a filtered geno table for linkage mapping\n# Genotypes are converted to parental genotype (A|B|H|-)\n\n# Warning: this is not a generic script inte... | [
[
"scipy.stats.chisquare"
]
] |
loriab/resp_gm | [
"36974ca2caf262ef40bf7a9586c12d65e0a29be5"
] | [
"tests/test_ex2.py"
] | [
"def test_ex2():\n import psi4\n import resp\n import numpy as np\n \n # Initialize two different conformations of ethanol\n geometry = \"\"\"C 0.00000000 0.00000000 0.00000000\n C 1.48805540 -0.00728176 0.39653260\n O 2.04971655 1.37648153 0.25604810\n H 3.06429978 1.37... | [
[
"numpy.allclose",
"numpy.array"
]
] |
svavil/bcl-xl-inhibition | [
"3340d909903a7f32cbcc484e9d95665e17480637"
] | [
"descriptors.py"
] | [
"# A script to calculate molecular descriptors and fingerprints based on molecule SMILES\n# Created by: svavil\n# Created on: 2020-10-24\n# Edited on: 2020-10-25\n\nimport pandas as pd\nfrom rdkit import Chem, DataStructs\nfrom rdkit.Chem import Descriptors\nfrom rdkit.Chem.Pharm2D import Gobbi_Pharm2D, Generate\n\... | [
[
"pandas.read_excel",
"pandas.concat"
]
] |
morbitech1/DeepPoseKit | [
"0501847f61c8f49d2af973f5fe3895aa22895334"
] | [
"deepposekit/models/layers/hourglass.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2018-2019 Jacob M. Graving <jgraving@gmail.com>\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-... | [
[
"tensorflow.keras.backend.int_shape",
"tensorflow.keras.layers.Add",
"tensorflow.keras.layers.MaxPool2D",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.BatchNormalization",
"numpy.maximum"
]
] |
imandr/nnet | [
"e40b54b3c568e0872e3a7a21ccd4d5fd6c363893"
] | [
"samples/mnist/load_mnist.py"
] | [
"import numpy as np\n\ndef read_file(fn):\n labels = []\n images = []\n with open(fn, \"r\") as f:\n hdr = f.readline()\n for l in f.readlines():\n l = l.strip()\n if l:\n data = l.split(\",\")\n label = int(data[0])\n image =... | [
[
"numpy.array",
"numpy.savez"
]
] |
epri-dev/StorageVET | [
"26b740ba03b1ad4fc0734af56787ec5c0ebd3824"
] | [
"storagevet/ValueStreams/DemandChargeReduction.py"
] | [
"\"\"\"\nCopyright (c) 2021, Electric Power Research Institute\n\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without modification,\n are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice... | [
[
"pandas.Timedelta",
"pandas.DataFrame",
"pandas.date_range",
"numpy.nonzero",
"pandas.concat",
"numpy.all",
"pandas.Series",
"pandas.Period"
]
] |
Jaewoo97/VisualOdomtery | [
"cc6fc72dd40cb5f37e735502e6409d4329279c1d",
"cc6fc72dd40cb5f37e735502e6409d4329279c1d"
] | [
"dataloader/SecenFlowLoader.py",
"save_figures.py"
] | [
"import os\r\nimport torch\r\nimport torch.utils.data as data\r\nimport torch\r\nimport torchvision.transforms as transforms\r\nimport random\r\nfrom PIL import Image, ImageOps\r\nfrom . import preprocess \r\nfrom . import listflowfile as lt\r\nfrom . import readpfm as rp\r\nimport numpy as np\r\n\r\nIMG_EXTENSIONS... | [
[
"numpy.ascontiguousarray"
],
[
"matplotlib.pyplot.imsave",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ioff",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
wuzh07/agents | [
"bf10ec26f1552d7ebb7672cf7cc3fa85a05c933e"
] | [
"tf_agents/bandits/agents/neural_linucb_agent.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.compat.v1.assign",
"tensorflow.debugging.check_numerics",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.Module.__init__",
"tensorflow.cast",
"tensorflow.distribute.get_replica_context",
"tensorflow.compat.v1.variables_initializer",
"tensorflow.compat.v2.sum... |
MoniFarsang/DRL-in-Robotics | [
"4571f37fa5bbb121461e83202ab2def18a60fa09"
] | [
"utils/exp_manager.py"
] | [
"import argparse\nimport csv\nimport json\nimport os\nimport time\nimport warnings\nfrom collections import OrderedDict\nfrom pprint import pprint\nfrom typing import Any, Callable, Dict, List, Optional, Tuple\n\nimport gym\nimport numpy as np\nimport optuna\nimport yaml\nimport stable_baselines3\nfrom optuna.integ... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
sokolheavy/KinGBERT | [
"c7c91d92bd7d6cc725375d8c3d541040e8a22184"
] | [
"KinGBERT/model.py"
] | [
"import spacy\nimport numpy as np\nimport torch\nfrom sklearn.metrics.pairwise import cosine_similarity\nfrom transformers import AutoModel, AutoTokenizer\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom KinGBERT.utils import extractor_topic_rank, extractor_topical_page_rank, extractor_single_rank... | [
[
"torch.is_tensor",
"torch.no_grad",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.metrics.pairwise.cosine_similarity",
"numpy.unique"
]
] |
NilBre/alignment_master_thesis | [
"a2dfbc813775f8eb35e906cf328036f64f859884"
] | [
"visuals/scatter_plots/scatter_stations.py"
] | [
"import argparse\n\n#import matplotlib\n#matplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\n#for recolor\nimport matplotlib.colors as mplcolor\nimport colorsys as colorsys\n\nimport json\nimport numpy as np\n\n\n## Collecting information from json file\nparser = argparse.ArgumentParser()\nparser.add_argument... | [
[
"numpy.array",
"matplotlib.colors.to_rgb",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.scatter",
... |
jingli9111/RUM-Tensorflow | [
"6a2fec4ee36a44e8d54f5a25493d2202bc43166a"
] | [
"babi_task.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport argparse, os\nimport tensorflow as tf\nimport sys, tarfile, re\n\nfrom tensorflow.contrib.rnn import BasicLSTMCell, BasicRNNCell, GRUCell\n\nfrom tensorflow.python.ops import... | [
[
"tensorflow.constant_initializer",
"tensorflow.contrib.rnn.BasicLSTMCell",
"tensorflow.matmul",
"tensorflow.nn.embedding_lookup",
"tensorflow.contrib.rnn.BasicRNNCell",
"tensorflow.global_variables_initializer",
"tensorflow.cast",
"tensorflow.random_normal_initializer",
"tensor... |
j-dsouza/pytorch-lightning | [
"62029c17ee6b91de03ea428f69f451fdc845d83a"
] | [
"pytorch_lightning/trainer/distrib_data_parallel.py"
] | [
"\"\"\"\nLightning supports model training on a cluster managed by SLURM in the following cases:\n\n1. Training on a single cpu or single GPU.\n2. Train on multiple GPUs on the same node using DataParallel or DistributedDataParallel\n3. Training across multiple GPUs on multiple different nodes via DistributedDataPa... | [
[
"torch.cuda.set_device",
"numpy.random.uniform",
"torch.cuda.is_available"
]
] |
Verichev/CarND-Behavioral-Cloning-P3 | [
"9250ace04c5c9ed8039b97be5db0cb476b84c8e7"
] | [
"predict.py"
] | [
"import csv\n\nimport cv2\nimport numpy as np\nfrom keras.models import load_model\nfrom sklearn.utils import shuffle\n\n\ndef generator(samples, batch_size=32):\n num_samples = len(samples)\n while 1: # Loop forever so the generator never terminates\n shuffle(samples)\n for offset in range(0, n... | [
[
"sklearn.model_selection.train_test_split",
"numpy.array",
"numpy.fliplr",
"sklearn.utils.shuffle"
]
] |
micro-pixel/gnes | [
"44a54be4c80108ac65b2450b4af8deded6da3339"
] | [
"gnes/encoder/audio/mfcc.py"
] | [
"# Tencent is pleased to support the open source community by making GNES available.\n#\n# Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.\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 ... | [
[
"numpy.array",
"numpy.zeros"
]
] |
theContentMint/moviepy | [
"a2f74d1152563b4a6dafc6c9cdb688c7a5244965"
] | [
"moviepy/audio/io/readers.py.BASE.6136.py"
] | [
"import subprocess as sp\nimport re\n\nimport numpy as np\nfrom moviepy.tools import cvsecs\nfrom moviepy.conf import FFMPEG_BINARY\n\n \nclass FFMPEG_AudioReader:\n \"\"\"\n A class to read the audio in either video files or audio files\n using ffmpeg. ffmpeg will read any audio and transform them into... | [
[
"numpy.fromstring"
]
] |
liuxx479/hmf-1 | [
"8b24f5df42cdf73d507ffc4a7c6138573769bb2c"
] | [
"tests/test_functional.py"
] | [
"import numpy as np\nfrom hmf import get_hmf\nfrom hmf import MassFunction\n\n\ndef test_order():\n order = [\n \"sigma_8: 0.7, ST, z: 0\",\n \"sigma_8: 0.7, PS, z: 0\",\n \"sigma_8: 0.7, ST, z: 1\",\n \"sigma_8: 0.7, PS, z: 1\",\n \"sigma_8: 0.7, ST, z: 2\",\n \"sigma_8... | [
[
"numpy.allclose"
]
] |
eustomaqua/adanet | [
"9c1de82428a4e661768af8e764041afebfec2e6f",
"9c1de82428a4e661768af8e764041afebfec2e6f"
] | [
"adanet/core/report_accessor.py",
"research/improve_nas/trainer/cifar100.py"
] | [
"\"\"\"Store and retrieve adanet.IterationReport protos.\n\nCopyright 2018 The AdaNet 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 https://www.apach... | [
[
"tensorflow.io.gfile.exists",
"tensorflow.io.TFRecordWriter",
"tensorflow.io.gfile.makedirs"
],
[
"numpy.array",
"tensorflow.contrib.estimator.multi_class_head",
"numpy.zeros",
"tensorflow.logging.info",
"tensorflow.keras.datasets.cifar100.load_data",
"tensorflow.contrib.tr... |
cds-mipt/HPointLoc | [
"b346c10928939ddc1fe5840aef5085418e3aa0ad",
"b346c10928939ddc1fe5840aef5085418e3aa0ad"
] | [
"pipelines/utils/loftr_3rd.py",
"3rd/Patch-NetVLAD/patchnetvlad/models/netvlad.py"
] | [
"import os\nimport torch\nimport numpy as np\nimport re\nimport json \nfrom os.path import join\nfrom tqdm import tqdm\nimport h5py\nfrom utils.subprocces import run_python_command\nimport sys\n\nMAXDEPTH = 10\n\ndef loftr(dataset_path, input_pairs, output_dir, root_dir):\n sys.path.append(join(root_dir, '3rd/L... | [
[
"torch.no_grad",
"numpy.squeeze",
"torch.load",
"torch.from_numpy"
],
[
"torch.zeros",
"torch.nn.functional.normalize",
"torch.rand",
"numpy.dot",
"numpy.linalg.norm",
"numpy.log",
"numpy.mean",
"torch.from_numpy",
"torch.nn.Conv2d",
"torch.nn.functional... |
traclabs/toppra | [
"ffaf8de3a4c19fd5cf14ccddf98c9939c4e1318e"
] | [
"toppra/algorithm/reachabilitybased/reachability_algorithm.py"
] | [
"from ..algorithm import ParameterizationAlgorithm\nfrom ...constants import LARGE, SMALL\nfrom ...constraint import ConstraintType\n\nimport numpy as np\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass ReachabilityAlgorithm(ParameterizationAlgorithm):\n \"\"\"Base class for all Reachability Anal... | [
[
"numpy.copy",
"numpy.isnan",
"numpy.sqrt",
"numpy.zeros"
]
] |
manijhariya/SportsBallClassifier | [
"fefa06b86e1df821c2cec4847536e2bed6cf55e5"
] | [
"Images_To_CSV.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom PIL import Image\nimport matplotlib.pyplot as plt\nimport os\nimport sys\n\ndef load_image(location,flatten=True):\n\timg = None\n\ttry:\n\t\timg = Image.open(location).convert('RGB')\n\t\timg = img.resize((100,100))\n\t\timg = np.asarray(img,dtype=np.int)\n\t\t#plt.i... | [
[
"pandas.DataFrame",
"numpy.asarray",
"numpy.append"
]
] |
yifanmai/tfx | [
"56b4d373b8b777a780f4552b5834925e837c51e9"
] | [
"tfx/components/evaluator/executor_test.py"
] | [
"# Lint as: python2, python3\n# Copyright 2019 Google LLC. 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\... | [
[
"tensorflow.compat.v1.enable_v2_behavior",
"tensorflow.test.main"
]
] |
undeadyequ/protest-detection-violence-estimation | [
"0781e83d7b37353be1cb25ca2a4917de416a7891"
] | [
"preprocess/data_prepare.py"
] | [
"\"\"\"\nPrepare data to below for training\n\n- id_label_transcript\n id label transcript\n - train\n - test\n\n- id_path\n id path\n\n- id_label_trans_prob\n id label transcript prob1 prob2 ...\n\n\"\"\"\n\nimport os\nimport easyocr\nimport os\nimport glob\nfrom pathlib import Path\nimport csv\nimp... | [
[
"sklearn.model_selection.train_test_split",
"pandas.DataFrame",
"pandas.read_csv"
]
] |
arnavbansal2764/topopt | [
"74d8f17568a9d3349632e23840a9dc5b0d6c4d1f"
] | [
"examples/simultaneous_loads.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Two simultaneous point loads.\"\"\"\nfrom __future__ import division\n\nimport numpy\n\nimport context # noqa\n\nfrom topopt.boundary_conditions import BoundaryConditions\nfrom topopt.utils import xy_to_id\n\nfrom topopt import cli\n\n\nclass SimultaneousLoads... | [
[
"numpy.array",
"numpy.zeros"
]
] |
chiragThakur62/ga-learner-dsmp-repo | [
"a525732fad0da0ed2a73bced16b8006621097e2b"
] | [
"Decision-Trees-Loan-Defaulters/code.py"
] | [
"# --------------\n#Importing header files\n\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n\n\n# Code starts here\n\ndata=pd.read_csv(path)\n\nX=data.drop(columns=['customer.id','paid.back.loan'])\ny=data['paid.back.loan']\n\nX_train,X_test,y_train,y_test=train_test_split(X,y, test_siz... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.model_selection.GridSearchCV",
"matplotlib.pyplot.imread",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.arange",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.model_selection.train_test_split",
"sklearn.tree.expor... |
awharkrider/CPSC-3520-Artificial-Intelligence | [
"e6fe115ab2e21b9fbe470fbb9530a59acaca34be"
] | [
"path-planning-project/PathPlanning.py"
] | [
"\"\"\"\nPathPlanning.py\nAaron Harkrider\nCollaborated with: Ally Wallace, Garrett Henderson\n\n02-06-2018\n\n\n# Map a path for a UGV(unmanned ground vehicle) to successfully navigate through a grid as fast as possible.\n\n- Two uninformed search algorithms and\n * breadth_first_search\n * depth_first_graph... | [
[
"numpy.matrix",
"numpy.loadtxt"
]
] |
KamalakerDadi/empirical_proxy_measures | [
"f501dd3027fa8df29dcac92aec333cc71cbc0acb"
] | [
"predictive_analysis_age_at_assement/make_combined_outputs_age_at_assessment_prediction_from_earlylife.py"
] | [
"import os\nimport collections\nfrom os.path import join\nimport numpy as np\nimport pandas as pd\n\nfrom itertools import chain\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.impute import SimpleImputer, MissingIndicator\nfrom sklearn.pipeline import make_union, Pipeline\nfrom sklearn.ensemble... | [
[
"sklearn.impute.SimpleImputer",
"sklearn.metrics.mean_squared_error",
"sklearn.model_selection.GridSearchCV",
"pandas.DataFrame",
"sklearn.metrics.r2_score",
"sklearn.metrics.explained_variance_score",
"sklearn.metrics.mean_absolute_error",
"numpy.loadtxt",
"numpy.arange",
... |
KingaS03/global-divergences | [
"27590b63e58af2439d1fe4aa2a57cb2f16cef821"
] | [
"global_divergences_ShapeMI2018/softmin_1D.py"
] | [
"#-------------------------------------------------------\n# Code used to generate Fig. 5\n#-------------------------------------------------------\n\nimport numpy as np\nimport torch\n\ns2v = lambda x : torch.tensor([x])\n\nNt = 501\nt = torch.linspace( 0, 1, Nt ).view(-1,1)\nx_1 = .25\nx_2 = .75\n\n... | [
[
"numpy.savetxt",
"numpy.log",
"torch.max",
"torch.linspace",
"numpy.stack",
"torch.tensor"
]
] |
MaxGhenis/OG-USA | [
"ee070856075e23fa63494992bd2688855c6551d9"
] | [
"ogusa/tests/test_get_micro_data.py"
] | [
"import multiprocessing\nfrom distributed import Client, LocalCluster\nimport pytest\nfrom pandas.testing import assert_frame_equal\nimport numpy as np\nimport os\nfrom ogusa.constants import CPS_START_YEAR, PUF_START_YEAR, TC_LAST_YEAR\nfrom ogusa import get_micro_data, utils\nfrom taxcalc import GrowFactors\nNUM_... | [
[
"numpy.allclose",
"pandas.testing.assert_frame_equal"
]
] |
brycejoh16/combining-evolutionary-and-assay-labelled-data | [
"36ffcf10ad6eacf5d44c81d69f0bc6f7f9cae73b",
"36ffcf10ad6eacf5d44c81d69f0bc6f7f9cae73b"
] | [
"src/utils/metric_utils.py",
"scripts/tblout2csv.py"
] | [
"import numpy as np\nfrom scipy.stats import spearmanr\nfrom sklearn.metrics import r2_score, roc_auc_score, ndcg_score\n\nSPEARMAN_FRACTIONS = np.linspace(0.1, 1.0, 10)\n\n\ndef spearman(y_pred, y_true):\n if np.var(y_pred) < 1e-6 or np.var(y_true) < 1e-6:\n return 0.0\n return spearmanr(y_pred, y_tru... | [
[
"numpy.sum",
"scipy.stats.spearmanr",
"numpy.argsort",
"sklearn.metrics.r2_score",
"numpy.linspace",
"sklearn.metrics.roc_auc_score",
"numpy.var"
],
[
"pandas.read_csv"
]
] |
ecoresystems/Kyushu_School_Works | [
"279ed2fccf78a0822243b5ec969dad11f33aeaee"
] | [
"System_Software/assignment4/py_version.py"
] | [
"# -*- eoding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Jun 28 13:20:40 2019\r\n\r\n@author: Conan\r\n\"\"\"\r\n\r\nimport csv\r\nimport numpy\r\n\r\nA = numpy.loadtxt(open(\"test_matrix.csv\", \"rb\"), delimiter=\",\", skiprows=0)\r\nx0 = numpy.array([1,0,0,0,0,0,0,0,0,0,0,0])\r\nfor i in range (6):\r\n x0 = numpy... | [
[
"numpy.array",
"numpy.matmul"
]
] |
GPrathap/OpenBCIPython | [
"0f5be167fb09d31c15885003eeafec8cdc08dbfa"
] | [
"py_qt/kernels.py"
] | [
"r\"\"\"\n:Author: Pierre Barbier de Reuille <pierre.barbierdereuille@gmail.com>\n\nModule providing a set of kernels for use with either the :py:mod:`pyqt_fit.kde` or the :py:mod:`kernel_smoothing` \nmodule.\n\nKernels should be created following this template:\n\n\"\"\"\nimport numpy as np\nfrom scipy import fftp... | [
[
"numpy.asfarray",
"numpy.divide",
"numpy.empty",
"numpy.asarray",
"numpy.sum",
"numpy.exp",
"numpy.multiply",
"numpy.atleast_1d",
"numpy.sqrt",
"numpy.isfinite",
"scipy.special.erf",
"scipy.integrate.quad",
"numpy.atleast_2d"
]
] |
anthayes92/pennylane | [
"0c1c805fd5dfce465a8955ee3faf81037023a23e"
] | [
"pennylane/tape/interfaces/torch.py"
] | [
"# Copyright 2018-2020 Xanadu Quantum Technologies Inc.\r\n\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n# Unles... | [
[
"torch.as_tensor",
"numpy.hstack",
"numpy.dtype",
"torch.from_numpy"
]
] |
xopclabs/MetricLearningIdentification | [
"8d7a39d7c121cbe280f2bfb744f9b01963d918a9"
] | [
"test.py"
] | [
"# Core libraries\nimport os\nimport sys\nimport torch\nimport argparse\nimport numpy as np\nfrom tqdm import tqdm\nfrom sklearn.neighbors import KNeighborsClassifier\n\n# PyTorch\nimport torch\nfrom torch.utils import data\nfrom torch.autograd import Variable\n\n# Local libraries\nfrom utilities.utils import Utili... | [
[
"numpy.concatenate",
"numpy.zeros",
"sklearn.neighbors.KNeighborsClassifier",
"numpy.savez",
"torch.utils.data.DataLoader"
]
] |
ninjakx/youtube-video2ppt | [
"bb399744566062bb114eee1c242de5a7a5b56648"
] | [
"save_yl_slide.py"
] | [
"import pytube\r\nfrom pathlib import Path\r\nimport argparse\r\nimport cv2\r\nimport numpy as np\r\nfrom img2ppt import create_ppt\r\n\r\n# construct the argument parse and parse the arguments\r\nap = argparse.ArgumentParser()\r\nap.add_argument(\"-s\", \"--start\", required=False, type=int, default=0,\thelp=\"Sta... | [
[
"numpy.sum"
]
] |
yilaili/Automatic-cryoEM-preprocessing-dev | [
"075304d867ebf08b2e3f8ebf58b6deb3270eeeeb"
] | [
"cryoassess/micassess.py"
] | [
"import os\nimport numpy as np\nimport glob\nimport shutil\nimport multiprocessing as mp\nimport argparse\nfrom pathlib import Path\n\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # INFO and WARNING messages are not printed\nimport tensorflow as tf\nfrom tensorflow import keras\n\nfrom tensorflow.keras.optimizers impor... | [
[
"numpy.full",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.distribute.MirroredStrategy",
"tensorflow.shape",
"numpy.minimum",
"numpy.mean",
"numpy.where",
"numpy.argmax"
]
] |
anindex/drqn-study | [
"ab357178bbe6a1e09eda0f19583e8e8444bf4a54"
] | [
"src/replay/random.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport random\nimport numpy as np\n\nfrom src.replay.sum_tree import SumTree\nfrom src.replay.base import Memory\n\n\nclass RandomMemory(Memory):\n def __init__(self, **kwargs):\n super(RandomM... | [
[
"numpy.array",
"numpy.power"
]
] |
mayok/ssr | [
"3b4fbba5c586da05513b1407a52d24a6622e63d8"
] | [
"mfcc.py"
] | [
"#coding:utf-8\nfrom __future__ import print_function\nimport wave\nimport sys\nimport numpy as np\nimport scipy.signal\nimport scipy.fftpack\nimport scipy.fftpack.realtransforms\nfrom pylab import *\n\ndef wavread(filename):\n wf = wave.open(filename, \"r\")\n fs = wf.getframerate()\n x = wf.readframes(wf... | [
[
"numpy.dot",
"numpy.zeros",
"numpy.log",
"numpy.round",
"numpy.exp",
"numpy.fft.fft",
"numpy.arange",
"numpy.frombuffer",
"numpy.hstack",
"numpy.fft.fftfreq"
]
] |
bendichter/giocomo-lab-to-nwb | [
"a096cdea15291f77793ca334de1eaaa762685c58"
] | [
"giocomo_lab_to_nwb/wen22/wen21behaviorinterface.py"
] | [
"from pathlib import Path\nfrom warnings import warn\n\nimport pandas as pd\nimport numpy as np\n\nfrom pynwb import NWBFile, TimeSeries\nfrom hdmf.backends.hdf5.h5_utils import H5DataIO\nfrom ndx_events import Events\nfrom pynwb.behavior import Position, SpatialSeries\nfrom nwb_conversion_tools.basedatainterface i... | [
[
"numpy.max",
"numpy.zeros",
"numpy.diff",
"pandas.concat",
"pandas.read_csv"
]
] |
Binary-bug/Python | [
"233425ded6abc26c889599a82a181487789e3bab"
] | [
"NumpyStack/matplotlib/histogram.py"
] | [
"# histogram is nothing but a discretized probability distribution of the\n# data\n\n\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\nA = pd.read_csv(\"data_1d.csv\",header=None).as_matrix()\n\nx = A[:,0] # x axis is the first column colon : means select everything in that\n ... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.hist",
"pandas.read_csv"
]
] |
ntraut/StratiPy | [
"2b57821f21561a44c44ab4f14897b5f12b217c20"
] | [
"reproducibility/reproducibility.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\nimport sys\nimport time\nfrom confusion_matrices import get_cluster_idx, repro_confusion_matrix\nfrom nbs_functions import all_functions\nfrom sklearn.model_selection import ParameterGrid\nimport datetime\n\n\n\"\"\"Tuning parameters' list for Network Based Stratification (N... | [
[
"sklearn.model_selection.ParameterGrid"
]
] |
EvoHull/Tapirs | [
"b4c94cec66027fb9ec4e71083b6cdc02689b18ae"
] | [
"workflow/scripts/mlca.py"
] | [
"# ------------------------------------------------------------------------------\n# MAJORITY LOWEST COMMON ANCESTOR (mlca)\n# caluclation of mlca from blast output\n# ------------------------------------------------------------------------------\n\nimport pandas as pd\nimport numpy as np\nfrom itertools import dro... | [
[
"pandas.read_csv",
"numpy.unique"
]
] |
EpicWink/pymap3d | [
"021e9924f94b2bb5b7148cd00f03d3557619fe27"
] | [
"src/pymap3d/rsphere.py"
] | [
"\"\"\" compute radii of auxiliary spheres\"\"\"\n\nfrom __future__ import annotations\nimport typing\n\ntry:\n from numpy import radians, sin, cos, log, sqrt, degrees, asarray, ndarray\nexcept ImportError:\n from math import radians, sin, cos, log, sqrt, degrees # type: ignore\n\n asarray = None\n nda... | [
[
"numpy.asarray"
]
] |
cod3licious/nlputils | [
"f7319c11b14ea0c54cf7eeb2d0d5411360cad3f3"
] | [
"nlputils/simcoefs.py"
] | [
"from __future__ import unicode_literals, division, print_function, absolute_import\nfrom collections import defaultdict\nfrom sys import float_info as fi\nfrom math import sqrt, log\nimport numpy as np\n\n\ndef _polynomial_sim(x, y, p=2):\n \"\"\"\n polynomial/linear kernel\n compute the similarity betwee... | [
[
"numpy.abs"
]
] |
Claire-Hough/augur | [
"b48d246a8959f62473c8e898148a2113772a700c"
] | [
"augur/metrics/pull_request/pull_request.py"
] | [
"\"\"\"\nMetrics that provide data about pull requests & their associated activity\n\"\"\"\n\nimport datetime\nimport sqlalchemy as s\nimport pandas as pd\nfrom augur.util import logger, annotate, add_metrics\n\n@annotate(tag='pull-requests-merge-contributor-new')\ndef pull_requests_merge_contributor_new(self, repo... | [
[
"pandas.read_sql"
]
] |
dimaischenko/nn | [
"a7f5887ec816e6b3bbfc57e6864ab3ae320161a6"
] | [
"nn/modules/relu.py"
] | [
"from nn.modules import Module\nimport numpy as np\n\n\nclass ReLU(Module):\n \"\"\"Classic ReLU non-linear layer\"\"\"\n\n def __init__(self):\n super(ReLU, self).__init__()\n\n def forward(self, input_):\n self.output = np.maximum(0, input_)\n return self.output\n\n def backward(s... | [
[
"numpy.maximum"
]
] |
wyli/nitorch | [
"3ecd18944cf45fb9193c4c6ffc32953c4d1c71ac"
] | [
"nitorch/core/math.py"
] | [
"\"\"\"Mathematical functions.\"\"\"\n\n# mikael.brudfors@gmail.com\n# yael.balbastre@gmail.com\n\nimport torch\nfrom .constants import inf, ninf\n\n\ndef round(t, decimals=0):\n \"\"\" Round a tensor to the given number of decimals.\n\n Args:\n t (torch.tensor) Tensor.\n decimals (int, optional... | [
[
"scipy.linalg.expm",
"torch.round",
"torch.min",
"torch.isnan",
"torch.max",
"scipy.linalg.logm",
"torch.arange",
"torch.lgamma",
"numpy.real",
"torch.from_numpy",
"torch.as_tensor",
"torch.log",
"torch.exp",
"torch.where",
"torch.sum"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.