repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
brycecr/magenta
[ "24c14ca346506f31d789db35bb1b0173b7d97ce6", "24c14ca346506f31d789db35bb1b0173b7d97ce6" ]
[ "magenta/models/score2perf/datagen_beam.py", "magenta/models/onsets_frames_transcription/onsets_frames_transcription_create_tfrecords.py" ]
[ "# Copyright 2020 The Magenta 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 by applicable law o...
[ [ "tensorflow.compat.v1.gfile.Glob", "tensorflow.compat.v1.logging.info", "tensorflow.compat.v1.gfile.Remove", "numpy.cumsum" ], [ "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.io.gfile.makedirs", "tensorflow.compat.v1.io.gfile.glob", "tensorflow.compat.v1.io....
ljwolf/spenc
[ "d58f235606d6b567a59a405525d98792fc3b3dd7" ]
[ "spenc/abstracts.py" ]
[ "from sklearn import cluster as clust\nimport sklearn.metrics as skm\nimport sklearn.metrics.pairwise as pw\nfrom sklearn.utils.validation import check_array\nfrom .utils import check_weights\nfrom sklearn.neighbors import kneighbors_graph\nfrom sklearn.utils.extmath import _deterministic_vector_sign_flip\nfrom skl...
[ [ "numpy.ones_like", "numpy.argmin", "numpy.median", "numpy.min", "sklearn.utils.extmath._deterministic_vector_sign_flip", "numpy.random.normal", "numpy.flipud", "sklearn.base.clone", "numpy.vstack", "scipy.sparse.issparse", "sklearn.preprocessing.LabelEncoder", "nump...
shiwei23/ImageAnalysis3
[ "1d2aa1721d188c96feb55b22fc6c9929d7073f49", "1d2aa1721d188c96feb55b22fc6c9929d7073f49" ]
[ "classes/decode.py", "External/Fitting_v4.py" ]
[ "import os, glob, sys, time\nimport numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\nfrom scipy.spatial.distance import cdist\nfrom scipy.spatial import KDTree\n# local\nfrom .preprocess import Spots3D, SpotTuple\ndefault_pixel_sizes=[250,108,108]\ndefault_search_th = 150\ndefault_search_eps = 0.25\n\nclass...
[ [ "numpy.concatenate", "numpy.array", "numpy.setdiff1d", "scipy.spatial.KDTree", "numpy.where", "numpy.argmax", "numpy.sort", "numpy.argsort", "pandas.read_csv" ], [ "scipy.spatial.cKDTree", "numpy.dot", "numpy.argmin", "sklearn.linear_model.LinearRegression",...
YaronBenAtar/glow
[ "cda5383b1609ebad1a3631ca77b41b8a863443d4" ]
[ "torch_glow/tests/nodes/embedding_bag_test.py" ]
[ "# Copyright (c) Glow Contributors. See CONTRIBUTORS file.\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...
[ [ "torch.zeros", "numpy.zeros", "torch.ops.quantized.embedding_bag_4bit_prepack", "numpy.sum", "torch.FloatTensor", "torch.from_numpy", "numpy.random.random_sample", "torch.LongTensor", "numpy.random.randint", "torch.nn.EmbeddingBag.from_pretrained", "torch.ops.quantized....
Hikki12/remio
[ "17942bffe3c0619d3435b1a12399b116d4c800e3" ]
[ "examples/camera/tracker/utils.py" ]
[ "from typing import Union\nimport numpy as np\nimport cv2\nimport time\n\n\nclass Tracker(object):\n \"\"\"A color tracker.\n\n Args:\n limit_1: color limit 1\n limit_2: color limit 2\n ksize: kernel size\n \"\"\"\n\n def __init__(\n self,\n limit_1: list = [50, 30, 40...
[ [ "numpy.array" ] ]
angelvillar96/vp-suite
[ "3e7c7d852862bad09a771d754fc56a71abf0a25f" ]
[ "vp_suite/datasets/kitti_raw.py" ]
[ "import random\nfrom pathlib import Path\n\nimport cv2\nimport numpy as np\nimport torch\n\nfrom vp_suite.base.base_dataset import VPDataset, VPData\nimport vp_suite.constants as constants\nfrom vp_suite.utils.utils import set_from_kwarg\n\n\nclass KITTIRawDataset(VPDataset):\n r\"\"\"\n Dataset class for the...
[ [ "torch.zeros", "numpy.stack" ] ]
getyourguide/bamboo-coffee
[ "eb79de661ee229cf1893893e0f174f3351721563" ]
[ "bamboo_coffee.py" ]
[ "from PyBambooHR.PyBambooHR import PyBambooHR\nimport csv\nimport os\nimport pandas as pd\nimport smtplib\nfrom email.mime.multipart import MIMEMultipart\nfrom email.mime.text import MIMEText\nimport random\nimport statistics\nimport sys\nimport jinja2\nimport itertools\nimport configparser\n\n\ndef load_df():\n ...
[ [ "pandas.read_csv" ] ]
vmproj/conformer-vc
[ "224d330692cf3245c805bbf78c3e58a7805126d1" ]
[ "models/model.py" ]
[ "import torch.nn as nn\n\nfrom .common import RelPositionalEncoding, PostNet\nfrom .conformer import Conformer\nfrom .predictors import VarianceConverter\nfrom .utils import sequence_mask\n\n\nclass ConformerVC(nn.Module):\n def __init__(self, params):\n super(ConformerVC, self).__init__()\n\n self...
[ [ "torch.nn.Conv1d" ] ]
hassanmohsin/ligandnet2
[ "06cf02da8a4781b3c47892b47b449eb4d7c42a48" ]
[ "prediction/selleck_chem/predict.py" ]
[ "import numpy as np\nfrom sklearn.externals import joblib\nimport os\nimport json\n\nMODELS_DIR = \"../../models\"\nimport sys\n\nsys.path.append(\"../../../ddt/\")\nfrom utility import FeatureGenerator\n\nPY_VERSION = \"27\" if sys.version_info[0] < 3 else \"35\"\n\n# Extract features\nft = FeatureGenerator()\nft....
[ [ "numpy.any", "numpy.where", "numpy.array" ] ]
MatsuiLin101/aprp
[ "b015be3ce01683671453537beeb7b1db93d4b5e9" ]
[ "src/apps/hogs/tests/test_aggregate.py" ]
[ "import datetime\nfrom django.core.management import call_command\nfrom django.test import TestCase\nfrom apps.hogs.builder import direct\nfrom apps.dailytrans.models import DailyTran\nfrom django.db.models import Sum, F\nfrom pandas import DataFrame\n\n\nclass AggregationTestCase(TestCase):\n @classmethod\n ...
[ [ "pandas.DataFrame" ] ]
jsignell/holoviews
[ "4f9fd27367f23c3d067d176f638ec82e4b9ec8f0" ]
[ "holoviews/core/data/dask.py" ]
[ "from __future__ import absolute_import\n\ntry:\n import itertools.izip as zip\nexcept ImportError:\n pass\n\nimport numpy as np\nimport pandas as pd\nimport dask.dataframe as dd\nfrom dask.dataframe import DataFrame, Series\n\nfrom .. import util\nfrom ..dimension import Dimension\nfrom ..element import Elem...
[ [ "numpy.isnan", "numpy.isscalar" ] ]
jky88/OpenBot
[ "ebae990824534dcde6adad5b0bb8559bad23e710" ]
[ "policy/models.py" ]
[ "# Created by Matthias Mueller - Intel Intelligent Systems Lab - 2020\n\nimport tensorflow as tf\n\n\"\"\"\nConstructors for standard MLPs and CNNs\n\"\"\"\ndef create_cnn(width, height, depth, \n cnn_filters=(8, 12, 16, 20, 24), \n kernel_sz=(5, 5, 5, 3, 3), \n stride=(2,2...
[ [ "tensorflow.keras.layers.Flatten", "tensorflow.keras.Sequential", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "tensorflow.keras.Model", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.Input", "tensorflow.keras.layers.BatchNormalization", "tensorflow....
legislative-votes-br/parser
[ "e81b78757e581c758ea08d79c02d430946b79691" ]
[ "parser-data-to-sql.py" ]
[ "from pandas import DataFrame\nimport sqlalchemy\nimport constants\nimport json\nimport logging\nimport os\nfrom helpers import omit\nfrom functools import reduce\nfrom operator import concat\nfrom pydash import flatten, flatten_deep\n\n\nlogging.basicConfig(\n level=logging.INFO,\n format='[%(module)s-l.%(li...
[ [ "pandas.DataFrame" ] ]
adujardin/openpifpaf
[ "4fa79162f5529f5b0de72e2312aab54d410bee3f", "4fa79162f5529f5b0de72e2312aab54d410bee3f" ]
[ "openpifpaf/encoder/cif.py", "openpifpaf/transforms/rotate.py" ]
[ "import dataclasses\nimport logging\nfrom typing import ClassVar\n\nimport numpy as np\nimport torch\n\nfrom .annrescaler import AnnRescaler\nfrom .. import headmeta\nfrom ..visualizer import Cif as CifVisualizer\nfrom ..utils import create_sink, mask_valid_area\n\nLOG = logging.getLogger(__name__)\n\n\n@dataclasse...
[ [ "numpy.full", "numpy.linalg.norm", "numpy.isnan", "numpy.zeros", "numpy.round", "numpy.logical_and", "numpy.expand_dims" ], [ "torch.rand", "numpy.asarray", "scipy.ndimage.rotate", "numpy.swapaxes", "numpy.clip", "numpy.flip" ] ]
WenPeiyu/LianjiaSpider
[ "9d4fd31df0120c756fbbd625b66f2fee4fe17891" ]
[ "LogAnalysis/mpl.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib.colors import LogNorm\nZ = np.random.rand(6, 10)\n\nfig, (ax0, ax1) = plt.subplots(2, 1)\n\nc = ax0.pcolor(Z)\nax0.set_title('default: no edges')\n\nc = ax1.pcolor(Z, edgecolors='k', linewidths=4)\nax1.set_title('thick edges')\n\nfig.tight_layout...
[ [ "matplotlib.pyplot.show", "numpy.random.rand", "matplotlib.pyplot.subplots" ] ]
Msmhasani/cflow-ad
[ "bc8bcf796723ba885587a72a6fbbf45ecb4b7bf4" ]
[ "train.py" ]
[ "import os, time\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom sklearn.metrics import roc_auc_score, auc, precision_recall_curve\nfrom skimage.measure import label, regionprops\nfrom tqdm import tqdm\nfrom visualize import *\nfrom model import load_decoder_arch, load_encoder_arch, positio...
[ [ "torch.randperm", "torch.exp", "numpy.max", "numpy.zeros_like", "sklearn.metrics.precision_recall_curve", "numpy.logical_and", "torch.tensor", "torch.utils.data.DataLoader", "numpy.argmax", "numpy.logical_or", "numpy.array", "torch.max", "sklearn.metrics.roc_auc...
danielballan/matplotlib
[ "d8de9d5cdf37dccee324a20d609e348dab6373d3" ]
[ "lib/matplotlib/rcsetup.py" ]
[ "\"\"\"\nThe rcsetup module contains the default values and the validation code for\ncustomization using matplotlib's rc settings.\n\nEach rc setting is assigned a default value and a function used to validate\nany attempted changes to that setting. The default values and validation\nfunctions are defined in the rc...
[ [ "matplotlib.fontconfig_pattern.parse_fontconfig_pattern", "matplotlib.colors.is_color_like" ] ]
brandon-debruyn/project_machine_learning
[ "92563971b88481d372302ed0ffc6add12cebab87" ]
[ "external/ext_functions.py" ]
[ "import csv\nimport pandas as pd\nimport os\nimport numpy as np\n\nfrom zlib import crc32 # Cyclic Redundancy Check (32bit) for implementing checksums \n\ndef check_test_data(id, test_ratio=0.20):\n # starting value for checksum is the instance provided, as a 64 bit np integer object\n return crc32(np.int64(i...
[ [ "numpy.int64" ] ]
DSIP-UPatras/PhyCS2018_paper
[ "1d9a17e345122944bc1bc8b48d8d56df14d33c4c" ]
[ "generator.py" ]
[ "# Based on https://stanford.edu/~shervine/blog/keras-how-to-generate-data-on-the-fly.html\n\nimport numpy as np\nimport keras\nimport scipy.io, scipy.signal\nimport data_augmentation as da\n\nclass DataGenerator(keras.utils.Sequence):\n \n def __init__(self, repetitions, input_directory, batch_size=32, sampl...
[ [ "numpy.max", "numpy.empty", "numpy.reshape", "numpy.zeros", "numpy.random.choice", "numpy.copy", "numpy.random.shuffle", "numpy.prod", "numpy.squeeze" ] ]
Jeffwan/deep-learning-models
[ "d21e9fa72e205f44510e7b8a5a168f04df711e63" ]
[ "models/resnet/tensorflow/train_imagenet_resnet_hvd.py" ]
[ "#!/usr/bin/env python\n# Copyright (c) 2018, NVIDIA 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\n# are met:\n# * Redistributions of source code must retain the above copyright\n# ...
[ [ "tensorflow.group", "tensorflow.ones_like", "tensorflow.zeros_like", "tensorflow.clip_by_value", "tensorflow.stack", "tensorflow.image.decode_jpeg", "tensorflow.parse_single_example", "tensorflow.random_normal_initializer", "tensorflow.argmax", "tensorflow.TensorShape", ...
jpchen/pyro-models
[ "b9e6ae6271e6cd622fbb4d34d67c450d5a954c9b", "b9e6ae6271e6cd622fbb4d34d67c450d5a954c9b", "b9e6ae6271e6cd622fbb4d34d67c450d5a954c9b", "b9e6ae6271e6cd622fbb4d34d67c450d5a954c9b" ]
[ "pyro_models/arm/radon_vary_intercept_nofloor_chr.py", "pyro_models/arm/y_x.py", "pyro_models/arm/radon_no_pool.py", "pyro_models/arm/ideo_reparam.py" ]
[ "# Copyright Contributors to the Pyro project.\n# SPDX-License-Identifier: Apache-2.0\n\n# model file: example-models/ARM/Ch.21/radon_vary_intercept_nofloor_chr.stan\nimport torch\nimport pyro\nimport pyro.distributions as dist\n\ndef init_vector(name, dims=None):\n return pyro.sample(name, dist.Normal(torch.zer...
[ [ "torch.zeros", "torch.ones" ], [ "torch.zeros", "torch.ones" ], [ "torch.zeros", "torch.ones" ], [ "torch.zeros", "torch.ones" ] ]
ua-snap/downscale
[ "3fe8ea1774cf82149d19561ce5f19b25e6cba6fb", "3fe8ea1774cf82149d19561ce5f19b25e6cba6fb" ]
[ "snap_scripts/downscaling_v2/downscale_cru_tem.py", "snap_scripts/epscor_sc/temp_metrics_cmip5_testing_epscor_sc.py" ]
[ "# downscale cru data in a CLI way\n\nif __name__ ==\t'__main__':\n\timport glob, os, itertools, rasterio\n\tfrom downscale import DeltaDownscale, Baseline, Dataset, utils, Mask\n\tfrom functools import partial\n\timport numpy as np\n\timport argparse\n\n\t# parse the commandline arguments\n\tparser = argparse.Argu...
[ [ "numpy.ma.masked_array" ], [ "matplotlib.use", "numpy.asarray", "pandas.DataFrame", "matplotlib.pyplot.close", "numpy.mean" ] ]
ykwang1/PypeIt
[ "a96cff699f1284905ce7ef19d06a9027cd333c63", "a96cff699f1284905ce7ef19d06a9027cd333c63" ]
[ "pypeit/core/wavecal/autoid.py", "pypeit/spectrographs/vlt_xshooter.py" ]
[ "\"\"\" Module for finding patterns in arc line spectra\n\"\"\"\nfrom scipy.ndimage.filters import gaussian_filter\nfrom scipy.spatial import cKDTree\nimport itertools\nimport scipy\nfrom linetools import utils as ltu\nfrom astropy import table, stats\nimport copy\nimport numpy as np\nfrom IPython import embed\n\nf...
[ [ "scipy.spatial.cKDTree", "numpy.array_equal", "numpy.argmin", "numpy.median", "scipy.ndimage.filters.gaussian_filter", "numpy.min", "numpy.where", "numpy.linalg.lstsq", "matplotlib.pyplot.xticks", "numpy.max", "numpy.concatenate", "numpy.zeros_like", "matplotlib...
Chloejay/image_caption_app
[ "9d3ed9f7fff13ae8d13c2e5e0ae542a537c76ce8" ]
[ "model/bbox.py" ]
[ "import os\nimport glob\nimport pandas as pd\nimport xml.etree.ElementTree as ET\n\n\ndef xml_to_csv(path):\n xml_list = []\n for xml_file in glob.glob(path + '/*.xml'):\n tree = ET.parse(xml_file)\n root = tree.getroot()\n for member in root.findall('object'):\n value = (root....
[ [ "pandas.DataFrame" ] ]
micheleFraccaroli/autokeras
[ "4c0e36dc0a5418355952dd74f74b2b6e7e87ebf1", "4c0e36dc0a5418355952dd74f74b2b6e7e87ebf1" ]
[ "autokeras/graph.py", "autokeras/blocks/preprocessing.py" ]
[ "# Copyright 2020 The AutoKeras 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 by applicable law...
[ [ "tensorflow.keras.optimizers.SGD", "tensorflow.keras.optimizers.schedules.PolynomialDecay", "tensorflow.keras.utils.custom_object_scope", "tensorflow.keras.Model", "tensorflow.python.util.nest.flatten", "tensorflow.keras.optimizers.Adam" ], [ "tensorflow.keras.layers.experimental.p...
adc21/asva
[ "b94db4aa41ee10ef1991ed4f042c91d9e310a1e1" ]
[ "asva/dampers/iRDT.py" ]
[ "\"\"\"iRDT\"\"\"\nfrom typing import Tuple, TypedDict\nimport copy\nimport numpy as np\nfrom asva.dampers.Damper import Damper\n\nclass iRDTType(TypedDict):\n md: float\n cd: float\n alpha: float\n kb: float\n fr: float\n cosA: float\n\n# ==========================================================...
[ [ "numpy.diag", "numpy.zeros", "numpy.size" ] ]
vd1371/XProject
[ "6c00736a6319b2a5310751c8f7ae2f9cfa2bd667" ]
[ "classifiers/BoostingClassifier.py" ]
[ "#Loading dependencies\nimport numpy as np\nimport pandas as pd\nimport joblib\nimport pprint\n\nfrom utils.BaseModel import BaseModel\nfrom utils.AwesomeTimeIt import timeit\nfrom utils.FeatureImportanceReport import report_feature_importance\nfrom utils.ClassificationReport import evaluate_classification\nfrom ut...
[ [ "pandas.get_dummies" ] ]
zmoon/scipy-lecture-notes
[ "75a89ddedeb48930dbdb6fe25a76e9ef0587ae21" ]
[ "intro/numpy/examples/plot_mandelbrot.py" ]
[ "\"\"\"\nMandelbrot set\n==============\n\nCompute the Mandelbrot fractal and plot it\n\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom numpy import newaxis\n\ndef compute_mandelbrot(N_max, some_threshold, nx, ny):\n # A grid of c-values\n x = np.linspace(-2, 1, nx)\n y = np.linspace(-1....
[ [ "numpy.warnings.catch_warnings", "matplotlib.pyplot.gray", "numpy.warnings.simplefilter", "matplotlib.pyplot.show", "numpy.linspace", "matplotlib.pyplot.imshow" ] ]
AyrtonB/xarray
[ "ff6b1f542e52dc330e294fd367f846e02c2955a2" ]
[ "xarray/core/duck_array_ops.py" ]
[ "\"\"\"Compatibility module defining operations on duck numpy-arrays.\n\nCurrently, this means Dask or NumPy arrays. None of these functions should\naccept or return xarray objects.\n\"\"\"\nimport contextlib\nimport datetime\nimport inspect\nimport warnings\nfrom distutils.version import LooseVersion\nfrom functoo...
[ [ "numpy.array", "numpy.asarray", "pandas.to_timedelta", "numpy.timedelta64", "numpy.gradient" ] ]
synml/motion-detector
[ "5c78565db0be6bfb7fb4920e501e46eacd5c2229" ]
[ "final_rasp_main.py" ]
[ "import multiprocessing as mp\nimport sys\nimport time\nimport os\nimport cv2\nimport numpy as np\nfrom PyQt5 import QtWidgets, QtGui, QtCore\nfrom PyQt5 import uic\nimport RPi.GPIO as GPIO\n\nGPIO.setmode(GPIO.BCM)\nalert = 24\nGPIO.setup(alert, GPIO.OUT)\n\nidleTime = 10 # second\nthreshold = 1.6\n\nlabel_w = 80...
[ [ "numpy.abs" ] ]
talashilkarraj/spydrnet-physical
[ "d13bcbb0feef7d5c93aa60af4a916f837128a5ad" ]
[ "examples/OpenFPGA/partition/02_switch_partition_01.py" ]
[ "\"\"\"\n=====================\nPartition Conn Box 01\n=====================\n\nThis example demonstrate how pre-tech mapped netlist of connection box \ncan be partition based on mux connection patterns. \n\n1. Calculate difference beetween top and bottom switches on each channels \n2. Sort each channel based on di...
[ [ "numpy.set_printoptions", "numpy.vstack" ] ]
visionscaper/sru
[ "6e0038ec675be0a37d870865f7f8fa22f1ad2254" ]
[ "test/regression/test_regression.py" ]
[ "\"\"\"\ntest:\n- running some numbers through two versions of sru, checking they come out the sam\n- save sru in older version, and loading in new version\n\n\"\"\"\nimport torch\nimport sru\nimport pytest\nimport sys\n\n\nEPSILON = 1e-6\n\n\nARTIFACT_DIR = 'test/regression/artifacts'\n\n\n@pytest.mark.parametrize...
[ [ "torch.manual_seed", "torch.no_grad", "torch.load" ] ]
Quansight/ibis-benchmark
[ "63d1175c87c96c3a50cefb4090ce55dc6e8341bb" ]
[ "ibis_benchmark/nyc_taxi/_benchmark_nyc_taxi.py" ]
[ "\"\"\"\nThis module will run a benchmark for expressions related to NYC TAXI dataset.\n\nThe available fields are:\n\n * VendorID\n * tpep_pickup_datetime\n * tpep_dropoff_datetime\n * passenger_count\n * trip_distance\n * RatecodeID\n * store_and_fwd_flag\n * PULocationID\n * DOLocation...
[ [ "pandas.read_csv" ] ]
itsmjoe/tytus
[ "3b0341cc854d67979b766c5c8b06ed172ce0c913" ]
[ "parser/team08/Tytus_SQLPARSER_G8/Instrucciones/Sql_update/UpdateTable.py" ]
[ "from Instrucciones.Excepcion import Excepcion\nfrom Instrucciones.TablaSimbolos.Instruccion import Instruccion\nfrom Instrucciones.Sql_select.SelectLista import Alias\nfrom storageManager.jsonMode import *\nfrom Instrucciones.Sql_create.Tipo_Constraint import Tipo_Dato_Constraint\nimport numpy as np\n\nclass Updat...
[ [ "numpy.array" ] ]
pdimh/cnnface
[ "07deac23f89671da4323f596907f6aa0183521ec" ]
[ "src/model/__init__.py" ]
[ "import tensorflow as tf\n\n\n# @tf.autograph.experimental.do_not_convert\ndef loss_box(yt, yp):\n\n idx = yt[:, 2] * yt[:, 3] != 0\n yt_n = tf.cast(yt, 'float32')\n yp_n = tf.reshape(yp, [tf.shape(yp)[0], tf.shape(yp)[-1]])\n res = (yp_n - yt_n) ** 2\n res = tf.reduce_sum(res, axis=1)\n return tf...
[ [ "tensorflow.shape", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.math.log" ] ]
RosselHerrera/rnn-py-keras
[ "2c79daeb0240a7f48c3de939fd49b7af911c7db6" ]
[ "rnnpykeras/rnn.1.py" ]
[ "# Crea tu primer MLP en Keras\r\nfrom keras.models import Sequential\r\nfrom keras.layers import Dense\r\nimport numpy\r\n# Fija las semillas aleatorias para la reproducibilidad\r\nnumpy.random.seed(7)\r\n# carga los datos\r\ndataset = numpy.loadtxt(\"pima-indians-diabetes.csv\", delimiter=\",\")\r\n# dividido en ...
[ [ "numpy.random.seed", "numpy.loadtxt" ] ]
balajich/data-science-crash-course
[ "65e7c05c1833b5f153986466655b9c86d18c68c6" ]
[ "Part_00_Introduction/01_first_model.py" ]
[ "# import necessary libraries\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\n# Data Extraction - Reading dataset from csv file\ndataset = pd.read_csv('00_first_model_data.csv', header=None)\n\n# Create independent variable\nX = dataset.iloc[:, 0].values\n\n# Create dependent variable\n...
[ [ "numpy.array", "sklearn.linear_model.LinearRegression", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.scatter", "pandas.read_csv" ] ]
mkucijan/ray
[ "48ecb1f88a89c3894e2a92d66d89d3965c179ecd" ]
[ "python/ray/tune/tests/test_trial_scheduler.py" ]
[ "from collections import Counter\nimport os\nimport json\nimport random\nimport unittest\nimport time\n\nimport numpy as np\nimport sys\nimport tempfile\nimport shutil\nfrom unittest.mock import MagicMock\n\nimport ray\nfrom ray import tune\nfrom ray.tune import Trainable\nfrom ray.tune.result import TRAINING_ITERA...
[ [ "numpy.ceil" ] ]
benvial/gyptis
[ "3f197fe33d0a0bac72be05a474baff4e450af0ab" ]
[ "src/gyptis/spharm.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Author: Benjamin Vial\n# License: MIT\n\n\n\"\"\"\nScattering Matrix calculations for a scatterer.\n\nSee:\nDemésy, G., Auger, J.-C. & Stout, B. Scattering matrix of arbitrarily shaped\nobjects: combining finite elements and vector partial waves.\nJ. Opt. Soc. Am. ...
[ [ "scipy.special.yv", "scipy.special.jv" ] ]
Phylliade/vinci0
[ "c4e4283ccdeca8261e6ead199fb2af3e4ef4742d" ]
[ "rl/callbacks.py" ]
[ "from __future__ import division\nfrom __future__ import print_function\nimport warnings\nimport timeit\nimport json\n\nimport numpy as np\n\nfrom keras.callbacks import Callback as KerasCallback, CallbackList as KerasCallbackList\nfrom keras.utils.generic_utils import Progbar\n\n\nclass Callback(KerasCallback):\n ...
[ [ "numpy.max", "numpy.array", "numpy.isnan", "numpy.sum", "numpy.min", "numpy.mean", "numpy.nanmean", "numpy.argsort", "numpy.log10" ] ]
enesyugan/yapay-nn
[ "b6e0740e7c1ae829abd7cd1bd447a172291538b1" ]
[ "src/pynn/net/s2s_lstm_8bit.py" ]
[ "# Copyright 2019 Thai-Son Nguyen\n# Licensed under the Apache License, Version 2.0 (the \"License\")\n\nimport random\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\n\nfrom . import freeze_module\nfrom . import Xavie...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.Dropout", "torch.nn.LSTM", "torch.log_softmax", "torch.nn.Sequential", "torch.nn.Conv2d", "torch.nn.utils.rnn.pad_packed_sequence", "torch.nn.Embedding" ] ]
NGeorgescu/numpy
[ "593ef5fc5a02fbcd6eeb70a59684b3b21c9cc643", "593ef5fc5a02fbcd6eeb70a59684b3b21c9cc643" ]
[ "numpy/distutils/setup.py", "numpy/core/tests/test_multiarray.py" ]
[ "#!/usr/bin/env python3\ndef configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('distutils', parent_package, top_path)\n config.add_subpackage('command')\n config.add_subpackage('fcompiler')\n config.add_subpackage('tests')\n...
[ [ "numpy.distutils.core.setup", "numpy.distutils.misc_util.Configuration" ], [ "numpy.int8", "numpy.random.rand", "numpy.core._multiarray_tests.get_c_wrapping_array", "numpy.random.choice", "numpy.testing.temppath", "numpy.tile", "numpy.core.numeric.set_string_function", ...
dakhouya/GamestonkTerminal
[ "006b3570b795215a17c64841110b649b03db9a98", "006b3570b795215a17c64841110b649b03db9a98", "006b3570b795215a17c64841110b649b03db9a98", "006b3570b795215a17c64841110b649b03db9a98" ]
[ "gamestonk_terminal/etf/prediction_techniques/pred_controller.py", "gamestonk_terminal/common/prediction_techniques/mc_view.py", "gamestonk_terminal/alternative/covid/covid_view.py", "gamestonk_terminal/cryptocurrency/pycoingecko_helpers.py" ]
[ "\"\"\" Prediction Controller \"\"\"\n__docformat__ = \"numpy\"\n\nimport argparse\nfrom typing import List\nfrom datetime import datetime, timedelta\nimport pandas as pd\nimport numpy as np\nfrom prompt_toolkit.completion import NestedCompleter\n\nfrom gamestonk_terminal.parent_classes import BaseController\nfrom ...
[ [ "numpy.log" ], [ "numpy.max", "matplotlib.pyplot.ion", "matplotlib.dates.DateFormatter", "pandas.date_range", "numpy.min", "matplotlib.pyplot.show" ], [ "matplotlib.pyplot.show", "matplotlib.dates.DateFormatter", "matplotlib.pyplot.ion", "pandas.concat" ], [...
kathir-t/EmailCopier
[ "aff833270bb70cdd2fd96227e1817e8b573453ea" ]
[ "email_copier.py" ]
[ "import pandas as pd\nimport clipboard\nimport math\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"csv\", help=\"Name of the CSV file\", type=str)\nparser.add_argument(\"column\", help=\"Name of the column you want to copy\", type=str)\nparser.add_argument(\"copy_count\", help=\"Numbe...
[ [ "pandas.read_csv" ] ]
rtygbwwwerr/innvestigate
[ "697e21aa6f37f1bf8ba330a9ff7096de3cf5c1f1" ]
[ "innvestigate/utils/visualizations.py" ]
[ "# Begin: Python 2/3 compatibility header small\n# Get Python 3 functionality:\nfrom __future__ import\\\n absolute_import, print_function, division, unicode_literals\nfrom future.utils import raise_with_traceback, raise_from\n# catch exception with: except Exception as e\nfrom builtins import range, map, zip, f...
[ [ "numpy.zeros_like", "numpy.asarray", "numpy.percentile", "numpy.invert", "numpy.abs", "numpy.select", "matplotlib.pyplot.cm.get_cmap" ] ]
NasTul/models
[ "4fabd84c5c5e2b34a1b95431788f7801de036421", "4fabd84c5c5e2b34a1b95431788f7801de036421", "4fabd84c5c5e2b34a1b95431788f7801de036421" ]
[ "research/object_detection/model_lib_v2.py", "official/vision/beta/projects/panoptic_maskrcnn/tasks/panoptic_maskrcnn_test.py", "official/vision/beta/projects/yolo/dataloaders/tf_example_decoder.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.compat.v1.compat.v2.train.Checkpoint", "tensorflow.compat.v1.logging.info", "numpy.median", "tensorflow.compat.v1.clip_by_global_norm", "tensorflow.compat.v1.nest.map_structure", "tensorflow.compat.v1.shape", "numpy.mean", "tensorflow.compat.v1.compat.v2.train.Checkpoin...
jalalium/pyccel
[ "4f3d9a359e42c16440e9c841059257d292a8361b" ]
[ "tests/pyccel/scripts/arrays_view.py" ]
[ "# pylint: disable=missing-function-docstring, missing-module-docstring/\nimport numpy as np\nfrom pyccel.decorators import allow_negative_index\n\ndef array_view():\n a = np.array([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]])\n b = a[:, :]\n for i in range(2):\n for j in range(5):\n print(b[i][j]...
[ [ "numpy.array", "numpy.shape" ] ]
zestyoreo/Coursera_Courses
[ "455d3bc45f66c612a4abc45b7bbdca8be63e22cd" ]
[ "DL Specialization/Course3 (Convolutional Neural Networks)/W1/A1/public_tests.py" ]
[ "import numpy as np\nfrom test_utils import single_test, multiple_test\nfrom outputs import *\n\n\ndef zero_pad_test(target):\n np.random.seed(1)\n x = np.random.randn(4, 3, 3, 2)\n pad = 2\n expected_output = expected_output = np.array(zero_pad_output0)\n\n test_cases = [\n {\n \"n...
[ [ "numpy.random.seed", "numpy.array", "numpy.float64", "numpy.random.randn" ] ]
mehta-lab/recOrder
[ "67f2edb9ab13114dfe41d57e465ae24f961b0004" ]
[ "recOrder/postproc/post_processing.py" ]
[ "from scipy.ndimage import affine_transform\nimport numpy as np\nfrom waveorder.util import wavelet_softThreshold\n\n\ndef post_proc_denoise(data_volume, params):\n\n data_volume_denoised = np.copy(data_volume)\n\n if len(data_volume) == 1:\n data_volume_denoised = wavelet_softThreshold(data_volume[0],...
[ [ "scipy.ndimage.affine_transform", "numpy.copy", "numpy.asarray" ] ]
Paulinos739/DeepPattern
[ "259ffa49756c32d7ca1b65b998926267255a1a86" ]
[ "predictions/visualize_patterns.py" ]
[ "\"\"\"September 2020 for Forschungsmodul SoSe 20 at the DDU at TU Darmstadt\"\"\"\n\n'@author: Paul Steggemann (github@ Paulinos739)'\n\n'This program tests a pretrained DNN Classification model on a floor plan image'\n'and visualizes the predicted output through footers which are pasted onto the image'\n\n\"\"\n\...
[ [ "numpy.array", "numpy.ndarray.tolist", "numpy.expand_dims" ] ]
dtklinh/Protein-Rigid-Domains-Estimation
[ "a27152ef5437eb87ee31c317091356c4787f82a4" ]
[ "venv/lib/python3.5/site-packages/MDAnalysis/topology/PSFParser.py" ]
[ "# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-\n# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 \n#\n# MDAnalysis --- https://www.mdanalysis.org\n# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors\n# (see the file AUTHORS for the full list of names)\n#\n# Rel...
[ [ "numpy.zeros" ] ]
Thesys-lab/learned-coded-computation
[ "c5c32bcfb7cc4a9f52079f648373e6972c19eff9" ]
[ "base_models/resnet.py" ]
[ "\"\"\"\nResNet adapted from:\n https://github.com/kefth/fashion-mnist\n\"\"\"\nimport math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\ndef conv3x3(in_planes, out_planes, stride=1):\n \"3x3 convolution with padding\"\n return nn.Conv2d(in_planes, out_planes, kernel_size=3, st...
[ [ "torch.nn.Linear", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
DanielChuDC/yolov5-fastapi
[ "27eef7d52cf72cda0c14856a745a8798d51d9383" ]
[ "segmentation.py" ]
[ "import torch\nfrom PIL import Image\nimport io\n\n\ndef get_yolov5():\n # local best.pt\n model = torch.hub.load('./yolov5', 'custom', path='./model/best.pt', source='local') # local repo\n model.conf = 0.5\n return model\n\n\ndef get_image_from_bytes(binary_image, max_size=1024):\n input_image = I...
[ [ "torch.hub.load" ] ]
ar90n/lightning-flash
[ "61e1a2d3b72f8fbbffe6ace14fb5b5bb35c5f131" ]
[ "tests/image/embedding/test_model.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.Size", "torch.rand", "torch.cuda.device_count" ] ]
anitagraser/py
[ "84f4102b96380a3acbe533ed4820427676ba226e" ]
[ "code/chapters/05-geometry-operations.py" ]
[ "# ---\n# jupyter:\n# jupytext:\n# text_representation:\n# extension: .py\n# format_name: light\n# format_version: '1.5'\n# jupytext_version: 1.13.8\n# kernelspec:\n# display_name: Python 3 (ipykernel)\n# language: python\n# name: python3\n# ---\n\n# # Geometry operations...
[ [ "matplotlib.pyplot.subplots" ] ]
joshfuchs/ZZCeti_analysis
[ "1674e4c69f0e9aa28989a4b202eb8f2f00d4d84f" ]
[ "logg_teff_plot.py" ]
[ "'''\nWritten by JT Fuchs, UNC - Chapel Hill\n\nRead in fitting_solutions.txt file and plot all the solutions in the logg-Teff plane.\n\n'''\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\n'''\nfitting_solutions.txt contains: blue filename, red filenames, best model, best Teff, best logg, FWHM, best chi-s...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.ylim", "numpy.genfromtxt", "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "matplotlib.pyplot.clf" ] ]
sbrugman/histogrammar-python
[ "33cb32a01c2eb1a72d0978c65850e03101548c69", "33cb32a01c2eb1a72d0978c65850e03101548c69" ]
[ "histogrammar/primitives/sparselybin.py", "histogrammar/primitives/irregularlybin.py" ]
[ "#!/usr/bin/env python\n\n# Copyright 2016 DIANA-HEP\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 ap...
[ [ "numpy.divide", "numpy.array", "numpy.isnan", "numpy.empty", "numpy.isposinf", "numpy.not_equal", "numpy.isneginf", "numpy.subtract", "numpy.bitwise_not", "numpy.linspace", "numpy.unique", "numpy.floor" ], [ "numpy.concatenate", "numpy.array", "numpy...
longma2019/fast-reid
[ "57ee0ebca4cb67e90806ee988364a58a737a3301" ]
[ "fastreid/utils/events.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport datetime\nimport json\nimport logging\nimport os\nfrom collections import defaultdict\nfrom contextlib import contextmanager\nimport torch\nfrom .file_io import PathManager\nfrom .history_buffer import HistoryBuffer\n\n_CURRENT_STORAGE_...
[ [ "torch.cuda.max_memory_allocated", "torch.cuda.is_available", "torch.utils.tensorboard.SummaryWriter" ] ]
WhiteDOU/DNN_Pruning
[ "bb84c9161ae8e2602ae00b0e6a4907a55f74a01f" ]
[ "final.py" ]
[ "import torch.optim as optim\nimport torch.utils.data\nimport torch.backends.cudnn as cudnn\nimport torchvision\nfrom torchvision import transforms as transforms\nimport numpy as np\nimport glob\nfrom collections import OrderedDict\nimport multiprocessing\nfrom torch import nn\nfrom utils import load_model_dict\nfr...
[ [ "numpy.percentile", "numpy.linspace" ] ]
ferdinandhuang/mnist_test
[ "eabe568ff6a4f3db148538bf2bd075a47f30a595" ]
[ "Linear_Regression/manual.py" ]
[ "import sys\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nsys.path.append('../')\n\nfrom loadmnist import load\nloadfnc = load('../mnist')\n# load data\n# train_images, train_labels, test_images, test_labels = load('../mnist').load_mnist()\n# print('train_images shape:%s' % str(train_images.shape))\n# pri...
[ [ "numpy.zeros_like", "numpy.dot", "numpy.zeros", "numpy.log", "numpy.sum", "numpy.random.randn", "numpy.exp", "numpy.tanh", "numpy.where" ] ]
flor14/strapvizpy
[ "24338c466308a96131834ea0b621daee38ace90a" ]
[ "src/strapvizpy/display.py" ]
[ "import os\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom strapvizpy.bootstrap import calculate_boot_stats\n\n\ndef plot_ci(sample, rep, bin_size=30, n=\"auto\", ci_level=0.95,\n ci_random_seed=None, title=\"\", x_axis=\"Bootstrap Sample Mean\", \n y_axis=\"Cou...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.hist", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.axvline", "matplotlib.pyplot.gca" ] ]
aouelete/glio
[ "89cdff704c4751036688ff87ab7c359c4617b352" ]
[ "fortranio.py" ]
[ "import numpy as np\n\nclass FortranIOException(Exception):\n \"\"\"Base class for exceptions in the fortranio module.\"\"\"\n def __init__(self, message):\n super(FortranIOException, self).__init__(message)\n\nclass FortranFile(object):\n \"\"\"\n A class for reading from, or writing to, a file ...
[ [ "numpy.array", "numpy.iinfo", "numpy.dtype", "numpy.fromfile" ] ]
ConorPQuinn/NengoDecimal
[ "ef798db409417b23da6dcda761654b93a2b44342" ]
[ "nengo/spa/assoc_mem.py" ]
[ "import numpy as np\n\nimport nengo\nfrom nengo.dists import Choice, Uniform\nfrom nengo.networks.ensemblearray import EnsembleArray\nfrom nengo.spa.module import Module\nfrom nengo.spa.vocab import Vocabulary\nfrom nengo.utils.compat import is_iterable\n\n\nclass AssociativeMemory(Module):\n \"\"\"Associative m...
[ [ "numpy.matrix", "numpy.ones", "numpy.eye" ] ]
ashahba/models
[ "c08d1ea02083814d3a31f9695c5bbf5c7704a8a7" ]
[ "models/language_translation/tensorflow/transformer_mlperf/inference/fp32/transformer/export_transformer.py" ]
[ "#! /usr/bin/env python\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport argparse\nimport sys\n\nimport tensorflow as tf\nfrom model import model_params\nfrom model import transformer\n\ntf.compat.v1.disable_v2_behavior()\n\n_EXTR...
[ [ "tensorflow.compat.v1.placeholder", "tensorflow.train.latest_checkpoint", "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.train.Saver", "tensorflow.compat.v1.variable_scope", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.logging.set_verbosity", "tensorflow...
ssmith00/turbo_seti
[ "40c2dfb567b46e97d79c372cb4f4a868ff388ee3" ]
[ "setup.py" ]
[ "# To increment version\n# Check you have ~/.pypirc filled in\n# git tag x.y.z\n# git push && git push --tags\n# rm -rf dist; python setup.py sdist bdist_wheel\n# auditwheel repair dist/*.whl -w dist/ (Linux)\n# TEST: twine upload --repository-url https://test.pypi.org/legacy/ dist/*\n# twine upload dist/*\n\nfrom ...
[ [ "numpy.get_include" ] ]
manuelcaeiro/locaton-map
[ "011bb2794975e77a33d410a23f501358d242d5c7" ]
[ "nuclear_waste_on_campuses.py" ]
[ "import folium\r\nfrom folium.plugins import MarkerCluster\r\nimport pandas as pd\r\n\r\n# Load data\r\ndata = pd.read_csv(\"Nuclear_Waste_Sites_on_US_Campuses.csv\")\r\nlat = data['lat']\r\nlon = data['lon']\r\nname = data['text']\r\n\r\n# Create a base map\r\nmap = folium.Map(location=[37.000000,-96.000000], zoom...
[ [ "pandas.read_csv" ] ]
annnvv/hiking_upward_recommender
[ "1f111626bdcde4887abc783204c5e14f0e400692" ]
[ "app/streamlit_app.py" ]
[ "from numpy import float16\nimport streamlit as st\nimport pandas as pd\n\nst.set_page_config(page_title=\"Hiking Upward Recommender\", layout=\"wide\")\n\nst.title(\"Hiking Upward Recommender\")\n\nst.header(\"Input\")\nst.write(\n \"Please visit [Hiking Upward](https://www.hikingupward.com/maps/) to choose a h...
[ [ "pandas.read_csv", "pandas.merge" ] ]
NeuroDataDesign/DF-CNN
[ "d23afd8acb2eec22b48f64b2c66bd0efc0d1539a" ]
[ "classification/train.py" ]
[ "import os, sys\r\nimport timeit\r\nfrom random import shuffle\r\n\r\nimport numpy as np\r\nimport tensorflow as tf\r\nfrom scipy.io import savemat\r\n\r\nfrom utils.utils import savemat_wrapper\r\nif sys.version_info.major < 3:\r\n from gen_data import mnist_data_print_info, cifar_data_print_info, officehome_da...
[ [ "numpy.array", "tensorflow.Session", "tensorflow.reset_default_graph", "scipy.io.savemat", "tensorflow.ConfigProto", "numpy.amax", "numpy.random.randint", "tensorflow.summary.FileWriter", "tensorflow.global_variables_initializer" ] ]
Swaraj-Deep/UAV-GRN-DRN
[ "f18fe05751794bc7530b58312f6fadacb1e4a500" ]
[ "plot_graph.py" ]
[ "import os\nimport os.path\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef get_points():\n \"\"\"\n Function: get_points\\n\n Parameters: None\\n\n Returns: list of tuples containing coordinate points\\n\n \"\"\"\n parent_dir = os.getcwd()\n dir_name = 'analysis_output_files'\n ...
[ [ "matplotlib.pyplot.clf", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter" ] ]
gvevance/gm_over_id
[ "eae4a9e20b547a136dc6777d4f1708cb3aba2ea9" ]
[ "Demo/nmos_opsearch.py" ]
[ "# This program is designed to help the IC designer to choose \n# transistor sizes upon inputting the required device parameters \n# (mainly small signal parameters). Will probably involve some \n# efficient DSA search algorithm and some efficient file handling.\n\nfrom subprocess import call\nimport os\nimport num...
[ [ "numpy.genfromtxt" ] ]
athon-millane/uncertainty-baselines
[ "aa504fc51aac6d4cac47dbd34aa672c670dfbd28" ]
[ "baselines/toxic_comments/utils.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Uncertainty Baselines 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# Unles...
[ [ "tensorflow.io.gfile.GFile", "numpy.array", "tensorflow.train.load_variable", "tensorflow.train.load_checkpoint", "tensorflow.train.list_variables", "tensorflow.core.protobuf.trackable_object_graph_pb2.TrackableObjectGraph" ] ]
DavidT3/XGA
[ "cde51c3f29f98b5f1e981fb6d327c04072b0ba38" ]
[ "xga/products/base.py" ]
[ "# This code is a part of XMM: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS).\n# Last modified by David J Turner (david.turner@sussex.ac.uk) 30/08/2021, 09:32. Copyright (c) David J Turner\n\nimport inspect\nimport os\nimport pickle\nfrom copy import deepcopy\nfrom random import r...
[ [ "numpy.median", "numpy.mean", "numpy.divide", "numpy.random.normal", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.gca", "numpy.array", "numpy.percentile", "numpy.random.randn", "m...
liuyxpp/liuyxpp-gyroid
[ "7db91cb140869760124a66239773822bc2cd4e44" ]
[ "gyroid/group.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\ngyroid.group\n============\n\n\"\"\"\n\nimport numpy as np\nfrom numpy.linalg import inv\n\n#from .symmetry import find_symmetry_for_group\nfrom .common import HM_ITA_TABLE1,HM_ITA_TABLE2,HM_ITA_TABLE3\nfrom .common import GROUP_ORDER_TABLE1,GROUP_ORDER_TABLE2,GROUP_ORDER_TABLE3\nf...
[ [ "numpy.ndindex" ] ]
tomsander1998/google-research
[ "65eceeae83dab8eef5cc6bbbb8fa451494a69736" ]
[ "non_semantic_speech_benchmark/data_prep/beam_dofns.py" ]
[ "# coding=utf-8\n# Copyright 2021 The Google Research 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 requ...
[ [ "numpy.concatenate", "numpy.array", "numpy.pad", "numpy.tile", "numpy.mean", "numpy.stack", "numpy.expand_dims" ] ]
deil87/categorical-encoding
[ "c867aa09343b55cbcb600958542d6e8b0c405d86" ]
[ "category_encoders/utils.py" ]
[ "\"\"\"A collection of shared utilities for all encoders, not intended for external use.\"\"\"\n\nimport pandas as pd\nimport numpy as np\nfrom scipy.sparse.csr import csr_matrix\n\n__author__ = 'willmcginnis'\n\n\ndef get_obj_cols(df):\n \"\"\"\n Returns names of 'object' columns in the DataFrame.\n \"\"\...
[ [ "pandas.DataFrame", "numpy.array", "pandas.to_numeric" ] ]
shubhamagarwal92/visdial-challenge-starter-pytorch
[ "474ceb338b5f5dbed8236fc59212a4debcb40576" ]
[ "visdialch/decoders/disc.py" ]
[ "import torch\nfrom torch import nn\n\nfrom visdialch.utils import DynamicRNN\n\n\nclass DiscriminativeDecoder(nn.Module):\n def __init__(self, config, vocabulary):\n super().__init__()\n self.config = config\n\n self.word_embed = nn.Embedding(\n len(vocabulary),\n conf...
[ [ "torch.nn.LSTM", "torch.sum" ] ]
LiXiling/advent-of-code-2021
[ "d8f28ac3556dcd3187aa09e52fc95623322f0002" ]
[ "11/aoc_11.py" ]
[ "import os\nimport numpy as np\n\nINPUT = os.path.join(os.path.dirname(__file__), \"input.txt\")\n\nwith open(INPUT) as f:\n lines = f.readlines()\nlines = [list(l.rstrip()) for l in lines]\n\nlines_arr = np.array(lines).astype(int)\n\n\ndef within_bounds(x, y, lower, upper):\n full = np.transpose(np.vstack((...
[ [ "numpy.array", "numpy.ones_like", "numpy.delete", "numpy.where", "numpy.invert", "numpy.all", "numpy.vstack" ] ]
MoritzWillmann/pennylane
[ "2b07d22cfcc6406ba28e5c647062340b240a4ee5" ]
[ "tests/ops/op_math/test_adjoint_transform.py" ]
[ "# Copyright 2018-2022 Xanadu Quantum Technologies 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 ap...
[ [ "torch.cos", "numpy.array", "numpy.sin", "tensorflow.GradientTape", "torch.sin", "tensorflow.cos", "tensorflow.Variable", "numpy.allclose", "torch.tensor", "numpy.cos", "tensorflow.sin" ] ]
yutiansut/tqsdk-python
[ "5ee0a79fc6e3be574570c07eff8c1dff7db81b6b" ]
[ "tqsdk/tafunc.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n__author__ = 'limin'\n\n\"\"\"\ntqsdk.tafunc 模块包含了一批用于技术指标计算的函数\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\n\n\ndef ref(series, n):\n \"\"\"\n 简单移动: 求series序列位移n个周期的结果\n\n 注意: 当n为0, 函数返回原序列; 当n为有效值但当前的series序列元素个数不足 n + 1 个, 函数返回 NaN 序列\n\n A...
[ [ "numpy.minimum", "numpy.where", "numpy.absolute", "numpy.average", "numpy.maximum" ] ]
chandru99/nilmtk
[ "236b16906ec1f6e6ba973e30af11affe5f7e2c9a" ]
[ "nilmtk/dataset_converters/redd/convert_redd.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom copy import deepcopy\nfrom os.path import join, isdir, isfile\nfrom os import listdir\nimport re\nfrom sys import stdout\nfrom nilmtk.utils import get_datastore\nfrom nilmtk.datastore import Key\nfrom nilmtk.timeframe import TimeFrame\nfrom nilmtk.measurement import LE...
[ [ "pandas.to_datetime", "pandas.read_csv" ] ]
rmorse7/TCH_Arrhythmias_F20
[ "eb739ab68288d012c9af7f5c21c16776f947ac09" ]
[ "F20/CNN_leave_one_out/data_generator.py" ]
[ "import h5py\nimport pywt\nimport numpy as np\nimport os\nimport re\nimport random\nfrom glob import glob\nfrom sklearn.model_selection import train_test_split\nfrom ECG_feature_extraction import *\nfrom ECG_preprocessing import *\nfrom PPG_preprocessing import *\nfrom os import listdir\nfrom skimage.transform impo...
[ [ "numpy.array", "numpy.load" ] ]
hikaya-io/incubator-superset
[ "3dac81c89613f04dc9e4424dda043821c7557323" ]
[ "superset/viz_sip38.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "pandas.to_datetime", "numpy.isnan", "numpy.nanpercentile", "pandas.DataFrame", "pandas.to_numeric" ] ]
theunissenlab/sounsig
[ "fca413aa71ce6fec079c59e615e328e6781d1d35" ]
[ "soundsig/test/test_discrete_process.py" ]
[ "from __future__ import print_function\n\nfrom unittest import TestCase\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom soundsig.discrete_process import DiscreteProcessEstimator\nfrom soundsig.colormaps import magma\n\n\nclass DiscreteProcessTest(TestCase):\n\n\n def setUp(self):\n pass\n\n...
[ [ "numpy.array", "matplotlib.pyplot.colorbar", "numpy.random.rand", "numpy.zeros", "numpy.random.exponential", "numpy.sum", "matplotlib.pyplot.title", "numpy.min", "matplotlib.pyplot.figure", "numpy.where", "numpy.arange", "numpy.cumsum", "matplotlib.pyplot.show",...
JDekun/HCSC
[ "3f35082d3012aa1e686ae0ccab5d17326d222863" ]
[ "hcsc/loader.py" ]
[ "from PIL import ImageFilter\nimport random\nimport torch\nfrom torchvision import transforms\nimport torchvision.datasets as datasets\nimport os\n\nclass GaussianBlur(object):\n \"\"\"Gaussian blur augmentation in SimCLR https://arxiv.org/abs/2002.05709\"\"\"\n\n def __init__(self, sigma=[.1, 2.]):\n ...
[ [ "torch.utils.data.DataLoader", "torch.utils.data.distributed.DistributedSampler" ] ]
wangning-001/DSNet
[ "6599f613544ea31cb29e206f319d7cd57624c821" ]
[ "model.py" ]
[ "import torch\nimport torch.optim as optim\nfrom utils.io import load_ckpt\nfrom utils.io import save_ckpt\nfrom torchvision.utils import make_grid\nfrom torchvision.utils import save_image\nfrom modules.DSNet import DSNet, VGG16FeatureExtractor\nimport os\nimport time\n\n\nclass DSNetModel():\n def __init__(sel...
[ [ "torch.abs", "torch.device", "torch.cuda.is_available" ] ]
shessam/DSR
[ "5f811f79f06f0af43285b51a9aaade65edad8271" ]
[ "waveread24.py" ]
[ "import wave\nimport numpy as np\n\n\ndef _wav2array(nchannels, sampwidth, data):\n \"\"\"data must be the string containing the bytes from the wav file.\"\"\"\n num_samples, remainder = divmod(len(data), sampwidth * nchannels)\n if remainder > 0:\n raise ValueError('The length of data is not a mult...
[ [ "numpy.fromstring", "numpy.empty" ] ]
BramVanroy/sv-order-2021
[ "4a164d146bb02c0b45f5b9c405489c24825ce188" ]
[ "add_frequencies_to_df.py" ]
[ "\"\"\"Add word frequencies, based on the generated frequencies from the previous step (see\nextract_frequencies_from_corpus.py) to the input Excel-file. These values are saved for each row of data.\n\nEach row should consist (in order) of a finite verb, a main verb, a lemma of a subject, the lemma of the finite ve...
[ [ "pandas.read_excel", "pandas.isna" ] ]
LuChang-CS/CGL
[ "b8b883395684b15f0b646628a7b3109aba82392a" ]
[ "loss.py" ]
[ "import tensorflow as tf\n\n\ndef medical_codes_loss(y_true, y_pred):\n return tf.reduce_mean(tf.reduce_sum(tf.nn.sigmoid_cross_entropy_with_logits(labels=y_true, logits=y_pred), axis=1))\n" ]
[ [ "tensorflow.nn.sigmoid_cross_entropy_with_logits" ] ]
ByungKwanLee/Causal-Adversarial-Instruments
[ "68993508a6beeaae2936aaf0c44da360bb82a597" ]
[ "defense/fast_train_trades.py" ]
[ "# Import built-in module\r\nimport argparse\r\nimport warnings\r\nwarnings.filterwarnings(action='ignore')\r\n\r\n# Import torch\r\nimport torch.optim as optim\r\nimport torch.distributed as dist\r\n\r\n# Import Custom Utils\r\nfrom utils.fast_network_utils import get_network\r\nfrom utils.fast_data_utils import g...
[ [ "torch.distributed.init_process_group", "torch.cuda.amp.GradScaler", "torch.cuda.amp.autocast" ] ]
source-data/datasets
[ "987df6b4e9e20fc0c92bc9df48137d170756fd7b" ]
[ "src/datasets/utils/file_utils.py" ]
[ "\"\"\"\nUtilities for working with the local dataset cache.\nThis file is adapted from the AllenNLP library at https://github.com/allenai/allennlp\nCopyright by the AllenNLP authors.\n\"\"\"\n\nimport copy\nimport gzip\nimport json\nimport lzma\nimport os\nimport re\nimport shutil\nimport sys\nimport tarfile\nimpo...
[ [ "tensorflow.random.get_global_generator", "torch.cuda.get_rng_state_all", "torch.cuda.manual_seed_all", "torch.cuda.set_rng_state_all", "numpy.random.seed", "torch.random.get_rng_state", "torch.random.manual_seed", "tensorflow.executing_eagerly", "torch.cuda.is_available", ...
NicoleWang/retina_tiny
[ "81dfdf84baf7a96799a9f9029c6d5a890aec2a57" ]
[ "detec_human_output.py" ]
[ "import numpy as np\nimport torchvision\nimport time\nimport os, json\nimport copy\nimport pdb\nimport time\nimport argparse\n\nimport sys\nimport cv2\n\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import datasets, models, transforms\nimport model\nimport skimage.io\nimport skim...
[ [ "torch.zeros", "numpy.array", "numpy.zeros", "torch.no_grad", "torch.from_numpy", "torch.cuda.is_available", "torch.load" ] ]
fpeder/pnpmat
[ "ebb91adbd33291e80e6c49fa140f87085fac9e5a" ]
[ "src/script/dat2bmp.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nUsage: ./dat2bmp.py <img> [<out>]\n\nOptions:\n -h --help Show this message\n\"\"\"\n\nimport struct\n\nMAGIC = 666\n\n\ndef read(src):\n bmp = []\n with open(src, 'rb') as f:\n magic = struct.unpack('1i', f.read(4))[0]\n assert magi...
[ [ "numpy.array", "scipy.misc.imsave", "matplotlib.pyplot.axis", "matplotlib.pyplot.show", "numpy.expand_dims", "matplotlib.pyplot.imshow" ] ]
syonoki/exchange_calendars
[ "639ab0f88a874af99bb601824a8ffef2572820d4", "639ab0f88a874af99bb601824a8ffef2572820d4" ]
[ "tests/test_xetr_calendar.py", "exchange_calendars/lunisolar_holidays.py" ]
[ "import pytest\nimport pandas as pd\n\nfrom exchange_calendars.exchange_calendar_xetr import XETRExchangeCalendar\nfrom .test_exchange_calendar import ExchangeCalendarTestBase\n\n\nclass TestXETRCalendar(ExchangeCalendarTestBase):\n @pytest.fixture(scope=\"class\")\n def calendar_cls(self):\n yield XET...
[ [ "pandas.Timedelta" ], [ "pandas.to_datetime" ] ]
kevalmorabia97/ACL-Search-Engine-CS510
[ "a11e45fea3376d95e05354f1ec993904f2dfc91b" ]
[ "preprocessing.py" ]
[ "import ast\r\nfrom nltk.corpus import stopwords\r\nfrom nltk.stem import WordNetLemmatizer\r\nfrom nltk.tokenize import RegexpTokenizer\r\nfrom os import listdir\r\nimport pandas as pd\r\nimport re\r\nimport string\r\n\r\n\r\nlemmatizer = WordNetLemmatizer()\r\nmore_stopwords = [word.strip() for word in open('data...
[ [ "pandas.read_pickle", "pandas.DataFrame" ] ]
mpquant/efinance
[ "d80406c2d9cb3d84f9d1ed792a2b574ee1692f6e" ]
[ "efinance/stock/getter.py" ]
[ "from typing import Dict, List, Union\nfrom jsonpath import jsonpath\nfrom retry import retry\nimport pandas as pd\nimport requests\nimport multitasking\nimport signal\nfrom tqdm import tqdm\nfrom ..utils import to_numeric, get_quote_id\nfrom ..config import MARET_NUMBER_DICT\nfrom .config import (EASTMONEY_KLINE_F...
[ [ "pandas.DataFrame", "pandas.Series", "pandas.concat" ] ]
JJXiangJiaoJun/DQN_FlappyBird
[ "4d7b56427bf3e0c38f67298ac7e4bf6f5ae318db" ]
[ "DQN_FlappyBird.py" ]
[ "#coding=utf-8\r\nfrom __future__ import print_function\r\n\r\n#导入一些必要的包\r\nimport tensorflow as tf\r\nimport cv2\r\nimport sys\r\nsys.path.append(\"game/\")\r\nimport wrapped_flappy_bird as game\r\nimport random\r\nimport numpy as np\r\nfrom collections import deque\r\n\r\n\r\n\r\nclass Flappy_Bird(object):\r\n ...
[ [ "tensorflow.constant_initializer", "tensorflow.nn.conv2d", "tensorflow.matmul", "tensorflow.train.get_checkpoint_state", "tensorflow.reshape", "tensorflow.global_variables_initializer", "numpy.max", "tensorflow.train.Saver", "tensorflow.variable_scope", "numpy.argmax", ...
trainmachines/unity-ml-agents-cl
[ "6cee4d719bbbd80b8fc5303f05a7b0d7c9368fc8" ]
[ "ml-agents/mlagents/trainers/components/bc/module.py" ]
[ "from typing import Dict, Any\nimport numpy as np\n\nfrom mlagents.trainers.tf_policy import TFPolicy\nfrom .model import BCModel\nfrom mlagents.trainers.demo_loader import demo_to_buffer\nfrom mlagents.trainers.trainer import UnityTrainerException\n\n\nclass BCModule:\n def __init__(\n self,\n pol...
[ [ "numpy.random.normal", "numpy.zeros", "numpy.mean" ] ]
djinnome/cameo
[ "63cccca00d1dfb26dfdbc2da654291d907476efe" ]
[ "cameo/strain_design/deterministic/linear_programming.py" ]
[ "# Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU.\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...
[ [ "pandas.DataFrame" ] ]
StevenSiegl/Cryostat-GUI
[ "afc96705078336285555b3e2fdddd8921c7ca3f7", "afc96705078336285555b3e2fdddd8921c7ca3f7" ]
[ "Oxford/ITC_control.py", "Sequence.py" ]
[ "\"\"\"Module containing a class to run a (Oxford Instruments) ITC 503 Intelligent Temperature Controller in a pyqt5 application\n\nClasses:\n ITC_Updater: a class for interfacing with a ITC 503 Temperature Controller\n inherits from AbstractLoopThread\n there, the looping behaviour of ...
[ [ "numpy.where", "numpy.isclose" ], [ "pandas.DataFrame.from_dict", "numpy.polynomial.polynomial.polyfit", "numpy.mean", "numpy.std", "numpy.linspace" ] ]
yicrane/BasicSR
[ "5924d3bc20334381798099b7e841a26b6be90a4b" ]
[ "basicsr/data/util.py" ]
[ "import mmcv\nimport numpy as np\nimport torch\nfrom os import path as osp\nfrom torch.nn import functional as F\n\nfrom basicsr.data.transforms import mod_crop, totensor\n\n\ndef read_img_seq(path, require_mod_crop=False, scale=1):\n \"\"\"Read a sequence of images from a given folder path.\n\n Args:\n ...
[ [ "torch.stack", "numpy.zeros", "scipy.ndimage.filters.gaussian_filter", "torch.from_numpy", "torch.nn.functional.pad", "torch.nn.functional.conv2d" ] ]