repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
xudongxiang/NMTGMinor
[ "78e25157b0a95a13d9093ac145eab7259761d348" ]
[ "onmt/ModelConstructor.py" ]
[ "import torch, copy\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport onmt\nfrom onmt.modules.Transformer.Models import TransformerEncoder, TransformerDecoder, Transformer\nfrom onmt.modules.Transformer.Layers import PositionalEncoding\n\ninit = torch.nn.init\n\nMAX_LEN = onmt.Constants.max_positi...
[ [ "torch.nn.ModuleList", "torch.load" ] ]
aakhundov/deep-german
[ "2f6183d4585cf7bff7c2556bb89ec963b3397142", "2f6183d4585cf7bff7c2556bb89ec963b3397142" ]
[ "rnn_deep_german.py", "evaluate_manual.py" ]
[ "import sys\nimport tensorflow as tf\nimport tensorflow.contrib.rnn as rnn\n\nfrom datetime import datetime\n\nfrom read_data import read_data_sets\nfrom rnn_word_model import RNNWordModel\n\n\nMAX_WORD_LEN = 31\nALPHABET_SIZE = 31\nNUM_GENDERS = 3\n\nEPOCHS = 30\n\n# the hyperparameters below are\n# configurable w...
[ [ "tensorflow.local_variables_initializer", "tensorflow.placeholder", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "tensorflow.Session", "tensorflow.train.AdamOptimizer", "tensorflow.train.Saver" ], [ "tensorflow.placeholder", "numpy.argmax", "tens...
serre-lab/brain-score
[ "dad1c2ce6f969d9e0d89f610e7c84b05b7c143c9" ]
[ "tests/test_metrics/test___init__.py" ]
[ "import numpy as np\nfrom brainio_base.assemblies import DataAssembly\n\nfrom brainscore.metrics import Score\n\n\nclass TestScoreRaw:\n def test_sel(self):\n score = Score([1, 2], coords={'a': [1, 2]}, dims=['a'])\n score.attrs['raw'] = DataAssembly([0, 2, 1, 3], coords={'a': [1, 1, 2, 2]}, dims=[...
[ [ "numpy.testing.assert_array_equal" ] ]
ukritw/autonialm
[ "a5264753dae19b9b5257ca75433a0f55dce0f173" ]
[ "bayesian_optimization/utils/metrics_np.py" ]
[ "from __future__ import print_function, division\nfrom copy import copy\nimport numpy as np\nimport sklearn.metrics as metrics\n\n\ndef relative_error_in_total_energy(output, target):\n \"\"\"Negative means under-estimates.\"\"\"\n sum_output = np.sum(output)\n sum_target = np.sum(target)\n return float...
[ [ "numpy.abs", "numpy.linalg.norm", "numpy.sum", "numpy.zeros" ] ]
TheGoldfish01/pydpf-core
[ "75ca8a180454f94cedafbc68c1d6f20dcfc4c795" ]
[ "examples/01-static-transient/00-basic_transient.py" ]
[ "\"\"\"\n.. _ref_basic_transient:\n\nTransient Analysis Result Example\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nThis example shows how to postprocess a transient result and\nvisualize the outputs.\n\nImport the necessary modules:\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom ansys.dpf import core ...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
ninkle/hotpot
[ "fbb5d80e6f224609f3c6ea0bedef925bcda4df74" ]
[ "prepro.py" ]
[ "import random\nfrom tqdm import tqdm\nimport spacy\nimport ujson as json\nfrom collections import Counter\nimport numpy as np\nimport os.path\nimport argparse\nimport torch\n# import pickle\nimport torch\nimport os\nimport re\nimport itertools\nfrom joblib import Parallel, delayed\n\nimport torch\n\nnlp = spacy.bl...
[ [ "torch.LongTensor", "numpy.random.normal", "torch.Tensor", "torch.save" ] ]
KeeratKG/pandas
[ "dd05fb7ab25935dd1d3ef39da0d1b56fb12bc0db", "dd05fb7ab25935dd1d3ef39da0d1b56fb12bc0db" ]
[ "pandas/tests/reshape/test_melt.py", "pandas/tests/io/excel/test_readers.py" ]
[ "import numpy as np\nimport pytest\n\nimport pandas as pd\nfrom pandas import (\n DataFrame,\n lreshape,\n melt,\n wide_to_long,\n)\nimport pandas._testing as tm\n\n\nclass TestMelt:\n def setup_method(self, method):\n self.df = tm.makeTimeDataFrame()[:10]\n self.df[\"id1\"] = (self.df[...
[ [ "pandas._testing.assert_produces_warning", "pandas.concat", "pandas.Series", "numpy.random.seed", "pandas.date_range", "pandas.Categorical", "pandas.wide_to_long", "pandas.Index", "pandas.MultiIndex.from_tuples", "pandas.DataFrame", "pandas.lreshape", "numpy.random....
ParadiseLab/Numerical_Methods
[ "5f6c86503ded6b77c36ee2103eee683deea63d3f" ]
[ "integration/riemann.py" ]
[ "import numpy as np\n\n\ndef riemann(function, p0, n : int):\n x,y=p0\n dx=np.abs(x-y)/n\n r=0\n for i in range(n):\n r=r+function(x)*dx\n x=x+dx\n return r\n\n\n# find the value of pi by integrating sin(x)^2 from 0 to 2pi\nf = lambda x : np.sin(x)**2\nx = riemann(f, (0, 2*np.pi), int(1...
[ [ "numpy.abs", "numpy.sin" ] ]
bourque/exoctk
[ "1d2f8e7b9c00e74033626d81593b1f879b7df6ad" ]
[ "exoctk/groups_integrations/groups_integrations.py" ]
[ "\"\"\"This is a module for calcuating groups and integrations with JWST on\nthe fly. The main function (``perform_calculation``) takes a dictionary\nof inputs (modeled around how the web tool takes inputs) which must\ninclude: ``observation_time``, ``num_groups``, ``magnitude``,\n``model``, ``band``, ``filt``, ``f...
[ [ "numpy.log10", "numpy.array", "scipy.interpolate.interp1d", "numpy.floor" ] ]
shmouses/SpectrumImageAnalysisPy
[ "4374e604fb7b493ba84b9675041015b87084e07f" ]
[ "src/DeconvolutionBlankError.py" ]
[ "from __future__ import division\nimport Spectrum\nimport SpectrumPlotter\nimport os\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport collections\nimport rms\n\nfolder = 'TestCase'\n\nspec1name = 'SimRod_(60,0).csv'\nspec1 = Spectrum.EELSSpectrum.LoadFromCSV(os.path.join(folder, spec1name))\nspec1plot =...
[ [ "matplotlib.pyplot.plot", "numpy.size", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
zdw694140234/TensorFlow2.0_ResNet
[ "a25737f6316da6c6881101e6a407f808e71ffe2f" ]
[ "models/residual_block.py" ]
[ "import tensorflow as tf\n\n\nclass BasicBlock(tf.keras.layers.Layer):\n\n def __init__(self, filter_num, stride=1):\n super(BasicBlock, self).__init__()\n self.conv1 = tf.keras.layers.Conv2D(filters=filter_num,\n kernel_size=(3, 3),\n ...
[ [ "tensorflow.nn.relu", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.Sequential", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.add" ] ]
dallascard/krippendorff_alpha
[ "337682110d3b10e566811ab8605b84f680fb9ec5" ]
[ "measure_agreement.py" ]
[ "import json\nfrom collections import Counter\nfrom optparse import OptionParser\n\nimport numpy as np\n\n\ndef main():\n usage = \"%prog infile.jsonlist\"\n parser = OptionParser(usage=usage)\n parser.add_option('--response-field', type=str, default='response',\n help='Name of column ...
[ [ "numpy.diag", "numpy.savez", "numpy.shape", "numpy.bincount", "numpy.argmin", "numpy.outer", "numpy.zeros", "numpy.sum" ] ]
gyyang/olfaction_evolution
[ "434baa85b91f450e1ab63c6b9eafb8d370f1df96" ]
[ "standard/analysis_pn2kc_training.py" ]
[ "import os\nimport sys\nimport pickle\nimport glob\nfrom pathlib import Path\nfrom collections import defaultdict\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import LinearSegmentedColormap\nimport matplotlib.animation as animation\nfrom scipy.signal import savgol_filter\nfrom skle...
[ [ "numpy.linspace", "matplotlib.pyplot.plot", "numpy.max", "numpy.mean", "numpy.exp", "numpy.histogram", "numpy.ones_like", "numpy.arange", "numpy.std", "numpy.count_nonzero", "matplotlib.pyplot.figure", "numpy.log", "numpy.isnan", "matplotlib.pyplot.ylim", ...
cgeller/WorldOnRails
[ "d8aa9f7ae67a6b7b71a2fc5ba86bb2a44f221bef" ]
[ "rails/datasets/lidar_dataset.py" ]
[ "import ray\nimport glob\nimport yaml\nimport lmdb\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\n\nfrom .main_dataset import MainDataset\n\nclass LiDARMainDataset(MainDataset):\n def __getitem__(self, idx):\n \n lmdb_txn = self.txn_map[idx]\n index = self.idx_map[i...
[ [ "numpy.concatenate", "numpy.stack" ] ]
mshvartsman/gpytorch
[ "b9d4200ad29ee1e534bcfb97f747e9d3487f1086" ]
[ "gpytorch/utils/cholesky.py" ]
[ "#!/usr/bin/env python3\n\nimport warnings\nimport torch\n\n\ndef psd_safe_cholesky(A, upper=False, out=None, jitter=None):\n \"\"\"Compute the Cholesky decomposition of A. If A is only p.s.d, add a small jitter to the diagonal.\n Args:\n :attr:`A` (Tensor):\n The tensor to compute the Chole...
[ [ "torch.cholesky", "torch.cholesky_solve", "torch.potrs", "torch.isnan" ] ]
bopopescu/phyG
[ "023f505b705ab953f502cbc55e90612047867583" ]
[ "eggs/numpy-1.6.0-py2.7-linux-x86_64-ucs4.egg/numpy/lib/tests/test_format.py" ]
[ "r''' Test the .npy file format.\n\nSet up:\n\n >>> import sys\n >>> if sys.version_info[0] >= 3:\n ... from io import BytesIO as StringIO\n ... else:\n ... from cStringIO import StringIO\n >>> from numpy.lib import format\n >>>\n >>> scalars = [\n ... np.uint8,\n ... n...
[ [ "numpy.arange", "numpy.lib.format.open_memmap", "numpy.lib.format.write_array_header_1_0", "numpy.lib.format.read_array", "numpy.dtype", "numpy.compat.asbytes", "numpy.compat.asbytes_nested", "numpy.array", "numpy.lib.format.write_array" ] ]
gglin001/adventofcode
[ "226140109c69a6562b8629304f97ec653b531810" ]
[ "day2/p2.py" ]
[ "import os\nimport pandas as pd\n\n\ndef func():\n cur_dir = os.path.dirname(os.path.realpath(__file__))\n fp = f'{cur_dir}/input.txt'\n df = pd.read_csv(fp, sep=' ', header=None)\n\n depth = 0\n aim = 0\n horizontal = 0\n for _, row in df.iterrows():\n if row[0] == 'down':\n ...
[ [ "pandas.read_csv" ] ]
aldanor/skggm
[ "d2e29d692d1654285653ab07fd24534628fcb076" ]
[ "inverse_covariance/profiling/metrics.py" ]
[ "import numpy as np\n\n\ndef _nonzero_intersection(m, m_hat):\n \"\"\"Count the number of nonzeros in and between m and m_hat.\n\n Returns\n ----------\n m_nnz : number of nonzeros in m (w/o diagonal)\n\n m_hat_nnz : number of nonzeros in m_hat (w/o diagonal)\n\n intersection_nnz : number of nonz...
[ [ "numpy.nonzero", "numpy.in1d", "numpy.setdiff1d", "numpy.ones", "numpy.less_equal", "numpy.diag_indices", "numpy.triu", "numpy.sum" ] ]
trunc8/cod3-hacks
[ "46cf5313af59a711f747e4b10087f2ca302e1593" ]
[ "outer-periphery-waypoints-of-racetrack/extract_pixels.py" ]
[ "#!/usr/bin/env python\nimport argparse\nimport csv\nimport cv2\nfrom itertools import product\nimport numpy as np\n\nparser = argparse.ArgumentParser(description=\"Output outer periphery waypoints given a closed loop track image\")\nparser.add_argument('-i', help=\"input image path\", default=\"\")\nargs = parser....
[ [ "numpy.zeros" ] ]
indigo-dc/retinopathy_test
[ "5e87be2a67bbbc0b82f6ca258324e80068ef9407" ]
[ "retinopathy_test/models/resnet_model.py" ]
[ "# Copyright 2017 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.nn.relu", "tensorflow.layers.batch_normalization", "tensorflow.transpose", "tensorflow.reduce_mean", "tensorflow.test.is_built_with_cuda", "tensorflow.cast", "tensorflow.identity", "tensorflow.reshape", "tensorflow.layers.dense", "tensorflow.layers.max_pooling2d...
frason88/Heart-Pred-Project
[ "45302bae16dd1c6155df2f8aacc664ec1195decd" ]
[ "app.py" ]
[ "\n#Important Modules\nfrom flask import Flask,render_template, url_for ,flash , redirect\nimport pickle\nfrom flask import request\nimport numpy as np\n\n\n\n\nimport os\nfrom flask import send_from_directory\n\n\n#from this import SQLAlchemy\napp=Flask(__name__,template_folder='template')\n\n\n\n\n@app.route(\"/\...
[ [ "numpy.array" ] ]
millerjohnp/pytorch_image_classification
[ "431ffcf78e040133a04897cc53bfba115e385a75" ]
[ "utils.py" ]
[ "import importlib\nimport json\nimport pathlib\nimport shutil\nimport tempfile\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport augmentations\nimport optim\n\n\ndef str2bool(s):\n if s.lower() == 'true':\n return True\n elif s.lower() == 'false':\n ...
[ [ "torch.optim.lr_scheduler.MultiStepLR", "torch.optim.Adam", "torch.nn.CrossEntropyLoss", "torch.nn.functional.log_softmax", "torch.sum", "numpy.cos", "numpy.save", "torch.no_grad", "torch.optim.SGD", "torch.ones_like", "torch.save" ] ]
githubsigmod2021/CodecDB
[ "a1fdc9012a6051c869fbc33bf76762c554709f29" ]
[ "encoding_selection/src/main/python/example/tf_lstm.py" ]
[ "import tensorflow as tf\n\ntf.contrib.rnn.BasicLSTMCell(10)" ]
[ [ "tensorflow.contrib.rnn.BasicLSTMCell" ] ]
gfrias/CarNDFinalProject
[ "341a4e5097bdad8d53ed7e84aed256355dffe50a" ]
[ "ros/src/tl_detector/light_classification/nn/saved_model/train_tf_classifier.py" ]
[ "\r\nimport glob\r\nimport imageio\r\nimport random\r\nimport scipy\r\nimport numpy as np\r\nimport tensorflow as tf\r\n\r\n\r\ndef modify_picture(image):\r\n # flip\r\n if np.random.rand() > 0.60:\r\n image = np.fliplr(image)\r\n\r\n # rotate\r\n if np.random.rand() > 0.60:\r\n max_angle ...
[ [ "tensorflow.layers.conv2d", "tensorflow.layers.flatten", "tensorflow.concat", "tensorflow.nn.softmax_cross_entropy_with_logits", "numpy.fliplr", "tensorflow.layers.dropout", "tensorflow.layers.dense", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "num...
JerrikEph/fastNLP
[ "999a14381747068e9e6a7cc370037b320197db00" ]
[ "test/io/test_embed_loader.py" ]
[ "import unittest\nimport numpy as np\n\nfrom fastNLP import Vocabulary\nfrom fastNLP.io import EmbedLoader\n\n\nclass TestEmbedLoader(unittest.TestCase):\n def test_load_with_vocab(self):\n vocab = Vocabulary()\n glove = \"test/data_for_tests/glove.6B.50d_test.txt\"\n word2vec = \"test/data_...
[ [ "numpy.linalg.norm" ] ]
NyckelAI/codesamples
[ "9a719eddb71969ddfd06400eec176e0036a886b0" ]
[ "automl_benchmark/results.py" ]
[ "import csv\nimport json\n\nimport fire\nimport numpy as np\n\n\ndef accuracy(test_file, pred_file):\n\n with open(test_file, \"r\") as csvfile:\n csvreader = csv.reader(csvfile, delimiter=\",\", quotechar='\"')\n next(csvreader)\n gts = [row[2] for row in csvreader]\n\n with open(pred_fi...
[ [ "numpy.argmax" ] ]
rajesh-lab/Inverse-Weighted-Survival-Games
[ "8e86065001fe58a3f99523b590992ac84a5d1cc4" ]
[ "_nll.py" ]
[ "import models\nimport os\nimport copy\nimport torch\nimport torch.nn as nn\nfrom lifelines import KaplanMeierFitter as KMFitter\nimport pycox\nimport numpy as np\n\n\n# local\nimport util\n\n############################################\n############ NLL ###########################\n################################...
[ [ "torch.eq", "torch.where" ] ]
pgDora56/rough
[ "8f168e9d870369c9ca1530ac72a177f849b5ee76" ]
[ "pyaudio/QuizSoundJudge.py" ]
[ "# -*- coding: utf-8 -*-\r\nimport pyaudio\r\nimport wave\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\ndef drawGraph(datas):\r\n xorigin = np.frombuffer(datas, dtype=\"int16\")\r\n x = xorigin / 3276800.0\r\n\r\n \"\"\"\r\n plt.figure(figsize=(15,3))\r\n plt.plot(x)\r\n plt.show...
[ [ "numpy.frombuffer", "numpy.fft.fft" ] ]
ornithos/pytorch-mtds-mocap
[ "3ec10387d3d897e9a20d789bd4a3782a047519f7" ]
[ "src/mtfixb_model.py" ]
[ "\"\"\"Sequence-to-sequence model for human motion prediction.\"\"\"\n\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom torch.nn import Parameter\n\nfrom typing import *\nfrom enum import IntEnum\n\nclass Dim(IntEnum):\n batch = 0\n seq = 1\n feature = 2\n\n\nclass MTGRU(nn.Module):\n \"\"\...
[ [ "torch.randn_like", "torch.sigmoid", "torch.ones", "numpy.min", "torch.cat", "torch.zeros", "torch.randn", "torch.nn.GRU", "torch.nn.Tanh", "torch.tanh", "torch.nn.Linear", "numpy.prod", "numpy.array", "numpy.zeros", "torch.ones_like" ] ]
youtang1993/self-attention-cv
[ "ae215541d3e33d39f26947924253a63585683226" ]
[ "self_attention_cv/vit/vit.py" ]
[ "import torch\nimport torch.nn as nn\nfrom einops import rearrange\n\nfrom self_attention_cv import TransformerEncoder\n\n\nclass ViT(nn.Module):\n def __init__(self, *,\n img_dim,\n in_channels=3,\n patch_dim=16,\n num_classes=10,\n ...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.randn" ] ]
Fricker95/MMCL
[ "4218fcf94760a733f47354769afd03188be92b55" ]
[ "MMCL/MMCL/Brownian.py" ]
[ "#! /bin/python3\n\n\"\"\"\nBrownian.py\n\nCreated by Nicolas Fricker on 1/1/21.\nCopyright © 2021 Nicolas Fricker. All rights reserved.\n\"\"\"\n\nfrom MMCL.HyperSpace \t\timport Point, Vector, Plane\n\nimport numpy as np\n\ndef brownian(D, dt, d = 2, origin = None):\n\t\"\"\"\n\tMulti dimensional brownian motion ...
[ [ "numpy.arange", "numpy.random.randn", "numpy.sqrt", "numpy.zeros" ] ]
ramfalas/Speech_driven_gesture_generation_with_autoencoder
[ "59e8ebdb0f6e87b0e81268046c99a4d6c9bf62a8" ]
[ "motion_repr_learning/ae/learn_dataset_encoding.py" ]
[ "\"\"\"\nThis file contains a script for learning encoding-decoding network\non our dataset.\n\nUsage example: python learn_dataset_encoding.py data_dir\n\nDeveloped by Taras Kucherenko (tarask@kth.se)\n\"\"\"\n\nimport sys\nimport numpy as np\nimport os\n\nimport train as tr\nfrom utils.utils import prepare_motion...
[ [ "numpy.std" ] ]
mochic/neuroglia
[ "5b4e43d3dcfd75184d205e18a251598586f9f812" ]
[ "neuroglia/utils.py" ]
[ "import numpy as np\nimport xarray as xr\nfrom scipy import interpolate\n\ndef events_to_xr_dim(events,dim='event'):\n # builds the event dataframe into coords for xarray\n coords = events.to_dict(orient='list')\n coords = {k:(dim,v) for k,v in coords.items()}\n # define a DataArray that will describe t...
[ [ "scipy.interpolate.InterpolatedUnivariateSpline" ] ]
xiaomaicha/neural-networks-and-deep-learning-python3-master
[ "3f04d6f9fdddd354617fb20446e75dc9778da674" ]
[ "src/network2.py" ]
[ "\"\"\"network2.py\n~~~~~~~~~~~~~~\n\nAn improved version of network.py, implementing the stochastic\ngradient descent learning algorithm for a feedforward neural network.\nImprovements include the addition of the cross-entropy cost function,\nregularization, and better initialization of network weights. Note\ntha...
[ [ "numpy.dot", "numpy.log", "numpy.sqrt", "numpy.linalg.norm", "numpy.argmax", "numpy.random.randn", "numpy.array", "numpy.exp", "numpy.zeros" ] ]
zhuxinqimac/VP-metrics-pytorch
[ "438e4ac927dd4186194dde58528d45b010958b89" ]
[ "generate_fid_dataset.py" ]
[ "#!/usr/bin/python\n#-*- coding: utf-8 -*-\n\n# >.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.\n# Licensed under the Apache License, Version 2.0 (the \"License\")\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# --- File Name: generate_fid_dataset.py\n# --- Creation Date: 04-03-2020\n...
[ [ "numpy.random.shuffle" ] ]
GU-CLASP/spatial_relations_vectors_sltc2018
[ "db4e3f1193f95c3da1cc8f7650117991f3f556b9" ]
[ "bucketing.py" ]
[ "import argparse\n# we need this for making faster bucketing\nfrom multiprocessing import Pool\n\n# import all required codes here\nimport os\nimport nltk\nimport numpy as np\nfrom itertools import product, permutations\n\nparser = argparse.ArgumentParser()\nparser.add_argument('-v', \"--vocab\", help=\"numpy file ...
[ [ "numpy.load", "numpy.random.shuffle", "numpy.arange", "numpy.random.seed" ] ]
spencerahill/infinite-diff
[ "b0d3ff0b5cd8347eb1785e7fc9cd3b0203136666" ]
[ "indiff/test/test_deriv_phys.py" ]
[ "import sys\nimport unittest\n\nimport numpy as np\nimport xarray as xr\n\nfrom indiff._constants import LON_STR, LAT_STR, PFULL_STR\nfrom indiff.utils import wraparound\nfrom indiff.deriv import (\n PhysDeriv, LonDeriv, LatDeriv, SphereEtaDeriv,\n LonFwdDeriv, LatFwdDeriv, EtaFwdDeriv, SphereFwdDeriv,\n L...
[ [ "numpy.random.random", "numpy.zeros", "numpy.ones" ] ]
Ybionz/moviepy
[ "570979c35dc352ccf470f93774962001e4f5cc97", "570979c35dc352ccf470f93774962001e4f5cc97" ]
[ "moviepy/video/VideoClip.py", "moviepy/Clip.py" ]
[ "\"\"\"\nThis module implements VideoClip (base class for video clips) and its\nmain subclasses:\n- Animated clips: VideofileClip, ImageSequenceClip\n- Static image clips: ImageClip, ColorClip, TextClip,\n\"\"\"\nimport os\nimport subprocess as sp\nimport tempfile\nimport warnings\n\nimport numpy as np\nfrom im...
[ [ "numpy.hstack", "numpy.arange", "numpy.tile", "numpy.dstack", "numpy.isscalar", "numpy.zeros", "numpy.vstack" ], [ "numpy.arange" ] ]
prlz77/meta-dataset
[ "e764bd663a80b46b9a21eeae1058465f6a754d61", "e764bd663a80b46b9a21eeae1058465f6a754d61" ]
[ "meta_dataset/data/imagenet_hierarchy_test.py", "meta_dataset/dataset_conversion/convert_datasets_to_records.py" ]
[ "# coding=utf-8\n# Copyright 2019 The Meta-Dataset 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 require...
[ [ "numpy.random.choice" ], [ "tensorflow.flags.DEFINE_string", "tensorflow.app.run" ] ]
85599/NSE_DATA_COLLECTION
[ "6f4ba9302b8d688952f41f510f6f7d7693e1f3cc" ]
[ "NSE_DATA_COLLECTION.py" ]
[ "##############################################################################\r\n# Copyright (C) 2020, 2021 Khushal Jain\r\n##############################################################################\r\n#\r\n# WARNING! All changes made in this file will be lost!\r\n\r\n\r\nimport requests\r\nimport time\r\nimp...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
yutiansut/tars-1
[ "866c7d1030a985a6f336193b093a6711d87b9efd" ]
[ "correct_values.py" ]
[ "import numpy\nimport talib\n\ndecimals = 4\n\n\n\ndef convert_array_to_vec(array):\n array = array[numpy.logical_not(numpy.isnan(array))].round(4)\n string = \"[\"\n for elem in array:\n string += str(elem) + \", \"\n string = string[:-2]\n string += \"];\"\n return string\n\n# Data series...
[ [ "numpy.isnan", "numpy.array" ] ]
igbitx/micro-displays
[ "ccfb4cfd19fa56f778832e71394b9ac56403a7b1" ]
[ "main240x240.py" ]
[ "# Copyright 2020 ig https://github.com/igbit\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 ...
[ [ "numpy.dstack" ] ]
alexeytomashyov/LightAutoML
[ "41e8e10d430344dbdb5e39dd48342653ee31988c", "41e8e10d430344dbdb5e39dd48342653ee31988c" ]
[ "lightautoml/transformers/numeric.py", "lightautoml/ml_algo/linear_sklearn.py" ]
[ "\"\"\"Numeric features transformers.\"\"\"\n\nfrom typing import Union\n\nimport numpy as np\nfrom log_calls import record_history\n\nfrom .base import LAMLTransformer\nfrom ..dataset.base import LAMLDataset\nfrom ..dataset.np_pd_dataset import PandasDataset, NumpyDataset\nfrom ..dataset.roles import NumericRole, ...
[ [ "numpy.log", "numpy.nanmedian", "numpy.isinf", "numpy.linspace", "numpy.clip", "numpy.isnan", "numpy.unique", "numpy.quantile", "numpy.nanmean", "numpy.nanstd", "numpy.zeros", "numpy.where" ], [ "sklearn.linear_model.Lasso", "sklearn.linear_model.Elastic...
whxbergkamp/RobustDL_GAN
[ "a622faf1c7d5e803bca3091dd035c616b5736bd7" ]
[ "svhn/adversarial_networks/models/resnet18.py" ]
[ "\nimport tensorflow as tf\nfrom tensorflow.contrib import slim\nimport logging\n\n\nlogger = logging.getLogger(__name__)\n\n\n_BATCH_NORM_DECAY = 0.997\n_BATCH_NORM_EPSILON = 1e-5\n\n\n################################################################################\n# Convenience functions for building the ResNet ...
[ [ "tensorflow.nn.relu", "tensorflow.layers.batch_normalization", "tensorflow.transpose", "tensorflow.reshape", "tensorflow.identity", "tensorflow.truncated_normal_initializer", "tensorflow.nn.tanh", "tensorflow.pad", "tensorflow.layers.average_pooling2d" ] ]
fwitte/ogs
[ "0b367872fc58ecd4e1dbfe1dcebbc847da6639d7" ]
[ "Tests/Data/Parabolic/T/1D_neumann/plotLine.py" ]
[ "#!/usr/bin/env python\n\nimport temperature_analytical\nfrom matplotlib.legend import Legend\nfrom vtk import *\nfrom vtk.numpy_interface import dataset_adapter as dsa\nfrom vtk.util.numpy_support import vtk_to_numpy\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport pandas as pd\nimport scipy...
[ [ "pandas.concat", "matplotlib.pyplot.rc", "matplotlib.pyplot.subplots", "pandas.DataFrame", "matplotlib.pyplot.close" ] ]
xinzha623/transform
[ "55f6d1d1847450fc95b9d31915a67227bad195f1" ]
[ "tensorflow_transform/coders/csv_coder_test.py" ]
[ "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "numpy.testing.assert_equal", "tensorflow.FixedLenFeature", "tensorflow.SparseFeature", "tensorflow.VarLenFeature", "numpy.array" ] ]
RezaFirouzii/python-opencv-review
[ "454a2be7fa36516a2b1fbd4e6162068bba25c989" ]
[ "1) Applying Geometric Transformations to Images/#4 Image translation/translation.py" ]
[ "import cv2 as cv\nimport numpy as np\n\nif __name__ == \"__main__\":\n \n img = cv.imread('../../assets/test1.jpg')\n height, width = img.shape[:2] # rows, columns\n\n # translating the img 200 pixels right (x axis)\n translation_matrix = np.float32([[1, 0, 200], [0, 1, 0]])\n output = cv.warpA...
[ [ "numpy.float32" ] ]
wantedly/recsys2020-challenge
[ "d9967860cc4767380d28d2ed7af00d467cc6941a" ]
[ "features/common_flg_features.py" ]
[ "import pandas as pd\nfrom base import BaseFeature\n\n\nclass CommonFlgFeatures(BaseFeature):\n def import_columns(self):\n return [\n \"engaged_is_verified\",\n \"engaging_is_verified\",\n \"engagee_follows_engager\",\n ]\n\n def make_features(self, df_train_inp...
[ [ "pandas.DataFrame" ] ]
arjunsurendran24/tensorflow
[ "381dadbf32dfd6bf06cb1b3da3c30bdc5218e53c" ]
[ "tensorflow/python/autograph/impl/api.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.util.tf_stack.CurrentModuleFilter", "tensorflow.python.util.tf_inspect.getfullargspec", "tensorflow.python.autograph.converters.asserts.transform", "tensorflow.python.autograph.operators.py_builtins.overload_of", "tensorflow.python.autograph.utils.ag_logging.warn", "tens...
JackHaoyingZhou/RBE595_DL_Discussion
[ "db16141b1cd18a03f182d418a2cf092f57fe4a6b" ]
[ "week4/Regression/boston_standardized_larger.py" ]
[ "# Carlos Morato, PhD.\n# cwmorato@wpi.edu\n# Deep Learning for Advanced Robot Perception\n#\n# Regression Example With Boston Dataset: Standardized and Larger\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n\nimport numpy\nimport pandas\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfr...
[ [ "sklearn.cross_validation.cross_val_score", "pandas.read_csv", "numpy.random.seed", "sklearn.pipeline.Pipeline", "sklearn.preprocessing.StandardScaler" ] ]
joearedmond/tutorials
[ "bd7f5b4024769df5d6ae898fd736680e6c21bab8" ]
[ "tutorials/assets/tensorflow_to_onnx_example.py" ]
[ "# SPDX-License-Identifier: Apache-2.0\n\n# 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.o...
[ [ "tensorflow.nn.max_pool", "tensorflow.cast", "tensorflow.train.AdamOptimizer", "tensorflow.get_default_graph", "tensorflow.nn.conv2d", "tensorflow.graph_util.convert_variables_to_constants", "tensorflow.Variable", "tensorflow.ConfigProto", "tensorflow.reset_default_graph", ...
chaveshigor/Spark
[ "3102e6263c61218ea8cadc399e08f4ca3b43a421" ]
[ "src/entities/capacitance.py" ]
[ "from numpy.linalg import inv\nimport numpy as np\nimport math\n\nclass Capacitance:\n\n def __init__(self, p, C, v0, i0, dt):\n\n self.p = p\n self.p1 = p.split('-')[0]\n self.p2 = p.split('-')[1]\n self.C = C\n self.v0 = v0\n self.i0 = i0\n self.dt = dt\n ...
[ [ "numpy.linalg.inv" ] ]
Sylvester-dev/Crypto-Imposters
[ "0021b16e27103adc075c0acfddf3693447be1e37" ]
[ "old-frontend/packages/ImposterAPI/MakeImposter.py" ]
[ "# Built with python 3, dependencies installed with pip \n# library to generate images - Pillow \n# https://pillow.readthedocs.io/en/stable/installation.html\nfrom PIL import Image\n\n# library to work with arrays \n# https://numpy.org/\nimport numpy as np\n\n#extra added for flask\nfrom flask import Flask, jsonify...
[ [ "numpy.array" ] ]
GowravTata/flask-app
[ "267113bdcb81d308b0f1eff81a43200dc477ddcc" ]
[ "new.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Jul 23 15:48:41 2020\r\n\r\n@author: Gowrav Tata\r\n\"\"\"\r\n\r\nimport pandas as pd\r\nfrom flask import Flask, jsonify, request\r\nimport pickle\r\n\r\n# load model\r\nmodel = pickle.load(open('model.pkl','rb'))\r\n\r\n# app\r\napp = Flask(__name__)\r\n\r\n# r...
[ [ "pandas.DataFrame.from_dict" ] ]
daniellehot/ROB10
[ "9dc1e8641eb5545925fd3ed28698c5a328843df3" ]
[ "affordanceAnalyzer/scripts/client_usage_example.py" ]
[ "#!/usr/bin/env python3\nimport rospy\nfrom affordance_analyzer.srv import getAffordanceSrv, getAffordanceSrvResponse\nimport numpy as np\nimport cv2\nfrom cameraService.cameraClient import CameraClient\nfrom affordanceService.client import AffordanceClient\nfrom rob9Utils.visualize import visualizeMasksInRGB, visu...
[ [ "numpy.zeros", "numpy.save" ] ]
urbanecm/2021-icloud-private-relay-usage
[ "adb93ea8ee67b25a3271e20d0067fc1543939b9b" ]
[ "check_private_relay_usage.py" ]
[ "#!/usr/bin/env python\n\nimport ipaddress\n\nfrom collections import defaultdict\n\nimport pandas as pd\nimport numpy as np\n\nfrom pyspark.sql import SparkSession\nfrom pyspark.sql import functions as F, types as T, Window\n\n# load iCloud's private relay egress ranges\n# data comes from https://mask-api.icloud.c...
[ [ "pandas.read_csv" ] ]
wangshusen/PyRLA
[ "066876545c8501dca8ec857676465553a0ebb822" ]
[ "sketch/leverage.py" ]
[ "import numpy\n\nimport sketch.countsketch as cs\nimport sketch.srft as srft\n\ndef lev_exact(a_mat):\n '''\n Compute Exact Column Leverage Scores\n \n Input\n a_mat: m-by-n dense matrix A (n >> m).\n \n Output\n lev_vec: n-dim vector containing the exact leverage scores\n '''\n ...
[ [ "numpy.dot", "numpy.linalg.svd", "numpy.sqrt", "numpy.random.choice", "numpy.random.randn", "numpy.sum" ] ]
nikhiljay/ml
[ "b99f2727bcffce6dc8c5313dfac3b7b8387c46f8" ]
[ "Boston-Housing/boston.py" ]
[ "# Written by Nikhil D'Souza\n# Data from http://lib.stat.cmu.edu/datasets/boston\n\n# This neural network predicts the values of houses in Boston based on:\n# 1. per capita crime rate by town\n# 2. proportion of residential land zoned for lots over 25,000 sq.ft.\n# 3. proportion of non-retail business acres per to...
[ [ "numpy.expand_dims" ] ]
tlestang/autodE
[ "fd80995206ac601299d2f78105d0fe4deee8c2cf", "fd80995206ac601299d2f78105d0fe4deee8c2cf" ]
[ "autode/geom.py", "tests/test_species.py" ]
[ "import numpy as np\nfrom scipy.spatial.distance import cdist\nfrom scipy.spatial import distance_matrix\nfrom autode.log import logger\n\n\ndef are_coords_reasonable(coords):\n \"\"\"\n Determine if a set of coords are reasonable. No distances can be < 0.7 Å\n and if there are more than 4 atoms ensure the...
[ [ "numpy.square", "numpy.dot", "numpy.linalg.svd", "numpy.sqrt", "numpy.min", "numpy.asarray", "numpy.tril_indices", "numpy.cos", "scipy.spatial.distance_matrix", "numpy.linalg.norm", "numpy.sin", "numpy.round", "numpy.identity", "numpy.average", "numpy.ar...
AmitHasanShuvo/data-inspector
[ "69637f0dcc45707c2efac39a21d4aecca8bb1ac9" ]
[ "data_inspector/data_inspector.py" ]
[ "import matplotlib.pyplot as plt\nimport seaborn as sns\nimport warnings\nimport numpy as np\nimport pandas as pd\nfrom scipy.stats import pearsonr\nfrom scipy import stats\n\nwarnings.filterwarnings(\"ignore\")\n\n\"\"\"\nNAME \n data_inspector\nDESCRIPTION\n This module brings different functions to make ED...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.scatter", "scipy.stats.pearsonr", "numpy.triu_indices_from", "matplotlib.pyplot.subplots", "scipy.stats.probplot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.subplot", "numpy.zeros_like", "matplotlib.pyplot.grid", "matpl...
made-ml-in-prod-2021/mrtimmy89
[ "d1c6d69aae63e396d1ee6b4f5e9238a8b04a44f2" ]
[ "online_inference/src/data/preprocess_data.py" ]
[ "\"\"\"\r\nA small script to make from a .csv file with given data the similar but without a column \"target\"\r\n\"\"\"\r\n\r\nimport pandas as pd\r\n\r\nSOURCE_FILEPATH = \"data/raw/heart.csv\"\r\nPROCESSED_FILEPATH = \"data/processed/data_without_prediction.csv\"\r\n\r\ndf = pd.read_csv(SOURCE_FILEPATH, index_co...
[ [ "pandas.read_csv" ] ]
theodorecooper/face2pixel
[ "842f74d98099f7f7f310b1c900c879307c70328f" ]
[ "faceDetect/faceDetect.py" ]
[ "import cv2\r\nimport sys\r\nimport os.path\r\nimport numpy as np\r\nfrom glob import glob\r\n\r\ndef detect(filename, cascade_file=\"faceDetect/haarcascade_frontalcatface.xml\"):\r\n print('Detecting faces...')\r\n print('Format Spport: *.jpg')\r\n if not os.path.isfile(cascade_file):\r\n raise Run...
[ [ "numpy.argsort", "numpy.copy" ] ]
TinkTheBoush/stable-baselines
[ "1f1b7823c2ed5286a6aff516af365e37b37813d9" ]
[ "stable_baselines/sac/sac.py" ]
[ "import time\nimport warnings\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom stable_baselines.common import tf_util, OffPolicyRLModel, SetVerbosity, TensorboardWriter\nfrom stable_baselines.common.vec_env import VecEnv\nfrom stable_baselines.common.math_util import safe_mean, unscale_action, scale_action\nf...
[ [ "tensorflow.Graph", "numpy.log", "tensorflow.control_dependencies", "tensorflow.reduce_mean", "tensorflow.minimum", "tensorflow.assign", "tensorflow.placeholder", "tensorflow.exp", "tensorflow.stop_gradient", "tensorflow.global_variables_initializer", "tensorflow.summar...
vanderschaarlab/inverse-online
[ "bfcaebad5b556251f836cc8412b24e5ca840f552" ]
[ "iol/models/rcal.py" ]
[ "import torch\n\nfrom iol.models import BaseModel\nimport torch.nn.functional as F\n\nfrom sklearn.metrics import accuracy_score, roc_auc_score, average_precision_score\n\n\nclass RCAL(BaseModel):\n def __init__(\n self,\n covariate_size: int,\n action_size: int,\n hidden_size: int,\n...
[ [ "torch.abs", "torch.nn.functional.softmax", "torch.nn.Linear", "torch.distributions.Categorical", "torch.nn.functional.one_hot" ] ]
DimitraSt/Neural_Machine_Translation
[ "cbb4bfa1eb400d664d1bfb3e5c99fad1d26d6952" ]
[ "try_tensor.py" ]
[ "import torch\n\nif __name__ == '__main__':\n\tx = torch.rand(3,5, 3)\n\tprint(x)\n\tprint(x[0:3:2])" ]
[ [ "torch.rand" ] ]
vivelakorea/pymks
[ "5f42557b9a63f865a590704f34930cdab9ee07c9", "5f42557b9a63f865a590704f34930cdab9ee07c9" ]
[ "pymks/datasets/elastic_FE_simulation.py", "pymks/datasets/base_microstructure_generator.py" ]
[ "import pytest\nsfepy = pytest.importorskip('sfepy')\n\nimport numpy as np\nfrom sfepy.base.goptions import goptions\nfrom sfepy.discrete.fem import Field\ntry:\n from sfepy.discrete.fem import FEDomain as Domain\nexcept ImportError:\n from sfepy.discrete.fem import Domain\nfrom sfepy.discrete import (FieldVa...
[ [ "numpy.ones_like", "numpy.min", "numpy.reshape", "numpy.empty_like", "numpy.max", "numpy.zeros_like", "numpy.floor", "numpy.array", "numpy.where" ], [ "numpy.array", "numpy.cumsum", "numpy.random.seed", "numpy.allclose" ] ]
maoyab/OWUS
[ "daf90bd40b4906504332e2e7ee0650b25f1f593b" ]
[ "get_WUS_sites.py" ]
[ "import sys \nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom datetime import datetime\nfrom pickle import dump, load\nfrom sswm import SM_C_H\nfrom param_sm_pdf import Processor\n\n\ndef go_mhmcmc(dfi, unknown_params, save_params, epsi=None, stress_type='dynamic', num_pl=3...
[ [ "matplotlib.pyplot.legend", "pandas.concat", "pandas.read_csv", "matplotlib.pyplot.tight_layout", "numpy.linspace", "numpy.median", "matplotlib.pyplot.savefig", "pandas.DataFrame", "numpy.std", "matplotlib.pyplot.close", "numpy.array", "matplotlib.pyplot.suptitle", ...
sabadijou/cooperative_scene_parsing
[ "0689c8057757a9efec387c272ddae9074861b07a" ]
[ "utils/sunrgbd_utils.py" ]
[ "\"\"\"\nCreated on April, 2018\n\n@author: Siyuan Huang\n\nscripts used in SUNRGBD Dataset\n\n\"\"\"\nimport numpy as np\nfrom camera_utils import normalize_point\nfrom shapely.geometry.polygon import Polygon\n\n\ndef flip_towards_viewer(normals, points):\n points = points / np.linalg.norm(points)\n proj = p...
[ [ "numpy.abs", "numpy.min", "numpy.vstack", "numpy.linalg.norm", "numpy.tile", "numpy.max", "numpy.argsort", "numpy.array", "numpy.where", "numpy.zeros" ] ]
Czaki/cellpose
[ "fe3a0f9c18323faffd05fffe760dc29db22624f6" ]
[ "cellpose/dynamics.py" ]
[ "from scipy.ndimage.filters import maximum_filter1d\nimport scipy.ndimage\nimport skimage.morphology\nimport numpy as np\nfrom tqdm import trange\nimport time\nimport mxnet as mx\nimport mxnet.ndarray as nd\nfrom numba import njit, float32, int32, vectorize\nfrom . import utils, metrics\n\n@njit('(float64[:], int32...
[ [ "numpy.expand_dims", "numpy.concatenate", "scipy.ndimage.filters.maximum_filter1d", "numpy.argmin", "numpy.exp", "numpy.unique", "numpy.reshape", "numpy.arange", "numpy.stack", "numpy.zeros", "numpy.isin", "numpy.log", "numpy.nonzero", "numpy.median", "n...
JiHyuk-Byun/FOTS.PyTorch-1
[ "b2b128ebdedc081862d68d1eea9da4dcd7e24e5a" ]
[ "FOTS/utils/util.py" ]
[ "import os\nimport pathlib\nimport typing\n\nimport numpy\nimport torch\nimport collections\nimport cv2\nimport numpy as np\nfrom sklearn.decomposition import PCA\nimport string\n\nkeys = string.printable\n\n\ndef ensure_dir(path):\n if not os.path.exists(path):\n os.makedirs(path)\n\n\ndef show_box(image...
[ [ "pandas.read_csv", "numpy.min", "torch.tensor", "numpy.max", "torch.IntTensor", "numpy.array", "sklearn.decomposition.PCA" ] ]
veronicamorfi/pytorch-lightning
[ "19df43d7a5f523d83d97d835d8bcbf13e2ed243b" ]
[ "tests/core/test_lightning_module.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.nn.Linear", "torch.device", "torch.nn.ReLU", "torch.distributed._sharded_tensor.empty", "torch.distributed._sharding_spec.ChunkShardingSpec" ] ]
ugurcanarikan/bert
[ "55d003f9f42a06e309d44f7694dbe7bd6e172fd9" ]
[ "tokenization.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl...
[ [ "tensorflow.gfile.GFile" ] ]
tkent198/modRSW_EnKF
[ "fc9f0bcc6f753a05fed245d4d2987cd3a34078ad" ]
[ "parameters.py" ]
[ "####################################################################\n## \t\t\t FIXED PARAMETERS \t\t\t ##\n####################################################################\n'''\nAuthor: T. Kent (amttk@leeds.ac.uk)\nList of fixed parameters for model integration and EnKF.\n'''\n\nimport numpy as np\n\n'...
[ [ "numpy.linspace" ] ]
nobleschools/college-lists
[ "ea11b495f8433c036095bf9d00fd1340490f76dc" ]
[ "reports_modules/create_students.py" ]
[ "#!python3\r\n\"\"\"Module for working with student records and making Students tab\"\"\"\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom reports_modules.excel_base import safe_write, write_array\r\nfrom reports_modules.excel_base import make_excel_indices\r\n\r\nDEFAULT_FROM_TARGET = 0.2 # default prediction...
[ [ "pandas.concat", "pandas.isnull", "numpy.isnan", "pandas.DataFrame", "numpy.round", "numpy.floor", "numpy.isreal" ] ]
rushabh-v/numpy
[ "f30b2564d3923b2c307a026e4a22d20bc19872f0" ]
[ "numpy/lib/tests/test_shape_base.py" ]
[ "from __future__ import division, absolute_import, print_function\n\nimport numpy as np\nimport functools\nimport sys\nimport pytest\n\nfrom numpy.lib.shape_base import (\n apply_along_axis, apply_over_axes, array_split, split, hsplit, dsplit,\n vsplit, dstack, column_stack, kron, tile, expand_dims, take_alon...
[ [ "numpy.lib.shape_base.array_split", "numpy.expand_dims", "numpy.lib.shape_base.tile", "numpy.lib.shape_base.take_along_axis", "numpy.squeeze", "numpy.lib.shape_base.dstack", "numpy.lib.shape_base.apply_along_axis", "numpy.lib.shape_base.apply_over_axes", "numpy.lib.shape_base.h...
sunshinenum/text_classification
[ "68c10cf5f51c4c99b39447e2871250274f953111" ]
[ "a02_TextCNN/p7_TextCNN_train.py" ]
[ "# -*- coding: utf-8 -*-\n#import sys\n#reload(sys)\n#sys.setdefaultencoding('utf-8') #gb2312\n#training the model.\n#process--->1.load data(X:list of lint,y:int). 2.create session. 3.feed data. 4.training (5.validation) ,(6.prediction)\n#import sys\n#reload(sys)\n#sys.setdefaultencoding('utf8')\nimport tensorflow ...
[ [ "tensorflow.constant", "numpy.sqrt", "tensorflow.train.latest_checkpoint", "tensorflow.assign", "tensorflow.app.flags.DEFINE_integer", "tensorflow.ConfigProto", "numpy.random.uniform", "tensorflow.global_variables_initializer", "tensorflow.app.flags.DEFINE_string", "tensorf...
FelixTheC/hackerrank_exercises
[ "24eedbedebd122c53fd2cb6018cc3535d0d4c6a0" ]
[ "hackerrank/eye_and_identity.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n@created: 01.12.19\n@author: felix\n\"\"\"\nimport numpy as np\n\nif __name__ == '__main__':\n n, m = input().split(' ')\n np.set_printoptions(legacy='1.13')\n print(np.eye(int(n), int(m), 0))\n" ]
[ [ "numpy.set_printoptions" ] ]
MFajcik/SemEval_2020_Task-5
[ "c20b2aa34d7e2613cd3c8b3c1e3881e320ebdd9e" ]
[ "subtask_2/src_scripts/transformers_task2/run_albert_xxlarge_v2_task2.py" ]
[ "import logging\nimport os\nimport sys\nimport torch\n\nfrom src_scripts.common.utils import setup_logging\nfrom src_scripts.transformers_task2.task2_transformers_trainer import TransformerTask2Framework\n\nconfig = {\n \"objective_variant\": \"independent\",\n \"decoding_variant\": \"independent\",\n \"to...
[ [ "torch.cuda.is_available" ] ]
mmim2904/molecool
[ "0c5c13cfec112e0d4af85044e6d8bec60f7d5b6a" ]
[ "molecool/io/pdb.py" ]
[ "\"\"\"\nFunctions for reading and writing pdb files.\n\"\"\"\n\nimport numpy as np\n\ndef open_pdb(f_loc):\n # This function reads in a pdb file and returns the atom names and coordinates.\n with open(f_loc) as f:\n data = f.readlines()\n\n c = []\n sym = []\n for l in data:\n if 'ATOM...
[ [ "numpy.array" ] ]
TobbeTripitaka/ant_lithosphere
[ "a9f7b735da78a5296f648cb3bb94c1c31843c668", "a9f7b735da78a5296f648cb3bb94c1c31843c668" ]
[ "SCM6/corkO/corkO.py", "SCM6/nuuk/nuuk.py" ]
[ "# \n# corkO\n# www.fabiocrameri.ch/colourmaps\nfrom matplotlib.colors import LinearSegmentedColormap \n \ncm_data = [[0.24651, 0.24352, 0.2292], \n [0.24607, 0.24243, 0.23232], \n [0.24564, 0.24145, 0.23554], \n [0.24522, 0.24052, 0.2...
[ [ "matplotlib.colors.LinearSegmentedColormap.from_list", "matplotlib.pyplot.show", "numpy.linspace" ], [ "matplotlib.colors.LinearSegmentedColormap.from_list", "matplotlib.pyplot.show", "numpy.linspace" ] ]
EmpereurCC/Spinningup_uptodate
[ "f93e7edf778237a0e79bfdb45f7529522bd34ed4" ]
[ "spinup/algos/ppo_pyco_load/ppo_pyco_load.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport gym\nimport time\nimport spinup.algos.ppo_pyco.core as core\nimport matplotlib.pyplot as plt\nfrom gym.spaces import Box, Discrete\nfrom spinup.utils.logx import EpochLogger\nfrom spinup.utils.mpi_tf import MpiAdamOptimizer, sync_all_params\nfrom spinup.utils.mpi...
[ [ "tensorflow.summary.FileWriter", "numpy.random.seed", "tensorflow.reduce_mean", "tensorflow.logical_or", "tensorflow.cast", "tensorflow.minimum", "tensorflow.exp", "tensorflow.global_variables_initializer", "numpy.append", "tensorflow.Summary.Value", "tensorflow.summary...
khoihd/pyDcop
[ "02ae6b7a486650134a404cb988ff28f96ba85e29" ]
[ "pydcop/algorithms/dsatuto.py" ]
[ "#!/usr/bin/env python3\n\n# BSD-3-Clause License\n#\n# Copyright 2017 Orange\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# ...
[ [ "numpy.random.random" ] ]
gitter-badger/scipy
[ "0d10fea581d5044bbecc8b4fbe8c11fc102f6592" ]
[ "scipy/special/__init__.py" ]
[ "\"\"\"\n========================================\nSpecial functions (:mod:`scipy.special`)\n========================================\n\n.. currentmodule:: scipy.special\n\nNearly all of the functions below are universal functions and follow\nbroadcasting and automatic array-looping rules.\n\n.. seealso::\n\n `sc...
[ [ "numpy.dual.register_func", "scipy._lib._testutils.PytestTester" ] ]
tangtang95/qslim-recommender
[ "31b3825a171f3010890491f1b9675072a37252aa" ]
[ "course_lib/Notebooks_utils/compileCython.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on 16/07/2017\n\n@author: Maurizio Ferrari Dacrema\n\"\"\"\n\n\ntry:\n from setuptools import setup\n from setuptools import Extension\nexcept ImportError:\n from distutils.core import setup\n from distutils.extension import Extension\n\n...
[ [ "numpy.get_include" ] ]
marionmari/pyGP_PR
[ "e7f62a04ab4064b541d7cdc64f142e9dcdf23735" ]
[ "src/Core/means.py" ]
[ "#================================================================================\n# Marion Neumann [marion dot neumann at uni-bonn dot de]\n# Daniel Marthaler [marthaler at ge dot com]\n# Shan Huang [shan dot huang at iais dot fraunhofer dot de]\n# Kristian Kersting [kristian dot kersting at cs dot tu...
[ [ "numpy.dot", "numpy.ones", "numpy.floor", "numpy.array", "numpy.zeros" ] ]
LbsIrving/PyTorch
[ "314dbe9efc9e0116a7342d4ae3ab168c1c3afa32", "314dbe9efc9e0116a7342d4ae3ab168c1c3afa32" ]
[ "PyTorch Recipes/Part 1/loading_data_recipe.py", "PyTorch Recipes/Part 2/profiler.py" ]
[ "import torch\r\nimport torchaudio\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n# A data point in Yesno is a tuple (waveform, sample_rate, labels) where labels\r\n# is a list of integers with 1 for yes and 0 for no.\r\n# yesno_data = torchaudio.datasets.YESNO(\r\n# './Data/YESNO',\r\n# do...
[ [ "matplotlib.pyplot.show", "torch.utils.data.DataLoader", "matplotlib.pyplot.figure" ], [ "torch.randn", "torch.autograd.profiler.record_function", "torch.autograd.profiler.profile" ] ]
sciarrilli/bdd100k-instance-segmentation
[ "3520e798fd27095e23a9c99ff508a04d6c541b5b" ]
[ "samples/bdd100k/bdd100k.py" ]
[ "\"\"\"\nMask R-CNN\nTrain on the bdd100k segmentation dataset from https://www.bdd100k.com/\n\nWritten by Nick Sciarrilli\n\n------------------------------------------------------------\n\nUsage: import the module (see Jupyter notebooks for examples), or run from\n the command line as such:\n\n # Train a ...
[ [ "numpy.ascontiguousarray", "matplotlib.use", "numpy.reshape", "numpy.dstack", "numpy.concatenate", "numpy.argsort", "numpy.array", "numpy.zeros", "numpy.where" ] ]
bguedj/pyrotor
[ "31620de00f69d4ff2e0c4c8b03f38f80742c1d44" ]
[ "tests/test_data_analysis.py" ]
[ "# !/usr/bin/env python\n# -*- coding:utf-8 -*-\n\n\"\"\"\nTest the basis module\n\"\"\"\nimport unittest\nfrom pytest import raises\n\nimport numpy as np\nimport pandas as pd\n\nfrom pyrotor.data_analysis import nb_samples_is_sufficient\nfrom pyrotor.data_analysis import compute_covariance\nfrom pyrotor.data_analy...
[ [ "pandas.DataFrame", "numpy.testing.assert_almost_equal", "numpy.max", "pandas.testing.assert_frame_equal", "numpy.random.rand", "numpy.array", "numpy.sum" ] ]
yukeyi/MCDS-Capstone
[ "f7ce48fc5d3f5f96c1f29556585ed2338683c7d2" ]
[ "code4step1/main.py" ]
[ "import os\nimport random\nimport time\nimport cv2\nimport shutil\nimport argparse\nfrom multiprocessing.dummy import Pool\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom torch.utils.data import DataLoader, Dataset\nfrom torchsumma...
[ [ "torch.nn.Softmax", "torch.nn.ConvTranspose2d", "torch.cat", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.init.xavier_normal", "numpy.concatenate", "torch.nn.MaxPool2d", "torch.nn.Upsample", "torch.sort", "torch.cuda.is_available", "torch.nn.init.constant", ...
Ilmosal/QuantumSampling
[ "52a8e1cb15cfe15c09059d9cd060fd1f02867abe" ]
[ "src/model_cd.py" ]
[ "\"\"\"\nClass for estimating the model distribution of an RBM with contrastive divergence algorithm.\n\"\"\"\n\nimport numpy as np\n\nfrom model import Model\nfrom utils import sample, sigmoid\n\nclass ModelCD(Model):\n \"\"\"\n Base class for model\n \"\"\"\n\n def __init__(self, parameters, cd_iter, ...
[ [ "numpy.dot", "numpy.random.default_rng" ] ]
mynameistechno/aimet
[ "507f9fd2985b1f569766aca711db534ef11e856e" ]
[ "TrainingExtensions/tensorflow/src/python/aimet_tensorflow/keras/quant_sim/qc_quantize_wrapper.py" ]
[ "# /usr/bin/env python3.5\n# -*- mode: python -*-\n# =============================================================================\n# @@-COPYRIGHT-START-@@\n#\n# Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# ...
[ [ "tensorflow.Variable" ] ]
mitalbert/HPI_CPS_DL18_Project
[ "c0fdcaed444dd59f1d79b25e897ca598766017ef" ]
[ "resnet101.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torchvision import models\nfrom torch.autograd import Variable\n\n\nresnet101 = models.resnet101(pretrained=True)\n\nclass Resnet101Feats(nn.Module):\n def __init__(self):\n super(Resnet101Feats, self).__init__()\n self.features = nn.Sequential(\n resnet101.con...
[ [ "torch.nn.Sequential" ] ]
Thomasw219/RLBench
[ "da6e87049bab67919e14ecd001eb69f289259647" ]
[ "rlbench/task_environment.py" ]
[ "import logging\nfrom typing import List, Callable\n\nimport numpy as np\nfrom pyquaternion import Quaternion\nfrom pyrep import PyRep\nfrom pyrep.errors import IKError\nfrom pyrep.objects import Dummy\n\nfrom rlbench import utils\nfrom rlbench.action_modes import ArmActionMode, ActionMode\nfrom rlbench.backend.exc...
[ [ "numpy.random.get_state", "numpy.abs", "numpy.allclose", "numpy.linalg.norm", "numpy.shape", "numpy.array" ] ]
xiong233/Scissors
[ "51d191cc54924d1ee117ae463948508664b0f737" ]
[ "lib/model/cycle_gan/models.py" ]
[ "#encoding=utf-8\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Function\nimport pdb\nclass ResidualBlock(nn.Module):\n def __init__(self, in_features):\n super(ResidualBlock, self).__init__()\n\n conv_block = [ nn.ReflectionPad2d(1),\n n...
[ [ "torch.nn.Sequential", "torch.nn.ReflectionPad2d", "torch.nn.Conv2d", "torch.nn.Sigmoid", "torch.nn.InstanceNorm2d", "torch.nn.LeakyReLU", "torch.nn.ReLU" ] ]
djmaity/md-davis
[ "5ddc446a31366ca242b81a603ff4d09b4368f0f2" ]
[ "md_davis/xvg.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nThis module parses and plots the data from xmgrace (.xvg) files\ngenerated by GROMACS. Although xmgrace can show such plots; the look is\noutdated and difficult for quick comparison of multiple files.\n\"\"\"\n\nimport numpy\nimport os\nimport re\n\nimport click\nimport matplotlib....
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplot", "numpy.shape", "matplotlib.pyplot.suptitle", "numpy.array", "matplotlib.pyplot.show" ] ]
giswqs/geemap
[ "f9cc15856db253416aa3863e14502702d7eb7e1d" ]
[ "geemap/foliumap.py" ]
[ "\"\"\" This module extends the folium Map class. It is designed to be used in Google Colab, as Google Colab currently does not support ipyleaflet.\n\"\"\"\nimport os\n\nimport ee\nimport folium\nfrom folium import plugins\n\nfrom .common import *\nfrom .conversion import *\nfrom .legends import builtin_legends\n\n...
[ [ "numpy.max", "numpy.min" ] ]
hamsik1223/bert-nmt
[ "4dca398013a0b667ad6d5c24a27108540407e076" ]
[ "fairseq/models/transformer_withSE.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport math\nfrom typing import Any, Dict, List, Optional, Tuple\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional ...
[ [ "torch.sigmoid", "torch.empty", "torch.Tensor", "torch.load", "torch.nn.init.constant_", "torch.nn.functional.dropout", "torch.nn.ModuleList", "torch.cat", "torch.zeros", "torch.nn.Embedding", "torch.any", "torch.nn.Linear", "torch.nn.init.normal_", "torch.n...
satoshifuku/monty_hall
[ "2ae4fb7036b380621d2519742df8af47ce83506b" ]
[ "monty_hall.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport pathlib\n\n\ndef counter(counts, car, chosen):\n return counts[-1] + 1 if car == chosen else counts[-1]\n\n\ndef main():\n \n not_switched = {'count':[0], 'rate':[.0]}\n switched = {'count':[0], 'rate':[.0]}\n n_doors = 3\n n_trials = 10...
[ [ "matplotlib.pyplot.legend", "numpy.random.choice", "matplotlib.pyplot.ylim", "matplotlib.pyplot.figure", "matplotlib.pyplot.plot", "numpy.round", "numpy.random.randint", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "numpy.where", "matplotlib.pyplot.ylabel" ] ...
CarkusL/SFA3D
[ "0f76706fdf722472930ef6f8473b0a84d6e34790" ]
[ "sfa/utils/eval.py" ]
[ "import io as sysio\nimport time\n\nimport numba\nimport numpy as np\nfrom scipy.interpolate import interp1d\n\nfrom nms_gpu import rotate_iou_gpu_eval\n\n\ndef get_mAP(prec):\n sums = 0\n for i in range(0, len(prec), 4):\n sums += prec[i]\n return sums / 11 * 100\n\n\n@numba.jit\ndef get_thresholds...
[ [ "numpy.linspace", "numpy.cos", "numpy.stack", "numpy.concatenate", "numpy.max", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
Mixality/sus-analysis-toolkit
[ "21a3575ccb6c078dffa2d9b7d943004468e1a973" ]
[ "Charts.py" ]
[ "import statistics\nfrom collections import Counter\nimport numpy as np\nimport plotly.graph_objects as go\nimport pandas as pd\nimport Annotations\nimport plotly.io as pio\n\nimport Helper\n\npio.templates.default = 'seaborn'\n\nplotSize = {0: 500,\n 1: 500,\n 2: 600,\n 3: 700,\n ...
[ [ "numpy.exp", "numpy.linspace", "pandas.DataFrame" ] ]