repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
LeeDaeil/PyQt5_study | [
"ecdd22ce2809ce6f01c8691a7ca75ef1771b7202"
] | [
"Study_6/CNS_Fun.py"
] | [
"import multiprocessing\nimport time\n\n\nclass function1(multiprocessing.Process):\n def __init__(self, mem):\n multiprocessing.Process.__init__(self)\n self.mem = mem[0] # main mem connection\n\n def run(self):\n while True:\n print(self, self.mem['QPROLD'])\n time... | [
[
"matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg",
"matplotlib.pyplot.figure"
]
] |
hustlibraco/MockingBird | [
"c396792b22613e8ac37b1c51bd38bd462909251f"
] | [
"synthesizer/models/global_style_token.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.init as init\nimport torch.nn.functional as tFunctional\nfrom synthesizer.gst_hyperparameters import GSTHyperparameters as hp\n\n\nclass GlobalStyleToken(nn.Module):\n\n def __init__(self):\n\n super().__init__()\n self.encoder = ReferenceEncode... | [
[
"torch.nn.Linear",
"torch.nn.GRU",
"torch.nn.ModuleList",
"torch.FloatTensor",
"torch.split",
"torch.nn.BatchNorm2d",
"torch.nn.init.normal_",
"torch.nn.Conv2d",
"torch.nn.functional.softmax",
"torch.nn.functional.relu",
"torch.matmul",
"torch.nn.functional.tanh"
... |
anewmark/galaxy_dark_matter | [
"b5261e4e413d3a18a45a19e92f7545adc408878a",
"b5261e4e413d3a18a45a19e92f7545adc408878a"
] | [
"lin-log_test.py",
"call_ages.py"
] | [
"print('Testing Lin v Log')\n\n\ntest=2\nif test==1:\n\timport astropy.table as table \n\timport numpy as np\n\tfrom defcuts import *\n\tfrom defflags import *\n\tfrom halflight_first import *\n\tfrom def_get_mags import *\n\tfrom def_halflight_math import *\n\t\n\tbands=['g', 'r', 'i','z', 'y']\n\tdaperture=[1.01,... | [
[
"numpy.array",
"matplotlib.pyplot.errorbar",
"numpy.round",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.plot",
"numpy.min",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"s... |
niksaz/semantic-code-search | [
"8b25dbdba43fa9ee6c400a9243b81aa6a7d0c07a"
] | [
"src/model_restore_helper.py"
] | [
"from typing import Dict, Any, Optional, Type\n\nimport tensorflow as tf\nfrom dpu_utils.utils import RichPath\n\nfrom encoders import \\\n NBoWEncoder, CodeTokensASTEncoder, TBCNNEncoder, ASTNNEncoder, AstTokensEncoder, ASTPretrainedNBoWEncoder, \\\n GraphPretrainedNBoWEncoder, GraphTokensEncoder, GraphNodes... | [
[
"tensorflow.variables_initializer",
"tensorflow.name_scope"
]
] |
dask/partd | [
"efa78b4cb27ec450d9bff360e1bf9451c5ec0b17"
] | [
"partd/numpy.py"
] | [
"\"\"\" Store arrays\n\nWe put arrays on disk as raw bytes, extending along the first dimension.\nAlongside each array x we ensure the value x.dtype which stores the string\ndescription of the array's dtype.\n\"\"\"\nfrom contextlib import suppress\nimport pickle\n\nimport numpy as np\nfrom toolz import valmap, ide... | [
[
"numpy.dtype",
"numpy.frombuffer"
]
] |
panghantian-kavout/DeepRL | [
"c144f751d12f17ae5f0fd99d97fd936de39f57c1"
] | [
"DeepRL/Agent/PGAgent.py"
] | [
"from Agent import Agent\nimport random\nimport tensorflow as tf\nimport numpy as np\n\n\nclass PGAgent(Agent):\n\n def __init__(self, _model, _env, _is_train=True,\n _optimizer=None, _global_step=None, _replay=None,\n _gpu=False, _gamma=0.99,\n _batch_size=32, _be... | [
[
"tensorflow.initialize_all_variables",
"numpy.zero_like",
"tensorflow.gradients",
"tensorflow.log",
"tensorflow.placeholder",
"tensorflow.reduce_sum",
"tensorflow.device"
]
] |
WingCode/live-project | [
"977dfbcaade35d8173dbb6ace102fe8998f1cdf4"
] | [
"test/funksvd_recommender_test.py"
] | [
"import os\n\nfrom builder.matrix_factorization_calculator import MatrixFactorization\nfrom recs.funksvd_recommender import FunkSVDRecs\n\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"prs_project.settings\")\n\nimport django\n\ndjango.setup()\n\nimport unittest\n\nimport pandas as pd\n\nSTAR_WARS = 'star war... | [
[
"pandas.DataFrame"
]
] |
SunAriesCN/face-datasets | [
"78d3cbb1badc224cf17091c7b8712ea2fed1eb2b"
] | [
"LFW/plot.py"
] | [
"import matplotlib\nmatplotlib.use(\"agg\")\nimport matplotlib.pyplot as plt\nimport random\nimport os\n\ndef getPlotColor(i):\n cnames = [\n '#ED1F24',\n '#B8529F',\n '#3952A3',\n '#69BC45', \n '#FF8400',\n '#A74E44', \n '#7642CC', \n '#000000', \n '#00FF00',\n '#FF0000']\n retu... | [
[
"matplotlib.use",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.subplot"
]
] |
Northengard/torch2tf_converter | [
"8d16c5364d97e25ed04c89704d9768b4bffc1c6b"
] | [
"models/example.py"
] | [
"from torch import nn\n\n\nclass SimpleTorchModel(nn.Module):\n def __init__(self):\n super(SimpleTorchModel, self).__init__()\n n_chn = 32\n self.conv1 = nn.Conv2d(3, n_chn, (3, 3), padding=1, stride=(1, 1), bias=False)\n self.conv1_bn = nn.BatchNorm2d(n_chn)\n self.conv1_relu... | [
[
"torch.nn.Linear",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.Flatten"
]
] |
MargeryLab/BMaskR-CNN | [
"41f63d301d6be7fa30ba281a5a0f727fbca6ad2a"
] | [
"tests/data/test_detection_utils.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\r\n\r\nimport copy\r\nimport numpy as np\r\nimport os\r\nimport unittest\r\nimport pycocotools.mask as mask_util\r\nfrom fvcore.common.file_io import PathManager\r\n\r\nfrom detectron2.data import MetadataCatalog, detection_utils\r\nfrom detec... | [
[
"numpy.allclose",
"numpy.random.rand",
"numpy.asarray",
"numpy.zeros"
]
] |
Sabokou/BigData | [
"7901451cf3fa748c541ef93cf1578495335165cf"
] | [
"Spark/Recommendations/py-apps/Spark_Recommendations.py"
] | [
"import logging\n\nfrom pyspark.sql import SparkSession\nfrom pyspark.sql.functions import *\nimport numpy as np\nimport pandas as pd\nimport pyspark.sql.functions as F\nfrom pyspark.sql.types import DoubleType\nfrom sklearn.metrics.pairwise import cosine_similarity\nfrom sklearn.feature_extraction.text import Coun... | [
[
"pandas.read_sql_query"
]
] |
kiseyno92/SNU_ML | [
"be48a5c570ef59dc2b5a782c828536e100d7f0eb",
"be48a5c570ef59dc2b5a782c828536e100d7f0eb"
] | [
"Practice1/ML_Linear_Regression.py",
"Practice3/NN_basic.py"
] | [
"\n# coding: utf-8\n\n# Linear Regression Example\n\n# In[1]:\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn import datasets, linear_model\n\n\n# In[4]:\n\n#Load the diabetes dataset\ndiabetes = datasets.load_diabetes()\n#diabetes\n\n\n# In[6]:\n\ndiabetes_X = diabetes.data[:,np.newaxis, 2]#모든... | [
[
"sklearn.linear_model.LinearRegression",
"sklearn.datasets.load_diabetes",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.scatter"
],
[
"numpy.arra... |
dmnpignaud/incubator-airflow | [
"84a55f3e546cfbfd5f47302537444c8c8c4d2753"
] | [
"scripts/perf/scheduler_ops_metrics.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# 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... | [
[
"pandas.DataFrame"
]
] |
HarshCasper/Ling | [
"5171024b440ae455bad4d0972c2046288bd8b159"
] | [
"app.py"
] | [
"from flask import Flask,render_template,url_for,request\nfrom flask_bootstrap import Bootstrap \nimport pandas as pd \nimport numpy as np \n\n# ML Packages\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.externals import joblib\n\n\napp = Flask(__name__)\nBootstrap(app)\n\n\n@app.route('... | [
[
"sklearn.externals.joblib.load",
"pandas.read_csv",
"sklearn.feature_extraction.text.CountVectorizer"
]
] |
khaykingleb/HiFi-GAN | [
"6bafd6f8f67d2393e057cb64cd6c1311d59a85f0"
] | [
"nv/datasets/ljspeech_dataset.py"
] | [
"import torchaudio\nimport torch\n\n\nclass LJSpeechDataset(torchaudio.datasets.LJSPEECH):\n\n def __init__(self, root: str):\n super().__init__(root=root)\n \n def __getitem__(self, index: int):\n waveform, sr, _, transcript = super().__getitem__(index)\n waveform_length = torch.tenso... | [
[
"torch.tensor"
]
] |
shenlong95/mealpy | [
"36fd404b8c255699cccc5ea68dbda385836a615b"
] | [
"mealpy/human_based/ICA.py"
] | [
"#!/usr/bin/env python\n# ------------------------------------------------------------------------------------------------------%\n# Created by \"Thieu\" at 14:07, 02/03/2021 %\n# ... | [
[
"numpy.max",
"numpy.random.normal",
"numpy.array",
"numpy.random.choice",
"numpy.random.rand",
"numpy.sum",
"numpy.min",
"numpy.mean",
"numpy.random.uniform",
"numpy.argmax"
]
] |
negm/scipy-lecture-notes | [
"cc87204fcc4bd2f4702f7c29c83cb8ed5c94b7d6"
] | [
"advanced/mathematical_optimization/examples/compare_optimizers_plot.py"
] | [
"\"\"\"\nPlotting the comparison of optimizers\n======================================\n\nPlots the results from the comparison of optimizers.\n\n\"\"\"\n\nimport pickle\n\nimport numpy as np\nimport pylab as pl\n\nresults = pickle.load(file('compare_optimizers.pkl'))\n#results = pickle.load(file('compare_optimizer... | [
[
"numpy.linspace",
"numpy.arange",
"numpy.mean"
]
] |
hammer/pandas | [
"7d7d210cc40206564d63e4b0d1239eef0e987173"
] | [
"pandas/stats/tests/test_ols.py"
] | [
"\"\"\"\nUnit test suite for OLS and PanelOLS classes\n\"\"\"\n\n# pylint: disable-msg=W0212\n\nfrom __future__ import division\n\nfrom datetime import datetime\nimport unittest\nimport numpy as np\n\nfrom pandas.core.panel import LongPanel, Panel\nfrom pandas.core.api import DataFrame, Index, Series, notnull\nfrom... | [
[
"pandas.core.api.notnull",
"pandas.util.testing.assert_frame_equal",
"pandas.util.testing.makeTimeDataFrame",
"pandas.core.api.Index",
"pandas.core.panel.Panel",
"pandas.util.testing.assert_almost_equal",
"numpy.random.randn",
"pandas.util.testing.assert_series_equal",
"pandas.... |
lwang89/Stock-Trading-Visualization | [
"42f1b775b19e6291a026b6375e362d05660be385"
] | [
"render/StockTradingGraph.py"
] | [
"\n\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nfrom matplotlib import style\n\n# finance module is no longer part of matplotlib\n# see: https://github.com/matplotlib/mpl_finance\nfrom mpl_finance import candlestick_ochl as candlestick\n\nstyle.use('da... | [
[
"numpy.array",
"matplotlib.style.use",
"matplotlib.pyplot.close",
"numpy.nonzero",
"matplotlib.pyplot.figure",
"matplotlib.dates.strpdate2num",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.subplot2grid",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots_adjust"
]
] |
nickwood/endochrone | [
"050a2604be82ee4cd5ee6357ea72d3d6d4117277"
] | [
"tests/stats/test_measures.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nimport pytest\n\nfrom endochrone.stats import measures\nfrom endochrone.utils import lazy_test_runner as ltr\n\n__author__ = \"nickwood\"\n__copyright__ = \"nickwood\"\n__license__ = \"mit\"\n\n\ndef test_euclidian_dist():\n A = np.array([0, 0])\n B = np.array([3,... | [
[
"numpy.array",
"numpy.arange"
]
] |
Ayushparikh-code/nanotune | [
"6d63adc64c89aa38592cf732345d38f7c18f05e1"
] | [
"nanotune/tests/tuning/test_tuner.py"
] | [
"import copy\n\nimport numpy as np\nimport pytest\n\nimport nanotune as nt\nfrom nanotune.device_tuner.tuner import (Tuner, set_back_valid_ranges,\n set_back_voltages)\nfrom nanotune.device_tuner.tuningresult import TuningResult\nfrom nanotune.tests.mock_classifier import Moc... | [
[
"numpy.allclose"
]
] |
abdulrhmanG-alahmadi/Exploring-Weather-Trends | [
"e3fca01e18efdc90edf3de777aa174c5a1025567"
] | [
"visulize.py"
] | [
"'''\r\nthis code was made by Abdulrhman Alahmadi and runs in linear time O(n)\r\nplease if you have any suggestions to make it more efficient share them with me\r\n'''\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\n\r\n# getting csv files\r\nglobalData = pd.read_csv(\"C:\\\\Users\\\\alahm\\\\Desktop\... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
mwojcikowski/opendrugdiscovery | [
"174b22f6a9378bfbb1f435a6e71cad13218e5e6d",
"174b22f6a9378bfbb1f435a6e71cad13218e5e6d"
] | [
"oddt/metrics.py",
"oddt/scoring/descriptors/__init__.py"
] | [
"\"\"\"Metrics for estimating performance of drug discovery methods implemented in ODDT\"\"\"\n\nfrom math import ceil\nimport numpy as np\nfrom sklearn.metrics import roc_curve as roc, roc_auc_score as roc_auc, auc, mean_squared_error\n\n__all__ = ['roc', 'auc', 'roc_auc', 'roc_log_auc', 'enrichment_factor', 'rand... | [
[
"sklearn.metrics.mean_squared_error",
"numpy.log",
"sklearn.metrics.auc",
"numpy.log10",
"sklearn.metrics.roc_curve"
],
[
"numpy.zeros_like",
"numpy.vstack",
"numpy.zeros"
]
] |
DataScientest-Studio/firepy | [
"e4fc61a2232a22b2a7d45ae42123995d51866c52"
] | [
"streamlit/streamlit_firepy.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nScript for the Streamlit demo of the FirePy project\n\"\"\"\n\nimport folium # map rendering library\nimport streamlit as st\nfrom streamlit_folium import folium_static\nimport rasterio as rio\nimport tifffile\nimport numpy as np\nfrom pyproj import Proj, transform\nimport tensorf... | [
[
"numpy.moveaxis"
]
] |
brsr/antitile | [
"57228f1e2f2646ee88afbfc853adb8d3a6bcd736"
] | [
"antitile/xmath.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nExtra math and array functions.\n\"\"\"\n\nimport numpy as np\nfrom numpy.linalg import norm\nimport pandas as pd\n\ndef reflect_through_origin(normal):\n \"\"\"Reflection matrix for reflecting through a plane through the origin\n specified by its normal\n\n >>> x = np.arr... | [
[
"numpy.isclose",
"numpy.where",
"numpy.outer",
"numpy.inner",
"numpy.dtype",
"numpy.sin",
"numpy.linalg.norm",
"pandas.DataFrame",
"numpy.arange",
"numpy.sqrt",
"numpy.cross",
"numpy.array",
"numpy.roll",
"numpy.recarray",
"numpy.stack",
"numpy.arcta... |
naylor-b/OpenAeroStruct | [
"eeb69bcea7c80587c6156472ba70735e62b15702"
] | [
"openaerostruct/utils/plot_wingbox.py"
] | [
"\"\"\"\r\n\r\nThis only works when using the wingbox model with MULTIPOINT analysis/optimization.\r\n\r\n\"\"\"\r\n\r\n\r\nfrom __future__ import division, print_function\r\nimport sys\r\nmajor_python_version = sys.version_info[0]\r\n\r\nif major_python_version == 2:\r\n import tkFont\r\n import Tkinter as T... | [
[
"numpy.min",
"numpy.mean",
"matplotlib.pyplot.draw",
"numpy.cos",
"matplotlib.backends.backend_tkagg.NavigationToolbar2Tk",
"numpy.max",
"numpy.sin",
"numpy.linalg.norm",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.tight_layout",
"numpy.sqrt",
"matplotlib.use",
... |
AsciencioAlex/Matplotlib-In-Practice-Data-Visualization | [
"4203b5ba0f3f2fd7f72c26e6fec6d32d7949fc54"
] | [
"sine-cosine1.py"
] | [
"from pylab import *\nimport numpy as np\n\n\n# generate uniformly distributed\n# 256 points from -pi to pi, inclusive\nx = np.linspace(-np.pi, np.pi, 256, endpoint=True)\n\n# these are vectorized versions\n# of math.cos, and math.sin in built-in Python maths\n# compute cos for every x\ny = np.cos(x)\n\n# compute s... | [
[
"numpy.linspace",
"numpy.sin",
"numpy.cos"
]
] |
yick2232/imgclsmob | [
"fb220bff18b27d1fc6db1bac6cf69b70c2d07490",
"fb220bff18b27d1fc6db1bac6cf69b70c2d07490",
"fb220bff18b27d1fc6db1bac6cf69b70c2d07490"
] | [
"chainer_/chainercv2/models/pyramidnet.py",
"pytorch/pytorchcv/models/squeezenext.py",
"pytorch/pytorchcv/models/wrn.py"
] | [
"\"\"\"\n PyramidNet for ImageNet-1K, implemented in Chainer.\n Original paper: 'Deep Pyramidal Residual Networks,' https://arxiv.org/abs/1610.02915.\n\"\"\"\n\n__all__ = ['PyramidNet', 'pyramidnet101_a360', 'PyrUnit']\n\nimport os\nimport chainer.functions as F\nimport chainer.links as L\nfrom chainer import... | [
[
"numpy.zeros"
],
[
"torch.nn.Linear",
"torch.nn.init.kaiming_uniform_",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.init.constant_",
"torch.nn.ReLU",
"torch.randn"
],
[
"torch.nn.Linear",
"torch.nn.init.kaiming_uniform_",
"to... |
1e-to/sdc | [
"3ca1bd6cb2d085d9b0f464ff19e97aaf178d4304"
] | [
"sdc/datatypes/pandas_series_functions/map.py"
] | [
"# *****************************************************************************\n# Copyright (c) 2020, Intel Corporation All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# Redistribut... | [
[
"numpy.empty",
"pandas.Series"
]
] |
KaidongLi/pytorch-3d2d | [
"15c0bcef28de3b041c35b38cfa1093e9d23b3a53"
] | [
"train_cls.py"
] | [
"\"\"\"\nAuthor: Benny\nDate: Nov 2019\n\"\"\"\nfrom data_utils.ModelNetDataLoader import ModelNetDataLoader\nimport argparse\nimport numpy as np\nimport os\nimport torch\nimport datetime\nimport logging\nfrom pathlib import Path\nfrom tqdm import tqdm\nimport sys\nimport provider\nimport importlib\nimport shutil\n... | [
[
"torch.optim.lr_scheduler.StepLR",
"numpy.zeros",
"torch.no_grad",
"torch.save",
"numpy.mean",
"torch.utils.data.DataLoader",
"torch.Tensor"
]
] |
adematti/obiwan | [
"c12b427ac5bc0e16ae836ac063fc2c009264ed25"
] | [
"py/tests/test_batch.py"
] | [
"import os\nimport io\nimport sys\nimport shutil\nimport importlib\n\nimport numpy as np\nimport fitsio\nimport legacypipe\nfrom legacypipe import runbrick as lprunbrick\n\nfrom obiwan import setup_logging,runbrick,SimCatalog,RunCatalog,find_file\nfrom obiwan.catalog import ListStages,Stages\nfrom obiwan.batch impo... | [
[
"numpy.all",
"numpy.random.RandomState"
]
] |
Tsaousis/acme | [
"14278693bcc5fef0839ac60792d452d3d80acfd7"
] | [
"acme/agents/jax/ail/networks.py"
] | [
"# Copyright 2018 DeepMind Technologies Limited. 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# Unle... | [
[
"numpy.sqrt"
]
] |
FabianKamp/neurolib | [
"970bcb02c54e635dcba21f3635c12ccf5df9d36b"
] | [
"neurolib/optimize/exploration/exploration.py"
] | [
"import copy\nimport datetime\nimport logging\nimport multiprocessing\nimport os\nimport pathlib\n\nimport numpy as np\nimport pandas as pd\nimport psutil\nimport pypet\nimport tqdm\nimport xarray as xr\n\nfrom ...utils import paths\nfrom ...utils import pypetUtils as pu\nfrom ...utils.collections import dotdict, f... | [
[
"pandas.DataFrame",
"numpy.stack",
"numpy.unique"
]
] |
marian2js/agents | [
"114c5252fb8d0dd4d739f01ffac36ceae76eff5f",
"114c5252fb8d0dd4d739f01ffac36ceae76eff5f"
] | [
"tf_agents/environments/wrappers_test.py",
"tf_agents/agents/dqn/examples/v1/train_eval_atari.py"
] | [
"# coding=utf-8\n# Copyright 2018 The TF-Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b... | [
[
"numpy.array",
"numpy.asarray",
"numpy.random.RandomState",
"numpy.testing.assert_array_almost_equal",
"numpy.finfo",
"numpy.prod"
],
[
"tensorflow.compat.v1.placeholder",
"tensorflow.TensorSpec",
"tensorflow.compat.v1.data.make_one_shot_iterator",
"tensorflow.compat.v2... |
cHemingway/MRCG_python | [
"341f4ce646f5b1e25e3f4b9c16b56d27e1da13ff"
] | [
"test_MRCG.py"
] | [
"# Unit tests for MRCG, comparing against reference implementation\n\n# Chris Hemingway 2019, MIT License\n# See LICENSE file for details\n\nimport os\nimport sys\nimport unittest\nimport cProfile\nimport argparse\n\nimport scipy.io.wavfile, scipy.io.matlab\nimport numpy as np\nfrom matplotlib import transforms, py... | [
[
"numpy.concatenate",
"numpy.testing.assert_allclose",
"matplotlib.pyplot.colorbar",
"numpy.testing.assert_equal",
"matplotlib.pyplot.savefig",
"numpy.random.randn",
"matplotlib.pyplot.subplots",
"numpy.abs"
]
] |
Marcel-Rodekamp/qcdanalysistools | [
"945c8201337ba0d52bc37267198d367bbe3e75e3"
] | [
"test/Fitting/t_DiagonalLS_initialization.py"
] | [
"import numpy as np\nimport qcdanalysistools.fitting as fitting\nimport qcdanalysistools.analysis as ana\n\n# number of data points i.e. gauge configurations\nN = 212\n\n# dimension i.e. size of temporal dimension\nD = 48\n\n# abscissa\nx = np.array([x for x in range(D)])\n\n# ordinate data\ny = np.array( [[ *x ] f... | [
[
"numpy.average",
"numpy.allclose",
"numpy.var"
]
] |
PaperCodeStorage/MLVSNet | [
"967692542b73affb46715ba97728825ce541068c"
] | [
"searchspace.py"
] | [
"import numpy as np\nfrom pomegranate import MultivariateGaussianDistribution, GeneralMixtureModel\nimport logging\n\n\nclass SearchSpace(object):\n\n def reset(self):\n raise NotImplementedError\n\n def sample(self):\n raise NotImplementedError\n\n def addData(self, data, score):\n re... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"numpy.cov",
"numpy.zeros",
"numpy.round",
"numpy.shape",
"numpy.mean",
"numpy.random.multivariate_normal",
"numpy.diag",
"numpy.average",
"numpy.linspace",
"numpy.meshgrid"
]
] |
frankinspace/l2ss-py | [
"29b88621c0fabe5d696aeffcc8f7039f108ff20b"
] | [
"podaac/subsetter/xarray_enhancements.py"
] | [
"# Copyright 2019, by the California Institute of Technology.\n# ALL RIGHTS RESERVED. United States Government Sponsorship acknowledged.\n# Any commercial use must be negotiated with the Office of Technology\n# Transfer at the California Institute of Technology.\n#\n# This software may be subject to U.S. export con... | [
[
"numpy.all",
"numpy.where",
"numpy.isnan",
"numpy.any"
]
] |
kylebarron/tablefill | [
"5f56a54c63939e03538d7530f5a64ede2b2455be"
] | [
"tablefill/tablefill.py"
] | [
"#!/usr/bin/env python2\n# encoding: utf-8\n\n\"\"\"Fill LaTeX template files with external inputs\n\nDescription\n-----------\n\ntablefill is a python module designed to fill LaTeX and Lyx tables\nwith output from text files (usually output from Stata or Matlab). The\noriginal tablefill does the same for LyX files... | [
[
"numpy.asmatrix",
"numpy.array"
]
] |
aikovsky/tegridy-tools | [
"4a87e1a27e2ad9ee6e16049bde7835836caa4fdd"
] | [
"tegridy-tools/pretty_midi/utilities.py"
] | [
"\"\"\"Utilty functions for converting between MIDI data and human-readable/usable\nvalues\n\n\"\"\"\n\nimport numpy as np\nimport re\n\nfrom pm_constants import DRUM_MAP, INSTRUMENT_MAP, INSTRUMENT_CLASSES\n\n\ndef key_number_to_key_name(key_number):\n \"\"\"Convert a key number to a key string.\n\n Paramete... | [
[
"numpy.round",
"numpy.log2"
]
] |
lravindr/cvat | [
"b025acea43fbb55c7ea7eac7b12007f0eb6d3f45"
] | [
"datumaro/datumaro/plugins/tf_detection_api_format/extractor.py"
] | [
"\n# Copyright (C) 2019 Intel Corporation\n#\n# SPDX-License-Identifier: MIT\n\nfrom collections import OrderedDict\nimport numpy as np\nimport os.path as osp\nimport re\n\nfrom datumaro.components.extractor import (SourceExtractor, DatasetItem,\n AnnotationType, Bbox, Mask, LabelCategories\n)\nfrom datumaro.uti... | [
[
"numpy.dstack"
]
] |
xy-always/2020Iberlef | [
"b3c5a7046955d6f841a6fcb55fdd8bb8981015db"
] | [
"src/optimization.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | [
[
"tensorflow.zeros_initializer",
"tensorflow.trainable_variables",
"tensorflow.multiply",
"tensorflow.group",
"tensorflow.contrib.tpu.CrossShardOptimizer",
"tensorflow.gradients",
"tensorflow.constant",
"tensorflow.train.polynomial_decay",
"tensorflow.sqrt",
"tensorflow.trai... |
vlegout/pandas-profiling | [
"3d0d0e4bb85a32cd7b7cd63e7ad083cb9a65970c"
] | [
"tests/unit/test_describe.py"
] | [
"import datetime\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom pandas_profiling import config\nfrom pandas_profiling.model.base import Variable\nfrom pandas_profiling.model.describe import describe\nfrom pandas_profiling.model.summary import describe_1d\n\ncheck_is_NaN = \"pandas_profiling.check... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"numpy.ones",
"pandas.Series"
]
] |
ezdac/raiden | [
"d7504996e6738b55d5a9dcf9a36ef66797f6f326"
] | [
"tools/debugging/plot/scatter.py"
] | [
"#!/usr/bin/env python\nimport argparse\nimport csv\nimport datetime\nimport sys\n\nfrom matplotlib import dates, pyplot\nfrom matplotlib.axes import Axes\n\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--width\", default=1000, help=\"Configures width of the output in pixels.\")\nparser.add_argument(... | [
[
"matplotlib.dates.MinuteLocator",
"matplotlib.pyplot.savefig",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.figure",
"matplotlib.dates.HourLocator",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.gca"
]
] |
gfgb/nglod | [
"801b662e9417562419dfac577c60c0152e6fdff4"
] | [
"sdf-net/lib/tracer/SphereTracer_VC.py"
] | [
"# The MIT License (MIT)\r\n#\r\n# Copyright (c) 2021, NVIDIA CORPORATION.\r\n#\r\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\r\n# this software and associated documentation files (the \"Software\"), to deal in\r\n# the Software without restriction, including without limitatio... | [
[
"torch.zeros",
"torch.nn.functional.normalize",
"torch.cat",
"torch.rand",
"torch.no_grad",
"torch.abs",
"torch.ones_like",
"torch.zeros_like",
"torch.addcmul"
]
] |
mokeeqian/ZhengFangJiaoWu | [
"7ac697ed9c1914f7f4aba47d51ba40a60eec1ebd"
] | [
"main.py"
] | [
"#!/usr/bin/env python3\n# encoding=utf-8\n# Copyright: Qian Jipeng(C) 2019\n\"\"\"\nTODO:\n\t数据清洗与进一步解析!\n\"\"\"\n\n\n\nimport os\nimport re\nimport chardet\t\t# encoding\nimport urllib.parse\n\nimport requests\nimport numpy as np\nimport pandas as pd\n\nimport config_loader as cfl \t# load config\n\nif os.name ==... | [
[
"numpy.array",
"pandas.read_csv"
]
] |
OmriBromberg/great_expectations | [
"60eb81ebfb08fef5d37d55c316dc962928beb165",
"60eb81ebfb08fef5d37d55c316dc962928beb165"
] | [
"tests/test_definitions/test_expectations_cfe.py",
"tests/checkpoint/test_checkpoint.py"
] | [
"import glob\nimport json\nimport os\nimport random\nimport string\n\nimport pandas as pd\nimport pytest\n\nfrom great_expectations.execution_engine.pandas_batch_data import PandasBatchData\nfrom great_expectations.execution_engine.sparkdf_batch_data import SparkDFBatchData\nfrom great_expectations.execution_engine... | [
[
"pandas.__version__.split"
],
[
"pandas.DataFrame"
]
] |
Leslie-Fang/incubator-tvm | [
"aa035f4650926f5e714b02cbab6d974f0a17352f"
] | [
"tests/python/relay/test_external_runtime.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... | [
[
"numpy.concatenate",
"numpy.random.rand"
]
] |
J-E-J-S/aaRS-Pipeline | [
"43f59f28ab06e4b16328c3bc405cdddc6e69ac44"
] | [
"resources/mgltools_x86_64Linux2_1.5.6/lib/python2.5/site-packages/matplotlib/axis.py"
] | [
"\"\"\"\nClasses for the ticks and x and y axis\n\"\"\"\nfrom __future__ import division\n\nfrom matplotlib import rcParams\nimport matplotlib.artist as artist\nimport matplotlib.cbook as cbook\nimport matplotlib.font_manager as font_manager\nimport matplotlib.lines as mlines\nimport matplotlib.patches as mpatches... | [
[
"matplotlib.patches.bbox_artist",
"matplotlib.transforms.Bbox.from_extents",
"matplotlib.units.registry.get_converter",
"matplotlib.artist.Artist.set_clip_path",
"matplotlib.cbook.silent_list",
"matplotlib.font_manager.FontProperties",
"matplotlib.transforms.IdentityTransform",
"ma... |
Benykoz/simcom | [
"ffe1c3636ef65a037a34e71d5cbcdb2e483d5b93"
] | [
"src/Unity2RealWorld.py"
] | [
"import numpy as np\nimport math\nfrom geometry_msgs.msg import Pose, Point, Quaternion, Vector3\n\n\ndef positionROS2RW(position):\n A = np.array([[-1,0,0], [0,-1,0], [0,0,1,]])\n B = np.array([position.x, position.y, position.z])\n RWPos = A.dot(B)\n #RWPos = RWPos[0:3]\n return RWPos\n\n\ndef rot... | [
[
"numpy.array",
"numpy.sin",
"numpy.cos"
]
] |
ngi-nix/vframe | [
"60469e25203136f9d6a5ecaabe2423695ee9a0f2"
] | [
"vframe_cli/commands/train/create-yolo-pytorch.py"
] | [
"#############################################################################\n#\n# VFRAME\n# MIT License\n# Copyright (c) 2019 Adam Harvey and VFRAME\n# https://vframe.io\n#\n#############################################################################\n\n\nimport click\n\n@click.command()\n@click.option('-i', '-... | [
[
"pandas.read_csv"
]
] |
nyiritb/tensorflow | [
"61a985bb48e4d38d05966132a347afe6f8a9a353"
] | [
"tensorflow/python/keras/engine/base_layer_test.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.variables.Variable",
"tensorflow.python.ops.array_ops.identity",
"numpy.dot",
"tensorflow.python.keras.backend.learning_phase",
"tensorflow.python.keras.backend.get_graph",
"tensorflow.python.keras.engine.sequential.Sequential",
"tensorflow.python.ops.state_ops.a... |
pranav270-create/pybullet-panda | [
"bf53fb685d8568beb7dd17ec62ea73ecb180f0b5"
] | [
"Archive/train_grasp_minimal.py"
] | [
"import os\nimport random\nimport math\nimport numpy as np\nfrom numpy import array\nimport matplotlib.pyplot as plt\nimport torch\nimport pybullet as p\nfrom PIL import Image\nimport concurrent.futures\nimport psutil\n\nfrom model.fcn import MLP\nfrom utils.depth import getParameters\nfrom utils.misc import save__... | [
[
"torch.cat",
"numpy.load",
"numpy.min",
"torch.nn.BCEWithLogitsLoss",
"torch.load",
"numpy.max",
"numpy.concatenate",
"torch.sigmoid",
"numpy.empty",
"matplotlib.pyplot.get_cmap",
"numpy.arange",
"numpy.argmax",
"numpy.append",
"torch.empty",
"torch.set_... |
hectormz/napari | [
"c53051ed3e3693ae74c86a5c4611f057293bd21d"
] | [
"napari/_qt/qt_dims_slider.py"
] | [
"from typing import Optional, Tuple\n\nimport numpy as np\nfrom qtpy.QtCore import QObject, Qt, QTimer, Signal, Slot\nfrom qtpy.QtGui import QIntValidator\nfrom qtpy.QtWidgets import (\n QApplication,\n QCheckBox,\n QComboBox,\n QDoubleSpinBox,\n QFormLayout,\n QHBoxLayout,\n QLabel,\n QLine... | [
[
"numpy.floor"
]
] |
liyuan9988/IVOPEwithACME | [
"d77fab09b2e1cb8d3dbd8b2ab88adcce6a853558"
] | [
"src/ope/kiv_batch/learner.py"
] | [
"# Lint as: python3\n# pylint: disable=bad-indentation,line-too-long\n\"\"\"DFIV Learner implementation.\"\"\"\n\nfrom typing import Dict, List\n\nimport acme\nfrom acme.tf import savers as tf2_savers\nfrom acme.tf import utils as tf2_utils\nfrom acme.utils import counting\nfrom acme.utils import loggers\nimport nu... | [
[
"tensorflow.zeros",
"tensorflow.shape",
"tensorflow.eye",
"tensorflow.expand_dims",
"tensorflow.matmul",
"tensorflow.Variable",
"tensorflow.linalg.solve",
"tensorflow.reduce_mean"
]
] |
ManuelALH/ProyectoTeoriaComputacionDFA | [
"f989c71934f2d31f25c31f60ed1aab9e8e0a971a"
] | [
"visual_automata/colors.py"
] | [
"from colormath.color_conversions import convert_color\nfrom colormath.color_objects import sRGBColor\nfrom typing import Generator\nimport numpy as np\n\n\ndef create_palette(\n start_rgb: sRGBColor, end_rgb: sRGBColor, n: int, colorspace: sRGBColor\n) -> list:\n \"\"\"\n Generates color palette based on ... | [
[
"numpy.linspace"
]
] |
Baukmeister/rtex | [
"0ac06e5d9a467d915cde97a0919f168a176abe21"
] | [
"load_manual_eval_tags.py"
] | [
"\"\"\"\nThis script loads the corresponding to repot text for certain patient IDs\n\"\"\"\nimport json\nimport os\nimport pydicom\nfrom PIL import Image\nimport pandas as pd\n\nDATA_DIR = \"./data/tags\"\nOUTPUT_DIR = \"./manual_classification\"\n\ngroups = pd.read_csv(f\"{DATA_DIR}/groups.csv\", sep=\";\")\ntags ... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
Grantzho/Labs | [
"935707defeef61a856a248eddabbd0dcc87c51c1"
] | [
"app/data.py"
] | [
"\"\"\"\nBloomTech Labs DS Data Engineer Role\n- Database Interface\n- Visualization Interface\n\"\"\"\nimport os\nimport re\nimport string\nfrom random import randint\nfrom typing import Iterable, Dict, List\n\nimport pandas as pd\nimport psycopg2\nimport plotly.express as px\nimport plotly.graph_objects as go\nfr... | [
[
"pandas.crosstab"
]
] |
9Strike/ap_praktikum | [
"2771f995372c1d075d0a5fcaaeb4c4214a0dfd8c"
] | [
"datstat.py"
] | [
"import numpy as np\nfrom numpy import sqrt\n\ndef mv(x):\n s = 0.0\n for i in range(len(x)):\n s += x[i]\n return s / len(x)\n\ndef dsto(x):\n s = 0.0\n for i in range(len(x)):\n s += (x[i] - mv(x))**2\n return sqrt(s / (len(x) - 1))\n\ndef dsto_mv(x):\n return dsto(x) / sqrt(len(x))\n\ndef dsys_mv(x)... | [
[
"numpy.sum",
"numpy.zeros_like",
"numpy.abs",
"numpy.sqrt"
]
] |
jrderek/some-projects | [
"ad46083d451763a4201d4b4057086cf29dd8bf13"
] | [
"Data-Science-Projects-master/KaggleAmazon/predict_keras.py"
] | [
"import train_keras\nfrom keras.models import load_model\nimport os\nimport numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\nfrom keras.callbacks import ModelCheckpoint\nimport sys\n\nTF_CPP_MIN_LOG_LEVEL=2\nTEST_BATCH = 128\n\ndef load_params():\n X_test = os.listdir('./test-jpg')\n X_test = [fn.repl... | [
[
"numpy.concatenate",
"pandas.DataFrame.from_dict",
"numpy.save"
]
] |
jinglebot/CarND-Capstone | [
"cf81f270eedda9e9b2f09d01cd23f74e6069b2d3"
] | [
"ros/src/tl_detector/light_classification/tl_classifier.py"
] | [
"import numpy as np\nimport os\nimport tensorflow as tf\n\nfrom styx_msgs.msg import TrafficLight\n\nFROZEN_SIM_INFERENCE_GRAPH = os.getcwd() + \"/sim_traffic_light_graph.pb\"\nFROZEN_SITE_INFERENCE_GRAPH = os.getcwd() + \"/site_traffic_light_graph.pb\"\nSCORE_THRESHOLD = 0.5\nMAX_BOXES = 3\n\nclass TLClassifier(ob... | [
[
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.GraphDef",
"tensorflow.import_graph_def",
"tensorflow.gfile.GFile",
"numpy.squeeze",
"numpy.expand_dims"
]
] |
yangrq1018/akshare | [
"fed5922110727edf2f14bcc68d2045bcf67ebb5a"
] | [
"akshare/stock_feature/stock_em_jgdy.py"
] | [
"# -*- coding:utf-8 -*-\n# /usr/bin/env python\n\"\"\"\nAuthor: Albert King\ndate: 2019/12/27 18:02\ncontact: jindaxiang@163.com\ndesc: 东方财富网-数据中心-特色数据-机构调研\n东方财富网-数据中心-特色数据-机构调研-机构调研统计: http://data.eastmoney.com/jgdy/tj.html\n东方财富网-数据中心-特色数据-机构调研-机构调研详细: http://data.eastmoney.com/jgdy/xx.html\n\"\"\"\nimport json\... | [
[
"pandas.DataFrame"
]
] |
lonelyhentai/workspace | [
"2a996af58d6b9be5d608ed040267398bcf72403b",
"2a996af58d6b9be5d608ed040267398bcf72403b"
] | [
"data_ai/comp3009/src/lab3/utils.py",
"data_ai/comp3006/src/test.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom typing import Dict, Any, Union, Iterable\nfrom numpy import ndarray\nimport math\nimport copy\n\n\ndef one_hot_encoder(labels: pd.Series) -> Dict[Any, ndarray]:\n ret = {}\n uniques = labels.unique()\n unique_num = len(uniques)\n for index, label in enumera... | [
[
"numpy.zeros"
],
[
"numpy.sum",
"pandas.Series",
"pandas.DataFrame"
]
] |
Kindpire/inflated_convnets_pytorch | [
"8efe7748ad3b0df3de4cc1d18211988d5af442a3"
] | [
"src/inflate.py"
] | [
"import torch\n\ndef inflate_conv(conv2d,\n time_dim=3,\n time_padding=0,\n time_stride=1,\n time_dilation=1,\n center=False):\n # To preserve activations, padding should be by continuity and not zero\n # or no padding in time dim... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.BatchNorm3d",
"torch.nn.MaxPool3d",
"torch.nn.Conv3d",
"torch.nn.AvgPool3d",
"torch.Tensor"
]
] |
martinbomio/tfx-bsl | [
"14b46fad556527009497f0de0161400ed7e234df"
] | [
"tfx_bsl/tfxio/telemetry.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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.bincount",
"numpy.add",
"numpy.random.rand",
"numpy.zeros",
"numpy.arange"
]
] |
andykoswara/adme_tox | [
"6ff1de3a85e415c7a8f1ab981dc64c468be23957"
] | [
"rdkit_ecfp_main.py"
] | [
"from adme_utils import *\n\nfrom rdkit import DataStructs, Chem\nfrom rdkit.Chem import AllChem, Descriptors\n\nfrom sklearn.preprocessing import MinMaxScaler, StandardScaler, RobustScaler\n\n## generate morgan fingerprint/ecfp\ndef genFP(mol, rad, nBits):\n \"\"\"\n\t\tcompute extended circular fingerprint\n ... | [
[
"sklearn.preprocessing.MinMaxScaler"
]
] |
derekvantilborg/molml_tools | [
"5a5baaa21a4b3b91e59c1a350d04db3fd5102e4e"
] | [
"molml/Viz/multivariate.py"
] | [
"from typing import List, Callable, Any\nfrom molml.Datastructures.molecule import Molecule\nfrom sklearn.manifold import TSNE as sklearn_tsne\nfrom sklearn.decomposition import PCA as sklearn_PCA\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n\nclass TSNE:\n ... | [
[
"pandas.DataFrame",
"sklearn.manifold.TSNE",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"sklearn.decomposition.PCA"
]
] |
draustin/otk | [
"c6e91423ec79b85b380ee9385f6d27c91f92503d"
] | [
"otk/rt1/_interfaces.py"
] | [
"from typing import Dict, Sequence, Tuple\nfrom enum import Enum\nimport numpy as np\nimport otk.functions\nimport scipy.interpolate\nfrom otk.functions import make_perpendicular\n\nfrom .. import v4hb\nfrom .. import functions\nfrom .. import ri\n\nclass Directions(Enum):\n REFLECTED = 0\n TRANSMITTED = 1\n\... | [
[
"numpy.arccos",
"numpy.asarray",
"numpy.broadcast",
"numpy.choose",
"numpy.atleast_1d",
"numpy.all"
]
] |
Darylgolden/manim | [
"9d42bdf9274572726334e91d54310cf4d0876630"
] | [
"manim/renderer/cairo_renderer.py"
] | [
"import time\nimport typing\n\nimport numpy as np\n\nfrom manim.utils.hashing import get_hash_from_play_call\n\nfrom .. import config, logger\nfrom ..camera.camera import Camera\nfrom ..mobject.mobject import Mobject\nfrom ..scene.scene_file_writer import SceneFileWriter\nfrom ..utils.exceptions import EndSceneEarl... | [
[
"numpy.array"
]
] |
transcendentsky/detection_models | [
"185f4bcccd5ab2c2f8edac37c76a9ccc47f73883",
"185f4bcccd5ab2c2f8edac37c76a9ccc47f73883"
] | [
"ssd.pytorch/layers/box_utils.py",
"ssd.pytorch/train.py"
] | [
"# -*- coding: utf-8 -*-\nimport torch\n\n\ndef point_form(boxes):\n \"\"\" Convert prior_boxes to (xmin, ymin, xmax, ymax)\n representation for comparison to point form ground truth data.\n Args:\n boxes: (tensor) center-size default boxes from priorbox layers.\n Return:\n boxes: (tensor)... | [
[
"torch.cat",
"torch.mul",
"torch.clamp",
"torch.index_select",
"torch.log",
"torch.exp"
],
[
"torch.zeros",
"torch.autograd.Variable",
"torch.set_default_tensor_type",
"torch.nn.init.xavier_uniform_",
"torch.ones",
"torch.cuda.is_available",
"numpy.random.ra... |
marcelo-santos-12/tcc | [
"a5dd5c4c4b923fbd3753b8e4749f5815da2305dd"
] | [
"lbp_module/texture.py"
] | [
"\"\"\"\nMethods to characterize image textures.\n\"\"\"\n\nimport numpy as np\nimport warnings\nfrom .utils._texture import _local_binary_pattern\nfrom .utils._texture_ilbp import _improved_local_binary_pattern\nfrom .utils._texture_hlbp import _hamming_local_binary_pattern\nfrom .utils._texture_elbp import _exten... | [
[
"numpy.ascontiguousarray",
"numpy.histogram",
"numpy.asarray",
"numpy.asanyarray"
]
] |
morris-frank/scvi-tools | [
"b828c75455bdd9e9558882d0b110ed97ba135184"
] | [
"scvi/model/_condscvi.py"
] | [
"import logging\nimport warnings\nfrom typing import Optional, Union\n\nimport numpy as np\nimport torch\nfrom anndata import AnnData\n\nfrom scvi import _CONSTANTS\nfrom scvi.model.base import (\n BaseModelClass,\n RNASeqMixin,\n UnsupervisedTrainingMixin,\n VAEMixin,\n)\nfrom scvi.module import VAEC\n... | [
[
"torch.cat",
"numpy.zeros",
"numpy.sum",
"torch.no_grad",
"numpy.where"
]
] |
nateandre/machine_learning | [
"5c6535a18b46feaa5ffc38670e6404869836d2b1"
] | [
"pointer-gen_implementations/code/pointer_gen_multitask.py"
] | [
"\"\"\" Multitask Pointer-generation model implementation\n\nAuthor: Nathaniel Andre\n\"\"\"\n\nfrom tensorflow.keras import backend as K\nfrom tensorflow.keras.layers import Dense,Bidirectional,LSTM,Input,RepeatVector,Activation,Softmax,Embedding,Dot,Lambda\nfrom tensorflow.keras.layers import Softmax,Concatenate,... | [
[
"tensorflow.keras.layers.RepeatVector",
"tensorflow.keras.layers.Activation",
"numpy.load",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.zeros_like",
"tensorflow.keras.layers.LSTM",
"tensorflow.keras.layers.Dot",
"tensorflow.gather",
"sklear... |
cswin/CADA | [
"5e07ad339f0f1e523db87e452f65cb0f9bd05aa7"
] | [
"data_preprocess/mnet_utils.py"
] | [
"#The code is modified from https://github.com/HzFu/MNet_DeepCDR\n# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function\n\nimport os\n\nimport numpy as np\nfrom PIL import Image\nfrom scipy.ndimage import binary_fill_holes\nfrom skimage.measure import label, regionprops\nfrom tensorflow.python.keras impo... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.reshape",
"tensorflow.python.keras.backend.flatten",
"tensorflow.python.keras.backend.sum",
"numpy.argmax"
]
] |
blakeaw/ORBILT | [
"ed402dd496534dccd00f3e75b57007d944c58c1d"
] | [
"pybilt/common/running_stats.py"
] | [
"\"\"\"Running stats module.\n\nThis module defines the RunningStats and BlockAverager classes, as well as the\ngen_running_average function.\n\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom builtins import object\nfrom six.moves impor... | [
[
"numpy.histogram",
"numpy.array",
"numpy.zeros",
"numpy.stack",
"numpy.sqrt",
"numpy.abs",
"numpy.linspace",
"scipy.stats.t.cdf"
]
] |
agartland/tcrdist3 | [
"34f8d50e7448b2bf7cf7cd9ab9a2d80759f47240"
] | [
"tcrdist/tests/longtest_simulate_cdr3_w_olga.py"
] | [
"import olga.load_model as load_model\nimport olga.generation_probability as pgen\nimport olga.sequence_generation as seq_gen\nimport pandas as pd\n\n\ndef generate_simulated_beta_seqs(params_file_name = 'tcrdist/default_models/human_T_beta/model_params.txt',\n marginals_file_name = 'tcrd... | [
[
"pandas.DataFrame"
]
] |
Dany-L/Reinforcement-learning | [
"ca1626e5910e325df6b9fdfd3e403dde93a4a1ee"
] | [
"randomwalk.py"
] | [
"import gym\nimport numpy as np\nimport gym_random_walk\n\nenv = gym.make('random_walk-v0')\n\nV = [0, 0.5, 0.5,0.5,0.5,0.5,0]\nV_MC = [0, 0.5, 0.5, 0.5, 0.5, 0.5, 0]\nalpha = 0.1\ngamma = 1\n\nnum2 = 100\n\nfor episodes in range(num2):\n\n env.reset()\n env.render()\n s=3\n total_reward = 0\n done =... | [
[
"numpy.random.randint"
]
] |
akineeic/models | [
"11ea5237818e791a5717716d5413977f4c4db1e3",
"11ea5237818e791a5717716d5413977f4c4db1e3"
] | [
"official/vision/beta/modeling/backbones/mobilenet_test.py",
"official/nlp/transformer/model_utils_test.py"
] | [
"# Lint as: python3\n# Copyright 2020 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... | [
[
"tensorflow.keras.layers.InputSpec",
"tensorflow.keras.Input",
"tensorflow.keras.backend.set_image_data_format",
"tensorflow.test.main"
],
[
"tensorflow.constant",
"tensorflow.shape",
"tensorflow.test.main",
"tensorflow.reshape"
]
] |
X-Libor/qiskit-optimization | [
"f2a92538d883ebc0f78c156ab6f31710e9b1d14f"
] | [
"test/algorithms/test_grover_optimizer.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2020, 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... | [
[
"numpy.testing.assert_array_almost_equal"
]
] |
klw11j/Sexual-Assualt-Analysis | [
"bdba47d08d45b26f59832c926fe2ac4baa9e5f02"
] | [
"app.py"
] | [
"from flask import Flask, Response, render_template, jsonify,redirect, url_for, send_from_directory\nimport pandas as pd \nfrom sqlalchemy import create_engine\nfrom sqlalchemy import BigInteger, Column, JSON, Text\nfrom config import cxnstring\nfrom flask_cors import CORS\nimport psycopg2\nimport sys\nimport reque... | [
[
"pandas.read_sql"
]
] |
watsoncm/PruneSeg | [
"07c0a209495f88ce596aabf4b5273260aae08c6f"
] | [
"train.py"
] | [
"\"\"\"\nTrains, evaluates and saves the KittiSeg model.\n\n-------------------------------------------------\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 Marvin Teichmann\n\nMore details: https://github.com/MarvinTeichmann/KittiSeg/blob/master/LICENSE\n\"\"\"\nfrom __future__ import absolute_import\nfrom __futur... | [
[
"tensorflow.app.run",
"tensorflow.app.flags.DEFINE_boolean"
]
] |
philippbeer/m4_clustering | [
"18cf1b9111f4236f0be152d2419c470840645acb"
] | [
"feature_extraction.py"
] | [
"\"\"\"\nThis module enables the feature extraction\n\"\"\"\nimport math\nfrom multiprocessing import Pool\nimport os\nfrom typing import Union\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn import preprocessing\nfrom tqdm import tqdm\nfrom tsfresh.feature_extraction import extract_features, EfficientFCPa... | [
[
"pandas.set_option",
"sklearn.preprocessing.StandardScaler"
]
] |
sgsmob/covidcast-indicators | [
"424ef5fd5361c4ed7b3ed88cf31813349d35240e"
] | [
"google_health/tests/test_run.py"
] | [
"\"\"\"Tests for running google_health.\"\"\"\n\nfrom os.path import join, exists\n\nimport pandas as pd\nfrom pandas.testing import assert_frame_equal\nfrom delphi_utils import read_params\nfrom delphi_google_health.run import run_module\n\nclass TestRunModule:\n \"\"\"Tests for run_module().\"\"\"\n PARAMS ... | [
[
"pandas.testing.assert_frame_equal"
]
] |
zwxu064/RANP | [
"92135583e0ced21fa5634823b289c5aea366de21",
"92135583e0ced21fa5634823b289c5aea366de21"
] | [
"pruning/pytorch_snip/prune_utils.py",
"third_party/thop/my_test.py"
] | [
"import torch\nimport copy\n\n\ndef convert_dim_conv2fully(grads):\n grads = copy.deepcopy(grads) # grads is a reference, changing its size in function will change it externally\n\n n_layers = len(grads) // 2\n\n for idx in range(n_layers - 1):\n weight_idx = 2 * idx\n next_weight_idx = 2 * (idx + 1)\n ... | [
[
"torch.equal"
],
[
"torch.nn.Linear",
"torch.cuda.manual_seed",
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.manual_seed",
"torch.nn.Conv2d",
"torch.randn"
]
] |
gdmcbain/scipy | [
"846e9cd501bba8c5b23f218f37c88ce962c38bef",
"846e9cd501bba8c5b23f218f37c88ce962c38bef",
"846e9cd501bba8c5b23f218f37c88ce962c38bef"
] | [
"scipy/linalg/_expm_frechet.py",
"scipy/optimize/_differentialevolution.py",
"doc/source/tutorial/examples/normdiscr_plot2.py"
] | [
"\"\"\"Frechet derivative of the matrix exponential.\"\"\"\nimport numpy as np\nimport scipy.linalg\n\n__all__ = ['expm_frechet', 'expm_cond']\n\n\ndef expm_frechet(A, E, method=None, compute_expm=True, check_finite=True):\n \"\"\"\n Frechet derivative of the matrix exponential of A in the direction E.\n\n ... | [
[
"numpy.zeros_like",
"numpy.dot",
"numpy.asarray",
"numpy.identity",
"numpy.asarray_chkfinite",
"numpy.outer",
"numpy.hstack",
"numpy.log2",
"numpy.vstack"
],
[
"numpy.argmin",
"numpy.copy",
"scipy.stats.qmc.LatinHypercube",
"numpy.mean",
"numpy.finfo",
... |
aldanor/blox | [
"429d9c1066e32d8cb119c2d4532ec161c003d5e0"
] | [
"blox/blosc.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nimport six\nimport blosc\nimport numpy as np\n\nfrom blox.utils import read_json, write_json, flatten_dtype, restore_dtype\n\n\ndef write_blosc(stream, data, compression='lz4', level=5, shuffle=True):\n if isinstance(compression, six.string_ty... | [
[
"numpy.empty",
"numpy.asanyarray",
"numpy.dtype"
]
] |
lkwagner/pyqmc | [
"72999e8dfdba11e50219e45d5c8b19a879a38370"
] | [
"pyqmc/mc.py"
] | [
"# This must be done BEFORE importing numpy or anything else.\n# Therefore it must be in your main script.\nimport os\n\nos.environ[\"MKL_NUM_THREADS\"] = \"1\"\nos.environ[\"NUMEXPR_NUM_THREADS\"] = \"1\"\nos.environ[\"OMP_NUM_THREADS\"] = \"1\"\nimport numpy as np\nimport h5py\n\n\ndef initial_guess(mol, nconfig,... | [
[
"numpy.linalg.norm",
"numpy.random.rand",
"numpy.asarray",
"numpy.sum",
"numpy.random.randn",
"numpy.exp",
"numpy.mean",
"numpy.sqrt",
"numpy.cumsum",
"numpy.floor"
]
] |
jplummer01/azureml-examples | [
"6a073d157f21060312941f71cfbcf25d0c541183"
] | [
"sdk/jobs/automl-standalone-jobs/automl-image-instance-segmentation-task-fridge-items/jsonl_converter.py"
] | [
"import argparse\nimport os\nimport json\nimport numpy as np\nimport PIL.Image as Image\nimport xml.etree.ElementTree as ET\n\nfrom simplification.cutil import simplify_coords\nfrom skimage import measure\n\n\ndef convert_mask_to_polygon(\n mask,\n max_polygon_points=100,\n score_threshold=0.5,\n max_re... | [
[
"numpy.array",
"numpy.ceil",
"numpy.zeros",
"numpy.unique"
]
] |
JingZhang918/master_thesis | [
"f0d3b874a5ac1c55db028f87a7442a18f2d418eb"
] | [
"DRL_Automated_Trading/visualization.py"
] | [
"import numpy as np\nimport pandas as pd\nimport yfinance as yf\nfrom data_process import get_revised_yearly_return, get_revised_monthly_return\nimport plotly.graph_objects as go\nimport config\n\ndef get_returns(prices):\n return prices[-1]/prices[0]-1\n\ndef plot_yearly_diff_comparison(df_drl, df_etf, save_pat... | [
[
"numpy.where",
"numpy.arange"
]
] |
zengrz/cgan-isola-2017 | [
"3f1e45a4ecc26773927b1b8d37f204f2954e8c4e"
] | [
"src/CustomDataFlow.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# File: bsds500.py\n\nimport os\nimport glob\nimport numpy as np\nimport cv2\nfrom random import randint\nfrom functools import reduce\n\nfrom tensorpack.utils.fs import download, get_dataset_path\nfrom tensorpack.dataflow.base import RNGDataFlow\n\nIMG_W, IMG_H = 51... | [
[
"numpy.arange",
"numpy.reshape",
"numpy.fromfile"
]
] |
lcskrishna/my-pytorch-experiments | [
"b846760bbf8dfa930fa914edcee8f1a71a43fc98"
] | [
"tensor-numpy-comparision/pytorch_tensor_test.py"
] | [
"import torch\nimport time\n\ndtype = torch.float\ndevice = torch.device(\"cpu\")\n\nN, D_in, H, D_out = 64, 1000, 100, 10\n\nx = torch.randn(N, D_in, device= device, dtype=dtype)\ny = torch.randn(N, D_out, device=device, dtype=dtype)\n\nw1 = torch.randn(D_in, H, device=device, dtype = dtype)\nw2 = torch.randn(H, D... | [
[
"torch.device",
"torch.randn"
]
] |
weihaosky/CycleSiam | [
"9d11f6cb236a6699185774e49ebafe8d2f867ebe"
] | [
"models/siammask_sharp.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom utils.anchors import Anchors\n\n\nclass SiamMask(nn.Module):\n def __init__(self, anchors=None, o_sz=127, g_sz=127):\n super(SiamMask, self).__init__()\n self.anchors = anchors # anchor... | [
[
"torch.nn.functional.nll_loss",
"torch.nn.functional.unfold",
"torch.nn.UpsamplingBilinear2d",
"torch.transpose",
"torch.nn.functional.log_softmax",
"torch.from_numpy",
"torch.mean",
"torch.nn.functional.soft_margin_loss",
"torch.index_select",
"torch.randn",
"torch.sum... |
wilsonify/tensorflow-examples | [
"2271c666b33c7a74047c7196783ab04e9aee8362"
] | [
"src/tensorflow-examples/tensorflow_examples/converted_notebooks/14_deep_computer_vision_with_cnns.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# **Chapter 14 – Deep Computer Vision Using Convolutional Neural Networks**\n\n# _This notebook contains all the sample code in chapter 14._\n\n# <table align=\"left\">\n# <td>\n# <a target=\"_blank\" href=\"https://colab.research.google.com/github/ageron/handson-ml2... | [
[
"tensorflow.image.resize_with_crop_or_pad",
"tensorflow.keras.optimizers.SGD",
"tensorflow.reduce_min",
"tensorflow.nn.conv2d",
"tensorflow.image.random_flip_left_right",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.GlobalAvgPool2D",
"tensorflow.keras.models.Model... |
Priesemann-Group/historydependence | [
"e1adc5eea8cb05cc686bfda0b979244b34d63bb4",
"e1adc5eea8cb05cc686bfda0b979244b34d63bb4"
] | [
"plots/supplementaries/S13Fig_measures_vs_rate.py",
"plots/supplementaries/S6Fig.py"
] | [
"\"\"\"Functions\"\"\"\nimport os\nimport sys\nfrom sys import exit, stderr, argv, path, modules\nfrom os.path import isfile, isdir, realpath, dirname, exists\nimport numpy as np\nimport pandas as pd\n# plotting\nimport matplotlib\nimport seaborn.apionly as sns\nfrom matplotlib import rc\nimport matplotlib.lines as... | [
[
"numpy.median",
"matplotlib.ticker.ScalarFormatter",
"numpy.log2",
"matplotlib.rc"
],
[
"numpy.array",
"numpy.zeros",
"matplotlib.rc",
"numpy.amax",
"numpy.append",
"matplotlib.ticker.ScalarFormatter",
"numpy.log10"
]
] |
Screams233/MachineLearning_Python | [
"fc954f68d8b2d89ed4463308873ebce0d22ddaa2"
] | [
"NeuralNetwok/NeuralNetwork.py"
] | [
"#-*- coding: utf-8 -*-\nimport numpy as np\nfrom scipy import io as spio\nfrom matplotlib import pyplot as plt\nfrom scipy import optimize\nfrom matplotlib.font_manager import FontProperties\nfont = FontProperties(fname=r\"c:\\windows\\fonts\\simsun.ttc\", size=14) # 解决windows环境下画图汉字乱码问题\n\nfrom sklearn import ... | [
[
"numpy.random.rand",
"numpy.exp",
"numpy.max",
"matplotlib.font_manager.FontProperties",
"numpy.sin",
"scipy.optimize.fmin_cg",
"numpy.arange",
"numpy.transpose",
"numpy.sqrt",
"numpy.random.randint",
"numpy.int32",
"numpy.vstack",
"matplotlib.pyplot.axis",
... |
johnmlee101/manim | [
"7ec60462e01ce07811580480302721fcf259cb87"
] | [
"constants.py"
] | [
"import os\nimport numpy as np\nimport colour\nimport argparse\nimport sys\n\nSCRIPT_DIR = \"\"\nMEDIA_DIR = \"\"\nANIMATIONS_DIR = \"\"\nRASTER_IMAGE_DIR = \"\"\nSVG_IMAGE_DIR = \"\"\nSTAGED_SCENES_DIR = \"\"\nFILE_DIR = \"\"\nTEX_DIR = \"\"\nSAVE_DIR = \"\"\nTEX_IMAGE_DIR = \"\"\nMOBJECT_DIR = \"\"\nIMAGE_MOBJECT... | [
[
"numpy.array"
]
] |
efrain2010/matchms | [
"80678fdc7325813a1e3bd3ad7e2a60cb7482026a",
"69cedeed5597966619a97c4e4211deaf8610d727"
] | [
"tests/test_add_parent_mass.py",
"tests/test_ParentmassMatch.py"
] | [
"import numpy\nfrom matchms import Spectrum\nfrom matchms.filtering import add_parent_mass\n\n\ndef test_add_parent_mass():\n \"\"\"Test if parent mass is correctly derived.\"\"\"\n mz = numpy.array([], dtype='float')\n intensities = numpy.array([], dtype='float')\n metadata = {\"pepmass\": (444.0, 10),... | [
[
"numpy.array"
],
[
"numpy.array"
]
] |
MichaelMarien/jax | [
"bf3c658114703e955f0b06642c53c6b64c5b2df3"
] | [
"jax/experimental/maps.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.array",
"numpy.empty",
"numpy.asarray",
"numpy.zeros",
"numpy.issubdtype",
"numpy.dtype"
]
] |
tanishq1g/Pytorch_codes | [
"45ac44d70b021556d0c451a1553c4aaabd1a5410"
] | [
"ZeroToAll/08_dataset_loader.py"
] | [
"# one epoch : one forward pass or one backward pass for all training examples\n# batch size : the number of training examples on one forward/backward pass. the higher the batch size, the more memory space you will need\n# number of iterations : number of passes, each pass using[batch size] number of examples\n# on... | [
[
"torch.autograd.Variable",
"numpy.loadtxt",
"torch.utils.data.DataLoader",
"torch.from_numpy"
]
] |
Mrxuelovecode/Deep-Multi-Sphere-SVDD | [
"60a52659db8c9de971ca373562a3417731da7975"
] | [
"src/baseline_kde.py"
] | [
"'''\n This is a revision to \"Deep One-Class Classification\" implementation by\n Lukas Ruff (https://github.com/lukasruff/Deep-SVDD)\n Summary of the changes:\n 1. Mobifall dataset is added\n 2. Normal and anomaly classes can be given as input label vectors\n'''\n\nimport argparse\nimport os\nimport numpy... | [
[
"numpy.float32"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.