repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
hyanwong/tskit
[ "f1c5e29e2f4ed022a436895cea3e92f21e368ec6" ]
[ "python/tests/test_drawing.py" ]
[ "# MIT License\n#\n# Copyright (c) 2018-2019 Tskit Developers\n# Copyright (C) 2017 University of Oxford\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 deal\n# in the Software without restriction, inclu...
[ [ "numpy.full", "numpy.testing.assert_array_equal" ] ]
arisliang/taichi
[ "c775649705195a84e17a04432b60e796f31dee5c" ]
[ "python/taichi/lang/matrix.py" ]
[ "import copy\nimport numbers\nfrom collections.abc import Iterable\n\nimport numpy as np\nfrom taichi.lang import expr, impl\nfrom taichi.lang import ops as ops_mod\nfrom taichi.lang import kernel_impl as kern_mod\nfrom taichi.lang.common_ops import TaichiOperations\nfrom taichi.lang.exception import TaichiSyntaxEr...
[ [ "numpy.array", "numpy.shape", "numpy.zeros" ] ]
chuzcjoe/TriNet
[ "d2689de7362f1845b5c399f1f9f66f42eb4df23f" ]
[ "utils.py" ]
[ "# -*- coding:utf-8 -*-\n\"\"\"\n utils script\n\"\"\"\nimport os\nimport cv2\nimport torch\nimport numpy as np\nimport matplotlib\n#matplotlib.use(\"Qt4Agg\")\nimport math\nimport matplotlib.pyplot as plt\nfrom math import cos, sin\nfrom mpl_toolkits.mplot3d.axes3d import Axes3D\n#from rotation import Rotation ...
[ [ "torch.acos", "matplotlib.pyplot.xlim", "torch.stack", "numpy.exp", "matplotlib.pyplot.draw", "numpy.cos", "torch.exp", "torch.sum", "matplotlib.pyplot.switch_backend", "numpy.mat", "numpy.max", "torch.sqrt", "numpy.sin", "torch.IntTensor", "matplotlib.p...
EkaterinaPogodina/catboost
[ "4628e86e978da2ec5e4d42f6b8d05e0b5e8aab30" ]
[ "catboost/pytest/lib/common_helpers.py" ]
[ "import csv\nimport json\nimport os\nimport random\nimport shutil\n\nfrom copy import deepcopy\nimport numpy as np\n\n__all__ = [\n 'DelayedTee',\n 'binary_path',\n 'compare_evals',\n 'compare_evals_with_precision',\n 'compare_metrics_with_diff',\n 'generate_random_labeled_set',\n 'permute_data...
[ [ "numpy.concatenate", "numpy.delete", "numpy.isclose", "numpy.random.RandomState", "numpy.loadtxt" ] ]
mongmogroup/auto-trading-framework
[ "b68123e3820083d53b4c7637dc4547adc1eae228" ]
[ "model/models.py" ]
[ "# common library\nimport time\nimport numpy as np\n\n# from stable_baselines import A2C\n# from stable_baselines import DDPG\n# RL models from stable-baselines\n# from stable_baselines import PPO2\n# from stable_baselines import TD3\n# from stable_baselines.common.noise import OrnsteinUhlenbeckActionNoise\n# from ...
[ [ "numpy.quantile", "numpy.ones", "numpy.zeros", "numpy.mean" ] ]
manhcntt21/TextNormSeq2Seq
[ "440b252bddc0c735f083acd51271f2056d088a0a" ]
[ "loss_folder/draw_loss.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\ndef get_data(f1,f2,f3,f4):\n\t\"\"\"\n \tfour folder loss\n\t\"\"\"\n\tepoches = []\n\ttrain_word = []\n\ttest_word = []\n\ttrain_char = []\n\ttest_char = []\n\twith open(f1,\"r\") as f:\n\t\tfor line in f:\n\t\t\ttmp = line.rstrip(\"\\n\\r\").split(\"\\t\")\n\t...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
pulupa/pyspedas
[ "7228199cf16eca2a27d130f1e4985ef1e69462ea", "7228199cf16eca2a27d130f1e4985ef1e69462ea" ]
[ "pyspedas/erg/satellite/erg/mgf/mgf.py", "pyspedas/mms/feeps/mms_feeps_omni.py" ]
[ "import cdflib\nimport numpy as np\nfrom pytplot import clip, get_data, options, ylim\n\nfrom ..load import load\n\n\ndef mgf(trange=['2017-03-27', '2017-03-28'],\n datatype='8sec',\n level='l2',\n suffix='',\n get_support_data=False,\n varformat=None,\n varnames=[],\n ...
[ [ "numpy.nanmax", "numpy.nanmin" ], [ "numpy.array", "numpy.abs" ] ]
mymatin/vmaf
[ "d785a9ab8999e12c7d87d4bd20a89d9a2b95b74d" ]
[ "python/src/vmaf/core/train_test_model.py" ]
[ "from abc import ABCMeta, abstractmethod\nimport os\nimport pickle\nfrom numbers import Number\n\nfrom sklearn.metrics import f1_score\nimport numpy as np\n\nfrom vmaf.tools.decorator import deprecated\nfrom vmaf.tools.misc import indices\nfrom vmaf.core.mixin import TypeVersionEnabled\nfrom vmaf.core.perf_metric i...
[ [ "numpy.max", "numpy.array", "numpy.matrix", "numpy.zeros", "sklearn.ensemble.ExtraTreesRegressor", "numpy.percentile", "matplotlib.pyplot.get_cmap", "numpy.random.seed", "numpy.min", "numpy.mean", "numpy.std", "numpy.ravel", "sklearn.ensemble.RandomForestRegress...
shivapbhusal/calculate_bandgap
[ "7f738a35145e6c9c64100d30bf8ae477a627bbba" ]
[ "plot.py" ]
[ "'''\nA python script to compute bandgap in zinc oxide\nRequires 1 argument in command line. \nExample, python compute_bandgap doscar\n'''\n\nimport matplotlib.pyplot as plt \nimport sys\nimport numpy as np\n\n'''\nFunction to convert numbers in E+ and E- exponential format to \nnormal floating point numbers. \n'''...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.axis" ] ]
jacopomaroli/vectorbt
[ "44968ac579a1420f713df326eb730bae93041622" ]
[ "vectorbt/portfolio/nb.py" ]
[ "\"\"\"Numba-compiled functions.\n\nProvides an arsenal of Numba-compiled functions that are used for portfolio\nmodeling, such as generating and filling orders. These only accept NumPy arrays and\nother Numba-compatible types.\n\n!!! note\n vectorbt treats matrices as first-class citizens and expects input arra...
[ [ "numpy.isinf", "numpy.full", "numpy.isnan", "numpy.empty", "numpy.sum", "numpy.ones", "numpy.mean", "numpy.random.shuffle", "numpy.any", "numpy.sign", "numpy.require", "numpy.random.uniform", "numpy.isfinite", "numpy.cumsum", "numpy.broadcast_to", "n...
aurelienserre/samestats
[ "91a4471e8e85cff198b206ec9a36883811215596" ]
[ "objective_functions.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass DistToPoints(nn.Module):\n\n \"\"\"Compute the sum over all the points given as input of\n their squared distances to some target points.\"\"\"\n\n def __init__(self, targets):\n \"\"\"Initializes the targets\n\n :targets: (np.array or torch.Ten...
[ [ "torch.min", "torch.unsqueeze", "torch.Tensor", "torch.matmul", "torch.where" ] ]
SvenA098072/ESHL_CBo_Post_Processing
[ "d3b53f41011b4e8fed61175b4873e514cc4802ed" ]
[ "anemometere.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jan 11 15:52:37 2021\n\n@author: Devineni\n\"\"\"\n\n\nimport pandas as pd\nimport numpy as np\nfrom statistics import mean\nimport time\nimport datetime as dt\nimport matplotlib.pyplot as plt\nimport operator # for plotting\n\nfrom openpyxl import load_workbook\n\n#...
[ [ "matplotlib.pyplot.savefig", "pandas.read_excel", "matplotlib.pyplot.subplots" ] ]
smg478/Kaggle---Carvana-Image-Masking-Challange
[ "3df42c451a4d2218230e462eba9387a3b742f7ef" ]
[ "tools/dice_coeff_check.py" ]
[ "import pandas as pd\nimport numpy as np\nimport cv2\nfrom tqdm import tqdm\n\nfrom u_net import get_unet1_1024x1024\n\n\ndef dice_coeff(y_true, y_pred):\n smooth = 1.\n y_true_f = K.flatten(y_true)\n y_pred_f = K.flatten(y_pred)\n intersection = K.sum(y_true_f * y_pred_f)\n score = (2. * intersectio...
[ [ "numpy.array", "pandas.read_csv", "numpy.expand_dims", "numpy.array_split" ] ]
clemisch/jax
[ "771d7c8ba5dd0c64d72556712b5d4329878a20cc" ]
[ "jax/interpreters/pxla.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", "numpy.empty", "numpy.asarray", "numpy.zeros", "numpy.prod", "numpy.arange", "numpy.issubdtype" ] ]
harnalashok/credit_risk
[ "8ad0426d8ac66a115ef6b6feb8a8a05119c1cd9e" ]
[ "_build/jupyter_execute/join_all_processed.py" ]
[ "#!/usr/bin/env python\r\n# coding: utf-8\r\n\r\n# # Joining all processed data\r\n# This notebook joins all processed data and then saves it in a file for subsequent modeling.\r\n\r\n# In[87]:\r\n\r\n\r\n# Last amended: 24th October, 2020\r\n# Myfolder: C:\\Users\\Administrator\\OneDrive\\Documents\\home_credit_de...
[ [ "pandas.read_csv", "pandas.set_option" ] ]
marcreyesph/tf-selfpacedtuts
[ "fd0393ef8578fc65042b1270575a16df6bd30605" ]
[ "session-1/sess1_gabor_kernel.py" ]
[ "from skimage import data\r\nimport tensorflow as tf \r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport os\r\n\r\n# Minimize console warnings by tensorflow\r\nos.environ['TF_CPP_MIN_LOG_LEVEL']='2'\r\n\r\nsess = tf.InteractiveSession()\r\n\r\nimg_dataset = [os.path.join('celeba_dataset_minified', i...
[ [ "numpy.array", "tensorflow.multiply", "tensorflow.linspace", "tensorflow.nn.conv2d", "tensorflow.expand_dims", "tensorflow.matmul", "numpy.mean", "numpy.std", "tensorflow.sqrt", "tensorflow.placeholder", "tensorflow.sin", "tensorflow.stack", "matplotlib.pyplot.s...
aaltay/data-validation
[ "14773d06aa673f7f525d76bb785887e51d920a6f" ]
[ "tensorflow_data_validation/utils/display_util.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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "pandas.DataFrame", "pandas.set_option" ] ]
SebastianRiedel/python_scratchbook
[ "cdd5a9864873fce2d510ae0977f68d36b3caa56b" ]
[ "vtk_example.py" ]
[ "# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>\n# Copyright (c) 2008, Enthought, Inc.\n# License: BSD Style.\n\nfrom mayavi import mlab\n\n# To access any VTK object, we use 'tvtk', which is a Python wrapping of\n# VTK replacing C++ setters and getters by Python properties and\n# converting numpy arrays ...
[ [ "numpy.array", "numpy.sin", "numpy.empty", "numpy.random.rand", "numpy.eye", "numpy.cos" ] ]
guoyejun/pytorch
[ "57cba8e60116bfff37d10bc2b4596d8c478ffd0a" ]
[ "test/distributed/elastic/rendezvous/utils_test.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport threading\nimport time\nimport socket\nfrom datetime import timedelta\nfrom typing import List\...
[ [ "torch.distributed.elastic.rendezvous.utils._delay", "torch.distributed.elastic.rendezvous.utils._matches_machine_hostname", "torch.distributed.elastic.rendezvous.utils._parse_rendezvous_config", "torch.distributed.elastic.rendezvous.utils._try_parse_port", "torch.distributed.elastic.rendezvou...
phlrain/models
[ "59adc0d6f38cd2351e16608d6c9d4e72dd5e7fea" ]
[ "fluid/ocr_recognition/train.py" ]
[ "\"\"\"Trainer for OCR CTC or attention model.\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport paddle.fluid as fluid\nfrom utility import add_arguments, print_arguments, to_lodtensor, get_ctc_feeder_data, get_attention_feeder_data\nimport...
[ [ "numpy.average", "numpy.percentile", "numpy.array", "numpy.divide" ] ]
scorelab/Elphas
[ "be3e3906fa1f69155dc3f61f5c0bf21568e712c9" ]
[ "back-end/object_detection/trainer_test.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\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#\...
[ [ "tensorflow.image.resize_images", "tensorflow.random_uniform", "tensorflow.contrib.layers.fully_connected", "tensorflow.global_variables", "tensorflow.reshape", "tensorflow.constant", "tensorflow.reduce_sum", "tensorflow.test.main", "tensorflow.contrib.layers.flatten" ] ]
Shyamdeokr/Bayesian_CO_oxidation
[ "3d58c1ad967522266609259eea667bff55cfef0f" ]
[ "Bayesian/MKM_corrected.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# # Microkinetic Model for CO Oxidation (Pd), (PdO) and (PdO2) + O2 ads - corrected for DFT energetics and barriers\n\n# Reactions - 1 - 8\n# \n# ![image.png](attachment:image.png)\n\n# Reactions 6' - 11\n# ![image.png](attachment:image.png)\n\n# Reactions 12-14\n# ![image...
[ [ "numpy.log", "numpy.zeros", "sklearn.linear_model.LinearRegression", "numpy.exp", "numpy.linspace" ] ]
dindom999/akshare
[ "95b38d3430c71637c3ee9ba799618c20afe4a010" ]
[ "akshare/air/air_hebei.py" ]
[ "# -*- coding:utf-8 -*-\n# /usr/bin/env python\n\"\"\"\nDate: 2020/4/29 12:33\nDesc: 河北省空气质量预报信息发布系统\nhttp://110.249.223.67/publish/\n每日 17 时发布\n等级划分\n1. 空气污染指数为0-50,空气质量级别为一级,空气质量状况属于优。此时,空气质量令人满意,基本无空气污染,各类人群可正常活动。\n2. 空气污染指数为51-100,空气质量级别为二级,空气质量状况属于良。此时空气质量可接受,但某些污染物可能对极少数异常敏感人群健康有较弱影响,建议极少数异常敏感人群应减少户外活动。\n3. 空...
[ [ "pandas.DataFrame.from_dict", "pandas.DataFrame" ] ]
eirikgje/c3pp
[ "0efe2cba7960131509d5d968ac825c4f1dbbc552" ]
[ "src/spectrum.py" ]
[ "from matplotlib import rcParams, rc\nimport matplotlib.patheffects as path_effects\nimport matplotlib.ticker as ticker\nimport matplotlib.pyplot as plt\nfrom cycler import cycler\nfrom tqdm import trange, tqdm\nimport numpy as np\nimport healpy as hp\nimport sys\nimport math\nfrom brokenaxes import brokenaxes\n\ni...
[ [ "numpy.mean", "numpy.max", "matplotlib.patheffects.withSimplePatchShadow", "numpy.concatenate", "numpy.empty", "numpy.log", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "numpy.argmax", "matplotlib.pyplot.tight_layout", "numpy.sqrt", "matplotlib.pyplot....
vuiseng9/OHO
[ "1c0bdd10502317f41f717deb317d6dcb04b3c6bf" ]
[ "metaopt/cifar/main_quotient.py" ]
[ "import os, sys, math, argparse, time\nimport torch\nimport torch.optim as optim\nfrom torch.autograd import Variable\nimport torch.backends.cudnn as cudnn\nfrom torch.utils.data import DataLoader\nfrom torchvision import datasets, transforms\nfrom copy import copy\nimport numpy as np\nimport matplotlib.pyplot as p...
[ [ "numpy.random.RandomState" ] ]
iudeen/superset
[ "d304849b46b39bb6a261b735b7ca658962bc31e0" ]
[ "superset/common/query_context_processor.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "pandas.concat" ] ]
st3107/shed-streaming
[ "c632fc465d7e11fe0155fbc3e8add1965615dd51" ]
[ "shed/writers.py" ]
[ "from rapidz import Stream\nimport os\nimport numpy as np\nfrom event_model import compose_resource\n\n\n@Stream.register_api()\nclass Store(Stream):\n def __init__(self, upstream, root, writer, resource_kwargs=None, **kwargs):\n Stream.__init__(self, upstream, **kwargs)\n if writer is None:\n ...
[ [ "numpy.isscalar", "numpy.save" ] ]
coongroup/MITOMICS
[ "6515c23017288ee91984ba052ce6b6cc74ade60a" ]
[ "src/processing/IJM/lipidomics/4.0-lipidomics_processing.py" ]
[ "# load modules\nimport pandas as pd\nimport re\nimport numpy as np\nfrom collections import Counter\n\n# load proteomics data\nlipidomics_path = \"combined_lipidomics_data_filtered.tsv\"\nlipidomics_df = pd.read_csv(lipidomics_path, sep=\"\\t\", index_col=0)\n\n# drop batch column and transpose\nlipidomics_df = li...
[ [ "pandas.read_csv", "pandas.read_excel" ] ]
jibanCat/gpy_dla_detection
[ "4d987adec75a417313fdc6601ee41a0ea60a0a2e" ]
[ "gpy_dla_detection/plottings/plot_model.py" ]
[ "\"\"\"\nPlot the GP model with sample likelihoods\n\"\"\"\nfrom typing import Optional\n\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\nfrom ..dla_gp import DLAGP\n\n\ndef plot_dla_model(\n dla_gp: DLAGP,\n nth_dla: int,\n title: Optional[str] = None,\n label: Optional[str] = None,\n):\n ...
[ [ "numpy.nanmax", "numpy.nanmin", "matplotlib.pyplot.subplots" ] ]
Rigel-Everlasting/ID2211DataMining
[ "44f6038fee91a124a5f1ebed4d100fae2af2ec0e" ]
[ "models/MatrixFct.py" ]
[ "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n# @author: JamieJ\n# @license: Apache Licence\n# @file: MatrixFct.py\n# @time: 2021/05/10\n# @contact: mingj@kth,se\n# @software: PyCharm\n# May the Force be with you.\n\nfrom Data import *\nimport numpy as np\nfrom scipy.sparse import coo_matrix\nfrom scipy import sp...
[ [ "torch.mul", "torch.Tensor", "torch.nn.Embedding" ] ]
yangw1234/models-1
[ "7e7f484f4f22c760f9a5af836f57a3602b4fa7a6", "7e7f484f4f22c760f9a5af836f57a3602b4fa7a6" ]
[ "models/language_translation/tensorflow/transformer_mlperf/training/fp32/transformer/compute_bleu.py", "models/language_translation/tensorflow/transformer_mlperf/training/fp32/transformer/transformer_main.py" ]
[ "# Copyright 2018 MLBenchmark Group. 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 ...
[ [ "tensorflow.io.gfile.GFile" ], [ "tensorflow.compat.v1.train.get_global_step", "tensorflow.compat.v1.trainable_variables", "tensorflow.compat.v1.set_random_seed", "tensorflow.cast", "tensorflow.compat.v1.name_scope", "tensorflow.estimator.RunConfig", "tensorflow.compat.v1.train...
Jorge-C/bipy
[ "1097cefafc6f9bbb9d96f25b569892a3fe3f3600" ]
[ "skbio/maths/stats/distance/tests/test_permanova.py" ]
[ "#! /usr/bin/env python\n\n# ----------------------------------------------------------------------------\n# Copyright (c) 2013--, scikit-bio development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n# -------...
[ [ "numpy.random.seed", "numpy.testing.assert_array_equal" ] ]
adarsh-kr/CVModelsBenchmark
[ "85aeb76c7c796d86baa97e1272aea83d734665b5" ]
[ "benchmark_params.py" ]
[ "'''Train CIFAR10 with PyTorch.'''\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torch.backends.cudnn as cudnn\n\nimport torchvision\nimport torchvision.transforms as transforms\n\nimport os\nimport argparse\n\nfrom models import *\nfrom utils import prog...
[ [ "torch.nn.CrossEntropyLoss", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.nn.DataParallel" ] ]
chenkangyang/CMAESEforWaterPrediction
[ "a50a53748e5cbfc1ae856e776cfa15f80b871780" ]
[ "gcforest/utils/metrics.py" ]
[ "# -*- coding:utf-8 -*-\nimport numpy as np\nfrom sklearn.metrics import f1_score\n\nfrom .win_utils import win_vote, win_avg\n\ndef accuracy(y_true, y_pred):\n return 1.0 * np.sum(y_true == y_pred) / len(y_true)\n\ndef accuracy_pb(y_true, y_proba):\n y_true = y_true.reshape(-1)\n y_pred = np.argmax(y_prob...
[ [ "numpy.sum", "sklearn.metrics.f1_score", "numpy.argmax" ] ]
MoleOrbitalHybridAnalyst/kelvin
[ "99538f8360975e2f80941446d8fbf2e848f74cf9" ]
[ "kelvin/ueg_scf_system.py" ]
[ "import logging\nimport numpy\nfrom pyscf import lib\nfrom cqcpy import ft_utils\nfrom cqcpy.ov_blocks import one_e_blocks\nfrom cqcpy.ov_blocks import two_e_blocks\nfrom cqcpy.ov_blocks import two_e_blocks_full\nfrom .system import System\nfrom .ueg_utils import UEGBasis\n\neinsum = lib.einsum\n#einsum = einsum\n\...
[ [ "numpy.asarray", "numpy.zeros", "numpy.ix_", "numpy.identity", "numpy.einsum", "numpy.arange", "numpy.hstack", "numpy.diag" ] ]
pangeo-data/climpred
[ "8df537f4a3740441dba55e018ce65e1b6d977162" ]
[ "climpred/bias_removal.py" ]
[ "import logging\nimport warnings\n\nimport numpy as np\nimport pandas as pd\nimport xarray as xr\nfrom bias_correction import XBiasCorrection\nfrom xclim import sdba\nfrom xskillscore.core.utils import suppress_warnings\n\nfrom .constants import BIAS_CORRECTION_BIAS_CORRECTION_METHODS, GROUPBY_SEASONALITIES\nfrom ....
[ [ "numpy.arange" ] ]
tonybeltramelli/Graphics-And-Vision
[ "a1dbeada8e907b119ecce1fe421ae91e64ff3371" ]
[ "Projective-Geometry/bergar/com.bergar.simonsen.homography/tools/IO.py" ]
[ "__author__ = 'bs'\n\nimport cv2\nfrom config.Const import *\nfrom tools import Utils\nimport numpy as np\n\ndef writeImage(I):\n fName = SAVE_FOLDER + OUTPUT_IMAGE + JPG_EXTENSION\n for i in range(MAX_FILES):\n if not Utils.doesFileExist(fName):\n cv2.imwrite(SAVE_FOLDER + fName, I)\n ...
[ [ "numpy.save" ] ]
matthew-brett/rnbgrader
[ "f07494f59dd0d1cb97c094ac2ea9e9d1243f0f70" ]
[ "rnbgrader/tests/test_grids.py" ]
[ "\"\"\" Test grading paths\n\"\"\"\n\nimport numpy as np\n\nfrom rnbgrader.chunkrunner import EvaluatedChunk\nfrom rnbgrader.grids import full_grid, max_multi\n\nfrom numpy.testing import assert_array_equal\n\n\ndef test_full_grid():\n # Test calculation of grid from results, answers. An answer returns marks\n ...
[ [ "numpy.testing.assert_array_equal", "numpy.ones", "numpy.diag", "numpy.zeros" ] ]
pmalhaire/rlcard
[ "19dbd6972c9bf1ace9ee814598e65475dd672fe5" ]
[ "rlcard/agents/nfsp_agent.py" ]
[ "# Copyright 2019 DATA Lab at Texas A&M University. All rights reserved.\n# Copyright 2019 DeepMind Technologies Ltd. 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 Licen...
[ [ "tensorflow.compat.v1.placeholder", "numpy.random.rand", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.keras.layers.Flatten", "tensorflow.compat.v1.layers.batch_normalization", "tensorflow.compat.v1.variable_scope", "tensorflow.keras.layers.Dense", "tensorflow.compat.v1.g...
anupriya-babbar/ga-learner-dsmp-repo
[ "6692b827a06bdb6e246c1df4f2f036d8c9c9a06c" ]
[ "clusters/code.py" ]
[ "# --------------\n# import packages\n\nimport pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt \n\n\n\n# Load Offers\n\noffers=pd.read_excel(path,sheet_name=0)\n# Load Transactions\nlist1=[]\ntransactions=pd.read_excel(path,sheet_name=1)\nfor i in range(0,len(transactions)):...
[ [ "pandas.merge", "pandas.read_excel", "sklearn.cluster.KMeans", "matplotlib.pyplot.show", "sklearn.decomposition.PCA" ] ]
hnumair/fury
[ "6116e1c702c536aae0bb89a2b7e67b4aeef1acad" ]
[ "fury/tests/test_window.py" ]
[ "import os\nimport warnings\nfrom tempfile import TemporaryDirectory as InTemporaryDirectory\nimport numpy as np\nimport numpy.testing as npt\nimport pytest\nfrom fury import actor, window, io\nfrom fury.testing import captured_output, assert_less_equal\nfrom fury.decorators import skip_osx, skip_win\n\n\ndef test_...
[ [ "numpy.array", "numpy.dot", "numpy.testing.assert_warns", "numpy.testing.assert_equal", "numpy.testing.assert_almost_equal", "numpy.sum", "numpy.testing.assert_array_equal", "numpy.testing.assert_array_almost_equal", "numpy.testing.assert_raises" ] ]
ariel415el/RL-Exploration
[ "87e5bb77862cf7545634e89bde99b9e953ebb8cf" ]
[ "ExplorationModule/ICM.py" ]
[ "import torch\nfrom torch import nn\n\n\nclass Forward_module(nn.Module):\n def __init__(self, action_dim, hidden_dim, activation=nn.ReLU(inplace=True)):\n super(Forward_module, self).__init__()\n action_embedd_dim=128\n self.action_encoder = nn.Embedding(action_dim, action_embedd_dim)\n ...
[ [ "torch.nn.Linear", "torch.nn.Embedding", "torch.cat", "torch.nn.ReLU", "torch.nn.CrossEntropyLoss" ] ]
shaofengzhu/codespacefunc
[ "96f2e9d65d4486fd87fde9aea411fd034fefd992" ]
[ "Functions.py" ]
[ "from __future__ import annotations\r\nimport itertools\r\nimport pandas as pd\r\nimport base64\r\nfrom urllib.parse import quote as urlquote\r\nfrom urllib.request import urlopen\r\n\r\n\r\ndef myadd(x, y):\r\n \"\"\"Basic addition test\"\"\"\r\n return x + y\r\n\r\n\r\ndef badadd(x : float, y : float) -> fl...
[ [ "pandas.DataFrame", "pandas.read_csv", "numpy.random.rand" ] ]
quanshengwu/PyChemia
[ "98e9f7a1118b694dbda3ee75411ff8f8d7b9688b", "98e9f7a1118b694dbda3ee75411ff8f8d7b9688b", "98e9f7a1118b694dbda3ee75411ff8f8d7b9688b" ]
[ "bin/EvaluatorDirectVASP.py", "bin/abi_abinit2xyz.py", "pychemia/population/orbitaldftu.py" ]
[ "#!/usr/bin/env python\n\nimport argparse\nimport logging\nimport os\n\nimport numpy as np\n\nfrom pychemia import pcm_log\nfrom pychemia.analysis import StructureAnalysis\nfrom pychemia.code.vasp.task import IonRelaxation\nfrom pychemia.db import get_database\nfrom pychemia.evaluator import DirectEvaluator\nfrom p...
[ [ "numpy.max", "numpy.apply_along_axis", "numpy.average" ], [ "numpy.array" ], [ "numpy.array", "numpy.linalg.norm", "numpy.zeros", "numpy.round", "numpy.linalg.eigh", "numpy.random.random_sample", "numpy.apply_along_axis", "numpy.diag", "numpy.abs", "...
sytelus/convNet.pytorch
[ "efc0f1aa428b190e492cc7ef5eedcd58ff46b1d8" ]
[ "models/alexnet.py" ]
[ "import torch.nn as nn\nimport torchvision.transforms as transforms\n\n__all__ = ['alexnet']\n\n\nclass AlexNetOWT_BN(nn.Module):\n\n def __init__(self, num_classes=1000):\n super(AlexNetOWT_BN, self).__init__()\n self.features = nn.Sequential(\n nn.Conv2d(3, 64, kernel_size=11, stride=4...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.BatchNorm1d" ] ]
chentyl/SLQ_analysis
[ "19a43dd3c1f034e1c3b22a92da9e9fc1666d4f46" ]
[ "lanczos_bin/lanczos.py" ]
[ "import numpy as np\nimport scipy as sp\n\n\ndef exact_lanczos(A,q0,k,reorth=True):\n \"\"\"\n run Lanczos with reorthogonalization\n \n Input\n -----\n A : entries of diagonal matrix A\n q0 : starting vector\n k : number of iterations\n B : entries of diagonal weights for orthogonalizati...
[ [ "numpy.sqrt", "numpy.zeros" ] ]
PayamDiba/CoNSEPT
[ "496a549d2cbfb89d13bfd7683fb16a93554af71e" ]
[ "CoNSEPT/Dataset.py" ]
[ "\"\"\"\n@author: Payam Dibaeinia\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\nfrom CoNSEPT.DataBuilder import InlineData\nimport os\n\nclass dataset(object):\n def __init__(self,\n seq_file,\n expression_file,\n TF_file,\n ...
[ [ "pandas.read_csv" ] ]
Lmaster20/cogent3
[ "1d5ff1ba2b3d42736f8f04de8507b5cd585b4fe9" ]
[ "src/cogent3/util/dict_array.py" ]
[ "#!/usr/bin/env python\n\"\"\"Wrapper for numpy arrays so that they can be indexed by name\n\n >>> a = numpy.identity(3, int)\n >>> b = DictArrayTemplate('abc', 'ABC').wrap(a)\n >>> b[0]\n ===========\n A B C\n -----------\n 1 0 0\n -----------\n >>> b['a']\n ===========\n ...
[ [ "numpy.all", "numpy.asarray", "numpy.shape" ] ]
Jack12xl/landmark-detection
[ "68b199fe13b0a57cdd7b9302a9f38e16418d675c" ]
[ "SAN/lib/san_vision/transforms.py" ]
[ "##############################################################\n### Copyright (c) 2018-present, Xuanyi Dong ###\n### Style Aggregated Network for Facial Landmark Detection ###\n### Computer Vision and Pattern Recognition, 2018 ###\n###########################################################...
[ [ "torch.is_tensor", "numpy.array" ] ]
veniversum/baselines
[ "99666bd86f0051b2323366c6ee89111df92e7f44" ]
[ "baselines/trpo_exp/trpo_exp.py" ]
[ "from baselines.common import explained_variance, zipsame, dataset\nfrom baselines import logger\nimport baselines.common.tf_util as U\nimport tensorflow as tf, numpy as np\nimport time\nfrom baselines.common import colorize\nfrom collections import deque\nfrom baselines.common import set_global_seeds\nfrom baselin...
[ [ "numpy.set_printoptions", "numpy.copy", "tensorflow.gradients", "tensorflow.reshape", "numpy.mean", "numpy.empty", "tensorflow.ConfigProto", "tensorflow.variable_scope", "numpy.sqrt", "numpy.append", "numpy.isfinite", "tensorflow.get_collection", "numpy.empty_li...
bartua/pandas-ta
[ "3bbd5bef4a906f8e810cd557cf20bf92870851c0" ]
[ "pandas_ta/overlap/vidya.py" ]
[ "# -*- coding: utf-8 -*-\r\nfrom numpy import nan as npNaN\r\nfrom numpy import nonzero\r\nimport numpy\r\nfrom pandas import Series\r\nfrom pandas_ta.utils import get_drift, get_offset, verify_series\r\n\r\n\r\ndef vidya(close, length=None, drift=None, offset=None, **kwargs):\r\n \"\"\"Indicator: Variable Inde...
[ [ "pandas.Series" ] ]
Huizerd/jax
[ "32319e1bc36e17ca270e9ff1a9545e6680f9eb28" ]
[ "tests/sparse_test.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# 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.prod" ] ]
hamsik1223/fairseq
[ "13164c38b0aab4269f8775a2506e2b60f5909114" ]
[ "fairseq/models/longformer.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\nimport math\nfrom typing import Any, Dict, List, Optional, Tuple\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional ...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.ModuleList", "torch.nn.init.constant_", "torch.nn.functional.dropout", "torch.FloatTensor", "torch.nn.init.xavier_uniform_", "torch.nn.init.normal_", "torch.empty", "torch.Tensor", "torch.nn.Embedding", "torch.where" ] ]
bgshin/mxnet_cnn
[ "19ebc13f4990ee29612a479325cf13d3bd9723ec" ]
[ "src/decode_demo.py" ]
[ "from keras.layers import Conv1D, Average, Multiply\nfrom keras.layers import Dense, AveragePooling1D, Input, Lambda\nfrom keras.models import Model\nfrom keras.preprocessing import sequence\n\nfrom dataset import Timer\nimport os\nfrom keras import backend as K\nimport gensim\nimport numpy as np\nimport pickle\n\n...
[ [ "numpy.array" ] ]
clbarnes/meshio
[ "21601539d073ea7cb7fe70cf7e2e818aa9c4353c" ]
[ "meshio/_xdmf/common.py" ]
[ "import numpy\n\nnumpy_to_xdmf_dtype = {\n \"int32\": (\"Int\", \"4\"),\n \"int64\": (\"Int\", \"8\"),\n \"uint32\": (\"UInt\", \"4\"),\n \"uint64\": (\"UInt\", \"8\"),\n \"float32\": (\"Float\", \"4\"),\n \"float64\": (\"Float\", \"8\"),\n}\nxdmf_to_numpy_type = {v: k for k, v in numpy_to_xdmf_dt...
[ [ "numpy.where", "numpy.array", "numpy.arange", "numpy.unique" ] ]
lotress/MoePhoto
[ "6f47515d2cf236773a46413f57839565fa665796" ]
[ "python/runSlomo.py" ]
[ "'''\nsuper slomo\ncode refered from https://github.com/avinashpaliwal/Super-SloMo.git\n'''\n# pylint: disable=E1101\nimport logging\nimport torch\nfrom slomo import UNet, backWarp\nfrom imageProcess import initModel, getStateDict, getPadBy32, doCrop, identity, Option, extend\nfrom config import config\n\nlog = log...
[ [ "torch.sigmoid", "torch.cat", "torch.stack" ] ]
VarshaChanaliya/Python-web-crawler
[ "5f858acf53acd9ee4f76462e410b98c7838daedd" ]
[ "Python web scraper.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# # Importing Required libraries\n\n# In[62]:\n\n\nimport requests\nimport bs4\nimport articleDateExtractor\nfrom newspaper import Article \nimport pandas as pd\n\n\n# # Creating generalized code for News analysis\n\n# In[129]:\n\n\nclass news_analysis:\n def __init__(s...
[ [ "pandas.DataFrame" ] ]
amsuhane/astroquery
[ "9c6ad92c9c52fc82816958e50354465c3ba73618" ]
[ "astroquery/vizier/tests/test_vizier.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nimport os\nimport requests\nfrom numpy import testing as npt\nimport pytest\nfrom astropy.table import Table\nimport astropy.units as u\nimport six\nfrom six.moves import urllib_parse as urlparse\nfrom ... import vizier\nfrom ...utils import commons\...
[ [ "numpy.testing.assert_approx_equal" ] ]
jingtaozhan/bert-ranking-analysis
[ "c17000abf4fb27ce631d403407522ff49586187e" ]
[ "attpattern/save_att.py" ]
[ "import os\nimport glob\nimport torch\nimport random\nimport logging\nimport argparse\nimport zipfile\nimport numpy as np\nfrom tqdm import tqdm, trange\nfrom torch.utils.data import DataLoader\nfrom transformers import (BertConfig, BertTokenizer)\n\nfrom modeling import MonoBERT\nfrom dataset import RelevantDatase...
[ [ "numpy.array", "torch.no_grad", "torch.cuda.device_count", "torch.cuda.is_available", "torch.nn.DataParallel", "torch.sum" ] ]
nauaneed/pysph
[ "9cb9a859934939307c65a25cbf73e4ecc83fea4a", "9cb9a859934939307c65a25cbf73e4ecc83fea4a", "9cb9a859934939307c65a25cbf73e4ecc83fea4a" ]
[ "pysph/sph/swe/basic.py", "pysph/examples/rigid_body/sphere_in_vessel_akinci.py", "pysph/examples/solid_mech/rings.py" ]
[ "\"\"\"\nBasic Equations for solving shallow water problems\n#####################\n\"\"\"\n\nfrom pysph.sph.equation import Equation\nfrom pysph.sph.integrator_step import IntegratorStep\nfrom pysph.sph.integrator import Integrator\nfrom compyle.api import declare\nfrom pysph.sph.wc.linalg import gj_solve, augment...
[ [ "numpy.append", "numpy.zeros_like", "numpy.array", "numpy.ones_like", "numpy.sin", "numpy.zeros", "numpy.tile", "numpy.exp", "numpy.where", "numpy.sign", "numpy.arctan2", "numpy.sqrt", "numpy.cos", "numpy.repeat", "numpy.abs" ], [ "numpy.concaten...
khy0809/WeightNet
[ "cd5ea53b42c6169ffd5a0d7d883788fdc871cd1e" ]
[ "submodules/torchskeleton/bin/benchmark/efficientnet_throughput_dist.py" ]
[ "# -*- coding: utf-8 -*-\nimport os\nimport sys\nimport logging\n\nimport torch\nimport torch.distributed as dist\n\n\nbase_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nsys.path.append(base_dir)\nimport skeleton\nimport efficientnet\n\n\nLOGGER = logging.getLogger(__name__)\n\...
[ [ "torch.zeros", "torch.distributed.get_world_size", "torch.device", "torch.cuda.synchronize", "torch.nn.parallel.DistributedDataParallel", "torch.ones", "torch.cuda.set_device", "torch.distributed.get_rank", "torch.nn.CrossEntropyLoss" ] ]
venice-liong/argoverse-api
[ "61c9bdc87f33feb84f2d8766dded1614b56cd0fe" ]
[ "argoverse/evaluation/detection/utils.py" ]
[ "# <Copyright 2020, Argo AI, LLC. Released under the MIT license.>\n\"\"\"Detection utilities for the Argoverse detection leaderboard.\n\nAccepts detections (in Argoverse ground truth format) and ground truth labels\nfor computing evaluation metrics for 3d object detection. We have five different,\nmetrics: mAP, AT...
[ [ "numpy.minimum", "numpy.where", "numpy.finfo", "numpy.cumsum", "numpy.count_nonzero", "numpy.linalg.norm", "matplotlib.pyplot.savefig", "pandas.DataFrame", "numpy.interp", "numpy.nonzero", "numpy.divmod", "numpy.vstack", "matplotlib.use", "numpy.array", ...
Sergiodiaz53/tensorflow-layer-library
[ "c4c71b59c034f4ec894580943e161c2971a92035", "c4c71b59c034f4ec894580943e161c2971a92035" ]
[ "samples/mnist/main.py", "samples/main_convlstm.py" ]
[ "\"\"\"\n© Michael Widrich, Markus Hofmarcher, 2017\n\nExample for mnist predictions via dense network\n\nCommand-line usage:\n>>> python3 samples/mnist/main_convlstm.py --config=samples/mnist/config.json\n\"\"\"\n# Import MNIST data\nfrom tensorflow.examples.tutorials.mnist import input_data\n\n# Import TeLL\nfrom...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.summary.scalar", "tensorflow.argmax", "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "tensorflow.nn.softmax", "tensorflow.name_scope", "tensorflow.summary.merge_all", "tensorflow.maximum", "tensorf...
Brikwerk/learn2learn
[ "c0b7c088f15986880b136ec27059644ac513db60" ]
[ "examples/vision/anilkfo_cifarfs.py" ]
[ "#!/usr/bin/env python3\n\n\"\"\"\nFile: anilkfo_cifarfs.py\nAuthor: Seb Arnold - seba1511.net\nEmail: smr.arnold@gmail.com\nGithub: seba-1511\nDescription:\nDemonstrates how to use the low-level differentiable optimization utilities\nto implement ANIL+KFC on CIFAR-FS.\n\nA demonstration of the high-level API is av...
[ [ "torch.nn.Linear", "torch.device", "torch.cuda.manual_seed", "numpy.random.seed", "torch.optim.Adam", "torch.from_numpy", "torch.manual_seed", "torch.cuda.device_count", "numpy.arange", "torch.nn.CrossEntropyLoss" ] ]
khavernathy/sarpy
[ "e0c2bb1a55f153628162ef7be89e9b7de34602df", "e0c2bb1a55f153628162ef7be89e9b7de34602df" ]
[ "pytests/test_cphd_consistency.py", "sarpy/io/general/base.py" ]
[ "#\n# Copyright 2020-2021 Valkyrie Systems Corporation\n#\n# Licensed under MIT License. See LICENSE.\n#\n\nimport copy\nimport os\nimport re\nimport shutil\nimport tempfile\n\nfrom lxml import etree\nimport numpy as np\nimport pytest\n\nfrom sarpy.consistency import cphd_consistency\nfrom sarpy.io.phase_history.c...
[ [ "numpy.linspace", "numpy.ones", "numpy.zeros" ], [ "numpy.max", "numpy.array", "numpy.ceil", "numpy.reshape", "numpy.zeros", "numpy.ascontiguousarray", "numpy.any", "numpy.memmap", "numpy.arange", "numpy.transpose", "numpy.swapaxes", "numpy.frombuffe...
brandonwillard/Theano
[ "f375a0e999b950a81824a003f685b0bfd1c4e405" ]
[ "theano/compile/ops.py" ]
[ "\"\"\"\nThis file contains auxiliary Ops, used during the compilation phase and Ops\nbuilding class (:class:`FromFunctionOp`) and decorator (:func:`as_op`) that\nhelp make new Ops more rapidly.\n\n\"\"\"\n\nimport copy\nimport warnings\nfrom collections import OrderedDict\n\nimport numpy as np\nimport six.moves.cP...
[ [ "numpy.all" ] ]
Lucas-Prates/ruptures
[ "9685818d08ca024c0abb6ecf6121f2f86fb26dba" ]
[ "tests/test_detection.py" ]
[ "from copy import deepcopy\nfrom itertools import product\n\nimport numpy as np\nimport pytest\n\nfrom ruptures.costs import CostAR\nfrom ruptures.datasets import pw_constant\nfrom ruptures.detection import Binseg, BottomUp, Dynp, Pelt, Window, KernelCPD\nfrom ruptures.exceptions import BadSegmentationParameters\n\...
[ [ "numpy.zeros" ] ]
jklopf/tensorbayes
[ "4b0cb3c565e9603a972135ddf7cfbe28a23b3a4a", "4b0cb3c565e9603a972135ddf7cfbe28a23b3a4a" ]
[ "benchmark/old/dbc/tb/d3_cpu_TensorBayes_v4.2.py", "python/TensorBayes_dev_v1.2.py" ]
[ "## Imports\nimport tensorflow as tf\nimport tensorflow_probability as tfp\nimport numpy as np\nfrom timeit import repeat\ntfd = tfp.distributions\nimport psutil\nfrom tqdm import tqdm\n\n'''\nThis version is able to retrieve the simulated parameters and\nstore the history of the sampling, and implement the tensorf...
[ [ "numpy.dot", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.group", "tensorflow.matmul", "numpy.min", "tensorflow.reshape", "numpy.mean", "tensorflow.sqrt", "tensorflow.control_dependencies", "tensorflow.global_variables_initializer", "tensorflow.set_random_s...
xubiuit/jina
[ "4ab91693c2d51a35eca3cf6c187034e0568b0ac9" ]
[ "tests/test_client.py" ]
[ "import time\n\nimport numpy as np\nimport requests\nfrom jina.clients import py_client\nfrom jina.clients.python import PyClient\nfrom jina.clients.python.io import input_files, input_numpy\nfrom jina.drivers.helper import array2pb\nfrom jina.enums import ClientMode\nfrom jina.flow import Flow\nfrom jina.main.pars...
[ [ "numpy.random.random" ] ]
micheleantonazzi/GibsonEnv
[ "4b9c57712efdf519015f9ba40c85a6b168ed3660" ]
[ "gibson/core/physics/robot_bases.py" ]
[ "## Author: pybullet, Zhiyang He\n\nimport pybullet as p\nimport gym, gym.spaces, gym.utils\nimport numpy as np\nimport os, inspect\n\nfrom gibson.assets.assets_manager import AssetsManager\n\ncurrentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))\nparentdir = os.path.dirname(current...
[ [ "numpy.array" ] ]
kckishan/Depth_and_Dropout
[ "64bbff9169d588486d92946485e108342daa29b0" ]
[ "experiments/image_experiments.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\nfrom tqdm import tqdm\nimport os\n\nimport torch\nimport torchvision\nimport torchvision.transforms as transforms\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torch.utils.data import DataLoader\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as p...
[ [ "matplotlib.style.use", "torch.argmax", "torch.no_grad", "torch.save", "torch.utils.data.DataLoader", "torch.nn.functional.softmax", "torch.nn.functional.nll_loss", "torch.nn.CrossEntropyLoss" ] ]
bunkahle/PILasOPENCV
[ "5acfe7279a88ddfb09f431ffec369a527885072e" ]
[ "PILasOPENCV.py" ]
[ "#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n\r\nfrom __future__ import print_function\r\nimport numpy as np\r\nimport cv2\r\ntry:\r\n import gif2numpy\r\n gif2numpy_installed = True\r\nexcept:\r\n gif2numpy_installed = False\r\ntry:\r\n import numpy2gif\r\n numpy2gif_installed = True\r\nexce...
[ [ "numpy.minimum", "numpy.tile", "numpy.min", "numpy.multiply", "numpy.radians", "numpy.cos", "numpy.frombuffer", "numpy.fromstring", "numpy.divide", "numpy.max", "numpy.sin", "numpy.logical_and", "numpy.flipud", "numpy.argmax", "numpy.sqrt", "numpy.lo...
cslotboom/Naturalize
[ "f54beb0baa53f33a66e85660738eb4880419aa1e" ]
[ "test/test_mutatate_strategies.py" ]
[ "\nimport naturalize.mutate.strategies as st\n# from naturalize.solutionClass import Individual\nimport numpy as np\n\n# np.random.seed(25)\n\nN = 6\ngenea = np.linspace(0,5,N)\ngeneb = np.linspace(0,5,N)*5\n\n\nPvector = np.array([0.1, 0.1, 0.4, 0.5, 1, 0.1])\nthreshold = 0.2\nbounds = np.ones([2,N])*np.array([[0,...
[ [ "numpy.array", "numpy.sum", "numpy.ones", "numpy.abs", "numpy.all", "numpy.linspace" ] ]
rbiswas143/deep-audioviz-experiments-train
[ "294c648ca9115efce6127fb242ac3f6f51cdf532" ]
[ "hp_tune.py" ]
[ "\"\"\"CLI and utils for training a batch of models and analysing hyper parameter tuning results\"\"\"\n\nimport train\nimport models\nimport data_processor as dp\nimport commons\n\nimport argparse\nimport torch\nimport os\nimport collections\n\n\ndef train_models(training_configs, email=False):\n \"\"\"Train a ...
[ [ "torch.cuda.is_available" ] ]
zayed22/kepler-mapper
[ "1224e5d8e64e16ebe9e9ef989556a6ea3e2b214e" ]
[ "test/test_visuals.py" ]
[ "import os\nimport numbers\nimport json\nimport pytest\n\nimport numpy as np\nfrom sklearn.datasets import make_circles\nfrom kmapper import KeplerMapper\n\nfrom kmapper import visuals\nfrom kmapper.visuals import (\n init_color_function,\n format_meta,\n format_mapper_data,\n _map_val2color,\n build...
[ [ "numpy.array", "numpy.random.rand", "numpy.random.choice", "numpy.random.seed", "numpy.ones", "sklearn.datasets.make_circles", "numpy.random.random" ] ]
rhotter/mne-python
[ "f0ced56fadb369f2542c801d60c4472b2f545721" ]
[ "mne/viz/tests/test_ica.py" ]
[ "# Authors: Denis Engemann <denis.engemann@gmail.com>\n# Alexandre Gramfort <alexandre.gramfort@inria.fr>\n#\n# License: Simplified BSD\n\nimport os.path as op\n\nimport numpy as np\nfrom numpy.testing import assert_equal, assert_array_equal\nimport pytest\nimport matplotlib.pyplot as plt\n\nfrom mne impor...
[ [ "numpy.testing.assert_array_equal", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.pyplot.get_fignums", "matplotlib.pyplot.gcf", "numpy.int64" ] ]
ManUtdMoon/safety-starter-agents
[ "d94f087f6eccb92833c6fc4b0705cb6607c334d7" ]
[ "scripts/visualize_policy_upper.py" ]
[ "#!/usr/bin/env python\n\nimport time\nimport numpy as np\nfrom safe_rl.utils.load_utils import load_policy, load_feasibiltiy\nfrom safe_rl.utils.logx import EpochLogger\nimport matplotlib.pyplot as plt\nimport os.path as osp\nimport json\nimport gym\nplt.rcParams.update({'font.size': 16})\n\ndef visualize_region(e...
[ [ "matplotlib.pyplot.rcParams.update", "matplotlib.pyplot.colorbar", "numpy.ones_like", "numpy.array", "numpy.reshape", "numpy.zeros_like", "numpy.sum", "matplotlib.pyplot.figure", "numpy.multiply", "numpy.stack", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.a...
Quimica-supramolecular/scripts_graficas
[ "2db5352bd1e8080de7f71db172c1f85d053f379c" ]
[ "Algoritm_of_Gamp.py" ]
[ "#Algoritm of Gamp \r\n\r\nfrom autograd.differential_operators import jacobian\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom scipy.optimize import minimize\r\nfrom autograd import elementwise_grad as egrad \r\nfrom autograd import grad\r\n\r\n# This function open window fo...
[ [ "numpy.concatenate", "numpy.array", "numpy.column_stack", "matplotlib.pyplot.xlabel", "pandas.DataFrame", "matplotlib.pyplot.plot", "pandas.read_excel", "numpy.min", "numpy.linalg.pinv", "matplotlib.pyplot.figure", "numpy.sum", "matplotlib.pyplot.ylabel", "numpy...
ahnorr/Naive-Resume-Matching
[ "22e0bdc638e7bfae4d2771782a291f7bab0c99a6" ]
[ "main.py" ]
[ "from tf_idf import do_tfidf\nimport argparse\nimport re\nimport os\nimport Similar\nimport pandas as pd\nfrom flask import Flask, request, send_from_directory\napp = Flask(__name__)\n\n\napp.config[\"PATH\"] = os.path.dirname(os.path.realpath(__file__))\n@app.route('/extract', methods=[\"POST\"])\ndef hello():\n ...
[ [ "pandas.read_csv" ] ]
yz3062/xgcm
[ "95f4f33d72d2add00136e27f6b3bedecb97d4d77" ]
[ "xgcm/gridops.py" ]
[ "# python 3 compatiblity\n\nimport numpy as np\nimport xarray as xr\n\n# make some functions for taking divergence\nfrom dask import array as da\n\n\ndef _append_to_name(array, append):\n try:\n return array.name + \"_\" + append\n except TypeError:\n return append\n\n\nclass GCMDataset(object):...
[ [ "numpy.atleast_1d", "numpy.zeros" ] ]
ubermag/mumaxc
[ "73098ada436cb4e16699f33068a8391a679b49e9" ]
[ "mumax3c/tests/test_util.py" ]
[ "import discretisedfield as df\nimport micromagneticmodel as mm\nimport numpy as np\nimport pytest\n\nimport mumax3c as mc\n\n\ndef test_mumax3_regions__no_subregion():\n mesh = df.Mesh(p1=(0, 0, 0), p2=(2, 2, 2), cell=(1, 1, 1))\n system = mm.System(name=\"test\")\n system.m = df.Field(mesh, dim=3, value=...
[ [ "numpy.allclose", "numpy.unique" ] ]
THU-luvision/Occuseg
[ "163e1fba6f5d9afd4ee2a4202118bc81d8f7c5e4" ]
[ "sparseconvnet/submanifoldConvolution.py" ]
[ "# Copyright 2016-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\n# 'SubmanifoldConvolution == SubmanifoldConvolution'\n\nimport sparseconvnet\nimport sparseconvnet.SCN\nfrom tor...
[ [ "torch.nn.Module.__init__" ] ]
nipundavid/PythonPlaybook
[ "cb35a6587cebf3febcdbd5dd30f5e69ab89f9a93" ]
[ "OpenCV/GettingStarted/join_images.py" ]
[ "import cv2\r\nimport numpy as np\r\n\r\n'''Used to stack images, if we are working with multiple images,\r\nit's ticky to manage so many windows so we put them in one image'''\r\n\r\nimg = cv2.imread(\"Resources/test_image.png\")\r\n\r\nhor = np.hstack((img, img))\r\ncv2.imshow(\"Horizontal Stack\", hor)\r\n\r\nve...
[ [ "numpy.hstack", "numpy.zeros", "numpy.vstack" ] ]
juwangvsu/faster-rcnn
[ "2df9e6475284ab47de9cfcb90ff63d6a81ce8559" ]
[ "lib/model/nms/nms_cpu.py" ]
[ "from __future__ import absolute_import\n\nimport numpy as np\nimport torch\n\ndef nms_cpu(dets, thresh):\n dets = dets.numpy()\n x1 = dets[:, 0]\n y1 = dets[:, 1]\n x2 = dets[:, 2]\n y2 = dets[:, 3]\n scores = dets[:, 4]\n\n areas = (x2 - x1 + 1) * (y2 - y1 + 1)\n order = scores.argsort()[:...
[ [ "torch.IntTensor", "numpy.where", "numpy.maximum" ] ]
sdrees/pyvtreat
[ "fed9a653b2524ba04b1e92b1087e58bead25f99a" ]
[ "pkg/tests/test_pipeparams.py" ]
[ "#%% md\n\n# From [pyvtreat issue 12](https://github.com/WinVector/pyvtreat/issues/12)\n\n#%%\n\nimport pytest\n\nimport pandas as pd\nimport numpy as np\nimport numpy.random\nimport vtreat\nimport vtreat.util\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.pipeline import Pipeline\nfrom sklearn....
[ [ "sklearn.model_selection.train_test_split", "numpy.random.normal", "sklearn.linear_model.LogisticRegression" ] ]
CrownX/DeepRobust
[ "276a7048aded2cf3a190d3851ffd4587b7d1dd49", "ede9246b6c882b0ae4ef666516c3e9d8f989299d" ]
[ "deeprobust/graph/utils.py", "deeprobust/image/attack/cw.py" ]
[ "import numpy as np\nimport scipy.sparse as sp\nimport torch\nfrom sklearn.model_selection import train_test_split\nimport torch.sparse as ts\nimport torch.nn.functional as F\nimport warnings\n\ndef encode_onehot(labels):\n \"\"\"Convert label to onehot format.\n\n Parameters\n ----------\n labels : num...
[ [ "torch.cat", "torch.LongTensor", "torch.eye", "torch.nn.functional.nll_loss", "torch.exp", "torch.Size", "scipy.sparse.diags", "numpy.log", "torch.FloatTensor", "scipy.sparse.eye", "numpy.arange", "scipy.sparse.csr_matrix", "torch.zeros", "scipy.sparse.isspa...
shivjeetbhullar/pi7db
[ "1215d849d1ffb0670fdb3fcc4f35602fe7963e51" ]
[ "pi7db/tests/csvtest/test.py" ]
[ "import os\nimport pandas as pd\nclass tabledb:\n def __init__(self,db_name):\n self.db_name = db_name\n if not os.path.exists(db_name):os.mkdir(db_name)\n \n def create_table(self,**kwargs):\n if 'name' in kwargs and 'colums' in kwargs and isinstance(kwargs['name'],str) and isinstance(kwargs['colums'],list...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
PacktPublishing/Practical-Computer-Vision
[ "8cf8ee58d306e0fb1a2e21b6518136bb4c174ff5" ]
[ "Chapter02/02_keras_cifar10.py" ]
[ "from __future__ import print_function\n\nfrom keras.datasets import cifar10\nimport matplotlib.pyplot as plt \n\n# Download and load dataset \n(x_train, y_train), (x_test, y_test) = cifar10.load_data()\nlabels = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']\n# to know t...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
orsveri/3DSSG
[ "9f0bb09389769e0a0bf7e85eb997545fe2221049" ]
[ "src/dataset_SGFN.py" ]
[ "if __name__ == '__main__' and __package__ is None:\n from os import sys\n sys.path.append('../')\n \nimport torch.utils.data as data\nimport os, random, torch, json, trimesh\nimport numpy as np\nimport multiprocessing as mp\n\nfrom utils import util_ply, util_data, util, define\nfrom data_processing impor...
[ [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.dot", "numpy.min", "numpy.eye", "torch.from_numpy", "numpy.where", "numpy.random.uniform", "torch.tensor", "numpy.stack", "torch.log", "torch.mean", "numpy.unique" ] ]
Palfore/OSRSmath
[ "373eb1e7f9702b98de318b3c708084353626a177" ]
[ "osrsmath/examples/combat/old/part_II/models/generate.py" ]
[ "from osrsmath.results.part_II.colors import colors\r\nfrom osrsmath.combat.successful_hits import *\r\nfrom osrsmath.results.part_II.generate_simulation import load_dataset\r\nfrom pprint import pprint\r\nfrom mpl_toolkits.mplot3d import Axes3D\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport sys...
[ [ "numpy.max", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "numpy.min", "numpy.std", "matplotlib.pyplot.ylabel", "numpy.average", "matplotlib.pyplot.show", "numpy.meshgrid" ] ]
Ellison-Lab/TestisTEs2021
[ "b624d80b216d219701fd60e347c4d30271e8d3d6" ]
[ "workflow/scripts/collect_mod_scores.py" ]
[ "import pandas as pd\nimport scanpy as sc\nimport pyarrow.dataset as pads\n\nparams = pd.read_json(\"results/finalized/optimal-gep-params/larval-w1118-testes.json\")\n\nds = pads.dataset(\"results/finalized/larval-w1118-testes/optimal_gep_membership/\", format=\"arrow\")\n\ndf = ds.to_table().to_pandas()\n\ntep = d...
[ [ "pandas.read_json" ] ]
jiahuei/cisip-FIRe
[ "bcbda2b74dc5a0b26f0338f707a257d660b688a1" ]
[ "utils/datasets.py" ]
[ "import logging\nimport os\nfrom abc import ABC\nfrom typing import Tuple, Any\n\nimport numpy as np\nimport torch\nimport torchvision\nfrom pandas import read_csv\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision.datasets import CIFAR10, CIFAR100\nfrom torchvision.datasets.folder import pil_loade...
[ [ "numpy.concatenate", "torch.zeros", "numpy.array", "torch.cat", "torch.nn.functional.one_hot", "torch.stack", "numpy.random.choice", "torch.device", "numpy.sum", "torch.save", "torch.no_grad", "numpy.random.shuffle", "numpy.flipud", "torch.tensor", "nump...
zzpwahaha/VimbaCamJILA
[ "3baed1b5313e6c198d54a33c2c84357035d5146a" ]
[ "VimbaCam/ColorMap/ehtplot/ehtplot/extra/metroize.py" ]
[ "# Copyright (C) 2018 Chi-kwan Chan\n# Copyright (C) 2018 Steward Observatory\n#\n# This file is part of ehtplot.\n#\n# ehtplot is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the Lic...
[ [ "numpy.sum", "numpy.array", "numpy.cumsum" ] ]
MuhamedEssam/deeplearning
[ "e6004da4df5d8d066f637dc471f4a0f590f3af1e" ]
[ "015-word2vec/skip-gram.py" ]
[ "# code is from https://github.com/tensorflow/tensorflow/blob/r1.7/tensorflow/examples/tutorials/word2vec/word2vec_basic.py\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport collections\nimport math\nimport os\nimport sys\nimport argparse\nimpo...
[ [ "matplotlib.pyplot.annotate", "numpy.random.choice", "tensorflow.matmul", "tensorflow.contrib.tensorboard.plugins.projector.ProjectorConfig", "tensorflow.nn.embedding_lookup", "tensorflow.global_variables_initializer", "tensorflow.nn.nce_loss", "tensorflow.train.GradientDescentOpti...
YoungYoung619/road_object_detection
[ "05b0bcac45b64a6ae72606d4be77d9f8220748f8" ]
[ "utils/common_tools.py" ]
[ "\"\"\"\nCopyright (c) College of Mechatronics and Control Engineering, Shenzhen University.\nAll rights reserved.\n\nDescription :\n\n\nAuthor:Team Li\n\"\"\"\nimport tensorflow as tf\nimport logging\n\nlogging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')\nlogger = logging.ge...
[ [ "tensorflow.reshape", "tensorflow.stack" ] ]
omarmaddouri/GCNCC_1
[ "3270b4c2d48e0090a18a0ab1df3b9fd81627029d" ]
[ "scripts/scz_microarray_combined/1_prepare_feature_label_matrix_old_original.py" ]
[ "from __future__ import division\r\nfrom __future__ import print_function\r\n\r\nimport tensorflow as tf\r\nfrom pathlib import Path\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom collections import OrderedDict\r\nimport itertools\r\nimport csv\r\nimport os\r\nimport sys\r\nproject_path = Path(__file__).resol...
[ [ "numpy.logical_or", "numpy.zeros", "pandas.DataFrame", "sklearn.preprocessing.normalize", "pandas.concat", "numpy.dtype" ] ]
azure-walker/MLOpsPython
[ "710291c3c573acd0d4fcb897150404c7ca9498ca" ]
[ "app/training/test_train.py" ]
[ "import numpy as np\nfrom app.training.train import train_model, get_model_metrics\n\n\ndef test_train_model():\n X_train = np.array([1, 2, 3, 4, 5, 6]).reshape(-1, 1)\n y_train = np.array([10, 9, 8, 8, 6, 5])\n data = {\"train\": {\"X\": X_train, \"y\": y_train}}\n\n reg_model = train_model(data, {\"al...
[ [ "numpy.testing.assert_almost_equal", "numpy.array" ] ]
jakob-he/TADA
[ "8db4e0af19b4a32c7071c175a21bbafe3b02cb31" ]
[ "tadacnv/lib/utils.py" ]
[ "\"\"\"Helper functions to parse BED files.\"\"\"\n# standart libraries\nimport pathlib\nimport json\nimport gzip\n\n# own libraries\nfrom .bed import Bed\nfrom .bed_class import BedClass\n\n# third party libararies\nimport numpy as np\nimport pandas as pd\nfrom scipy import stats, linalg\n\n# sklearn\nfrom sklearn...
[ [ "numpy.zeros", "pandas.crosstab", "numpy.ones", "scipy.linalg.lstsq", "numpy.mean", "sklearn.ensemble._forest._generate_unsampled_indices", "scipy.stats.pearsonr", "numpy.argmax", "numpy.unique" ] ]
hbdat/cvpr20_IMCL
[ "a71b592e006778f5fff05976acd64b3b412c7f4a", "a71b592e006778f5fff05976acd64b3b412c7f4a" ]
[ "utility.py", "OpenImages_experiments/baseline_logistic_OpenImages.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Jan 21 12:34:41 2019\r\n\r\n@author: badat\r\n\"\"\"\r\nfrom sklearn.metrics import average_precision_score\r\nimport numpy as np\r\nimport tensorflow as tf\r\n\r\n#%%\r\ndef compute_AP(Prediction,Label,names):\r\n num_class = Prediction.shape[1]\r\n ap=np....
[ [ "numpy.concatenate", "tensorflow.image.decode_jpeg", "tensorflow.decode_raw", "numpy.zeros", "tensorflow.read_file", "tensorflow.FixedLenFeature", "numpy.sum", "tensorflow.gfile.GFile", "sklearn.metrics.average_precision_score", "numpy.transpose", "numpy.argsort", "...
trentpark8800/pandas
[ "4edf3351b0bfef551a01adf3ca2e6e657448ed80" ]
[ "pandas/core/indexes/category.py" ]
[ "from typing import Any, List, Optional\nimport warnings\n\nimport numpy as np\n\nfrom pandas._config import get_option\n\nfrom pandas._libs import index as libindex\nfrom pandas._libs.lib import no_default\nfrom pandas._typing import ArrayLike, Label\nfrom pandas.util._decorators import Appender, cache_readonly, d...
[ [ "pandas.core.arrays.categorical.contains", "pandas.core.accessor.delegate_names", "pandas.io.formats.printing.pprint_thing", "pandas.core.construction.extract_array", "pandas.core.missing.clean_reindex_fill_method", "pandas.core.dtypes.common.ensure_platform_int", "pandas.core.dtypes.m...