repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
vikashachary/SolvedProblems
[ "1edea79222f914beef5ab4393c0e074a79f13a48" ]
[ "Python/checkerboxMatrix.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jul 31 08:12:19 2019\nCreate checker box\n@author: vikash\n\"\"\"\n\nimport numpy as np\n# Read the variable from STDIN\nn = int(input())\n\nmatrix = np.zeros((n,n), dtype=int)\nmatrix[1::2,::2] = 1\nmatrix[::2,1::2] = 1\nprint(matrix)" ]
[ [ "numpy.zeros" ] ]
steven-lang/DAFNe
[ "b13912041a263904cf26ca5f3468c6bc64ce800c" ]
[ "dafne/data/datasets/icdar15.py" ]
[ "from detectron2.data.datasets import register_coco_instances\nfrom dafne.utils.sort_corners import sort_quadrilateral\nfrom detectron2.utils.colormap import colormap\nfrom detectron2.data.datasets.coco import load_coco_json\nfrom detectron2.data import (\n DatasetCatalog,\n MetadataCatalog,\n DatasetMappe...
[ [ "numpy.array", "numpy.sin", "numpy.cos", "numpy.abs", "numpy.maximum" ] ]
erickmartinez/pydlcp
[ "611eceeb0816af432e1c06ee171376af2bc13a0e" ]
[ "pydlcp/datastorage.py" ]
[ "\nimport h5py\nimport numpy as np\n\nvcr_type = np.dtype([('V', 'd'), ('C', 'd'), ('R', 'd')])\ntti_type = np.dtype([('time', 'd'), ('temperature', 'd'), ('current', 'd')])\ndlcp_type = np.dtype([('osc_level', 'd'), ('bias', 'd'), ('nominal_bias', 'd'), ('V', 'd'), ('C', 'd'), ('R', 'd')])\n\n\nclass BTSH5Store:\n...
[ [ "numpy.array", "numpy.empty", "numpy.dtype" ] ]
liuhuaijjin/epnet_pointformer.py
[ "ad9890895f7d91c6687b959ec1edc231a13184ef" ]
[ "lib/net/pointnet2_msg_unet_vgg16.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom pointnet2_lib.pointnet2.pointnet2_modules import PointnetFPModule, PointnetSAModuleMSG, PointnetSAModuleMSGPointformer\nfrom lib.config import cfg\nfrom torch.nn.functional import grid_sample\n\n\nBatchNorm2d = nn.BatchNorm2d\n\ndef conv3x3...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.nn.Sequential", "torch.gather", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.functional.grid_sample", "torch.nn.BatchNorm1d", "t...
wut-biolab-zhangyanping/mfcis
[ "4b3df36760182a1cdcc292e8dcfdc1775de0ae59" ]
[ "models/BaseModel.py" ]
[ "from tensorflow import keras\nfrom tensorflow.keras.layers import Conv1D, Dropout, Dense, BatchNormalization, Input, Concatenate, MaxPooling2D, Reshape\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras import backend as K\nfrom tensorflow.keras.layers import Layer\nfrom tensorflow.keras import regu...
[ [ "tensorflow.keras.backend.sum", "tensorflow.keras.applications.xception.Xception", "tensorflow.keras.layers.Input", "tensorflow.keras.backend.exp", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Reshape", "tensorflow.keras.backend.pow", "tensorflow.keras.layers.Dropout",...
justindlwhite/pymc
[ "9c2ba7afc829fef5799068a0215a53b0f69da7c0" ]
[ "pymc/tests/test_transforms.py" ]
[ "# Copyright 2020 The PyMC Developers\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 appli...
[ [ "numpy.nextafter", "numpy.array", "numpy.random.rand", "numpy.asarray", "numpy.zeros", "numpy.ones", "numpy.random.randn", "numpy.diff", "numpy.float64", "numpy.abs" ] ]
makinacorpus/pandas
[ "3c1185fd03306a65101657c32b58e4f59c3d1376" ]
[ "pandas/tests/test_categorical.py" ]
[ "# pylint: disable=E1101,E1103,W0232\n\nfrom datetime import datetime\nfrom pandas.compat import range, lrange, u\nimport os\nimport pickle\nimport re\nfrom distutils.version import LooseVersion\n\nimport numpy as np\nimport pandas as pd\n\nfrom pandas import Categorical, Index, Series, DataFrame, PeriodIndex, Time...
[ [ "pandas.core.common.is_float_dtype", "numpy.random.choice", "pandas.compat.u", "pandas.Timestamp", "pandas.concat", "pandas.compat.range", "pandas.core.common.isnull", "numpy.dtype", "pandas.read_pickle", "pandas.core.common.is_integer_dtype", "numpy.log", "pandas.D...
vishalbelsare/cplvm
[ "d8f715258b2c363beb2d59e95e5b5b9e73b503a7" ]
[ "experiments/simulation_experiments/hypothesis_testing/cplvm_global_bfs_varyp.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport seaborn as sns\nimport pandas as pd\nimport os\nfrom scipy.stats import poisson\nfrom scipy.special import logsumexp\nfrom sklearn.metrics import roc_curve\nfrom sklearn.metrics import roc_auc_score\n\nfrom cplvm import CPLVM\nfrom cplvm import CPLVMLogNo...
[ [ "numpy.concatenate", "numpy.array", "numpy.isnan", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "pandas.DataFrame", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.rc", "numpy.arange", "matplotlib.pyplot.tight_layout", "matplotlib.pypl...
ihabbou/ml-algos
[ "4a12e64b6d18e88dbb068df2b1aa523522bbc8d7" ]
[ "src/ml_algos/utils.py" ]
[ "import numpy as np\n\n\ndef distance(point1, point2):\n return np.linalg.norm(point1 - point2)\n" ]
[ [ "numpy.linalg.norm" ] ]
xuchen-ethz/continuous_view_synthesis
[ "c6fc39e5ef4a21b8b33154404c71c4d53625fe8c" ]
[ "demo/demo_base.py" ]
[ "import matplotlib.backends.backend_tkagg as tkagg\nimport matplotlib.pyplot as plt\nfrom matplotlib.widgets import Button\nfrom tkinter.filedialog import askopenfilename\nimport tkinter; tkinter.Tk().withdraw()\n\nfrom models.base_model import BaseModel\nimport numpy as np\nimport cv2\n\nclass Demo():\n def __i...
[ [ "matplotlib.widgets.Button", "numpy.array", "matplotlib.pyplot.figure", "matplotlib.pyplot.draw", "matplotlib.pyplot.show", "matplotlib.pyplot.axes", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
edsumpena/SkyStone
[ "dab78c1687547d19171626ec3287ab37082bb4c2" ]
[ "tools/parse_ftc.py" ]
[ "import sys\nimport os\nimport string\nimport math\nfrom math import pi\n\nfrom matplotlib import pyplot as plt\nimport numpy as nm\nfrom datetime import datetime\nimport array\n\nscript_dir=os.path.dirname(os.path.abspath(__file__));\n\nauto_time=[];\nauto_time2=[];\nauto_time_raw=[]; # offset time;\ncreate_time=...
[ [ "numpy.add", "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.style.use", "matplotli...
aklnk/xaesa
[ "9d2a2b0e69a052a89acc28f206621c107f101a7f" ]
[ "compare.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Oct 20 11:07:03 2016\r\n\r\n@author: sasha\r\n\"\"\"\r\n\r\nfrom .init import QTVer\r\n\r\nif QTVer == 4:\r\n from PyQt4 import QtGui, QtCore\r\n from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas\r\n from matplotlib.backend...
[ [ "matplotlib.backends.backend_qt5agg.NavigationToolbar2QT", "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg", "matplotlib.pyplot.figure" ] ]
ymdatta/BagOfVisualWords
[ "e023e84824c2b0e1e56674b6505be6aee78e219f" ]
[ "get_train_data.py" ]
[ "import get_cluster_centres\nimport numpy as np\n\n\ndef get_images_and_labels_1(img_dict):\n img_labels = []\n img_list = []\n for key in img_dict.keys():\n for des in img_dict[key]:\n img_labels.append(key)\n\n # extend label 50 times\n # img_labels.extend(itertool...
[ [ "numpy.asarray" ] ]
szachovy/lpdr
[ "ef43c83b07c17c2e2c4dfb2c58f44abe688e424b" ]
[ "lpdr/lpdr.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n__version__ = '0.1'\n__author__ = 'Wiktor Maj'\n\n#------\nimport numpy as np\nimport cv2\n\nfrom keras.models import model_from_json\nfrom pytesseract import image_to_string\n\nimport argparse\nimport os\nimport stat\nimport pkg_resources\n#------\n\n### tesseract...
[ [ "numpy.matrix", "numpy.array", "numpy.zeros", "numpy.ones", "numpy.where", "numpy.amax", "numpy.linalg.svd", "numpy.amin", "numpy.squeeze" ] ]
PreferredAI/seer
[ "d043f4b28b7b2bb82cb2a72031ac1df1191db97b" ]
[ "local_search_contextualized_opinion.py" ]
[ "import argparse\n\nimport numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\n\nfrom explanation_generation import (contextualize_candidate_sentences,\n get_contextualizer, get_preference)\nfrom sentence_pair_model import TfIdfSentencePair\nfrom util import convert_str_to_li...
[ [ "pandas.read_csv" ] ]
EVS-ATMOS/cmdv-rrm-anl
[ "1d73d2dc2cb3b86de43c817fe340d0b550e2e04b" ]
[ "code/w_pdfs_by_pope_regime_echotop.py" ]
[ "import matplotlib\nmatplotlib.use('Agg')\nimport pyart\nfrom netCDF4 import Dataset\nimport numpy as np\nfrom datetime import datetime, timedelta\nfrom copy import deepcopy\nimport glob\nimport math\nimport dask.array as da\nfrom distributed import Client, LocalCluster\nfrom dask import delayed, compute\nimport ti...
[ [ "numpy.arccos", "numpy.multiply", "numpy.where", "numpy.nanmean", "numpy.concatenate", "numpy.max", "numpy.nanpercentile", "numpy.logical_and", "scipy.ndimage.measurements.label", "scipy.ndimage.measurements.minimum", "numpy.arange", "numpy.sqrt", "scipy.ndimage...
4PiR2/SO-Pose
[ "a3a61d2c97b1084a4754d6c12e45e16d85809729" ]
[ "core/gdrn_modeling/datasets/ycbv_pbr.py" ]
[ "import hashlib\nimport logging\nimport os\nimport os.path as osp\nimport sys\n\ncur_dir = osp.dirname(osp.abspath(__file__))\nPROJ_ROOT = osp.normpath(osp.join(cur_dir, \"../../..\"))\nsys.path.insert(0, PROJ_ROOT)\nimport time\nfrom collections import OrderedDict\nimport mmcv\nimport numpy as np\nfrom tqdm import...
[ [ "numpy.where", "numpy.array", "numpy.abs", "numpy.zeros" ] ]
feliximmohr/master_thesis_software
[ "875348747900da4732558a2d790d6ebe827ffac3" ]
[ "python_model_DNN/auditory_model/utils/load_data_raw.py" ]
[ "\"\"\"\nA python module that provides functions and classes to load data for training.\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nfrom keras.utils import Sequence\n\n\nclass DataGenerator_raw(Sequence):\n \"\"\"\n A class for a data generator for Keras sequential models. Creates\n the training sa...
[ [ "pandas.read_hdf", "numpy.random.shuffle", "numpy.empty", "numpy.floor" ] ]
dataiku/dss-plugin-deeplearning-image
[ "d7ae22e171c374b92bdca8f0730e6f529fbea3cb" ]
[ "custom-recipes/deeplearning-image-score-v2/recipe.py" ]
[ "import pandas as pd\nfrom dataiku.customrecipe import get_recipe_config\n\nimport dku_deeplearning_image.utils as utils\nimport dku_deeplearning_image.dku_constants as constants\nfrom dku_deeplearning_image.config_handler import create_dku_config\n\nfrom dku_deeplearning_image.recipes import ScoreRecipe\nfrom dku_...
[ [ "pandas.DataFrame" ] ]
Wu-Zhe/maskgan-local
[ "446688d9317fea0a5cbb4bd8b1cf227df6679dc7" ]
[ "official/recommendation/ncf_keras_main.py" ]
[ "# Copyright 2018 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.logging.set_verbosity", "tensorflow.zeros", "tensorflow.keras.layers.Lambda", "tensorflow.keras.layers.Input", "tensorflow.keras.backend.learning_phase", "tensorflow.logging.info", "tensorflow.keras.Model", "tensorflow.zeros_like", "tensorflow.slice", "tensorflo...
splunk/splunk-mltk-container-docker
[ "6e98e5984d99d7a3318f3e68c224d2a5163b717b" ]
[ "app/model/dnn_regressor.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n\n \n# In[ ]:\n\n\n# mltkc_import\n# this definition exposes all python module imports that should be available in all subsequent commands\nimport json\nimport datetime\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\nfrom tensorflow import keras\n\n# ...
[ [ "pandas.read_csv", "tensorflow.feature_column.numeric_column", "tensorflow.estimator.DNNRegressor" ] ]
johnson880319/Software
[ "045894227f359e0a3a3ec5b7a53f8d1ebc06acdd" ]
[ "catkin_ws/src:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/bala/duckietown/catkin_ws/src:/home/bala/duckietown/catkin_ws/src/lib/python2.7/site-packages/geometry/manifolds/matrix_linear_space.py" ]
[ "# coding=utf-8\nfrom abc import abstractmethod\n\nfrom contracts import check, contract\nfrom geometry.manifolds.differentiable_manifold import DifferentiableManifold\nfrom geometry.utils.numpy_backport import assert_allclose\nimport numpy as np\n\n__all__ = ['MatrixLinearSpace']\n\n\nclass MatrixLinearSpace(Diffe...
[ [ "numpy.isreal", "numpy.linalg.norm", "numpy.zeros" ] ]
zay3d/FinRL
[ "17633b874993f9e126131797dcc481730b8e32ac" ]
[ "finrl/env/env_stocktrading.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom gym.utils import seeding\nimport gym\nfrom gym import spaces\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport pickle\nfrom stable_baselines3.common.vec_env import DummyVecEnv\n#from stable_baselines3.common import logger\n\n\nclass Sto...
[ [ "matplotlib.use", "numpy.array", "pandas.DataFrame", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "numpy.where", "numpy.argsort" ] ]
silent567/pytorch_geometric
[ "20f839935751f319541c1e0c075f09bb3da2a80a" ]
[ "examples/proteins_mincut_pool.py" ]
[ "import os.path as osp\nfrom math import ceil\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.nn import Linear\nfrom torch_geometric.datasets import TUDataset\nfrom torch_geometric.data import DataLoader\nfrom torch_geometric.nn import GCNConv, DenseGraphConv, dense_mincut_pool\nfrom torch_geometric.ut...
[ [ "torch.nn.Linear", "torch.cuda.is_available", "torch.nn.functional.log_softmax" ] ]
devalab/SCONES
[ "b2b81c0a00c5a82b28c918b33cbdbad804727cfd" ]
[ "SCONES/model/dataset.py" ]
[ "import torch\nimport numpy as np\n\nfrom torch.utils.data import Dataset\nfrom utils.constants import AA_ID_DICT, AA_SASA\n\nclass PreprocessedDataset(Dataset):\n def __init__(self, radius_cutoff, device, logger=None):\n self.logger = logger\n if logger is None:\n import logging\n ...
[ [ "torch.zeros", "numpy.count_nonzero", "numpy.isnan", "numpy.sin", "numpy.vectorize", "numpy.asarray", "torch.is_tensor", "numpy.exp", "torch.from_numpy", "numpy.where", "numpy.abs", "numpy.cos" ] ]
LaGauffre/SMCCompoMo
[ "242feab1f1a6f923b682cfb8b033bb9c96317dc3" ]
[ "Python_memoire/smclomo/loss_distribution.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Sep 2 15:42:14 2020\n\n@author: pierr\n\"\"\"\n\nimport scipy.special as sp\nimport math as ma\nimport pandas as pd\nimport numpy as np\nimport scipy.stats as st\nfrom scipy.optimize import minimize\n\n\ndef sim_gam_par(n, k, α, θ):\n \"\"\"\n Sample from a Ga...
[ [ "scipy.special.gammainc", "scipy.special.gamma", "numpy.exp", "numpy.where", "numpy.invert", "numpy.sort", "scipy.stats.binom", "numpy.log", "pandas.DataFrame", "numpy.logical_and", "numpy.sqrt", "numpy.append", "scipy.optimize.minimize", "scipy.stats.gamma"...
tfboyd/rl-reliability-metrics
[ "f5bbb3ce9c90f1bf599c002e843128ab541630a6" ]
[ "rl_reliability_metrics/evaluation/eval_metrics.py" ]
[ "# coding=utf-8\n# Copyright 2019 The Authors of RL Reliability Metrics.\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# U...
[ [ "numpy.random.seed" ] ]
kanand77/unet-updated
[ "54a4b7169f280ec78cedd787ffd9404f1c70645d" ]
[ "data_3.py" ]
[ "import numpy as np \nimport os\nfrom tensorflow.python.keras.utils.data_utils import Sequence\nimport skimage.io as io\n\nclass DataGenerator(Sequence):\n def __init__(self, im_IDs, train_path, truth_path, \n train_prefix = 'input', truth_prefix = 'truth',\n N_t = 25, batch_size=...
[ [ "numpy.fft.fftshift", "numpy.empty", "numpy.random.shuffle" ] ]
jlec/numdifftools
[ "43071da54627f896213cabcea61158d29f4e86b0" ]
[ "numdifftools/extrapolation.py" ]
[ "'''\nCreated on 28. aug. 2015\n\n@author: pab\n'''\nfrom __future__ import division, print_function\nimport numpy as np\nfrom scipy import linalg\nfrom scipy.ndimage.filters import convolve1d\nimport warnings\nEPS = np.finfo(float).eps\n_EPS = EPS\n_TINY = np.finfo(float).tiny\n\n\nclass Dea(object):\n '''\n ...
[ [ "numpy.sin", "scipy.ndimage.filters.convolve1d", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.diff", "scipy.linalg.pinv", "numpy.finfo", "numpy.where", "numpy.arange", "numpy.atleast_1d", "numpy.sqrt", "numpy.abs", "numpy.linspace" ] ]
DragonYong/DCGANFACEGENERATION
[ "7e14f355e0cefb2d61f695ca01e0441d174266ff" ]
[ "models.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# @Time : 2021/4/26-15:57\n# @Author : TuringEmmy\n# @Email : yonglonggeng@163.com\n# @WeChat : superior_god\n# @File : models.py\n# @Project : 00PythonProjects\nimport tensorflow as tf\n\n\ndef lrelu(x, leak=0.2):\n return tf.maximum(x, leak * x)...
[ [ "tensorflow.contrib.layers.batch_norm", "tensorflow.reshape", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.variable_scope", "tensorflow.layers.conv2d", "tensorflow.layers.dense", "tensorflow.layers.conv2d_transpose", "tensorflow.maximum", "tensorflow.nn.sigmoi...
XingxingZhang/PyTorch-NLP
[ "b998dbbd943f7a00f67fd94aacbe5e865577da33" ]
[ "examples/awd-lstm-lm/utils.py" ]
[ "from torch.autograd import Variable\n\n\ndef repackage_hidden(h):\n \"\"\"Wraps hidden states in new Variables, to detach them from their history.\"\"\"\n if type(h) == Variable:\n return Variable(h.data)\n else:\n return tuple(repackage_hidden(v) for v in h)\n" ]
[ [ "torch.autograd.Variable" ] ]
renatomatz/pdpipe
[ "edcb5553d40e724d02f89dc828301d03155a19ee" ]
[ "pdpipe/nltk_stages.py" ]
[ "\"\"\"PdPipeline stages dependent on the nltk Python library.\n\nPlease note that the nltk Python package must be installed for the stages in\nthis module to work.\n\nWhen attempting to load stages from this module, pdpipe will first attempt to\nimport nltk. If it fails, it will issue a warning, will not import an...
[ [ "pandas.DataFrame.from_dict" ] ]
orris27/nus_cs5242_project_group27
[ "2aa5722e8d9d722ff1a3a37f36cb35c1ece481f8" ]
[ "models/EncoderRNN.py" ]
[ "import torch.nn as nn\r\n\r\n\r\nclass EncoderRNN(nn.Module):\r\n def __init__(self, dim_vid, dim_hidden, input_dropout_p=0.2, rnn_dropout_p=0.5,\r\n n_layers=1, bidirectional=False, rnn_cell='gru'):\r\n \"\"\"\r\n\r\n Args:\r\n hidden_dim (int): dim of hidden state of r...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.init.xavier_normal_" ] ]
Mawiszus/World-GAN
[ "0ad21849e284e18c44e7ffede0eefb764e0ff4bb" ]
[ "minecraft/block2vec/block2vec_dataset.py" ]
[ "import os\nfrom collections import defaultdict\nfrom itertools import product\nfrom typing import Tuple\n\nfrom loguru import logger\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom PyAnvilEditor.pyanvil import World\nfrom torch.utils.data.dataset import Dataset\n\n\nclass Block2VecDataset(Dataset):\n\n def _...
[ [ "numpy.array", "numpy.random.rand", "numpy.sqrt" ] ]
BCV-Uniandes/SMIT
[ "c1084aa5040ac18a48db7679e050c4ce577b8535" ]
[ "models/spectral.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import Parameter\n\n\ndef l2normalize(v, eps=1e-12):\n return v / (v.norm() + eps)\n\n\nclass SpectralNorm(nn.Module):\n def __init__(self, module, name='weight', power_iterations=1):\n super(SpectralNorm, self).__init__()\n self.module = module...
[ [ "torch.nn.Parameter" ] ]
dmw51/reactiondataextractor
[ "f7d2ee9a2a7df17ffcf9b33efee2bcb49dfdcbae" ]
[ "reactiondataextractor/extractors/diagrams.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nDiagrams\n=======\n\nThis module contains a single diagram extraction class.\n\nauthor: Damian Wilary\nemail: dmw51@cam.ac.uk\n\n\"\"\"\nimport copy\nimport logging\nfrom matplotlib.patches import Rectangle\nimport numpy as np\n\nfrom sklearn.cluster import DBSCAN\nfrom sklearn.pre...
[ [ "numpy.array", "numpy.ceil", "numpy.mean", "sklearn.cluster.DBSCAN", "sklearn.preprocessing.MinMaxScaler", "numpy.hstack", "matplotlib.patches.Rectangle" ] ]
yuxiang-zhou/DenseDeformableModel
[ "382d9cc2ccee629c64ec873110c3653bcc3a30fe" ]
[ "dAAMs/gridview.py" ]
[ "from menpo.shape import PointCloud, TriMesh\n\nimport numpy as np\n\n\ndef grid_triangulation(shape):\n height, width = shape\n row_to_index = lambda x: x * width\n top_triangles = lambda x: np.concatenate([\n np.arange(row_to_index(x), row_to_index(x) + width - 1)[..., None],\n np.arange(ro...
[ [ "numpy.concatenate" ] ]
ans2human/Github-Scraper
[ "4554f76bd70c3ed02db7893cafee3143aeb08d8b" ]
[ "github.py" ]
[ "import time\nimport base64\nimport pandas as pd\nfrom selenium import webdriver\nfrom selenium.common.exceptions import NoSuchElementException\n\n\nurl = \"https://github.com/login\"\ndriver = webdriver.Chrome(executable_path= 'C:/Users/reckonsys/anshuman-work/product-analysis/productanalysis/chromedriver.exe')\nd...
[ [ "pandas.DataFrame" ] ]
usnistgov/perm_hmm
[ "b57b3cca51d0d91bde438a62f26c0b0123c26aa5" ]
[ "perm_hmm/policies/ignore_transitions.py" ]
[ "\"\"\"For the special case of two states and two outcomes, computes the optimal\npermutations for the related HMM that has transition matrix equal to the\nidentity matrix.\n\nBecause there are only two states, we adopt the convention that the two states\nare called the ``dark`` and ``bright`` states. The ``dark`` ...
[ [ "torch.zeros", "torch.nonzero", "torch.arange", "torch.from_numpy" ] ]
debcaldarola/FedAvg_pytorch
[ "ed4180020f7c0fd2060cd55a4daff79f91634bed" ]
[ "models/cifar10/cnn.py" ]
[ "import torch\nimport torch.nn as nn\nimport numpy as np\nimport os\nfrom PIL import Image\nimport torchvision.transforms as transforms\n\nIMAGE_SIZE = 32\nIMAGES_DIR = os.path.join('..', 'data', 'cifar10', 'data', 'raw', 'img')\n\ntransform_train = transforms.Compose([\n # transforms.RandomCrop(IMAGE_SIZE, padd...
[ [ "torch.nn.Linear", "numpy.array", "torch.nn.MaxPool2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.reshape" ] ]
Tariod/security
[ "2b544fdaa27760bd80879e3106cfb39dc986c73f" ]
[ "lab_01/part_04/part_04.py" ]
[ "import math\nfrom functools import partial\n\nimport pandas as pd\nimport random\nimport string\n\nfrom calculate_frequency import calculate_frequency_norm\nfrom ngrams import ngrams\nfrom substitution_cipher import substitution_cipher\n\n# ================ ALPHABET CONF ================\nALPHABET = string.ascii_u...
[ [ "pandas.read_csv" ] ]
catalinbotean/Licenta
[ "241184a31564ff676fe9637acf9c95539eca880b" ]
[ "network/Resnet.py" ]
[ "\"\"\"\n# Code Adapted from:\n# https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py\n#\n# BSD 3-Clause License\n#\n# Copyright (c) 2017,\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following...
[ [ "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.init.constant_", "torch.nn.init.kaiming_normal_", "torch.utils.model_zoo.load_url", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.InstanceNorm2d", "torch.load" ] ]
CEMES-CNRS/pymodaq_femto
[ "3482ff7ad049cb35ae47dd2edf35176d473ee4ed" ]
[ "src/pymodaq_femto/materials.py" ]
[ "from pypret.material import BaseMaterial\nimport numpy as np\n\n\nclass SellmeierF1(BaseMaterial):\n \"\"\" Defines a dispersive material via a specific Sellmeier equation.\n\n This subclass supports materials with a Sellmeier equation of the\n form::\n\n n^2(l) - 1 = c1 + c2 * l^2 / (l...
[ [ "numpy.sqrt", "numpy.full_like" ] ]
wotchin/openGauss-server
[ "ebd92e92b0cfd76b121d98e4c57a22d334573159" ]
[ "src/gausskernel/dbmind/sqldiag/src/pre_process.py" ]
[ "\"\"\"\nCopyright (c) 2020 Huawei Technologies Co.,Ltd.\n\nopenGauss is licensed under Mulan PSL v2.\nYou can use this software according to the terms and conditions of the Mulan PSL v2.\nYou may obtain a copy of Mulan PSL v2 at:\n\n http://license.coscl.org.cn/MulanPSL2\n\nTHIS SOFTWARE IS PROVIDED ON AN ...
[ [ "numpy.array" ] ]
Ali-AliAli-Ali/abs-lib
[ "d04962adef1908ad2f276c5dd390a0e5cbf21b09" ]
[ "tests/kpTests.py" ]
[ "import unittest\n\nimport numpy as np\n\nfrom abslib.kp import KnowledgePatternManager, DisjunctKnowledgePatternItem, MatrixProducer, QuantKnowledgePatternItem, \\\n ConjunctKnowledgePatternItem\n\n\n# Tests for knowledge pattern part of abslib\nclass KnowledgePatternManagerTest(unittest.TestCase):\n\n def t...
[ [ "numpy.array" ] ]
liketheflower/DL_training
[ "a7123bf846085a698089ab30dd15017f2e857f51" ]
[ "cifar10_image_resize.py" ]
[ "# Large CNN model for the CIFAR-10 Dataset\nimport numpy\nfrom keras.datasets import cifar10\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.layers import Dropout\nfrom keras.layers import Flatten\nfrom keras.constraints import maxnorm\nfrom keras.optimizers import SGD\nfrom keras....
[ [ "numpy.random.seed" ] ]
wangmengyun1998/HydroDataset
[ "40d461f564aedf8d1c456cdbba6f393f18ad5fcd" ]
[ "test/test_camels.py" ]
[ "import os\nimport pytest\n\nimport numpy as np\n\nimport definitions\nfrom hydrodataset.data.data_camels import Camels\n\n\n@pytest.fixture\ndef camels_aus_path():\n return os.path.join(definitions.DATASET_DIR, \"camels\", \"camels_aus\")\n\n\n@pytest.fixture\ndef camels_br_path():\n return os.path.join(defi...
[ [ "numpy.array", "numpy.sort" ] ]
aris-mukherjee/TransUNet-modified
[ "185307b677fd6ee05604213c90e14e028fab476a" ]
[ "BIDMC_test.py" ]
[ "import argparse\nimport logging\nimport os\nimport random\nimport sys\nimport numpy as np\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader\nfrom tqdm import tqdm\nfrom datasets.dataset_synapse import Synapse_dataset\nfrom utils import test_single_v...
[ [ "numpy.array", "torch.cuda.manual_seed", "numpy.random.seed", "matplotlib.pyplot.savefig", "numpy.sum", "torch.rot90", "numpy.mean", "torch.from_numpy", "torch.manual_seed", "matplotlib.pyplot.show", "sklearn.metrics.auc", "torch.load", "sklearn.calibration.Cali...
yuhaitao1994/Biendata_Molecule_Prediction_Challenge_3rd
[ "9f450f15045683d416bb02ad9633c95d9bc0908d" ]
[ "data_loader.py" ]
[ "# coding=utf-8\n\"\"\"\n加载原始数据,并将categorical features转化成NN模型1的one-hot编码,将numerical features标准化\n@author: yuhaitao\n\"\"\"\nimport pandas as pd\nimport os\nimport tqdm\nimport numpy as np\nimport seaborn as sns\nimport json\nimport datetime\nimport multiprocessing\nfrom sklearn.model_selection import KFold\n\n\ndef...
[ [ "pandas.isnull", "pandas.DataFrame", "pandas.Series" ] ]
jacks808/tensorflow-chatbot
[ "f9a53891294989a07c9b1516f685883b9f07856c" ]
[ "utils/data_helper.py" ]
[ "import codecs\nimport logging\nimport os\nimport re\nfrom collections import Counter\n\nimport jieba\nimport numpy as np\n\n\ndef cut_file(hparams):\n \"\"\"\n cut a file from sentence to words\n :param hparams: hparams\n :return: None\n \"\"\"\n src_file_path = hparams.data_path\n target_file...
[ [ "numpy.reshape" ] ]
dmitryvinn/nevergrad
[ "4909e3f694bdb7dbef8d27d70a9ea1f70aca6892" ]
[ "nevergrad/optimization/test_callbacks.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\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 time\nfrom pathlib import Path\nimport logging\nimport os\nimport numpy as np\nimport nevergrad as ng\ni...
[ [ "numpy.random.rand", "numpy.float_", "numpy.int_" ] ]
kmarathe10/mmf
[ "2e4acaad7ca8eee4319e1205a560eed81733a0be" ]
[ "tests/modules/test_losses.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\nimport collections\nimport unittest\nfrom unittest.mock import MagicMock\n\nimport torch\n\nimport mmf.modules.losses as losses\nfrom mmf.common.registry import registry\nfrom mmf.common.sample import SampleList\n\nRETURN_VALUE = torch.tensor(1.0)\n\n\ndef build_...
[ [ "torch.zeros", "torch.rand", "torch.manual_seed", "torch.randint", "torch.tensor", "torch.empty" ] ]
andyGFHill/fieldosophy
[ "8677048d56b382a45a80383fe8ff84d75a5f9760" ]
[ "examples/SPDE/2D/SPDEFEM2DSphereNonStat.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nThis script demonstrates:\n * Creating an spherical Matérn FEM approximation model in 2 dimensions.\n * Generate samples from this model.\n * Compute covariances.\n\n\nThis file is part of Fieldosophy, a toolkit for random fields.\n\nCopyright (C) 2...
[ [ "numpy.array", "numpy.sin", "scipy.stats.norm.rvs", "numpy.zeros", "numpy.ones", "numpy.mean", "matplotlib.pyplot.figure", "numpy.diff", "numpy.std", "numpy.arange", "numpy.sqrt", "matplotlib.pyplot.clf", "numpy.linspace", "numpy.meshgrid" ] ]
yshuqiao/steelDetect
[ "2424d3706d8d7e351094d2daa2869e70ed450836" ]
[ "mmdet/datasets/pipelines/transforms.py" ]
[ "import inspect\n\nimport mmcv\nimport numpy as np\nfrom numpy import random\n\nfrom mmdet.core import PolygonMasks\nfrom mmdet.core.evaluation.bbox_overlaps import bbox_overlaps\nfrom ..builder import PIPELINES\n\ntry:\n from imagecorruptions import corrupt\nexcept ImportError:\n corrupt = None\n\ntry:\n ...
[ [ "numpy.concatenate", "numpy.array", "numpy.ceil", "numpy.random.choice", "numpy.asarray", "numpy.zeros", "numpy.random.rand", "numpy.random.permutation", "numpy.tile", "numpy.random.random_sample", "numpy.random.uniform", "numpy.random.randint", "numpy.clip", ...
antonybholmes/libgsea
[ "f810f32370be51bec4d1b982098552b0f526b515" ]
[ "libgsea/extgsea.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Dec 13 14:13:10 2018\n\n@author: antony\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport sys\nimport matplotlib\nfrom matplotlib.colors import Normalize\nimport matplotlib.pyplot as plt\nimport matplotlib.transforms as transforms\nim...
[ [ "numpy.concatenate", "numpy.max", "numpy.zeros", "matplotlib.pyplot.savefig", "numpy.sum", "numpy.ones", "numpy.random.permutation", "numpy.min", "numpy.mean", "numpy.where", "numpy.sort", "numpy.argsort", "matplotlib.transforms.blended_transform_factory", "...
vigneshbabupj/Project_Vision
[ "dd4eefe99da0a5b4283fcc5b70a95e7657f1e450" ]
[ "plane_decoder/modules.py" ]
[ "\"\"\"\nCopyright (C) 2019 NVIDIA Corporation. All rights reserved.\nLicensed under the CC BY-NC-SA 4.0 license\n(https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).\n\"\"\"\n\nimport torch\nimport torch.nn.functional as F\nimport time\nimport numpy as np\nfrom torch import nn\nimport sys\n\ndef unmoldD...
[ [ "torch.nn.Linear", "torch.round", "torch.cat", "torch.stack", "torch.nn.BatchNorm2d", "torch.inverse", "torch.ones", "torch.nn.BatchNorm3d", "torch.norm", "torch.nn.ConvTranspose2d", "torch.abs", "torch.nn.Conv3d", "torch.nn.ConvTranspose3d", "torch.zeros", ...
yujheli/MachineLearningProjects
[ "fb6b2e7c38545f87d5b9fa13bb9c6dbededd47b1" ]
[ "MatrixFactorization/hw5.py" ]
[ "import argparse\nimport numpy as np\nimport pandas as pd\nimport keras.backend as K\nfrom keras.models import Model, Sequential\nfrom keras.layers import add, Dot, Input, Dense, Lambda, Reshape, Dropout, Embedding, Concatenate\nfrom keras.regularizers import l2\nfrom keras.initializers import Zeros\nfrom keras.cal...
[ [ "numpy.random.seed", "tensorflow.Session", "numpy.save", "numpy.mean", "tensorflow.ConfigProto", "numpy.std", "pandas.concat", "pandas.read_csv" ] ]
gseba/Missions_to_Mars
[ "a131078004241e4f3c019253dc4dfd17fc7ccf8a" ]
[ "scrape_mars.py" ]
[ "# Import dependencies\nimport requests\nfrom bs4 import BeautifulSoup as bs\nfrom splinter import Browser\nimport time\nimport re\nimport pandas as pd\n\n# Define a function the visits a webpage and returns a beautful soup\ndef get_soup(url):\n \n executable_path = {\"executable_path\": \"chromedriver.exe\"}...
[ [ "pandas.read_html" ] ]
annukamat/edu-live
[ "de06f7bad6a395c546ecf85d66e08bb8de2b3255" ]
[ "python-stuff/data-wrangling/labels-maker.py" ]
[ "import pandas as pd\nimport numpy as np\nimport cv2\n\n\ndata_file = 'thinking.csv'\n\n\"\"\"\nlabels must be a list of segments where the time serie class is true \n(i.e. the list of segments where the drawer has \"hands down\")\n\"\"\"\n\nlabels = [(29,96),(122,145),(162,185),(209,220),(244,261),(339,454)]\n\ndf...
[ [ "pandas.read_csv", "numpy.zeros" ] ]
onetask-ai/sequence-learn
[ "6f0fc2974ba591167ee9778a93e2ad833693ab55" ]
[ "sequencelearn/point_tagger.py" ]
[ "from sklearn.gaussian_process import GaussianProcessClassifier\nfrom sklearn.svm import SVC\nfrom sequencelearn import CONSTANT_OUTSIDE, PointTagger\n\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.naive_bayes import GaussianNB\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.t...
[ [ "sklearn.gaussian_process.GaussianProcessClassifier", "sklearn.ensemble.AdaBoostClassifier", "sklearn.ensemble.RandomForestClassifier", "sklearn.neighbors.KNeighborsClassifier", "sklearn.naive_bayes.GaussianNB", "sklearn.svm.SVC", "sklearn.linear_model.LogisticRegression", "sklearn...
g2des/17700_project
[ "ccb7ff64574aa8e649d8a3e743755e61b070d1f9" ]
[ "tests/tf_user.py" ]
[ "import csv, logging, requests, re, numpy as np\nfrom locust import HttpUser, TaskSet, task, constant_pacing ##ADD THIS\nimport json\nimport pyonmttok\nimport tensorflow as tf\n\n\nUSER_CREDENTIALS = None\nsentences = None\nnp.random.seed(17700)\n\nwith open('./data/training/news-commentary-v9.fr-en.en') as file:\n...
[ [ "numpy.random.seed" ] ]
yuyay/ASNG-NAS
[ "a13c4828cfa9acc1eebd598dc1f88ee18e152159" ]
[ "inpainting/main_inpainting_int.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport csv\nimport argparse\nimport numpy as np\n\nimport torch\nimport torch.utils\nimport torchvision\nimport torch.backends.cudnn as cudnn\n\nfrom common import utils\nfrom common.utils import RandomPixelMasking, RandomHalfMasking, CenterMasking\nfrom...
[ [ "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.cuda.set_device", "numpy.arange" ] ]
bezirganyan/Occup-R2N2
[ "9adf6d0a9cc6f884fc17c80b24e72060dbacf3c1" ]
[ "im2mesh/occupr2n2/models/decoder.py" ]
[ "\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom im2mesh.layers import (\n ResnetBlockFC, CResnetBlockConv1d,\n CBatchNorm1d, CBatchNorm1d_legacy,\n ResnetBlockConv1d\n)\n\n\nclass Decoder(nn.Module):\n ''' Decoder class.\n\n It does not perform any form of normalization.\n\n Args:\...
[ [ "torch.nn.Linear", "torch.nn.Conv1d", "torch.nn.ReLU", "torch.nn.BatchNorm1d", "torch.nn.functional.leaky_relu" ] ]
sillwood/voicemos
[ "6088b9c5dfd3dc44febd55e8a8fc02b93de1e9e1" ]
[ "helpers.py" ]
[ "import os\n\nimport numpy as np\nimport scipy\nimport wandb\n\nfrom tabula import Helper\n\n\nclass WandbHelper(Helper):\n def __init__(self, conf):\n\n wandb.init(project=\"voicemos\", entity=\"jiamenggao\", config=conf)\n wandb.run.name = conf[\"exp_name\"]\n\n def iter_end(self, data, metada...
[ [ "numpy.array", "scipy.stats.kendalltau", "scipy.stats.spearmanr", "numpy.mean", "numpy.corrcoef" ] ]
Fabrizio94/ECGClassification
[ "c4c00224cb9fd3fb67823a41581831bb7e112c0a" ]
[ "rpeakdetection/pan_tompkins.py" ]
[ "import os\nimport numpy as np\nfrom rpeakdetection.rpeak_detector import RPeakDetector\nrpd = RPeakDetector()\nevaluation_width = 36\necg_folder = \"../data/ecg/mitdb/\"\npeaks_folder = \"../data/peaks/pan_tompkins/\"\nprecisions = list()\nrecalls = list()\nfor name in os.listdir(peaks_folder):\n peaks = list()...
[ [ "numpy.mean" ] ]
qihongl/keras-resnet50-demo
[ "6f612d89374b69c5f9047dd0bffb779be4c8940a" ]
[ "test_vgg16.py" ]
[ "# reference1: https://github.com/fchollet/deep-learning-models\n# reference2: https://github.com/philipperemy/keras-visualize-activations\nfrom keras.applications.vgg16 import VGG16\nfrom keras.preprocessing import image\nfrom dep.imagenet_utils import preprocess_input, decode_predictions\nfrom dep.read_acts_keras...
[ [ "numpy.expand_dims" ] ]
Tenfleques/margipose
[ "ae0580cb7b3b41c21965cd32e280d2af0e8cf2c3" ]
[ "src/margipose/bin/run_gui.py" ]
[ "#!/usr/bin/env python3\n\nimport matplotlib\n\nfrom matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk\nimport matplotlib.pyplot as plt\nfrom matplotlib.figure import Figure\nfrom mpl_toolkits.mplot3d import Axes3D\nimport tkinter as tk\nfrom tkinter import ttk\nimport tkinter.font\ni...
[ [ "torch.device", "matplotlib.pyplot.get_cmap", "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg", "matplotlib.figure.Figure", "torch.set_grad_enabled", "matplotlib.backends.backend_tkagg.NavigationToolbar2Tk" ] ]
davidbailey/dpd
[ "29bce937e34afa2161788a5c4a911e590a388229" ]
[ "dpd/folium/plot_stops.py" ]
[ "from functools import partial\n\nimport folium\nimport geopandas\nfrom matplotlib import pyplot as plt\nimport mplleaflet\nfrom shapely.geometry import Point\n\nfrom dpd.osrm import contour_plot\n\n\ndef _plot_linestring(foliumMap, row):\n folium.PolyLine(\n locations=zip(row[\"geometry\"].xy[1], row[\"g...
[ [ "matplotlib.pyplot.subplots" ] ]
francis-mujani/News_and_Trading
[ "fb4c5642fd1f2facd300840b9091d85820d5e5ba" ]
[ "flask/model.py" ]
[ "import requests\nfrom pymongo import MongoClient\nfrom bson import json_util\nimport math\nimport numpy as np\nimport pandas as pd\nimport tensorflow\nfrom sklearn.preprocessing import MinMaxScaler\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import Dense, LSTM, Dropout\nimport con...
[ [ "pandas.to_datetime", "numpy.array", "numpy.reshape", "pandas.read_excel", "numpy.mean", "tensorflow.keras.layers.Dense", "tensorflow.keras.models.Sequential", "sklearn.preprocessing.MinMaxScaler", "tensorflow.keras.layers.LSTM" ] ]
PPTMiao/mtl-ssl
[ "b61449c3f902414304657de6ec217077e441a6b9" ]
[ "object_detection/meta_architectures/faster_rcnn_meta_arch.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.ones", "tensorflow.ones_like", "tensorflow.reshape", "tensorflow.Dimension", "tensorflow.stack", "tensorflow.greater", "tensorflow.nn.softmax", "tensorflow.to_float", "tensorflow.tile", "tensorflow.identity", "tensorflow.cast", "tensorflow.shape", "t...
kaikai581/t2k-mppc-daq
[ "6b4f7bf04d885e952d9fd653df8f9ca1dd31089e" ]
[ "FEBDAQMULTx2/data_analysis/12_labview_dark_rate/1_plot_dcr_vs_thr_by_stitching.py" ]
[ "#!/usr/bin/env python\n'''\nMake the dark count rate vs. threshold plot by concatenating multiple files.\n'''\n\nimport argparse\nimport matplotlib\nmatplotlib.use('Agg')\nimport os\nimport pandas as pd\nimport seaborn as sns\n\nclass segmented_rate:\n def __init__(self, infpns):\n self.dfs_raw = []\n ...
[ [ "matplotlib.use", "pandas.DataFrame", "pandas.read_csv" ] ]
jasondark/cvxpy
[ "bd6f5142effa8cf883d1a0d7fd46c0d906b2fb93" ]
[ "cvxpy/tests/test_dgp.py" ]
[ "import cvxpy\nfrom cvxpy.tests.base_test import BaseTest\nimport numpy as np\n\n\nclass TestDgp(BaseTest):\n def test_product(self):\n x = cvxpy.Variable((), pos=True)\n y = cvxpy.Variable((), pos=True)\n prod = x * y\n self.assertTrue(prod.is_dgp())\n self.assertTrue(prod.is_...
[ [ "numpy.array", "numpy.ones" ] ]
aaalgo/paperworks
[ "ea26a86469a878bcd4cb4ed3f5303ec37d21d733" ]
[ "flow/register.py" ]
[ "import sys\nfrom sklearn.linear_model import LinearRegression\nfrom reportlab.lib.units import inch\nfrom skimage import measure\nfrom flow.models import *\nfrom params import *\nimport numpy as np\nimport cv2\n\ndef points2paper (points):\n return [(x * SCAN_PPI/inch, y * SCAN_PPI/inch) for x, y in points]\n\n...
[ [ "numpy.max", "numpy.array", "numpy.zeros", "sklearn.linear_model.LinearRegression", "numpy.round", "numpy.sum", "numpy.copy", "numpy.ones", "numpy.min", "numpy.where" ] ]
SyuyaMurakami/RiskQuantLib-Doc
[ "2503befc24c2e422e51f8b9f468c8d8439e11c65" ]
[ "RiskQuantLib/Set/InterestRate/base.py" ]
[ "#!/usr/bin/python\n#coding = utf-8\nimport numpy as np\nimport pandas as pd\nfrom RiskQuantLib.Property.NumberProperty.numberProperty import numberProperty\nfrom RiskQuantLib.Property.InterestRate.interestRate import interestRate\n\nclass setBase:\n\n def setCode(self,codeString):\n self.code = codeStrin...
[ [ "pandas.Timestamp.now" ] ]
funnylittleman/Multilingual_Text_to_Speech
[ "4fad3dd1b74964cdd6f66d5e8d659d942fd56c57" ]
[ "finetune.py" ]
[ "import os\nimport time\nimport datetime\nimport math\nimport numpy as np\nimport torch\nfrom torch.utils.data import DataLoader\n\nfrom dataset.dataset import TextToSpeechDatasetCollection, TextToSpeechCollate\nfrom params.params import Params as hp\nfrom utils import audio, text\nfrom modules.tacotron2 import Tac...
[ [ "torch.sigmoid", "numpy.random.seed", "torch.no_grad", "torch.optim.Adam", "torch.save", "numpy.min", "torch.cuda.device_count", "torch.manual_seed", "torch.cuda.is_available", "torch.load", "torch.nn.functional.softmax", "torch.zeros_like", "torch.sum" ] ]
jasonplato/RL_for_AutonomousGreenhouse
[ "e814f3dc42a9ae684a1a6198c31dc900a8636d34" ]
[ "A3C.py" ]
[ "import multiprocessing # 多线程模块\nimport threading # 线程模块\nimport queue\nimport tensorflow as tf\nimport numpy as np\nimport gym\nimport os\nimport shutil # 拷贝文件用\nimport matplotlib.pyplot as plt\nfrom FeudalBatchProcessor import FeudalBatchProcessor\nimport policy_utils\nfrom LSTMmodel import SingleStepLSTM\n\nG...
[ [ "tensorflow.get_default_session", "tensorflow.constant_initializer", "tensorflow.group", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.gradients", "tensorflow.nn.softmax", "tensorflow.global_variables_initializer", "tensorflow.square", "tensorflow.shape", "tens...
scottprahl/ofiber
[ "aaad9aa368d28a0bcc0f34e12377fc3bcad80180" ]
[ "ofiber/cylinder_step.py" ]
[ "# pylint: disable=invalid-name\n# pylint: disable=no-name-in-module\n\"\"\"\nUseful routines for step-index cylindrical waveguides.\n\nSee <https://ofiber.readthedocs.io> for usage examples.\n\nBased on chapter 8 of A. Ghatak, K. Thyagarajan, An Introduction to Fiber\nOptics, Cambridge University Press, 1998\n\nFu...
[ [ "matplotlib.pyplot.annotate", "matplotlib.pyplot.xlim", "numpy.exp", "numpy.where", "scipy.optimize.brentq", "scipy.special.jn", "numpy.sqrt", "numpy.append", "numpy.log10", "numpy.empty_like", "numpy.array", "scipy.special.jn_zeros", "scipy.special.kn", "nu...
ThibHlln/unifhy
[ "4105932ed7dfec34d428c1f2d2f85ec25ea522ed" ]
[ "tests/tests/test_utils/test_record.py" ]
[ "import numpy as np\nfrom netCDF4 import Dataset\n\nimport unifhy\nfrom ..test_time import get_dummy_output_time_and_bounds\nfrom ..test_component import time_resolutions\n\n# expected raw values for states/transfers/outputs after main run\n# (null initial conditions, no spinup run, 12-day period)\nexp_records_raw ...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.amax", "numpy.amin" ] ]
SwamyDev/gym-quickcheck
[ "d271f509c11998c9f210c5d8131906f712553123" ]
[ "tests/test_alternation.py" ]
[ "import numpy as np\nimport pytest\nfrom gym import utils\nfrom more_itertools import last\nfrom pytest import approx\n\nfrom gym_quickcheck.envs.alteration_env import AlternationEnv\nfrom tests.aux import assert_that, follows_contract, assert_obs_eq, unpack_reward, unpack_obs, until_done, \\\n run_example\n\n\n...
[ [ "numpy.zeros" ] ]
wjjmjh/cogent3
[ "e10f4f933921d52b000096b7c016190a1602add6" ]
[ "src/cogent3/recalculation/calculation.py" ]
[ "#!/usr/bin/env python\n\nimport os\nimport time\nimport warnings\n\nimport numpy\n\nfrom cogent3.maths.optimisers import ParameterOutOfBoundsError, maximise\nfrom cogent3.maths.solve import find_root\n\n\nFloat = numpy.core.numerictypes.sctype2char(float)\n\n\nTRACE_DEFAULT = \"COGENT3_TRACE\" in os.environ\nTRACE...
[ [ "numpy.core.numerictypes.sctype2char", "numpy.exp", "numpy.log" ] ]
creatist/XueLangTianchi
[ "7deaf2936045f9f2d44035ec35bd9039f054b2cf" ]
[ "Resnet152/main.py" ]
[ "#!/usr/bin/python\n# -*- coding:utf-8 -*-\n# power by Mr.Li\nfrom Resnet152.utils.config import opt\nimport os\nimport torch as t\nimport Resnet152.models as models\nimport torch.backends.cudnn as cudnn\nfrom Resnet152.data.XueLangDataSet import XueLangDataSet #加载转换后的数据集\nfrom torch.utils.data import DataLoader...
[ [ "torch.autograd.Variable", "torch.save", "torch.utils.data.DataLoader", "torch.load", "torch.nn.functional.softmax", "sklearn.metrics.roc_auc_score", "torch.nn.CrossEntropyLoss" ] ]
jeremy24/rnn-classifier
[ "3a79b8b835af7fd2866513b2dcf4b3d812051db2" ]
[ "data_loader.py" ]
[ "from __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\n\n\nimport os\nimport math\nimport time\nimport re\nimport json\nimport glob\n# from multiprocessing import Process, RawValue, Lock\n# from multiprocessing.dummy import Pool as ThreadPool\nfrom six.moves...
[ [ "numpy.max", "numpy.array", "numpy.vectorize", "numpy.random.seed", "numpy.sum", "numpy.median", "numpy.load", "numpy.min", "numpy.split", "numpy.mean", "numpy.save", "numpy.unique" ] ]
heasungkim/reinforcementLearning
[ "e6114aa2665294b0b53b5693c9c45007ec445ef1" ]
[ "main2_Agent.py" ]
[ "\nimport tensorflow as tf\nimport numpy as np\nfrom replayBuffer import ReplayBuffer\n\nclass Agent_DDPG(object):\n def __init__(self, action_size, state_size, action_limit,):\n self.memory_size = 10000\n self.replayBuffer = ReplayBuffer(self.memory_size)\n self.sess = tf.Session()\n\n ...
[ [ "tensorflow.losses.mean_squared_error", "tensorflow.global_variables_initializer", "tensorflow.variable_scope", "tensorflow.layers.dense", "tensorflow.get_collection", "matplotlib.pyplot.subplot", "matplotlib.pyplot.rcParams.update", "tensorflow.train.AdamOptimizer", "tensorflo...
Ankur3107/transformers-1
[ "8e908c8c74f556a82534f4cf1e7a1b4f7b55d24c" ]
[ "tests/test_feature_extraction_speech_to_text.py" ]
[ "# coding=utf-8\n# Copyright 2021 HuggingFace Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "numpy.asarray", "numpy.sum", "numpy.mean", "numpy.allclose", "numpy.var" ] ]
mzegar/node-rapids
[ "27c9e2468372df4fae3779d859089b54c8d32c4f" ]
[ "modules/demo/ipc/graph/python/test_data.py" ]
[ "# Copyright (c) 2021, NVIDIA CORPORATION.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# 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 l...
[ [ "pandas.Timestamp" ] ]
QWDs4Z/elgkjeknf25
[ "15ed98b4b3bb9cf3437b8ed7a8dbdf92e0e56c83" ]
[ "Algorithm_4/Result_Alg_4_part1/Draw_figures_Alg4_1.py" ]
[ "import matplotlib as mpl\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom pylab import cm\r\na,b = np.loadtxt('FindFault_Alg4_firstTest.csv',unpack=True,delimiter=',',skiprows=1);\r\nfig = plt.figure();\r\nplt.scatter(a,b,color= \"green\",marker= \".\", s=0.5);\r\nplt.xlabel('The number of infectio...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure", "numpy.loadtxt", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter" ] ]
JasonMA606/Student_Performance_ML-DL
[ "ec87d3782371f55e9dd73b57a13b856df78ef7b4" ]
[ "scikit-learn_model/train.py" ]
[ "from __future__ import print_function\n\nimport argparse\nimport os\nimport pandas as pd\n\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.externals import joblib\n\n# TODO: Import any additional libraries you need to define a model\n\n\n# Provided model load function\ndef model_fn(model_dir):\n...
[ [ "sklearn.ensemble.RandomForestClassifier" ] ]
vir-k01/graph-pde
[ "f7bcf22d3f3c58b30769edfa57b86727154850d2" ]
[ "multipole-graph-neural-operator/neurips2_MGKN.py" ]
[ "import torch\nimport numpy as np\n\nimport torch.nn.functional as F\nimport torch.nn as nn\n\nfrom torch_geometric.data import Data, DataLoader\nimport matplotlib.pyplot as plt\nfrom utilities import *\nfrom torch_geometric.nn import GCNConv, NNConv\n\nfrom timeit import default_timer\nimport scipy.io\n\ntorch.man...
[ [ "torch.nn.Linear", "torch.device", "torch.optim.lr_scheduler.StepLR", "numpy.savetxt", "numpy.zeros", "torch.nn.ModuleList", "numpy.random.seed", "numpy.sum", "torch.save", "torch.no_grad", "torch.manual_seed", "torch.nn.functional.relu" ] ]
ypraveen/pandas
[ "50ebb24880d9d516a6dacf9a28117289fb9eae97" ]
[ "pandas/core/arrays/datetimelike.py" ]
[ "from datetime import datetime, timedelta\nimport operator\nfrom typing import Any, Sequence, Type, Union, cast\nimport warnings\n\nimport numpy as np\n\nfrom pandas._libs import NaT, NaTType, Timestamp, algos, iNaT, lib\nfrom pandas._libs.tslibs.c_timestamp import integer_op_not_supported\nfrom pandas._libs.tslibs...
[ [ "pandas.core.dtypes.common.is_string_dtype", "numpy.array_equal", "pandas.core.dtypes.common.is_unsigned_integer_dtype", "pandas.core.algorithms.value_counts", "pandas.core.ops.common.unpack_zerodim_and_defer", "pandas._libs.tslibs.timedeltas.delta_to_nanoseconds", "pandas.core.ops.inv...
nihilesh/sharpner
[ "bb74a20cebb5de284b50b1b81dc5b4b7fca34b7c" ]
[ "Python/matplotlib/tutorials_python/intermediate/tight_layout_guide.py" ]
[ "\"\"\"\n==================\nTight Layout guide\n==================\n\nHow to use tight-layout to fit plots within your figure cleanly.\n\n*tight_layout* automatically adjusts subplot params so that the\nsubplot(s) fits in to the figure area. This is an experimental\nfeature and may not work for some cases. It only...
[ [ "matplotlib.pyplot.colorbar", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplot2grid", "matplotlib.pyplot.gcf", "matplotlib.pyplot.show", "matplotlib.pyplot.gca",...
KonradUdoHannes/konstanz-open-data-api
[ "cfd2cc0c3a054600195069655882e7cc450ead61" ]
[ "opencity/fetch_dataset_list.py" ]
[ "import os\nimport sys\nimport time\nimport math\nimport requests\nimport pandas as pd\nfrom tqdm import tqdm\nfrom bs4 import BeautifulSoup\nfrom colorama import init, Fore, Back, Style\n\ninit() # colorama\n\n# from .config import Config as cf\n\n\nclass DataSetUrlFetcher:\n \"\"\"\n\tHandles the fetching and...
[ [ "pandas.DataFrame.from_dict", "pandas.read_csv", "pandas.merge" ] ]
riven314/Stylised-Controllable-Image-Captioning
[ "50fee52a02e98603cda0cb4b082950c565b96a0f" ]
[ "src/decoder.py" ]
[ "import os\n\nimport torch\nimport torch.nn as nn\n\nfrom src.dropouts import WeightDropout, InputDropout, RNNDropout, EmbeddingDropout\n\n\nclass Attention(nn.Module):\n \"\"\"\n Attention Network.\n \"\"\"\n\n def __init__(self, encoder_dim, decoder_dim, attention_dim):\n \"\"\"\n :param...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cat", "torch.nn.LSTMCell", "torch.nn.Softmax", "torch.nn.Sigmoid", "torch.nn.Parameter", "torch.nn.ReLU", "torch.from_numpy", "torch.nn.Embedding" ] ]
YeoLab/flotilla
[ "31da64567e59003c2b9c03fc8f4eb27ee62e299c" ]
[ "flotilla/visualize/ipython_interact.py" ]
[ "\"\"\"\nNamed `ipython_interact.py` rather than just `interact.py` to differentiate\nbetween IPython interactive visualizations vs D3 interactive visualizations.\n\"\"\"\n\nfrom __future__ import absolute_import, division, print_function\nfrom __future__ import unicode_literals\n\nimport os\n# import sys\nimport w...
[ [ "matplotlib.pyplot.gcf" ] ]
b1nhm1nh/jesse-ctf
[ "98e519ba6a08af5dd8dd5bae09617a6056f3b5e4" ]
[ "tests/test_helpers.py" ]
[ "import os\n\nimport arrow\nimport numpy as np\nimport pytest\n\nimport jesse.helpers as jh\n\n\ndef test_app_currency():\n from jesse.routes import router\n from jesse.enums import exchanges, timeframes\n router.initiate(\n [{'exchange': exchanges.BITFINEX, 'symbol': 'ETH-USD', 'timeframe': timefra...
[ [ "numpy.equal", "numpy.array" ] ]
Treadco/sharp-tick
[ "14cac0c707c4c6322f5b984e74b8ca96e4e332d4" ]
[ "tick_syn.py" ]
[ "#!/usr/bin/python\n# (c) 2017 Treadco software.\n# this defaults to python 2 on my machine\n\nimport numpy as np\nimport sys,os\nfrom PIL import Image\nfrom PIL import ImageChops\nfrom pylab import *\n\nimport kernel\n\ndef normalize( a ):\n# written generally\n# a tuple resolves to an index\n# just need to find t...
[ [ "numpy.array", "numpy.fft.fftn", "numpy.real", "numpy.multiply", "numpy.subtract" ] ]
201419/Optimizer-PyTorch
[ "5db2164fef8d419d4a1486c923f6835f54f0b091" ]
[ "optimistic.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom tensorflow.python.ops import control_flow_ops\nfrom tensorflow.python.ops import math_ops\nfrom tensorflow.python.ops import state_ops\nfrom tensorflow.python.framework import ops\nfrom tensorflow...
[ [ "tensorflow.python.ops.math_ops.cast", "tensorflow.python.ops.control_flow_ops.group", "tensorflow.python.framework.ops.convert_to_tensor", "tensorflow.sqrt", "tensorflow.div", "tensorflow.python.ops.state_ops.assign_sub", "tensorflow.square" ] ]
long-long-float/py-videocore
[ "f2a0ef174a936f7a6e11a9e24f34fb555acb84c7" ]
[ "tests/test_vpm.py" ]
[ "'Test of VPM read and write'\n\nimport numpy as np\n\nfrom videocore.assembler import qpu\nfrom videocore.driver import Driver\n\n#=================================== 32 bit ===================================\n\n@qpu\ndef horizontal_32bit_read(asm):\n mov(ra0, uniform)\n ldi(rb0, 4*16*16)\n for i in rang...
[ [ "numpy.all", "numpy.arange" ] ]
lee1043/assessed-cloud-fbks
[ "34829616644365ccab34488592a58288d7f068e5" ]
[ "code/zelinka_analysis.py" ]
[ "import MV2 as MV\nimport numpy as np\nimport MV2 as MV\n\n###########################################################################\ndef map_SWkern_to_lon(Ksw,albcsmap):\n \"\"\"\n Map each location's clear-sky surface albedo to the correct albedo bin\n \"\"\"\n\n albcsmap=MV.masked_greater(albcsmap,...
[ [ "scipy.interpolate.interp1d", "numpy.ma.sum", "numpy.where", "numpy.arange", "numpy.moveaxis", "numpy.ma.count", "numpy.expand_dims" ] ]
zxxia/RL-CC
[ "d3d3be0097d69ee07b06363ad531cf2479029d74" ]
[ "src/simulator/network_simulator/pcc/aurora/aurora_old.py" ]
[ "###########################################################################################\n# Implementation of Implicit Quantile Networks (IQN)\n# Author for codes: sungyubkim, Chu Kun(kun_chu@outlook.com)\n# Paper: https://arxiv.org/abs/1806.06923v1\n# Reference: https://github.com/sungyubkim/Deep_RL_with_pytor...
[ [ "torch.rand", "numpy.array", "torch.argmax", "torch.arange", "torch.FloatTensor", "tensorflow.compat.v1.logging.set_verbosity", "torch.nn.functional.linear", "numpy.random.uniform", "torch.LongTensor", "numpy.random.randint", "numpy.sqrt", "torch.load", "numpy.l...
milomacphail/machine_learning_models
[ "d38dcb0ae593163c98754eb3dfa6cf149c968ae1" ]
[ "Multilinear Regression/backward_multilinear_regression.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun May 24 11:50:59 2020\n\n@author: milom\n\"\"\"\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Importing the dataset\ndataset = pd.read_csv(\"50_Startups.csv\")\nX = dataset.iloc[:,:-1].values\nY = dataset.ilo...
[ [ "sklearn.preprocessing.LabelEncoder", "sklearn.linear_model.LinearRegression", "numpy.ones", "sklearn.model_selection.train_test_split", "pandas.read_csv", "sklearn.preprocessing.OneHotEncoder" ] ]