repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
SimonKrughoff/ginga
[ "abcd284228400092b2d7b73bb51d30632e90ee03" ]
[ "ginga/AutoCuts.py" ]
[ "#\n# AutoCuts.py -- class for calculating auto cut levels\n#\n# This is open-source software licensed under a BSD license.\n# Please see the file LICENSE.txt for details.\n#\nimport numpy as np\nimport threading\n\nfrom ginga.misc import Bunch\n#from ginga.misc.ParamSet import Param\nfrom ginga.util import zscale\...
[ [ "numpy.mean", "numpy.multiply", "numpy.sort", "numpy.size", "numpy.cumsum", "numpy.histogram", "numpy.nanmin", "numpy.nonzero", "numpy.arange", "numpy.isfinite", "numpy.nanmax", "numpy.flatnonzero", "numpy.array", "numpy.ma.getmaskarray", "numpy.std", ...
matthiaslinsenmeier/my_individual_repo_emission_app
[ "35f0cf4bdd35d576b0bfdfcf0d9def894fc1bdf9" ]
[ "app.py" ]
[ "\"\"\" write to a SQLite database with forms, templates\n add new record, delete a record, edit/update a record\n \"\"\"\n\nfrom flask import Flask, render_template, request, flash, send_file, make_response, jsonify, abort, session, redirect, url_for\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_boots...
[ [ "pandas.to_datetime", "pandas.read_sql" ] ]
Sale1996/automatization_of_data_mining_project
[ "223aec59231586563a3b125bff064f8420630a8f" ]
[ "automatization_of_data_mining_project/prediction_module/classes/predictors/classificators/knn_classificator.py" ]
[ "from sklearn.model_selection import GridSearchCV\n\nfrom data_set_info_data_class.data_class.preprocessed_data_set_info import PreprocessedDataSetInfo\nfrom prediction_module.classes.data_class.predictor_type_enum import PredictorTypeEnum\nfrom prediction_module.classes.predictors.predictor import Predictor\nfrom ...
[ [ "sklearn.neighbors.KNeighborsClassifier" ] ]
fuxiAIlab/PMTC
[ "bea55d821bc8adf64044194a0b72d8ce913a6213", "bea55d821bc8adf64044194a0b72d8ce913a6213" ]
[ "app/downstream_tasks/core/game_toy_datasets.py", "game_seq_embedder/game_seq_embedder/transformers/modeling_tf_pytorch_utils.py" ]
[ "import ipdb\nimport torch\nimport collections\nimport random\nfrom torch import nn\nfrom torch.utils.data import Dataset\nfrom pytorch_lightning import Trainer, seed_everything\n\n\nclass ChurnPredictToyDataset(Dataset):\n def __init__(self, data_size, seq_len, vocab_size, input_size,\n mask_zer...
[ [ "torch.zeros", "torch.bincount", "torch.stack", "torch.argsort", "torch.full_like", "torch.randint", "torch.full", "torch.tensor", "torch.bernoulli", "torch.empty", "torch.nn.Embedding" ], [ "tensorflow.python.keras.backend.batch_set_value", "torch.from_nump...
nyamashi/BigDL
[ "0813c90f006f0bd613d950f4440b1bb65199b0c2" ]
[ "python/orca/test/bigdl/orca/learn/ray/pytorch/test_estimator_pytorch_backend.py" ]
[ "#\n# Copyright 2016 The BigDL Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law ...
[ [ "torch.nn.Linear", "torch.cat", "torch.stack", "numpy.array_equal", "numpy.random.rand", "torch.ones", "torch.manual_seed", "numpy.random.randint", "torch.utils.data.DataLoader", "torch.nn.BCELoss", "torch.zeros", "numpy.array", "numpy.random.randn", "torch....
XuHg-zjcn/Spectrum-Transform
[ "7d93a499503686b3acb7c1906f1fdb76bfd0681b" ]
[ "grad_mult_scan.py" ]
[ "from PIL import Image\nfrom scipy.ndimage.filters import gaussian_filter\nimport numpy as np\nimport os\nvis_base='./hres_vis'\nir_base='./hres_tir'\nnlst = np.load('nlst.npy')\nscans = np.zeros([len(nlst), 40, 40])\nfor ni, n in enumerate(nlst):\n\tprint(ni,'/',len(nlst))\n\tvis_name = os.path.join(vis_base, 'FLI...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.load", "scipy.ndimage.filters.gaussian_filter", "numpy.save", "numpy.sqrt", "numpy.gradient" ] ]
maz2009/Grasp-and-lift-EEG-challenge
[ "36fe555d523c3ca3f201e765b1b1004dc5383dd2" ]
[ "preprocessing/filterBank.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jul 21 17:24:01 2015.\n\n@author: fornax, alexandre\n\"\"\"\nimport numpy as np\nfrom sklearn.base import BaseEstimator, TransformerMixin\n\nfrom scipy.signal import butter, lfilter\n\n\nclass FilterBank(BaseEstimator, TransformerMixin):\n\n \"\"\"Filterbank Trans...
[ [ "scipy.signal.butter", "numpy.array", "scipy.signal.lfilter" ] ]
griswaldbrooks/botvac_testing
[ "34471d96a4fbc3ac03b36fc79b0ff7ec871d0c75" ]
[ "botvac_tools/lds_tools/play_scans.py" ]
[ "#!/usr/bin/env python\n#\n# MIT License\n#\n# Copyright (c) 2016 Griswald Brooks\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# in the Software without restriction, including without limitation...
[ [ "matplotlib.pyplot.subplot", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
larsmans/cython
[ "4b29260d24af8fe7924efd2291a931e8bdf938f1" ]
[ "runtests.py" ]
[ "#!/usr/bin/python\n\nimport os\nimport sys\nimport re\nimport gc\nimport locale\nimport shutil\nimport time\nimport unittest\nimport doctest\nimport operator\nimport subprocess\nimport tempfile\nimport traceback\nimport warnings\n\ntry:\n import platform\n IS_PYPY = platform.python_implementation() == 'PyPy'...
[ [ "numpy.get_include" ] ]
bfis/coffea
[ "e5e67d410e86faee1172fcc864774d7024d97653" ]
[ "coffea/lookup_tools/csv_converters.py" ]
[ "import numpy\nimport sys\nimport warnings\n\n# pt except for reshaping, then discriminant\nbtag_feval_dims = {0: [1], 1: [1], 2: [1], 3: [2]}\n\n\ndef convert_btag_csv_file(csvFilePath):\n warnings.warn(\n \"Auto-conversion of btag CSV files is deprecated. Try coffea.btag_tools.BTagScaleFactor!\",\n ...
[ [ "numpy.where", "numpy.union1d" ] ]
N1kYan/vssil
[ "214363f1a924414415cfef940404d8057f6912e7" ]
[ "src/models/ulosd_layers.py" ]
[ "\"\"\"\n\n This script implements the functionalities of\n https://github.com/google-research/google-research/blob/master/video_structure/ops.py\n in PyTorch\n\n\"\"\"\nimport torch\nimport torch.nn as nn\n\nEPSILON = 1e-6\n\n\ndef make_pixel_grid(axis: int, width: int):\n \"\"\" Creates linspace of le...
[ [ "torch.cat", "torch.stack", "torch.min", "torch.tile", "torch.max", "torch.split", "torch.linspace", "torch.multiply", "torch.mean", "torch.sum" ] ]
dimitar-petrov/numba
[ "5aaf81c4605331b657778dc1d0db29ef95564b47" ]
[ "numba/targets/builtins.py" ]
[ "from __future__ import print_function, absolute_import, division\n\nimport math\nfrom functools import reduce\n\nimport numpy as np\nimport operator\n\nfrom llvmlite import ir\nfrom llvmlite.llvmpy.core import Type, Constant\nimport llvmlite.llvmpy.core as lc\n\nfrom .imputils import (lower_builtin, lower_getattr,...
[ [ "numpy.finfo" ] ]
dieterpl/iDogstra
[ "62ee246763e107335b9caf0a4f96239fa0953234" ]
[ "code/utils/kalman.py" ]
[ "import numpy as np\nimport pykalman\nfrom typing import Optional\n\n\nclass PositionKalmanFilter(object):\n \"\"\"\n A class that implements a kalman filter for a moving object in a 2D cathesian space.\n Basically a wrapper around pykalman.\n \"\"\"\n\n def __init__(self, init_state: Optional[np.arr...
[ [ "numpy.array", "numpy.zeros", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "numpy.random.randn", "numpy.eye", "matplotlib.pyplot.show" ] ]
xiaofanustc/cifar_ssl
[ "9783c43dc709905f12e3e8398dd7de0a97d2b696" ]
[ "moco/builder.py" ]
[ "\"\"\"https://github.com/facebookresearch/moco\"\"\"\nimport torch\nimport torch.nn as nn\n\n\nclass MoCo(nn.Module):\n \"\"\"\n Build a MoCo model with: a query encoder, a key encoder, and a queue\n https://arxiv.org/abs/1911.05722\n \"\"\"\n def __init__(self, base_encoder, dim=128, K=65536, m=0.9...
[ [ "torch.zeros", "torch.nn.functional.normalize", "torch.cat", "torch.nn.Linear", "torch.distributed.get_world_size", "torch.einsum", "torch.no_grad", "torch.argsort", "torch.distributed.all_gather", "torch.randperm", "torch.nn.ReLU", "torch.ones_like", "torch.dis...
dwen3232/magenta
[ "fc01346a50109ec1ee1276c6b73a8520ece0b47a" ]
[ "magenta/models/score2perf/score2perf.py" ]
[ "# Copyright 2021 The Magenta Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "tensorflow.compat.v1.reshape", "tensorflow.compat.v1.VarLenFeature", "tensorflow.compat.v1.data.Dataset.from_tensor_slices", "tensorflow.compat.v1.stack", "tensorflow.compat.v1.shape", "tensorflow.compat.v1.expand_dims", "tensorflow.compat.v1.mod", "tensorflow.compat.v1.random_uni...
Byomyyt/GnTCN
[ "e1abb8c526b2a9904d6f964b0084b54f123b82c9" ]
[ "models/networkgcn.py" ]
[ "import numpy as np \nimport torch \nimport torch.nn.functional as F \nfrom TorchSUL import Model as M \nfrom torch.nn.parameter import Parameter\nimport torch.nn.init as init \n\nclass PropLayer(M.Model):\n\tdef initialize(self, outdim, usebias=True):\n\t\tself.outdim = outdim\n\t\tself.act = torch.nn.ReLU()\n\t\t...
[ [ "torch.cat", "torch.einsum", "torch.nn.ReLU", "numpy.sqrt", "torch.nn.init.uniform_", "torch.Tensor" ] ]
kyungjaelee/robosuite
[ "0d73fcca9ed8e638632f4bd7b0f1b8ebf4640fb1" ]
[ "robosuite/mcts/mixture_logitnet.py" ]
[ "import pickle\nimport numpy as np\nimport cv2\n\nimport torch\nimport torch.nn as nn\n\nfrom torch.utils.data import Dataset\nfrom torch.utils.data import DataLoader\n\nimport math\nimport matplotlib.pyplot as plt\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\...
[ [ "torch.nn.Linear", "numpy.set_printoptions", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.set_printoptions", "torch.cuda.is_available", "torch.eye", "torch.exp", "torch.reshape", "torch.sum", "numpy.concatenate", "torch.sigmoid", "torch.mul", ...
zdou0830/crosslingual_summarization_semantic
[ "511d64b541efbfe1245b017b7dbd8317cd194f42" ]
[ "sent-level-supervised/train.py" ]
[ "# -*- coding: utf-8 -*-\nimport logging\n\nimport torch\nimport torch.cuda\n\nfrom beaver.data import build_dataset\nfrom beaver.infer import beam_search\nfrom beaver.loss import WarmAdam, LabelSmoothingLoss\nfrom beaver.model import NMTModel\nfrom beaver.utils import Saver\nfrom beaver.utils import calculate_bleu...
[ [ "torch.set_grad_enabled" ] ]
FatimahAdwan/tfx-addons
[ "2c718acb679304de144ea461cd38e222a52ed1f0" ]
[ "examples/sklearn_penguins/penguin_pipeline_sklearn_gcp_test.py" ]
[ "# Copyright 2021 Google LLC. 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...
[ [ "tensorflow.test.main" ] ]
dmezh/ece472-deeplearning
[ "42a230095ae25f14a6c39d5aaee604618767d451" ]
[ "a3-mnist/mnist_min.py" ]
[ "#!/bin/env/python3\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport tensorflow as tf\n\ndef import_images(filename):\n with open(filename, mode='rb') as images:\n\n header = np.fromfile(images, count=4, dtype='>u4')\n magic_number, image_count, row_count, col_count = header\n\n ...
[ [ "tensorflow.keras.utils.to_categorical", "numpy.delete", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPooling2D", "numpy.fromfile", "tensorflow.keras.optimize...
kaimo455/numpy_ml
[ "00d476a776f65565b1c352883dcba1942b2b5b2b" ]
[ "01_linear_regression.py" ]
[ "import numpy as np\nfrom sklearn.utils import shuffle\nfrom sklearn.datasets import load_diabetes\nimport matplotlib.pyplot as plt\n\nclass LinearRegression:\n\n def __init__(self):\n pass\n\n @staticmethod\n def load_data():\n ds = load_diabetes()\n X, Y = shuffle(ds.data, ds.target,...
[ [ "numpy.dot", "numpy.random.rand", "sklearn.datasets.load_diabetes", "matplotlib.pyplot.xlabel", "numpy.sum", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "sklearn.utils.shuffle" ] ]
ShkarupaDC/FullSubNet
[ "2aef8b656376a42fbf519e0020636a893b56c4f8" ]
[ "audio_zen/trainer/base_trainer.py" ]
[ "import shutil\nimport time\nfrom functools import partial\nfrom pathlib import Path\n\nimport librosa\nimport librosa.display\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport toml\nimport torch\nfrom joblib import Parallel, delayed\nfrom rich import print\nfrom rich.console import Console\nfrom torch.c...
[ [ "matplotlib.pyplot.switch_backend", "numpy.max", "numpy.min", "numpy.mean", "matplotlib.pyplot.subplots", "numpy.std", "matplotlib.pyplot.tight_layout", "torch.cuda.amp.GradScaler" ] ]
bjodah/chemreac
[ "dbe38a10cf6b88e66192bcc998721b61aabbd9dc" ]
[ "chemreac/tests/test_symbolic.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import print_function, division, absolute_import\n\n\nimport numpy as np\n\nfrom chemreac.symbolic import SymRD\n\n\ndef test_SymRD():\n rd = SymRD(2, [[0]], [[1]], k=[5.0])\n\n fout = rd.alloc_fout()\n rd.f(0, [7, 3], fout)\n assert np.allclose(fout, [-5*7, 5*7...
[ [ "numpy.allclose" ] ]
Hoeze/CADD-scripts
[ "6c98fe74cd83b24ff21989e1e883670726526552" ]
[ "src/scripts/lib/Annotations.py" ]
[ "import os, sys\nimport pysam\nimport numpy as np\nfrom AnalysisLib import get_from_tabix,get_range_from_tabix\nfrom AnalysisLib import eval_dbSNP_frequencies,eval_ESP_frequencies\n\n###################\n### ANNOTATIONS ###\n###################\n\nclass Annotation(object):\n consequence = False\n mandatory = ...
[ [ "numpy.mean" ] ]
yangmingustb/PTPSim
[ "63bc0b7e81846fdd02dc8c105f356595cb9f3d91" ]
[ "TrajectoryPlanning/pathPlanner5.py" ]
[ "\"\"\"\nMIT License\n\nCopyright (c) 2019 ming\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge,...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.plot", "matplotlib.pyplot.pause", ...
RitwikGupta/torchgeo
[ "14c19e35c2b17f9cd6f2dcbdc0968283aa89fbbb", "14c19e35c2b17f9cd6f2dcbdc0968283aa89fbbb" ]
[ "tests/datasets/test_so2sat.py", "torchgeo/datasets/nwpu.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\nimport os\nfrom pathlib import Path\nfrom typing import Generator\n\nimport matplotlib.pyplot as plt\nimport pytest\nimport torch\nimport torch.nn as nn\nfrom _pytest.fixtures import SubRequest\nfrom _pytest.monkeypat...
[ [ "torch.nn.Identity", "matplotlib.pyplot.close" ], [ "numpy.array", "torch.from_numpy" ] ]
varun-raghavendra/fl_faas_fabric
[ "36310d24805c5bd7258f2e432997ac9b91aee61a" ]
[ "functions/fl_client/google/main.py" ]
[ "import sys\nimport json\nimport numpy as np\nfrom bson.binary import Binary\nimport pickle\nimport requests\nimport tensorflow as tf \nfrom tensorflow import keras\nimport os\nimport bson\nfrom bson.json_util import dumps\nnp.random.seed(2)\n\nclass Client:\n client_id = 0\n\n def __init__(self, lr, optim, l...
[ [ "tensorflow.keras.optimizers.SGD", "tensorflow.data.Dataset.from_tensor_slices", "numpy.random.seed", "tensorflow.keras.layers.Flatten", "numpy.fromiter", "tensorflow.keras.layers.Dense", "tensorflow.keras.optimizers.Nadam", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.l...
LaudateCorpus1/dm_c19_modelling
[ "25c0a3c47df4f93991acaf4b5e4d3ab0a6d9b5ab", "25c0a3c47df4f93991acaf4b5e4d3ab0a6d9b5ab" ]
[ "evaluation/forecast_indexing.py", "modelling/training/checkpointing.py" ]
[ "# pylint: disable=g-bad-file-header\n# Copyright 2020 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...
[ [ "pandas.isnull", "numpy.equal", "pandas.to_datetime", "pandas.Timedelta", "pandas.DataFrame", "pandas.concat", "pandas.read_csv", "pandas.pivot_table" ], [ "tensorflow.train.get_checkpoint_state" ] ]
tvelagapudi/lenstronomy
[ "e9fe311c58897da8022840e392aa30ca022d5641", "e9fe311c58897da8022840e392aa30ca022d5641", "e9fe311c58897da8022840e392aa30ca022d5641" ]
[ "lenstronomy/LensModel/Profiles/cnfw.py", "lenstronomy/Plots/lens_plot.py", "test/test_LensModel/test_Profiles/test_sis.py" ]
[ "__author__ = 'dgilman', 'sibirrer'\n\nimport numpy as np\nfrom scipy.integrate import quad\nfrom lenstronomy.LensModel.Profiles.nfw import NFW\nfrom lenstronomy.LensModel.Profiles.base_profile import LensProfileBase\n\n\nclass CNFW(LensProfileBase):\n \"\"\"\n this class computes the lensing quantities of a ...
[ [ "numpy.array", "numpy.ones_like", "numpy.log", "numpy.where", "numpy.arctan", "numpy.empty_like", "numpy.sqrt", "numpy.absolute", "numpy.arctanh", "scipy.integrate.quad", "numpy.maximum" ], [ "numpy.max", "matplotlib.pyplot.colorbar", "scipy.ndimage.gaus...
maikpaixao/nubank-credit-risk-analysis
[ "712a8ac5248d404a4dab0e149f2f68223fc9627b" ]
[ "model.py" ]
[ "from sklearn.model_selection import KFold\nfrom sklearn.metrics import accuracy_score\nfrom xgboost import XGBClassifier\nimport numpy as np\n\nclass Model:\n def __init__(self, encoded_df):\n self.x = encoded_df.drop('target_default', axis=1).select_dtypes(exclude='object')\n self.y = encoded_df['target_de...
[ [ "sklearn.model_selection.KFold", "numpy.mean" ] ]
yisun98/pan-sharpening
[ "4a30c86ef81071e110f90de9fd84c89cf6ff07f0" ]
[ "methods/Brovey.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nLicense: MIT\n@author: gaj\nE-mail: anjing_guo@hnu.edu.cn\nPaper References:\n [1] A. R. Gillespie, A. B. Kahle, and R. E. Walker, “Color enhancement of highly correlated images-II. Channel ratio and “Chromaticity” Transform techniques,” \n Remote Sensing of Environment, ...
[ [ "numpy.concatenate", "numpy.round", "numpy.mean", "numpy.std", "numpy.squeeze", "numpy.expand_dims" ] ]
fserrey/gcp-explore
[ "80f9774f4115891ff31e9c9d21c9389399a21d23" ]
[ "ftp-etl/cloud_function_script.py" ]
[ "from ftplib import FTP\nfrom google.cloud import storage\nfrom google.cloud import bigquery\n\nimport os\nfrom io import StringIO, BytesIO\nfrom datetime import datetime, timedelta\nimport pandas as pd\nfrom dotenv import load_dotenv\nload_dotenv()\n\nFTP_HOST = os.getenv(\"FTP_HOST\")\nFTP_USER = os.getenv(\"FTP_...
[ [ "pandas.DataFrame" ] ]
upkoi/skypond
[ "5e366a18f2c5c85ce7b092d69b28c8f8aaad8718" ]
[ "tests/games/four_keys/common.py" ]
[ "import math\nimport skypond\nimport numpy as np\nfrom skypond.games.four_keys.four_keys_environment import FourKeysEnvironment\nfrom skypond.games.four_keys.four_keys_shared_state import FourKeysSharedState\nfrom skypond.games.four_keys.four_keys_board_items import FourKeysBoardItems\nfrom skypond.games.four_keys....
[ [ "numpy.sum", "numpy.count_nonzero" ] ]
ankitgpt231/pytorch-0.4-yolov3
[ "5a9c05385b0dbb2e2366659139e09c23cb99b140" ]
[ "image.py" ]
[ "#!/usr/bin/python\n# encoding: utf-8\nimport os\nfrom PIL import Image, ImageFile\nimport numpy as np\n\n# to avoid image file truncation error\nImageFile.LOAD_TRUNCATED_IMAGES = True\n\ndef scale_image_channel(im, c, v):\n cs = list(im.split())\n cs[c] = cs[c].point(lambda i: i * v)\n out = Image.merge(i...
[ [ "numpy.array", "numpy.pad", "numpy.reshape", "numpy.zeros", "numpy.random.uniform", "numpy.random.randint", "numpy.loadtxt" ] ]
bernease/whylogs-python
[ "f71cc98a250c68365ee19b15f7b1eba72677209a", "cfd2a2f71280537aae584cbd40a752fbe7da647b" ]
[ "tests/unit/util/test_dsketch_frequentitems.py", "tests/unit/core/test_datasetprofile.py" ]
[ "import json\n\nimport datasketches\nimport numpy as np\nfrom testutil import compare_frequent_items\n\nfrom whylogs.util import dsketch\n\ndecode_item = dsketch.FrequentItemsSketch._decode_item\n\nNUMBERS = [1, 1, 1, 2, 3, 4, 4, 5.0, 5.0, 4.0, 1e90]\nSTRINGS = [\"a\", \"b\", \"hello world\", \"hello World\", \"a\"...
[ [ "numpy.arange" ], [ "pandas.util.testing.makeDataFrame", "numpy.random.rand", "numpy.zeros" ] ]
tusharc31/c3dpo_nrsfm
[ "bffe61ddd84eb2aab8d6f18c3534107f616d0fd2" ]
[ "model.py" ]
[ "\"\"\"\nCopyright (c) Facebook, Inc. and its affiliates.\n\nThis source code is licensed under the MIT license found in the\nLICENSE file in the root directory of this source tree.\n\"\"\"\n\nfrom dataset.dataset_configs import STICKS\nfrom tools.so3 import so3_exponential_map, rand_rot\nfrom tools.functions impor...
[ [ "torch.cat", "numpy.array", "torch.stack", "torch.nn.BatchNorm2d", "torch.bmm", "torch.clamp", "torch.nn.ReLU", "torch.from_numpy", "torch.nn.Conv2d", "torch.eye", "torch.tensor", "torch.nn.Softplus" ] ]
freddyaboulton/evalml
[ "53242f9d7397a1af3f8c48d498a023042790d4c3", "53242f9d7397a1af3f8c48d498a023042790d4c3" ]
[ "evalml/tests/data_checks_tests/test_target_distribution_data_check.py", "evalml/pipelines/components/transformers/encoders/label_encoder.py" ]
[ "import numpy as np\nimport pandas as pd\nimport pytest\nfrom scipy.stats import jarque_bera, lognorm, norm, shapiro\n\nfrom evalml.data_checks import (\n DataCheckAction,\n DataCheckActionCode,\n DataCheckError,\n DataCheckMessageCode,\n DataCheckWarning,\n TargetDistributionDataCheck,\n)\nfrom e...
[ [ "scipy.stats.norm.rvs", "numpy.round", "scipy.stats.lognorm.rvs", "numpy.abs", "pandas.Series" ], [ "sklearn.preprocessing.LabelEncoder", "pandas.Series" ] ]
voldemortX/DeeplabV3_PyTorch1.3_Codebase
[ "9c62c0a721d11c8ea6bf312ecf1c7b238a54dcda", "9c62c0a721d11c8ea6bf312ecf1c7b238a54dcda" ]
[ "utils/losses/weighted_ce_loss.py", "utils/models/erfnet_encoder.py" ]
[ "import torch.nn.functional as F\n\nfrom ._utils import WeightedLoss\nfrom .builder import LOSSES\n\n\n# Use a base class that can take list weight instead of Tensor\n@LOSSES.register()\nclass WeightedCrossEntropyLoss(WeightedLoss):\n __constants__ = ['ignore_index', 'reduction']\n\n def __init__(self, weight...
[ [ "torch.nn.functional.cross_entropy" ], [ "torch.nn.ModuleList", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.Conv2d", "torch.load", "torch.nn.functional.relu" ] ]
jkurdys/ThinkBayes2
[ "1ebab8c10f2fec5db420f8032b23ea3c7d0f1346" ]
[ "scripts/electorate.py" ]
[ "\"\"\"This file contains code for use with \"Think Bayes\",\nby Allen B. Downey, available from greenteapress.com\n\nCopyright 2014 Allen B. Downey\nLicense: GNU GPLv3 http://www.gnu.org/licenses/gpl.html\n\"\"\"\n\nfrom __future__ import print_function, division\n\nimport numpy\nimport thinkbayes2\nimport thinkpl...
[ [ "numpy.linspace" ] ]
bigwater/NASBigData
[ "41f549acfb3f980174b51889260bce26e0075a07" ]
[ "nas_big_data/search/agebov1.py" ]
[ "import collections\nimport json\nimport os\nimport copy\n\n# import ConfigSpace as cs\nimport numpy as np\nfrom skopt import Optimizer as SkOptimizer\nfrom skopt.learning import (\n GradientBoostingQuantileRegressor,\n RandomForestRegressor,\n ExtraTreesRegressor,\n)\nfrom skopt.acquisition import gaussia...
[ [ "matplotlib.pyplot.xlim", "numpy.random.choice", "numpy.concatenate", "matplotlib.pyplot.savefig", "matplotlib.pyplot.gca", "matplotlib.pyplot.subplot", "matplotlib.ticker.FixedFormatter", "numpy.array", "matplotlib.pyplot.xscale", "matplotlib.ticker.MultipleLocator", "...
eimrek/cp2k-spm-tools
[ "94b158e7e93bc4cb76e88d59d31347fafdda5e64", "94b158e7e93bc4cb76e88d59d31347fafdda5e64" ]
[ "cp2k_spm_tools/cp2k_stm_sts.py", "hrstm_tools/interpolator.py" ]
[ "\"\"\"\nTools to perform STM/STS analysis on orbitals evaluated on grid\n\"\"\" \n\nimport os\nimport numpy as np\nimport scipy\nimport scipy.io\nimport scipy.special\nimport time\nimport copy\nimport sys\n\nimport re\nimport io\nimport ase\nimport ase.io\n\nfrom .cp2k_grid_orbitals import Cp2kGridOrbitals\n\nang_...
[ [ "numpy.exp", "numpy.min", "numpy.sort", "numpy.gradient", "numpy.max", "numpy.concatenate", "numpy.empty", "numpy.prod", "numpy.argmax", "numpy.arange", "numpy.savez_compressed", "numpy.sqrt", "numpy.array", "numpy.zeros", "numpy.round", "numpy.shape...
MagnusOstertag/Diffusion2D-Python-Package
[ "0ece681298e7eb23ace9d71621fcce58b52682db" ]
[ "src/ostertmsdiffusion2D/ostertmsdiffusion2D.py" ]
[ "\"\"\"\nSolving the two-dimensional diffusion equation\n\nExample acquired from https://scipython.com/book/chapter-7-matplotlib/examples/the-two-dimensional-diffusion-equation/\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom .output import create_plot, output_plots\n\n######################\...
[ [ "numpy.ones", "matplotlib.pyplot.figure" ] ]
oserikov/opennmt-inspection
[ "0686a43aceb2620272ecda44ad08ba3bc9cb6e9b" ]
[ "searchers/correlation-to-rank.py" ]
[ "#!/usr/bin/env python\n\n# USAGE:\nimport sys\nimport torch\n\ncorr_file = sys.argv[1]\nnetwork = int(sys.argv[2])\nlayer = int(sys.argv[3])\nout = sys.argv[4]\n\ncorrelations = torch.load(corr_file)\ncorrelations = correlations[network][layer][0]\nmaxs, _ = torch.max(\n torch.abs(correlations) *\n (1 - torc...
[ [ "torch.arange", "torch.save", "torch.abs", "torch.eye", "torch.load", "torch.sort" ] ]
Freedomisgood/NineLearning
[ "6fc91ddd74d8ace1ecbc2f03e9a47b86f4285e6a" ]
[ "board.py" ]
[ "# -*- coding: utf-8 -*-\n\n\nfrom sys import stderr\nimport numpy as np\n\n\nBSIZE = 9 # board size\nEBSIZE = BSIZE + 2 # extended board size\nBVCNT = BSIZE ** 2 # vertex count\nEBVCNT = EBSIZE ** 2 # extended vertex count\n\n# 两个越界的位置规定为PASS-81和unvaild-82\n# pass\nPASS = EBVCNT\n# invalid position\nVNULL = EB...
[ [ "numpy.full", "numpy.zeros", "numpy.copy", "numpy.random.shuffle", "numpy.where", "numpy.arange" ] ]
rubelbd82/Udemy_Machine_Learning_A-Z_practice_codes
[ "244949721d22d795e6f46e644b5bc7e5a8c17e49" ]
[ "Python/polynomial_regression.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n\n# Improting the dataset\ndataset = pd.read_csv('Position_Salaries.csv')\nX = dataset.iloc[:, 1:2].values\ny = dataset.iloc[:, 2].values\n\n# Splitting the dataset into training set and test set\nprint(X)\n\"\"\"from sklearn.cross_validat...
[ [ "pandas.read_csv", "sklearn.preprocessing.PolynomialFeatures", "sklearn.linear_model.LinearRegression" ] ]
StanleyHusai/PythonRobotics
[ "431204a46292d02d666ccdcfd9fa0f863dc72a8b" ]
[ "PathPlanning/RRTStarDubins/rrt_star_dubins.py" ]
[ "\"\"\"\nPath Planning Sample Code with RRT and Dubins path\n\nauthor: AtsushiSakai(@Atsushi_twi)\n\n\"\"\"\n\nimport random\nimport math\nimport copy\nimport numpy as np\nimport dubins_path_planning\nimport matplotlib.pyplot as plt\n\nshow_animation = True\n\n\nclass RRT():\n \"\"\"\n Class for RRT Planning\...
[ [ "numpy.linalg.norm", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "matplotlib.pyplot.pause", "matplotlib.pyplot.clf", "matplotlib.pyplot.axis" ] ]
kreimanlab/WhenPigsFlyContext
[ "4d03bb29f3be3e96c2b9d1945dc08c381abae513" ]
[ "test.py" ]
[ "import argparse\nimport datetime\nimport pathlib\nimport json\nimport yaml\n\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader\n\nfrom tqdm import tqdm\nfrom ml_collections import ConfigDict\n\nfrom core.dataset import COCODatasetWithID\nfrom core.config import save_config\nfrom core.mo...
[ [ "torch.no_grad", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.load", "torch.nn.CrossEntropyLoss" ] ]
tecdan/Pretrained_Models_NMT
[ "58b4a873ff03fbba0c438c8e846eef19c897866a" ]
[ "onmt/ModelConstructor.py" ]
[ "import torch\nimport torch.nn as nn\nimport onmt\nfrom onmt.modules.Transformer.Models import TransformerEncoder, TransformerDecoder, Transformer\nfrom onmt.modules.Transformer.Layers import PositionalEncoding\nfrom onmt.utils import change_paranames\ninit = torch.nn.init\n\nMAX_LEN = onmt.Constants.max_position_l...
[ [ "torch.nn.ModuleList", "torch.nn.LayerNorm", "torch.load" ] ]
jedamzik/diamond-square
[ "14fcb4506763f54c3f4cf24803bdcab504547e65" ]
[ "diamond-square.py" ]
[ "import argparse\r\nfrom enum import IntEnum\r\nimport random\r\nfrom typing import Callable, Dict, Tuple\r\nfrom blessed import Terminal\r\nimport numpy as np\r\nimport math\r\nimport signal\r\n\r\n\r\nclass SquareNodeGraph:\r\n def __init__(self, size: int):\r\n\r\n if size < 3:\r\n raise Val...
[ [ "numpy.zeros" ] ]
gugarosa/feelyng
[ "95a427049b9b82b0f5bc2ad200443ae7fc85eb6c" ]
[ "nalp/models/generators/rnn.py" ]
[ "\"\"\"Recurrent Neural Network generator.\n\"\"\"\n\nfrom typing import Optional\n\nimport tensorflow as tf\nfrom tensorflow.keras.layers import RNN, Dense, Embedding, SimpleRNNCell\n\nfrom nalp.core import Generator\nfrom nalp.encoders.integer import IntegerEncoder\nfrom nalp.utils import logging\n\nlogger = logg...
[ [ "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.RNN", "tensorflow.keras.layers.SimpleRNNCell", "tensorflow.keras.layers.Embedding" ] ]
ClementPla/deep_typhoon
[ "0e8338db0167a417988bdb05bbc739b212cc3d9e" ]
[ "networks/progressive_WAE.py" ]
[ "import torch.nn as nn\nimport numpy\nfrom .abstract_network import AbstractNet\nfrom .basis_block import *\n\n\nclass Encoder(nn.Module):\n def __init__(self, channel_in=1, z_size=128, activation=nn.ReLU(True)):\n super(Encoder, self).__init__()\n self.size = channel_in\n layers_list = []\n...
[ [ "torch.nn.Linear", "torch.nn.Sigmoid", "torch.nn.Sequential", "torch.nn.Tanh", "torch.nn.BatchNorm2d", "torch.nn.init.constant_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.BatchNorm1d", "numpy.prod", "numpy.sqrt", "torch.nn.init.uniform_" ] ]
1minus1/porespy
[ "4ba483cafa076dce7af197e685704678f13e97db", "4ba483cafa076dce7af197e685704678f13e97db" ]
[ "test/unit/test_tools.py", "porespy/metrics/__regionprops__.py" ]
[ "import porespy as ps\nimport numpy as np\nimport scipy as sp\nimport scipy.ndimage as spim\nimport matplotlib.pyplot as plt\nimport pytest\n\n\nclass ToolsTest():\n def setup_class(self):\n plt.close('all')\n self.im = np.random.randint(0, 10, 20)\n np.random.seed(0)\n self.blobs = p...
[ [ "numpy.array", "numpy.random.rand", "numpy.zeros", "numpy.random.seed", "scipy.ndimage.label", "numpy.ones", "matplotlib.pyplot.close", "numpy.mean", "numpy.shape", "numpy.prod", "numpy.random.randint", "scipy.spatial.ConvexHull", "numpy.all", "numpy.unique"...
Nasiru-code/chat-room-master
[ "c06e82871739ebb30db4da082ed544e8688a79bb" ]
[ "clientMedia.py" ]
[ "import cv2\nfrom socket import socket, AF_INET, SOCK_STREAM\nfrom imutils.video import WebcamVideoStream\n# import pyaudio\nfrom array import array\nfrom threading import Thread\nimport numpy as np\nimport zlib\nimport struct\n\nHOST = input(\"Enter Server IP\\n\")\nPORT_VIDEO = 3000\nPORT_AUDIO = 4000\n\nBufferSi...
[ [ "numpy.array" ] ]
ShahResearchGroup/UWDIRECT.github.io
[ "d4db958a6bfe151b6f7b1eb4772d8fd1b9bb0c3e" ]
[ "2017/SEDS_content/test_pc.py" ]
[ "import pandas as pd\n\nimport pc\n\ndef test_row_i_to_row_j():\n df = pd.DataFrame([[-1, 0, 1], [1, 0, -1], [.5, 0, .5]])\n A = df.loc[0]\n B = df.loc[1]\n C = df.loc[2]\n assert int(pc.row_i_to_row_j(A, A)) == 1, \"Diagonal elements not handled properly\"\n assert int(pc.row_i_to_row_j(A, B)) ==...
[ [ "pandas.DataFrame" ] ]
PositivePeriod/OpenCVexample
[ "4946fcb922263f3a298af45ed458a4ffa82eee2b" ]
[ "representative_color.py" ]
[ "import numpy as np\r\nimport cv2\r\nimport time\r\nimport matplotlib.pyplot as plt\r\n\r\n# https://stackoverflow.com/questions/43111029/how-to-find-the-average-colour-of-an-image-in-python-with-opencv\r\n\r\n\r\nclass RepresentativeColor:\r\n def resize(self, image, x=0.1, y=0.1):\r\n image = cv2.resize...
[ [ "numpy.uint8", "numpy.zeros", "numpy.ones", "matplotlib.pyplot.subplots", "numpy.argsort", "numpy.int_", "matplotlib.pyplot.show", "numpy.unique" ] ]
adnanfaroq86/deafrica-sandbox-notebooks
[ "827f8e8891eb820088e92b5ade84256ed3294b1e" ]
[ "Tools/deafrica_tools/load_era5.py" ]
[ "\"\"\"\nFunctions to retrieve ERA5 gridded climate data.\n\nUpdated Apr 2020 to directly access Zarr format data in PDS\n\nPervious code for downloading and loading netcdf adpated from scripts by Andrew Cherry and Brian Killough.\n\nLicense\n-------\nThe code in this notebook is licensed under the Apache License,\...
[ [ "numpy.sort", "numpy.timedelta64", "numpy.datetime64" ] ]
pvk-developer/Copulas
[ "86dc1304fe4ffb51302fc37801d7f18c4ab4d88d", "86dc1304fe4ffb51302fc37801d7f18c4ab4d88d" ]
[ "copulas/univariate/uniform.py", "tests/unit/bivariate/test_base.py" ]
[ "\"\"\"UniformUnivariate module.\"\"\"\n\nimport numpy as np\nfrom scipy.stats import uniform\n\nfrom copulas.univariate.base import BoundedType, ParametricType, ScipyModel\n\n\nclass UniformUnivariate(ScipyModel):\n \"\"\"Uniform univariate model.\"\"\"\n\n PARAMETRIC = ParametricType.PARAMETRIC\n BOUNDED...
[ [ "numpy.max", "numpy.min" ], [ "numpy.array" ] ]
rinocloud/rinobot-plugin-parse-spc
[ "6bb675a646455e8b9c61bb380705875894fc52e4" ]
[ "lib/sub.py" ]
[ "\"\"\"\nSubFile class: loads each subfile data segment into object\n\nauthor: Rohan Isaac\n\"\"\"\n\nfrom __future__ import division, absolute_import, unicode_literals, print_function\n\nimport struct\nimport numpy as np\n\nfrom .global_fun import read_subheader\n\n\nclass subFile:\n \"\"\"\n Processes each ...
[ [ "numpy.int32" ] ]
coolbay/VSGN
[ "51a3fd59343820aed82879266df3be0147231cab" ]
[ "Utils/dataset_thumos.py" ]
[ "# -*- coding: utf-8 -*-\nimport numpy as np\nimport json\nimport torch.utils.data as data\nimport os\nimport torch\nimport h5py\nimport torch.nn.functional as F\n\n\ndef load_json(file):\n with open(file) as json_file:\n data = json.load(json_file)\n return data\n\n\nclass VideoDataSet(data.Datase...
[ [ "numpy.divide", "torch.zeros", "torch.cat", "numpy.array", "numpy.minimum", "torch.nn.functional.interpolate", "numpy.stack", "torch.tensor", "torch.transpose", "torch.Tensor", "numpy.maximum" ] ]
VincentYCYao/stanford-cs231n-2019
[ "c293f754ef4b9a14e1ebff7a9d743e6d103072a5" ]
[ "assignment2/cs231n/optim.py" ]
[ "import numpy as np\n\n\"\"\"\nThis file implements various first-order update rules that are commonly used\nfor training neural networks. Each update rule accepts current weights and the\ngradient of the loss with respect to those weights and produces the next set of\nweights. Each update rule has the same interfa...
[ [ "numpy.zeros_like", "numpy.sqrt" ] ]
williamcorsel/mmrotate
[ "00a3b9af34c4e36c82616d98fdb91b468d4cfb34" ]
[ "tests/test_data/test_pipelines/utils.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport numpy as np\n\n\ndef _check_fields(results, pipeline_results, keys):\n \"\"\"Check data in fields from two results are same.\"\"\"\n for key in keys:\n assert np.equal(results[key], pipeline_results[key]).all()\n assert results[key].dtype ...
[ [ "numpy.equal" ] ]
akhlesh/dash-docs
[ "78313a8aa4793b0935e594cdf12e93e916252db9" ]
[ "tutorial/examples/table/callbacks_paging_multicolumn_sorting.py" ]
[ "import dash\nfrom dash.dependencies import Input, Output\nimport dash_table\nimport pandas as pd\n\n\napp = dash.Dash(__name__)\n\ndf = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminder2007.csv')\n\nPAGE_SIZE = 5\n\napp.layout = dash_table.DataTable(\n id='table-multicol-sorting',\...
[ [ "pandas.read_csv" ] ]
chensjtu/AdelaiDepth
[ "de906b4ac4ad5775daedaf443fcff02a994188a0", "de906b4ac4ad5775daedaf443fcff02a994188a0" ]
[ "LeReS/Minist_Test/lib/multi_depth_model_woauxi.py", "LeReS/Minist_Test/lib/net_tools.py" ]
[ "import torch\r\nimport torch.nn as nn\r\n\r\nfrom lib import network_auxi as network\r\nfrom lib.net_tools import get_func\r\n\r\nclass RelDepthModel(nn.Module):\r\n def __init__(self, backbone='resnet50'):\r\n super(RelDepthModel, self).__init__()\r\n if backbone == 'resnet50':\r\n enc...
[ [ "torch.no_grad" ], [ "torch.cuda.empty_cache", "torch.load" ] ]
kuldeepdadhich/fin
[ "b88be9720bd502b0072ed8423c35ecb4a26af413" ]
[ "main.py" ]
[ "from __future__ import print_function\nfrom future.standard_library import install_aliases\ninstall_aliases()\n\nfrom flask import Flask\nfrom flask import request\nfrom flask import make_response\n\n\nfrom urllib.parse import urlparse, urlencode\nfrom urllib.request import urlopen, Request\nfrom urllib.error impo...
[ [ "numpy.array" ] ]
gdemelo/PubMedCLIP
[ "1c0892af2b640e7e6c3ac7846c12a596418eda2a" ]
[ "MEVF_PubMedCLIP/attention.py" ]
[ "\"\"\"\nThis code is extended from Jin-Hwa Kim, Jaehyun Jun, Byoung-Tak Zhang's repository.\nhttps://github.com/jnhwkim/ban-vqa\n\nThis code is modified from ZCYang's repository.\nhttps://github.com/zcyang/imageqa-san\n\"\"\"\nimport torch\nimport torch.nn as nn\nfrom torch.nn.utils.weight_norm import weight_norm\...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.Softmax", "torch.nn.ModuleList", "torch.nn.Tanh", "torch.sum" ] ]
MYusha/video-classification-3d-cnn-pytorch
[ "12e317c65df5306235da6bf2e0d872babbe5cf65" ]
[ "visualize_features.py" ]
[ "import numpy as np\nimport os\nimport json\nimport sys\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn import manifold\nfrom time import time\nimport pdb\nfrom matplotlib import offsetbox\n\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.svm import SVC\nfrom sklearn.decomposit...
[ [ "numpy.max", "numpy.equal", "sklearn.ensemble.RandomForestClassifier", "sklearn.neighbors.KNeighborsClassifier", "matplotlib.pyplot.title", "sklearn.manifold.TSNE", "numpy.min", "matplotlib.pyplot.figure", "sklearn.svm.SVC", "matplotlib.pyplot.show", "pandas.read_csv", ...
lorenghoh/pyman
[ "9b4ddd52c5577fc85e2601ae3128f398f0eb673c" ]
[ "Book/chap5/Supporting Materials/sinePlotDenserXY.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nx = np.linspace(0, 4.*np.pi, 129)\ny = np.sin(x)\n\nplt.plot(x, y)\n\nplt.show()\n\nplt.savefig(\"sinePlotDenserXY.png\")" ]
[ [ "numpy.sin", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "numpy.linspace" ] ]
ricosjp/femio
[ "f43991132e530c97477374f4bba25a250a6acae8" ]
[ "examples/00_basic.py" ]
[ "\"\"\"\nBasic Usage of FEMIO\n====================\n\nFEMIO can be used as a converter, load data in a format, and write data in\nanother format.\n\"\"\"\n\n###############################################################################\n# Import numpy and :mod:`femio`.\n\nimport numpy as np\nimport femio\n\n#####...
[ [ "numpy.array", "numpy.mean" ] ]
EnriqueMoran/ipyannotator
[ "5517f8ded24e9e1347d0d72c73d620778f7b3069" ]
[ "ipyannotator/datasets/generators.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01a_datasets.ipynb (unless otherwise specified).\n\n__all__ = ['create_color_classification', 'create_shape_color_classification', 'create_object_detection']\n\n# Internal Cell\nimport numpy as np\nimport pandas as pd\nfrom pandas import DataFrame\nimport ipywidgets ...
[ [ "numpy.array", "numpy.random.RandomState", "numpy.random.uniform", "numpy.random.randint", "numpy.sqrt", "numpy.hstack" ] ]
FlanFlanagan/raven
[ "ef1372364a2776385931763f2b28fdf2930c77b9", "ef1372364a2776385931763f2b28fdf2930c77b9" ]
[ "tests/framework/unit_tests/utils/testFrontUtils.py", "framework/Metrics/metrics/MetricUtilities.py" ]
[ "# Copyright 2017 Battelle Energy Alliance, 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 ...
[ [ "numpy.array" ], [ "numpy.average" ] ]
YiGuangLee/gamer
[ "b392f0058cd7ec7ec9123cf96ebab5f5e9489b46" ]
[ "example/yt/plot__uniform_grid.py" ]
[ "\n# ref: https://yt-project.org/docs/dev/examining/generic_array_data.html\n\nimport yt\nimport sys\nimport numpy as np\n\n\n# input parameters\nfile_in = 'filename_in' # input filename\nfile_out = 'filename_out' # output filename\nfield = 'field_name' # target field\n...
[ [ "numpy.array", "numpy.fromfile" ] ]
keurfonluu/StochOPy
[ "5f6625c40ec80297dbcd3bd85b5073b9ed6b8cb2" ]
[ "stochopy/sample/_common.py" ]
[ "import numpy as np\n\n\ndef in_search_space(x, lower, upper, constraints):\n \"\"\"Determine feasibility of a sample.\"\"\"\n if constraints == \"Reject\":\n np.logical_and(np.all(x >= lower), np.all(x <= upper))\n else:\n return True\n" ]
[ [ "numpy.all" ] ]
Sangeetha8034/olympic-hero
[ "f9c1c8e2e7d1402cace8055dfbaea59e4308a344" ]
[ "code.py" ]
[ "# --------------\n#Importing header files\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n#Path of the file\r\npath\r\n\r\n#Code starts here\r\ndata = pd.read_csv(path)\r\ndata.rename(columns={'Total':'Total_Medals'},inplace=True)\r\nprint(data.head(10))\n\n\n# --------------...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.figure", "numpy.where", "matplotlib.pyplot.ylabel", "pandas.read_csv", "matplotlib.pyplot.bar" ] ]
liamwarfield/advent-of-code2019
[ "936abf002901b5f0f4d4eb1d5bcb465aeaffe2ef" ]
[ "day3/wires.py" ]
[ "import numpy as np\nfrom tqdm import trange\n\ndef read_input():\n wires = []\n try:\n f = open(\"input.txt\")\n except FileNotFoundError:\n print(\"Could not find an input file\")\n f.close()\n quit(-1)\n for line in f:\n wire = [(x[0], int(x[1::])) for x in line.spl...
[ [ "numpy.zeros" ] ]
haleqiu/TLIO
[ "d4fea31517fb8db662dc14c388a792217b172e64" ]
[ "src/dataloader/data_io.py" ]
[ "from os import path as osp\n\nimport h5py\nimport numpy as np\nfrom scipy.interpolate import interp1d\nfrom scipy.spatial.transform import Rotation\nfrom utils.logging import logging\nfrom utils.math_utils import unwrap_rpy, wrap_rpy\n\n\nclass DataIO:\n def __init__(self):\n # raw dataset - ts in us\n ...
[ [ "numpy.random.normal", "numpy.array", "scipy.interpolate.interp1d", "numpy.matmul", "numpy.copy", "scipy.spatial.transform.Rotation.from_euler", "numpy.eye", "numpy.where", "numpy.loadtxt", "scipy.spatial.transform.Rotation.from_matrix", "scipy.spatial.transform.Rotatio...
gemeinl/braindecode
[ "56e7d2c77b7b904a8c7a2bc87c76ac8c34100ccd", "56e7d2c77b7b904a8c7a2bc87c76ac8c34100ccd" ]
[ "braindecode/models/deep4.py", "braindecode/models/hybrid.py" ]
[ "import numpy as np\nfrom torch import nn\nfrom torch.nn import init\nfrom torch.nn.functional import elu\n\nfrom braindecode.models.base import BaseModel\nfrom braindecode.torch_ext.modules import Expression, AvgPool2dWithConv\nfrom braindecode.torch_ext.functions import identity\nfrom braindecode.torch_ext.util i...
[ [ "torch.nn.LogSoftmax", "torch.nn.Dropout", "torch.nn.init.constant_", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "numpy.ones", "torch.nn.init.xavier_uniform_", "torch.nn.Conv2d" ], [ "torch.nn.LogSoftmax", "torch.cat", "torch.nn.Sequential", "torch.nn.Consta...
VladislavZavadskyy/baselines
[ "98257ef8c9bd23a24a330731ae54ed086d9ce4a7" ]
[ "baselines/logger.py" ]
[ "import os\nimport sys\nimport shutil\nimport os.path as osp\nimport json\nimport time\nimport datetime\nimport tempfile\n\nLOG_OUTPUT_FORMATS = ['stdout', 'log', 'csv']\n# Also valid: json, tensorboard\n\nDEBUG = 10\nINFO = 20\nWARN = 30\nERROR = 40\n\nDISABLED = 50\n\nclass KVWriter(object):\n def writekvs(sel...
[ [ "pandas.DataFrame", "pandas.read_csv", "tensorflow.train.summary_iterator", "tensorflow.python.util.compat.as_bytes" ] ]
haoweii0215/Kaggle-Courses
[ "57974b2e6618b1125e030791320c649dda2fc783" ]
[ "Data Cleaning/Class 2 - Scaling and Normalization.py" ]
[ "# Scaling and Normalization\nimport pandas as pd\nimport numpy as np\nfrom scipy import stats\nfrom mlxtend.preprocessing import minmax_scaling\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n### generate 1000 data points randomly drawn from an exponential distribution\noriginal_data = np.random.exponen...
[ [ "numpy.random.exponential", "scipy.stats.boxcox", "matplotlib.pyplot.subplots" ] ]
LeonDong1993/TractableDE-ContCNet
[ "30e050eeef802308f4124bf56a161bae7f2e11c4" ]
[ "experiment/loaders/superconduct.py" ]
[ "import numpy as np\nfrom pdb import set_trace\nfrom utmLib import utils\n\ndef load_data(options):\n print('Loading the superconduct data.....')\n data_file = '{}/{}'.format(options.root_dir, options.data_path)\n # read_data\n raw = np.loadtxt(data_file ,delimiter=',', encoding='utf-8', dtype=str)\n ...
[ [ "numpy.loadtxt" ] ]
gzlzb/2019
[ "7e7ebe35617780589f92c0bbbef9f12ef6803a48" ]
[ "Cor_pre.py" ]
[ "import statsmodels.formula.api as smf\r\nfrom sklearn import linear_model\r\n#from sklearn.cross_validation import cross_val_predict\r\nfrom sklearn.model_selection import cross_val_predict\r\nimport pandas as pd\r\n#from scipy import stats\r\n\r\ndef training_test(training, test, response):\r\n \"\"\"Linear mo...
[ [ "sklearn.linear_model.LinearRegression", "pandas.DataFrame", "scipy.stats.spearmanr", "scipy.stats.linregress", "pandas.read_csv", "sklearn.model_selection.cross_val_predict" ] ]
lyprince/hierarchical_lfads
[ "cc897286a3ade52038840900bc0313fe7195f871" ]
[ "deprecated/.ipynb_checkpoints/run_lfads_synth-checkpoint.py" ]
[ "from models import *\nfrom utils import read_data, load_parameters, save_parameters\nimport argparse\nimport time\nimport yaml\nimport torch\nimport torchvision\n\nparser = argparse.ArgumentParser()\nparser.add_argument('-o', '--output', type=str)\nparser.add_argument('-d', '--data_path', type=str)\nparser.add_arg...
[ [ "torch.cuda.is_available", "torch.Tensor", "torch.utils.data.TensorDataset" ] ]
LowerySJ/steveCNTK
[ "422f710242c602b2660a634f2234abf5aaf5b337" ]
[ "contrib/Python/cntk/examples/MNIST/mnist_one_layer.py" ]
[ "# Copyright (c) Microsoft. All rights reserved.\n\n# Licensed under the MIT license. See LICENSE.md file in the project root\n# for full license information.\n# ==============================================================================\n\n\"\"\"\nMNIST Example, one hidden layer neural network using training an...
[ [ "numpy.allclose" ] ]
zhaolongkzz/Machine-Learning
[ "8ec62a4d469db125fd45534dc0217af4cbbf603d" ]
[ "212.py" ]
[ "# -*- coding:utf-8 -*-\r\n# !/usr/bin/python3\r\n\r\n'''\r\ntest the part program when you do not know!\r\n'''\r\n\r\nfrom math import log, sqrt\r\nimport operator, re, random\r\nimport numpy as np\r\nimport tensorflow as tf\r\nimport sys, scipy\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.funct...
[ [ "torch.nn.Linear", "torch.randn" ] ]
dongliangcao/MultimodalGAN
[ "f6c41e2a067753709975ef46246897082bf33ec1" ]
[ "ssim.py" ]
[ "# https://github.com/VainF/pytorch-msssim/blob/master/pytorch_msssim/ssim.py\nimport warnings\n\nimport torch\nimport torch.nn.functional as F\n\n\ndef _fspecial_gauss_1d(size, sigma):\n r\"\"\"Create 1-D gauss kernel\n Args:\n size (int): the size of gauss kernel\n sigma (float): sigma of norm...
[ [ "torch.relu", "torch.stack", "torch.arange", "torch.FloatTensor", "torch.flatten", "torch.exp" ] ]
WannaFIy/automl
[ "287f54af377a177d8c58eef3ac22350a3d8ced64", "287f54af377a177d8c58eef3ac22350a3d8ced64" ]
[ "efficientnetv2/hparams.py", "efficientnetv2/effnetv2_model_test.py" ]
[ "# Copyright 2021 Google Research. 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...
[ [ "tensorflow.io.gfile.GFile" ], [ "tensorflow.compat.v1.zeros", "tensorflow.compat.v1.test.main" ] ]
Weruminger/picamera
[ "0edddb8ff6307d099b80d4895628c085b0f8a966" ]
[ "samples/TestBlankLenseShiftArrays.py" ]
[ "from picamera import PiCamera\nimport numpy as np\nimport time\n\nwith PiCamera() as cam:\n lst_shape = cam._lens_shading_table_shape()\n\nlst = np.zeros(lst_shape, dtype=np.uint8)\nlst[...] = 32 # NB 32 corresponds to unity gain\n\nwith PiCamera(lens_shading_table=lst) as cam:\n cam.start_preview()\n tim...
[ [ "numpy.zeros" ] ]
imagexdsearch/imagesearch
[ "7f4d18906d6ebd9f5d7b4e0db4bc6c7e675fbb1d" ]
[ "src/old/run_brute_force.py" ]
[ "'''\nCreated on 3 de jun de 2016\n\n@author: romuere\n'''\nimport numpy as np\nfrom scipy.spatial.distance import euclidean,cityblock,chebyshev,cosine\nfrom scipy.stats import pearsonr\nfrom scipy.stats import chisquare\nfrom scipy.stats import entropy,ks_2samp\nimport math\nimport csv\nfrom scipy.misc import imre...
[ [ "numpy.set_printoptions", "scipy.stats.entropy", "scipy.spatial.distance.cityblock", "scipy.spatial.distance.cosine", "numpy.cumsum", "numpy.max", "numpy.argmax", "numpy.log10", "scipy.stats.chisquare", "matplotlib.use", "numpy.array", "scipy.spatial.distance.euclid...
emdodds/DictLearner
[ "a1c7d7b1d3a3ed4c6af39b7065b4ee93bc42a5e7" ]
[ "scripts/topo_script.py" ]
[ "import tf_toposparse\r\nimport numpy as np \r\nimport pca\r\nimport pickle\r\nimport argparse\r\n\r\nparser = argparse.ArgumentParser(description=\"Learn dictionaries for Topographic Sparsenet with given parameters.\")\r\nparser.add_argument('-d', '--data', default='images', type=str)\r\nparser.add_argument('-r', ...
[ [ "numpy.prod", "numpy.load" ] ]
rostekus/recognition_of_handwritten_digits
[ "1cdc86572b1aad8da126cd5623a8e857aa6bbc55" ]
[ "model_training.py" ]
[ "#Import all Necessary Libraries\nimport tensorflow as tf\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import Conv2D, Lambda, MaxPooling2D, Flatten, BatchNormalization, Dense\nfrom tensorflow.keras.utils import to_categorical\nimport matplotlib.pyplot as plt\nfrom sklearn.model_sele...
[ [ "sklearn.datasets.fetch_openml", "tensorflow.keras.utils.normalize", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.models.Sequential", "sklearn.model_selection.train_te...
mf-zhang/tfoptflow
[ "d27b249fcbae2d1f4373ef4ba16cb0c89890058e" ]
[ "tfoptflow-grad-eval-batch-bad/model_pwcnet (orig).py" ]
[ "\"\"\"\nmodel_pwcnet.py\n\nPWC-Net model class.\n\nWritten by Phil Ferriere\n\nLicensed under the MIT License (see LICENSE for details)\n\"\"\"\n\nfrom __future__ import absolute_import, division, print_function\nimport time\nimport datetime\nimport warnings\nimport numpy as np\nimport pandas as pd\nimport tensorf...
[ [ "tensorflow.image.resize_bilinear", "numpy.mean", "tensorflow.zeros_like", "tensorflow.keras.initializers.he_normal", "tensorflow.trainable_variables", "tensorflow.shape", "tensorflow.nn.leaky_relu", "tensorflow.concat", "pandas.DataFrame", "tensorflow.norm", "tensorflo...
danielhey/Maelstrom
[ "439485ea1972a77f6058ffd6af9a5737af7bee5b" ]
[ "maelstrom/estimator.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom __future__ import division, print_function\n\nimport numpy as np\nfrom astropy.timeseries import LombScargle\nfrom scipy import optimize\nimport exoplanet as xo\nimport pymc3 as pm\nimport theano.tensor as tt\n\n__all__ = [\"estimate_frequencies\"]\n\n\ndef estimate_frequencies(\n ...
[ [ "numpy.square", "numpy.array", "numpy.sin", "numpy.matmul", "numpy.diff", "numpy.arange", "numpy.abs", "numpy.linalg.solve", "numpy.argsort", "numpy.cos", "scipy.optimize.minimize" ] ]
junjuew/scalable-edge-native-applications
[ "1ace9ce71bef267880049633160e7cb74c57bddb", "1ace9ce71bef267880049633160e7cb74c57bddb" ]
[ "rmexp/client/dutycycle.py", "rmexp/app_utility_func.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport collections\nimport os\n\nimport numpy as np\nfrom scipy.stats import norm\n\n\ndef lego_dynamic_sampling_rate(x):\n \"\"\"Returns the dyanmic sampling rate for LEGO. \n x is the number of seconds after an instruction has delivered\n ...
[ [ "scipy.stats.norm.cdf" ], [ "numpy.exp", "numpy.power", "numpy.log" ] ]
haihabi/model_optimization
[ "97372a9596378bb2287c59f1180b5059f741b2d6" ]
[ "tests/pytorch_tests/test_pytorch_tp_model.py" ]
[ "# Copyright 2022 Sony Semiconductors Israel, 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# Un...
[ [ "torch.nn.Hardtanh", "torch.nn.Conv2d", "numpy.random.randn" ] ]
Gandedong/matplotlib-cheatsheet
[ "424bc92d804e140eaa43a9659c14ccab60523105" ]
[ "reference-collection.py" ]
[ "# ----------------------------------------------------------------------------\n# Title: Scientific Visualisation - Python & Matplotlib\n# Author: Nicolas P. Rougier\n# License: BSD\n# ----------------------------------------------------------------------------\nimport numpy as np\nimport matplotlib.pyplot as p...
[ [ "matplotlib.collections.StarPolygonCollection", "matplotlib.collections.EllipseCollection", "matplotlib.path.Path", "matplotlib.collections.RegularPolyCollection", "numpy.zeros", "matplotlib.pyplot.savefig", "numpy.ones", "matplotlib.pyplot.figure", "matplotlib.collections.Circ...
y-muraka/Human-Cochlear-Model
[ "8f430f461e633b18d36134644baa7631b3853f26" ]
[ "cpp/fft/CochlearModel_1D_fft.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport tqdm\nfrom scipy.fft import dct, idct\nfrom time import time\n\nclass params_cochlea:\n def __init__(self, Nx, gamma):\n self.N = Nx\n self.Lb = 3.5\n self.W = 0.1\n self.H = 0.1\n self.b = 0.4\n self.rho = 1.0...
[ [ "numpy.sin", "numpy.zeros", "numpy.cosh", "numpy.ones", "numpy.exp", "numpy.tanh", "numpy.arange", "scipy.fft.dct", "matplotlib.pyplot.show", "scipy.fft.idct" ] ]
AriChow/fastestimator
[ "d381d9acc1d42c6cf88a4424e083375cf98140bf" ]
[ "apphub/image_styletransfer/fst_coco/fst_coco.py" ]
[ "# Copyright 2019 The FastEstimator 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 r...
[ [ "tensorflow.square", "tensorflow.image.total_variation", "tensorflow.keras.utils.get_file", "tensorflow.reduce_prod", "tensorflow.cast", "tensorflow.add_n", "numpy.expand_dims", "tensorflow.math.square", "tensorflow.keras.optimizers.Adam", "tensorflow.einsum" ] ]
haoyu-x/robot-learning
[ "70da64466fd02dc4cfc97ad9e123c893fc17acd3" ]
[ "utils/gym_env.py" ]
[ "from collections import deque, OrderedDict\n\nimport gym\nimport numpy as np\n\n\ndef stacked_space(space, k):\n if isinstance(space, gym.spaces.Box):\n space_stack = gym.spaces.Box(\n low=np.concatenate([space.low] * k, axis=0),\n high=np.concatenate([space.high] * k, axis=0),\n ...
[ [ "numpy.concatenate", "numpy.zeros" ] ]
adithya-1/Instagram-Comments-Scraper
[ "6c2f42261ff69063f65aa20e4f88c484912bd668" ]
[ "follower.py" ]
[ "from selenium import webdriver\nimport pandas as pd\nimport time\n\ndf = pd.read_excel('comments.xlsx')\nnames = df['name']\n\nfollowers = []\nfollowing = []\nfor i in range(0, len(names)):\n driver = webdriver.Chrome(\n 'D:\\My apps\\Instagram-Comments-Scraper\\.venv\\Scripts\\chromedriver.exe')\n ur...
[ [ "pandas.read_excel" ] ]
brijmohan/kald
[ "3c552764030897652b916cc9ddd2324a97fa7ce8" ]
[ "egs/voice_privacy/v1/local/anon/compute_spk_pool_cosine.py" ]
[ "import sys\nimport kaldi_io\nimport os\nfrom os.path import join, isdir\n\nfrom scipy.spatial import distance\n\nargs = sys.argv\n\nsrc_xvec_dir = args[1]\npool_xvec_dir = args[2]\nscores_dir = args[3]\n\nif not isdir(scores_dir):\n os.makedirs(scores_dir)\n\nsrc_xvec_file = join(src_xvec_dir, 'spk_xvector.scp'...
[ [ "scipy.spatial.distance.cosine" ] ]
ShivenTripathi/CS698-Deep-Reinforcement-Learning
[ "184f7887cea3065d2bfa4ba05bfb249838c3dab4" ]
[ "PROJECT/CS698R-Project-Foraging-in-Replenishing-Patches-7-main/agents/MAB/baselines.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[4]:\n\n\nget_ipython().system('pip install --upgrade --editable gym-env')\n\n\n# In[2]:\n\n\nimport gym\nimport gym_env\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\nimport numpy as np\n\nenv = gym.make('foraging-replenishing-patches-v0')\n\nenv.reset()\nfo...
[ [ "numpy.max", "numpy.random.choice", "numpy.random.rand", "numpy.zeros", "numpy.log", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "numpy.ones", "numpy.mean", "numpy.exp", "numpy.random.randint", "numpy.arange", "matplotl...