repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
nicococo/LAD
[ "d086cbd2b4b1adda8eb5921e3ca77c83e17b64f0" ]
[ "toydata.py" ]
[ "import cvxopt as co\nimport numpy as np\nimport pylab as pl\nimport matplotlib.pyplot as plt\n\nfrom ssvm import SSVM\nfrom so_multiclass import SOMultiClass\n\nclass ToyData:\n\n\n @staticmethod\n def get_gaussian(num,dims=2,means=[0,0],vars=[1,1]):\n data = co.matrix(0.0,(dims,num))\n for d i...
[ [ "numpy.round", "numpy.int", "numpy.random.uniform", "numpy.random.randint" ] ]
alexmascension/triku_notebooks
[ "ac8dbac867ea39b0489f3f075141347953d386d4" ]
[ "triku_nb_code/robustness_functions.py" ]
[ "import gc\nimport os\nfrom itertools import product\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport scanpy as sc\nimport scipy.stats as sts\nfrom tqdm.notebook import tqdm\n\nimport triku as tk\nfrom triku.tl._triku_functions import subtract_median\n\nf...
[ [ "matplotlib.lines.Line2D", "numpy.nan_to_num", "pandas.DataFrame", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "scipy.stats.pearsonr", "numpy.intersect1d", "numpy.abs", "pandas.read_csv", "sklearn.decomposition.PCA" ] ]
asaadeldin11/graspy
[ "26083e5fe0c79d0ce0bf045a07b8c6c6b0eab559", "26083e5fe0c79d0ce0bf045a07b8c6c6b0eab559" ]
[ "graspy/inference/latent_distribution_test.py", "graspy/simulations/simulations_corr.py" ]
[ "# Copyright 2019 NeuroData (http://neurodata.io)\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.concatenate", "numpy.zeros", "numpy.median", "numpy.sum", "numpy.eye", "numpy.multiply", "numpy.arange", "numpy.expand_dims" ], [ "numpy.array", "numpy.sum", "numpy.ones", "numpy.where", "numpy.any", "numpy.issubdtype" ] ]
MeimShang/sRender
[ "a07fcc2c2ce590649da4006c5de545ac65372817" ]
[ "croquis_style/pix2pix/train.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Time : 19-6-13\n# @Author : Jehovah\n# @File : train.py\n# @Software: PyCharm\n\n\nimport time\nimport options\nfrom data_loader2 import DataLoader\n\nfrom models.networks import *\nfrom utils.utils import GANLoss\nfrom torch.optim import lr_scheduler\nimpo...
[ [ "torch.utils.data.DataLoader" ] ]
kiyoon/video-long-term-feature-banks
[ "f1201555901cf8c04ce45e97551e01fd04b541d4" ]
[ "lib/utils/lr_policy.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\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 app...
[ [ "numpy.float32" ] ]
MartinWohlan/floodlight
[ "add8325725fba9169bec40726e6e949da7a8fc2f" ]
[ "floodlight/io/statsperform.py" ]
[ "import warnings\nfrom typing import Dict, Tuple, Union\nfrom pathlib import Path\n\nimport numpy as np\nimport pandas as pd\n\n\nfrom floodlight.core.code import Code\nfrom floodlight.core.events import Events\nfrom floodlight.core.pitch import Pitch\nfrom floodlight.core.xy import XY\n\n\ndef _create_metadata_fro...
[ [ "numpy.full", "numpy.array", "pandas.DataFrame", "numpy.sum", "numpy.diff", "numpy.insert", "numpy.floor" ] ]
safduagfyuafg/VSR-Transformer
[ "87701264f04746404c57418f135f90f7ef6c3f50" ]
[ "basicsr/models/video_base_model.py" ]
[ "import importlib\nimport torch\nfrom collections import Counter\nfrom copy import deepcopy\nfrom os import path as osp\nfrom torch import distributed as dist\nfrom tqdm import tqdm\n\nfrom basicsr.models.sr_model import SRModel\nfrom basicsr.utils import get_root_logger, imwrite, tensor2img\nfrom basicsr.utils.dis...
[ [ "torch.cuda.empty_cache", "torch.distributed.barrier", "torch.mean", "torch.distributed.reduce" ] ]
IPVS-AS/pusion
[ "58ef24b602f611192430f6005ecf5305f878f412" ]
[ "tests/doc_examples_1.py" ]
[ "import pusion as p\n\nimport sklearn\n\n\n# Create an ensemble of 3 neural networks with different hyperparameters\nclassifiers = [\n sklearn.neural_network.MLPClassifier(hidden_layer_sizes=(100,)),\n sklearn.neural_network.MLPClassifier(hidden_layer_sizes=(100, 50)),\n sklearn.neural_network.MLPClassifie...
[ [ "sklearn.neural_network.MLPClassifier" ] ]
MichaelDoron/imaginaire
[ "7c650977b29ea2dd12557d1fef447df9809db737", "7c650977b29ea2dd12557d1fef447df9809db737" ]
[ "imaginaire/third_party/flow_net/flownet2/utils/flow_utils.py", "imaginaire/losses/flow.py" ]
[ "# Copyright (C) 2020 NVIDIA Corporation. All rights reserved.\n#\n# This work is made available under the Nvidia Source Code License-NC.\n# To view a copy of this license, check out LICENSE.md\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os.path\n\nTAG_CHAR = np.array([202021.25], np.float32)\n\n\...
[ [ "numpy.max", "numpy.logical_not", "numpy.array", "numpy.uint8", "numpy.isnan", "numpy.zeros", "numpy.min", "numpy.finfo", "numpy.arange", "numpy.arctan2", "numpy.sqrt", "numpy.size", "numpy.repeat", "numpy.fromfile", "numpy.floor" ], [ "torch.dev...
RedTachyon/PettingZoo
[ "0c4be0ca0de5a11bf8eff3f7b87976edcacd093e", "0c4be0ca0de5a11bf8eff3f7b87976edcacd093e" ]
[ "pettingzoo/mpe/scenarios/simple_speaker_listener.py", "pettingzoo/classic/checkers/checkers.py" ]
[ "import numpy as np\n\nfrom .._mpe_utils.core import Agent, Landmark, World\nfrom .._mpe_utils.scenario import BaseScenario\n\n\nclass Scenario(BaseScenario):\n def make_world(self):\n world = World()\n # set any world properties first\n world.dim_c = 3\n num_landmarks = 3\n wo...
[ [ "numpy.square", "numpy.array", "numpy.concatenate", "numpy.zeros" ], [ "numpy.rot90", "numpy.array", "numpy.zeros", "numpy.ones", "numpy.roll" ] ]
jlscs/FastNN
[ "0628bd82e9e5a1772bc3246a914116abb6da9ade" ]
[ "image_models/models/nasnet/pnasnet.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.nn.relu", "tensorflow.test.is_gpu_available", "tensorflow.logging.info", "tensorflow.transpose", "tensorflow.variable_scope", "tensorflow.nn.softmax", "tensorflow.contrib.training.HParams" ] ]
reidy-p/DublinBusPredictions
[ "a6b1fc8a5c28500a3292883ea0dfcde1770d78d1" ]
[ "data_analytics/preprocessing/create_db.py" ]
[ "import sqlite3\nimport pandas as pd\n\n# Create db if it doesn't exist or connect to it if it does exist\nwith sqlite3.connect(\"/home/team13/db/database/DublinBusHistoric.db\") as connection:\n c = connection.cursor()\n\n # vehicles\n c.execute(\"\"\"DROP TABLE IF EXISTS vehicles\"\"\")\n c.execute(\"...
[ [ "pandas.read_csv" ] ]
leyiweb/Adversarially-Learned-Anomaly-Detection
[ "763359fc8fe84677f0c26075967c96ae4a4074f1", "763359fc8fe84677f0c26075967c96ae4a4074f1" ]
[ "toy_experiments/utils/rng.py", "alad/run.py" ]
[ "from numpy.random import RandomState\nfrom random import Random\n\nseed = 2\n\npy_rng = Random(seed)\nnp_rng = RandomState(seed)\n\ndef set_seed(n):\n global seed, py_rng, np_rng\n\n seed = n\n py_rng = Random(seed)\n np_rng = RandomState(seed)\n", "import time\nimport numpy as np\nimport tensorflow ...
[ [ "numpy.random.RandomState" ], [ "tensorflow.group", "tensorflow.ones_like", "numpy.mean", "tensorflow.zeros_like", "tensorflow.control_dependencies", "tensorflow.contrib.layers.flatten", "tensorflow.set_random_seed", "tensorflow.trainable_variables", "numpy.random.norma...
2torus/tf-quant-finance
[ "2647d65b4c8458203c89e023d03d738028f32884" ]
[ "tf_quant_finance/models/hull_white/vector_hull_white.py" ]
[ "# Lint as: python3\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "tensorflow.compat.v2.shape", "tensorflow.compat.v2.cast", "tensorflow.compat.v2.exp", "tensorflow.compat.v2.name_scope", "tensorflow.compat.v2.squeeze", "tensorflow.compat.v2.math.exp", "tensorflow.compat.v2.transpose", "tensorflow.compat.v2.linalg.cholesky", "tensorflow.compa...
jbergmanster/probability
[ "e15b307066e7485b8fe9faf3d289c739ab8d3806" ]
[ "tensorflow_probability/python/distributions/lkj.py" ]
[ "# Copyright 2018 The TensorFlow Probability 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 a...
[ [ "tensorflow.compat.v2.matmul", "tensorflow.compat.v2.shape", "tensorflow.compat.v1.get_default_graph", "tensorflow.compat.v2.sqrt", "tensorflow.compat.v2.math.log", "tensorflow.compat.v2.tile", "numpy.log", "tensorflow.compat.v2.rank", "tensorflow.compat.v2.name_scope", "te...
zwitterion/python_robot
[ "ab1e56c6189ff376522cdd93ddf209eb59df111a" ]
[ "main/robot.py" ]
[ "import os\nimport sys\nimport multiprocessing as mp\nimport traceback\nfrom collections import namedtuple\nfrom timeit import default_timer as timer\nimport numpy as np\nimport math\n\nfrom messagebus_manager import MessageBusManager, ProcessNames, TopicNames\nfrom config import Config\nfrom message import Message...
[ [ "numpy.sign", "numpy.array", "numpy.clip" ] ]
rasmita404/py-sgtl
[ "c2872b81ed4a591f880624de2288f4dadf57ccf8" ]
[ "sgtl/algorithms.py" ]
[ "\"\"\"\nA collection of spectral graph algorithms.\n\"\"\"\nfrom typing import Tuple, List, Set\nimport numpy as np\nimport scipy.sparse.linalg\n\nimport sgtl\n\n\ndef _sweep_set(graph: sgtl.Graph, vector: List[float]) -> Tuple[Set[int], Set[int]]:\n \"\"\"\n Given an SGTL graph and a vector, use the sweep s...
[ [ "numpy.ones" ] ]
johnnycakes79/pyops
[ "9eeda939e3f0d65a5dd220b3e439c8d2ba880d98" ]
[ "pyops/plots.py" ]
[ "import pandas as pd\nfrom bokeh.plotting import figure, show, output_notebook, gridplot\nfrom bokeh.palettes import brewer\nfrom collections import OrderedDict\nfrom bokeh.models import HoverTool\nimport numpy as np\nfrom bokeh.models import ColumnDataSource, Range1d, FactorRange\nfrom datetime import datetime\n\n...
[ [ "pandas.to_datetime", "numpy.hstack", "pandas.DataFrame" ] ]
jparrax/datascience_middle_course
[ "347dfd6f68fa0f90eac35e8154f3ea469ccbdea2" ]
[ "09_inspection/solutions/solution_06.py" ]
[ "import numpy as np\nfrom sklearn.pipeline import make_pipeline\nfrom sklearn.linear_model import RidgeCV\n\nalphas = np.logspace(-3, 3, num=100)\nmodel = make_pipeline(\n preprocessor, RidgeCV(alphas=alphas)\n)\nmodel\n" ]
[ [ "sklearn.linear_model.RidgeCV", "numpy.logspace" ] ]
alongwithyou/pytorch-kaldi
[ "ef16d0f44df65ee133c166fc51e150790d5ecd07" ]
[ "model/unet_dilated_encoder.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\n\r\nclass DownSamplingLayer(nn.Module):\r\n def __init__(self, channel_in, channel_out, dilation=1, kernel_size=15, stride=1, padding=7):\r\n super(DownSamplingLayer, self).__init__()\r\n self.main = nn.Sequential(\r\n...
[ [ "torch.cat", "torch.nn.Conv1d", "torch.nn.Tanh", "torch.nn.LeakyReLU", "torch.nn.functional.interpolate", "torch.nn.BatchNorm1d" ] ]
dingchenghu/baselines_openai
[ "f2729693253c0ef4d4086231d36e0a4307ec1cb3" ]
[ "baselines/deepq/replay_buffer.py" ]
[ "import numpy as np\nimport random\n\nfrom baselines.common.segment_tree import SumSegmentTree, MinSegmentTree\n\n\nclass ReplayBuffer(object):\n def __init__(self, size):\n \"\"\"Create Replay buffer.\n\n Parameters\n ----------\n size: int\n Max number of transitions to s...
[ [ "numpy.array" ] ]
Meg1211/GamestonkTerminal
[ "9e8b9fb631df1778795236b3ec2aa66725266c15" ]
[ "gamestonk_terminal/cryptocurrency/coingecko/pycoingecko_controller.py" ]
[ "\"\"\"Cryptocurrency Controller\"\"\"\n__docformat__ = \"numpy\"\n# pylint: disable=R0904, C0302, W0622\nimport argparse\nimport os\nimport pandas as pd\nfrom prompt_toolkit.completion import NestedCompleter\nfrom gamestonk_terminal import feature_flags as gtff\nfrom gamestonk_terminal.helper_funcs import get_flai...
[ [ "pandas.DataFrame" ] ]
danielperezr88/sentence-transformers
[ "56a7990c56c484e7948cf6400b54f27114bb267c" ]
[ "examples/applications/parallel-sentence-mining/bucc2018.py" ]
[ "\"\"\"\r\nThis script tests the approach on the BUCC 2018 shared task on finding parallel sentences:\r\nhttps://comparable.limsi.fr/bucc2018/bucc2018-task.html\r\n\r\nYou can download the necessary files from there.\r\n\r\nWe have used it in our paper (https://arxiv.org/pdf/2004.09813.pdf) in Section 4.2 to evalua...
[ [ "torch.nn.Identity", "sklearn.decomposition.PCA", "torch.tensor" ] ]
brianhie/ample
[ "8902dd2c165fbdcb1b387fd5389157ec1ded0b03" ]
[ "bin/tabula_ss2.py" ]
[ "import numpy as np\nimport os\nfrom scanorama import *\nfrom scipy.sparse import vstack\nfrom sklearn.cluster import KMeans\nfrom sklearn.preprocessing import normalize, LabelEncoder\n\nfrom experiments import *\nfrom process import load_names\nfrom utils import *\n\nnp.random.seed(0)\n\nNAMESPACE = 'tabula_ss2'\n...
[ [ "numpy.random.seed", "sklearn.preprocessing.LabelEncoder", "scipy.sparse.vstack", "sklearn.preprocessing.normalize" ] ]
UBC-MOAD/outputanalysisnotebooks
[ "50839cde3832d26bac6641427fed03c818fbe170" ]
[ "PythonScripts/get_dTrdzProfiles.py" ]
[ "from netCDF4 import Dataset\nimport numpy as np\nimport pandas as pd\nimport canyon_tools.readout_tools as rout\n#from MITgcmutils import rdmds # cant make it work\n\nCGrid = '/data/kramosmu/results/TracerExperiments/3DVISC_REALISTIC/run29/gridGlob.nc' # Smallest volume grid, closed bdy, no canyon.\nCGridOut = Dat...
[ [ "numpy.ma.masked_array", "pandas.DataFrame", "numpy.zeros", "numpy.expand_dims" ] ]
Big-Life-Lab/deepROC
[ "a36711205b2f5cc6091e20a8ae56dda1e3e9ae08" ]
[ "Python3.8/deepROC.py" ]
[ "# deepROC.py\n#\n# Copyright 2021 Ottawa Hospital Research Institute\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....
[ [ "numpy.isinf", "numpy.array", "sklearn.calibration.calibration_curve", "matplotlib.pyplot.xlim", "matplotlib.ticker.MultipleLocator", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.fill", "ma...
rmulla-biocorellc/helmet-assignment
[ "9e806468aed127e9e1e77d36a5e56fa654aa2ea1" ]
[ "helmet_assignment/score.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom sklearn.metrics import accuracy_score\n\n\"\"\"\nHelper functions for scoring accoring to the competition evaluation metric.\nhttps://www.kaggle.com/c/nfl-health-and-safety-helmet-assignment/overview/evaluation\n\"\"\"\n\n\ndef check_submission(sub):\n \"\"\"\n C...
[ [ "numpy.ones_like", "pandas.DataFrame", "sklearn.metrics.accuracy_score", "pandas.read_csv", "numpy.maximum" ] ]
relf/OpenMDAO
[ "e96aa063d04330ed0aedece365b7f0b8717aad3b" ]
[ "openmdao/core/tests/test_discrete.py" ]
[ "\"\"\" Unit tests for discrete variables.\"\"\"\n\nimport sys\nimport unittest\nimport copy\n\nfrom io import StringIO\nimport numpy as np\n\nimport openmdao.api as om\nfrom openmdao.core.driver import Driver\nfrom openmdao.visualization.n2_viewer.n2_viewer import _get_viewer_data\nfrom openmdao.test_suite.compone...
[ [ "numpy.array" ] ]
amalrkrishna/subway_time_prediction
[ "11d3b82dfdba84ed0953b8f38e0c13bd2124b885" ]
[ "trainer/get_realtime_mbta_feed.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Dec 9 10:35:12 2018\n\n@author: amal\n\"\"\"\n\nimport time\nimport task\nimport model\nimport helpers\nimport numpy as np\nimport pandas as pd\nfrom geopy.distance import vincenty\nimport threading \n\nVEHICLE_POSITIONS = \"https://cdn.mbta....
[ [ "numpy.mean", "pandas.merge", "pandas.concat" ] ]
mgerhards/Real-Time-Voice-Cloning
[ "c7defceed16fc7c3e0798331c740d121e2a76129" ]
[ "vocoder/models/fatchord_version.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom vocoder.distribution import sample_from_discretized_mix_logistic\nfrom vocoder.display import *\nfrom vocoder.audio import *\n\n\nclass ResBlock(nn.Module):\n def __init__(self, dims):\n super().__init__()\n self.conv1 = nn...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.distributions.Categorical", "torch.stack", "torch.nn.GRU", "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.no_grad", "torch.nn.Conv2d", "torch.nn.BatchNorm1d", "torch.load", "torch.nn.functional.softmax", ...
dqawami/openvino_training_extensions
[ "dddda1dfd651eaae2d59cecda84275b1b03bd0ad" ]
[ "ote/ote/utils/misc.py" ]
[ "\"\"\"\n Copyright (c) 2020-2021 Intel 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...
[ [ "torch.cuda.is_available", "torch.cuda.device_count" ] ]
PenHsuanWang/IncrementalLearningE2EPlayground
[ "c22708bdf4dd4ba8770dafe6e85f0481b34030fd" ]
[ "RiverToys/ConceptDriftExample.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import gridspec\n\nfrom river import drift\n\n#Auxiliary function to plot the data\ndef plot_data(dist_a, dist_b, dist_c, drifts=None):\n fig = plt.figure(figsize=(7,3), tight_layout=True)\n gs = gridspec.GridSpec(1, 2, width_ratios=[3, 1])...
[ [ "numpy.concatenate", "numpy.random.RandomState", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.subplot" ] ]
karldw/conleySE
[ "4fb680106896786a6068b7f347f98ce97a08197e" ]
[ "tests/test_cross_section.py" ]
[ "\n# coding: utf-8\nimport numpy as np\nfrom distance import great_circle\nfrom core import cross_section as conley_cross_section\nfrom core import (CutoffError, get_kernel_fn,\n _neighbors_to_sparse_uniform, _neighbors_to_sparse_nonuniform)\nfrom numpy.testing import assert_allclose\nfrom hypothes...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.isnan", "numpy.empty", "numpy.zeros", "numpy.linalg.LinAlgError", "numpy.ascontiguousarray", "numpy.ones", "numpy.logical_and", "numpy.finfo", "numpy.linalg.lstsq", "numpy.diag", "numpy.argsort", "numpy....
bbayukari/abess
[ "3b21b0a58cac6c1464ec9403ffbe4902fee7b890" ]
[ "python/pytest/test_dataset.py" ]
[ "import pytest\nimport numpy as np\nimport abess\nfrom utilities import assert_shape\n\n\n@pytest.mark.filterwarnings(\"ignore\")\nclass TestOther:\n \"\"\"\n Test for other modules in abess package.\n Include: `abess.datasets`\n \"\"\"\n\n @staticmethod\n def test_glm():\n np.random.seed(1...
[ [ "numpy.random.seed" ] ]
DKuva/projclfimg1819
[ "58f799b69f50edfff651b789287a33ef9a0477b8" ]
[ "implementation/datasetloader.py" ]
[ "import os\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport cv2\nimport csv\n\n\ndef get_images_and_labels(datadir,train_data,imtype=-1,bgr2rgb=False,resolution=(0,0),crop=False):\n '''\n Reads traffic sign data for German Traffic Sign Recognition Benchmark.\n Arguments: \n datadir --...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
gina-alaska/arctic_thermokarst_model
[ "7a3dbedb72b133670bb6e476fc3f5788bbcdbca4" ]
[ "atm/checks/poi_based.py" ]
[ "\"\"\"\nPOI Based transition\n--------------------\n\nTransition functions for POI based changes in area\n\"\"\"\nimport numpy as np\nimport functions\n# import matplotlib.pyplot as plt\n\ndef transition (name, year, grids, control):\n \"\"\"This checks for any area in the cohort 'name' that should be transitio...
[ [ "numpy.logical_not", "numpy.logical_and", "numpy.zeros" ] ]
steffen-jung/movie-mining
[ "d49a6d6b9a6c632ea748fc582c2576b71fab9074", "d49a6d6b9a6c632ea748fc582c2576b71fab9074" ]
[ "src/data/normalize_column.py", "src/model/ModelSelection_NeuralNet.py" ]
[ "import pandas as pd\nfrom sklearn import preprocessing\nimport numpy as np\n\n\n# this method removes the initial column and replaces it with the normalized column\n\ndef normalize_column_data(df, column_name):\n x = df[column_name].astype(np.float64)\n x = x.values.reshape(-1, 1)\n\n # Create a minimum a...
[ [ "pandas.DataFrame", "sklearn.preprocessing.MinMaxScaler" ], [ "pandas.DataFrame", "pandas.read_csv" ] ]
julesmuhizi/qkeras
[ "eec5a4a9f1930d0ee51319ab7363dd038a6e68c5" ]
[ "tests/print_qstats_test.py" ]
[ "# Copyright 2019 Google LLC\n#\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agree...
[ [ "tensorflow.keras.layers.DepthwiseConv2D", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.Activation", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.BatchNormalization" ] ]
thomktz/TinyAutoML
[ "74d9d806ac31795dbf1c4fd60755b0bf9a7c4124" ]
[ "TinyAutoML/builders.py" ]
[ "from typing import Union\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.base import BaseEstimator\nfrom sklearn.compose import ColumnTransformer\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.preprocessing import (\n FunctionTransformer,\n MinMaxScaler,\n OneHotEncoder,\n StandardScaler...
[ [ "sklearn.preprocessing.StandardScaler", "pandas.DataFrame", "sklearn.compose.ColumnTransformer", "sklearn.preprocessing.MinMaxScaler", "sklearn.preprocessing.OneHotEncoder" ] ]
fossabot/experiment_code
[ "de0fdfc4f6cc61cd1941af8df6e39491fada0e6b" ]
[ "pandas_learn/pandas_senior.py" ]
[ "\n\nimport pandas as pd\nimport numpy as np\ndates = pd.date_range('20130101', periods=6)\ndf = pd.DataFrame(np.random.randn(6,4), index=dates, columns=list('ABCD'))\n\n\ndf['E'] = np.where(df['D'] >= 0, '>=0', '<0')\ndf['F'] = np.random.randint(0, 2, 6)\ndf.assign(G = df.A * df.D) # 或者\ndf['F'] = df['F'].apply(st...
[ [ "pandas.value_counts", "pandas.date_range", "numpy.random.randn", "numpy.where", "numpy.random.randint", "pandas.Series", "pandas.pivot_table" ] ]
arita37/tbats
[ "4e726919f08e39e74dd70a592b5258dfc7b25953" ]
[ "test/tbats/TBATSHarmonicsChoosingStrategy_test.py" ]
[ "import pytest\nimport numpy as np\n\nfrom tbats.tbats import HarmonicsChoosingStrategy, Context, Components, ModelParams\n\n\nclass TestTBATSHarmonicsChoosingStrategy(object):\n class ModelMock:\n def __init__(self, y, params, aic_score):\n self.params = params\n self.y = y\n ...
[ [ "numpy.array", "numpy.array_equal", "numpy.asarray" ] ]
bionictoucan/crispy
[ "2bd5cb78736ee0799c85ad2d0a00bf97dce2f006" ]
[ "crispy/io.py" ]
[ "import numpy as np\nimport os, zarr\nfrom astropy.wcs import WCS\nfrom scipy.io import readsav\nfrom tqdm import tqdm\n\ndef memmap_crisp_cube(path):\n \"\"\"\n This function memory maps a legacy La Palma data cube pulling metainformation from appropriate files. The function first looks for an ``assoc.pro`` ...
[ [ "numpy.median", "numpy.arange", "numpy.memmap", "scipy.io.readsav" ] ]
vincent841/mask-rcnn-test-python
[ "94b64790a483180a8729ef44958c90d623665d46" ]
[ "detector/samples/balloon/nespresso.py" ]
[ "\"\"\"\nMask R-CNN\nTrain on the toy Balloon dataset and implement color splash effect.\n\nCopyright (c) 2018 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\n------------------------------------------------------------\n\nUsage: import the module (see Jupyte...
[ [ "numpy.sum", "numpy.ones", "numpy.where" ] ]
ajoshiusc/robust-unet
[ "d72ec684a68623530efa4105694d936218ae6637" ]
[ "old_code/train_AE_fashion_rOBUST.py" ]
[ "from __future__ import print_function\nimport argparse\nimport torch\nimport math\nimport torch.utils.data\nfrom torch import nn, optim\nfrom torch.nn import functional as F\nfrom torchvision import datasets, transforms\nfrom torchvision.utils import save_image\nimport numpy as np\nfrom sklearn.model_selection imp...
[ [ "torch.nn.Linear", "torch.device", "numpy.array", "torch.prod", "numpy.random.seed", "torch.no_grad", "torch.pow", "torch.from_numpy", "torch.manual_seed", "torch.sum", "torch.cuda.is_available", "numpy.prod", "torch.utils.data.DataLoader", "numpy.clip", ...
deganii/ViolinResponse
[ "bf31f339bdb219ea93b2eaa18eab51cbc85fa382" ]
[ "linear_model.py" ]
[ "#!env python3\n\nimport numpy as np\nimport wavio\nimport scipy.signal\nimport scipy.fftpack\nimport math\nimport sys\nfrom scipy.fftpack import fft, ifft\n\n# Generate the best linear approximation (BLA) of the system\n# Note: The Fourier Transform IS the best least squares fit!\n# Credit to Pascal Brunet:\n# Non...
[ [ "numpy.reshape", "numpy.zeros", "numpy.round", "numpy.mean", "scipy.fftpack.fft", "numpy.abs", "numpy.var" ] ]
aymara/tensorflow
[ "84e5e832c1de1df3bbedb007c45a8384f175d7d5", "84e5e832c1de1df3bbedb007c45a8384f175d7d5", "84e5e832c1de1df3bbedb007c45a8384f175d7d5", "84e5e832c1de1df3bbedb007c45a8384f175d7d5" ]
[ "tensorflow/python/keras/layers/recurrent_v2.py", "tensorflow/python/keras/callbacks_v1.py", "tensorflow/python/keras/engine/compile_utils_test.py", "tensorflow/python/ops/risc/risc_grad.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.math_ops.equal", "tensorflow.python.ops.gen_cudnn_rnn_ops.CudnnRNN", "tensorflow.python.platform.sysconfig.get_build_info", "tensorflow.python.ops.state_ops.assign", "tensorflow.python.keras.backend.maybe_convert_to_ragged", "tensorflow.python.eager.context.get_devic...
tenajima/nyaggle
[ "6f64d1dd25fab5390420f876e93fda213d65ec44" ]
[ "tests/ensemble/test_averaging.py" ]
[ "import numpy as np\nimport scipy.stats as stats\nfrom numpy.testing import assert_array_almost_equal\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.ensemble import RandomForestClassifier, RandomForestRegressor\nfrom sklearn.linear_model import Ridge, LogisticRegression\nfrom sklearn.utils.mult...
[ [ "sklearn.metrics.mean_squared_error", "sklearn.ensemble.RandomForestClassifier", "sklearn.linear_model.Ridge", "sklearn.utils.multiclass.type_of_target", "numpy.testing.assert_array_almost_equal", "sklearn.svm.SVC", "sklearn.linear_model.LogisticRegression", "sklearn.svm.SVR", ...
Veltys/TBLO
[ "85a2a84b40bf0e83f4b4acc9fe467de28372a971", "85a2a84b40bf0e83f4b4acc9fe467de28372a971" ]
[ "src/tblo.py", "src/lib.py" ]
[ "from operator import attrgetter\n\nimport numpy as np\n# import pprint as pp\nimport random as rand\n\n\nclass Learner(object):\n def __init__(self, initialSubjects, initialFitness):\n super(Learner, self).__init__()\n\n self.subjects = initialSubjects\n self.fitness = initialFitness\n\n ...
[ [ "numpy.around", "numpy.array", "numpy.mean" ], [ "numpy.sum", "numpy.exp", "numpy.cos" ] ]
yyht/PyCLUE_albert
[ "71143d797e967a4215f3a8c1664b56369da4e58e" ]
[ "PyCLUE/utils/utils/classifier_utils/modeling.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl...
[ [ "tensorflow.matmul", "tensorflow.ones", "tensorflow.reshape", "tensorflow.control_dependencies", "tensorflow.nn.softmax", "tensorflow.one_hot", "tensorflow.einsum", "tensorflow.cast", "tensorflow.shape", "tensorflow.concat", "tensorflow.logging.info", "tensorflow.tr...
opendatafit/sasview
[ "c470220eecfc9f6d8a0e27e2ea8919dcb1b38e39" ]
[ "src/sas/sasgui/plottools/PlotPanel.py" ]
[ "\"\"\"\n Plot panel.\n\"\"\"\nfrom __future__ import print_function\n\nimport logging\nimport traceback\nimport math\nimport os\nimport operator\nimport copy\n\nimport wx\nimport numpy as np\n\n# Try a normal import first\n# If it fails, try specifying a version\nimport matplotlib\nmatplotlib.interactive(False)...
[ [ "matplotlib.use", "numpy.histogram2d", "matplotlib.font_manager.FontProperties", "numpy.log10", "matplotlib.backends.backend_wxagg.FigureCanvasWxAgg.__init__", "numpy.zeros", "numpy.errstate", "numpy.ones", "numpy.min", "numpy.isfinite", "matplotlib.interactive", "m...
keedio/tensorflow
[ "8a428cdd350a56b9f7de2ed55b3fbe7b6ad6b257" ]
[ "tensorflow/contrib/kfac/python/ops/fisher_factors.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.contrib.kfac.python.ops.utils.extract_pointwise_conv2d_patches", "tensorflow.python.ops.variable_scope.variable_scope", "tensorflow.python.ops.variable_scope.get_variable", "tensorflow.python.ops.math_ops.matmul", "tensorflow.contrib.kfac.python.ops.utils.posdef_inv", "tensorfl...
k4rth33k/dnnc-operators
[ "a7fe3f1240c12b3438558def71fbfcd4520446c3" ]
[ "test/swig/Flatten.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\") yo...
[ [ "numpy.prod", "numpy.random.randn", "numpy.reshape" ] ]
ShiAngWang/video_analyst
[ "de4f86363cc408695428b423e8d6e346aa35149b" ]
[ "videoanalyst/model/backbone/backbone_impl/tinyconv.py" ]
[ "# -*- coding: utf-8 -*\r\n\r\nimport torch\r\nimport torch.nn as nn\r\n\r\nfrom videoanalyst.model.backbone.backbone_base import (TRACK_BACKBONES,\r\n VOS_BACKBONES)\r\nfrom videoanalyst.model.common_opr.common_block import conv_bn_relu\r\nfrom videoanalyst.mod...
[ [ "torch.nn.init.constant_", "torch.no_grad", "scipy.stats.truncnorm", "torch.nn.MaxPool2d" ] ]
qiuchenqqb/tp091
[ "94446122fc3d592101518c615583e2c6396bfe97", "94446122fc3d592101518c615583e2c6396bfe97" ]
[ "tensorpack/train/trainers.py", "tensorpack/dataflow/imgaug/crop.py" ]
[ "# -*- coding: utf-8 -*-\n# File: trainers.py\n\nimport multiprocessing as mp\nimport os\nimport sys\nimport tensorflow as tf\n\nfrom ..callbacks import CallbackFactory, RunOp\nfrom ..graph_builder.distributed import DistributedParameterServerBuilder, DistributedReplicatedBuilder\nfrom ..graph_builder.training impo...
[ [ "tensorflow.name_scope" ], [ "numpy.sqrt" ] ]
clarkfitzg/pandas
[ "fe9aa125c19ce2b22a0c4aabedd68b24df6cb98e", "a71ede374a019ea40321d8c1cfd13258b45ff58d" ]
[ "pandas/tseries/frequencies.py", "pandas/sparse/tests/test_sparse.py" ]
[ "from datetime import datetime\nfrom pandas.compat import range, long, zip\nfrom pandas import compat\nimport re\n\nimport numpy as np\n\nfrom pandas.core.algorithms import unique\nfrom pandas.tseries.offsets import DateOffset\nfrom pandas.util.decorators import cache_readonly\nimport pandas.tseries.offsets as offs...
[ [ "pandas.lib.Timestamp", "pandas.tseries.index.DatetimeIndex", "pandas.DatetimeIndex", "numpy.asarray", "pandas.compat.iteritems", "pandas.compat.zip", "pandas.core.common.is_datetime64_dtype", "pandas.tseries.offsets.CDay", "pandas.core.common.is_integer", "pandas.core.algo...
pnsaevik/ladim
[ "967728b291631dd5a83cb0ee041770a0a9b08313", "967728b291631dd5a83cb0ee041770a0a9b08313", "967728b291631dd5a83cb0ee041770a0a9b08313" ]
[ "postladim/cellcount.py", "examples/outline/animate.py", "test/test_utilities.py" ]
[ "import numpy as np # type:ignore\nimport xarray as xr # type: ignore\nfrom typing import Union, Optional, Tuple, List\n\nArray = Union[List[float], np.ndarray, xr.DataArray]\nLimits = Union[Tuple[int, int], Tuple[int, int, int, int]]\n\n\ndef cellcount(\n X: Array, Y: Array, W: Optional[Array] = None, grid_li...
[ [ "numpy.max", "numpy.min", "numpy.arange", "numpy.asarray" ], [ "matplotlib.pyplot.pcolormesh", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.show", "matplotlib.pyplot.matplotlib.col...
safdark/SDC-Semantic-Segmentation
[ "36c92ebe53025d00065d3dffbd8d593c713583fe" ]
[ "python/infer_video.py" ]
[ "#!/usr/bin/env python3\nimport tensorflow as tf\nimport input_utils\nimport warnings\nfrom distutils.version import LooseVersion\n\n# Check TensorFlow Version\nassert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You are using {}'.format(tf.__version__)\nprint('...
[ [ "tensorflow.test.is_gpu_available", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.test.gpu_device_name" ] ]
eudoxos/Aleph
[ "874882c33a0e8429c74e567eb01525613fee0616" ]
[ "utilities/visualize_cycles.py" ]
[ "#!/usr/bin/env python3\n#\n# This file is part of 'Aleph - A Library for Exploring Persistent\n# Homology'. It visualizes information about simple cycles in some\n# set of graphs, providing a sort of mean histogram visualization,\n# as the time or simulation parameter of the graph varies.\n#\n# Original author: Ba...
[ [ "numpy.max", "matplotlib.pyplot.colorbar", "numpy.nan_to_num", "numpy.savetxt", "numpy.zeros", "numpy.min", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
mfisherlevine/astroquery
[ "cda88ef18b308563e86ee79bcc78e4ac59874df1" ]
[ "astroquery/ipac/nexsci/nasa_exoplanet_archive/tests/test_nasa_exoplanet_archive_remote.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n\nimport pytest\n\nimport numpy as np\nimport astropy.units as u\nfrom astropy.coordinates import SkyCoord\n\nfrom astropy.tests.helper import assert_quantity_allclose\nfrom astroquery.exceptions import InputWarning, InvalidQueryError, NoResultsWar...
[ [ "numpy.all", "numpy.isfinite" ] ]
astro313/primrose
[ "891f001e4e198096edb74eea951d27c9ae2a278f" ]
[ "primrose/readers/sklearn_dataset_reader.py" ]
[ "\"\"\"Module to read canned datasets from sklearn\n\nAuthor(s):\n Carl Anderson (carl.anderson@weightwatchers.com)\n\n\"\"\"\nfrom primrose.base.sql_reader import AbstractReader\nfrom sklearn.datasets import *\nimport pandas as pd\n\n\nclass SklearnDatasetReader(AbstractReader):\n \"\"\"Read data from sklear...
[ [ "pandas.DataFrame" ] ]
mjpcollins/spam-filter
[ "4bb1da8391eebccb229c8e5faf935df402472d22" ]
[ "classifiers/nn.py" ]
[ "from numpy import genfromtxt\nfrom utils.neural_network import NeuralNetwork\n\n\ndef train():\n training_full_dataset = genfromtxt(\"data/training_spam.csv\", delimiter=',')\n test_full_dataset = genfromtxt(\"data/testing_spam.csv\", delimiter=',')\n training_dataset = training_full_dataset[:, 1:]\n t...
[ [ "numpy.genfromtxt" ] ]
swarm-ai/concept-to-clinic
[ "d447cacf57cbbe84f7b744303497030b2a92a122" ]
[ "prediction/src/algorithms/segment/src/models/simple_3d_model.py" ]
[ "import numpy as np\nfrom keras.callbacks import ModelCheckpoint\nfrom keras.engine import Input, Model\nfrom keras.layers import Conv3D, MaxPooling3D, UpSampling3D, Activation\nfrom keras.optimizers import Adam\nfrom scipy.ndimage import zoom\n\nfrom .segmentation_model import SegmentationModel\n\n\nclass Simple3D...
[ [ "scipy.ndimage.zoom", "numpy.zeros_like", "numpy.zeros" ] ]
ga642381/robust-vc
[ "90c5c51007db4544885e903d755fb95fadd1fb71" ]
[ "Voice-conversion-evaluation/models/any2any/VQVC+/audioprocessor.py" ]
[ "#!python\n# -*- coding: utf-8 -*-\n\"\"\"Preprocess audio files.\"\"\"\n\nfrom typing import Tuple, Optional\nimport numpy as np\nfrom librosa import load, stft\nfrom librosa.filters import mel\nfrom librosa.effects import trim\n\n\nclass AudioProcessor:\n \"\"\"Process audio data.\"\"\"\n\n # hyperparameter...
[ [ "numpy.log10", "numpy.dot", "numpy.clip" ] ]
JunhoPark0314/DCNet
[ "4b8b11701ae05903ecae779cb72949d320f134a7" ]
[ "tools/fewshot_exp/datasets/gen_fewlist_voc.py" ]
[ "import argparse\nimport random\nimport os\nimport numpy as np\nfrom os import path\nimport sys\n\nseed = sys.argv[1]\n\nclasses = [\"aeroplane\", \"bicycle\", \"bird\", \"boat\", \"bottle\",\n \"bus\", \"car\", \"cat\", \"chair\", \"cow\", \"diningtable\",\n \"dog\", \"horse\", \"motorbike\", \...
[ [ "numpy.loadtxt", "numpy.reshape" ] ]
gwq2018/modified_SSD_pytorch
[ "cfea2c0873c485d4e50d7465535cb647af066ef9" ]
[ "data/__init__.py" ]
[ "from .voc0712 import VOCDetection, VOCAnnotationTransform, VOC_CLASSES, VOC_ROOT, TEST_ROOT\n\nfrom .coco import COCODetection, COCOAnnotationTransform, COCO_CLASSES, COCO_ROOT, get_label_map\nfrom .config import *\nimport torch\nimport cv2\nimport numpy as np\n\ndef detection_collate(batch):\n \"\"\"Custom col...
[ [ "torch.FloatTensor", "numpy.array", "torch.stack" ] ]
saharshy29/altML
[ "3c107af1c3b0416e7d78d612ac8254ccfdb1cc7a" ]
[ "ml/utils/load_data.py" ]
[ "import numpy as np\r\nfrom tensorflow import keras\r\nfrom utils.preprocessing import *\r\nfrom pickle import load, dump\r\nimport random\r\n'''\r\n\t*We have Flickr_8k.trainImages.txt and Flickr_8k.devImages.txt files which consist of unique identifiers(id) \r\n\t\twhich can be used to filter the images and their...
[ [ "tensorflow.keras.preprocessing.sequence.pad_sequences", "tensorflow.keras.utils.to_categorical", "numpy.array", "tensorflow.keras.preprocessing.text.Tokenizer" ] ]
jenuk/clip-bb
[ "a19c4bf8b6ca6aebf05a56bff9a39561a6480aa6" ]
[ "clip-bb.py" ]
[ "import argparse, os\n\nimport torch\nimport pandas as pd\nfrom omegaconf import OmegaConf\n\nfrom tqdm.auto import tqdm\n\nimport clip\n\nimport config2object \n\n\n@torch.no_grad()\ndef clip_bb(model_clip, dataloader, out_data, device):\n for slides, num_slides, starts, tokens, extra in tqdm(dataloader):\n ...
[ [ "torch.zeros", "torch.device", "torch.cat", "torch.arange", "torch.max", "pandas.DataFrame", "torch.no_grad", "torch.tensor", "torch.utils.data.DataLoader", "torch.nn.functional.cosine_similarity", "torch.flatten" ] ]
ctralie/DynamicsSynchronization
[ "d8a13a08e582814860636ddb8c9b2059b20736fb" ]
[ "CGLE1D.py" ]
[ "\"\"\"\nReplicate the 1D time series reshuffling problem in the equal space paper\n\"\"\"\nimport numpy as np\nimport scipy.io as sio\nimport scipy.linalg as slinalg\nimport matplotlib.pyplot as plt\nfrom PDE2D import *\nfrom PatchDescriptors import *\nfrom DiffusionMaps import *\n\nclass GLSimulation(PDE2D):\n ...
[ [ "numpy.max", "numpy.sum", "scipy.io.loadmat", "matplotlib.pyplot.figure", "matplotlib.pyplot.scatter", "numpy.abs", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "matplotlib.pyplot.subplot" ] ]
adamamiller/IDEAS_git_intro_EAC
[ "dd5639b35d622fa30dc25d0d4c9cede7089b2ec2" ]
[ "python_plot.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\nx_arr = np.linspace(0, 6*np.pi)\n\n# Plot a cosine curve\nplt.figure()\nplt.plot(x_arr, np.cos(x_arr), '-.', color='k')\nplt.show()\n\n\n\n" ]
[ [ "matplotlib.pyplot.show", "numpy.linspace", "numpy.cos", "matplotlib.pyplot.figure" ] ]
grap3-fru1t/QLSMA
[ "432e4b21581fa9e45a9173fba072d088765542b5" ]
[ "main.py" ]
[ "\"\"\" Control the reinforcement algorithm\nover multiple training episodes\n\"\"\"\nimport os\nimport time\nfrom datetime import datetime\nimport pickle\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom learning import Learning\nfrom model_objects import Agent, Track\n\n\nclass Game_Episode:\n\t\"\"\" Co...
[ [ "numpy.asarray", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
maddy-tod/qiskit-terra
[ "f11740cf0375c725880fc5feea749fbb64011f11" ]
[ "test/python/transpiler/test_consolidate_blocks.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2019.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE...
[ [ "numpy.array" ] ]
seberg/scipy
[ "d8081cdd40ed8cbebd5905c0ad6c323c57d5da6e" ]
[ "scipy/sparse/linalg/tests/test_matfuncs.py" ]
[ "#!/usr/bin/env python\n#\n# Created by: Pearu Peterson, March 2002\n#\n\"\"\" Test functions for scipy.linalg.matfuncs module\n\n\"\"\"\nimport numpy as np\nfrom numpy import array, eye, dot, sqrt, double, exp, random\nfrom numpy.testing import TestCase, run_module_suite, assert_array_almost_equal, \\\n assert...
[ [ "numpy.array", "numpy.testing.run_module_suite", "numpy.random.rand", "numpy.random.seed", "scipy.sparse.csc_matrix", "scipy.linalg.logm", "numpy.exp", "scipy.sparse.construct.eye", "numpy.eye", "numpy.iscomplexobj", "scipy.sparse.linalg.expm" ] ]
amirassov/retinanet
[ "5b8a05bcf705607166f83efb91bec6f7bfb0c86c" ]
[ "retinanet/models/subnet.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass Subnet(nn.Module):\n def __init__(self, num_classes, num_anchors, num_layers):\n super().__init__()\n self.num_classes = num_classes\n self.num_anchors = num_anchors\n self.num_layers = num_layers\n self.layers = self._make_layers...
[ [ "torch.nn.Sequential", "torch.cat", "torch.nn.Conv2d", "torch.nn.ReLU" ] ]
LeihuaYe/dowhy
[ "96450741c9dd8c9fb4d2c40e964d8183c4dd8ec3" ]
[ "dowhy/causal_refuter.py" ]
[ "import logging\nimport numpy as np\n\n\nclass CausalRefuter:\n \n \"\"\"Base class for different refutation methods. \n\n Subclasses implement specific refutations methods. \n\n \"\"\"\n\n def __init__(self, data, identified_estimand, estimate, **kwargs):\n self._data = data\n self._ta...
[ [ "numpy.random.seed" ] ]
julianmak/pydra
[ "eee7dbd5fbb2c64ead9f732ed1475634606b035a" ]
[ "native/sta2dfft.py" ]
[ "#/usr/bin/env python3\n#\n# JM: 12 Apr 2018\n#\n# the sta2dfft.f90 adapted for python\n# contains 2d spectral commands which uses stafft\n\nfrom stafft import *\n\n# This module performs FFTs in two directions on two dimensional arrays using \n# the stafft library module to actually compute the FFTs. If FFTs in on...
[ [ "numpy.arange" ] ]
xiaofx2/ai_semiconductors
[ "9f4a92b76acbd0ac1c04fc5ea038e175d13a7193" ]
[ "ai_semiconductors/tests/test_standardize.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[5]:\n\n\nimport sys\nsys.path.append(\"../\")\n\n\n# In[34]:\n\n\ndef test_standardize():\n import standardize\n import numpy as np\n a = np.array([1, 2, 3, 4, 5])\n std_a = (a - a.mean())/a.std()\n assert np.alltrue(std_a == standardize.standardize(a))...
[ [ "numpy.array" ] ]
brandonwillard/pymc3-hmm
[ "a90b13937601a77217d901e9f3daed0ffe1315a2" ]
[ "pymc3_hmm/step_methods.py" ]
[ "from itertools import chain\nfrom typing import Callable, Tuple\n\nimport numpy as np\n\ntry: # pragma: no cover\n import aesara.scalar as aes\n import aesara.tensor as at\n from aesara import config\n from aesara.compile import optdb\n from aesara.graph.basic import Variable, graph_inputs\n fro...
[ [ "scipy.stats.invgamma", "numpy.random.normal", "scipy.sparse.issparse", "numpy.dot", "numpy.empty", "numpy.full", "numpy.asarray", "numpy.log", "numpy.sum", "scipy.sparse.eye", "numpy.multiply", "numpy.random.uniform", "numpy.stack", "numpy.sqrt", "numpy...
EpiSci/SoCRATES
[ "901a896c5a765e3cb56f290188cde71c8707192d" ]
[ "gym_ds3/schedulers/models/deepsocs_model.py" ]
[ "import tensorflow as tf\n\nfrom gym_ds3.envs.utils.helper_deepsocs import get_vars, count_vars\n\n\ndef create_deepsocs_model(args, feat_hdims=[32,16], gnn_hdims=[16,8],\n task_hdims=[32,16,8], pe_hdims=[64,32,16,8], output_actv=None):\n \"\"\"\n Create DeepSoCS Model (compatible with Ray...
[ [ "tensorflow.matmul", "tensorflow.gradients", "tensorflow.reshape", "tensorflow.nn.softmax", "tensorflow.compat.v1.layers.dense", "tensorflow.compat.v1.placeholder", "tensorflow.shape", "tensorflow.concat", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.compat.v1.la...
DenseAI/deep-learning-and-fashion-mnist
[ "49e21d821bbbcc6c9b33f5ee440a61a166efed15", "49e21d821bbbcc6c9b33f5ee440a61a166efed15" ]
[ "baseline/cnn/fashion_mnist_cnn_error_learning.py", "baseline/cnn/layers.py" ]
[ "\n# -*- coding:utf-8 -*-\n\n\nfrom __future__ import print_function\nimport keras\nimport tensorflow as tf\nfrom keras import backend as K\nfrom keras.callbacks import ModelCheckpoint, EarlyStopping\nimport os\n\n# Helper libraries\nimport random\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn.m...
[ [ "tensorflow.set_random_seed", "numpy.array", "tensorflow.get_default_graph", "numpy.random.seed", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "sklearn.metrics.classification_report", ...
AidarShakerimoff/scikit-learn
[ "f2481a73bd627e9d891ff27604e4e92a6f454c43" ]
[ "sklearn/tests/test_pipeline.py" ]
[ "\"\"\"\nTest the pipeline module.\n\"\"\"\nfrom tempfile import mkdtemp\nimport shutil\nimport time\nimport re\nimport itertools\n\nimport pytest\nimport numpy as np\nfrom scipy import sparse\nimport joblib\n\nfrom sklearn.utils.fixes import parse_version\nfrom sklearn.utils._testing import (\n assert_raises,\n...
[ [ "sklearn.utils._testing.assert_raise_message", "numpy.random.choice", "sklearn.utils._testing.MinimalTransformer", "sklearn.linear_model.LinearRegression", "numpy.mean", "sklearn.feature_extraction.text.CountVectorizer", "numpy.unique", "sklearn.feature_selection.SelectKBest", ...
fzi-forschungszentrum-informatik/P3IV
[ "51784e6dc03dcaa0ad58a5078475fa4daec774bd" ]
[ "p3iv_utils/test/test_finite_differences.py" ]
[ "\nimport unittest\nimport numpy as np\nfrom p3iv_utils.finite_differences import finite_differences\n\n\nclass CheckFiniteDifferences(unittest.TestCase):\n def test(self):\n pos_cartesian = np.array([[1, 0], [2, 2], [3, 3], [5, 3]])\n v, a, j = finite_differences(pos_cartesian, dt=0.1)\n\n ...
[ [ "numpy.array" ] ]
aryandeshwal/MerCBO
[ "526dfbc05bb7be3a77a30d8943233707f1636f14" ]
[ "MerCBO/acquisition/acquisition_marginalization.py" ]
[ "import torch\n\nfrom MerCBO.graphGP.kernels.diffusionkernel import DiffusionKernel\nfrom MerCBO.graphGP.models.gp_regression import GPRegression\nfrom MerCBO.graphGP.inference.inference import Inference\nfrom MerCBO.graphGP.sampler.tool_partition import group_input\n\nfrom MerCBO.acquisition.acquisition_functions ...
[ [ "torch.cat", "torch.stack", "torch.sum" ] ]
kinjad/MulBert
[ "8dbdb6420b3d46e115865323d740a86d2d6c9c96" ]
[ "transformers/examples/run_multiple_choice.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. 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...
[ [ "torch.distributed.get_world_size", "torch.utils.data.RandomSampler", "torch.cuda.is_available", "torch.load", "torch.nn.DataParallel", "torch.distributed.init_process_group", "torch.manual_seed", "torch.tensor", "torch.utils.data.DataLoader", "numpy.argmax", "torch.dis...
zfisher/transformers
[ "2541d4b185ad1284c5f0eb5d0df123152ad0c87a" ]
[ "tests/test_modeling_xlnet.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl...
[ [ "torch.manual_seed", "torch.Tensor", "torch.zeros" ] ]
unyacat/IllustStore
[ "cc2a74381a79b6f3fb8ea6d6cde31b35f48b197e" ]
[ "deepdanbooru/src/deepdanbooru/model/layers/__init__.py" ]
[ "import tensorflow as tf\n\n\ndef conv(\n x, filters, kernel_size, strides=(1, 1), padding=\"same\", initializer=\"he_normal\"\n):\n c = tf.keras.layers.Conv2D(\n filters=filters,\n kernel_size=kernel_size,\n strides=strides,\n padding=padding,\n kernel_initializer=initializ...
[ [ "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.GlobalAveragePooling2D", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.Multiply" ] ]
JulianWgs/pandas
[ "7a11be888a02d1d5689dfd33fbc56071bc7e8c69" ]
[ "pandas/tests/groupby/test_groupby.py" ]
[ "from datetime import datetime\nfrom decimal import Decimal\nfrom io import StringIO\n\nimport numpy as np\nimport pytest\n\nfrom pandas.compat import IS64\nfrom pandas.errors import PerformanceWarning\nimport pandas.util._test_decorators as td\n\nimport pandas as pd\nfrom pandas import (\n Categorical,\n Dat...
[ [ "pandas.Grouper", "pandas._testing.rands_array", "pandas.core.common.asarray_tuplesafe", "pandas.Timestamp", "pandas.concat", "pandas._testing.assert_series_equal", "numpy.random.random", "numpy.empty", "pandas.DataFrame", "pandas._testing.makeTimeDataFrame", "numpy.ara...
zduguid/slocum-nav
[ "4efa75a3b37dd6f95c199ebdc922610ad58fe688" ]
[ "dvl_plotter.py" ]
[ "# micron_plotter.py\n# \n# Plotting utilities for Micron Sonar\n# 2020-05-22 zduguid@mit.edu initial implementation \n\nimport math\nimport datetime\nimport numpy as np\nimport utm\nimport pandas as pd\nimport seaborn as sns\nimport earthpy.plot as ep\nimport matplotlib.cm as cm\nimport matplotlib.pypl...
[ [ "matplotlib.pyplot.xlim", "numpy.argmin", "numpy.triu_indices_from", "numpy.mean", "matplotlib.pyplot.cm.twilight_shifted", "numpy.cos", "matplotlib.pyplot.xticks", "numpy.max", "pandas.notnull", "numpy.sin", "numpy.zeros_like", "pandas.Timedelta", "matplotlib.p...
minorchange/co2_monitor_hd
[ "9d91d3dcc8363c547a9040d9ea2c97d05cc82502" ]
[ "scenarios.py" ]
[ "import numpy as np\nimport datetime\nfrom dateutil.relativedelta import relativedelta\n\n\ndef add_scenarios(df):\n\n assert \"co2_kt_total\" in df.columns\n assert \"trend_const_kt\" in df.columns\n assert \"trend_lin_kt\" in df.columns\n\n df[\"scenario_trendlin_kt\"] = df[\"co2_kt_total\"].fillna(df...
[ [ "numpy.isnan" ] ]
themohitpapneja/Code_Dump
[ "ec72144e66d12cba2ce719c37292517588490b42" ]
[ "Python/Pandas/I-X_method.py" ]
[ "import pandas as pd\nsongs={'Album':[\"abc\",\"fgh\",\"xyz\",\"uiop\"],\n 'Year':[\"122\",\"456\",\"545\",\"5465\"],\n 'length':[\"21\",\"45\",\"54\",\"5\"]}\ndf=pd.DataFrame(songs)\nprint(df)\n##df.ix[0,0]\n## ix is depreciated\n## noice- refer to pandas documentation-slicing ranges\n## variable of th...
[ [ "pandas.DataFrame" ] ]
quantshah/qutip
[ "b71625e004b9d99b0c2b4f777c1937d299de08e5", "b71625e004b9d99b0c2b4f777c1937d299de08e5" ]
[ "qutip/tests/test_lattice.py", "qutip/qobjevo.py" ]
[ "import numpy as np\nimport pytest\nimport qutip\n\n_r2 = np.sqrt(2)\n\n\ndef _assert_angles_close(test, expected, atol):\n \"\"\"Assert that two arrays of angles are within tolerance of each other.\"\"\"\n np.testing.assert_allclose(test % (2*np.pi), expected % (2*np.pi),\n atol...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.sin", "numpy.random.rand", "numpy.zeros", "numpy.ones", "numpy.exp", "numpy.eye", "numpy.prod", "numpy.arange", "numpy.random.randint", "numpy.sqrt", "numpy.sort", "numpy.cos", "numpy.random.random" ...
KejiZhaoLab/cLoops2
[ "2a1ce6b63a912cdd282dc40718d2c7333e3c16b2" ]
[ "build/scripts-3.6/tracPre2.py" ]
[ "#!python\n#--coding:utf-8--\n\"\"\"\ntracPre.py\nPre-processing code for Hi-Trac data, implemented with cLoops2, from fastq to bedpe files and qc report.\n2020-02-27: finished and well tested.\n2020-06-30: add linker filter, new stat, and changing mapping to end-to-end\n\"\"\"\n\n__author__ = \"CAO Yaqiang\"\n__em...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
Timh37/SeasonalDSLC_NWES
[ "9cbc155448dbd0ba07a5b95c5ce49dc3cb4a4187", "9cbc155448dbd0ba07a5b95c5ce49dc3cb4a4187" ]
[ "code_for_figures/Fig5_composites_roms/plot_cmip6_roms_experiments.py", "cmip6_processing/regridding/ESMMapping.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n#plot composite plots of the response of sea level & barotropic currents in ROMS\nto dSWSpA from three CMIP6 models in winter and summer\n\n@author: thermans\n\"\"\"\nimport xarray as xr\nimport matplotlib.ticker as mticker\nimport matplotlib.pyplot as plt\n...
[ [ "matplotlib.ticker.FixedLocator", "numpy.empty", "matplotlib.pyplot.close", "matplotlib.pyplot.figure" ], [ "numpy.ma.masked_array", "numpy.ndindex", "numpy.empty" ] ]
b06401098/b06401098_
[ "c97be047e85e2645375cdcd42bec0711c7380bbe" ]
[ "week1/week_1_first_meet.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Mar 1 15:50:43 2018\n\n@author: user\n\"\"\"\n\nimport pandas as pd\n\ndf = pd.read_csv('Ntu_Orders.csv')\n\ndf.head()\n\ndf.tail()\n\ndf.shape\ndf.info()\n\ndf['new_DateId'] = pd.to_datetime(df['DateId'].astype(str),format='%Y%m%d')\n\ndf.info()\ndf.head()\n\ndf['Q...
[ [ "pandas.read_csv" ] ]
jweisz/reviewer-assignment
[ "c3e5a56b7583d3208cbe2718a06d4e7d81845d5f" ]
[ "assign-without-priors.py" ]
[ "#!/usr/bin/env python3\nfrom numpy.random import default_rng\nimport argparse\nimport csv\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(description='Create reviewing assignments')\n parser.add_argument('--n', dest='n', type=int, default=3, required=False, help='number of reviews per submis...
[ [ "numpy.random.default_rng" ] ]
layumi/hmr
[ "45f8434658e1fc6d07bb863f8c8e8ed4d9abcea7" ]
[ "generate_3DVIP_bg.py" ]
[ "\"\"\"\nDemo of HMR.\n\nNote that HMR requires the bounding box of the person in the image. The best performance is obtained when max length of the person in the image is roughly 150px. \n\nWhen only the image path is supplied, it assumes that the image is centered on a person whose length is roughly 150px.\nAlter...
[ [ "matplotlib.use", "matplotlib.pyplot.subplot", "numpy.array", "numpy.max", "numpy.reshape", "numpy.zeros", "matplotlib.pyplot.title", "tensorflow.Session", "numpy.load", "numpy.mean", "matplotlib.pyplot.figure", "matplotlib.pyplot.draw", "numpy.expand_dims", ...
gdurin/mokas
[ "57893d0191c988b241dcf5701d4213a3cbcf587a", "57893d0191c988b241dcf5701d4213a3cbcf587a" ]
[ "mokas_stackimages.py", "mokas_cluster_methods.py" ]
[ "import os, sys, glob, time, re\nimport scipy\nimport scipy.ndimage as nd\nimport scipy.signal as signal\nimport scipy.stats.stats\nimport numpy as np\nimport numpy.ma as ma\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport matplotlib.colors as colors\nimport matplotlib.cm as cmx\nfrom colorsys imp...
[ [ "numpy.rot90", "numpy.compress", "matplotlib.pyplot.errorbar", "numpy.copy", "numpy.min", "numpy.mean", "numpy.where", "matplotlib.pyplot.draw", "scipy.asarray", "scipy.concatenate", "scipy.ndimage.measurements.center_of_mass", "numpy.concatenate", "numpy.max", ...
jsndc99/Inertia_ByteCamp_2020
[ "8f0edf42847e09d8ba3ca570a35e12e091595f2f" ]
[ "Visualisation/visualise.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib\nmatplotlib.use(\"Qt5Agg\")\nimport matplotlib.pyplot as plt\nfrom pandas.plotting import scatter_matrix\nimport seaborn as sns\n\npd_df = pd.read_csv(\"data.csv\")\nprint(pd_df.head())\n\npd_df.describe().to_csv(\"describe.csv\")\npd_df[['Happy','Angry','...
[ [ "matplotlib.use", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "matplotlib.pyplot.clf", "pandas.read_csv", "pandas.plotting.scatter_matrix" ] ]
Mopolino8/ITHACA-SEM
[ "5ffdc13c9ecf14a51a6d044d567d3ec5f220efa0", "5ffdc13c9ecf14a51a6d044d567d3ec5f220efa0" ]
[ "ITHACA_SEM_code/ROM_Oseen_Iteration.py", "ITHACA_SEM_code/oseen_trafo_p_snap_imprv57.py" ]
[ "\n\n\"\"\"\n\nruns using \n1) python/3.3.2 2) numpy/1.11.1/python/3.3 \t\t 3) scipy/0.17.1/python/3.3\n\nmodule load python3/3.3.2 /scratch/mhess/py3p3/3.3\n\nAim: do MOR steady state solver with efficient matrices\n\n\"\"\"\n\n\n\nimport numpy as np\nimport time\nfrom ITHACA_SEM_code import ROM_Osee...
[ [ "numpy.dot", "numpy.linalg.norm", "numpy.zeros", "numpy.sum", "numpy.mean", "numpy.transpose", "numpy.arange", "numpy.linalg.svd", "numpy.cumsum" ], [ "numpy.loadtxt", "numpy.dot", "numpy.load", "numpy.save" ] ]
MinhyungCho/riemannian-batch-normalization
[ "d1ac938ca5af8af1b7c1d4f708c1aacd2d8cbab9" ]
[ "grassmann_optimizer.py" ]
[ "#from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\nfrom tensorflow.python.framework import ops\nfrom tensorflow.python.training import optimizer\n\nfrom gutils import unit\nfrom gutils import gproj\nfrom gutils import clip_by_...
[ [ "tensorflow.zeros_initializer", "tensorflow.convert_to_tensor", "tensorflow.assign", "tensorflow.group", "tensorflow.python.framework.ops.colocate_with", "tensorflow.Variable", "tensorflow.sqrt", "tensorflow.control_dependencies" ] ]
Jie-Yuan/1_DataMining
[ "f5338388b4f883233f350d4fb9c5903180883430" ]
[ "ext/DataMining/8_ParametersTuning/BayesianOptimization/TuningCV.py" ]
[ "# coding: utf-8\n__title__ = 'byes'\n__author__ = 'JieYuan'\n__mtime__ = '2017/12/10'\n\nimport warnings\n\nwarnings.filterwarnings('ignore')\nfrom udfs import *\nimport lightgbm as lgb\nimport xgboost as xgb\n\nfrom bayes_opt import BayesianOptimization\nfrom sklearn.ensemble import RandomForestClassifier\nfrom s...
[ [ "sklearn.model_selection.cross_val_score", "sklearn.datasets.make_classification" ] ]