repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
dvirg/auctions | [
"da706f3d11b9582c7f811de9f50b96b43ac8cbd0"
] | [
"old/SimultaneousAscendingPriceVector.py"
] | [
"#!python3\n\n\"\"\"\nDefines classes related to price-vectors.\n\nAuthor: Erel Segal-Halevi\nSince: 2019-12\n\"\"\"\n\nimport logging, sys\nfrom typing import *\n\nlogger = logging.getLogger(__name__)\nlogger.addHandler(logging.StreamHandler(sys.stdout))\n# To enable tracing, set logger.setLevel(logging.INFO)\n\n... | [
[
"scipy.optimize.linprog"
]
] |
maxxiefjv/privpack | [
"b6bff78588362e57bc3f1268ab864026db4a1afa"
] | [
"privpack-app/__main__.py"
] | [
"from runners import GaussianNetworkRunner, BinaryNetworkRunner\nfrom experiments import BinaryExperiment, GaussianExperiment\nfrom priv_bmi import BMIExperiment\nfrom utils import get_binary_data, get_gaussian_data\nfrom utils import save_results\n\nfrom privpack import BinaryPrivacyPreservingAdversarialNetwork as... | [
[
"numpy.linspace"
]
] |
KennyCandy/HAR | [
"739ede1907374215cfc1dd6bd525d8d5b5f4606e"
] | [
"module45/CCCPC_32_32.py"
] | [
"# Note that the dataset must be already downloaded for this script to work, do:\n# $ cd data/\n# $ python download_dataset.py\n# quoc_trinh\n\nimport tensorflow as tf\n\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom sklearn import metrics\n\nimport os\nimport sys\nimport date... | [
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.nn.conv2d",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.nn.rnn_cell.BasicLSTMCell",
"tensorflow.random_normal",
"tensorflow.cast",
"numpy.max",
"tensorflow.trainable_variables",
"tensorflow.argmax",
... |
dychen24/magx | [
"3d72cfa447bcab050e97ee517b1688ef99dd480d"
] | [
"Codes/optimization/real_time_pos_face.py"
] | [
"from os import read\nimport queue\nfrom codetiming import Timer\nimport asyncio\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport sys\nimport random\nfrom itertools import count\nimport time\nfrom matplotlib.animation import FuncAnimation\nfrom numpy.core.numeric import True_\nimport matplotlib\nimport ... | [
[
"matplotlib.use",
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros_like",
"numpy.sin",
"numpy.argmin",
"numpy.zeros",
"numpy.log",
"numpy.load",
"numpy.mean",
"matplotlib.pyplot.figure",
"numpy.stack",
"numpy.savez",
"matplotlib.pyplot.pause",
"numpy.sqr... |
cloud-cds/cds-stack | [
"d68a1654d4f604369a071f784cdb5c42fc855d6e"
] | [
"etl/alerts/server.py"
] | [
"import pandas as pd\npd.set_option('display.width', 200)\nimport asyncio, asyncpg\nimport concurrent.futures\nimport logging\nimport json\nimport etl.io_config.server_protocol as protocol\nfrom etl.io_config.database import Database\nfrom etl.alerts.predictor_manager import PredictorManager\nimport datetime as dt\... | [
[
"pandas.set_option"
]
] |
LucaCappelletti94/EnsmallenGraph | [
"572532b6d3f4352bf58f9ccca955376acd95fd89"
] | [
"notebooks_and_scripts/graph_miner/repositories/monarch_initiative_graph_repository.py"
] | [
"\"\"\"Sub-module handling the retrieval and building of graphs from MonarchInitiative.\"\"\"\nfrom typing import List, Dict\nimport os\nimport requests\nfrom bs4 import BeautifulSoup\nimport pandas as pd\nimport compress_json\nfrom .graph_repository import GraphRepository\n\n\nclass MonarchInitiativeGraphRepositor... | [
[
"pandas.read_xml"
]
] |
NeilDG/SGID-PFF | [
"e027ac65e63f3c052665290cd0438bb7bdeabf9f"
] | [
"code/logger/logger.py"
] | [
"import torch\nimport imageio\nimport numpy as np\nimport os\nimport datetime\n\nimport matplotlib\n\nmatplotlib.use('Agg')\nfrom matplotlib import pyplot as plt\n\n\nclass Logger:\n def __init__(self, args, init_loss_log):\n self.args = args\n self.psnr_log = torch.Tensor()\n self.loss_log ... | [
[
"matplotlib.use",
"torch.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"torch.load",
"numpy.linspace",
"torch.Te... |
magic20191/spark | [
"74ebef243c18e7a8f32bf90ea75ab6afed9e3132"
] | [
"python/pyspark/ml/linalg/__init__.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"numpy.bincount",
"numpy.max",
"numpy.count_nonzero",
"numpy.isnan",
"numpy.dot",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.asarray",
"numpy.array_equal",
"numpy.set_printoptions",
"numpy.array",
"numpy.min",
"numpy.nonzero",
"numpy.frombuffer",
"numpy.... |
wtjiang98/mmpose-gyl | [
"ed369ba4dfcd875ed7dba9263660f1f660658b0a"
] | [
"mmpose/models/detectors/top_down.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport warnings\n\nimport mmcv\nimport numpy as np\nfrom mmcv.image import imwrite\nfrom mmcv.utils.misc import deprecated_api_warning\nfrom mmcv.visualization.image import imshow\n\nfrom mmpose.core import imshow_bboxes, imshow_keypoints\nfrom .. import builder\nfr... | [
[
"numpy.vstack"
]
] |
Yoshi-0921/EXP | [
"8da7c2baa7fc956cbf91b20ff870208b134b99d6"
] | [
"experiments/exp5/exp5_agent.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom random import random\nfrom typing import Tuple\n\nimport numpy as np\nimport torch\nfrom torch import nn, optim\n\nfrom models.dqn_conv import DQN_Conv\nfrom utils.agent import Agent\nfrom utils.buffer import Experience\nfrom utils.tools import hard_update\n\n\nclass DQNAgent(Agent)... | [
[
"torch.nn.MSELoss",
"torch.max",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.random.random"
]
] |
AlexanderKalistratov/mlir-extensions | [
"7f6bee6b19a73b177eb7f3c2ac735657e60c98c6"
] | [
"numba_dpcomp/mlir/numpy/funcs.py"
] | [
"# Copyright 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 law or ... | [
[
"numpy.concatenate",
"numpy.dot",
"numpy.empty",
"numpy.sum",
"numpy.true_divide",
"numpy.atleast_2d"
]
] |
FloList/GCE_NN | [
"3f6dd059fd366164a6fcda07643a9dae970a6aba"
] | [
"GCE/utils.py"
] | [
"import os\nimport sys\nimport time\nimport matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_pdf import PdfPages\nfrom shutil import copyfile\nimport psutil\nimport gc\n\n\ndef import_from(module, name):\n \"\"\"\n from 'module' import 'name'\n :param module: module name\n :param name: name of... | [
[
"matplotlib.pyplot.get_fignums",
"matplotlib.backends.backend_pdf.PdfPages",
"matplotlib.pyplot.figure"
]
] |
kashiy/optimized_pyointillism | [
"61755ecb26951f0131c9a73524e44b0c302d46b8"
] | [
"pyointillism_pop50_selection__mutation_crossover_random - M0.4 X0.8.py"
] | [
"# -------------------------------------------------------------------------------------------------\r\n# MIT License\r\n# If you use this in something awesome, credit would be nice but isn't required\r\n# Written by Keilan\r\n# Website: www.scholtek.com\r\n# Github: https://github.com/Keilan\r\n# -----------------... | [
[
"numpy.array",
"numpy.abs"
]
] |
eeishaan/ift6759-block2 | [
"be7c870746cbe73cdab6ee63def2263b745d4591"
] | [
"horoma/experiments/__init__.py"
] | [
"#!/usr/bin/env python3\n\nfrom types import SimpleNamespace\n\nimport torch\nimport numpy as np\n\nfrom horoma.cfg import DEVICE\nfrom horoma.constants import TrainMode\nfrom horoma.utils.score import compute_metrics\n\n\nclass HoromaExperiment(object):\n '''\n Base class for experiments\n '''\n\n def ... | [
[
"numpy.bincount",
"numpy.array",
"torch.no_grad",
"torch.save",
"numpy.where",
"numpy.argmax",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.load"
]
] |
hasandiwan/pandas | [
"f6059224456f6e287ec43524c6a1286fe398c548"
] | [
"pandas/io/formats/style.py"
] | [
"\"\"\"\nModule for applying conditional formatting to DataFrames and Series.\n\"\"\"\nfrom __future__ import annotations\n\nfrom collections import defaultdict\nfrom contextlib import contextmanager\nimport copy\nfrom functools import partial\nfrom itertools import product\nfrom typing import (\n Any,\n Call... | [
[
"pandas.isna",
"pandas.io.formats.excel.ExcelFormatter",
"pandas.api.types.is_list_like",
"pandas.core.indexing.maybe_numeric_slice",
"pandas.core.indexing.non_reducing_slice",
"pandas.util._decorators.doc",
"pandas.compat._optional.import_optional_dependency",
"pandas.core.common.... |
nielsdrost/pymt | [
"ae39bf807428827a6904202bf4d3b927daa255ea"
] | [
"pymt/framework/bmi_plot.py"
] | [
"#! /usr/bin/env python\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef quick_plot(bmi, name, **kwds):\n gid = bmi.get_var_grid(name)\n gtype = bmi.get_grid_type(gid)\n grid = bmi.grid[gid]\n\n x, y = grid.node_x.values, grid.node_y.values\n z = bmi.get_value(name)\n\n x_label = \"{n... | [
[
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.tripcolor",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.axis"
]
] |
chusloj/taxdata | [
"52c02c5f457145413983762280f8c1552b5ac740"
] | [
"tests/test_data.py"
] | [
"\"\"\"\nTest CPS and PUF data file contents.\n\"\"\"\nimport os\nimport pytest\nimport numpy as np\n\n\ndef unique_recid(data, dataname):\n \"\"\"\n Test that RECID values are unique.\n \"\"\"\n recid = data[\"RECID\"]\n unique, counts = np.unique(recid, return_counts=True)\n recid_count = dict(z... | [
[
"numpy.all",
"numpy.allclose",
"numpy.unique"
]
] |
AaronRegan/ObjectTracker | [
"d834f67963e7659e693df0792aadcfeecb4a2b21"
] | [
"hog.py"
] | [
"# import the necessary packages\nfrom __future__ import print_function\nfrom non_max_suppression import non_max_suppression\nfrom myqueue import myqueue\nfrom frames import frames\nfrom object import Object\nimport numpy as np\nimport argparse\nimport datetime\nimport imutils\nimport cv2\nimport time\n\nap = argpa... | [
[
"numpy.array",
"numpy.float32",
"numpy.zeros"
]
] |
Struth-Rourke/packagedata-struth-rourke | [
"b8a0d734b87f21047678a31b1461fba237d150f0"
] | [
"newpandaspackage/pandas_package.py"
] | [
"import pandas as pd\nfrom newpandaspackage.new_mod import train_val_test_func, date_splitting, add_state_names, list_series_df_col, StateWrangle\n\n\n## Function 1 (train_val_test_func)\n# Mock df\ndfx = pd.DataFrame({'a': [1,2,3,4,5,6,7,8,9,10], 'b': [1,2,3,4,5,6,7,8,9,10]})\n\n# Calling function\ntrain_val_test_... | [
[
"pandas.DataFrame"
]
] |
nateanl/recipes-1 | [
"3b46a7479508608f73b6f24deffdc8fcffd25ee5"
] | [
"torchrecipes/vision/data/modules/tests/test_mnist_data_module.py"
] | [
"# Copyright (c) Meta Platforms, Inc. and affiliates.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\n\n#!/usr/bin/env python3\n\nimport unittest\nfrom tempfile import TemporaryDirectory\n\nimport torch\nfrom hydra.core.config... | [
[
"torch.Size"
]
] |
Joreshic/python-for-android | [
"c60e02d2e32e31a3a754838c51e9242cbadcd9e8"
] | [
"testapps/testapp_keyboard/main.py"
] | [
"print('main.py was successfully called')\n\nimport os\nprint('imported os')\n\nfrom kivy import platform\n\nif platform == 'android':\n print('contents of ./lib/python2.7/site-packages/ etc.')\n print(os.listdir('./lib'))\n print(os.listdir('./lib/python2.7'))\n print(os.listdir('./lib/python2.7/site-p... | [
[
"numpy.random.random",
"numpy.arange",
"numpy.zeros"
]
] |
zzdang/cascade_rcnn_gluon | [
"b4018001719ec56a688be26c2aab18be664e4bdd"
] | [
"scripts/detection/faster_rcnn/demo_faster_rcnn.py"
] | [
"\"\"\"Faster RCNN Demo script.\"\"\"\nimport os\nimport argparse\nimport mxnet as mx\nimport gluoncv as gcv\nfrom gluoncv.data.transforms import presets\nfrom matplotlib import pyplot as plt\n\ndef parse_args():\n parser = argparse.ArgumentParser(description='Test with Faster RCNN networks.')\n parser.add_ar... | [
[
"matplotlib.pyplot.show"
]
] |
PitPietro/pascal-triangle | [
"eb81e9fc4728f4e09a631922c470201a9f897195"
] | [
"charts/lines_bars_markers/filling/fill_area_between_lines.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\n\"\"\"\nhttps://matplotlib.org/gallery/lines_bars_and_markers/fill_between_demo.html#sphx-glr-gallery-lines-bars-and-markers-fill-between-demo-py\n\"\"\"\n\n\ndef fill_area_1():\n x = np.arange(0.0, 2, 0.01)\n y1 = np.sin(2 * np.pi * x)\n y2 = 0.8 * n... | [
[
"numpy.sin",
"numpy.array",
"matplotlib.pyplot.subplots",
"numpy.arange",
"numpy.polyfit",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
niddal-imam/End-2-End-image-spam-detector-pixellink | [
"a546b6d55ae611806eef7182c4648be6cce73580"
] | [
"pixel_crnn/tool/create_dataset.py"
] | [
"import os\nimport lmdb\nimport cv2\nimport numpy as np\nimport argparse\nimport shutil\nimport sys\n\ndef checkImageIsValid(imageBin):\n if imageBin is None:\n return False\n \n try:\n imageBuf = np.fromstring(imageBin, dtype=np.uint8)\n img = cv2.imdecode(imageBuf, cv2.IMREAD_GRAYSCA... | [
[
"numpy.fromstring"
]
] |
PraveenAdepu/gcp | [
"de80ff86102cfa2d58dca951cd5fc372ec043462"
] | [
"vertex-trainer/trainer/task.py"
] | [
"# https://codelabs.developers.google.com/codelabs/vertex-ai-custom-code-training#3\n\nimport numpy as np\nimport pandas as pd\nimport io\n\npd.set_option(\"display.max_rows\", None)\npd.set_option(\"display.max_columns\", None)\n\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.ensemble import RandomF... | [
[
"sklearn.model_selection.train_test_split",
"pandas.to_numeric",
"pandas.set_option",
"sklearn.ensemble.RandomForestClassifier"
]
] |
ferdyandannes/Monocular-3D-Object-Detection | [
"85c424ce0ab386da9b30629819d63f7ec888c9c1"
] | [
"model/vgg16_1010.py"
] | [
"'''\nRefs:\n Very Deep Convolutional Networks for Large-Scale Image Recognition -- https://arxiv.org/abs/1409.1556\n'''\n\nimport tensorflow as tf\nlayers = tf.keras.layers\nreg = tf.keras.regularizers\n\nfrom config import config as cfg\n#from tensorflow.python.keras.layers import Lambda;\n#from tensorflow.pyt... | [
[
"tensorflow.nn.l2_normalize"
]
] |
zhangkuantian/Spark | [
"4f43421a5b33988a841c49d11d8b916e9d4414f4"
] | [
"python/pyspark/pandas/groupby.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"pandas.DataFrame",
"pandas.core.common._builtin_table.get",
"pandas.api.types.is_list_like",
"pandas.api.types.is_hashable"
]
] |
ManMohan291/PyProgram | [
"edcaa927bd70676bd14355acad7262ae2d32b8e5"
] | [
"01_SimpleLinearRegression/linearRegression.py"
] | [
"from os import system\nimport numpy as np\nimport scipy.optimize as op\nimport matplotlib.pyplot as plt\n\n####################################################################\ndef initTheta(size):\n return np.zeros((size, 1))\n\n####################################################################\ndef addBiasV... | [
[
"numpy.concatenate",
"numpy.matmul",
"numpy.zeros",
"numpy.sum",
"matplotlib.pyplot.plot",
"numpy.ones",
"numpy.multiply",
"numpy.loadtxt",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.subplot"
]
] |
imraviagrawal/sonnet | [
"3a305e16af9e274b89db2834e3b7cea9cea6806f"
] | [
"sonnet/python/modules/nets/alexnet_test.py"
] | [
"# Copyright 2017 The Sonnet 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 required ... | [
[
"tensorflow.zeros",
"tensorflow.constant_initializer",
"numpy.random.rand",
"tensorflow.fixed_size_partitioner",
"numpy.ones",
"tensorflow.global_variables",
"tensorflow.contrib.layers.l2_regularizer",
"tensorflow.placeholder",
"tensorflow.test.main",
"tensorflow.truncated_... |
LanceNorskog/keras-sift | [
"6942552684ec3f20f26c85627a32d4dd02e54b5f"
] | [
"keras_sift/keras_sift.py"
] | [
"import os\nimport sys\nimport time\nimport numpy as np\nimport tensorflow as tf\nimport math\nfrom random import getrandbits\n\nfrom keras import backend as K\nfrom keras.models import Model\nfrom keras.layers import Flatten, Activation, Input\nfrom keras.layers import Concatenate\nfrom keras.layers import Add, Mu... | [
[
"tensorflow.floor",
"numpy.array",
"tensorflow.concat",
"numpy.zeros",
"tensorflow.keras.layers.Input",
"numpy.reshape",
"tensorflow.equal",
"tensorflow.atan2",
"tensorflow.constant",
"numpy.arange",
"numpy.outer",
"numpy.hstack",
"tensorflow.math.mod",
"num... |
EnjoyLifeFund/Debian_py36_packages | [
"1985d4c73fabd5f08f54b922e73a9306e09c77a5"
] | [
"theano/tensor/opt.py"
] | [
"from __future__ import absolute_import, print_function, division\n\"\"\" Tensor optimizations addressing the ops in basic.py.\n\"\"\"\n# TODO: intelligent merge for mul/add\n# TODO: 0*x -> 0\n\nfrom collections import defaultdict\nimport logging\nimport itertools\nimport operator\nimport sys\nimport time\nimport t... | [
[
"numpy.int8",
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.sum",
"numpy.any",
"numpy.arange",
"numpy.all",
"numpy.log2",
"numpy.dtype"
]
] |
flymin/auto-attack | [
"4e8122dc436f06b067052bc836f77e2c8aeb45a9"
] | [
"autoattack/fab_base.py"
] | [
"# Copyright (c) 2019-present, Francesco Croce\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfr... | [
[
"torch.zeros",
"torch.rand",
"torch.cat",
"torch.arange",
"torch.cuda.random.manual_seed",
"torch.max",
"torch.no_grad",
"torch.ones",
"torch.random.manual_seed",
"torch.randn",
"torch.reshape"
]
] |
sudogauss/twasc | [
"527ddd8bb1fe76bb0aa8c0837cdff0acc1ddfc32"
] | [
"main.py"
] | [
"import sys\nimport getopt\nimport tensorflow as tf\nfrom model.model import Model\nfrom model.model_const import *\nimport numpy as np\n\nif __name__ == \"__main__\":\n\n arg_list = sys.argv[1:]\n\n short_opts = \"h\"\n long_opts = [\"help\", \"twitter_pattern=\", \"weights=\"]\n\n try:\n args, ... | [
[
"tensorflow.keras.utils.get_file"
]
] |
adelezaini/MachineLearning | [
"dc3f34f5d509bed6a993705373c46be4da3f97db"
] | [
"Projects/Project1/task45b.py"
] | [
"# The MIT License (MIT)\n#\n# Copyright © 2021 Fridtjof Gjengset, Adele Zaini, Gaute Holen\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the “Software”), to deal in the Software without restriction, including without limit... | [
[
"numpy.random.seed"
]
] |
lambdanauts/vilbert-multi-task | [
"12265c3fcd43b24c33544578ae1911fdc52305c8"
] | [
"vilbert/datasets/concept_cap_dataset.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport copy\nimport json\nimport logging\nimport math\nimport os\nimport random\n\nimport lmdb\nimport numpy as np\nimport tensorpack... | [
[
"numpy.concatenate",
"torch.distributed.is_available",
"torch.distributed.get_world_size",
"numpy.array",
"numpy.logical_or",
"numpy.zeros",
"numpy.minimum",
"numpy.sum",
"torch.tensor",
"torch.distributed.get_rank",
"numpy.expand_dims",
"numpy.maximum"
]
] |
mnmueller/auto_LiRPA | [
"7e1fbf12d857ef8d411d80eef1bd73d9ae4ba3be"
] | [
"examples/vision/models/densenet_no_bn.py"
] | [
"'''DenseNet in PyTorch.\nhttps://github.com/kuangliu/pytorch-cifar\n'''\n\n\nimport math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass Bottleneck(nn.Module):\n def __init__(self, in_planes, growth_rate):\n super(Bottleneck, self).__init__()\n # self.bn1 = nn.Batc... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.functional.avg_pool2d",
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.nn.functional.relu",
"torch.randn"
]
] |
leliel12/scikitcriteria | [
"f13a75b5a39cd2d3db30a37b69e61a2814a5cea4"
] | [
"skcriteria/preprocessing/scalers.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# License: BSD-3 (https://tldrlegal.com/license/bsd-3-clause-license-(revised))\n# Copyright (c) 2016-2021, Cabral, Juan; Luczywo, Nadia\n# Copyright (c) 2022, QuatroPe\n# All rights reserved.\n\n# =====================================================================... | [
[
"numpy.max",
"numpy.linalg.norm",
"numpy.asarray",
"numpy.sum",
"numpy.min",
"numpy.mean",
"numpy.std"
]
] |
sdss/apogee_drp | [
"20639052e56413a1afd862dfbf5d0262863fd98e"
] | [
"python/apogee_drp/utils/yanny.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n# -*- coding: utf-8 -*-\n\"\"\"Python library for reading & writing yanny files.\n\nyanny is an object-oriented interface to FTCL/yanny data files following\nthese specifications_.\n\nThe format of the returned object is similar to that returned by\n... | [
[
"numpy.dtype"
]
] |
ryanfox/NFLWin | [
"25967e7c11f7283289851912c5cc97a3a48394ab"
] | [
"nflwin/model.py"
] | [
"\"\"\"Tools for creating and running the model.\"\"\"\nfrom __future__ import print_function, division\n\nimport os\n\nimport numpy as np\nfrom scipy import integrate\nfrom scipy import stats\n\nimport joblib\n\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.linear_model import LogisticRegressio... | [
[
"numpy.max",
"scipy.integrate.simps",
"sklearn.calibration.CalibratedClassifierCV",
"numpy.round",
"numpy.sum",
"sklearn.metrics.brier_score_loss",
"sklearn.utils.validation.NotFittedError",
"matplotlib.pyplot.figure",
"sklearn.linear_model.LogisticRegression",
"scipy.stats... |
goncaloperes/pymc3 | [
"59ce9af97f0b840f992322f33ec8dee203d7d1c0"
] | [
"pymc3/distributions/bart.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.random.default_rng",
"numpy.zeros"
]
] |
ybhan/Machine-Learning-Projects | [
"80301a774247bb6ad11cccaeef54e9ec588a61b0"
] | [
"Identification-of-Paintings-and-Style-Transfer/Identification/svm.py"
] | [
"from feature import *\r\nimport util\r\nimport numpy as np\r\n\r\nX, y, X_test, Xname, Xname_test = util.load_image()\r\ny = np.array(y)\r\nTheta = [0, np.pi / 6, np.pi / 3, np.pi / 2, 2 * np.pi / 3, 5 * np.pi / 6]\r\nSigma = [2, 3, 4, 5]\r\n\r\nX = util.resize(X, 11)\r\nX_test = util.resize(X_test, 11)\r\n\r\nA, ... | [
[
"numpy.std",
"numpy.array",
"sklearn.model_selection.LeaveOneOut",
"sklearn.svm.SVC"
]
] |
jorgecarleitao/connector-x | [
"8c37965b50190fa1addd52e8bdb71669b83f920b"
] | [
"connectorx-python/connectorx/tests/test_redshift.py"
] | [
"import os\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom pandas.testing import assert_frame_equal\n\nfrom .. import read_sql\n\n\n@pytest.fixture(scope=\"module\") # type: ignore\ndef redshift_url() -> str:\n conn = os.environ[\"REDSHIFT_URL\"]\n return conn\n\n@pytest.mark.skipif(os.enviro... | [
[
"pandas.testing.assert_frame_equal",
"numpy.datetime64",
"pandas.Series"
]
] |
ettoremessina/differential-equations | [
"b0f74aa177e090ef654574e11af5e54e2c7b1472"
] | [
"ODEs/solver-demos/python/NeuroDiffEq/ode_2nd_ord_ivp_01.py"
] | [
"\"\"\"\nPlease see\nhttps://computationalmindset.com/en/neural-networks/ordinary-differential-equation-solvers.html#sys1\nfor details\n\"\"\"\n\n# x'' + x' + 2x = 0\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport torch\n\nfrom neurodiffeq import diff\nfrom neurodiffeq.ode import solve\nfrom neurodif... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"numpy.exp",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"numpy.sqrt",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
apahl/rdkit_ipynb_tools | [
"c259ac8ee75709becd2a5e67f9a913bd20e0ae38"
] | [
"rdkit_ipynb_tools/bokeh_tools.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n###########\nBokeh Tools\n###########\n\n*Created on 2015-12-12 by A. Pahl*\n\nBokeh plotting functionality for Mol_lists.\n\"\"\"\n\nimport colorsys\nimport math\n\nimport numpy as np\n\n# from bkcharts import Bar\nfrom bokeh.plotting import figure, ColumnD... | [
[
"numpy.histogram"
]
] |
danshirron/inference | [
"31ae9b30ca5b1081a2d35f73ffcde10ae1fdaf41"
] | [
"cloud/image_classification/python/main.py"
] | [
"\"\"\"\nmlperf inference benchmarking tool\n\"\"\"\n\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport argparse\nimport json\nimport logging\nimport os\nimport threading\nimport time\nfrom queue import Queue\n\nimport mlperf_loadgen as lg\nim... | [
[
"numpy.percentile",
"numpy.mean"
]
] |
xren1982/pytorch-image-models | [
"8c9814e3f500e8b37aae86dd4db10aba2c295bd2"
] | [
"timm/models/rexnet.py"
] | [
"\"\"\" ReXNet\n\nA PyTorch impl of `ReXNet: Diminishing Representational Bottleneck on Convolutional Neural Network` -\nhttps://arxiv.org/abs/2007.00992\n\nAdapted from original impl at https://github.com/clovaai/rexnet\nCopyright (c) 2020-present NAVER Corp. MIT license\n\nChanges for timm, feature extraction, an... | [
[
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU6",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d"
]
] |
acadien/lazyPlot | [
"bb36dc237bb11febfe6ea6e59c9c79167238beab"
] | [
"smoothing.py"
] | [
"#!/usr/bin/python\n\nfrom numpy import *\nfrom scipy import weave\nfrom scipy.weave import converters\n\n#uses a guassian smooth convoluted with finite differences to get an absurdly smooth line but with edge effects\nsuperSmoothCode=\"\"\"\ndouble pre=0.3989422804014327/sigma;\ndouble dx,xmus;\n\nfor(int a=0;a<N;... | [
[
"scipy.weave.inline"
]
] |
alexeyyakimovich/DeepPavlov | [
"f10b9485c118cdec69e73c89833a1a5a164404de"
] | [
"deeppavlov/models/classifiers/utils.py"
] | [
"# Copyright 2017 Neural Networks and Deep Learning lab, MIPT\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 requi... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.where",
"numpy.argmax"
]
] |
wavestoweather/enstools | [
"d0f612b0187b0ad54dfbbb78aa678564f46eaedf"
] | [
"tests/test_io_read_01.py"
] | [
"from numpy.testing import assert_equal\nimport xarray\nimport tempfile\nimport numpy\nimport os\nimport shutil\nimport enstools.io\nimport pytest\n\n\n@pytest.fixture\ndef test_dir():\n \"\"\"\n name of the test directoy\n \"\"\"\n test_dir = tempfile.mkdtemp()\n yield test_dir\n\n # cleanup\n ... | [
[
"numpy.linspace",
"numpy.testing.assert_raises",
"numpy.random.rand",
"numpy.testing.assert_equal"
]
] |
qe-team/marmot | [
"38e09ff1d0a3025a6b7edeaaf6086ed047ec45ff"
] | [
"marmot/evaluation/evaluation_utils.py"
] | [
"from __future__ import print_function, division\nfrom sklearn.metrics import f1_score\n\n\n\ndef write_res_to_file(test_file, test_predictions, output_file=''):\n if output_file == '':\n output_file = test_file+'.predictions'\n\n output = open(output_file, 'w')\n try:\n for idx, line in enum... | [
[
"sklearn.metrics.f1_score"
]
] |
mirzaim/cs231n | [
"d982c7f023a1cedd961b4104b3e652ce3c43e738"
] | [
"assignments/assignment3/cs231n/image_utils.py"
] | [
"\"\"\"Utility functions used for viewing and processing images.\"\"\"\n\nimport urllib.request, urllib.error, urllib.parse, os, tempfile\n\nimport numpy as np\nfrom imageio import imread\nfrom PIL import Image\n\n\n\ndef blur_image(X):\n \"\"\"\n A very gentle image blurring operation, to be used as a regula... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.argmin",
"numpy.clip"
]
] |
yyeboah/fairseq | [
"e69a1608851977daf9e2e8b51185f608d431b238"
] | [
"fairseq/modules/transformer_layer.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom typing import Dict, List, Optional\n\nimport torch\nimport torch.nn as nn\nfrom fairseq import utils\nfrom fairseq.modules impo... | [
[
"torch.nn.Linear",
"torch.cat"
]
] |
lhutton1/tvm | [
"d9ec031ec33e046044fd9521f02ed63213ad07b8"
] | [
"tests/python/relay/test_op_level3.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.array_equal",
"numpy.random.rand",
"numpy.copy",
"numpy.tile",
"numpy.where",
"numpy.sort",
"numpy.unique",
"numpy.random.random",
"numpy.full_like",
"numpy.full",
"numpy.ndindex",
"numpy.indices",
"numpy.random.normal",
"numpy.take",
"numpy.unrav... |
TristenHarr/api2db | [
"8c8b14280441f5153ff146c23359a0eb91022ddb"
] | [
"src/api2db/ingest/api_form.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nContains the ApiForm class\n==========================\n\"\"\"\nfrom .pre_process.pre import Pre\nfrom .data_feature.feature import Feature\nfrom .post_process.post import Post\nfrom typing import Optional, List, Any\nimport os\nimport pickle\nimport pandas as pd\nimport json\n\n\n... | [
[
"pandas.DataFrame"
]
] |
vivacebelles/QCEngine | [
"d9a033f66cbbd4476bd0848d08323988c2726531"
] | [
"qcengine/programs/qchem.py"
] | [
"\"\"\"\nCalls the Q-Chem executable.\n\"\"\"\n\nimport os\nimport tempfile\nfrom typing import Any, Dict, List, Optional, Tuple\n\nimport numpy as np\n\nfrom qcelemental.models import AtomicResult\nfrom qcelemental.util import parse_version, safe_version, which\n\nfrom ..exceptions import InputError, UnknownError\... | [
[
"numpy.frombuffer"
]
] |
yumere/document-qa-tmp | [
"7605b893a51209f39029769b9b10a58605ca3daf"
] | [
"docqa/data_processing/multi_paragraph_qa.py"
] | [
"from collections import Counter\nfrom typing import List, Union\n\nimport numpy as np\nfrom docqa.data_processing.qa_training_data import ParagraphAndQuestionSpec, WordCounts, ParagraphAndQuestion, \\\n ContextAndQuestion, ParagraphAndQuestionDataset\nfrom docqa.data_processing.span_data import TokenSpans\nfrom... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.random.choice",
"numpy.zeros",
"numpy.random.shuffle",
"numpy.insert"
]
] |
tangyeqiu/keras-yolo3-Cascade | [
"5427dfa2f88a0ab7cb77c657f580b8a15827cf13"
] | [
"yolo.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nClass definition of YOLO_v3 style detection model on image and video\r\n\"\"\"\r\n\r\nimport colorsys\r\n# import os\r\nfrom timeit import default_timer as timer\r\nimport datetime\r\n\r\nimport numpy as np\r\nfrom keras import backend as K\r\nfrom keras.models import load_mode... | [
[
"numpy.array",
"numpy.asarray",
"numpy.random.seed",
"numpy.sum",
"numpy.random.shuffle",
"numpy.expand_dims",
"numpy.floor"
]
] |
BrightXiaoHan/OpusFilter | [
"804c82a46837fc57ca69934314622043248f6042"
] | [
"opusfilter/classifier.py"
] | [
"\"\"\"Filter classifier\"\"\"\n\nimport json\nimport logging\nimport collections\nimport functools\nimport math\nimport scipy.optimize\n\nimport numpy as np\nimport pandas as pd\nfrom pandas import json_normalize\nimport sklearn.linear_model\nfrom sklearn.metrics import accuracy_score, confusion_matrix, roc_auc_sc... | [
[
"numpy.array",
"sklearn.metrics.confusion_matrix",
"pandas.json_normalize",
"pandas.DataFrame",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.log_loss",
"sklearn.metrics.roc_auc_score"
]
] |
int-brain-lab/iblscripts | [
"db65fb48e44a168d7ed5e08bc854a82e83a44cd0"
] | [
"deploy/videopc/video_lengths.py"
] | [
"#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n# @Author: Niccolò Bonacchi\n# @Date: Tuesday, January 12th 2021, 5:48:08 pm\n\"\"\"\nGiven a specific video session_path will count and printout the number of frames for the video\nthe GPIO pin states and the frame counter files\n\"\"\"\n\nimport sys\nfrom pathlib im... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"numpy.fromfile"
]
] |
MaxBromberg/networkx | [
"e4d1483f241e9a56fbda247592710b659d29bce5"
] | [
"networkx/algorithms/centrality/current_flow_betweenness.py"
] | [
"\"\"\"Current-flow betweenness centrality measures.\"\"\"\nimport networkx as nx\nfrom networkx.algorithms.centrality.flow_matrix import (\n CGInverseLaplacian,\n flow_matrix_row,\n FullInverseLaplacian,\n laplacian_sparse_matrix,\n SuperLUInverseLaplacian,\n)\nfrom networkx.utils import (\n not_... | [
[
"numpy.log",
"numpy.abs",
"numpy.zeros"
]
] |
mcbal/afem | [
"6101605bf427ccc655bd958d27407fcc133d47b4"
] | [
"tests/test_model_gradients.py"
] | [
"import itertools\nimport unittest\n\nimport numpy as np\nimport torch\nfrom torch.autograd import gradcheck\n\nfrom afem.models import VectorSpinModel\n\n\nclass TestAnalyticalGradients(unittest.TestCase):\n def test_phi_t(self):\n num_spins, dim = 7, 61\n\n for (t_vector, J_external, J_symmetric)... | [
[
"torch.allclose",
"torch.randn",
"numpy.sqrt",
"torch.ones"
]
] |
akan72/PiazzaTextualAnalysis | [
"2a1bbb1381ee4707992bacc5d752144a5950a009"
] | [
"piazzatextualanalysis/transform_posts.py"
] | [
"import os\nimport re\nimport glob\nimport pickle\nimport pandas as pd\n\nfrom utils.transform_utils import *\n\n# Get all posts within the data directory\nposts = glob.glob('data/posts/*.p')\n\n# Iterate over all posts within a class\nfor fp in posts:\n # Load each post into a DataFrame and store its networkid\... | [
[
"pandas.to_datetime"
]
] |
josecannete/transformers | [
"dfe012ad9d6b6f0c9d30bc508b9f1e4c42280c07"
] | [
"src/transformers/modeling_ctrl.py"
] | [
"# coding=utf-8\n# Copyright 2018 Salesforce and 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 obtain a copy of the License... | [
[
"torch.nn.Linear",
"torch.cos",
"torch.cat",
"torch.nn.LayerNorm",
"torch.stack",
"torch.nn.Dropout",
"torch.sin",
"torch.arange",
"torch.nn.CrossEntropyLoss",
"torch.softmax",
"torch.ones",
"torch.nn.ReLU",
"numpy.sqrt",
"torch.matmul",
"torch.nn.Embedd... |
jreganpb/face-alignment | [
"9391ae6f2b8e569c14e91553d7ecbb5e1fc1c72b"
] | [
"face_alignment/api.py"
] | [
"from __future__ import print_function\r\nimport os\r\nimport glob\r\nimport dlib\r\nimport torch\r\nimport torch.nn as nn\r\nfrom enum import Enum\r\nfrom skimage import io\r\nfrom skimage import color\r\nimport cv2\r\nimport uuid\r\nimport torchvision\r\nfrom torchvision import transforms\r\ntry:\r\n import ur... | [
[
"torch.cat",
"torch.autograd.Variable",
"torch.FloatTensor",
"torch.no_grad",
"torch.from_numpy",
"torch.load",
"torch.nn.functional.softmax",
"torch.sum"
]
] |
jc19chaoj/PaddleClas | [
"5d96bcfebeef4c3f146b0db6bb32fc6952d28cbc"
] | [
"ppcls/metric/metrics.py"
] | [
"# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.\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... | [
[
"sklearn.metrics.multilabel_confusion_matrix",
"sklearn.metrics.hamming_loss",
"sklearn.preprocessing.binarize",
"sklearn.metrics.accuracy_score"
]
] |
ann89/PHASE-SEPARATION | [
"b905a26577034ddd1e1b6aaa07fa1086956852b5"
] | [
"COM-recenter.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# =============================================================================\n# \"\"\"\n# @author: anna\n# Calculate the center of mass of the (\"phase separated\" aggregated )system using the method described in\n# L. Bai and D. Breen, J. Graphics, G... | [
[
"numpy.sin",
"numpy.arctan2",
"numpy.cos"
]
] |
JaiWillems/ATC-Controller | [
"35352cecdef552881259bf887950751b054c7c7c"
] | [
"atc_controller.py"
] | [
"import math\nimport numpy as np\nimport pandas as pd\nimport random\nfrom typing import Tuple\n\n\n# Airspace constants.\nCONTROL_ZONE_RADIUS = 10 # Km.\nHOLDING_PATTERN_RADIUS = 1 # Km.\n\n\n# Runway Specifications.\nNUMBER_OF_RUNWAYS = 2 # Int.\nRUNWAY_SEPARATION = 0.5 # Km.\nRUNWAY_LENGTH = 0.5 # Km.\nRUNW... | [
[
"numpy.array",
"numpy.arccos",
"numpy.linalg.norm",
"numpy.empty",
"numpy.zeros",
"numpy.sin",
"numpy.round",
"pandas.DataFrame",
"numpy.arange",
"numpy.cos",
"numpy.sqrt"
]
] |
MgeeeeK/splot | [
"746a7cf8dc80758c1e87c148a36362ed8f0cc85e"
] | [
"splot/_viz_esda_mpl.py"
] | [
"import matplotlib.pyplot as plt\nimport matplotlib as mpl\nimport geopandas as gpd\nimport numpy as np\nfrom libpysal.weights.contiguity import Queen\nfrom libpysal.weights.spatial_lag import lag_spatial\nimport seaborn as sbn\nfrom esda.moran import (Moran_Local, Moran_Local_BV,\n Moran, Mo... | [
[
"matplotlib.patches.Rectangle",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.polyfit",
"matplotlib.pyplot.tight_layout",
"matplotlib.colors.ListedColormap"
]
] |
Mario-Kart-Felix/adanet | [
"5e08fad3f501836bb3e2e22316704a10b5f4507f"
] | [
"research/improve_nas/trainer/optimizer.py"
] | [
"# Lint as: python3\n\"\"\"Definition of optimizers and learning rate schedules.\n\nCopyright 2019 The AdaNet Authors. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\... | [
[
"tensorflow.compat.v1.control_dependencies",
"tensorflow.compat.v1.assign_add",
"tensorflow.compat.v1.get_variable"
]
] |
jinjh0123/pytorch_geometric | [
"0a4aaa0fd02f0a7b39ac6aa88e3c392e9672a673"
] | [
"torch_geometric/nn/conv/signed_conv.py"
] | [
"from typing import Union\n\nimport torch\nfrom torch import Tensor\nfrom torch_sparse import SparseTensor, matmul\n\nfrom torch_geometric.nn.conv import MessagePassing\nfrom torch_geometric.nn.dense.linear import Linear\nfrom torch_geometric.typing import Adj, PairTensor\n\n\nclass SignedConv(MessagePassing):\n ... | [
[
"torch.cat"
]
] |
ds-chae/animeHAN | [
"dcf87b40fdaf54e1977ddd05c20697a2d3f38bd0"
] | [
"main.py"
] | [
"from __future__ import print_function\nimport os\nimport time\nimport random\nimport argparse\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport torch.utils.data\nimport torchvision.datasets as dset\nimport torchvision.transform... | [
[
"torch.nn.MSELoss",
"torch.autograd.Variable",
"torch.FloatTensor",
"torch.no_grad",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.bernoulli",
"torch.utils.data.DataLoader",
"torch.nn.BCELoss",
"torch.load"
]
] |
EnSlavingBlair/Coincidences | [
"bba3435d9f0530822ddd2ab48a6a0bb84aa95f15"
] | [
"venv/lib/python2.7/site-packages/astropy/modeling/tests/test_functional_models.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nfrom __future__ import (absolute_import, unicode_literals, division,\n print_function)\n\nimport pytest\nimport numpy as np\nfrom numpy.testing import assert_allclose, assert_array_equal, assert_array_less\n\nfrom .. import m... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.testing.assert_array_less",
"numpy.arange",
"numpy.all",
"numpy.linspace"
]
] |
jesusanaya-fb/duckdb | [
"85235f75c13bd91c8ac7fe915cde76c2ddd4f14b"
] | [
"tools/pythonpkg/setup.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport sys\nimport subprocess\nimport shutil\nimport platform\n\nfrom setuptools import setup, Extension\nfrom setuptools.command.sdist import sdist\nimport distutils.spawn\n\nextensions = ['parquet', 'icu', 'fts']\n\ndef open_utf8(fpath, flags):\n im... | [
[
"numpy.get_include"
]
] |
jordiriu/MP-DQN | [
"eec13eb9b4e2c0099649e0639f2a8b93d7d0d5be"
] | [
"agents/paddpg.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport numpy as np\nimport random\n\nfrom torch.autograd import Variable\n\nfrom agents.agent import Agent\nfrom agents.memory.memory import Memory, MemoryNStepReturns\nfrom agents.utils import soft_update_target_net... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.cuda.manual_seed",
"torch.nn.ModuleList",
"torch.nn.init.kaiming_normal_",
"torch.ones",
"torch.cuda.is_available",
"numpy.concatenate",
"torch.mul",
"torch.autograd.Variable",
"torch.manual_seed",
"torch.nn.init.normal_",
... |
intelligent-control-lab/BIS | [
"7df10426373696093271e9afcae0c7e8fa7be0f4"
] | [
"src/speed_profile.py"
] | [
"from agents import *\nfrom models import *\nimport numpy as np\nimport matplotlib\nmatplotlib.use('tkagg')\nimport matplotlib.pyplot as plt\nimport sys\nimport pickle\n# end class world\n\ndef speed_profile(file_names):\n \"\"\"\n This function is to plot speed profiles for several evaluation results.\n A... | [
[
"matplotlib.use",
"numpy.linalg.norm",
"numpy.shape",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.linspace",
"matplotlib.pyplot.subplot"
]
] |
laurenmarietta/nircam_simulator | [
"08a92050a89faf944221c3f3cb7f490f460abb74"
] | [
"mirage/yaml/generate_observationlist.py"
] | [
"\"\"\"Generate observation list files based on default values and APT output files.\n\nAuthors\n-------\n - Lauren Chambers\n - Johannes Sahlmann\n\nUse\n---\n ::\n from mirage.yaml import generate_observationlist\n generate_observationlist.get_observation_dict(xml_file, yaml_file, catalogs,... | [
[
"numpy.where",
"numpy.array",
"numpy.int",
"numpy.unique"
]
] |
Karma-design/PyFlickrMining | [
"54401ebb91fc81b7867e0f0b85dca32bbc015aca"
] | [
"main.py"
] | [
"# -*- coding: utf-8 -*-\nprint(__doc__)\n\n# Code source: Karim Alaoui\n# License: BSD 3 clause\n\n#HOW TO USE :\n# 1.Set the input and output filenames\ninput_filename = 'lyon_cleaned_url_100' ##possible values : 'lyon_cleaned','suburb_cleaned','all_cleaned'\noutput_filename = 'clustering_v2'\n#Set the pictures r... | [
[
"pandas.read_csv",
"sklearn.cluster.MeanShift",
"numpy.unique"
]
] |
mikadam/Maths-tools | [
"8c5dc44ec8c5212e98b44f5cf3f1e9762dbf9cf8"
] | [
"ODE_solver.py"
] | [
"'''\nFile name: ODE_Solvers.py\nAuthor: Michal Adamkiewicz\nDate: 2014\n\nContains UI for ODE solver\n'''\n\nimport math\n\n\nimport matplotlib\nimport tkinter as Tk\nimport tkinter.messagebox as messagebox\nimport tkinter.ttk as ttk\n\nfrom tkinter.filedialog import asksaveasfile\n\nfrom multiprocessing import Pr... | [
[
"matplotlib.use",
"numpy.array",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg",
"matplotlib.figure.Figure"
]
] |
bywang2018/security-dataset | [
"4f153944f4fd218f42f9803186a16832a328ed4d"
] | [
"mmdet/models/necks/pafpn.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import ConvModule\n\nfrom mmdet.core import auto_fp16\nfrom ..builder import NECKS\nfrom .fpn import FPN\n\n\n@NECKS.register_module()\nclass PAFPN(FPN):\n \"\"\"Path Aggregation Network for Instance Segmentation.\n This is an implementati... | [
[
"torch.nn.functional.relu",
"torch.nn.functional.interpolate",
"torch.nn.functional.max_pool2d",
"torch.nn.ModuleList"
]
] |
mats-granath/EWD-QEC | [
"6ce9ac0940c18e2a63ec244cdd7b80e40b0c7073"
] | [
"src/mcmc.py"
] | [
"import numpy as np\nimport random as rand\nimport copy\nimport pandas as pd\n\nfrom numba import njit\n\nfrom src.xzzx_model import xzzx_code, _apply_random_stabilizer as apply_stabilizer_fast_xzzx\nfrom src.rotated_surface_model import RotSurCode, _apply_random_stabilizer as apply_stabilizer_fast_rotated\nfrom sr... | [
[
"pandas.read_pickle",
"numpy.linspace"
]
] |
Finqen/SAT_Solving_Problem_3 | [
"20362a5fc807b6283d7f07f3e90d1eed1998090c"
] | [
"plot-times.py"
] | [
"import pandas as pd\r\nimport seaborn as sns\r\nfrom matplotlib import pyplot as plt\r\n\r\ndf_times = pd.read_csv('cmake-build-debug/times.csv', index_col=0)\r\n\r\na = df_times.to_numpy()\r\n\r\na.sort(axis=1)\r\n\r\nfor y in range(len(a)):\r\n for x in range(len(a[0])):\r\n if x > 0:\r\n a[... | [
[
"pandas.read_csv"
]
] |
fradetjulien/loan-handler | [
"18f6b0c784714d9fd568fa010a0452d5f15933ed"
] | [
"module/index.py"
] | [
"'''\nLoan Handler\n'''\nimport tkinter as tk\nimport tkinter.messagebox as message\nfrom tkinter import filedialog as fd\nimport pandas as pd\n\nFORM_FIELDS = ('First Name', 'Last Name', 'Social Security Number', 'Credit Score',\n 'Income', 'Requested Loan Amount', 'Home Value', 'Interest Rate')\n\nc... | [
[
"pandas.read_csv"
]
] |
mworion/MountWizzard4 | [
"4e06b29ec2ef70be40e114b911b7bdf2f858a4b1"
] | [
"tests/unit_tests/gui/utilities/test_toolsQtWidget.py"
] | [
"############################################################\n# -*- coding: utf-8 -*-\n#\n# # # # # # #\n# ## ## # ## # #\n# # # # # # # # # # #\n# # ## # ## ## ######\n# # # # # # #\n#\n# Python-based Tool for interaction with the 10micron mounts\n# GU... | [
[
"numpy.array"
]
] |
labscript-suite-temp-2/runmanager | [
"e5fc09947552a549ecb0d964d86c9b923687f3e9"
] | [
"__main__.py"
] | [
"#####################################################################\n# #\n# __main__.py #\n# #\n# Copyright 2013, Monash Univer... | [
[
"matplotlib.use"
]
] |
zzheng93/code_ms_ml_mam4 | [
"5ff8734142884f67c9e25f96892296454602928f"
] | [
"3_analysis/util.py"
] | [
"import xarray as xr\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport cartopy.crs as ccrs\nimport matplotlib.patches as mpatches\n\ndef open_nc(path,scale=1.0): \n ds=(xr.open_dataset(path)*scale)\n ds=ds.assign_coords(lon=(((ds.lon + 180) % 360) - 180))\n ds=ds.reindex(lon=sorted(ds.lon)) \... | [
[
"matplotlib.pyplot.colorbar",
"pandas.DataFrame",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.patches.Rectangle"
]
] |
Littlehong-1997/echo-1 | [
"d77887fc9a3122508c8eba487e6034494ccc0a83"
] | [
"train/method/model/load_data.py"
] | [
"import numpy as np\nfrom tensorflow.keras import preprocessing\nimport cv2\nimport pandas as pd\nfrom postprocessing import *\nimport os\nimport Augmentor\n\n\ndef load_datasets(filepath, sample_list, label_list, mark, a4c_or_a2c, m):\n \"\"\"\n we have illustrated the file structure of datasets and label in... | [
[
"numpy.array",
"tensorflow.keras.preprocessing.image.load_img",
"numpy.zeros",
"tensorflow.keras.preprocessing.image.img_to_array",
"pandas.read_csv"
]
] |
ejmejm/GoHeuristics | [
"9336d661abd48aa31ff5c9ed50cc2fbbd4472ebe"
] | [
"board.py"
] | [
"import numpy as np\nimport queue\n\nboard_size = 19\n\ndef make_move(board, move, player, enemy, debug=False):\n board = board.reshape(board_size, board_size)\n board[move[0]][move[1]] = player\n empty = 0\n\n group_captures = 0\n if move[0] + 1 <= 18 and board[move[0]+1][move[1]] == enemy and check... | [
[
"numpy.array",
"numpy.empty_like"
]
] |
jgruber99/Sampford_Sampling | [
"413c207957e57ac4f44086c9a0c25bef9f60a936"
] | [
"fairseq/modules/transformer_sentence_encoder_layer.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nimport math\n\nimport ... | [
[
"torch.nn.Linear",
"torch.nn.functional.dropout",
"torch.nn.LayerNorm"
]
] |
AkashBhave/neureign | [
"1297ab261906c2a166b258a29bcd5dd556cefd65"
] | [
"neureign/models.py"
] | [
"import numpy as np\n\nfrom neureign import activations\n\n\nclass ANN:\n def __init__(self):\n self.input_size = 2\n self.output_size = 1\n self.hidden_size = 3\n\n self.w1 = np.random.randn(self.input_size, self.hidden_size)\n self.w2 = np.random.randn(self.hidden_size, self.... | [
[
"numpy.dot",
"numpy.random.randn"
]
] |
uci-cbcl/scFAN | [
"b1955c88c6ec97c447c254dc0ebdd33778e09099"
] | [
"data_iter.py"
] | [
"import numpy as np\nimport pdb\ntry:\n import pyBigWig\nexcept:\n pdb.set_trace()\n import pyBigWig\nfrom keras.preprocessing.image import Iterator\n\n\n# Modified from keras\nclass DataIterator(Iterator):\n def __init__(self, data_list, genome, batch_size, seqlen, bigwig_rc_order=None, shuffle=False, ... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.isnan",
"numpy.zeros",
"numpy.random.randint",
"numpy.arange"
]
] |
noajshu/learning_irreps | [
"c2ed8dffdb5bf93ca5952fe8d093ea3e8c5e7237"
] | [
"tools/tensor.py"
] | [
"import torch\nimport itertools\nimport numpy as np\nimport scipy.linalg\n\nimport os\nif os.environ.get('DEVICE'):\n device = torch.device(os.environ.get('DEVICE'))\nelse:\n device = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n\ndtype = torch.float32\n\ndef cplx_contractor(n):\n c ... | [
[
"torch.zeros",
"numpy.random.normal",
"numpy.array",
"numpy.eye",
"torch.cuda.is_available",
"torch.tensor",
"torch.randn"
]
] |
kkiesling/openmc | [
"7e1f486be333c6ee4ebbe4025f0a8b4dcbdae7c3"
] | [
"tests/unit_tests/test_deplete_resultslist.py"
] | [
"\"\"\"Tests the ResultsList class\"\"\"\n\nfrom pathlib import Path\nfrom math import inf\n\nimport numpy as np\nimport pytest\nimport openmc.deplete\n\n\n@pytest.fixture\ndef res():\n \"\"\"Load the reference results\"\"\"\n filename = (Path(__file__).parents[1] / 'regression_tests' / 'deplete'\n ... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.linspace"
]
] |
Waller-Lab/SpectralDiffuserCam | [
"1a9ea9c82f10998cae13f7a222d0a9e854fa9192"
] | [
"Python/fista_spectral_cupy.py"
] | [
"import sys\nglobal device\ndevice= sys.argv[1]\nsys.path.append('helper_functions/')\n\nif device == 'GPU':\n import cupy as np\n import tv_approx_haar_cp as tv\n \n print('device = ', device, ', using GPU and cupy')\nelse:\n import numpy as np\n import tv_approx_haar_np as tv\n print('device ... | [
[
"numpy.fft.ifft2",
"numpy.fft.fft2",
"numpy.sign",
"numpy.max",
"numpy.zeros_like",
"numpy.linalg.norm",
"numpy.conj",
"numpy.sqrt",
"numpy.expand_dims",
"matplotlib.pyplot.subplot",
"numpy.pad",
"numpy.zeros",
"matplotlib.pyplot.title",
"numpy.random.randn"... |
smdp2000/BETYdb-YABA | [
"64b540ef21838d5b47469896b95672bb4ac00f48"
] | [
"app/Meta.py"
] | [
"\"\"\"\nThis is the Meta module and supports all the REST actions for the yaba.yaml\n\"\"\"\n# Importing modules\nimport os\nimport geopandas as gpd\nimport traceback\nimport logging\nimport pandas as pd\n\nfrom flask import make_response,Response,jsonify\nfrom flask import json\nfrom db import *\nfrom werkzeug im... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
liujiajun/examples | [
"f5816f1720208c205411265357220afe03a5d16f"
] | [
"player_rulebased-A_py/player_rulebased-A.py"
] | [
"#!/usr/bin/python3\n\nfrom __future__ import print_function\n\nfrom twisted.internet import reactor\nfrom twisted.internet.defer import inlineCallbacks\n\nfrom autobahn.wamp.serializer import MsgPackSerializer\nfrom autobahn.wamp.types import ComponentConfig\nfrom autobahn.twisted.wamp import ApplicationSession, A... | [
[
"numpy.fromstring",
"numpy.argsort",
"numpy.zeros"
]
] |
fluiddyn/fluiddyn | [
"04d125cb4590da7d5db80dac1d20577ce012a005"
] | [
"fluiddyn/calcul/test/test_signal.py"
] | [
"import unittest\n\nimport numpy as np\n\nfrom ..signal import FunctionLinInterp, decimate, deriv, smooth\n\n\nclass TestFFTW1DReal2Complex(unittest.TestCase):\n def test_signal(self):\n x = np.linspace(0, 2 * np.pi, 100)\n f = np.sin(x) + 0.02 * (np.random.rand(100) - 0.5)\n smooth(f, windo... | [
[
"numpy.linspace",
"numpy.sin",
"numpy.random.rand",
"numpy.zeros"
]
] |
cogitate3/stock | [
"bba986cbbb17de9f424c3b5417a17d1bb1204403"
] | [
"datahub/zdt.py"
] | [
"# -*- coding=utf-8 -*-\n__author__ = 'Rocky'\n'''\nhttp://30daydo.com\nContact: weigesysu@qq.com\n'''\n# 每天的涨跌停\nimport sys\nsys.path.append('..')\nimport re\nimport time\nimport os\nfrom configure.util import notify\nfrom configure.settings import config_dict\nimport pandas as pd\nfrom configure.settings import D... | [
[
"pandas.DataFrame"
]
] |
liorgolgher/python-pysight | [
"029634d328c18fde4fc4ed666980b2e537e18814"
] | [
"src/pysight/nd_hist_generator/volume_gen.py"
] | [
"import attr\nfrom attr.validators import instance_of\nimport pandas as pd\nimport numpy as np\nimport itertools\nfrom typing import Generator\nimport psutil\n\n\n@attr.s(slots=True)\nclass VolumeGenerator:\n \"\"\"\n Generate the list of volume chunks to be processed.\n Main method is \"create_frame_slice... | [
[
"numpy.uint64",
"numpy.prod",
"numpy.isnan"
]
] |
fixstars/clpy | [
"693485f85397cc110fa45803c36c30c24c297df0"
] | [
"tests/clpy_tests/binary_tests/test_packing.py"
] | [
"import numpy\nimport unittest\n\nfrom clpy import testing\n\n\n@testing.gpu\nclass TestPacking(unittest.TestCase):\n\n _multiprocess_can_split_ = True\n\n @testing.with_requires('numpy>=1.10')\n @testing.for_int_dtypes()\n @testing.numpy_clpy_array_equal()\n def check_packbits(self, data, xp, dtype)... | [
[
"numpy.arange"
]
] |
leonardoSaaads/CartaSmith | [
"b7fde20666746b6fe9b08261b55b0bfea9c3a128"
] | [
"CartaSmith.py"
] | [
"# Feito por Leonardo Saads Pinto\n# Setembro - 2021\n\n# Importando as bibliotecas padrões.\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nclass CartaSmith:\n \"\"\"\n BIBLIOTECA PARA FUNCIONALIDADES DA CARTA DE SMITH\n\n FUNÇÕES:\n - AJUSTAR\n - SUMARIO\n - PLOT_SMITH\n - PLOT COEF... | [
[
"numpy.array",
"numpy.sin",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"numpy.mean",
"numpy.cos",
"matplotlib.pyplot.show",
"numpy.linspace",
"matplotlib.pyplot.axis"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.