repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
nontoother/siamfc-ssd
[ "004d211831b313dce216f92c30fe1c7adc17d058" ]
[ "scripts/run_tracking.py" ]
[ "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright © 2017 bily Huazhong University of Science and Technology\n#\n# Distributed under terms of the MIT license.\n\nr\"\"\"Generate tracking results for videos using Siamese Model\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import ...
[ [ "tensorflow.ConfigProto", "tensorflow.Graph", "tensorflow.Session", "tensorflow.GPUOptions" ] ]
zhuyifengzju/robovat
[ "70fc53790cc8001c554c668614421534c75e7fbb" ]
[ "robovat/envs/grasp/franka_grasp_env.py" ]
[ "\"\"\"Top-down 4-DoF grasping environment.\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport glob\nimport random\nimport os.path\n\nimport gym\nimport numpy as np\n\nfrom robovat.envs import franka_arm_env\nfrom robovat.envs.grasp.gr...
[ [ "numpy.array", "numpy.random.uniform" ] ]
uoynac/big-ann-benchmarks
[ "8180e0e6ea5b8e36f76c5e34728116f0de23c05e" ]
[ "benchmark/plotting/utils.py" ]
[ "from __future__ import absolute_import\n\nimport itertools\nimport numpy\nfrom benchmark.plotting.metrics import all_metrics as metrics\nfrom benchmark.sensors.power_capture import power_capture\n\ndef get_or_create_metrics(run):\n if 'metrics' not in run:\n run.create_group('metrics')\n return run['m...
[ [ "numpy.array", "numpy.linspace" ] ]
wayne9qiu/AmpliGraph
[ "a4e7afcc39a92737cee6edb74661b364fa841336" ]
[ "ampligraph/__init__.py" ]
[ "# Copyright 2019-2020 The AmpliGraph Authors. All Rights Reserved.\n#\n# This file is Licensed under the Apache License, Version 2.0.\n# A copy of the Licence is available in LICENCE, or at:\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n\"\"\"AmpliGraph is a library for relational learning on knowledge ...
[ [ "tensorflow.compat.v1.logging.set_verbosity" ] ]
Subhraj07/allennlp
[ "c37ff2ca877585b11f62705637becd600aa7383a" ]
[ "allennlp/modules/text_field_embedders/basic_text_field_embedder.py" ]
[ "from typing import Dict, List\n\nimport torch\nfrom overrides import overrides\n\nfrom allennlp.common import Params\nfrom allennlp.common.checks import ConfigurationError\nfrom allennlp.data import Vocabulary\nfrom allennlp.modules.text_field_embedders.text_field_embedder import TextFieldEmbedder\nfrom allennlp.m...
[ [ "torch.cat" ] ]
guruyaya/examples
[ "d04d651b2062a7137f230cc402996f519e9fd603" ]
[ "tensorflow_examples/lite/model_maker/core/task/image_classifier.py" ]
[ "# Copyright 2019 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.compat.v2.compat.v1.logging.info", "tensorflow.compat.v2.io.gfile.makedirs", "tensorflow.compat.v2.compat.v1.logging.warning", "tensorflow.compat.v2.io.gfile.exists" ] ]
pypr/automan
[ "80619f0cb58ad1e996dc7c9ea66effecf8df5acc", "80619f0cb58ad1e996dc7c9ea66effecf8df5acc" ]
[ "examples/edm_conda_cluster/powers.py", "examples/tutorial/automate4.py" ]
[ "import argparse\nimport os\n\nimport numpy as np\n\n\ndef compute_powers(r_max, power):\n \"\"\"Compute the powers of the integers upto r_max and return the result.\n \"\"\"\n result = []\n for i in range(0, r_max + 1):\n result.append((i, i**power))\n x = np.arange(0, r_max + 1)\n y = np....
[ [ "numpy.savez", "numpy.arange", "numpy.power" ], [ "numpy.asarray", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel" ] ]
Khasir/transformers
[ "8a8ae27617e3c4dafb34bcbbaadf4ceee28583bd" ]
[ "src/transformers/modeling_tf_ctrl.py" ]
[ "# coding=utf-8\n# Copyright 2018 Salesforce and HuggingFace Inc. team.\n# Copyright (c) 2018, 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.\n# You may obtain a copy of the License...
[ [ "tensorflow.matmul", "tensorflow.ones", "tensorflow.reshape", "tensorflow.keras.layers.Dense", "numpy.cos", "tensorflow.tile", "tensorflow.math.sqrt", "tensorflow.nn.softmax", "tensorflow.stack", "tensorflow.cast", "numpy.concatenate", "numpy.sin", "tensorflow.c...
Yoshiki-Takahashi/tools4kaggle
[ "eb2779687867e876f6beec1351140cfec046b152" ]
[ "t4k/feature/feature.py" ]
[ "# This code comes from https://amalog.hateblo.jp/entry/kaggle-feature-management\n# Copy Rights belongs to えじ (amaotone).\n\nimport re\nimport time\nfrom abc import ABCMeta, abstractmethod\nfrom pathlib import Path\nfrom contextlib import contextmanager\n\nimport pandas as pd\n\n@contextmanager\ndef timer(name):\n...
[ [ "pandas.DataFrame", "pandas.read_feather", "pandas.concat" ] ]
ardiloot/NonlinearTMM
[ "508f009dbc1a071a7039dc1b381a9d8c4842c842" ]
[ "Tests/LabPy/_Tmm/_TmmForWavePackets.py" ]
[ "import numpy as np\r\nfrom LabPy import Core, Constants\r\nfrom time import time\r\n\r\n__all__ = [\"PlaneWave\", \\\r\n \"GaussianWave\",\r\n \"GaussianWaveFFT\",\r\n \"TukeyWaveFFT\",\r\n \"TmmForWaves\",\r\n \"SecondOrderNLTmmForWaves\"]\r\n\r\n#================...
[ [ "numpy.ones_like", "numpy.exp", "numpy.radians", "numpy.where", "numpy.cos", "numpy.max", "numpy.zeros_like", "numpy.sin", "numpy.log", "numpy.arcsin", "numpy.arange", "numpy.argmax", "numpy.sqrt", "numpy.conj", "numpy.array", "numpy.fft.ifftshift", ...
micmelesse/dgl
[ "5dd35580f7918faa1de551cd80a0ce90a143c434" ]
[ "python/dgl/backend/tensorflow/tensor.py" ]
[ "\nfrom __future__ import absolute_import\n\nfrom distutils.version import LooseVersion\n\nimport tensorflow as tf\nfrom tensorflow.python.eager import context\nimport builtins\nimport tfdlpack\nimport numpy as np\nfrom tfdlpack import to_dlpack, from_dlpack\n\nfrom ... import ndarray as nd\nfrom ... import kernel ...
[ [ "tensorflow.exp", "tensorflow.reduce_min", "tensorflow.ones", "tensorflow.unique", "tensorflow.reshape", "tensorflow.zeros_like", "tensorflow.math.top_k", "tensorflow.clip_by_value", "tensorflow.stack", "tensorflow.DeviceSpec.from_string", "tensorflow.random.shuffle", ...
gogasca/vertex-ai-samples
[ "85984f117300768061c03a64e3982fae27c64126" ]
[ "community-content/pytorch_image_classification_distributed_data_parallel_training_with_vertex_sdk/trainer/task.py" ]
[ "# Copyright 2021 Google LLC\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\",\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 o...
[ [ "torch.nn.Linear", "torch.distributed.is_available", "torch.device", "torch.distributed.get_world_size", "torch.distributed.destroy_process_group", "torch.distributed.init_process_group", "torch.no_grad", "torch.nn.parallel.DistributedDataParallel", "torch.distributed.get_backe...
KalebCoberly/data_wrangling_osm_xml_with_python_into_mongodb
[ "70b6f22331c3437e377e8caf01713498bc444d79" ]
[ "mongo_audit.py" ]
[ "import pprint as pp\nimport pandas as pd\nimport numpy as np\n\nlist_query = lambda cursor: [doc for doc in cursor]\n\ndef get_unique_users(coll):\n pipeline = [\n { \"$group\" : { \"_id\" : \"$created.uid\" } },\n { \"$count\" : \"unique_users\" }\n ]\n return coll.aggregate(pipeline)\n\n\n...
[ [ "numpy.zeros" ] ]
mitchelljeff/SUMMAD4.3
[ "33bb3a74cff16a7aa699660a08d98ddcd662cad5" ]
[ "jtr/util/hooks.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport time\nfrom time import strftime, localtime\nfrom datetime import datetime\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom sklearn.metrics import classification_report\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\n# todo: hooks should also have prefixes so tha...
[ [ "tensorflow.reduce_min", "numpy.min", "numpy.mean", "tensorflow.reshape", "numpy.multiply", "numpy.where", "tensorflow.nn.softmax", "numpy.divide", "tensorflow.trainable_variables", "numpy.concatenate", "numpy.max", "tensorflow.global_variables", "tensorflow.nor...
danielsgrun/cfwell
[ "d72e32260441d8390b8a6f06fc5bba34749deef3" ]
[ "cfwell/representations.py" ]
[ "from numpy import zeros\r\nimport numpy as np\r\n\r\ndef make_Ni(natom):\r\n '''\r\n \r\n Parameters\r\n ----------\r\n natom : int\r\n Total # of atoms.\r\n Returns\r\n -------\r\n np.array\r\n Array containing the representations of Ni operators.\r\n \"np.array([N1, N2,...
[ [ "numpy.array", "numpy.zeros" ] ]
EricFH/SOR
[ "d644469da16169dd269c6ecaac51b1762649e17a" ]
[ "sor_ppa/vis/predictor.py" ]
[ "import torch\nfrom detectron2.data import MetadataCatalog\nfrom detectron2.engine.defaults import DefaultPredictor\nfrom detectron2.utils.visualizer import ColorMode\nfrom visualizer import SORVisualizer\nimport numpy as np\n\n\nclass VisualizationDemo(object):\n def __init__(self, cfg, instance_mode=ColorMode....
[ [ "torch.device", "numpy.zeros_like" ] ]
t170815518/dlrm
[ "5f653a34efcd3b2116f7facf8d42d796f38a3c47" ]
[ "dlrm_s_pytorch.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n#\n# Description: an implementation of a deep learning recommendation model (DLRM)\n# The model input consists of dense and sparse fea...
[ [ "torch.cat", "torch.nn.ParameterList", "torch.nn.EmbeddingBag", "torch.nn.ModuleList", "numpy.set_printoptions", "torch.nn.parallel.scatter_gather.scatter", "torch.ones", "torch._ops.ops.quantized.embedding_bag_byte_prepack", "torch.set_printoptions", "torch.cuda.is_availab...
AhmedAyad89/Consitent-Prototypical-Networks-Semi-Supervised-Few-Shot-Learning
[ "b0b805733ee6c42cee5ddd9eace94edd29f6120d" ]
[ "fewshot/models/basic_model.py" ]
[ "# Copyright (c) 2018 Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell,\n# Kevin Swersky, Joshua B. Tenenbaum, Hugo Larochelle, Richars S. Zemel.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to d...
[ [ "tensorflow.train.AdamOptimizer", "tensorflow.summary.scalar", "tensorflow.summary.histogram", "tensorflow.add_n", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.constant", "tensorflow.name_scope", "tensorflow.pow", "tensorflow.reduce_mean", "tensorflow.get_...
matthewbal/messenger-analysis
[ "c69f3a28759a6852560e49982fdd5f005feceb52" ]
[ "scripts/processor.py" ]
[ "###################################\n# processor.py\n###################################\n\"\"\"\nAuthor: Matt Balshaw\nStart Date: 10/06/2020\n\nProcesses the raw facebook data into usable csv's\n\"\"\"\n\nimport pandas as pd\nimport os\nimport json\nimport sys\nfrom tqdm import tqdm\nfrom pathlib import Path\nim...
[ [ "pandas.DataFrame.from_dict", "pandas.DataFrame" ] ]
nishantrai18/homage
[ "4da1e3836b231d4915683a38502f7b5e0c14a1ea" ]
[ "test/dataset_3d_lc.py" ]
[ "import torch\nfrom torch.utils import data\nfrom torchvision import transforms\nimport os\nimport sys\nimport time\nimport pickle\nimport csv\nimport glob\nimport pandas as pd\nimport numpy as np\nimport cv2\n\nsys.path.append('../train')\nimport model_utils as mu\n\nsys.path.append('../utils')\nfrom augmentation ...
[ [ "torch.zeros", "torch.cat", "torch.stack", "numpy.zeros", "numpy.load", "torch.LongTensor", "torch.tensor", "numpy.arange", "pandas.read_csv" ] ]
zzh237/quanthmc
[ "8126691b43bddc2b1a96f73ab35d04d1af200d7a" ]
[ "algo/sgd.py" ]
[ "import torch \nimport torch.nn.functional as F\nimport numpy as np \nfrom algo.algo_interface import * \nfrom torch.utils.data import DataLoader\nfrom algo.Stochastic_Gradient_HMC_SA.utils import * \nfrom algo.gradient_based.sgd_update import * \nimport time \n\nclass sgd(algo_interface):\n def __init__(self, a...
[ [ "torch.save", "torch.utils.data.DataLoader", "numpy.zeros", "torch.load" ] ]
openclimatefix/predict_pv_yield_2
[ "505d7d06d30a42839b80a73428042a16e92ea831" ]
[ "predict_pv_yield/models/base_model.py" ]
[ "import pytorch_lightning as pl\nimport torch\nimport torch.nn.functional as F\n\nfrom nowcasting_utils.visualization.visualization import plot_example\nfrom nowcasting_utils.visualization.line import plot_batch_results\nfrom nowcasting_dataset.data_sources.nwp_data_source import NWP_VARIABLE_NAMES\nfrom nowcasting...
[ [ "torch.nn.functional.mse_loss", "torch.cuda.is_available", "pandas.to_datetime" ] ]
liqiokkk/FCtL
[ "b2f66e64214956aa84f261474c7a5aeaa88bf952" ]
[ "models/fcn.py" ]
[ "from .base_model import BaseModel\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision import models\nfrom .helpers import get_upsampling_weight\nimport torch\nfrom itertools import chain\nfrom .FCtL import FCtL\n\n \nclass MiniFCN8(BaseModel):\n def __init__(self, num_classes, pretraine...
[ [ "torch.nn.Dropout", "torch.nn.Sequential", "torch.nn.ConvTranspose2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
Edward-HE/SDUWH_DIP_2020
[ "b0435590e0fb86d37964ad800806e31b9b4757f4" ]
[ "Dip_func/geometric_transformation.py" ]
[ "from math import *\n\nimport cv2\nimport numpy as np\n\n\ndef read_img(filename):\n \"\"\"读取图像函数,使用 imdecode读取,避免OpenCV在Windows下不支持中文路径的问题\"\"\"\n img = cv2.imdecode(np.fromfile(filename, dtype=np.uint8), -1)\n return img\n\n\ndef img_scale(img, multiples):\n \"\"\"图像缩放函数\"\"\"\n # INTER_NEAREST\t最近...
[ [ "numpy.float32", "numpy.fromfile" ] ]
zhuhao-nju/mofanerf
[ "0206526e25aab3dd8f0cc789f290c7559642676b", "0206526e25aab3dd8f0cc789f290c7559642676b" ]
[ "tools/train_data_pre/align_clip.py", "models/tex_encoder_mod.py" ]
[ "import json\nimport numpy as np\nimport os\nimport trimesh\n\n\ndef deleteFace(mesh, dis):\n meshDis = np.sqrt(np.sum(mesh.vertices ** 2, 1))\n vert_mask = (meshDis < dis)\n\n face_mask = vert_mask[mesh.faces].all(axis=1)\n mesh.update_faces(face_mask)\n mesh.remove_unreferenced_vertices()\n\n re...
[ [ "numpy.array", "numpy.sum", "numpy.load", "numpy.tensordot", "numpy.loadtxt", "numpy.argsort" ], [ "torch.nn.Linear", "torch.cat", "torch.nn.LeakyReLU", "torch.nn.Conv2d", "torch.nn.ZeroPad2d", "torch.nn.init.calculate_gain" ] ]
sarafina325/tardis
[ "9e398b34c702d22681699e38512f45d7c7f12454" ]
[ "tardis/montecarlo/packet_source.py" ]
[ "import numpy as np\nimport numexpr as ne\nfrom tardis import constants as const\n\nclass BlackBodySimpleSource(object):\n \"\"\"\n Simple packet source that generates packets for the Montecarlo part.\n This uses the algorithm described in Bjorkman & Wood 2001 (page 4) which\n references Carter & Cashw...
[ [ "numpy.random.seed", "numpy.ones", "numpy.prod", "numpy.arange", "numpy.random.random" ] ]
richardbaihe/robustLM
[ "fb36aa08cd886ad98f431647d9cb128879bb4382" ]
[ "src/utils/vocabulary.py" ]
[ "import os\nfrom collections import Counter, OrderedDict, defaultdict\n\nimport torch\nimport nltk\nfrom nltk.corpus import wordnet as wn\nfrom tokenizers import Tokenizer\n\nclass Vocab(object):\n def __init__(self, special=[], min_freq=1, max_size=None, lower_case=True,\n delimiter=None, vocab_...
[ [ "torch.cat", "torch.LongTensor" ] ]
jasondien/DeepFormants
[ "bdb36bc4a47b83084107b11dcf61218baaffb659" ]
[ "extract_features.py" ]
[ "__author__ = 'shua'\n\nimport argparse\nimport numpy as np\nimport wave\nimport os\nfrom os import listdir\nfrom os.path import isfile, join\nimport math\nfrom scipy.fftpack.realtransforms import dct\nfrom scipy.signal import lfilter, hamming\nfrom copy import deepcopy\nfrom scipy.fftpack import fft, ifft\nfrom sc...
[ [ "numpy.int", "numpy.asarray", "numpy.zeros", "numpy.float", "numpy.ones", "numpy.fft.fft", "scipy.fftpack.fft", "numpy.atleast_1d", "scipy.signal.lfilter", "scipy.fftpack.realtransforms.dct", "numpy.isrealobj", "numpy.log10", "numpy.conj", "numpy.linspace", ...
Arctanxy/W-Net-PyTorch
[ "3af8212356a591d9555da7193c07af1e12841599", "3af8212356a591d9555da7193c07af1e12841599" ]
[ "main.py", "src/preload_data.py" ]
[ "# train + validation | inference\r\nimport torch\r\nimport sys\r\nimport os\r\nimport os.path as osp\r\nfrom torchvision import transforms\r\nimport matplotlib.pyplot as plt\r\nfrom src.config import conf, infer_conf\r\nfrom src.trainer import Trainer\r\nfrom src.data import generate_img\r\nfrom src.model import W...
[ [ "matplotlib.pyplot.subplot", "torch.utils.data.DataLoader", "torch.load", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ], [ "torch.cat", "torch.utils.data.DataLoader", "torch.where" ] ]
staghuntrpg/rpg
[ "78901f0cb2505b08d7d09603d46515ef292a0784" ]
[ "GridWorld/envs/gw_multiagents/Agent.py" ]
[ "\"\"\"Base class for an agent that defines the possible actions. \"\"\"\n\n#from gym.spaces import Box\nfrom gym.spaces import Discrete\nimport numpy as np\n#import utils.utility_funcs as util\n\n# basic moves every agent should do\nAGENT_ACTIONS = {0: 'MOVE_LEFT', # Move left\n 1: 'MOVE_RIGHT', #...
[ [ "numpy.array" ] ]
IGITUGraz/Spike-Frequency-Adaptation-Supports-Network-Computations
[ "58a33584b34b477cfb1d3614460f66f94344fb9c" ]
[ "12AX_task/tests/test_functools.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom randomgen.generator import RandomGenerator\n\nfrom symltl import Task\nfrom symltl.dataset import spike_encode, generate_string_single_task\nfrom symltl.ftools import fchain, generatorify, fify\nfrom symltl.plot import plot_spikes\n\n\ndef test_fchain():\n ...
[ [ "matplotlib.pyplot.show", "numpy.random.rand", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots" ] ]
joschkabraun/jax
[ "2a9c2d22cfbaae1c6255e47be0afa7c370910ea3" ]
[ "jax/lax/lax.py" ]
[ "# Copyright 2018 Google LLC\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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.array_equal", "numpy.isposinf", "numpy.not_equal", "numpy.negative", "numpy.where", "numpy.finfo", "numpy.size", "numpy.cumsum", "numpy.issubdtype", "numpy.dtype", "numpy.max", "numpy.zeros_like", "numpy.less", "numpy.take", "numpy.prod", "num...
bsm8734/BC_stage2_Tabular_data_Classification
[ "e421360f3f6f9016c58bfff2dd20485206e4a365" ]
[ "code/src/features.py" ]
[ "import pandas as pd\nimport numpy as np\nimport os, sys, gc, random\nimport datetime\nimport dateutil.relativedelta\n\n# Machine learning\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.impute import SimpleImputer\nfrom sklearn.model_selection import StratifiedKFold\nfrom sklearn.metrics import roc_a...
[ [ "pandas.to_datetime", "sklearn.impute.SimpleImputer", "sklearn.preprocessing.LabelEncoder", "pandas.merge", "pandas.DataFrame", "pandas.read_csv" ] ]
rithram/lale
[ "66903f3a28a6099ef8e6d9ece4212cc432ec76cc" ]
[ "lale/lib/autoai_ts_libs/autoai_window_transformed_target_regressor.py" ]
[ "# Copyright 2020 IBM 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 agreed ...
[ [ "sklearn.pipeline.make_pipeline" ] ]
1050669722/LeetCode-Answers
[ "c8f4d1ccaac09cda63b60d75144335347b06dc81" ]
[ "Python/problem0509.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat May 25 17:27:57 2019\n\n@author: Administrator\n\"\"\"\n\nimport time\n\ntime1 = time.perf_counter()\n\nclass Solution:\n def fib(self, N: int) -> int:\n# if N == 0:\n# return 0\n# if N == 1:\n# return 1\n# return self.fi...
[ [ "numpy.array", "numpy.dot" ] ]
TenaciousC22/deep_avsr
[ "74cbc1bfc45ee025ce38bcd1286a5a2aade76aef" ]
[ "audio_visual/demo.py" ]
[ "\"\"\"\nAuthor: Smeet Shah\nCopyright (c) 2020 Smeet Shah\nFile part of 'deep_avsr' GitHub repository available at -\nhttps://github.com/lordmartian/deep_avsr\n\nSpecifications:\n--------------\nVideofile - .mp4 file\nProperties - Video:\n 25 fps, 160x160 RGB frames, Mouth approx. in center,\n ...
[ [ "torch.device", "numpy.random.seed", "torch.no_grad", "torch.manual_seed", "torch.cuda.is_available", "torch.load" ] ]
fataik1/DS-Unit-3-Sprint-2-SQL-and-Databases
[ "7c77b4099c967bbfd2453dba73338893403f9912" ]
[ "module2-sql-for-analysis/titanic.py" ]
[ "# import appropriate modules\nimport pandas as pd\nimport psycopg2\nimport os\nfrom dotenv import load_dotenv\n\n# load contents of the .env file into the script's environment\nload_dotenv()\n\n# Read in the data from the local file path or website\ndf = pd.read_csv('C:/Users/kingf/Unit3/DS-Unit-3-Sprint-2-SQL-and...
[ [ "pandas.read_csv" ] ]
liujiamingustc/phd
[ "4f815a738abad43531d02ac66f5bd0d9a1def52a" ]
[ "docker/optimization/pyOpt/tags/v1.2.0/pyOpt/pyMMFD/setup.py" ]
[ "#!/usr/bin/env python\n\nimport os,sys\n\n\ndef configuration(parent_package='',top_path=None):\n \n from numpy.distutils.misc_util import Configuration\n \n config = Configuration('pyMMFD',parent_package,top_path)\n \n config.add_library('mmfd',\n sources=[os.path.join('source', '*.f')])\...
[ [ "numpy.distutils.misc_util.Configuration" ] ]
jinhang/fcn
[ "b99cb3464efbb9ea9e5850ab15450219266229bf" ]
[ "examples/apc2015/forward.py" ]
[ "#!/usr/bin/env python\n\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import unicode_literals\nimport argparse\nimport os\nimport os.path as osp\nimport sys\n\nfrom chainer import cuda\nimport chainer.serializers as S\nfrom chainer import Variable\nimport numpy as np\nfro...
[ [ "numpy.array", "numpy.ones", "scipy.misc.imread", "numpy.argmax", "numpy.vstack", "scipy.misc.imsave", "numpy.hstack", "numpy.unique" ] ]
slc-data/2021-datathon
[ "10e65c28001382527d0969cf12bd003fd2cd4aff" ]
[ "workbooks/sam/wrangle.py" ]
[ "import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n# turn off pink warning boxes\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\nimport sklearn\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import MinMaxScaler\n#--------...
[ [ "pandas.to_datetime", "pandas.cut", "pandas.DataFrame", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.pyplot.ylabel", "pandas.concat", "sklearn.model_selection.train_test_split", "pandas.read_csv", "pandas.to_numeric", ...
redxe/learn-qc-with-python-and-qsharp
[ "3b0a493d49b1eed38e2e92a3acf463a58d85667f" ]
[ "ch09/host.py" ]
[ "#!/bin/env python\n# -*- coding: utf-8 -*-\n##\n# host.py: Runs the host program for the phase estimation quantum algorithm.\n##\n# Copyright (c) Sarah Kaiser and Chris Granade.\n# Code sample from the book \"Learn Quantum Computing with Python and Q#\" by\n# Sarah Kaiser and Chris Granade, published by Manning Pu...
[ [ "numpy.sin", "scipy.optimize.curve_fit", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.linspace", "numpy.random.random" ] ]
Horta/limix-inference
[ "1ba102fc544f8d307412d361b574da9d4c166f8e" ]
[ "glimix_core/_ep/posterior_linear_kernel.py" ]
[ "from numpy import dot\n\nfrom .posterior import Posterior\n\n\ndef _cho_factor(B):\n from scipy.linalg import cho_factor\n\n B = cho_factor(B, overwrite_a=True, lower=True, check_finite=False)[0]\n return B\n\n\nclass PosteriorLinearKernel(Posterior):\n \"\"\"\n EP posterior.\n\n It is given by :...
[ [ "numpy.dot", "scipy.linalg.cho_factor" ] ]
xu-zhiwei/easyrec
[ "4e42a356efe799bcd469a568d356852e4230bbc8" ]
[ "easyrec/models/dcn.py" ]
[ "import tensorflow as tf\nfrom tensorflow.keras.layers import DenseFeatures, Dense\n\nfrom easyrec import blocks\n\n\nclass DCN(tf.keras.models.Model):\n \"\"\"\n Deep & Cross Network (DCN).\n Reference: Ruoxi Wang et al. Deep & Cross Network for ad Click Predictions. ADKDD. 2017.\n \"\"\"\n\n def __...
[ [ "tensorflow.concat", "tensorflow.expand_dims", "tensorflow.random.normal", "tensorflow.matmul", "tensorflow.keras.layers.Dense", "tensorflow.feature_column.embedding_column" ] ]
cybergis/nfie-inunmap
[ "8efb7c08759a3be651afef195d8cecd3f9f9fabd" ]
[ "src/calculate_hydraulic_properties/src/Hydraulic_Property_V2.1a.py" ]
[ "# ##########################################################\n# FILENAME: Hydraulic_Property_Calculation.py\n# VERSION: 2.1a\n# SINCE: 2016-08-09\n# AUTHOR: Xing Zheng - zhengxing@utexas.edu\n# Description:This program is designed for evaluating\n# NHD Flowline Hydraulic Properties ...
[ [ "numpy.asarray", "numpy.diff", "numpy.arange", "numpy.column_stack", "numpy.ma.masked_where" ] ]
QuantFinEcon/java-learn
[ "d844f2b0339b3e89ea64f8b498b4a682fcef3f73" ]
[ "h2o-3-master/h2o-py/h2o/frame.py" ]
[ "# -*- encoding: utf-8 -*-\n\"\"\"\nH2O data frame.\n\n:copyright: (c) 2016 H2O.ai\n:license: Apache License Version 2.0 (see LICENSE for details)\n\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport csv\nimport datetime\nimport functools\nimport os\nimport sys\nim...
[ [ "matplotlib.use", "scipy.sparse.issparse", "scipy.sparse.find", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.bar" ] ]
mikuh/bert-tf2-keras
[ "e361a0e7dc9fa0d64c48ac41320d302599dba025" ]
[ "layers/attention.py" ]
[ "import math\nimport tensorflow as tf\nfrom layers import dense_einsum, masked_softmax\n\nclass MultiHeadAttention(tf.keras.layers.Layer):\n \"\"\"MultiHeadAttention layer.\n\n This is an implementation of multi-headed attention based on \"Attention\n is all you Need\". If `from_tensor` and `to_tensor` are...
[ [ "tensorflow.keras.initializers.get", "tensorflow.keras.regularizers.get", "tensorflow.keras.regularizers.serialize", "tensorflow.keras.layers.Dropout", "tensorflow.keras.constraints.get", "tensorflow.keras.initializers.serialize", "tensorflow.einsum", "tensorflow.keras.constraints....
aimat-lab/MOF_web_interface
[ "f2c38e8f39bc9e1ae5cc869e8995a804039780ab" ]
[ "AI/cluster_extraction.py" ]
[ "from molSimplify.Scripts.cellbuilder_tools import *\nfrom molSimplify.Classes import mol3D\nfrom molSimplify.Informatics.autocorrelation import*\nfrom molSimplify.Informatics.misc_descriptors import*\nfrom molSimplify.Informatics.graph_analyze import*\nfrom molSimplify.Informatics.RACassemble import *\nimport os\n...
[ [ "numpy.array", "scipy.sparse.csgraph.connected_components", "numpy.nonzero", "numpy.ix_", "numpy.unique" ] ]
quantshah/jax
[ "99944d12045a8e16b42003c3f08fc60e8f3e2ec8" ]
[ "tests/jet_test.py" ]
[ "# Copyright 2020 Google LLC\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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.random.RandomState" ] ]
chuanyun/deepwater
[ "d5311c8c667df5e9264df096687581480f96fc5e" ]
[ "python/deepwater/models/mlp.py" ]
[ "from deepwater.models import BaseImageClassificationModel\n\nimport tensorflow as tf\n\nfrom tensorflow.python.ops import nn\n\nfrom deepwater.models.nn import fc\n\nclass MultiLayerPerceptron(BaseImageClassificationModel):\n def __init__(self, width=28, height=28, channels=1, classes=10,\n hidd...
[ [ "tensorflow.zeros", "tensorflow.constant", "tensorflow.variable_scope", "tensorflow.placeholder", "tensorflow.nn.softmax", "tensorflow.placeholder_with_default", "tensorflow.nn.dropout" ] ]
theSoenke/rlgraph
[ "a5ebf55820bce2d02dff22bb6db6247699fd6740" ]
[ "rlgraph/components/explorations/exploration.py" ]
[ "# Copyright 2018/2019 The RLgraph 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 re...
[ [ "torch.distributions.Uniform", "tensorflow.shape", "tensorflow.cond", "torch.where", "tensorflow.logical_and" ] ]
AmBarry/compare-surf-tools
[ "309f816f86c20ef38042973437d72681209ea3e4" ]
[ "lib/unit_tests.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# @author Nikhil Bhagawt\n# @date 1 Feb 2019\n\nimport numpy as np\nimport pandas as pd\nimport itertools\nfrom sklearn import svm\n\nfrom data_handling import *\nfrom data_stats import *\n\n\n# Data paths\nproj_dir = '/Users/nikhil/code/git_repos/compare-surf-tools/'\ndata_dir = proj_d...
[ [ "pandas.read_csv", "numpy.mean", "pandas.merge" ] ]
YevhenVieskov/ML-DL-in-production
[ "03839abcb93a49d4f05c43aa4e446a040027cdb0" ]
[ "aws_lambda/pytorch/source/torchvision/models/resnet.py" ]
[ "import torch.nn as nn\nimport math\nimport torch.utils.model_zoo as model_zoo\n\n\n__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',\n 'resnet152']\n\n\nmodel_urls = {\n 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',\n 'resnet34': 'https://download.pyto...
[ [ "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.utils.model_zoo.load_url", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
lyonva/Nue
[ "90680de00b0c76f6bfdbed71b785671e7c3a3f54" ]
[ "src/map/selection_db.py" ]
[ "from map import Database\nfrom sklearn.feature_selection import chi2, f_classif, f_regression\nfrom sklearn.feature_selection import SelectKBest, SelectPercentile,\\\n SelectFpr, SelectFdr, SelectFwe, RFE, VarianceThreshold\nfrom sklearn.ensemble import RandomForestRegressor\nfrom selection import AttributeSele...
[ [ "sklearn.ensemble.RandomForestRegressor" ] ]
ChickenTarm/NBA_Fantasy_Winner
[ "a9f31653e773f9a77e4f9e73a34ade1f64560cd9" ]
[ "src/make_streak_dataframe.py" ]
[ "import pandas as pd\nimport os\n\n\ndef get_streak(gr_df, date, team):\n previous_games = gr_df[((gr_df['home'] == team) | (gr_df['away'] == team)) & (gr_df['date'] < date)].iloc[::-1]\n\n first_game = True\n streak_type = \"\"\n\n streak = 0\n\n for index, game in previous_games.iterrows():\n ...
[ [ "pandas.read_pickle", "pandas.DataFrame", "pandas.set_option" ] ]
Zoufalc/qiskit-machine-learning
[ "aae3941214cd9667a53b643f229d11d0bff32c60" ]
[ "qiskit_machine_learning/datasets/iris.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2018, 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio...
[ [ "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.title", "matplotlib.pyplot.scatter", "sklearn.preprocessing.MinMaxScaler", "numpy.append", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.show", "sklearn.decomposition.PCA", "sklearn.datasets.load_iris" ...
dannyhung1128/pytorch-semseg
[ "3574c7a055be093340b3b044cbd074f31638a0a4" ]
[ "ptsemseg/models/pspnetXception.py" ]
[ "import os\nimport sys\nsys.path.insert(0, os.getcwd())\nimport torch\nimport numpy as np\nimport torch.nn as nn\n\nfrom math import ceil\nfrom torch.autograd import Variable\n\nfrom ptsemseg import caffe_pb2\nfrom ptsemseg.models.utils import *\nfrom ptsemseg.loss import *\nfrom ptsemseg.utils import convert_state...
[ [ "numpy.array", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.utils.model_zoo.load_url", "scipy.misc.imresize", "torch.from_numpy", "scipy.misc.imread", "torch.nn.ReLU", "torch.nn.Conv2d", "scipy.misc.imsave", "torch.nn.Dropout2d" ] ]
adalisan/Protein3D
[ "9af2f6e9277050fbd290d1452203f3f74912a330" ]
[ "Protein3D/construct.py" ]
[ "#%%\nimport os\nimport pickle\nimport torch\nimport requests\nfrom Bio.PDB import PDBParser\nfrom Bio.PDB.NeighborSearch import NeighborSearch\n\nimport numpy as np\nimport pandas as pd\n\nos.path.abspath(os.curdir)\nos.chdir('/home/flower/github/Protein3D/Protein3D')\nos.path.abspath(os.curdir)\n\ndata_dir = '../...
[ [ "numpy.concatenate", "pandas.read_csv", "torch.load" ] ]
hinha/kalkula-extension
[ "57163eaf55d0a734e65afe8af6bb35fe07c03b55" ]
[ "src/source/pandas.py" ]
[ "import pandas as pd\nimport gc\n\n\nclass Type:\n\n def __init__(self, data: list):\n self.data = data\n self.df = pd.DataFrame(data)\n\n def result(self):\n idTypeFilter = []\n for idtype in self.df.dtypes:\n if idtype == \"object\":\n idtype = \"string\...
[ [ "pandas.DataFrame" ] ]
hfpmatheus/health_insurance_cross_sell
[ "1367b7a82cccb44d0c7ee159dc2385a0c753c6ae" ]
[ "health_insurance_app_builder/healthinsurance/HealthInsurance.py" ]
[ "import pickle\nimport pandas as pd\n\nclass HealthInsurance( object ):\n def __init__ (self):\n self.age_scaler = pickle.load( open( 'encoders/age_scaler.pkl', 'rb' ) )\n self.annual_scaler = pickle.load( open( 'encoders/annual_scaler.pkl', 'rb' ) )\n self.gender_encoding...
[ [ "pandas.get_dummies" ] ]
weisheik/Burrata
[ "4cce27c84cc5f32cd6f6e32315b3ae5db6eb65b9" ]
[ "Python/get_sp500_wiki.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Oct 27 21:43:06 2019\n\n@author: CHEO\n\"\"\"\n\nimport requests\nfrom bs4 import BeautifulSoup\nimport pandas as pd\n\n# Get S&P500 stocks names\ndef getSp500():\n print(\"Getting SP500 stocks names from Wikipedia\")\n \n resp = requests.get('http://en.wiki...
[ [ "pandas.DataFrame" ] ]
jadenvc/ARS
[ "f4082b3a71b1f8255e8d74ebfe4aa4bda668145f" ]
[ "arspb/filter.py" ]
[ "# Code in this file is copied and adapted from\n# https://github.com/ray-project/ray/blob/master/python/ray/rllib/utils/filter.py\n\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\n\n\nclass Filter(object):\n \"\"\"Processes...
[ [ "numpy.square", "numpy.asarray", "numpy.zeros", "numpy.copy", "numpy.ones", "numpy.random.randn", "numpy.mean", "numpy.allclose", "numpy.sqrt", "numpy.var" ] ]
kant/qmt
[ "4ed096704a2e11dbebfe7db50c86920ac7cb7b94" ]
[ "tests/test_tasks.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\n\"\"\"Testing Task framework.\"\"\"\n\n\ndef test_task_init(fix_task_env):\n input_task_example, gathered_task_example, post_processing_task_example = fix_task_env\n parts = {'a': [0., 1., 2.], 'b': [-3., 10., 2...
[ [ "numpy.all", "numpy.sum", "numpy.linspace" ] ]
AurelienNioche/ActiveTeachingPlanning
[ "1a82745be1f12d3a368409aa8c39ac54959b086a" ]
[ "optimize_delta_coefficient.py" ]
[ "import logging\nimport sys\nimport random\n\nimport numpy as np\nimport optuna\n\nfrom a2c.a2c import A2C\nfrom a2c.callback import ProgressBarCallback\n\nfrom environments.continuous_teaching import ContinuousTeaching\n\nfrom human_agents import generate_agents\n\nN_USERS = 30\nN_ITEMS = 30\nrandom.seed(123)\ntes...
[ [ "numpy.sum", "numpy.array" ] ]
alex-yin/rMNIST
[ "21ac16188f7792f4a44bf5ce4f55d55f501b1038" ]
[ "plot_mnist.py" ]
[ "\"\"\"plot_mnist.py\n~~~~~~~~~~~~~~~~\n\nUse to plot MNIST images.\n\"\"\"\n\n# Third-party libraries\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndef plot_mnist(elts, m, n):\n \"\"\"Plot MNIST images in an m by n table. Note that we crop the images\n so that they appear reasona...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.show", "numpy.array", "matplotlib.pyplot.figure" ] ]
GillinedUp/video-games-data-integration
[ "8ed6fd5af3d67dd9ba9154de2ec9e196d121b7ee" ]
[ "data_analysis.py" ]
[ "import pandas as pd\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom matplotlib.ticker import StrMethodFormatter\nfrom sklearn.model_selection import train_test_split\nfrom sklearn import svm\nfrom sklearn.preprocessing import OneHotEncoder\nfrom sklearn.metric...
[ [ "numpy.empty", "sklearn.metrics.mean_absolute_error", "sklearn.svm.SVR", "sklearn.model_selection.train_test_split", "pandas.read_csv", "sklearn.preprocessing.OneHotEncoder" ] ]
chxw20/graph-optimal-transport
[ "2b5c6345b8f85a2db4a35b8a4f619663b09628ef" ]
[ "BAN_vqa/utils.py" ]
[ "\"\"\"\nThis code is extended from Hengyuan Hu's repository.\nhttps://github.com/hengyuan-hu/bottom-up-attention-vqa\n\"\"\"\nfrom __future__ import print_function\n\nimport errno\nimport os\nimport re\nimport collections\nimport numpy as np\nimport operator\nimport functools\nfrom PIL import Image\nimport torch\n...
[ [ "numpy.array", "torch.stack", "torch.is_tensor", "torch.save", "numpy.mean", "torch.from_numpy", "torch.abs", "torch.DoubleTensor", "torch.LongTensor", "torch.load", "numpy.abs", "torch.utils.data.dataloader.default_collate" ] ]
jerryduncan/pipsProphet
[ "f85b0e4e85a00856c2b8885d71abd9a23f6fef89" ]
[ "DQN/policy.py" ]
[ "from __future__ import division\nimport numpy as np\n\nfrom rl.util import *\n\n\nclass Policy(object):\n \"\"\"Abstract base class for all implemented policies.\n\n Each policy helps with selection of action to take on an environment.\n\n Do not use this abstract base class directly but instead use one o...
[ [ "numpy.random.random_integers", "numpy.sum", "numpy.ones", "numpy.random.gumbel", "numpy.random.uniform", "numpy.argmax", "numpy.sqrt", "numpy.clip" ] ]
roguextech/Waterloo-Rocketry-topside
[ "345e7d47efdac04c2c5f70d55f83bd77acdbb511" ]
[ "topside/visualization/tests/layout_demo.py" ]
[ "import matplotlib.pyplot as plt\n\nimport topside as top\n\n\ndef make_engine():\n states = {\n 'static': {\n (1, 2, 'A1'): 1,\n (2, 1, 'A2'): 1\n }\n }\n edges = [(1, 2, 'A1'), (2, 1, 'A2')]\n\n mapping = {'c1': {1: 'atm', 2: 1},\n 'c2': {1: 1, 2: 2},\...
[ [ "matplotlib.pyplot.show" ] ]
Naiko90/GoldenEagle
[ "dbfd2ed9a6d164f3aab4b605ed518eb033bea8b9" ]
[ "src/compare.py" ]
[ "from haarPsi import haar_psi\r\nimport mpl_interaction as mpl\r\nimport matplotlib.gridspec as gridspec\r\nimport matplotlib.pyplot as plt\r\nfrom multiprocessing.pool import ThreadPool\r\nimport sys\r\nimport os.path\r\nimport imghdr\r\nimport time\r\nimport cv2\r\nimport numpy as np\r\nimport argparse\r\nimport ...
[ [ "numpy.concatenate", "numpy.logical_or", "numpy.array", "numpy.zeros", "matplotlib.pyplot.get_current_fig_manager", "numpy.logical_and", "matplotlib.pyplot.figure", "numpy.float32", "numpy.amax", "numpy.argwhere", "matplotlib.pyplot.show", "numpy.int32", "matplo...
Oxygen-Chen/vision
[ "b37c8a3ca4c9c626cdac763c6be697231665b0f8" ]
[ "torchvision/datasets/widerface.py" ]
[ "import os\nfrom os.path import abspath, expanduser\nfrom typing import Any, Callable, List, Dict, Optional, Tuple, Union\n\nimport torch\nfrom PIL import Image\n\nfrom .utils import (\n download_file_from_google_drive,\n download_and_extract_archive,\n extract_archive,\n verify_str_arg,\n)\nfrom .visio...
[ [ "torch.tensor" ] ]
Ayushk4/stance-dataset
[ "e14a1e05cd43c134b1c83ff645b308886da5a427" ]
[ "misc-baselines/prepare_glove.py" ]
[ "# Ip: glove/smaller.json\n# Op: glove/prepared.json\n\n# Adds to vocab, the tokens with more than 10 occurrences\n# Handle special tokens.\n\nimport argparse\nimport json\nfrom collections import Counter\nimport numpy as np\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--glove_dims\", default=200, t...
[ [ "numpy.random.uniform" ] ]
pdvanmeter/meSXR
[ "c281e15c5fd01591bba9e0c1510f83c5f7ef771a", "c281e15c5fd01591bba9e0c1510f83c5f7ef771a" ]
[ "mst_ida/models/base/response.py", "mst_ida/models/base/profile_base.py" ]
[ "\"\"\"\n\"\"\"\nimport os\nimport pickle\nimport numpy as np\nimport scipy as sp\nimport scipy.special\n\n# Load the mu coefficients for filter transmission calculations\nMODULE_PATH = os.path.dirname(__file__)\nwith open(os.path.join(MODULE_PATH, 'filter_mu.pkl'), 'rb') as f:\n MU_DICT = pickle.load(f, enc...
[ [ "numpy.zeros", "numpy.interp", "numpy.amax", "numpy.sqrt", "numpy.amin" ], [ "numpy.logical_not", "numpy.array", "numpy.reshape", "numpy.minimum", "numpy.ones", "numpy.interp", "numpy.exp", "numpy.amin", "numpy.atleast_1d", "numpy.arctan2", "nump...
sifei/PyTorchModel
[ "6fcf00f9d8340f8a4caa704427c1ce44fbc125a9" ]
[ "models/models/model.py" ]
[ "import os\nfrom torch.autograd import Variable\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nConvMethod = \"in_channel_is_embedding_dim\"\nclass CNN(nn.Module):\n\tdef __init__(self, **kwargs):\n\t\tsuper(CNN, self).__init__()\n\t\t\n\t\tself.MODEL = kwargs[\"MODEL\"]\n\t\tself.BATCH_SIZE ...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.nn.LSTM", "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.nn.functional.dropout", "torch.nn.functional.log_softmax", "torch.from_numpy", "torch.nn.ReLU", "torch.nn.MaxPool1d", "torch.nn.Embedding" ] ]
harry-2016/seqlearn
[ "757d9882599a4b689f901e1f1a41dc3c6f408887" ]
[ "seqlearn/evaluation.py" ]
[ "from functools import partial\nfrom warnings import warn\n\nimport numpy as np\nfrom sklearn.externals import six\n\nfrom ._utils import check_random_state\n\n\ndef bio_f_score(y_true, y_pred):\n \"\"\"F-score for BIO-tagging scheme, as used by CoNLL.\n\n This F-score variant is used for evaluating named-ent...
[ [ "numpy.asarray", "numpy.zeros", "numpy.argmin", "numpy.sum", "sklearn.externals.six.moves.xrange", "numpy.any", "numpy.where", "numpy.cumsum", "numpy.vstack" ] ]
IPL-UV/gaussflow
[ "49336e5384856a86aaa4ab1a79bda1b8719b939d" ]
[ "src/viz/bivariate.py" ]
[ "import matplotlib.pyplot as plt\nimport seaborn as sns\nimport numpy as np\n\nimport wandb\n\nsns.set_context(context=\"talk\", font_scale=0.7)\n\n\ndef plot_2d_joint(\n data,\n color=\"blue\",\n kind=\"kde\",\n wandb_logger=None,\n log_name=\"\",\n **kwargs,\n):\n\n plt.figure(figsize=(5, 5))...
[ [ "matplotlib.pyplot.colorbar", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "numpy.meshgrid" ] ]
mibrahimali/CarND-Behavioral-Cloning-P3
[ "c7e0ef806b3f2046614f44bf550b8e5c1f3d782c" ]
[ "data_generator.py" ]
[ "import numpy as np\nimport cv2\nimport csv\nfrom matplotlib import pyplot as plt\nimport random\n\n\ndef dataset_generator(batch_size=32, paths=[]):\n image_width = 200\n image_height = 66\n image_channels = 3\n\n # Load Dataset Paths to memory to facilitate interaction between generator and dataset\n ...
[ [ "numpy.random.choice", "numpy.zeros", "matplotlib.pyplot.yticks", "matplotlib.pyplot.show", "matplotlib.pyplot.xticks", "numpy.fliplr" ] ]
parth2608/NPTEL-Joy-of-computing-with-Python
[ "ab1bf72612ec386da5bf3e5669145859814ef51c" ]
[ "Lottery_Simulation.py" ]
[ "import random\r\nimport matplotlib.pyplot as plt\r\n\r\naccount = 0\r\nx = []\r\ny = []\r\nfor i in range(365):\r\n x.append(i+1)\r\n bet = random.randint(1, 10)\r\n lucky_draw = random.randint(1, 10)\r\n# print(\"Bet: \", bet)\r\n# print(\"Lucky draw: \", lucky_draw)\r\n if bet == lucky_draw:\r\n ...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
zhenjiaa/ssd.pytorch
[ "4d72ae69edb4737dfa3eec4526f27967b1603fa5" ]
[ "ssd_two_stage_end2end_FV_CIoU.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom layers import *\nfrom data import two_stage_end2end, change_cfg_for_ssd512\nimport os\nimport numpy as np\n\nfrom layers.modules import ProposalTargetLayer_offset\n# https://github.com/longcw/RoIAlign.py...
[ [ "torch.cat", "torch.nn.ModuleList", "torch.nn.BatchNorm2d", "torch.ones", "torch.cuda.is_available", "torch.load", "torch.nn.Softmax", "torch.nn.MaxPool2d", "torch.autograd.Variable", "torch.IntTensor", "torch.FloatTensor", "torch.tensor", "torch.empty", "to...
dannieldwt/FedMAX
[ "7221af4fa4e48bc789bf8c3a50013bc4b07f77b8" ]
[ "digit_object_recognition/models/Update.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Python version: 3.6\n\nimport torch\nfrom torch import nn, autograd\nfrom torch.utils.data import DataLoader, Dataset\nfrom tqdm import tqdm\nimport copy\n\n\nclass DatasetSplit(Dataset):\n def __init__(self, dataset, idxs):\n self.dataset = dataset\n ...
[ [ "torch.nn.LogSoftmax", "torch.nn.MSELoss", "torch.nn.Softmax", "torch.autograd.Variable", "torch.norm", "torch.nn.KLDivLoss", "torch.nn.CrossEntropyLoss" ] ]
riccardopoiani/recsys_2019
[ "47a44d2f7d85e76e31dacf4ba2e69721d010b6b8", "47a44d2f7d85e76e31dacf4ba2e69721d010b6b8" ]
[ "src/model/HybridRecommender/HybridRerankingRecommender.py", "src/plots/recommender_plots.py" ]
[ "from abc import ABC\n\nimport numpy as np\nimport scipy.sparse as sps\n\nfrom src.model.HybridRecommender.AbstractHybridRecommender import AbstractHybridRecommender\n\n\n# --------- UTILITY ---------\ndef get_ui_matrix_from_ranking(ranking, scores, n_users, n_items):\n ranking_ui_matrix = sps.coo_matrix((n_user...
[ [ "numpy.max", "scipy.sparse.coo_matrix", "numpy.array", "numpy.reshape", "numpy.zeros", "numpy.ones", "numpy.min", "numpy.arange", "numpy.isscalar", "numpy.argsort", "numpy.atleast_1d", "numpy.maximum" ], [ "numpy.concatenate", "numpy.array", "numpy.a...
wagnew3/Amodal-3D-Reconstruction-for-Robotic-Manipulationvia-Stability-and-Connectivity--Release
[ "f55c6b0fac44d9d749e7804d99169a39d30c2111", "f55c6b0fac44d9d749e7804d99169a39d30c2111" ]
[ "simulation/generate_missing_data.py", "genre/loggers/loggers.py" ]
[ "\"\"\" This code is a python script that essentially replicates the code in simulating_data.ipynb\n\n As a script, this can be called many times with a bash script. This helps when I need to kill\n the process due to the weird memory leak in PyBullet.\n\n To call this script:\n $:~ python generate_data...
[ [ "numpy.count_nonzero", "numpy.unique" ], [ "numpy.array", "numpy.isnan", "numpy.random.rand", "numpy.random.randint", "tensorflow.Summary.Value" ] ]
dkang13/GeostatsPy
[ "246d15ec7a5e979460c9073475058336115c2908" ]
[ "geostatspy/geostats.py" ]
[ "\"\"\"\nThis file includes the reimplementations of GSLIB functionality in Python. While\nthis code will not be as well-tested and robust as the original GSLIB, it does\nprovide the opportunity to build 2D spatial modeling projects in Python without\nthe need to rely on compiled Fortran code from GSLIB. If you wan...
[ [ "scipy.spatial.cKDTree", "numpy.random.rand", "numpy.copy", "numpy.min", "numpy.mean", "numpy.exp", "numpy.where", "numpy.linalg.lstsq", "numpy.cos", "numpy.max", "numpy.sin", "numpy.log", "numpy.sqrt", "numpy.column_stack", "numpy.linalg.inv", "nump...
hayoc/peepo_prototype
[ "b15fd18d0f618e1e24eadc97c72fde62039ddafb" ]
[ "peepo/playground/simple_color_recognition/color_recognition_from_structure.py" ]
[ "#28/12/2018\nimport logging\nimport math\n\nimport matplotlib.pyplot as plt\nimport networkx as nx\nimport numpy as np\nfrom pomegranate import *\n\nfrom peepo.playground.simple_color_recognition.CeePeeDees import CPD\nfrom peepo.utilities.lattices import Lattices\nfrom peepo.utilities.utilities import Utilities\n...
[ [ "numpy.full", "numpy.asarray", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.figure", "numpy.prod", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter" ] ]
rohskopf/modulant
[ "eaaacd70a5f5811798b25e7447fdf76ab69b97c3" ]
[ "example/gen_data.py" ]
[ "import numpy as np\n\ndef function(x):\n value = 0.\n for i in range(0,ninputs):\n value+=x[i]**2\n return value\n\nnsamples = 4\nninputs = 2\nnoutputs = 1\n\nfh_in = open('TIN', 'w')\nfh_out = open('TOUT', 'w')\nfor d in range(0,nsamples):\n x = np.random.uniform(low=-1., high=1., size=ninputs)...
[ [ "numpy.random.uniform" ] ]
criterion-ai/criterion_core
[ "51298d3d3ff80bf9f4c85adf6a9b40742b0f0d06" ]
[ "criterion_core/utils/bayer_demosaic.py" ]
[ "import tensorflow as tf\nfrom tensorflow.keras.layers import Conv2D\nimport numpy as np\n\nkernels = {\n \"bgr\": np.array([[[1, 0, 0], [0, 0.5, 0]], [[0, 0.5, 0], [0, 0, 1]]]),\n \"rgb\": np.array([[[0, 0, 1], [0, 0.5, 0]], [[0, 0.5, 0], [1, 0, 0]]]),\n}\n\ndef BayerDemosaic(mode=\"rgb\"):\n kernel = ker...
[ [ "tensorflow.keras.layers.Conv2D", "numpy.array", "tensorflow.nn.conv2d" ] ]
wakafengfan/simcse-pytorch
[ "8b28715750aefe4f181c91099d6a09930295c896" ]
[ "train_and_eval.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom transformers import BertPreTrainedModel, BertModel, AutoConfig\n\nfrom bojone_snippets import DataGenerator, sequence_padding\nfrom bojone_tokenizers import Tokenizer\nfrom configuration.config import *\nfrom opt import create_optimizer_and...
[ [ "torch.nn.functional.normalize", "torch.no_grad", "torch.cuda.is_available", "torch.nn.BCEWithLogitsLoss" ] ]
rdenham/jug
[ "9c5e3930777658699bc9579c872a010a7c3bffe3" ]
[ "jug/tests/test_compound.py" ]
[ "import inspect\nimport os\n\nimport jug.compound\nimport jug.mapreduce\nimport numpy as np\nfrom jug.backends.dict_store import dict_store\nfrom jug.tests.utils import simple_execute\nfrom jug.compound import CompoundTask\nfrom jug.tests.test_mapreduce import mapper, reducer, dfs_run\nfrom jug.tests.task_reset imp...
[ [ "numpy.random.rand" ] ]
axiserr/Hetu
[ "0052f727488db0570d6b37f63549b43b0920bc29" ]
[ "examples/nlp/bert/hetu_bert.py" ]
[ "import hetu as ht\nimport numpy as np\n\n'''\nBert Module Architecture & Input/Output Tensor Size\n\nBertModel Inputs: \n input_ids: [batch_size, seq_len], word token indices in the vocabulary\n\nBertModel Outputs:\n sequence_output: [batch_size, seq_len, hidden_size] (from BertEncoder)\n pooled_output: [...
[ [ "numpy.arange" ] ]
fbottarel/Mask_RCNN
[ "3e2a9152a85a72c589d0fc0b77ddcfed3561d302" ]
[ "samples/tabletop/tabletop.py" ]
[ "\"\"\"\nMask R-CNN\n\nCopyright (c) 2018 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\nTrain, Detect and Evaluate on a Tabletop dataset\nAdapted by Fabrizio Bottarel (fabrizio.bottarel@iit.it)\n\n------------------------------------------------------------...
[ [ "numpy.any", "numpy.stack", "numpy.mean", "numpy.ones" ] ]
vikasj78/gammapy
[ "46deb872bbcbf36748df71e659dc3fa592f6dc27" ]
[ "gammapy/modeling/fit.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nimport logging\nimport numpy as np\nfrom astropy.utils import lazyproperty\nfrom .covariance import Covariance\nfrom .iminuit import confidence_iminuit, covariance_iminuit, mncontour, optimize_iminuit\nfrom .scipy import confidence_scipy, optimize_sc...
[ [ "numpy.all", "numpy.array", "numpy.linspace", "numpy.isnan" ] ]
Mr-Kumar-Abhishek/tensordrift
[ "21fac39c471dede0e4ae62dd60e2b0b85db48415", "21fac39c471dede0e4ae62dd60e2b0b85db48415" ]
[ "tensorflow/python/training/queue_runner_test.py", "tensorflow/python/kernel_tests/parsing_ops_test.py" ]
[ "\"\"\"Tests for QueueRunner.\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport time\n\nimport tensorflow.python.platform\n\nimport tensorflow as tf\n\n\nclass QueueRunnerTest(tf.test.TestCase):\n\n def testBasic(self):\n with self.te...
[ [ "tensorflow.initialize_all_variables", "tensorflow.train.Coordinator", "tensorflow.FIFOQueue", "tensorflow.Variable", "tensorflow.train.QueueRunner", "tensorflow.constant", "tensorflow.test.main" ], [ "tensorflow.train.BytesList", "tensorflow.train.FloatList", "tensorfl...
vignesh-pagadala/worm-propagation-simulator
[ "665d05b4bb27d8d57d7886923f3787192eb61ef7" ]
[ "backup/Project22.py" ]
[ "# Project 2\n# Get graph from CSV and run simulation.\nimport random\nimport csv\nimport networkx as nx\nimport matplotlib.pyplot as plt\nimport time\nimport sys\n\nfilename = sys.argv[1]\n\nwith open(filename, 'r') as f:\n reader = csv.reader(f)\n edgeList = list(reader)\n\nedgeList = [[int(float(j)) for j ...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot" ] ]
Billy-The-Squid/Cayley
[ "8e1884358c10e410c3b236d2be700726e84c6df2" ]
[ "classes/abstractnetwork.py" ]
[ "\"\"\"\nAuthors: Justin Pusztay\nFilename: abstractnetwork.py\nProject: Research for Irina Mazilu, Ph.D.\n\nAbstraction of all graphs created. These are methods that can be\nimplemented across many different graph objects. Examples included\nCayley Tree and Lattice. \n\"\"\"\n\n__author__ = \"\\n\".join(['Justin P...
[ [ "numpy.zeros" ] ]
capybaralet/pylearn2
[ "78d78a99bc6114616a22a4d798c7fedfe4489c58" ]
[ "pylearn2/datasets/tests/test_csv_dataset.py" ]
[ "import os\nimport pylearn2\nfrom pylearn2.datasets.csv_dataset import CSVDataset\nimport numpy as np\n\n\ndef test_loading_classification():\n test_path = os.path.join(pylearn2.__path__[0],\n 'datasets', 'tests', 'test.csv')\n d = CSVDataset(path=test_path, expect_headers=False)\n...
[ [ "numpy.array" ] ]
chunglabmit/phathom
[ "304db7a95e898e9b03d6b2640172752d21a7e3ed" ]
[ "phathom/phenotype/cellbody.py" ]
[ "\"\"\"This module contains functions for cell body detection in 3D for single-cell analysis\n\"\"\"\n\nimport os\nimport multiprocessing\nfrom functools import partial\nfrom tqdm import tqdm_notebook as tqdm\nimport numpy as np\nfrom scipy.ndimage import label\nimport skimage\nfrom skimage.transform import integra...
[ [ "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.where", "numpy.clip" ] ]
QBRC/SPROD
[ "bfc5e19e0cbf89b25af03c1804af2340761e38f8" ]
[ "sprod.py" ]
[ "\"\"\"\nA convinient function to wrap all necessary processed in Sprod. Minimal data processing is required.\nA 'Counts.txt' and a 'Spot_metadata.csv' is required to run this script.\nAlso, if the input folder contains a image tif file, it will be used as the input matching\nimage for feature extraction. Both file...
[ [ "pandas.read_csv", "numpy.ceil", "pandas.concat" ] ]
quentinverlhac/music-emotion-recognition
[ "c57b934574931fbb4cf31406eddce9d77d8824e4" ]
[ "test.py" ]
[ "from utils import load_model, load_dump, test_model\nimport tensorflow as tf\nimport argparse\n\nimport config\n\n\ndef test(model):\n print(f\"======================== evaluation on test data =========================\")\n # import data and labels\n test_spectrograms = load_dump(config.TEST_DATA_PATH)\n ...
[ [ "tensorflow.keras.metrics.Mean", "tensorflow.keras.metrics.BinaryAccuracy" ] ]
1105042987/NAG_Pytorch
[ "88d2598208f00d6f63ed767cd5573d6905c457e4" ]
[ "train_generator.py" ]
[ "import time,gc\nimport torch,torchvision\nimport torch.nn as nn\nfrom torchvision import transforms\n\nfrom nag.model import model_dict,AdveraryGenerator\nfrom nag.utils import get_device,get_bs\nfrom nag.data import CustomDataset,ImageFolder\nfrom torch.utils.data import DataLoader\nfrom torch import optim\nfrom ...
[ [ "torch.utils.data.DataLoader" ] ]
zelzhan/Linear-algebra-with-python
[ "a58042c9f29f67aafcd2c1c4c1300a0e9223a650" ]
[ "heart_disease/model.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom sklearn.preprocessing import LabelEncoder, OneHotEncoder, StandardScaler\nfrom sklearn.impute import SimpleImputer as Imputer\nfrom sklearn.model_selection import train_test_split, cross_val_score, GridSearchCV\nfrom sklearn.svm import ...
[ [ "sklearn.metrics.confusion_matrix", "matplotlib.pyplot.xlim", "sklearn.impute.IterativeImputer", "pandas.read_csv", "sklearn.model_selection.cross_val_score", "pandas.DataFrame", "sklearn.metrics.accuracy_score", "sklearn.model_selection.cross_val_predict", "sklearn.metrics.roc...
bryanoliveira/metaworld
[ "f35e91e40672f9b130afa3a2dbd4c1d038043315" ]
[ "tests/metaworld/envs/test_multitask_env.py" ]
[ "import pytest\nimport numpy as np\n\nfrom metaworld.benchmarks import ML10\nfrom metaworld.envs.mujoco.env_dict import MEDIUM_MODE_CLS_DICT, MEDIUM_MODE_ARGS_KWARGS\nfrom metaworld.envs.mujoco.multitask_env import MultiClassMultiTaskEnv\nfrom metaworld.envs.mujoco.sawyer_xyz import SawyerReachPushPickPlaceEnv\nfro...
[ [ "numpy.all", "numpy.sum", "numpy.array", "numpy.array_equal" ] ]