repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
grhsxy21/Insect_Identification
[ "3b9ffe3ba91c2271bd663c327e384a6679c67bc8" ]
[ "P_rect.py" ]
[ "# coding=utf-8\n# 先读图,然后二值化,\n# 矩形度\n\nimport cv2\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n# 此处读入图片,作为接口\norigin = cv2.imread('D:/GitHub/ZRB/Insect_Identification/picture/butterfly.png') #TODO改为绝对路径\ngrayimage = cv2.imread('D:/GitHub/ZRB/Insect_Identification/picture/butterfly.png', 0)\n\n#...
[ [ "numpy.int0" ] ]
steffen-schroeder-by/kartothek
[ "1821ea5df60d4079d3911b3c2f17be11d8780e22" ]
[ "kartothek/io/eager.py" ]
[ "import warnings\nfrom functools import partial\nfrom typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union, cast\n\nimport deprecation\nimport pandas as pd\nfrom simplekv import KeyValueStore\n\nfrom kartothek.core.common_metadata import (\n empty_dataframe_from_schema,\n make_meta,\n ...
[ [ "pandas.concat" ] ]
ChristianSchorr/InertialFlowCutter
[ "baac26aa394e6bb58ed43d122b820dd963cfb303" ]
[ "evaluation/parameterstudy.py" ]
[ "import configurable_inertialflowcutter_order as ifc\nimport pandas as pd\nimport numpy as np\nimport re\nimport subprocess\nimport os\n\nexperiments_folder = \"\"\ngraph = \"col\" #TODO replace again with europe\ngraph_path = experiments_folder + graph + \"/\"\nmetric_path = graph_path + \"travel_time\"\nque...
[ [ "numpy.array", "pandas.read_csv", "pandas.DataFrame" ] ]
JedersonLuz/Codenation_AceleraDev_DataScience
[ "a23137ba7f1349bdc544647ef680ea6f822f797b" ]
[ "module_3/df_test.py" ]
[ "import pandas as pd\r\nimport altair as alt\r\nimport streamlit as st\r\n\r\n@st.cache\r\ndef get_UN_data():\r\n AWS_BUCKET_URL = \"https://streamlit-demo-data.s3-us-west-2.amazonaws.com\"\r\n df = pd.read_csv(AWS_BUCKET_URL + \"/agri.csv.gz\")\r\n return df.set_index(\"Region\")\r\n\r\ntry:\r\n df = g...
[ [ "pandas.melt", "pandas.read_csv" ] ]
kishiyamat/npbdaa
[ "c13a97b32635e00b192b7075fdc09875710c5029", "c13a97b32635e00b192b7075fdc09875710c5029" ]
[ "sample/simple_pyhlm_sample.py", "sample/summary_and_plot_light.py" ]
[ "import time\nimport warnings\nfrom pathlib import Path\n\nimport numpy as np\nimport pyhsmm\nfrom tqdm import trange\nfrom util.config_parser import ConfigParser_with_eval\n\nfrom pyhlm.model import WeakLimitHDPHLM\nfrom pyhlm.word_model import LetterHSMM\n\nwarnings.filterwarnings('ignore')\n\n\n# import pyximpor...
[ [ "numpy.loadtxt", "numpy.savetxt", "numpy.savez", "numpy.cumsum" ], [ "numpy.concatenate", "numpy.savetxt", "numpy.zeros", "matplotlib.pyplot.savefig", "numpy.sum", "matplotlib.pyplot.title", "numpy.loadtxt", "numpy.argmax", "sklearn.metrics.adjusted_rand_sco...
fearaschiarrai/gxpy
[ "4c5e7594b24e530a8cd94df1eef562c5c6ce3e92", "4c5e7594b24e530a8cd94df1eef562c5c6ce3e92" ]
[ "geosoft/gxpy/tests/test_group.py", "geosoft/gxapi/GXVA.py" ]
[ "import unittest\nimport os\nimport numpy as np\n\nimport geosoft\nimport geosoft.gxapi as gxapi\nimport geosoft.gxpy.system as gsys\nimport geosoft.gxpy.map as gxmap\nimport geosoft.gxpy.geometry as gxgm\nimport geosoft.gxpy.grid as gxgrd\nimport geosoft.gxpy.agg as gxagg\nimport geosoft.gxpy.system as gxsys\nimpo...
[ [ "numpy.array", "numpy.isnan", "numpy.nanmin", "numpy.nanmean", "numpy.nanmax", "numpy.nanstd" ], [ "numpy.ascontiguousarray" ] ]
konstin/jax
[ "f7df3ee9c4221a202959e67816d485c35eb98102", "c3581a221842c09dc1b2f301012c3a01734f6b43" ]
[ "tests/filecheck/math.filecheck.py", "jax/experimental/sparse/bcoo.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.uint8", "numpy.uint32", "numpy.empty", "numpy.float16", "numpy.uint16", "numpy.complex128", "numpy.int64", "numpy.float64", "numpy.complex64", "numpy.float32", "numpy.bool_", "numpy.int32" ], [ "numpy.array", "numpy.zeros", "numpy.prod", "...
shikiponn/optuna
[ "a151fafc4d816d9ba7d6740adf8892a7832f83a9" ]
[ "optuna/storages/base.py" ]
[ "import abc\nimport numpy as np\nimport six\nfrom typing import Any # NOQA\nfrom typing import Dict # NOQA\nfrom typing import List # NOQA\nfrom typing import Optional # NOQA\nfrom typing import Tuple # NOQA\n\nfrom optuna import distributions # NOQA\nfrom optuna import structs # NOQA\n\nDEFAULT_STUDY_NAME_P...
[ [ "numpy.array" ] ]
bklppr/yolo2_onnx
[ "fcb85bd94e22c1c47f20fc13bb6ae3ac1ccd10f4" ]
[ "dataset.py" ]
[ "#!/usr/bin/python\n# encoding: utf-8\n\nimport os\nimport random\nimport torch\nimport numpy as np\nfrom torch.utils.data import Dataset\nfrom PIL import Image\nfrom utils import read_truths_args, read_truths\nfrom image import *\n\nclass listDataset(Dataset):\n\n def __init__(self, root, shape=None, shuffle=Tr...
[ [ "torch.zeros", "torch.from_numpy" ] ]
ZitongLu1996/NeuroRA
[ "4e72f5b37ff308a4a068107b35f7555df6b7df0d" ]
[ "neurora/rsa_plot.py" ]
[ "# -*- coding: utf-8 -*-\n\n' a module for plotting the NeuroRA results '\n\n__author__ = 'Zitong Lu'\n\nimport numpy as np\nimport copy\nimport matplotlib.pyplot as plt\nfrom scipy.interpolate import interp1d\nfrom scipy import signal\nfrom scipy.stats import ttest_1samp, ttest_rel\nfrom nilearn import plotting, d...
[ [ "matplotlib.pyplot.xlim", "numpy.min", "scipy.stats.ttest_1samp", "scipy.signal.filtfilt", "matplotlib.pyplot.gcf", "matplotlib.pyplot.xticks", "numpy.max", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.subplots", "matplotlib.pyplot.tick_params", "numpy.arange", ...
isabella232/corpora-data-portal
[ "09ed3cad3165f8b0db854b76404e0d5d0ea0b7d9" ]
[ "backend/scripts/curation/leng2020_AD/curate.py" ]
[ "\"\"\"Create the 'original' and 'remix' datasets for the snRNAseq of human neurons AD (Leng,\net. al. 2020) biorxiv preprint submission\"\"\"\n\n\nimport anndata\nimport numpy as np\nimport pandas as pd\nimport scanpy as sc\nfrom scipy.sparse import csr_matrix\n\nimport utils.hgnc\nimport utils.ontology\n\n\ndef b...
[ [ "numpy.array", "scipy.sparse.csr_matrix", "numpy.issubdtype", "pandas.DataFrame.sparse.from_spmatrix" ] ]
PPjaisri/Senior-project
[ "cf29a51bdff33e1cc9ae505b454a002457bc3245" ]
[ "News_fetcher/Sure/sure_info.py" ]
[ "import os\nimport csv\nimport time\nimport logging\nimport requests\nimport pandas as pd\nfrom bs4 import BeautifulSoup\n\nclass sure_info(object):\n path = os.getcwd()\n path = os.path.dirname(path)\n # If directly run this file --> uncomment line 16 and 17.\n path = os.path.dirname(path)\n\n input...
[ [ "pandas.read_csv" ] ]
OleguerCanal/kaggle_digit-recognizer
[ "89268df3e13744faacec5bf18bdc5071abf094d4" ]
[ "scripts/model.py" ]
[ "import datetime\nimport os\nimport pandas as pd\nimport numpy as np\nfrom pathlib import Path\nimport sys\nimport time\nimport yaml\n\n# Keras\nfrom keras.models import model_from_json\nfrom keras.optimizers import RMSprop, Adam\nfrom keras.preprocessing.image import ImageDataGenerator\n\n# Own imports TODO(olegue...
[ [ "tensorflow.Session", "tensorflow.ConfigProto", "numpy.argmax", "pandas.Series", "pandas.read_csv" ] ]
Chutlhu/DechorateDB
[ "378eda37ed296f2823e3306238101343c5f4084a" ]
[ "dechorate/cadzow.py" ]
[ "import numpy as np\n\nfrom dechorate.utils.dsp_utils import make_toepliz_as_in_mulan, reshape_toeplitz, enforce_toeplitz, build_frobenius_weights\n\ndef cadzow_denoise(A, n_spikes, thr_Cadzow=2e-5):\n '''\n Cadzow denoising method\n from Condat implementation\n '''\n N, P = A.shape\n K = n_spikes...
[ [ "numpy.dot", "numpy.exp", "numpy.fft.fft", "numpy.linalg.lstsq", "numpy.linalg.svd" ] ]
lilianschuster/PyGEM
[ "c805d09960f937fe6e35cdd1587f9089d4bec6b8" ]
[ "class_mbdata.py" ]
[ "\"\"\"class of mass balance data and functions associated with manipulating the dataset to be in the proper format\"\"\"\n\n# External libraries\nimport pandas as pd\nimport numpy as np\nimport calendar\nimport collections\nimport datetime\n# Local libraries\nimport pygem_input as input\nimport pygemfxns_modelsetu...
[ [ "numpy.isnan", "numpy.round", "pandas.DataFrame", "numpy.tile", "pandas.concat", "pandas.read_csv" ] ]
nhm-usgs/bmi-test-projects
[ "9ed065f291f0b33be9a9faeb0a02b3a253f36e9e" ]
[ "src/prms6bmi/prms6bmi/reader.py" ]
[ "\"\"\"\nCreated on Thu Dec 12 08:00:48 2019\n\n@author:rmcd build on pangeo package by Steve Markstrom - USGS\n\"\"\"\n\nimport xarray as xr\nimport glob\nimport os\nimport pandas as pd\nimport geopandas as gpd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.axes_grid1 import make_axes_loca...
[ [ "matplotlib.pyplot.gca", "pandas.Timestamp", "pandas.date_range", "numpy.asarray" ] ]
kircher-sw/expenses-tracker
[ "afd9550616a79f54dd119d91cec209c7748e9689" ]
[ "expenses_report/visualizations/transaction_bubbles_visualization.py" ]
[ "import pandas as pd\nfrom plotly import graph_objects as go\n\nfrom expenses_report.chart_builder import ChartBuilder\nfrom expenses_report.config import config\nfrom expenses_report.preprocessing.data_provider import DataProvider\nfrom expenses_report.visualizations.i_visualization import IVisualization\n\n\nclas...
[ [ "pandas.Timestamp", "pandas.DatetimeIndex" ] ]
aDecisionTree/HRNet_for_PolSAR_seg
[ "5243437ffa99ac4bce074d8f19bbdc1ec054f4b0" ]
[ "gaofenbisai_9436.py" ]
[ "# -*- coding: utf-8 -*-\nfrom PIL import Image,ImagePalette\nimport numpy as np\nimport yaml\n\nfrom skimage import io\nfrom torchvision import transforms\nimport os\nimport logging\n# import functools\n\nimport torch\nimport torch.nn as nn\n# import torch._utils\nimport torch.nn.functional as F\nimport torch.opti...
[ [ "torch.cat", "torch.nn.ModuleList", "torch.nn.BatchNorm2d", "torch.load", "numpy.zeros_like", "torch.nn.MaxPool2d", "torch.nn.init.constant_", "torch.nn.init.normal_", "numpy.argmax", "torch.utils.data.DataLoader", "torch.nn.Sequential", "torch.nn.ReLU", "torch....
maneeshdisodia/pythonic_examples
[ "f722bfbe253bbcead111ba082550bdfd1c6046d3" ]
[ "multi_thread.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom threading import Thread\nfrom multiprocessing import Queue\n\ndf = pd.DataFrame(data=np.random.rand(100).reshape(10, 10))\n\nprint(df.head())\nrows = df.index\ncolumn = df.columns\n\nque = Queue()\n\n\n# long run\ndef long_run(row, col, pv):\n for r in row:\n ...
[ [ "pandas.DataFrame", "numpy.random.rand", "numpy.array_split" ] ]
TapirLab/pdf-watermarkin
[ "f4e07f068ebb17e36fa2c8065f432ebd0d92a804" ]
[ "pdf_operations.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nThis program includes functions to add watermark to A4 PDFs. Also, miscellaneous\nfunctions are provided to harden OCR (Optical Character Recognition) process and\nmake encryption possible.\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%% A PDF...
[ [ "numpy.random.normal", "numpy.random.randint", "numpy.asarray" ] ]
otherman16/catalyst
[ "ccef2c7de7ff3869523a86f291b6a2390308bad5" ]
[ "catalyst/callbacks/metric.py" ]
[ "from typing import Any, Callable, Dict, List, TYPE_CHECKING, Union\nfrom abc import ABC, abstractmethod\nfrom collections import defaultdict\nimport logging\n\nimport numpy as np\n\nimport torch\n\nfrom catalyst.core.callback import Callback, CallbackNode, CallbackOrder\nfrom catalyst.tools.meters.averagevaluemete...
[ [ "numpy.concatenate", "torch.stack" ] ]
RalfG/pyAscore
[ "9467276f22d230369b24fd56cd69eccb9e82d51c" ]
[ "test/test_id_parsers.py" ]
[ "import unittest\nimport os\nimport pickle\nfrom itertools import product\nfrom pyascore import id_parsers\nimport numpy as np\nfrom pyteomics import mass\n\nSTD_AA_MASS = mass.std_aa_mass\n\nclass TestMassCorrector(unittest.TestCase):\n corrector = id_parsers.MassCorrector()\n\n def test_n_term(self):\n ...
[ [ "numpy.all", "numpy.array" ] ]
harymitchell/mscs-ml
[ "4e284c79c9c30926c7ca24ac8bf082b4cefadddc" ]
[ "MLWorker/dataset_service.py" ]
[ "import numpy as np\r\nfrom numpy import ma\r\nimport pandas\r\nfrom bson.objectid import ObjectId\r\nfrom pymongo import MongoClient\r\nfrom settings import TEST_MONGO_HOST, TEST_MONGO_PORT, TEST_MONGO_USERNAME, TEST_MONGO_PASSWORD\r\nimport gridfs\r\nimport pprint\r\nimport StringIO\r\n\r\nclass dataset_service (...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
AliMakiGmail/SFD-CNN-TL
[ "96890a086cb170334f761a825a5fdcdc51444696" ]
[ "svm.py" ]
[ "#!/usr/bin/env python\n# Copyright 2019 Augusto Cunha and Axelle Pochet\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this code and \n# associated documentation files, to deal in the code without restriction, \n# including without limitation the rights to use, copy, modify, ...
[ [ "tensorflow.set_random_seed", "numpy.array", "sklearn.model_selection.StratifiedKFold", "numpy.random.seed", "sklearn.externals.joblib.dump", "sklearn.svm.SVC", "sklearn.model_selection.train_test_split", "pandas.read_csv" ] ]
gabrielsluz/SlowFast
[ "bd06eac47fa236b070fd9a3b39518eea08d02947" ]
[ "clevrer_dev/text_baseline/train_net.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\n\nimport numpy as np\nimport pprint\nimport torch\nimport copy\nfrom torch.utils.data import DataLoader\n\nimport slowfast.models.losses as losses\nimport slowfast.models.optimizer as optim\nimport slowfast.utils.che...
[ [ "torch.sigmoid", "numpy.random.seed", "torch.no_grad", "torch.nn.parallel.DistributedDataParallel", "torch.cuda.device_count", "torch.manual_seed", "torch.cuda.current_device", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.argmax" ] ]
dguari1/Emotrics
[ "8b807d97663d6deb8efab7c74b31ee42f9218d1b" ]
[ "eye_window.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Aug 23 21:10:25 2017\n\n@author: Diego L.Guarin -- diego_guarin at meei.harvard.edu\n\"\"\"\nfrom PyQt5 import QtWidgets, QtCore, QtGui\nimport numpy as np\nfrom utilities import find_circle_from_points\n\n\"\"\"\nThis window show the eye and allows the user to selec...
[ [ "numpy.array" ] ]
comratvlad/cs231n.github.io
[ "63c72c3e8e88a6edfea7db7df604d715416ba15b" ]
[ "assignments/2019/assignment1/cs231n/vis_utils.py" ]
[ "from builtins import range\nfrom math import sqrt, ceil\n\nimport numpy as np\n\n\ndef visualize_grid(Xs, ubound=255.0, padding=1):\n \"\"\"\n Reshape a 4D tensor of image data to a grid for easy visualization.\n\n Inputs:\n - Xs: Data of shape (N, H, W, C)\n - ubound: Output grid will have values s...
[ [ "numpy.max", "numpy.ones", "numpy.min", "numpy.zeros" ] ]
vlad-perevezentsev/numba-dppy
[ "9c8dabf929368db96c3a2abf42072178b6cd9634" ]
[ "numba_dppy/tests/njit_tests/dpnp/test_numpy_rng.py" ]
[ "################################################################################\n# Numba-DPPY\n#\n# Copyright 2020-2021 Intel Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# Y...
[ [ "numpy.array", "numpy.random.rand", "numpy.random.hypergeometric", "numpy.isscalar", "numpy.all" ] ]
qaz734913414/insightface
[ "4101fe608ca1d38604a23d53f32314ce8a28fe79", "4101fe608ca1d38604a23d53f32314ce8a28fe79" ]
[ "recognition/arcface_paddle/deploy/pdserving/web_service.py", "recognition/vpl/vpl.py" ]
[ "# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.expand_dims", "numpy.frombuffer" ], [ "torch.zeros", "torch.nn.functional.normalize", "torch.nn.parameter.Parameter", "torch.max", "torch.cuda.current_stream", "torch.no_grad", "torch.normal", "torch.where", "torch.nn.functional.linear", "torch.distribute...
seunghoonlee89/pyscf-ecCC-TCC
[ "9a14f9bcc63bc75f5939cb4d00eb47861d8d8989" ]
[ "pyscf/pbc/mp/kmp2.py" ]
[ "#!/usr/bin/env python\n# Copyright 2014-2018 The PySCF Developers. 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/LIC...
[ [ "numpy.max", "numpy.array", "numpy.count_nonzero", "numpy.zeros", "numpy.ones", "scipy.linalg.block_diag", "numpy.ix_", "numpy.eye", "numpy.any", "numpy.where", "numpy.amax", "numpy.conj", "numpy.arange", "numpy.einsum", "numpy.all", "numpy.unique" ...
kpertsch/softlearning
[ "e437995b707771f745e1fe4ca464e076292756ca", "14759ce1b617d91f6ebc45c3297cc27e8480877d" ]
[ "softlearning/environments/dm_control/suite/wrappers/action_scale_test.py", "tests/softlearning/examples/development/main_test.py" ]
[ "import pytest\nimport numpy as np\nfrom dm_control import suite\n\nfrom action_scale import Wrapper as ActionScaleWrapper\n\n\ndef test_scale_action():\n seed = 0\n unwrapped_env = suite.load(\n domain_name=\"quadruped\", task_name=\"run\",\n task_kwargs={\"random\": seed})\n assert np.any(n...
[ [ "numpy.allclose", "numpy.testing.assert_allclose" ], [ "numpy.equal", "numpy.testing.assert_allclose", "tensorflow.trainable_variables", "numpy.log", "numpy.testing.assert_array_equal", "tensorflow.compat.v1.trainable_variables", "numpy.allclose", "tensorflow.compat.v1....
Bhaskers-Blu-Org2/petridishnn
[ "bf800c695a7f0774106968a0fadc5150074269ad" ]
[ "petridish/analysis/old/model_analysis.py" ]
[ "import numpy as np\nimport re\nimport os\nimport bisect\nfrom petridish.utils.geometry import _convex_hull_from_points\nfrom functools import partial\nimport copy\nimport subprocess\nfrom tensorpack.utils.serialize import loads, dumps\n\nfrom petridish.analysis.old.common import (\n img_dir, ann_models_logs, ex...
[ [ "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.pyplot.gcf", "matplotlib.pyplot.ylabel" ] ]
spragunr/jmu_ml_dimensionality_lab
[ "c6fe5adba8520f2a81f00556dcbf3574c1437016" ]
[ "code/good_dims.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jan 17 09:18:20 2020\n\n@author: spragunr\n\"\"\"\n\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n\nnum = 100\n\nD = np.zeros((num, 6))\nD[:,0] = np.random.randn(num)\nD[:,1] = np.random.rando...
[ [ "numpy.savetxt", "numpy.zeros", "matplotlib.pyplot.plot", "numpy.random.randn", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "numpy.random.randint", "numpy.random.random" ] ]
zhczhong/attention-is-all-you-need-pytorch
[ "f58eeb04e40575def05f5cb1fc2906d55aa05ebe" ]
[ "translate.py" ]
[ "''' Translate input text with trained model. '''\n\nimport torch\nimport torch.utils.data\nimport argparse\nfrom tqdm import tqdm\n\nfrom dataset import collate_fn, TranslationDataset\nfrom transformer.Translator import Translator\nfrom preprocess import read_instances_from_file, convert_instance_to_idx_seq\nfrom ...
[ [ "torch.load" ] ]
pedrocarvalhodev/flask_api
[ "31f57626f6c5f94c600fb53867b490aee7c74f8c" ]
[ "flask_api/server.py" ]
[ "import os\nimport pandas as pd\nimport dill as pickle\nfrom flask import Flask, jsonify, request\nfrom utils import PreProcessing\n\napp = Flask(__name__)\n\n@app.route('/predict', methods=['POST'])\ndef apicall():\n\t\"\"\"API Call\n\t\n\tPandas dataframe (sent as a payload) from API Call\n\t\"\"\"\n\ttry:\n\t\tt...
[ [ "pandas.read_json", "pandas.Series" ] ]
MartinoMensio/neural-symbolic-machines
[ "10683b8d7e0a97c2f6f35206deb5d3a31f4796c4" ]
[ "nsm/word_embeddings.py" ]
[ "import json\nimport numpy as np\nimport gensim\n\n\nclass EmbeddingModel(object):\n def __init__(\n self, vocab_file, embedding_file, normalize_embeddings=True):\n with open(embedding_file, 'rb') as f:\n self.embedding_mat = np.load(f)\n if normalize_embeddings:\n self.embedding_mat = self.em...
[ [ "numpy.linalg.norm", "numpy.load" ] ]
gizatt/scene_generation
[ "cd978b4fe8ac58983894db3fb93d625c85578dd6" ]
[ "inverse_graphics/direct_pose_and_param_estimation/pose_head.py" ]
[ "import fvcore.nn.weight_init as weight_init\nimport numpy as np\nimport torch\nfrom detectron2.layers import Conv2d, ConvTranspose2d, cat, get_norm\nfrom detectron2.utils.events import get_event_storage\nfrom detectron2.utils.registry import Registry\n\nfrom torch import nn\nfrom torch.nn import functional as F\n\...
[ [ "torch.cat", "torch.stack", "torch.transpose", "torch.exp", "torch.chunk", "torch.sum", "torch.abs", "numpy.prod", "torch.tensor", "torch.cos", "torch.nn.functional.l1_loss", "torch.linspace", "torch.clamp", "torch.cross", "torch.nn.functional.normalize"...
chrelli/3DDD_social_mouse_tracker
[ "291d2ed90029628dd65db0ce3e8972b721159a15" ]
[ "recording/record_calib_npy.py" ]
[ "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jan 12 15:36:15 2018\n\n@author: chrelli\nadded unix time stamps to the first camera!\n\nWays to slim down the data:\n no unix time stamps?\n no color frame showing? - yes, helps a lot!\n no png compression? Totally fine at 30 fps!\n\...
[ [ "numpy.array" ] ]
ahefnycmu/rpsp
[ "ff3aa3e89a91bb4afb7bad932d2c04691a727a63" ]
[ "rpsp/rpspnets/nn_diags.py" ]
[ "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Sep 8 18:56:28 2017\n\n@author: ahefny\n\"\"\"\nfrom __future__ import print_function\nimport numpy as np\nimport rpsp.globalconfig as globalconfig\n\nfrom rpsp.rpspnets.psr_lite.utils.nn import CallbackOp\n\nclass PredictionError(Exception):...
[ [ "numpy.sum" ] ]
christiaanlamers/sms-mip-ego
[ "3601efcb9cfe069e8543d3c29a6102ebbeb9a78c" ]
[ "all_cnn_bi_skippy_cifar100.py" ]
[ "from __future__ import print_function\n\nimport numpy as np\n#np.random.seed(43)\nimport tensorflow as tf\ntf.set_random_seed(43)\n\nimport keras\n#from keras.datasets import mnist\nfrom keras.datasets import cifar100\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom keras.models import Sequential\nf...
[ [ "tensorflow.set_random_seed", "pandas.DataFrame" ] ]
ElTapia/computacion-grafica
[ "8d6ec5e1bd2426093f253da9a197a7b74bb656a9", "8d6ec5e1bd2426093f253da9a197a7b74bb656a9" ]
[ "Ejercicios/Ejercicio_6/grafica/scene_graph.py", "Ejercicios/Ejercicio_5/grafica/ex_curves.py" ]
[ "# coding=utf-8\r\n\"\"\"A simple scene graph class and functionality\"\"\"\r\n\r\nfrom OpenGL.GL import *\r\nimport OpenGL.GL.shaders\r\nimport numpy as np\r\nimport grafica.transformations as tr\r\nimport grafica.gpu_shape as gs\r\n\r\n__author__ = \"Daniel Calderon\"\r\n__license__ = \"MIT\"\r\n\r\n\r\nclass Sce...
[ [ "numpy.array", "numpy.matmul" ], [ "numpy.concatenate", "numpy.array", "numpy.matmul", "matplotlib.pyplot.figure", "numpy.ndarray", "matplotlib.pyplot.show", "numpy.linspace" ] ]
RomaKoks/Practical_RL
[ "ddcb71f9e45d4e08fe04da6404cb0e312681b615" ]
[ "week05_explore/q_learning_agent.py" ]
[ "from collections import defaultdict\nimport random\nimport math\nimport numpy as np\n\n\nclass QLearningAgent:\n def __init__(self, alpha, epsilon, discount, get_legal_actions):\n \"\"\"\n Q-Learning Agent\n based on https://inst.eecs.berkeley.edu/~cs188/sp19/projects.html\n Instance...
[ [ "numpy.random.rand", "numpy.random.choice" ] ]
PansoK/slp
[ "ac55154f063245e0e4ed584c59f16370d228d8a7" ]
[ "slp/modules/norm.py" ]
[ "import torch\nimport torch.nn as nn\n\n\ndef safe_norm(x, eps=1e-5, dim=-1, keepdim=True):\n return torch.sqrt(torch.sum(torch.square(x), dim=dim, keepdim=keepdim) + eps)\n\n\nclass LayerNormTf(nn.Module):\n def __init__(self, hidden_size: int, eps: float = 1e-12):\n \"\"\"Construct a layernorm module...
[ [ "torch.zeros", "torch.sqrt", "torch.square", "torch.ones", "torch.tensor" ] ]
ruimashita/blueoil
[ "e65d64dc0604193e2658d8e0cd6ece09260b806e" ]
[ "blueoil/datasets/pascalvoc_2007_2012.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2018 The Blueoil 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...
[ [ "numpy.array" ] ]
henrymidles/LidarBot
[ "f67b5ed77671abad7267a86f425192fc6d5aad42" ]
[ "Python/Client/remote_click_control.py" ]
[ "#!/usr/bin/env python3\n\nimport socket\nimport time\nimport math\nimport threading\nimport numpy as np\nfrom util import point_direction, point_distance\nfrom queue import Queue\n#from PythonRobotics.SLAM.ICP.iterative_closest_point import icp_matching\nfrom RasPi_coms import RasPi_coms\nfrom Turtle_UI import UI\...
[ [ "numpy.zeros" ] ]
jakejhansen/minesweeper_solver
[ "5eaba3f3242f08cbbb69db56e7fde4d2cd104aec" ]
[ "q_learning/train_arg.py" ]
[ "\"\"\"\nThis module contains class definitions for open ai gym environments.\n\"\"\"\n\nimport argparse\nimport random\nimport numpy as np\nimport tensorflow as tf\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' \nfrom agent import QAgent\n\ndef setup_model(mode = 0):\n\n parser = argparse.ArgumentParser(p...
[ [ "numpy.random.seed", "tensorflow.set_random_seed", "tensorflow.reset_default_graph" ] ]
rhjohnstone/pytorch-lightning
[ "4cd7e77ad2471379eaf768c20d8a3284aeb8b0b5" ]
[ "tests/loops/test_training_loop_flow_scalar.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.utils.data._utils.collate.default_collate" ] ]
nftqcd/nthmc
[ "010c70e297c904219e9d8a04cc20b9c75a4b61e5", "010c70e297c904219e9d8a04cc20b9c75a4b61e5" ]
[ "u1_2d/s_nthmc_l64_b4_t2_lr5e-4.py", "u1_2d/t_force_b25_l64_b6_cn10.py" ]
[ "import tensorflow as tf\nimport tensorflow.keras as tk\nimport numpy\nimport nthmc, ftr, evolve, forcetrain\n\ntrajLength = 4.0\nnstep = 8\n\nconf = nthmc.Conf(nbatch=32, nepoch=4, nstepEpoch=1024, nstepMixing=128, initDt=trajLength/nstep, stepPerTraj=nstep, trainDt=False, nthr=10, nthrIop=1, seed=7*11*13*7)\nop0 ...
[ [ "tensorflow.keras.initializers.RandomNormal", "numpy.load", "tensorflow.random.Generator.from_seed" ], [ "tensorflow.keras.initializers.RandomNormal", "tensorflow.keras.optimizers.Adam", "numpy.load", "tensorflow.random.Generator.from_seed" ] ]
pulp-platform/q-eegnet_wolf
[ "f028a727d4ae346b81539ed78ecba5f059c9029f", "f028a727d4ae346b81539ed78ecba5f059c9029f" ]
[ "test/cl/func/conv/testcase.py", "test/cl/net/layer4/testcase.py" ]
[ "\"\"\"\nThis file will test the convolution implementation\n\"\"\"\n\n__author__ = \"Tibor Schneider\"\n__email__ = \"sctibor@student.ethz.ch\"\n__version__ = \"1.0\"\n__license__ = \"Apache 2.0\"\n__copyright__ = \"\"\"\n Copyright (C) 2020 ETH Zurich. All rights reserved.\n\n Author: Tibor Schneider, ETH Z...
[ [ "numpy.convolve" ], [ "numpy.random.randint", "numpy.load", "numpy.transpose" ] ]
hoangdzung/DGI
[ "12203ec30bd3e09770e79da2d967b613b8c8e79d" ]
[ "test.py" ]
[ "import torch \nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom torch import nn\n\nfrom torch_geometric.nn import GCNConv\nfrom sklearn.linear_model import LogisticRegression\n\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom gumbel import gumbel_softmax\nfrom utils import process\n\nnu...
[ [ "torch.diagonal", "torch.FloatTensor", "sklearn.linear_model.LogisticRegression", "torch.cuda.is_available", "numpy.argmax", "torch.transpose" ] ]
satinder147/opencv-utilities
[ "ec2d0469949924dd89f8159e9c49191f3c43f720" ]
[ "opencv_utilities/bounding_rect.py" ]
[ "import cv2\nimport numpy as np\nimport time\n\n\ndef check(scale, text, font, line_width, box_width, box_height, offset, p=1):\n \"\"\"\n :param scale: parameter binary search is optimising\n :return: A boolean, whether this scale is ok or if p==2 sends back the string of words in each line.\n \"\"\"\n...
[ [ "numpy.array", "numpy.zeros" ] ]
dangpzanco/dcase-task1
[ "72867cc5b8969d7ec55c5acfd30ebbc3a7246666" ]
[ "debugging/debug_validation.py" ]
[ "# Standard libraries\nimport pathlib\nimport glob\nimport platform\nimport pickle\nfrom datetime import datetime\nfrom pprint import pprint\n\n# Scientific stack\nimport numpy as np\nimport numpy.random as rnd\nimport pandas as pd\n\n# Chunked data\nimport zarr\n\n# Audio processing\nimport dcase_util as du\n\n# P...
[ [ "numpy.empty", "numpy.random.seed", "sklearn.model_selection.GroupKFold", "matplotlib.pyplot.subplots", "numpy.where", "numpy.arange", "matplotlib.pyplot.show", "numpy.random.get_state", "numpy.unique" ] ]
robovish/Python-Projects
[ "1cdfa18c093af32cfc02ac7d08e2bdf682670470" ]
[ "Data_Science/src/model.py" ]
[ "\n#load the libraries\nimport pandas as pd\nimport numpy as np\nfrom pandas_profiling import ProfileReport\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.metrics import classification_report\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.ensemble import RandomForestClassifier\...
[ [ "sklearn.model_selection.train_test_split", "pandas.DataFrame", "sklearn.ensemble.RandomForestClassifier", "sklearn.preprocessing.StandardScaler" ] ]
XJX777/FaceX-Zoo
[ "9d083ed58d77dca077bbdae3e8bbdc73f46d287f" ]
[ "face_sdk/core/model_handler/face_detection/FaceDetModelHandler.py" ]
[ "\"\"\"\n@author: JiXuan Xu, Jun Wang\n@date: 20201019\n@contact: jun21wangustc@gmail.com \n\"\"\"\n\nimport logging.config\nlogging.config.fileConfig(\"config/logging.conf\")\nlogger = logging.getLogger('sdk')\n\nimport torch\nimport numpy as np\nfrom math import ceil\nfrom itertools import product as product\nimp...
[ [ "torch.cat", "numpy.minimum", "torch.no_grad", "torch.from_numpy", "numpy.where", "numpy.float32", "numpy.hstack", "torch.Tensor", "torch.exp", "numpy.maximum" ] ]
Steven20210/cell_death_ML
[ "c1a380bb2f9f3e0279403cf76cb5f5193e771b5b" ]
[ "unsupervised_training.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\nimport cv2\nfrom matplotlib import style\n# from sci_utilities import is_outlier\nimport pandas as pd\n\nstyle.use(\"ggplot\")\nfrom sklearn.cluster import MiniBatchKMeans\nfrom keras.models import Model\nfrom tensorflow.keras.layers imp...
[ [ "matplotlib.style.use", "sklearn.cluster.MiniBatchKMeans", "numpy.asarray", "numpy.percentile", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.hist", "matplotlib.pyplot.show", "numpy.amax", "matplotlib.pyplot.ylabel",...
TomaszGolan/q-learning-maze
[ "2540acf09d939c1686060c58cbe52775e94304ed" ]
[ "nets.py" ]
[ "\"\"\"Quality functions\"\"\"\nimport tensorflow as tf\nimport numpy as np\nfrom settings import Moves, Settings\n\n\nclass Net01:\n \"\"\"My first attempt to approximate Q with NN\"\"\"\n\n def __init__(self, session, in_size, snapshot=None):\n \"\"\"Create a graph for NN\n\n session -- ten...
[ [ "tensorflow.zeros", "tensorflow.train.AdamOptimizer", "numpy.zeros", "tensorflow.argmax", "tensorflow.matmul", "tensorflow.placeholder", "tensorflow.losses.mean_squared_error", "tensorflow.global_variables_initializer", "tensorflow.random_normal" ] ]
imsanjoykb/Health-AI
[ "2c033899fce81089f9fc8e4d79e453dc94742576" ]
[ "app.py files/app_stroke.py" ]
[ "from flask import Flask, render_template, request\nimport numpy as np\nimport pickle\n\n\napp = Flask(__name__)\nmodel = pickle.load(open('Stroke.pkl', 'rb'))\n\n@app.route('/',methods=['GET'])\ndef Home():\n return render_template('index.html')\n\n@app.route(\"/predict\", methods=['POST'])\ndef predict():\n ...
[ [ "numpy.array" ] ]
Sam-Chanow/Bitcoin-IGASS
[ "c3babac66d6a0594c4d83479393c50a54af9572a" ]
[ "Predict.py" ]
[ "import torch\nimport sys\nfrom tqdm import tqdm\nfrom dataset import Dataset\nimport numpy as np\nimport tensorflow as tf\n\n#adding the model folder path\nsys.path.append('../model/')\nsys.path.append('../tensorflow_model/')\n\nimport model\nimport tf_model\n\nif __name__ == \"__main__\":\n if (len(sys.argv) >...
[ [ "numpy.concatenate", "numpy.argmax" ] ]
apapaion/menpo
[ "9834f0437ca3cbe6a972c2a62f7c970ae950cf32", "9834f0437ca3cbe6a972c2a62f7c970ae950cf32" ]
[ "menpo/transform/test/test_h_translation.py", "menpo/transform/test/test_image_tcoords.py" ]
[ "import numpy as np\nfrom numpy.testing import assert_allclose, assert_almost_equal\nfrom pytest import raises\n\nfrom menpo.transform import Translation\n\n\ndef test_1d_translation():\n t_vec = np.array([1])\n with raises(ValueError):\n Translation(t_vec)\n\n\ndef test_5d_translation():\n t_vec = ...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.random.rand", "numpy.testing.assert_almost_equal", "numpy.ones", "numpy.eye", "numpy.all" ], [ "numpy.array" ] ]
nkdnnlr/ECG-Heartbeat-Classification
[ "d75012794b17d0b3b8dd9026874c026445cf05c3" ]
[ "code/experiments/baseline_ptbdb.py" ]
[ "import pandas as pd\nimport numpy as np\n\nfrom keras import optimizers, losses, activations, models\nfrom keras.callbacks import (\n ModelCheckpoint,\n EarlyStopping,\n LearningRateScheduler,\n ReduceLROnPlateau,\n)\nfrom keras.layers import (\n Dense,\n Input,\n Dropout,\n Convolution1D,\...
[ [ "numpy.array", "sklearn.metrics.accuracy_score", "sklearn.metrics.average_precision_score", "pandas.concat", "sklearn.model_selection.train_test_split", "pandas.read_csv", "sklearn.metrics.f1_score", "sklearn.metrics.roc_auc_score" ] ]
Harshitha-Nagapudi/NN_Project
[ "f0df170a33b6b35a00929a0104dc6ee04c5062a9" ]
[ "Improvements/gnnimprove.py" ]
[ "import torch.nn as nn\nimport torch.nn.functional as F\nimport math\nimport torch\nimport torch.optim as optim\nfrom torch.nn.parameter import Parameter\nfrom torch.nn.modules.module import Module\nfrom deeprobust.graph import utils\nfrom copy import deepcopy\nimport sys\nfrom scipy import stats\n\nimport tensorly...
[ [ "torch.cat", "numpy.multiply", "scipy.sparse.triu", "torch.eye", "torch.nn.functional.nll_loss", "torch.cdist", "scipy.sparse.linalg.svds", "numpy.count_nonzero", "numpy.linalg.norm", "torch.FloatTensor", "torch.abs", "torch.zeros_like", "torch.nn.functional.rel...
LiYingwei/Regional-Homogeneity
[ "6b0b521ff6e9d1f4c3f25cb25518968047b5cca0" ]
[ "attack.py" ]
[ "from config import config as FLAGS\nimport tensorflow as tf\nfrom tensorpack import (BatchData)\nfrom tqdm import tqdm\nimport numpy as np\n\nfrom RHP_ops import conv_with_rn\nfrom data import PNGDataFlow, save_images\nfrom networks import network\n\nfrom tensorpack.tfutils.tower import TowerContext\n\n\nclass Att...
[ [ "numpy.concatenate", "tensorflow.abs", "tensorflow.train.latest_checkpoint", "tensorflow.less", "numpy.zeros", "tensorflow.while_loop", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.gradients", "tensorflow.constant", "tensorflow.zeros_like", "tensorflo...
hmedina/KaSaAn
[ "83e4e31ff0e0062762aacfbc65bbdd290808bb51" ]
[ "KaSaAn/functions/snapshot_visualizer_subcomponent.py" ]
[ "#! /usr/bin/env python3\n\nimport ast\nimport squarify\nimport warnings\nimport networkx as nx\nimport matplotlib as mpl\nimport matplotlib.patches as mpatches\nimport matplotlib.pyplot as plt\nfrom networkx.drawing.nx_agraph import graphviz_layout\nfrom typing import List, Tuple\nfrom ..core import KappaSnapshot,...
[ [ "matplotlib.patches.Patch", "matplotlib.pyplot.figure" ] ]
EwoutH/seaborn
[ "630c08d7bd1c2a39362eda2389e8822357057775" ]
[ "doc/sphinxext/gallery_generator.py" ]
[ "\"\"\"\nSphinx plugin to run example scripts and create a gallery page.\n\nLightly modified from the mpld3 project.\n\n\"\"\"\nimport os\nimport os.path as op\nimport re\nimport glob\nimport token\nimport tokenize\nimport shutil\nimport warnings\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot...
[ [ "matplotlib.use", "matplotlib.image.imread", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.gcf" ] ]
VITA-Group/VGAI
[ "c36746383da42b011dddf182303f8c2618d5ca42" ]
[ "train_loc.py" ]
[ "import os\nimport sys\nimport time\nimport glob\nimport numpy as np\nimport torch\nimport logging\nimport argparse\nimport torch.nn as nn\nimport torch.utils\nimport torch.backends.cudnn as cudnn\n\nimport joint_network as models\nfrom dataset_loc import OneHopDataset\nfrom torch.utils.data import Dataset, DataLoa...
[ [ "torch.cuda.manual_seed", "numpy.zeros", "numpy.random.seed", "torch.save", "torch.manual_seed", "torch.cuda.set_device", "torch.nn.SmoothL1Loss", "torch.cuda.is_available", "torch.utils.data.sampler.SubsetRandomSampler", "numpy.floor" ] ]
RoderickLi/python-snippet
[ "7cc672c455a768864cf38d6bbebdf8337b9c510c" ]
[ "data-mining/model2http-api.py" ]
[ "import tensorflow as tf\ndef save_model_to_serving(model, export_version, export_path='model/'):\n print(model.input, model.output)\n signature = tf.saved_model.signature_def_utils.predict_signature_def( \n inputs={'img_input': mod...
[ [ "tensorflow.compat.as_bytes", "tensorflow.saved_model.builder.SavedModelBuilder", "tensorflow.saved_model.signature_def_utils.predict_signature_def", "tensorflow.tables_initializer" ] ]
SHTUPLUS/ContextLab
[ "4e12f0af9d0640f29c763b915f02de763b577200" ]
[ "contextlab/utils/layer_misc.py" ]
[ "import torch\nfrom torch import nn\nimport torch.nn.functional as F\n__all__ = ['ConvBNReLU']\n\n\nclass ConvBNReLU(nn.Module):\n def __init__(self,\n in_channels,\n out_channels,\n kernel_size,\n norm_layer=nn.BatchNorm2d,\n with_r...
[ [ "torch.cat", "torch.bmm", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.functional.softmax" ] ]
herobd/GAN_aug
[ "b240da32d4f3ae9a00a9d395ac8f29728623f6b4" ]
[ "models/base_model.py" ]
[ "import os\nimport torch\nfrom collections import OrderedDict\nfrom abc import ABC, abstractmethod\nfrom . import networks\n\n\nclass BaseModel(ABC):\n \"\"\"This class is an abstract base class (ABC) for models.\n To create a subclass, you need to implement the following five functions:\n -- <__init__...
[ [ "torch.device", "torch.save", "torch.no_grad", "torch.cuda.is_available", "torch.load" ] ]
jdekarske/axopy
[ "a60abb44a12c5e833b9033170825773bb0691394", "a60abb44a12c5e833b9033170825773bb0691394" ]
[ "axopy/pipeline/sources.py", "tests/test_gui.py" ]
[ "\"\"\"Data streams for processing with a pipeline.\"\"\"\n\nimport warnings\nimport numpy as np\n\n\ndef segment(data, length, overlap=0):\n \"\"\"Generate segments of an array.\n\n Each segment is of a specified length and optional overlap with the\n previous segment. Only segments of the specified lengt...
[ [ "numpy.atleast_2d" ], [ "numpy.random.randn" ] ]
h3nnn4n/colosseum_renderer
[ "e8fb2e94ca333b4465b2cb4283822338f07d69ff" ]
[ "renderer/renderer.py" ]
[ "#!/usr/bin/env python3\n\nimport itertools\nimport sys\nfrom time import sleep, time\n\nimport numpy as np\nimport pygame\nfrom pygame.colordict import THECOLORS as colors\n\n\ndef load_image(name):\n image = pygame.image.load(name).convert_alpha()\n return image\n\n\ndef get_food_sprite():\n image = load...
[ [ "numpy.array" ] ]
dcortie/refnx
[ "037434fa0a64755f72c540d75063986bd517ab10" ]
[ "refnx/analysis/test/test_globalfitting.py" ]
[ "\"\"\"\nTest co-refinement of datasets by fitting 3 neutron reflectivity datasets. The\noverall construction of the models can be done in a few different ways.\n\"\"\"\nimport os.path\n\nimport numpy as np\nfrom numpy.testing import (\n assert_,\n assert_equal,\n assert_almost_equal,\n assert_allclose,...
[ [ "numpy.testing.assert_almost_equal", "numpy.array", "numpy.errstate", "numpy.testing.assert_equal" ] ]
destenson/tensorflow--tensorflow
[ "7f84d88d39f236e5c0cea492a2248782e696c972" ]
[ "tensorflow/python/keras/_impl/keras/backend.py" ]
[ "# Copyright 2015 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.array_ops.identity", "tensorflow.python.ops.math_ops.less", "tensorflow.python.ops.state_ops.assign_add", "tensorflow.python.ops.math_ops.matmul", "tensorflow.python.ops.array_ops.sparse_placeholder", "tensorflow.python.ops.array_ops.ones", "tensorflow.python.ops...
sourcery-ai-bot/Megatron-LM
[ "f27f44e2c49d1cb39b2288bef6f7d837e11094cb" ]
[ "megatron/data/indexed_dataset.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\n# copied from fairseq/fairseq/data/indexed_dataset.py\n# Removed IndexedRawTextDataset since it relied on Fairseq dictionary\n# ot...
[ [ "numpy.array", "numpy.copyto", "numpy.empty", "numpy.split", "numpy.memmap", "numpy.frombuffer", "numpy.dtype" ] ]
mvdelt/detectron2
[ "c320a6f0e6facb9c5d6dda8263c8e76834c04246" ]
[ "detectron2/evaluation/panoptic_evaluation.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\nimport contextlib\nimport io\nimport itertools\nimport json\nimport logging\nimport numpy as np\nimport os\nimport tempfile\nfrom collections import OrderedDict\nfrom PIL import Image\nfrom tabulate import tabulate\n\nfrom detectron2.data import MetadataCatalog\n...
[ [ "numpy.unique" ] ]
catalyst-cooperative/epacems_ramp_rates
[ "5a5ea6f9571823f7ef3f9c66abb4d9acb79820be" ]
[ "tests/features/test_build_features.py" ]
[ "import pytest\nimport pandas as pd\nimport numpy as np\n\nfrom ramprate.build_features import _find_uptime\n\n\ndef test__find_uptime_start_and_end_nonzero():\n dt_idx = pd.date_range(start=\"2020-01-01 00:00\", periods=6, freq=\"h\", tz=\"UTC\")\n data = [2, 2, 0, 0, 0, 2]\n\n # downtime=True\n # firs...
[ [ "pandas.to_datetime", "pandas.testing.assert_frame_equal", "pandas.DataFrame", "pandas.date_range", "pandas.Series" ] ]
nguyenvu2589/Numerical
[ "23eee7d31a8871d5d53871ebc9950866cf11ad23" ]
[ "cubicsplines.py" ]
[ "import numpy as np\nimport re\nimport matplotlib.pyplot as plt\n\ndebug = False\n\n\n# Takes a string of points in the string form: '(-1,3), (0,5), (3,1), (4,1), (5,1)'\n# and optionally, the graph resolution.\n# Prints the cubic spline functions to stdout and displays an interpolated line plot\n# Example usage: c...
[ [ "numpy.zeros", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.linalg.solve", "numpy.linspace" ] ]
jinglescode/python-signal-processing
[ "c3de02b12905f14a2350377d7f4a868bd7a40bc7" ]
[ "splearn/data/sample_ssvep.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"A 40-target SSVEP dataset recorded from a single subject.\n\"\"\"\nimport numpy as np\nfrom scipy.io import loadmat\nimport os\n\n\nclass SampleSSVEPData():\n r\"\"\"\n A 40-target SSVEP dataset recorded from a single subject.\n \n Data description:\n Original Data...
[ [ "numpy.array", "numpy.tile", "numpy.arange" ] ]
khoehlein/CNNs-for-Wind-Field-Downscaling
[ "eb8418d4d893fcb2beb929abb241281b7a9b6a95", "eb8418d4d893fcb2beb929abb241281b7a9b6a95" ]
[ "networks/modular_downscaling_model/core_modules/ResUNetSuper.py", "networks/modular_downscaling_model/base_modules/ConvBlock.py" ]
[ "import torch.nn as nn\nfrom networks.modular_downscaling_model.base_modules import ConvBlock, ResNetMultiBlock, ConvMultiBlock\nfrom networks.modular_downscaling_model.core_modules.unet_template import BaseUNet\nfrom networks.modular_downscaling_model.core_modules.unet_template.SkipConnectionModule import SkipConn...
[ [ "torch.nn.Upsample", "torch.nn.Sequential" ], [ "torch.nn.ReplicationPad2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.Conv2d", "torch.nn.PReLU", "torch.nn.ReflectionPad2d", "torch.nn.Dropout2d" ] ]
nicolas998/ifis_tools
[ "f7b06473a916324fc37937bc5e9034cc57bc1623" ]
[ "ifis_tools/from_taudem.py" ]
[ "import pandas as pd \nimport geopandas as gp\nimport numpy as np \nimport pylab as pl \nfrom struct import pack, unpack\nimport io\nimport gdal\nfrom osgeo import ogr\nimport osgeo\n#from wmf import wmf \npd.options.mode.chained_assignment = None\n\ndef read_raster(path_map,isDEMorDIR=False,dxp=None, noDataP = Non...
[ [ "numpy.isnan", "numpy.arange", "numpy.abs" ] ]
jsnlp/snorkel-tutorials
[ "b4cda9f918daf77f4011ec1598c08d9bd7e51c39" ]
[ "spam/02_spam_data_augmentation_tutorial.py" ]
[ "# -*- coding: utf-8 -*-\n# %% [markdown]\n# # 📈 Snorkel Intro Tutorial: Data Augmentation\n\n# %% [markdown]\n# In this tutorial, we will walk through the process of using *transformation functions* (TFs) to perform data augmentation.\n# Like the labeling tutorial, our goal is to train a classifier to YouTube com...
[ [ "numpy.random.choice", "pandas.set_option", "numpy.random.seed", "tensorflow.compat.v1.get_default_graph", "tensorflow.compat.v1.ConfigProto", "tensorflow.compat.v1.set_random_seed", "tensorflow.compat.v1.keras.backend.set_session" ] ]
JiarunLiu/mixmo-pytorch
[ "a9ad674122d9b6512094b8292280a4045bb5a400" ]
[ "mixmo/core/loss.py" ]
[ "\"\"\"\nBase loss definitions\n\"\"\"\nfrom collections import OrderedDict\nimport copy\nimport torch\nimport torch.nn as nn\n\nfrom mixmo.utils import misc, logger\n\nLOGGER = logger.get_logger(__name__, level=\"DEBUG\")\n\n\nclass AbstractLoss(nn.modules.loss._Loss):\n \"\"\"\n Base loss class defining pri...
[ [ "torch.nn.LogSoftmax", "torch.nn.modules.loss._Loss.__init__", "torch.stack", "torch.pow" ] ]
KevinKecc/caffe2
[ "a2b6c6e2f0686358a84277df65e9489fb7d9ddb2", "a2b6c6e2f0686358a84277df65e9489fb7d9ddb2", "a2b6c6e2f0686358a84277df65e9489fb7d9ddb2" ]
[ "caffe2/python/operator_test/mkl_speed_test.py", "caffe2/python/operator_test/matmul_op_test.py", "caffe2/python/checkpoint_test.py" ]
[ "# Copyright (c) 2016-present, Facebook, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl...
[ [ "numpy.random.randn", "numpy.random.rand" ], [ "numpy.matmul", "numpy.random.randint", "numpy.random.rand" ], [ "numpy.array" ] ]
zbloss/TransformerModel
[ "da4712fe5631accd22156f129e69c98b4ffe1146" ]
[ "transformer_model/masker.py" ]
[ "import tensorflow as tf\n\n\nclass Masker(object):\n\n def __init__(self):\n \"\"\"\n This class holds a collection of masking functions that are used across the entire package.\n \"\"\"\n\n @staticmethod\n def create_padding_mask(seq):\n \"\"\"\n :param seq: the sequenc...
[ [ "tensorflow.shape", "tensorflow.maximum", "tensorflow.ones", "tensorflow.math.equal" ] ]
ysakanaka/coco
[ "ebd5c30ccc83910755e379322b23d60a4b72ef38" ]
[ "code-experiments/build/python/python/solvers.py" ]
[ "from __future__ import absolute_import, division, print_function\nimport numpy as np\n\n# ===============================================\n# the most basic example solver\n# ===============================================\ndef random_search(fun, lbounds, ubounds, budget):\n \"\"\"Efficient implementation of uni...
[ [ "numpy.all", "numpy.array", "numpy.random.rand", "numpy.argmin" ] ]
kamalsharma2/horovod
[ "69c33290f8cc43073fade45619e80d9ffb3b9653" ]
[ "test/utils/spark_common.py" ]
[ "# Copyright 2019 Uber Technologies, Inc. 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...
[ [ "numpy.random.normal", "numpy.random.uniform" ] ]
kecsap/cleanlab
[ "e592e2ae2278018c8fdac33f20fd58659a825c3d" ]
[ "tests/test_latent.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\nfrom __future__ import print_function, absolute_import, division, unicode_literals, with_statement\n\n\nfrom cleanlab import latent_algebra, latent_estimation\nimport numpy as np\nimport pytest\n\n\ns = [0] * 10 + [1] * 5 + [2] * 15\nnm = np.array([\n [1.0, 0.0, 0.2],\n...
[ [ "numpy.sum", "numpy.array", "numpy.dot" ] ]
deepakkumar1984/ml-api
[ "8d09e9ef99c39838cd2f2db1e70226b8d6cbc77e", "8d09e9ef99c39838cd2f2db1e70226b8d6cbc77e" ]
[ "ml/pipelinecomponents.py", "vis/rcnn/processing/bbox_regression.py" ]
[ "import simplejson as json\nimport os\nimport pickle\nimport jsonpickle\nimport numpy\nimport pandas\nfrom keras import datasets\nfrom keras.models import model_from_json\nfrom pandas import read_csv\nfrom sklearn.model_selection import cross_validate, train_test_split, cross_val_predict\nfrom sklearn.preprocessing...
[ [ "sklearn.model_selection.cross_validate", "pandas.DataFrame", "sklearn.model_selection.train_test_split", "pandas.read_csv", "sklearn.preprocessing.Imputer" ], [ "numpy.where", "numpy.array", "numpy.sqrt", "numpy.zeros" ] ]
likojack/bnv_fusion
[ "76b7354c6f3bf8c7f7e1ff4d958de0e73ec3e614" ]
[ "src/utils/torchvision_utils.py" ]
[ "import torch\nimport torchvision.transforms as T\nimport numpy as np\nimport cv2\nfrom PIL import Image\nimport matplotlib as mpl\nimport matplotlib.cm as cm\n\n\ndef visualize_depth(depth, cmap=cv2.COLORMAP_JET):\n \"\"\"\n depth: (H, W)\n \"\"\"\n x = depth.astype(np.uint8)\n x_ = Image.fromarray(...
[ [ "numpy.percentile", "matplotlib.cm.ScalarMappable", "numpy.logical_and" ] ]
Valerio-Colombo/mbcd
[ "8bb8adce78d303e991d8afdb3fbc045970297f83", "8bb8adce78d303e991d8afdb3fbc045970297f83" ]
[ "mbcd/models/bnn.py", "experiments/mbcd_run.py" ]
[ "from __future__ import division\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\nimport os\nimport time\nimport pdb\nimport itertools\nfrom collections import OrderedDict\n\nimport tensorflow as tf\nimport numpy as np\nfrom tqdm import trange\nfrom scipy.io import savemat, loadmat\...
[ [ "tensorflow.exp", "numpy.random.choice", "numpy.set_printoptions", "numpy.tile", "tensorflow.zeros_like", "numpy.sort", "tensorflow.global_variables_initializer", "tensorflow.trainable_variables", "numpy.empty", "scipy.io.savemat", "tensorflow.add_n", "tensorflow.Co...
LucienZuber/AlgoTrader
[ "cc6088a525ed6311c9a6969880c739b91bdebf5c" ]
[ "indicators/support_resistance.py" ]
[ "import pandas as pd\nimport datetime\n\ndef detect_support_resistances(df: pd.DataFrame, initial_state: int = 20, precision: int = 3, expiration_time: datetime.timedelta = datetime.timedelta(days=7)):\n initial_min = df['Close'].iloc[:initial_state].idxmin()\n initial_max = df['Close'].iloc[:initial_state].i...
[ [ "pandas.DataFrame" ] ]
JAckleyLSNYC/GitPython
[ "93fa78346e85ec6b8d00c5b362d6b498598a0444", "93fa78346e85ec6b8d00c5b362d6b498598a0444" ]
[ "hyperlinker/app/Historical Backup Scripts/TRCExternalPrep.py", "hyperlinker/app/Historical Backup Scripts/IOIimmQuarterly.py" ]
[ "from flask import request, send_from_directory\r\nfrom app import app, DataWizardTools, HousingToolBox\r\nimport pandas as pd\r\n\r\n@app.route(\"/TRCExternalPrep\", methods=['GET', 'POST'])\r\ndef TRCExternalPrep():\r\n #upload file from computer via browser\r\n if request.method == 'POST':\r\n print...
[ [ "pandas.read_excel", "pandas.ExcelWriter" ], [ "pandas.DataFrame", "pandas.read_excel", "pandas.ExcelWriter" ] ]
zh981008/zh-farm
[ "e8cdb977579eb29417be000331c342427c4daf54" ]
[ "juanzeng.py" ]
[ "import uiautomator2 as u2\nimport time\nfrom utils import *\nfrom cv import *\nfrom Automator import *\nimport matplotlib.pylab as plt\n\n\nplt.ion()\nfig, ax = plt.subplots(1)\nplt.show()\n\na = Automator()\na.start()\n\ndef login_auth(ac,pwd):\n need_auth = a.login(ac=ac,pwd=pwd)\n if need_auth:\n a...
[ [ "matplotlib.pylab.subplots", "matplotlib.pylab.ion", "matplotlib.pylab.show" ] ]
tbenthompson/devito
[ "7ced4ba4ceca1680c68412172870b7a3c6e6d09a" ]
[ "tests/test_operator.py" ]
[ "import numpy as np\nimport pytest\nfrom itertools import permutations\n\nfrom conftest import skipif\nfrom devito import (Grid, Eq, Operator, Constant, Function, TimeFunction,\n SparseFunction, SparseTimeFunction, Dimension, error, SpaceDimension,\n NODE, CELL, dimensions, con...
[ [ "numpy.zeros_like", "numpy.array_equal", "numpy.asarray", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.allclose", "numpy.where", "numpy.arange", "numpy.all" ] ]
Yiman00/ibllib
[ "7fe5dcba1edd40ea05c974fe8b8584001c6c0c15" ]
[ "ibllib/io/spikeglx.py" ]
[ "import json\nimport logging\nfrom pathlib import Path\nimport re\n\nimport numpy as np\n\nimport mtscomp\nfrom brainbox.core import Bunch\nfrom ibllib.ephys import neuropixel as neuropixel\nfrom ibllib.io import hashfile\n\nSAMPLE_SIZE = 2 # int16\nDEFAULT_BATCH_SIZE = 1e6\n_logger = logging.getLogger('ibllib')\n...
[ [ "numpy.int8", "numpy.sum", "numpy.copy", "numpy.roll", "numpy.where", "numpy.float32", "numpy.memmap", "numpy.random.randint", "numpy.arange" ] ]
ZiqiuChi/vision
[ "b5ecf5431f7767d8920a69005e7822185ad31f81" ]
[ "flowvision/datasets/semeion.py" ]
[ "\"\"\"\n\"\"\"\nimport os\nimport os.path\nfrom typing import Any, Callable, Optional, Tuple\n\nimport numpy as np\nfrom PIL import Image\n\nfrom .utils import download_url, check_integrity\nfrom .vision import VisionDataset\n\n\nclass SEMEION(VisionDataset):\n r\"\"\"`SEMEION <http://archive.ics.uci.edu/ml/dat...
[ [ "numpy.loadtxt", "numpy.reshape", "numpy.nonzero" ] ]
akirallL/TurboTransformers
[ "7ca851947b1ae3b08122c45cea0ceac48ee04c3b" ]
[ "turbo_transformers/python/turbo_transformers/layers/modeling_distillbert.py" ]
[ "# Copyright (C) 2020 THL A29 Limited, a Tencent company.\n# All rights reserved.\n# Licensed under the BSD 3-Clause License (the \"License\"); you may\n# not use this file except in compliance with the License. You may\n# obtain a copy of the License at\n# https://opensource.org/licenses/BSD-3-Clause\n# Unless req...
[ [ "torch.cat", "torch.no_grad", "torch.ones", "torch.randint", "torch.cuda.is_available", "torch.tensor", "torch.t", "torch.onnx.export" ] ]
collassubmission91/CompoSuite-Code
[ "ac544efb68a11ed8a483b0932975c4949f0cec90" ]
[ "compositional-rl-benchmark/composition/spinningup_training/train_compositional_ppo_smallscale.py" ]
[ "from email.policy import default\nimport numpy as np\nimport argparse\nimport composition\nimport os\nimport json\n\nimport torch\n\nfrom spinup.algos.pytorch.ppo.compositional_core import CompositionalMLPActorCritic\nfrom spinup.algos.pytorch.ppo.ppo import ppo\nfrom spinup.utils.run_utils import setup_logger_kwa...
[ [ "numpy.random.seed", "torch.set_num_threads" ] ]
OoSnowfxm/AlphaZero_Othello
[ "3e94ac29dbac413502eb85628a0f8eb6d402d5e9" ]
[ "AlphaGoZero/code/Framework/Mcts.py" ]
[ "'''\n @Author: fxm\n @Date: Dec 27, 2020.\n @Title: Mcts class.\n'''\n\nimport logging\nimport math\nimport numpy as np\n\nEps = 1e-8\nlog = logging.getLogger(__name__)\n\n# 蒙特卡洛树搜索对象\nclass MCTS():\n '''\n 初始化过程\n 参数设置:\n game:游戏对象\n net:网络对象\n args:参数\n N(s,a...
[ [ "numpy.max", "numpy.sum", "numpy.random.choice" ] ]
gayatripk1/tvm
[ "8bf6cd5800daaf42935fd69cbd63180c97bef262" ]
[ "tests/python/contrib/test_hexagon/test_benchmark_elemwise_add.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.ndarray", "numpy.iinfo", "numpy.finfo" ] ]
hyyh28/tesp
[ "a77d9c228a6891b304e789ba2758a4cbfdb75ec0", "a77d9c228a6891b304e789ba2758a4cbfdb75ec0" ]
[ "ray/rllib/test/test_nested_spaces.py", "ray/rllib/agents/pg/pg_policy_graph.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport pickle\n\nfrom gym import spaces\nfrom gym.envs.registration import EnvSpec\nimport gym\nimport tensorflow.contrib.slim as slim\nimport tensorflow as tf\nimport unittest\n\nimport ray\nfrom ray....
[ [ "tensorflow.py_func", "tensorflow.contrib.slim.fully_connected", "tensorflow.control_dependencies" ], [ "tensorflow.get_default_session", "tensorflow.global_variables_initializer", "tensorflow.placeholder" ] ]