repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
YoshikawaMasashi/chainer
[ "8d776fcc1e848cb9d3800a6aab356eb91ae9d088" ]
[ "chainer/exporters/caffe.py" ]
[ "import collections\n\nimport heapq\nimport numpy\nimport os\nimport six\n\nimport chainer\nfrom chainer import function\nfrom chainer import function_node\nfrom chainer.links.caffe.protobuf3 import caffe_pb2 as caffe_pb\nfrom chainer import variable\n\n\n_function_types = (function.Function, function_node.Function...
[ [ "numpy.ones" ] ]
PBarnaghi/Task-Conditional-Neural-Networks-TCNN-_Honglin_Li
[ "4f95ca6aa48bf59978b78e55b1523a33ef104f01" ]
[ "code/utils/layers.py" ]
[ "import tensorflow as tf\nfrom keras import backend as K\nfrom utils.model_utils import mask_layer_by_task\nfrom keras.layers import Layer\n\n# Multiple Centers\nclass Probability_CLF_Mul_by_task(Layer):\n \"\"\"docstring for Probability_CLF\"\"\"\n\n def __init__(self, output_dim, num_centers=4, activation=N...
[ [ "tensorflow.reduce_max", "tensorflow.reduce_sum", "tensorflow.stack", "tensorflow.squared_difference" ] ]
alanoMartins/convex_hull_image
[ "0bcd472a002dc3b91c1304845dd14a4181d985ca" ]
[ "fernada_parada.py" ]
[ "import numpy as np\nimport cv2\n\ncap = cv2.VideoCapture(0)\nfgbg = cv2.createBackgroundSubtractorMOG2()\n\nwhile(True):\n # Capture frame-by-frame\n ret, frame = cap.read()\n\n # Our operations on the frame come here\n gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)\n blurred = cv2.GaussianBlur(gra...
[ [ "numpy.ones" ] ]
TillBeemelmanns/mononet3d
[ "5fdd701ce3fb0f11d9c432e47c4197b1b1569c65" ]
[ "utils/tf_utils.py" ]
[ "import sys\nsys.path.insert(0, './')\n\nimport tensorflow as tf\nfrom utils import helpers\n\n\ndef bytes_feature(value):\n return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value]))\n\n\ndef float_feature(value):\n return tf.train.Feature(float_list=tf.train.FloatList(value=[value]))\n\n\ndef float_l...
[ [ "tensorflow.math.atan2", "tensorflow.reduce_min", "tensorflow.train.Int64List", "tensorflow.ones", "tensorflow.reshape", "tensorflow.reverse", "tensorflow.zeros_like", "tensorflow.stack", "tensorflow.tile", "tensorflow.einsum", "tensorflow.cast", "tensorflow.reduce_...
anirudh2290/incubator-tvm
[ "14a5a35882e7369508578705edbc48922b5a0e9a" ]
[ "tests/python/relay/test_vm_serialization.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.array", "numpy.random.uniform", "numpy.random.rand" ] ]
Chrisys93/IcarusRepoSEND
[ "f670b8e178c6e6e63cdabb71434eee8ac33c28e9" ]
[ "icarus/models/strategy/placement.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Implementations of all service-based strategies\"\"\"\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport networkx as nx\nimport random\nimport sys\n# for the optimizer\nimport cvxpy as cp\nimport numpy as np\nimport optparse\nimport math # for ceil()\n\...
[ [ "numpy.zeros" ] ]
aaj-fullfact/slot_filling_and_intent_detection_of_SLU
[ "27adf381b9b087caa1e90bfafb88765e5e296192", "27adf381b9b087caa1e90bfafb88765e5e296192" ]
[ "models/crf.py", "utils/word_features.py" ]
[ "# -*- coding: utf-8 -*-\n# @Author: Jie Yang\n# @Date: 2017-12-04 23:19:38\n# @Last Modified by: Jie Yang, Contact: jieynlp@gmail.com\n# @Last Modified time: 2018-12-16 22:15:56\n# https://github.com/jiesutd/NCRFpp/blob/master/model/crf.py\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as...
[ [ "torch.zeros", "torch.cat", "torch.gather", "torch.max", "torch.logsumexp", "torch.nn.Parameter", "torch.sum", "torch.nn.functional.softmax", "torch.topk" ], [ "torch.tensor", "numpy.eye" ] ]
mortcanty/EESARDocker
[ "855b41a3da19f3b07b42438784309ab48fc7fe98" ]
[ "src/scripts/iMad.py" ]
[ "#!/usr/bin/env python\n#******************************************************************************\n# Name: iMad.py\n# Purpose: Perfrom IR-MAD change detection on bitemporal, multispectral\n# imagery \n# Usage: \n# python iMad.py -h\n#\n# Copyright (c) 2018 Mort Canty\n\nimpo...
[ [ "numpy.tile", "numpy.where", "numpy.nan_to_num", "numpy.sqrt", "matplotlib.pyplot.subplot", "numpy.reshape", "numpy.zeros", "matplotlib.pyplot.title", "numpy.identity", "scipy.linalg.inv", "numpy.argsort", "matplotlib.pyplot.show", "numpy.asarray", "numpy.su...
dvlab-research/MSN
[ "204239a0dd88c6e66b203777ca54af77c56f5bdb" ]
[ "TPN/networks/flownet_models.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nfrom torch.nn import init\r\n\r\nimport math\r\nimport numpy as np\r\n\r\nfrom resample2d_package.modules.resample2d import Resample2d\r\nfrom channelnorm_package.modules.channelnorm import ChannelNorm\r\n\r\nimport FlowNetC\r\nimport FlowNetS\r\nimport FlowNetSD\r\nimport ...
[ [ "numpy.ceil", "torch.cat", "numpy.zeros", "torch.nn.init.xavier_uniform", "torch.nn.init.uniform", "torch.from_numpy", "torch.nn.Upsample" ] ]
NC0DER/GraphOfDocs
[ "16603de9d8695ae8205117aa7123707d1dcbe0e0" ]
[ "GraphOfDocs/config_experiments.py" ]
[ "from sklearn.naive_bayes import MultinomialNB\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.neural_network import MLPClassifier\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.svm import LinearSVC\n\nMIN_NUMBER_OF_DOCUMENTS_PER_SELECTED_COMMUNITY = 2\nDATASET_PATH = \\\n r...
[ [ "sklearn.neighbors.KNeighborsClassifier", "sklearn.neural_network.MLPClassifier", "sklearn.naive_bayes.MultinomialNB", "sklearn.linear_model.LogisticRegression", "sklearn.svm.LinearSVC" ] ]
smallsunsun1/repvgg
[ "9739ab5a62078b208d9899826538c192617b1fb9" ]
[ "utils.py" ]
[ "import tensorflow as tf \n\n\ndef process_image_and_label(image, label):\n # image = tf.cast(image, dtype=tf.float32) / 255.0\n image = tf.cast(image, dtype=tf.float32)\n label = tf.squeeze(label, axis=1)\n label = tf.one_hot(label, 100, off_value=0)\n return image, label" ]
[ [ "tensorflow.one_hot", "tensorflow.squeeze", "tensorflow.cast" ] ]
ppiont/tensor-flow-state
[ "5d94f1080aef6dab1214518eb6a9f92db33a58a9" ]
[ "tensor-flow-state/modules/deprecated/zDEPRECATED_fix_standard_time_2019.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Nov 6 22:07:13 2019\r\n\r\n@author: peterpiontek\r\n\"\"\"\r\nimport pandas as pd\r\n\r\ndef fix_standard_time_2019(df):\r\n \"\"\"DEPRECATED AND USELESS: \r\n Replaces glitched timestamps with values that are consistent with \r\n the rows surroundin...
[ [ "pandas.to_datetime", "pandas.Timedelta" ] ]
ljdursi/julia_v_chapel
[ "386d7a7dc2678022bf1ece5f4555968935ce92f9" ]
[ "twodadvection/twodadvection.py" ]
[ "#!/usr/bin/env python\nfrom __future__ import print_function\nimport numpy as np\nimport dask.array as da\nfrom dask.multiprocessing import get as mp_get\nimport time\nimport argparse\n\n\ndef advect(dens, dx, dy, dt, u):\n \"\"\"\n second-order upwind method for 2d advection\n Advects density in some sub...
[ [ "numpy.array", "numpy.zeros_like", "numpy.dot", "numpy.exp", "numpy.arange", "numpy.meshgrid" ] ]
kelvinxu/blocks
[ "8081c0f00926e86d20731eb24cf8a61cab3a7529" ]
[ "blocks/initialization.py" ]
[ "\"\"\"Objects for encapsulating parameter initialization strategies.\"\"\"\nfrom abc import ABCMeta, abstractmethod\n\nimport numpy\nimport six\nimport theano\nfrom six import add_metaclass\n\n\n@add_metaclass(ABCMeta)\nclass NdarrayInitialization(object):\n \"\"\"Base class specifying the interface for ndarray...
[ [ "numpy.dot", "numpy.empty", "numpy.asarray", "numpy.random.choice", "numpy.eye", "numpy.linalg.qr", "numpy.sqrt", "numpy.diag" ] ]
LinuxIsCool/cryptocompy
[ "dad0852cc245bf618e6cc44f0b1beba984e63e9d" ]
[ "cryptocompy/utils.py" ]
[ "import requests\nimport numpy as np\nimport pandas as pd\nimport xarray as xr\nimport datetime\nfrom cryptocompy import top, coin\n\n# This should be ran async\ndef get_series(symbols, freq, tsym, limit, aggregate, exchange=''):\n series = {}\n assert(freq in ['minute', 'hourly', 'daily'])\n if freq == 'm...
[ [ "numpy.concatenate", "numpy.full", "pandas.DataFrame", "numpy.stack", "numpy.swapaxes" ] ]
CITA-cph/deep-sight
[ "9c60183a5bd1f3b6b930cdba8632c33f38769c0b" ]
[ "test/20200923_fungar_network.py" ]
[ "'''\nCopyright 2020 CITA\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, sof...
[ [ "numpy.dstack", "numpy.nonzero" ] ]
SunDevilThor/BestBuy_CPU_BS
[ "512e0a0b97d5b104f4643d031d690376c2306bb4" ]
[ "BestBuy_CPU_BS.py" ]
[ "# Best Buy AMD Ryzen Processor Webscraper\n# Python - Beautiful Soup \n\nimport requests\nfrom bs4 import BeautifulSoup\nfrom requests.models import Response\nimport pandas as pd\n\ndef extract():\n url = 'https://www.bestbuy.com/site/searchpage.jsp?cp=1&id=pcat17071&qp=category_facet%3Dname~abcat0507010&st=ryz...
[ [ "pandas.DataFrame" ] ]
frank-xwang/RIDE-LongTailRecognition
[ "5396100d33b75992e0a72dd01819513c10088611" ]
[ "data_loader/inaturalist_data_loaders.py" ]
[ "import torch\nimport random\nimport numpy as np\nimport os, sys\nfrom torchvision import datasets, transforms\nfrom torch.utils.data import DataLoader, Dataset, Sampler\nfrom base import BaseDataLoader\nfrom PIL import Image\n\nclass BalancedSampler(Sampler):\n def __init__(self, buckets, retain_epoch_size=Fals...
[ [ "numpy.unique" ] ]
neeravkaushal/Quijote-simulations
[ "5d98bc10609d3e263c1ae8aaf33215ef5766af98" ]
[ "checksums/check_files.py" ]
[ "# We use this script to verify the integrity of the transfer\n#import h5py\nfrom mpi4py import MPI\nimport numpy as np\nimport sys,os\n\n###### MPI DEFINITIONS ###### \ncomm = MPI.COMM_WORLD\nnprocs = comm.Get_size()\nmyrank = comm.Get_rank()\n\n################################## INPUT ##########################...
[ [ "numpy.array", "numpy.arange" ] ]
NLeSC/yeap16
[ "4f15c1851d819290dc7a922c9470a76ff458945c" ]
[ "deepy3d/Scans.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport progressbar as pb\nfrom os.path import basename\nfrom itertools import compress\nfrom matplotlib import cm\nfrom matplotlib.patches import Rectangle\n\nprogress = pb.ProgressBar(widgets=[pb.Bar('*', '[', '...
[ [ "numpy.max", "numpy.random.choice", "numpy.zeros", "numpy.sum", "numpy.load", "numpy.argwhere", "numpy.mod" ] ]
mick-liu/tagenalgo
[ "b47f4186d06d2898f64ec0d4d89561c7c920a67f" ]
[ "tagenalgo/tagenalgo.py" ]
[ "\r\n# Author: Mick Liu\r\n\r\nimport pandas as pd\r\nfrom pandas import DataFrame\r\nimport numpy as np\r\nfrom numpy import random\r\nimport talib\r\nfrom joblib import Parallel, delayed\r\nimport itertools\r\nfrom .backtest import rsi_signal, sma_signal, rsinsma_signal, rsi_stoploss_takeprofit\r\nfrom .utils imp...
[ [ "numpy.max", "numpy.array", "numpy.isnan", "pandas.DataFrame", "numpy.random.randint", "numpy.argmax", "numpy.random.random" ] ]
COVID-19-Causal-Reasoning/bio2bel
[ "f2c015c23e9e1f4b996716ec48f61687c5e347fe" ]
[ "src/bio2bel/sources/biogrid.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Download and convert `BioGRID <https://thebiogrid.org>`_ to BEL.\n\nRun this script with ``python -m bio2bel.sources.biogrid``\n\nThe interaction information contained in can be categorized into protein\ninteractions, genetic interactions, chemical associations, and post-translati...
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.isna" ] ]
talkowski-lab/gnomad-sv-v3-qc
[ "db23760af7bc21a776e14f6ca1fbc213ff0ff9a1", "db23760af7bc21a776e14f6ca1fbc213ff0ff9a1" ]
[ "src/sv-pipeline/02_evidence_assessment/02d_baftest/scripts/bafTest.py", "src/sv-pipeline/04_variant_resolution/scripts/filter_dn_metrics.py" ]
[ "#!usr/bin/env python\nfrom BAFpysam import *\nimport argparse\nfrom collections import deque\nimport numpy as np\nimport pandas as pd\nimport pysam\nimport boto3\nimport sys\n##########\ndef preprocess(chrom, start, end, tbx, samples, window=None):\n \"\"\"\n Report normalized BAFs in a set of samples across...
[ [ "pandas.DataFrame", "numpy.array" ], [ "pandas.read_table", "numpy.int", "numpy.float", "numpy.where", "numpy.any", "numpy.abs", "scipy.stats.poisson.cdf" ] ]
CVMI-Lab/DARS
[ "0cfe09ad6758458a497940f4fe7829aad6983f67" ]
[ "util/augmentation.py" ]
[ "# Code taken from https://github.com/DeepVoltaire/AutoAugment\n\nfrom PIL import Image, ImageEnhance, ImageOps\nimport numpy as np\nimport random\n\n\nclass CIFAR10Policy(object):\n \"\"\" Randomly choose one of the best 25 Sub-policies on CIFAR10.\n\n Example:\n >>> policy = CIFAR10Policy()\n ...
[ [ "numpy.linspace" ] ]
ldfrancis/faster_rcnn
[ "35b1ea5d16e669088e73bc741a7ea294221e6516" ]
[ "fasterrcnn/utils/checkpoint_utils.py" ]
[ "import tensorflow as tf\nfrom tensorflow import Variable\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras.optimizers import Optimizer\n\nfrom .path_utils import resolve_path\n\n\ndef create_checkpoint(\n checkpoint_path,\n max_to_keep,\n rpn: Model,\n detector: Model,\n backbone_hea...
[ [ "tensorflow.less", "tensorflow.Variable", "tensorflow.train.CheckpointManager", "tensorflow.greater" ] ]
Achuttarsing/Slow-Fast-pytorch-implementation
[ "4c47c8dce3096ec6a274bdd1d20d1e4fba789e48", "4c47c8dce3096ec6a274bdd1d20d1e4fba789e48" ]
[ "evaluator.py", "imshow_result_OLD.py" ]
[ "from typing import Tuple\nimport torch\nfrom torch.utils.data import DataLoader\nfrom tqdm import tqdm\nfrom dataset.base import Base as DatasetBase\nfrom model import Model\nimport cv2\nimport numpy as np\nclass Evaluator(object):\n def __init__(self, dataset: DatasetBase, path_to_results_dir: str):\n s...
[ [ "numpy.array", "torch.no_grad", "torch.utils.data.DataLoader" ], [ "numpy.array", "numpy.random.randint", "torch.tensor", "numpy.dtype" ] ]
mcgridles/CarND-Capstone
[ "a682fa8f46901c4367263bd9ed93a4bc466096db" ]
[ "detection/generate_tfrecord.py" ]
[ "\"\"\"\nUsage:\n\n# Create train data:\npython generate_tfrecord.py --csv_input=<PATH_TO_ANNOTATIONS_FOLDER>/train_labels.csv --output_path=<PATH_TO_ANNOTATIONS_FOLDER>/train.record\n\n# Create test data:\npython generate_tfrecord.py --csv_input=<PATH_TO_ANNOTATIONS_FOLDER>/test_labels.csv --output_path=<PATH_TO...
[ [ "tensorflow.app.run", "pandas.read_csv", "tensorflow.python_io.TFRecordWriter" ] ]
devtodev/COVID_argentina
[ "52dcd88c28fbc556570752f5c5a0e623ddbc4955" ]
[ "consulta.py" ]
[ "import mysql.connector\nimport json\nimport numpy as np\nimport time\n\nfile_zonas = \"data_zonas.json\"\nfile_totales = \"data_totales.json\"\nfile_edades = \"data_provincias_edades.json\"\nTAG_COVIDPOSITIVO = \"totales\"\nTAG_TESTS = \"test\"\n\nmydb = mysql.connector.connect(\n host=\"localhost\",\n user=...
[ [ "numpy.max", "numpy.percentile", "numpy.min" ] ]
achalumeau/enterprise
[ "da9b85f59f47766a9f1abf260af7848cef12893a" ]
[ "enterprise/signals/gp_signals.py" ]
[ "# gp_signals.py\n\"\"\"Contains class factories for Gaussian Process (GP) signals.\nGP signals are defined as the class of signals that have a basis\nfunction matrix and basis prior vector..\n\"\"\"\n\nimport functools\nimport itertools\nimport logging\n\nimport numpy as np\nimport scipy.sparse as sps\nfrom skspar...
[ [ "numpy.zeros_like", "numpy.array", "numpy.dot", "numpy.zeros", "numpy.log", "numpy.sum", "numpy.ones" ] ]
brunoarine/ML-peak-detection
[ "715709fd4bc3466d41a93de09751b8b3e6c16e76" ]
[ "helpers/spectrum_generator.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\nimport numpy as np\nfrom scipy import stats\nimport gzip\nimport pickle\n\ndef generate_new_spectrum(old_spectrum, rate=1): \n # auxiliary variable\n old_spectrum_ravel = [] \n # number of channels\n m = len(old_spectrum) \n # total number of counts\n ...
[ [ "numpy.bincount", "numpy.array", "scipy.stats.norm.rvs", "numpy.zeros", "numpy.sum", "numpy.random.poisson", "numpy.random.uniform", "numpy.random.randint", "numpy.sqrt" ] ]
LaurensonR/cleverhans
[ "d1ce194875d692d23cc33db7c79316fd99edc787" ]
[ "cleverhans_tutorials/mnist_tutorial_keras_tf_vgg.py" ]
[ "\"\"\"\nThis tutorial shows how to generate adversarial examples using FGSM\nand train a model using adversarial training with Keras.\nIt is very similar to mnist_tutorial_tf.py, which does the same\nthing but without a dependence on keras.\nThe original paper can be found at:\nhttps://arxiv.org/abs/1412.6572\n\"\...
[ [ "tensorflow.set_random_seed", "tensorflow.python.platform.flags.DEFINE_integer", "tensorflow.python.platform.flags.DEFINE_boolean", "numpy.random.RandomState", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.train.get_checkpoint_state", "tensorflow.python.platform.flags...
SunDubey/ga-learner-dsmp-repo
[ "c74e8e556d0fc585dee064f83dfa5589ebdf3812" ]
[ "Pandas_Wrangling/code.py" ]
[ "# --------------\n# Import packages\nimport numpy as np\nimport pandas as pd\nfrom scipy.stats import mode \n \n# code starts here\nbank = pd.read_csv(path)\n#print(bank.describe)\n#print(bank.info)\n\ncategorical_var = bank.select_dtypes(include='object')\nprint(categorical_var.head(10))\n\nnumerical_var = bank.s...
[ [ "pandas.read_csv" ] ]
ChrisDelaX/VIP
[ "7b728bdc78fdeb693e19de269ddfffba15064fb4", "7b728bdc78fdeb693e19de269ddfffba15064fb4" ]
[ "vip_hci/stats/bkg_proba.py", "vip_hci/preproc/badframes.py" ]
[ "#! /usr/bin/env python\n\n\"\"\"\nProbability of a point source to be a background star.\n\"\"\"\n\n__author__ = 'V. Christiaens'\n__all__ = ['bkg_star_proba']\n\nfrom scipy.special import factorial \nimport numpy as np\n\n\ndef bkg_star_proba(n_dens, sep, n_bkg=1, verbose=True, full_output=False):\n \"\"\" ...
[ [ "numpy.zeros", "numpy.sum", "numpy.exp", "scipy.special.factorial", "numpy.amax" ], [ "numpy.array", "numpy.isnan", "numpy.empty", "matplotlib.pyplot.xlim", "numpy.nan_to_num", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", ...
gpleiss/aum
[ "3c710662d74cdad9b299f541170070c0cb292042" ]
[ "examples/paper_replication/models/densenet.py" ]
[ "# This implementation is based on the DenseNet-BC implementation in torchvision\n# https://github.com/pytorch/vision/blob/master/torchvision/models/densenet.py\n\nimport math\nfrom collections import OrderedDict\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.checkpoint ...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.functional.avg_pool2d", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.nn.functional.dropout", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.utils.checkpoint.checkpoint", "torch.nn.functional.relu" ] ]
qsunny/python_notebook
[ "ee1cdc2ec7a82f76acc0c700e9caa5c225a4f5ac" ]
[ "pandas/pilot.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n\nts = pd.Series(np.random.randn(1000),\n index=pd.date_range('1/1/2019', periods=1000))\nts = ts.cumsum()\nts.plot()" ]
[ [ "pandas.date_range", "numpy.random.randn" ] ]
desihub/desicmx
[ "6f7c9a3cff25c970af57de20e3a12001382deb23" ]
[ "analysis/fpcalib/posarc/fit_petal.py" ]
[ "#!/usr/bin/env python\n\nimport sys\nimport os.path\nfrom astropy.table import Table\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfilenames = sys.argv[1:]\n\nx2i=None\ny2i=None\nloci=None\nfor filename in filenames :\n t=Table.read(filename)\n #print(t.dtype.names)\n x1=t[\"X_FP_METRO\"]\n y...
[ [ "numpy.array", "numpy.mean", "matplotlib.pyplot.figure", "numpy.std", "numpy.where", "numpy.sqrt", "matplotlib.pyplot.show", "matplotlib.pyplot.subplot" ] ]
divyanshu132/tensorflow
[ "59396e02b29d11a3f52f17fd6c80ff894f248241" ]
[ "tensorflow/python/ops/array_ops.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.gen_math_ops.select", "tensorflow.python.ops.gen_array_ops.list_diff", "tensorflow.python.ops.gen_array_ops.unique_with_counts", "tensorflow.python.ops.gen_array_ops.guarantee_const", "tensorflow.python.framework.tensor_util.constant_value", "numpy.prod", "tensor...
mail-ecnu/OTDyadicFair
[ "1259eb6d2e4c99b1b1333048eea4cbf94e4ec785" ]
[ "coraNode.py" ]
[ "import sys\nimport stellargraph as sg\nimport matplotlib.pyplot as plt\nfrom math import isclose\nimport sklearn\nfrom sklearn.decomposition import PCA\nimport os\nimport networkx as nx\nimport numpy as np\nimport pandas as pd\nfrom stellargraph import StellarGraph, datasets\nfrom stellargraph.data import EdgeSpli...
[ [ "numpy.array", "numpy.ones_like", "numpy.asarray", "numpy.zeros", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.savefig", "pandas.DataFrame", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "sklearn.metrics.accuracy_score", "sklearn.svm.SVC", "s...
wenye1024/PMStack
[ "1d80875eb5087697802241c5f3fb875b6fa80280" ]
[ "PMStack/Equity_port/Alert.py" ]
[ "'''\nCreated on Sep 30, 2018\n\n@author: yewen\n'''\n\n\nimport os\nfrom datetime import datetime\nimport pandas as pd\nimport numpy as np\nfrom scipy import stats\nfrom scipy import optimize\nfrom _ast import operator\nimport Equity_port.historical_price as historical_price\nimport Equity_port.finance as finance\...
[ [ "pandas.to_datetime", "pandas.Timedelta", "pandas.DataFrame", "pandas.date_range", "numpy.mean", "pandas.ExcelFile", "numpy.std", "pandas.ExcelWriter" ] ]
AnyWi/py-ubnt-airviewer
[ "a3980c8e62d50eb532c27094f89479387b3fba44" ]
[ "airviewer.py" ]
[ "#\n# Copyright (c) 2016, AnyWi Technologies BV\n# All rights reserved.\n# \n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n# \n# 1. Redistributions of source code must retain the above copyright notice,\n# this li...
[ [ "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.grid", "matplotlib.pyplot.subplots", "numpy.vstack", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "matplotlib.pyplot.xticks" ] ]
herbiebradley/mimicry
[ "03d5df6d3fbf91f5db4c729d0a66291ca51124f3" ]
[ "torch_mimicry/nets/sagan/sagan_32.py" ]
[ "\"\"\"\nImplementation of SAGAN for image size 32.\n\nNote: The original SAGAN did not have architecture designs for datasets with\nresolutions other than 128x128. Thus, the current placement of the attention\nblock follows the version for 128x128 but may well not be optimal for this\nparticular resolution. Feel f...
[ [ "torch.nn.BatchNorm2d", "torch.nn.init.xavier_uniform_", "torch.nn.ReLU", "torch.randint", "torch.sum" ] ]
fenghansen/MegVSR
[ "e57bfbc03342f24b2c71391890147fb17b5cfc68" ]
[ "datasets.py" ]
[ "import numpy as np\nimport cv2\nimport os\nimport h5py\nfrom tqdm import tqdm\nfrom matplotlib import pyplot as plt\nfrom utils import *\n\nclass Global_Buffer(Dataset):\n def __init__(self, pool_size=15, index_range=1000, optflow=False):\n super().__init__()\n self.pool_size = pool_size\n ...
[ [ "numpy.rot90", "numpy.zeros_like", "numpy.zeros", "numpy.flipud", "numpy.random.randint", "numpy.clip", "numpy.expand_dims" ] ]
LeaveLeaves/cil-road-segmentation-2019
[ "de027ca6fd2e29a018209a2b2e5380f63c2af8ef" ]
[ "model/bisenet/pred.py" ]
[ "#!/usr/bin/env python3\n# encoding: utf-8\nimport os\nimport cv2\nimport argparse\nimport numpy as np\n\nimport torch\nimport torch.multiprocessing as mp\n\nfrom config import config\nfrom utils.pyt_utils import ensure_dir, link_file, load_model, parse_devices\n\nfrom engine.evaluator import Evaluator\nfrom engine...
[ [ "torch.no_grad", "torch.cuda.get_device_name" ] ]
KaenChan/lightqnet-train
[ "390253287c59ee824cbf30be38da765e895396dd" ]
[ "models/uncertainty_res18_avg_confidence.py" ]
[ "import tensorflow as tf\nimport tensorflow.contrib.slim as slim\n\n'''\nResface20 and Resface36 proposed in sphereface and applied in Additive Margin Softmax paper\nNotice:\nbatch norm is used in line 111. to cancel batch norm, simply commend out line 111 and use line 112\n'''\n\ndef prelu(x):\n with tf.variabl...
[ [ "tensorflow.contrib.slim.repeat", "tensorflow.contrib.slim.l2_regularizer", "tensorflow.truncated_normal_initializer", "tensorflow.nn.relu", "tensorflow.sigmoid", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.contrib.slim.flatten", "tensorflow.variable_scope", "te...
alejocrojo09/SASpector
[ "0ea8df040da7dea65393c8252a29e74dbaed6d3b" ]
[ "build/scripts-3.7/summary.py" ]
[ "#!python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Nov 14 07:50:22 2019\n\n@author: alerojo\n\"\"\"\n\nfrom Bio import SeqUtils, SeqIO, BiopythonWarning\nfrom Bio.Seq import Seq\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport os\nimport progressbar \nimport time\nimport ...
[ [ "pandas.DataFrame.from_dict", "pandas.DataFrame", "matplotlib.pyplot.figure", "pandas.concat", "matplotlib.pyplot.clf", "pandas.read_csv" ] ]
taroyu0923/TechProject2019
[ "6cca60ed3306aaf34648a9406e140a5adb0d1b51" ]
[ "scraper.py" ]
[ "from facebook_scraper import get_posts\nfrom pprint import pprint\nimport pandas as pd\nimport numpy as np\nimport csv\nfrom collections import Counter\n\ndef nestedlist(list, output):\n with open(output, 'w') as f:\n w = csv.writer(f)\n fieldnames = list[0].keys()\n w.writerow(fieldnames)\...
[ [ "pandas.DataFrame" ] ]
manuboat/LDSSA
[ "6d79f9c48d08561e1243cdadd5c3ddf02afba3b0" ]
[ "units/SLU14_Algorithms/utils.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom sklearn.metrics import roc_auc_score\nfrom sklearn.cross_validation import train_test_split\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.metrics.pairwise import paired_distances\nfrom sklearn.datasets import make_moons, make_circles, make_blobs, ma...
[ [ "matplotlib.pyplot.contourf", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.scatter", "matplotlib.pyplot.show", "matplotlib.colors.ListedColormap", "sklearn.cross_validation.train_test_split", "sklearn.metrics.roc_auc_sco...
sickkids-mri/mrrecon
[ "202cbec37699ce98155b547105a7ba5348447740" ]
[ "mrrecon/sort.py" ]
[ "import numpy as np\r\n\r\n\r\ndef cardiac(triggers, nt, times, kspace, traj, angles=None, dcf=None):\r\n \"\"\"Sorts data into cardiac phases.\r\n\r\n Args:\r\n triggers (array): 1D array containing cardiac trigger times (ms).\r\n nt (int): Number of cardiac phases to sort into.\r\n time...
[ [ "numpy.random.normal", "numpy.array", "numpy.reshape", "numpy.digitize", "numpy.linspace" ] ]
malhotraa/transformer-experiments
[ "82931b89b14d26dbd6e4ffef8d6f2fd8b7279c0f" ]
[ "data/dataset.py" ]
[ "import logging\nimport math\nimport pickle\nimport os\nfrom typing import NamedTuple, List, Optional\n\nimport torch\nimport torchvision\nfrom torch.utils.data import Dataset\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nclass DataSample(NamedTuple):\n x: torch.Tensor\n y: torch.Tensor\n\nclass Dat...
[ [ "numpy.array", "torch.stack", "torch.isnan", "torch.no_grad", "torch.randperm", "matplotlib.pyplot.figure", "matplotlib.pyplot.save_fig", "torch.randint", "torch.tensor", "matplotlib.pyplot.subplot" ] ]
kotetsu99/rnn
[ "a5829c9ea0ef81584b7df617797e58e8798d4d07" ]
[ "01-simple_rnn_train.py" ]
[ "# -*- coding: utf-8 -*-\nimport keras\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.layers.recurrent import SimpleRNN\nimport numpy as np\nimport pandas as pd\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport sys\nimport os\nimport time\n\n\n# 時系列...
[ [ "matplotlib.use", "numpy.array", "numpy.zeros", "matplotlib.pyplot.xlabel", "numpy.random.permutation", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "pandas.read_csv" ] ]
ech0r/Senior-Project---Fall-2018
[ "1848dd69c771c03785822f0ea0fc51d6bcef6895" ]
[ "regression.py" ]
[ "from scipy import stats\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\nx = np.array([112, 345, 198, 305, 372, 550, 302, 420, 578])\ny = np.array([1120, 1523, 2102, 2230, 2600, 3200, 3409, 3689, 4460])\n\nslope, intercept, r_value, p_value, std_err, = stats.linregress(x,y)\n\nplt.plot(x, y, 'ro', colo...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "scipy.stats.linregress", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.axis" ] ]
okwrtdsh/3D-ResNets-PyTorch
[ "f36a32ea8b283524d1d102937c49689b1f475b5f" ]
[ "models/c2d_pt.py" ]
[ "# import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n# from torch.autograd import Variable\n# from functools import partial\nfrom .pattern_conv_modules import PatternConv\n\n__all__ = [\n 'C2DPt'\n]\n\n\nclass C2DPt(nn.Module):\n\n def __init__(self,\n sample_size,\n ...
[ [ "torch.nn.Linear", "torch.nn.BatchNorm2d", "torch.nn.functional.log_softmax", "torch.nn.Conv2d", "torch.nn.functional.dropout2d", "torch.nn.functional.max_pool2d" ] ]
deepakhr1999/facenet-1
[ "3c5b578c109be5598bca581d3d1492e1bd741249" ]
[ "src/classifier.py" ]
[ "\"\"\"An example of how to use your own dataset to train a classifier that recognizes people.\n\"\"\"\n# MIT License\n# \n# Copyright (c) 2016 David Sandberg\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\")...
[ [ "numpy.equal", "numpy.zeros", "tensorflow.get_default_graph", "numpy.random.seed", "tensorflow.Graph", "tensorflow.Session", "numpy.random.shuffle", "sklearn.svm.SVC", "numpy.argmax" ] ]
atitawat-pol/overlay-risk
[ "3a1f5478a4c1903d67ec2e353106f5717c78caba" ]
[ "scripts/influx_univ3_1h.py" ]
[ "import numpy as np\r\nimport pandas as pd\r\nimport os\r\nimport json\r\nimport typing as tp\r\nimport time\r\nimport math\r\nimport requests\r\n\r\nfrom concurrent.futures import ThreadPoolExecutor\r\n\r\nfrom brownie import network, Contract\r\nfrom datetime import datetime, timedelta\r\n\r\nfrom influxdb_client...
[ [ "pandas.DataFrame", "numpy.arange" ] ]
xuan11235813/sockeye
[ "7b71367008dc5af861979ce3fc7f869472c8e0e2" ]
[ "sockeye/utils.py" ]
[ "# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You may not\n# use this file except in compliance with the License. A copy of the License\n# is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"l...
[ [ "matplotlib.use", "numpy.random.seed", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "numpy.unravel_index", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.gca" ] ]
TileDB-Inc/TileDB-ML
[ "704d920b1482ad5b7ceefcc8b1f8f4b69d572e6c" ]
[ "tiledb/ml/readers/pytorch_sparse.py" ]
[ "\"\"\"Functionality for loading data directly from sparse TileDB arrays into the PyTorch Dataloader API.\"\"\"\n\nfrom concurrent.futures import ThreadPoolExecutor\nfrom typing import Iterator, Mapping, Optional, Sequence, Tuple\n\nimport numpy as np\nimport torch\nfrom scipy.sparse import csr_matrix\n\nimport til...
[ [ "torch.utils.data.get_worker_info", "numpy.random.shuffle", "numpy.stack", "numpy.arange", "torch.tensor", "scipy.sparse.csr_matrix", "numpy.unique" ] ]
zhuakexi/hicstuff
[ "b74bec7f62c355d351a70751e20646b34dfa036f" ]
[ "hicstuff/hicstuff.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Common Hi-C functions\n\nA bunch of handy functions for processing Hi-C data\n(mainly in the form of matrices):\n\n -Normalizations\n -Interpolations\n -Filters\n -Removing artifacts\n -Quick sum-pooling (aka 'binning') in sparse and dense form...
[ [ "scipy.linalg.eigh", "numpy.median", "scipy.sparse.csgraph.connected_components", "numpy.copy", "numpy.exp", "numpy.mean", "numpy.where", "numpy.tensordot", "numpy.cumsum", "numpy.outer", "numpy.logspace", "numpy.max", "numpy.bincount", "numpy.zeros_like", ...
williamFalcon/trains
[ "577c0a3c4196d9ed3630a081e6e16bde42a13de1" ]
[ "trains/logger.py" ]
[ "import logging\nimport math\nimport warnings\nfrom typing import Any, Sequence, Union, List, Optional, Tuple, Dict\n\nimport numpy as np\nimport six\n\ntry:\n import pandas as pd\nexcept ImportError:\n pd = None\nfrom PIL import Image\nfrom pathlib2 import Path\n\nfrom .backend_interface.logger import StdStr...
[ [ "numpy.array", "pandas.read_csv" ] ]
elizastarr/image_caption_generator
[ "435fbc390e3fb4b2139b56558d199cf574bffaa2" ]
[ "src/models/train.py" ]
[ "\"\"\"\nScript to train the LSTM Learner on the test and validation captions and images.\n\"\"\"\n\nfrom pathlib import Path\nimport os\nimport argparse\n\nfrom tensorflow.keras.callbacks import EarlyStopping, TensorBoard\nfrom tensorflow.keras import optimizers\nfrom tensorflow.keras.models import load_model\n\nf...
[ [ "tensorflow.keras.callbacks.TensorBoard", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.callbacks.EarlyStopping" ] ]
cinai/teacher_discourse_form
[ "7d6863dbf8d628011c6b0653ae7ca4e218c2d3bc" ]
[ "sessions_coding/fixtures/make_fixture_sessions_jp.py" ]
[ "import json\nimport os\nimport pandas as pd\nimport datetime as dt\nimport numpy as np\n# paths\ndata_path = r\"C:\\Users\\usuario\\Documents\\Python Scripts\\topic_forms\\teacher_discourse_form\\data\"\nsessions_path = os.path.join(data_path,'audio_db_simplify.xlsx')\nsessions_files_path = os.path.join(data_path,...
[ [ "pandas.read_excel" ] ]
pitrack/arglinking
[ "5f4677efe580e2d22915d66be26ceff331a3b2c2" ]
[ "miso/data/fields/sequence_label_field.py" ]
[ "from typing import Dict, List, Union, Set\nimport logging\nimport textwrap\n\nfrom overrides import overrides\nimport torch\n\nfrom miso.utils.checks import ConfigurationError\nfrom miso.utils.string import pad_sequence_to_length\nfrom miso.data.fields.field import Field\nfrom miso.data.fields.sequence_field impor...
[ [ "torch.LongTensor" ] ]
DavidSolanas/TFG
[ "dc84a8b11cfcc53e13ba6080793e3550bea6a48b" ]
[ "src/results/show_first_convs.py" ]
[ "\"\"\"\n File: show_first_convs.py\n Author: David Solanas Sanz\n TFG\n\"\"\"\n\nimport argparse\nimport os\n\nimport keras\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport tensorflow as tf\nfrom keras.backend.tensorflow_backend import set_session\nfrom keras.models import load_model\n\n\ndef ...
[ [ "tensorflow.ConfigProto", "tensorflow.Session", "numpy.squeeze", "matplotlib.pyplot.subplots" ] ]
workready/pythonbasic
[ "59bd82caf99244f5e711124e1f6f4dec8de22141" ]
[ "sources/t12/t12ej01.py" ]
[ "import numpy as np\nimport pandas as pd\ns = pd.Series([1,3,5,np.nan,6,8])\nprint(s)" ]
[ [ "pandas.Series" ] ]
katiehouse3/microsoft-azure-ml-notebooks
[ "1a1e57efc114c9623eb8a75a137cde08bd151ba6", "1a1e57efc114c9623eb8a75a137cde08bd151ba6" ]
[ "CIFAR-notebook/cnn_pytorch.py", "mashable-news-popularity/preprocess.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data import sampler\n\nimport torchvision.datasets as dset\nimport torchvision.transforms as T\n\nimport numpy as np\n\nfrom azureml.core import Run\nfrom utils import load_data\n\nimport tor...
[ [ "torch.nn.Linear", "torch.device", "torch.no_grad", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.cuda.is_available", "torch.nn.functional.cross_entropy", "torch.utils.data.DataLoader" ], [ "sklearn.model_selection.train_test_split", "pandas.qcut" ] ]
LinjianMa/AutoHOOT
[ "5f9b790afb15cf4ae97cd0929a1db65d7c0347b3" ]
[ "autohoot/autodiff.py" ]
[ "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.prod" ] ]
TomBlock/cate
[ "3924300a9d85f09fd40bc67b9f8a220230788d1c" ]
[ "test/core/test_workspace.py" ]
[ "import json\nimport os\nimport unittest\nfrom collections import OrderedDict\n\nimport numpy as np\nimport pandas as pd\nimport xarray as xr\n\nfrom cate.core.workflow import Workflow, OpStep\nfrom cate.core.workspace import Workspace, WorkspaceError, mk_op_arg, mk_op_args, mk_op_kwargs\nfrom cate.util.undefined i...
[ [ "numpy.array", "numpy.random.rand", "pandas.DataFrame", "pandas.date_range", "numpy.random.randn" ] ]
eitanrich/improved_wgan_training
[ "87dcc7fabf12fae07f99f17fd345b258dc92bcd9" ]
[ "mfa_adversarial_wgan_gp.py" ]
[ "import os, sys\nsys.path.append(os.getcwd())\n\nimport time\nimport functools\n\nimport numpy as np\nimport tensorflow as tf\nimport sklearn.datasets\n\nimport tflib as lib\nimport tflib.ops.linear\nimport tflib.ops.conv2d\nimport tflib.ops.batchnorm\nimport tflib.ops.deconv2d\nimport tflib.save_images\n# import t...
[ [ "tensorflow.ones_like", "tensorflow.__version__.startswith", "tensorflow.reshape", "tensorflow.zeros_like", "tensorflow.depth_to_space", "tensorflow.tanh", "tensorflow.random_normal", "tensorflow.cast", "tensorflow.concat", "tensorflow.sigmoid", "tensorflow.train.Saver"...
DunZhang/imbalanced-learn
[ "69a80c09d3bb52f265afab5464fc904321640fea" ]
[ "imblearn/utils/estimator_checks.py" ]
[ "\"\"\"Utils to check the samplers and compatibility with scikit-learn\"\"\"\n\n# Adapated from scikit-learn\n# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>\n# License: MIT\n\nfrom __future__ import division\n\nimport sys\nimport traceback\n\nfrom collections import Counter\n\nimport pytest\n\nimport numpy ...
[ [ "scipy.sparse.issparse", "numpy.array", "sklearn.utils.testing.set_random_state", "numpy.zeros", "sklearn.utils.estimator_checks.check_parameters_default_constructible", "sklearn.cluster.KMeans", "sklearn.utils.estimator_checks.check_estimator", "sklearn.utils.testing.assert_allclo...
cclauss/active-qa
[ "10ae211927233a0170dd0b44b1b0c4c54a74919f", "10ae211927233a0170dd0b44b1b0c4c54a74919f" ]
[ "px/nmt/model.py", "px/nmt/train.py" ]
[ "# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.matmul", "tensorflow.reshape", "tensorflow.gradients", "tensorflow.to_float", "tensorflow.tile", "tensorflow.tanh", "tensorflow.nn.embedding_lookup", "tensorflow.random_normal", "tensorflow.no_op", "tensorflow.train.GradientDescentOptimizer", "tensorflow.tra...
SamLau95/plotly.py
[ "7dd4ddd4e18e79ff30cec3ef331fa2f8949ed1bd" ]
[ "plotly/graph_objs/graph_objs.py" ]
[ "\"\"\"\ngraph_objs\n==========\n\nA module that understands plotly language and can manage the json\nstructures. This module defines two base classes: PlotlyList and PlotlyDict.\nThe former inherits from `list` and the latter inherits from `dict`. and is\nA third structure, PlotlyTrace, is also considered a base c...
[ [ "pandas.Series" ] ]
AlexanderRubinstein/gvp
[ "00323029899f11e1270f863d2847a9629a75936c" ]
[ "src/models.py" ]
[ "# Portions of this code were adapted from \n# https://github.com/jingraham/neurips19-graph-protein-design\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras import *\nfrom tensorflow.keras.layers import *\nfrom gvp import *\n\nclass MQAModel(Model):\n def __init__(self, node_features, edge_fe...
[ [ "tensorflow.math.acos", "tensorflow.reshape", "tensorflow.linalg.norm", "tensorflow.linalg.cross", "tensorflow.zeros_like", "tensorflow.clip_by_value", "tensorflow.math.sqrt", "tensorflow.stack", "tensorflow.cast", "tensorflow.shape", "tensorflow.concat", "numpy.log...
branislav1991/DeepRLPlayground
[ "57c6a76fa5d0016c730cd499f77a33c05de7fe60" ]
[ "common.py" ]
[ "import numpy as np\nimport torch\n\n\ndef select_action_policy(state, policy_network, value_network):\n \"\"\"Selects action following a sample of the policy network.\n\n Returns:\n (selected action, log probability of action, value).\n \"\"\"\n with torch.no_grad():\n val = value_network...
[ [ "torch.no_grad", "torch.distributions.Categorical", "numpy.random.rand", "numpy.random.randint" ] ]
stanhelsloot/project
[ "8da0927777a95fa3ed6f1fcc3704c26f1c8433d0" ]
[ "scripts/excelconverter.py" ]
[ "# Stan Helsloot, 10762388\n# script desgined for transforming csv/txt files to JSON files.\nimport pandas as pd\nimport json\n\nINPUT = \"../data/data_raw/Gaswinning-totaal-1963-2015-maandelijks.xlsx\"\nOUTPUT_MONTH = \"../data/data_refined/data_months.json\"\nOUTPUT_YEAR = \"../data/data_refined/data_years.json\"...
[ [ "pandas.read_excel" ] ]
kangcheol/torchcv
[ "561ef4e662fff1b9b47060bb08842408a205e689" ]
[ "model/cls/nets/shufflenetv2.py" ]
[ "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n# Author: Donny You (youansheng@gmail.com)\n# Class Definition for ShuffleNetv2 Models.\n\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch\nimport torch.nn as nn\nfrom collections import ...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.init.kaiming_uniform_", "torch.nn.Sigmoid", "torch.nn.Sequential", "torch.nn.MaxPool2d", "torch.split", "torch.nn.init.constant_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ] ]
Juju-botu/diffeqml-research
[ "aa796c87447e5299ec4f25a07fc4d032afb1f63e" ]
[ "neural-hybrid-automata/src/nn.py" ]
[ "\"Encoder and Decoder modules for NHA and ODE baselines\"\n\nimport torch\nfrom torch.distributions import Independent, Normal, Categorical\nimport torch.nn as nn\nfrom src.odeint import jagged_fixed_odeint\nfrom time import time\nfrom copy import deepcopy\n\n\n################ MODEL WRAPPERS ##################\nc...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.distributions.Categorical", "torch.gt", "torch.nn.Softmax", "torch.max", "torch.arange", "torch.nn.Tanh", "torch.distributions.Normal", "torch.ne", "torch.sum", "torch.nn.Softplus", "torch.zeros_like", ...
ManiacMaxo/Thesis
[ "38507f7ff09ae4e6cb26a457a03eafda7d3fda08" ]
[ "src/utils/save_pred_h5.py" ]
[ "from typing import Union\n\nimport h5py\nimport numpy as np\nfrom tensorflow.keras.models import Model, load_model\n\nfrom utils import load_dataset\n\n\ndef save_predictions(model: Union[str, Model], dist: str) -> None:\n \"\"\"Save predictions as h5\n\n Args:\n model (Union[str, Model]): model save ...
[ [ "tensorflow.keras.models.load_model" ] ]
ishine/lidbox
[ "e60d5ad2ff4d6076f9afaa780972c0301ee71ac8" ]
[ "lidbox/features/__init__.py" ]
[ "import kaldiio\nimport tensorflow as tf\n\n\ndef feature_scaling(X, min, max, axis=None):\n \"\"\"Apply feature scaling on X over given axis such that all values are between [min, max]\"\"\"\n X_min = tf.math.reduce_min(X, axis=axis, keepdims=True)\n X_max = tf.math.reduce_max(X, axis=axis, keepdims=True)...
[ [ "tensorflow.TensorSpec", "tensorflow.shape", "tensorflow.math.reduce_std", "tensorflow.bitwise.bitwise_and", "tensorflow.math.divide_no_nan", "tensorflow.math.reduce_mean", "tensorflow.signal.frame", "tensorflow.math.reduce_max", "tensorflow.numpy_function", "tensorflow.pad...
dthevenin/pycryptobot
[ "177e7d4012c93b3a6e59bafd5c1103e7e69cc62d" ]
[ "models/exchange/coinbase_pro/api.py" ]
[ "\"\"\"Remotely control your Coinbase Pro account via their API\"\"\"\n\nimport re\nimport json\nimport hmac\nimport hashlib\nimport time\nimport requests\nimport base64\nimport sys\nimport pandas as pd\nfrom datetime import datetime, timedelta\nfrom requests.auth import AuthBase\nfrom requests import Request\n\n# ...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
lianxiaolei/LaTeX_OCR
[ "1e1f196468e678c93dfa2d8ab2ba02fbda38a3c0" ]
[ "model/components/ResNet.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom torchvision.models.resnet import ResNet\r\nfrom torchvision.models.resnet import BasicBlock\r\n\r\n\r\ndef ResNet9(output_dim=1):\r\n model = ResNet(BasicBlock, [1, 1, 1, 1])\r\n in_features = model.fc.in_features\r\n model.a...
[ [ "torch.nn.Linear", "torch.nn.AdaptiveAvgPool2d" ] ]
danilonumeroso/clrs
[ "666daaeab56c8192b854833d4fc9446b9d841626" ]
[ "clrs/_src/algorithms/greedy.py" ]
[ "# Copyright 2021 DeepMind Technologies Limited. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unle...
[ [ "numpy.copy", "numpy.arange", "numpy.argsort", "numpy.zeros" ] ]
nnaisense/gmpda
[ "16e9824526f778ad35e2ffe7787a1fd289662e30" ]
[ "examples/real_application/gmpda_run.py" ]
[ "import argparse\nimport logging\nimport os\nimport pickle\nimport random\nimport shutil\nimport sys\nimport time\n\nimport numpy as np\nimport pandas as pd\nimport yaml\n\nfrom gmpda import GMPDA\n\nif __name__ == \"__main__\":\n\n # parse for running configurations\n parser = argparse.ArgumentParser(descrip...
[ [ "numpy.random.seed", "pandas.read_csv", "numpy.asarray" ] ]
xndcn/torch-mlir
[ "d8ba68119e5b9ff14b2240f0f282643317b5e160" ]
[ "e2e_testing/torchscript/reduction.py" ]
[ "# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n# See https://llvm.org/LICENSE.txt for license information.\n# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n# Also available under a BSD-style license. See LICENSE.\n\nimport torch\n\nfrom torch_mlir_e2e_test.torchscript.f...
[ [ "torch.mean", "torch.sum" ] ]
eltonfernando/pytorch-ssd
[ "f46e69e29666348603f65af7911dfb8d8a557845" ]
[ "train_ssd.py" ]
[ "import argparse\nimport os\nimport logging\nimport sys\nimport itertools\nfrom torchsummary import summary\nimport torch\nfrom torch.utils.data import DataLoader, ConcatDataset\nfrom torch.optim.lr_scheduler import CosineAnnealingLR, MultiStepLR\n\nfrom vision.utils.misc import str2bool, Timer, freeze_net_layers, ...
[ [ "torch.utils.data.ConcatDataset", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.no_grad", "torch.optim.SGD", "torch.optim.lr_scheduler.MultiStepLR", "torch.cuda.is_available", "torch.utils.data.DataLoader" ] ]
LaughingBudda/hachikuji
[ "0d65ecec12dd843dfb7e3828ac3b5c3824ce6901" ]
[ "plot.py" ]
[ "import matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\n# Data for plotting\ntimes = pd.read_csv('time.csv')\naccr = pd.read_csv('accr.csv')\natmp = pd.read_csv('atmp.csv')\nx = np.linspace(100, 2000, 2000)\n\n\n# Plotting time against n\ntimeplot = times.plot(x='Unnamed: 0')...
[ [ "matplotlib.pyplot.show", "pandas.read_csv", "numpy.linspace" ] ]
ccnguyen/meta-siren
[ "9afcd30ad20551e22267f6db436910fe97a50785" ]
[ "dataio.py" ]
[ "import csv\nimport glob\nimport math\nimport os\nimport sys\n\nimport matplotlib.colors as colors\nimport numpy as np\nimport scipy.io.wavfile as wavfile\nimport scipy.ndimage\nimport scipy.special\nimport skimage\nimport skimage.filters\nimport torch\nfrom PIL import Image\nfrom torch.utils.data import Dataset\nf...
[ [ "numpy.random.choice", "numpy.exp", "numpy.mean", "torch.squeeze", "matplotlib.colors.hsv_to_rgb", "torch.manual_seed", "numpy.prod", "numpy.random.randint", "numpy.hypot", "numpy.sqrt", "numpy.poly1d", "torch.empty", "torch.Tensor", "torch.zeros", "torc...
nubank/ibis
[ "3423ab8ece7698491d491e898f739504fb3580be" ]
[ "ibis/sql/tests/test_compiler.py" ]
[ "# Copyright 2014 Cloudera 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 applicable law or agreed to...
[ [ "pandas.DataFrame" ] ]
raudette/SmartDashcamForBikesMk3
[ "d43a97f62d1b57be18a0f4f3294145ebc9fb87bc" ]
[ "SmartDashcamForBikesMk3.py" ]
[ "#!/usr/bin/env python3\n# Running the yolov5s blob based on this code from Luxonis\n# https://github.com/luxonis/depthai-experiments/tree/e12d6a7e2f40d3ada35c03fb7b0176b33efe960b/gen2-yolov5\n# Running the depth perception based on this code from Luxonis\n# https://github.com/luxonis/depthai-experiments/tree/maste...
[ [ "numpy.array", "numpy.reshape", "numpy.expand_dims" ] ]
horribleheffalump/MinimaxResearch
[ "47ea0971e4a4d721f1293b2f8608dec0e2d818e0", "47ea0971e4a4d721f1293b2f8608dec0e2d818e0" ]
[ "CMNFvsUT/OutputScripts/pics_AiT-8pics/multiplypoints.py", "CMNFvsUT/OutputScripts/pics_AiT/pic12a_switchingobs_process_sample.py" ]
[ "import numpy as np\ndef multx(x): \n xplot = np.zeros(x.size * 2 - 1)\n for i in range(0, x.size - 1):\n xplot[i * 2] = x[i]\n xplot[i * 2 + 1] = x[i + 1]\n xplot[x.size * 2 - 2] = x[x.size - 1]\n return(xplot)\ndef multy(x): \n xplot = np.zeros(x.size * 2 - 1)\n for i...
[ [ "numpy.zeros" ], [ "matplotlib.rc", "numpy.loadtxt", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.subplot" ] ]
Joranson/modifiedTF
[ "bbf3d1c16ef2b1e8d3e1add9fe07dd07d52206da" ]
[ "tensorflow/contrib/learn/python/learn/monitors.py" ]
[ "# Copyright 2016 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.training.saver.latest_checkpoint", "tensorflow.core.util.event_pb2.SessionLog", "tensorflow.python.platform.tf_logging.info", "tensorflow.contrib.learn.python.learn.session_run_hook.SessionRunArgs", "tensorflow.contrib.framework.deprecated_arg_values", "tensorflow.python...
dhiraa/sabdha
[ "f428418962dcc76f49e0a451ffc0545fda9b6b59" ]
[ "src/main/python/shabda/run/executor.py" ]
[ "# Copyright 2018 The Shabda 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 require...
[ [ "tensorflow.estimator.Estimator", "tensorflow.estimator.TrainSpec", "tensorflow.estimator.EvalSpec", "tensorflow.estimator.train_and_evaluate" ] ]
zzheng93/scenario_generator_james
[ "6c4373f338afbc8204dba059b715ec6022cb3529" ]
[ "cases/case_3/1_create_LHS_matrix.py" ]
[ "# %% Load necessary libraries\nimport numpy as np\nimport pandas as pd\nimport pyDOE\nimport os\nimport shutil\n\n# https://codeday.me/bug/20170427/11215.html \ndef find_nearest(array,value):\n idx = (np.abs(array-value)).argmin()\n return array[idx]\n\n\n\ndef DOY_lat_temp(DOY, latitude, df): \n df_DOY =...
[ [ "pandas.read_pickle", "numpy.savetxt", "numpy.asarray", "numpy.loadtxt", "numpy.abs" ] ]
nicoguaro/scivis_tutorial_pycon2019
[ "0de8635b52c469bf9315e7cfdf994fe03ca74dbb" ]
[ "code/one_dimensional_colormap.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nGráfico de una viga en voladizo\n\n@author: Nicolas Guarin-Zapata\n@date: Febrero 14, 2018\n\"\"\"\nfrom __future__ import division, print_function\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nplt.style.use(\"../img/matplotlib.mplstyle\")\n\n# Data\nfname = \"../data/int...
[ [ "numpy.log", "matplotlib.pyplot.savefig", "numpy.genfromtxt", "matplotlib.pyplot.figure", "numpy.loadtxt", "matplotlib.pyplot.style.use", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.meshgrid", "matplotlib.pyplot.xticks" ] ]
wavecomp/waveext
[ "ef7da7f751d565c160f4e6fbaa71b6ef256702cd" ]
[ "test/test_multiply_grad_dfx.py" ]
[ "#!/usr/bin/env python3\n\n# test_multiply_grad_dfx.py \n#\n# Copyright (c) 2010-2018 Wave Computing, Inc. and its applicable licensors. \n# All rights reserved; provided, that any files identified as open source shall\n# be governed by the specific open source license(s) applicable to such files. \n#\n# For any ...
[ [ "tensorflow.glorot_normal_initializer", "numpy.array", "tensorflow.Session", "tensorflow.reset_default_graph", "numpy.multiply", "numpy.allclose", "tensorflow.global_variables_initializer" ] ]
jamesobutler/porespy
[ "ec9791e63db6e6a1281e364f4d2ea5d3796f70c9" ]
[ "test/unit/test_filters_ibip.py" ]
[ "import numpy as np\nimport porespy as ps\nimport scipy.ndimage as spim\nfrom skimage.morphology import square\nfrom edt import edt\nps.settings.tqdm['disable'] = True\n\n\nclass IBIPTest():\n\n def setup_class(self):\n np.random.seed(0)\n self.im = ps.generators.lattice_spheres(shape=[101, 101],\n...
[ [ "numpy.zeros_like", "numpy.random.seed", "numpy.copy", "numpy.all", "numpy.unique" ] ]
cistcontest/face_recognition_contest
[ "65921aaf43b3866824bdafdda0fe66e5c5a00f96" ]
[ "src/api_detect.py" ]
[ "\"\"\"Performs face alignment and stores face thumbnails in the output directory.\"\"\"\n# MIT License\n# \n# Copyright (c) 2016 David Sandberg\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# i...
[ [ "numpy.asarray", "numpy.zeros", "numpy.minimum", "tensorflow.Graph", "scipy.misc.imresize", "scipy.misc.imread", "tensorflow.ConfigProto", "numpy.argmax", "numpy.power", "scipy.misc.imsave", "numpy.squeeze", "tensorflow.GPUOptions", "numpy.vstack", "numpy.ma...
sw005320/espnet-1
[ "6ecde88045e1b706b2390f98eb1950ce4075a07d" ]
[ "espnet/nets/pytorch_backend/conformer/encoder.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# Copyright 2019 Shigeki Karita\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\n\"\"\"Encoder definition.\"\"\"\n\nimport logging\nimport torch\n\nfrom espnet.nets.pytorch_backend.conformer.convolution import ConvolutionModule\nfrom espnet.nets.pyt...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.LayerNorm", "torch.nn.Embedding" ] ]
jongkweh/onnxruntime
[ "742694f6796a3ce4426881f51eb3fddd38abb08e" ]
[ "onnxruntime/python/tools/transformers/benchmark_helper.py" ]
[ "# -------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n# --------------------------------------------------------------------------...
[ [ "torch.cuda.manual_seed", "torch.cuda.manual_seed_all", "numpy.random.seed", "numpy.percentile", "torch.from_numpy", "torch.manual_seed", "torch.empty", "numpy.var" ] ]
TerryGriffin/xlsor_lung_segmentation
[ "369fdd75c45c0398b8c6c683a21eef14a0ced758" ]
[ "segment_cxr.py" ]
[ "from argparse import ArgumentParser\nimport os\nimport sys\nimport pathlib\nimport numpy as np\nimport logging\nimport cv2\nimport torch.nn as nn\nimport torch.distributed\nimport torch\nfrom networks.xlsor import XLSor\nfrom PIL import Image as PILImage\nfrom skimage import io, transform\n\n\nlogger = logging.get...
[ [ "torch.device", "numpy.array", "numpy.asarray", "torch.distributed.init_process_group", "torch.no_grad", "numpy.shape", "torch.from_numpy", "torch.nn.Upsample", "torch.cuda.is_available", "numpy.clip" ] ]
ankitaguhaoakland/ml-workshop-intermediate-2-of-2
[ "46579bce28f858c581e5b0a2e4c5a29ee19ba676" ]
[ "notebooks/solutions/02-ex01-solutions.py" ]
[ "from sklearn.naive_bayes import GaussianNB\n\nnb = GaussianNB().fit(X_train, y_train)\n\nnb_proba = nb.predict_proba(X_test)\n\nbrier_score_loss(y_test, nb_proba[:, 1])\n\nplot_calibration_curve(y_test, nb_proba[:, 1], n_bins=10)\n" ]
[ [ "sklearn.naive_bayes.GaussianNB" ] ]
willdickson/imafly
[ "1152940a523f83c3e15e43eef0a698d3a23ca513" ]
[ "python/imafly/imafly/stimulus.py" ]
[ "import cv2\nimport numpy as np\n\nfrom . import ref_input\n\nclass Stimulus:\n\n def __init__(self, param):\n self.param = param\n self.image = create_image(param['image'])\n self.motion = self.get_motion_model(param['motion'])\n self.vel = np.array([0.0, 0.0])\n self.pos = np...
[ [ "numpy.array", "numpy.linspace", "numpy.zeros" ] ]