repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
mas192/cudf
[ "0e015a64af383c1a51687f48f1af4056d3ae986f" ]
[ "python/cudf/tests/test_libgdf_groupby.py" ]
[ "# Copyright (c) 2018, NVIDIA CORPORATION.\n\nimport pytest\n\nimport numpy as np\nimport pandas as pd\n\nfrom cudf.dataframe import DataFrame\nfrom cudf.tests.utils import assert_eq\n\n\ndef make_frame(dataframe_class, nelem, seed=0, extra_levels=(), extra_vals=()):\n np.random.seed(seed)\n\n df = dataframe_...
[ [ "numpy.random.seed", "numpy.random.random", "numpy.random.randint" ] ]
CarlosPena00/pytorchvision
[ "824b3a5a8940f3ee6b4da5de7a391a88e5aa36a2" ]
[ "pytvision/transforms/aumentation.py" ]
[ "\nimport torch\nimport numpy as np\nimport cv2\n\nfrom .grid.grid_sample import grid_sample\nfrom .grid.tps_grid_gen import TPSGridGen\n\nfrom . import functional as F\n\n\ninterpolate_image_mode = cv2.INTER_LINEAR\ninterpolate_mask_mode = cv2.INTER_NEAREST\ninterpolate_weight_mode = cv2.INTER_LINEAR\ninterp...
[ [ "numpy.max", "numpy.array", "torch.stack", "numpy.sum", "numpy.copy", "torch.unsqueeze", "torch.from_numpy", "numpy.any", "numpy.stack", "numpy.arange", "numpy.clip" ] ]
Dadle/Saltie
[ "a78dbc95e63153b47731252e3c825cb3afa34a1f" ]
[ "examples/legacy/legacy_game_input_formatter.py" ]
[ "import numpy as np\r\nfrom rlbot.utils.structures import game_data_struct\r\nfrom rlbot.utils.structures.game_data_struct import GameTickPacket\r\n\r\nfrom examples.current.raw_input_formatter import RawInputFormatter\r\n\r\n\r\ndef get_state_dim():\r\n return 219\r\n\r\n\r\nclass LegacyGameInputFormatter(RawIn...
[ [ "numpy.isnan", "numpy.asarray" ] ]
atagulmert/CS131_release
[ "e830eb12970e41d4350be526d631e1fdd51f5274" ]
[ "fall_2020/hw6_release/visualization.py" ]
[ "\"\"\"plot and visualization functions for cs131 hw7\"\"\"\nimport matplotlib.patches as patches\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom skimage.transform import downscale_local_mean, rescale, resize\n\n\ndef plot_part1(avg_face, face_hog):\n \"\"\"plot average face and hog representatitons o...
[ [ "matplotlib.pyplot.subplot", "numpy.zeros", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.patches.Rectangle", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
zihangJiang/CIPS-3D
[ "9244193048c73f55270d2df28fb160f42d5953ad", "9244193048c73f55270d2df28fb160f42d5953ad" ]
[ "exp/comm/models/film_layer.py", "exp/dev/nerf_inr/models/generator_nerf_inr_v8.py" ]
[ "from einops import rearrange\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom tl2.proj.pytorch import init_func\n\n\ndef frequency_init(freq):\n def init(m):\n with torch.no_grad():\n if isinstance(m, nn.Linear):\n num_input = m.weight.size(-1)\n ...
[ [ "torch.no_grad", "numpy.sqrt", "torch.sin" ], [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.gather", "torch.nn.Tanh", "torch.no_grad", "torch.randperm", "torch.sort" ] ]
Pawel762/class5-homework
[ "8e48dcda1ed91b7a5e28bea6db13b2a82182e074" ]
[ "dataset-processor1.py" ]
[ "\n\nimport pandas as pd\n\nwine_df = pd.read_csv(filepath_or_buffer='~/class5-homework/wine.data',\n sep=',',\n header=None)\nwine_df.columns = ['Class','Alcohol','Malic_Acid','Ash','Alcalinity_of_Ash','Magnesium',\n 'Total_Phenols','Flavanoids','Nonflavanoid_Phenols','...
[ [ "pandas.read_csv", "pandas.set_option" ] ]
dharchibald/asteroid-classifier
[ "dd9d3b6d12d7ecc0b773204b73c6d0cf12e0e15b" ]
[ "amb_sdk/sdk.py" ]
[ "import requests\nimport urllib\nimport time\nimport os.path\nimport tempfile\nimport validators\nimport json\nimport zipfile\nimport io\nimport pandas as pd\nfrom requests_toolbelt.multipart import encoder\nfrom amb_sdk.config import Config as cfg\n\n\nclass DarwinSdk:\n\n auth_string = ''\n api_key = ''\n ...
[ [ "pandas.DataFrame", "pandas.to_numeric", "pandas.Series" ] ]
brando90/anatome
[ "1fe0d8337be2265c4d1bd6ef03780e9f85868b4f" ]
[ "tests/test_distance.py" ]
[ "import pytest\nimport torch\nfrom torch import nn\n\nfrom anatome import distance\n\n\n@pytest.fixture\ndef matrices():\n return torch.randn(10, 5), torch.randn(10, 8), torch.randn(10, 20), torch.randn(8, 5)\n\n\ndef test_cca_shape(matrices):\n i1, i2, i3, i4 = matrices\n distance.cca(i1, i1, 'svd')\n ...
[ [ "torch.nn.Linear", "torch.nn.Conv2d", "torch.randn", "torch.no_grad" ] ]
elsanns/transformers
[ "d9149f00d1a4650bafa7e1cd73e10398193c852c" ]
[ "src/transformers/modeling_t5.py" ]
[ "# coding=utf-8\n# Copyright 2018 Mesh TensorFlow authors, T5 Authors and HuggingFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/lice...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.ModuleList", "torch.ones", "torch.nn.CrossEntropyLoss", "torch.where", "torch.sqrt", "tensorflow.train.list_variables", "torch.abs", "torch.tensor", "numpy.transpose", "torch.zeros_like", "torch.nn.functional.relu", ...
simberaj/mobilib
[ "ae350d095a34f53704bd4aaaf7f45e573bda779a" ]
[ "neighbour_table.py" ]
[ "\"\"\"Generate table listing pairs of identifiers of neighbouring polygons.\"\"\"\n\nimport pandas as pd\n\nimport mobilib.core\nimport mobilib.argparser\nimport mobilib.neigh\n\n\nparser = mobilib.argparser.default(__doc__)\nparser.add_argument('infile', help='input polygon table/GDAL-compatible file')\nparser.ad...
[ [ "pandas.DataFrame.from_records" ] ]
RyanWangZf/Face_Recognition
[ "8dd9fe6fb43704c5c1da0a6156821e5d0064f135" ]
[ "facenet_detector.py" ]
[ "# -*- coding: utf-8 -*-\n# Written by Zifeng\n# wangzf18@mails.tsinghua.edu.cn\n\n\"face embeddings extraction for verification.\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport pdb\nimport time\n\nimport tensorflow as tf \nimpor...
[ [ "numpy.array", "tensorflow.get_default_graph", "tensorflow.train.import_meta_graph", "tensorflow.Graph", "tensorflow.Session", "numpy.argmax", "sklearn.metrics.pairwise.cosine_similarity" ] ]
cxy1997/RAFT
[ "3fac6470f487c85bcc03ef102f86e1542262108e" ]
[ "demo.py" ]
[ "import sys\nsys.path.append('core')\n\nimport argparse\nimport os\nimport cv2\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom PIL import Image\n\nimport datasets\nfrom utils import flow_viz\nfrom raft import RAFT\n\n\nDEVICE = 'cuda'\n\ndef pad8(img):\n \"\"\"pad image such that dimensi...
[ [ "torch.no_grad", "torch.from_numpy", "torch.load", "torch.nn.functional.pad", "torch.nn.DataParallel" ] ]
richardpaulhudson/thinc
[ "a9b047121e1ddca30fd9fc6c78cb853084ea6e78" ]
[ "thinc/shims/pytorch.py" ]
[ "from typing import Any, Optional, cast\nimport contextlib\nfrom io import BytesIO\nimport itertools\nimport srsly\n\ntry:\n import torch.autograd\n from torch.cuda import amp\n import torch.optim\n import torch\nexcept ImportError: # pragma: no cover\n pass\n\nfrom ..util import torch2xp, xp2torch,...
[ [ "torch.autograd.backward", "torch.cuda.amp.autocast", "torch.no_grad", "torch.cuda.current_device", "torch.load" ] ]
mjasher/scikit-protopy
[ "f4deddc42c5883b527d7bb1bfc6d0ece7d01979d" ]
[ "protopy/selection/tomek_links.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nTomek Links\n\"\"\"\n\n# Author: Dayvid Victor <victor.dvro@gmail.com>\n#\n# License: BSD 3 clause\n\nimport numpy as np\n\nfrom sklearn.externals.six.moves import xrange\nfrom sklearn.utils.validation import check_X_y\nfrom sklearn.neighbors.classification import KNeighborsClassif...
[ [ "numpy.asarray", "sklearn.utils.validation.check_X_y", "sklearn.externals.six.moves.xrange", "numpy.unique", "sklearn.neighbors.classification.KNeighborsClassifier" ] ]
AnaLindaPenny/web-scraping-challenge
[ "06853fc98892b9674f51a5908f6b8f1134d43b76" ]
[ "Missions_to_Mars/scrape_mars.py" ]
[ "import os\nimport pandas as pd\nimport requests\nimport pymongo\nfrom bs4 import BeautifulSoup\nfrom splinter import Browser\nfrom webdriver_manager.chrome import ChromeDriverManager\n\ndef scrape():\n executable_path = ChromeDriverManager().install()\n browser = Browser('chrome', executable_path=executable_...
[ [ "pandas.read_html" ] ]
AlexElykov/straxen
[ "152b1cb23037a85e015dcba88ea8cb8659a4550f" ]
[ "straxen/url_config.py" ]
[ "import json\nfrom typing import Container\nimport strax\nimport fsspec\nimport pandas as pd\nimport straxen\nimport inspect\nfrom urllib.parse import urlparse, parse_qs\nfrom ast import literal_eval\nfrom strax.config import OMITTED\nimport os\nimport tempfile\nimport tarfile\n\nexport, __all__ = strax.exporter()\...
[ [ "pandas.DataFrame", "tensorflow.keras.models.load_model" ] ]
EtoDemerzel0427/Quarto
[ "5c65670a16d88106fad56591b4f7c6711e4bebf3" ]
[ "warm-up/Loss.py" ]
[ "\"\"\"\r\nIn this simple version, I assume loss to be the same as an activation function,\r\nfrom which we only need their values and grads.\r\n\"\"\"\r\n\r\nimport numpy as np\r\nfrom typing import Tuple\r\n\r\n\r\nclass Loss:\r\n def __init__(self):\r\n self.cache = None\r\n\r\n def forward(self, in...
[ [ "numpy.max", "numpy.array", "numpy.sum", "numpy.exp", "numpy.mean" ] ]
jtrfid/tkzgeom
[ "b3b1baf33b89e7b670bc736d28818456ac4547ad" ]
[ "src/EuclMath.py" ]
[ "\"\"\"\nThis script contains routines for computation in Eulidean geometry.\n\"\"\"\n\nimport numpy as np\n\ndef circle_approx_pts(centre, radius, num, from_to=[0,360]):\n \"\"\"\n SUMMARY\n estimates a circle with evenly spaced points sampled on it\n sets current mode\n\n PARAMETERS\n ...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.radians", "numpy.sqrt", "numpy.abs", "numpy.cross" ] ]
idhamari/CapsPix2Pix
[ "985341666a13e76e47723217df9fcde593bd028a" ]
[ "Capsules.py" ]
[ "\nfrom __future__ import print_function\nimport torch.nn.parallel\nimport torch.utils.data\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport cv2\n\nUSE_CUDA = torch.cuda.is_available()\n\nclass PrimaryCaps(nn.Module):\n def __init__(self, num_caps...
[ [ "torch.nn.Linear", "torch.sigmoid", "torch.cat", "torch.zeros", "torch.stack", "torch.sqrt", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.Conv2d", "torch.cuda.is_available", "torch.nn.functional.softmax", "torch.nn.functional.relu", "torch.matmu...
Charmve/TimeWarp
[ "65581c585c8dda2056b2d998320289f163bb7722" ]
[ "test_.py" ]
[ "import torch\nfrom model import MattingRefine\n\ndevice = torch.device('cpu')\nprecision = torch.float32\n\nmodel = MattingRefine(backbone='torchscript_resnet50_fp32',\n backbone_scale=0.25,\n refine_mode='sampling',\n refine_sample_pixels=80_000)\n\nm...
[ [ "torch.device", "torch.no_grad", "torch.rand", "torch.jit.load" ] ]
nict-wisdom/bertac
[ "d90cd95fa8aa339f03a027d9d055e916b83bf6ab" ]
[ "src/transformers/data/processors/glue.py" ]
[ "# coding=utf-8\n# Copyright (c) 2021-present, Data-driven Intelligent System Research Center (DIRECT), National Institute of Information and Communications Technology (NICT). (Modifications for BERTAC)\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDI...
[ [ "tensorflow.data.experimental.cardinality", "tensorflow.TensorShape" ] ]
fau-masters-collected-works-cgarbin/chexpert_explorer
[ "bb24eaf118dd1138a6f1eb4b90a300fff16ef532" ]
[ "chexpert_latex_export.py" ]
[ "\"\"\"CheXpert LaTex exporter.\n\nExport CheXpert statistics and graphs to be imported in LaTex documents.\n\nThe goal is to automate the generation of all tables stastical tables used in papers, so that they\nare accurate and can be regenerated quickly if the dataset is upgraded.\n\"\"\"\n\nimport os\nimport re\n...
[ [ "numpy.triu_indices_from" ] ]
rycmak/advent-of-code
[ "2a3289516f4c1d0bc1d24a38d495a93edcb19e29" ]
[ "2021/day04/bingo.py" ]
[ "import numpy as np\n\nfile = open(\"input.txt\", 'r')\n\nrandom_numbers = []\nboards = []\nboards_marked = []\nboard_num = -1 # index to keep track of which board in boards; no board at beginning\n\nfor i, line in enumerate(file):\n if i == 0:\n random_numbers = [int(x) for x in line.replace('\\n', '').split(...
[ [ "numpy.where", "numpy.full", "numpy.zeros" ] ]
sunblaze-ucb/rl-attack-vf
[ "48d59d5d022599560f0fabfdd5dbf99984457cec" ]
[ "a3c.py" ]
[ "from __future__ import print_function\n\nfrom collections import namedtuple\nimport six.moves.queue as queue\nimport threading\n\nimport numpy as np\nimport tensorflow as tf\nfrom model import LSTMPolicy\nimport scipy.signal\n\n\ndef discount(x, gamma):\n return scipy.signal.lfilter([1], [1, -gamma], x[::-1], a...
[ [ "tensorflow.constant_initializer", "tensorflow.gradients", "tensorflow.nn.softmax", "tensorflow.Summary", "tensorflow.shape", "tensorflow.variable_scope", "tensorflow.Summary.FromString", "tensorflow.nn.log_softmax", "tensorflow.train.AdamOptimizer", "tensorflow.summary.sca...
sgalella/NeuralModels
[ "3c8bf04f799de3fe493440970d9ce3ff35870beb" ]
[ "neural_models/leaky_integrate_and_fire.py" ]
[ "import numpy as np\n\n\nclass LeakyIntegrateAndFire:\n \"\"\"\n Creates an integrate-and-fire model.\n \"\"\"\n def __init__(self, VR=-70, R=100, C=0.3, theta=-55):\n \"\"\"\n Initializes the model.\n Args:\n VR (int, float): Resting state potential.\n R (int,...
[ [ "numpy.arange", "numpy.exp", "numpy.zeros" ] ]
STHSF/panther
[ "8122f299c5225f683c24070a1048e7bfbbe831fd" ]
[ "financial/calc_engines/factor_solvency_cal.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport pdb, importlib, inspect, time, datetime, json\n# from PyFin.api import advanceDateByCalendar\n# from data.polymerize import DBPolymerize\nfrom data.storage_engine import StorageEngine\nimport time\nimport pandas as pd\nimport numpy as np\nfrom datetime import timedelta, datetime\n...
[ [ "pandas.DataFrame", "pandas.merge" ] ]
linkinghack/ML-DLNotes
[ "c022e4fed4441b05c420dffe30da3dd2f74bc289" ]
[ "NeuralNetwork/SimplestFCNet.py" ]
[ "# 两层全链接网络\n# pytorch 官方示例\nimport numpy as np\n\n# N为样本大小; D_in为样本维度\n# H为隐藏层维度; D_out 为输出维度(分类数)\nN,D_in, H, D_out = 64,1000,100,10\n\n#生成随机样本\nx = np.random.randn(N,D_in)\ny = np.random.randn(N,D_out)\n\n#生成随机权重\nw1 = np.random.randn(D_in, H)\nw2 = np.random.randn(H, D_out)\n\nlearning_rate = 1e-6\nfor t in rang...
[ [ "numpy.square", "numpy.random.randn", "numpy.maximum" ] ]
ed-lau/jcast
[ "55ad910c13e8c611cbdf3124914539a42ab69af6" ]
[ "jcast/junctions.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\" Methods that concern splice junctions - getting their coordinates, transcription starts/ends, phases. \"\"\"\n\nimport logging\nimport os.path\nimport pandas as pd\nimport numpy as np\n\nfrom jcast import params\n\n\nclass RmatsResults(object):\n \"\"\"\n Container to hold t...
[ [ "numpy.array" ] ]
BPCZ/aitextgen
[ "bb536abbcbd40d04722db1f9a0e44cebb9a1d63c" ]
[ "aitextgen/TokenDataset.py" ]
[ "import torch\nimport logging\nimport csv\nimport os\nimport gzip\nfrom torch.utils.data import Dataset\nfrom typing import List\nfrom transformers import GPT2TokenizerFast, PreTrainedTokenizerFast\nfrom pkg_resources import resource_filename\nimport itertools\nfrom tqdm.auto import tqdm\nimport numpy as np\nimport...
[ [ "numpy.full", "numpy.array", "numpy.load", "numpy.save" ] ]
MCG-NJU/BCN
[ "e5c494d8ca396d5a535309575a7a652db54f14b7" ]
[ "batch_gen.py" ]
[ "# Only used in MS-TCN model\nimport torch\nimport numpy as np\nimport random\n\nclass BatchGenerator(object):\n def __init__(self, num_classes, actions_dict, gt_path, features_path, sample_rate):\n self.list_of_examples = list()\n self.index = 0\n self.num_classes = num_classes\n sel...
[ [ "numpy.shape", "torch.from_numpy" ] ]
UjjwalAyyangar/PettingZoo
[ "34c4d38e8fbc1cd6ecbebe58176e6d39ba1645de" ]
[ "pettingzoo/sisl/pursuit/pursuit_base.py" ]
[ "import glob\nimport os\nfrom os.path import join\nfrom subprocess import call\n\nimport numpy as np\nfrom gym import spaces\nfrom gym.utils import seeding\n\n\nimport pygame\n\nfrom .utils import agent_utils\nfrom .utils.agent_layer import AgentLayer\nfrom .utils.controllers import RandomPolicy, SingleActionPolicy...
[ [ "numpy.concatenate", "numpy.equal", "numpy.array", "numpy.zeros", "numpy.nonzero", "numpy.abs", "numpy.clip", "numpy.all" ] ]
shixing/OpenNMT-tf
[ "d425daa1eed355336fba3cbef56542e1fd78ae52" ]
[ "opennmt/tests/runner_test.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport copy\nimport os\nimport unittest\nimport shutil\n\nfrom parameterized import parameterized\n\nimport tensorflow as tf\n\nfrom opennmt import decoders\nfrom opennmt import models\nfrom opennmt import Runner\nfrom opennmt.config import load_model\nfrom opennmt.utils import exporters...
[ [ "tensorflow.saved_model.contains_saved_model", "tensorflow.train.latest_checkpoint", "tensorflow.train.get_checkpoint_state", "tensorflow.nest.map_structure", "tensorflow.constant", "tensorflow.test.main", "tensorflow.saved_model.load" ] ]
sboshin/tensorflow
[ "77689016fb4c1373abeca36360f7b2dd9434c547" ]
[ "tensorflow/python/saved_model/load.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.python.ops.variables.Variable", "tensorflow.python.training.tracking.tracking.CapturableResourceDeleter", "tensorflow.python.saved_model.revived_types.deserialize", "tensorflow.python.framework.tensor_util.MakeNdarray", "tensorflow.python.framework.ops.init_scope", "tensorflow....
rafaelsntn/keywords-common-crawl-spark
[ "61536ac8381b1f12c8fbc26f48ce1d3c86ae11c3" ]
[ "keywords_cc.py" ]
[ "import argparse\nfrom keybert import KeyBERT\nfrom sentence_transformers import SentenceTransformer\nfrom pyspark.sql import SparkSession\nfrom pyspark.sql.types import ArrayType, StructField, StructType, StringType, IntegerType\nfrom warcio.archiveiterator import ArchiveIterator\nimport numpy as np\nimport boto3\...
[ [ "numpy.where", "numpy.array", "numpy.loadtxt" ] ]
Herly-tech/HerlyTech
[ "1c16490aef0794dbd32368411c1db744d8e04a3c" ]
[ "Herly/iris_data.py" ]
[ "import pandas as pd\nimport tensorflow as tf\n\nTRAIN_URL = \"http://download.tensorflow.org/data/iris_training.csv\" #测试数据\nTEST_URL = \"http://download.tensorflow.org/data/iris_test.csv\" # =训练数据\n\nCSV_COLUMN_NAMES = ['SepalLength', 'SepalWidth',\n 'PetalLength', 'PetalWidth', 'Species'] #...
[ [ "tensorflow.data.TextLineDataset", "pandas.read_csv", "tensorflow.decode_csv", "tensorflow.data.Dataset.from_tensor_slices" ] ]
EtiCui/Msc-UdeS
[ "33ffda00240194444a59661742dd166e737b324f" ]
[ "dataAnalysis/msd.py" ]
[ "#!/usr/bin/python\n\"\"\" Functions to calculate the mean-square displacement from a LAMMPS trajectory\n\nUsage:\n#Must be in pythonpath or working directory\nfrom msd import msd\nmsd_df = msd(atom_type,first_frame,last_frame)\n\nRequirement:\npython2\nnumpy\ndump_dataframe.py\npandas\n\nTODO:\nParallelisation\nAd...
[ [ "pandas.DataFrame", "numpy.array", "numpy.mean" ] ]
valiantljk/icml20-smp
[ "67a6962898aa25def6bc3454b0ea95e6b2c8d2ad" ]
[ "modular-rl/src/helper/tensorboard_extract.py" ]
[ "import numpy as np\nfrom tensorboard.backend.event_processing.event_accumulator import EventAccumulator\nimport os\nimport argparse\n\n\ndef extract(args):\n os.makedirs(args.output_dir, exist_ok=True)\n for exp in args.expID:\n # identify the exp folder in the data dir\n exp_folder = [folder f...
[ [ "numpy.array", "numpy.vstack" ] ]
PeterTowers/visuProject
[ "fd90dc23a56d9de83fe382e37d99d4d4b26f51d8" ]
[ "src/general_purposes_clusters.py" ]
[ "import pandas as pd\n\ndf = pd.read_csv('data/owid_ginada.csv')\n\ndef revenue():\n df_renda = df[['date', 'location', 'continent', 'gdp_per_capita',\n 'life_expectancy', 'hospital_beds_per_thousand',\n 'human_development_index', 'gini']]\n df_renda = df_renda.dropna()\n ...
[ [ "pandas.read_csv" ] ]
Leeqh666/tianshou
[ "f71db624bee67b6170caaa06b0d3f68901b87985" ]
[ "tianshou/utils/net/continuous.py" ]
[ "import torch\nimport numpy as np\nfrom torch import nn\n\nfrom tianshou.data import to_torch, to_torch_as\n\n\nclass Actor(nn.Module):\n \"\"\"For advanced usage (how to customize the network), please refer to\n :ref:`build_the_network`.\n \"\"\"\n\n def __init__(self, preprocess_net, action_shape, max...
[ [ "torch.nn.Linear", "torch.cat", "numpy.prod", "torch.zeros_like", "torch.tanh" ] ]
Ashprakash/roberta
[ "5ee7abda64d752a467218c247855ddc20c09a779" ]
[ "fairseq/trainer.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\n\"\"\"\nTrain a network across multiple GPUs.\n\"\"\"\n\nfrom collections import OrderedDict\nimport contextlib\nfrom itertools impo...
[ [ "torch.cuda.manual_seed", "torch.no_grad", "torch.manual_seed", "torch.cuda.empty_cache", "torch.cuda.is_available", "torch.cuda.get_device_capability", "torch.distributed.all_reduce", "torch.cuda.DoubleTensor" ] ]
AlbertiPot/SinglePathOneShot
[ "35ceca4146076a1f08a7d38c24c5ff3bca616105" ]
[ "src/Supernet/train.py" ]
[ "import os\nimport sys\nimport torch\nimport argparse\nimport torch.nn as nn\nimport torchvision.transforms as transforms\nimport torchvision.datasets as datasets\nimport cv2\nimport numpy as np\nimport PIL\nfrom PIL import Image\nimport time\nimport logging\nimport argparse\nfrom network import ShuffleNetV2_OneSho...
[ [ "torch.device", "numpy.asarray", "numpy.ascontiguousarray", "torch.no_grad", "torch.from_numpy", "torch.cuda.is_available", "numpy.transpose", "torch.utils.data.DataLoader", "torch.load", "numpy.random.randint", "torch.optim.lr_scheduler.LambdaLR", "torch.nn.DataPar...
predictive-analytics-lab/mantra
[ "6c63d1d1e01745f31dbdc7c34f6c7932bcdccef8" ]
[ "ranzen/torch/utils.py" ]
[ "from __future__ import annotations\nfrom collections.abc import Iterable, Iterator\nfrom datetime import datetime\nimport random\nfrom typing import Any, TypeVar\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\n__all__ = [\"count_parameters\", \"random_seed\", \"inf_generator\", \"Event\"]\n\n\ndef co...
[ [ "torch.cuda.manual_seed", "torch.cuda.manual_seed_all", "torch.cuda.synchronize", "torch.cuda.Event", "numpy.random.seed", "torch.cuda.current_stream", "torch.manual_seed", "torch.cuda.is_available" ] ]
EdwardZheng0312/3d-data-diver
[ "620f68eaffbf0fa93f941e8631bb959b6209c71f" ]
[ "3ddatadiver/Y_slicing.py" ]
[ "import numpy as np\r\nimport pandas as pd\r\nfrom mpl_toolkits.mplot3d import Axes3D\r\nimport matplotlib.pyplot as plt\r\n\r\nimport create_pslist\r\nimport load_data\r\n\r\n\r\ndef y_slicing(filename, Z_direction, Y, x_actual, y_actual, x_size, y_size):\r\n \"\"\"Y_Slicing function with different input Y.\"\"...
[ [ "matplotlib.pyplot.show", "numpy.linspace", "numpy.meshgrid", "matplotlib.pyplot.figure" ] ]
gbouvignies/ChemEx
[ "b1748f1bdc623a1d078de47dffe8cae2515d3411" ]
[ "chemex/containers/noise.py" ]
[ "import numpy as np\nfrom scipy import interpolate\nfrom scipy import linalg as la\nfrom scipy import signal\nfrom scipy import stats\n\n\ndef _variance_from_duplicates(data):\n \"\"\"Estimate the variance of duplicate points.\n\n Estimate the uncertainty using the pooled standard deviation.\n\n Reference:...
[ [ "numpy.array", "scipy.stats.norm.ppf", "scipy.interpolate.interp1d", "numpy.median", "numpy.mean", "numpy.arange", "numpy.sort", "numpy.average", "scipy.linalg.norm", "numpy.var", "scipy.signal.convolve" ] ]
singnet/language-modeling
[ "70d78f61115b4df520845820719e5e14c6b40f91" ]
[ "BERTRAM/mi_multi_mask_ground_truth.py" ]
[ "import asyncio\r\nimport websockets\r\nimport json\r\n\r\nimport sys\r\nimport plotly.graph_objs as go\r\nimport plotly.offline as offline\r\nimport numpy as np\r\nfrom pytorch_pretrained_bert.tokenization import load_vocab, BertTokenizer\r\nfrom pytorch_pretrained_bert.modeling import BertForPreTraining, BertConf...
[ [ "numpy.concatenate", "torch.cuda.is_available", "torch.tensor" ] ]
chhetri22/interpret-community
[ "e61652111ac4badda2212926ad9d56ab7b56ad27" ]
[ "test/test_validate_explanations.py" ]
[ "# ---------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# ---------------------------------------------------------\n\nimport pytest\n\n# Tests for model explainability SDK\nimport numpy as np\nfrom scipy import stats\nimport shap\nimport logging\nf...
[ [ "numpy.sum", "scipy.stats.spearmanr", "numpy.mean", "numpy.abs", "numpy.absolute", "sklearn.model_selection.train_test_split" ] ]
RonBanner/Deep-learning
[ "63006f464e712a5821cd832cae030a298eac1313" ]
[ "theano/sandbox/cuda/dnn.py" ]
[ "from __future__ import absolute_import, print_function, division\nimport os\nimport numpy\nimport warnings\n\nfrom six import integer_types\n\nimport theano\nfrom theano import Apply, tensor, config, Variable\nfrom theano.scalar import as_scalar, constant, Log\nfrom theano.gradient import DisconnectedType, grad_no...
[ [ "numpy.asarray" ] ]
Allamrahul/MVP_Benchmark
[ "fc707b7663842363353316f86cdce3bae8433296" ]
[ "completion/models/pcn.py" ]
[ "from __future__ import print_function\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.utils.data\nimport torch.nn.functional as F\nimport math\n\n# from utils.model_utils import gen_grid_up, calc_emd, calc_cd\nfrom model_utils import gen_grid_up, calc_emd, calc_cd\n\n\nclass PCN_encode...
[ [ "torch.nn.Linear", "torch.max", "torch.cat", "torch.nn.Conv1d" ] ]
CodeSammich/detectron2
[ "3e71a2711bec4eaa488d29cd07f124d384d9d69e" ]
[ "detectron2/modeling/roi_heads/fast_rcnn.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\nimport logging\nfrom typing import Dict, List, Tuple, Union\nimport torch\nfrom fvcore.nn import giou_loss, smooth_l1_loss\nfrom torch import nn\nfrom torch.nn import functional as F\n\nfrom detectron2.config import configurable\nfrom detectron2.layers import Lin...
[ [ "torch.zeros", "torch.cat", "torch.arange", "torch.nn.init.constant_", "torch.isfinite", "torch.nn.init.normal_", "torch.nn.functional.softmax", "torch.flatten", "torch.empty" ] ]
IndexFziQ/my_git_laser
[ "12fb8746dba2b340d726bc4bd675a47f6dd623fc" ]
[ "preprocess_main.py" ]
[ "# coding=utf-8\n# Copyright 2019 The Google Research 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 requ...
[ [ "tensorflow.io.gfile.GFile", "tensorflow.io.TFRecordWriter" ] ]
guabao/fedlearn-algo
[ "5c202a0a0299391e6e05c824024e34ce76237d88" ]
[ "demos/secure_inference/insecure/run.py" ]
[ "# Copyright 2021 Fedlearn authors.\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 agre...
[ [ "numpy.linalg.norm", "numpy.asarray", "numpy.stack", "torch.tensor", "torch.load" ] ]
TeamAutonomousCarOffenburg/TACO_2018
[ "ebb63e466578fc3911269d4a714ebff0a516dbf6" ]
[ "vision/object_detection/meta_architectures/ssd_meta_arch_test.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...
[ [ "numpy.array", "numpy.log", "tensorflow.random_uniform", "tensorflow.Graph", "tensorflow.python.training.saver.Saver", "tensorflow.train.Saver", "tensorflow.constant", "tensorflow.variable_scope", "numpy.random.uniform", "tensorflow.placeholder", "tensorflow.test.main",...
ArcticFaded/iexfinance
[ "ad9e50214187606d39b444201cdf1751d0269308" ]
[ "iexfinance/data_apis/data_points.py" ]
[ "import pandas as pd\n\nfrom iexfinance.base import _IEXBase\n\n\nclass DataPoints(_IEXBase):\n\n def __init__(self, symbol, key=None, **kwargs):\n self.symbol = symbol\n self.key = key\n super(DataPoints, self).__init__(**kwargs)\n\n @property\n def url(self):\n if self.key is ...
[ [ "pandas.DataFrame" ] ]
larrys54321/quant_corner
[ "3dc6f3f3d1ce1fa002c226bd5c5f845b91710687" ]
[ "volatility/volatility_compare.py" ]
[ "import yfinance as yf\nfrom datetime import datetime\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom arch import arch_model\nfrom volatility.utils import get_percent_chg, Option, set_plot, get_ATR\n\n\nstart = datetime(2000, 1, 1)\nend = datetime(2021, 3, 17)\nsymbol = 'QQQ'\nticker...
[ [ "matplotlib.pyplot.show", "numpy.sqrt", "matplotlib.pyplot.subplots", "pandas.Series" ] ]
judgelight/bitmex_market_maker
[ "1b6e09d2d67bd903a834ef671dcae57ad4d0fc2b" ]
[ "custom_strategy.py" ]
[ "# -*- coding:utf-8 -*-\nimport sys\nfrom os.path import getmtime\nimport logging\nimport requests\nfrom time import sleep\nimport datetime\nimport schedule\nimport re\nimport numpy as np\n\nfrom market_maker.market_maker import OrderManager, XBt_to_XBT\nfrom market_maker.settings import settings\nfrom market_maker...
[ [ "numpy.mean" ] ]
adesgautam/document-kv-data-extractor
[ "6a6a1d16471128ba2fd6dfba43e88eca47b28d7c" ]
[ "tools/kie_test_imgs.py" ]
[ "#!/usr/bin/env python\nimport argparse\nimport os\nimport os.path as osp\nimport json\nimport mmcv\nimport torch\nimport numpy as np\nfrom mmcv import Config\nfrom mmcv.image import tensor2imgs\nfrom mmcv.parallel import MMDataParallel\nfrom mmcv.runner import load_checkpoint\nfrom mmocr.models.textdet.detectors.t...
[ [ "torch.no_grad" ] ]
alexklwong/learning-topology-synthetic-data
[ "fa4759a1c1c274d26251905185c867210b504e58" ]
[ "src/fusionnet_model.py" ]
[ "'''\nAuthors: Alex Wong <alexw@cs.ucla.edu>, Safa Cicek <safacicek@ucla.edu>\n\nIf this code is useful to you, please cite the following paper:\nA. Wong, S. Cicek, and S. Soatto. Learning topology from synthetic data for unsupervised depth completion.\nIn the Robotics and Automation Letters (RA-L) 2021 and Proceed...
[ [ "tensorflow.abs", "tensorflow.concat", "tensorflow.contrib.slim.max_pool2d", "tensorflow.where", "tensorflow.expand_dims", "tensorflow.summary.scalar", "tensorflow.summary.histogram", "tensorflow.ones_like", "tensorflow.cond", "tensorflow.zeros_like", "tensorflow.clip_b...
yxdragon/dragonfly
[ "0ac78838692ba71f960b869ed2e9ea39b8afbd89" ]
[ "dragonfly/hydrology/ridge.py" ]
[ "from scipy.misc import imread\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom numba import jit\nfrom skimage.data import camera\nimport scipy.ndimage as ndimg\nfrom time import time\n\nfrom scipy.ndimage import label, generate_binary_structure\n\nstrc = np.ones((3,3), dtype=np.bool)\n\ndef count(n):\n ...
[ [ "numpy.array", "numpy.dot", "numpy.cumprod", "numpy.zeros", "scipy.ndimage.label", "numpy.ones", "scipy.misc.imread", "scipy.ndimage.distance_transform_edt", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
zhengjian2322/darts-pt
[ "7d53b9df36559d325f003efd15d62b28854a2d98" ]
[ "nasbench201/search_model_darts_proj.py" ]
[ "import torch\nfrom .search_cells import NAS201SearchCell as SearchCell\nfrom .search_model import TinyNetwork as TinyNetwork\nfrom .genotypes import Structure\n\n\nclass TinyNetworkDartsProj(TinyNetwork):\n def __init__(self, C, N, max_nodes, num_classes, criterion, search_space, args,\n affine=...
[ [ "torch.zeros_like", "torch.no_grad", "torch.softmax" ] ]
umateusz/ros-bridge
[ "e1a99d94eca9fa82c7bfb8417d2282ef6939d8fa" ]
[ "carla_ros_bridge/src/carla_ros_bridge/actor_factory.py" ]
[ "#!/usr/bin/env python\n#\n# Copyright (c) 2020 Intel Corporation\n#\n# This work is licensed under the terms of the MIT license.\n# For a copy, see <https://opensource.org/licenses/MIT>.\n#\n\nimport time\nfrom threading import Thread, Lock\nimport itertools\nfrom enum import Enum\n\ntry:\n import queue\nexcept...
[ [ "numpy.matrix" ] ]
sachinpc1993/ConvLab
[ "1c594648b2855915ddac548c0a363e4d8439d240" ]
[ "convlab/modules/word_policy/multiwoz/larl/policy.py" ]
[ "# Modified by Microsoft Corporation.\n# Licensed under the MIT license.\nimport sys\n# sys.path.append('/root/ConvLab')\nfrom convlab.modules.word_policy.multiwoz.larl.corpora_inference import BOS, EOS, PAD\nfrom convlab.modules.word_policy.multiwoz.larl.latent_dialog.enc2dec.decoders import DecoderRNN\nfrom convl...
[ [ "numpy.max", "numpy.array", "torch.cat", "numpy.zeros", "torch.from_numpy", "torch.mm", "torch.cuda.is_available", "torch.t", "numpy.append", "torch.sum" ] ]
fermi-lat/pyBurstAnalysisGUI
[ "add53fe77ef71cb64a27751f024fb914f7cc0863" ]
[ "python/GtBurst/aplpy/colorbar.py" ]
[ "import warnings\n\nimport matplotlib.axes as maxes\n\ntry:\n \n from mpl_toolkits.axes_grid1 import make_axes_locatable\n \nexcept ImportError:\n # Old matplotlib\n from mpl_toolkits.axes_grid import make_axes_locatable\n\nfrom matplotlib.font_manager import FontProperties\n\nfrom .decorators import...
[ [ "matplotlib.font_manager.FontProperties" ] ]
Cugtyt/leaf-disease
[ "bc3559e9ea44138e170a31ea72aa6dfe10921cad" ]
[ "src/juzi_only_disease_process_pytorch_py37_V2.py" ]
[ "from shufflenetv2 import *\r\nfrom leaf_process_utils import *\r\nfrom torch import optim, nn, cuda\r\nfrom torchvision import datasets, transforms\r\nfrom torch.utils import data\r\nimport torch\r\nfrom pathlib import Path\r\nimport logging\r\nimport time\r\nimport copy\r\n\r\nimg_size = 224\r\nspecies = 'juzi'\r...
[ [ "torch.max", "torch.save", "torch.set_grad_enabled", "torch.cuda.device_count", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.nn.CrossEntropyLoss", "torch.nn.DataParallel", "torch.sum" ] ]
mohamad-amin/falkon
[ "581c761b4a4cb7bf6a299613700db8414c419a52" ]
[ "falkon/benchmarks/common/datasets.py" ]
[ "import os\nfrom abc import abstractmethod, ABC\nfrom typing import Union, Tuple\n\nimport h5py\nimport numpy as np\nimport scipy.io as scio\nimport scipy.sparse\nfrom scipy.sparse import load_npz\nfrom sklearn.datasets import load_svmlight_file\n\nfrom .benchmark_utils import Dataset\n\n__all__ = (\n \"get_load...
[ [ "sklearn.datasets.load_svmlight_file", "numpy.load", "numpy.mean", "numpy.where", "numpy.unique", "numpy.concatenate", "numpy.full", "tensorflow.SparseTensor", "scipy.sparse.load_npz", "numpy.log", "numpy.arange", "numpy.mod", "numpy.array", "numpy.random.sh...
soar-zhengjian/uai-sdk
[ "e195bd3fb2b97aca7dac6722d332c25b7070481f" ]
[ "examples/tensorflow-2.0/mnist/train/mnist_dist.py" ]
[ "import json\nimport os\nimport tensorflow as tf\nimport numpy as np\nfrom absl import app\nfrom absl import flags\nimport sys\n\nimport mnist_data\nfrom tensorflow.python.keras.utils import *\n\nimport logging\nlogging.getLogger().setLevel(logging.INFO)\n\nFLAGS = app.flags.FLAGS\nflags = app.flags\n\n# ==========...
[ [ "tensorflow.keras.utils.to_categorical", "tensorflow.distribute.experimental.MultiWorkerMirroredStrategy", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.compat.v1.train.AdamOptimizer", "numpy.asarray", "tensorflow.keras.layers.Flatten", "tensorflow.distribute.experimental.P...
IOT-smart-car-park/project
[ "3701d5a92eb0a6a35af67e9e254a63425b663760" ]
[ "Openalpr API/src/bindings/python/openalpr/openalpr.py" ]
[ "import ctypes\nimport json\nimport platform\n\n# We need to do things slightly differently for Python 2 vs. 3\n# ... because the way str/unicode have changed to bytes/str\nif platform.python_version_tuple()[0] == '2':\n # Using Python 2\n bytes = str\n _PYTHON_3 = False\nelse:\n # Assume using Python 3...
[ [ "numpy.ctypeslib.ndpointer" ] ]
ranattias/sparse
[ "a1fbdee8ae9c530c09327b5ae29042f872a7c0a6" ]
[ "sparselearning/core.py" ]
[ "from __future__ import print_function\nimport argparse\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.utils.data.sampler import SubsetRandomSampler\n\nimport numpy as np\nimport math\nimport os\nimport shutil\nimport time\nfrom matplotlib import pyplo...
[ [ "torch.zeros", "torch.rand", "torch.sqrt", "numpy.isnan", "torch.optim.lr_scheduler.CosineAnnealingLR", "numpy.mean", "numpy.prod", "torch.zeros_like" ] ]
mriedman/cs224n-project
[ "9045e764bd32d02fa84a880713ce8a7630a67c37" ]
[ "layers.py" ]
[ "\"\"\"Assortment of layers for use in models.py.\n\nAuthor:\n Chris Chute (chute@stanford.edu)\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\nfrom util import masked_softmax\n\n\nclass Embedding(nn.Modu...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Embedding.from_pretrained", "torch.cat", "torch.nn.LSTM", "torch.nn.functional.dropout", "torch.nn.init.xavier_uniform_", "torch.bmm", "torch.softmax", "torch.nn.utils.rnn.pad_packed_sequence", "torch.matmul", "torch.sum" ...
pariahGH/electrochemical_analysis
[ "9d2fcb6f8f3b0ff858e809a205e8cc5fd7bf3894" ]
[ "lab_data_analysis/functions.py" ]
[ "from decimal import Decimal as dec\nimport decimal\nimport re\nimport matplotlib.pyplot as plt\nimport os\ndecimal.getcontext().rounding = 'ROUND_HALF_UP'\n\ndef parseFilesIT(paths, magnitude, electrodeArea):\n\tallParsedData = []\n\tfor path in paths:\n\t\t#last and second to last are electrodes, third to last is...
[ [ "matplotlib.pyplot.errorbar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.close", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel" ] ]
GeoscienceAustralia/dea-vectoriser
[ "435a42929c9576450e8f6e030ca5484f8e3f5ee5" ]
[ "dea_vectoriser/vector_wos.py" ]
[ "\"\"\"\nRead in WOs GeoTIFF, Convert to Vectors\n\n1. create binary arrays for classed of interest: 1)water and 2)Not Analysed\n2. conduct binary erosion and dilation to remove single pixels/big gaps between datatypes\n - B) conduct fill on water to remove single pixel holes?\n - C) conduct 1 pixel buffer of...
[ [ "scipy.ndimage.binary_erosion", "scipy.ndimage.binary_dilation", "pandas.concat" ] ]
atick-faisal/Hand-Gesture-Recognition-v2
[ "f26e53b68e3cddd26c40edc9b056d82b5e887ff3" ]
[ "ContinuousDataAcquisitionPython/processChannels.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[62]:\n\n\nimport os\nimport pandas as pd\nimport numpy as np\n\ncolumnName = ['flex_1', 'flex_2', 'flex_3', 'flex_4', 'flex_5',\n 'Qw', 'Qx', 'Qy', 'Qz',\n 'GYRx', 'GYRy','GYRz',\n 'ACCx', 'ACCy', 'ACCz',\n 'ACCx_rea...
[ [ "pandas.read_csv", "numpy.savetxt", "numpy.expand_dims" ] ]
lsst-camera-dh/eotest
[ "0dc45fd0e2c11ced3da4714e18c699ef5c1df78f" ]
[ "python/lsst/eotest/raft/divisidero_tearing.py" ]
[ "\"\"\"\nCode to perform Divisadero tearing analysis. This is slightly\nrevised code originally from Aaron Roodman. See LSSTTD-1440.\n\"\"\"\nimport numpy as np\nfrom matplotlib import pyplot as plt\nimport matplotlib.gridspec as gridspec\nfrom astropy import stats\nimport lsst.eotest.image_utils as imutils\nimpor...
[ [ "numpy.max", "matplotlib.gridspec.GridSpecFromSubplotSpec", "numpy.zeros", "numpy.median", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.figure", "numpy.arange", "numpy.polyfit", "numpy.flip", "numpy.abs", "matplotlib.pyplot.Subplot", "matplotlib.gridspec.GridSpe...
qzhu2017/ML-DOS
[ "c58ebdfc77746175771af0862ed5737c4eaa3eec", "c58ebdfc77746175771af0862ed5737c4eaa3eec", "c58ebdfc77746175771af0862ed5737c4eaa3eec" ]
[ "pyxtal_ml/descriptors/stats.py", "pyxtal_ml/descriptors/charge.py", "pyxtal_ml/test/test_joblib.py" ]
[ "import numpy as np\nfrom scipy.stats import kurtosis, skew\n\nclass descriptor_stats(object):\n '''\n A class containing standardized statistics to compute over each\n representation\n\n These statistics include:\n mean, standard deviation, kurtosis, and skewness\n\n Population covariance is ...
[ [ "numpy.array", "numpy.zeros_like", "numpy.cov", "numpy.mean", "numpy.shape", "scipy.stats.skew", "numpy.std", "numpy.amax", "numpy.amin", "scipy.stats.kurtosis" ], [ "numpy.array", "numpy.shape" ], [ "sklearn.externals.joblib.load", "numpy.std", ...
jimzhu/OpenCTR-benchmarks
[ "e8e723cd7a0ef5ddd40e735b85ce7669955a3a99" ]
[ "candidate_matching/libs/LR-GCCF/evaluate.py" ]
[ "# -- coding:UTF-8\nimport numpy as np\nimport torch \nimport time\nimport pdb\nimport math\n \ndef metrics_loss(model, test_val_loader_loss, batch_size): \n start_time = time.time() \n loss_sum=[]\n loss_sum2=[]\n for user, item_i, item_j in test_val_loader_loss:\n user = user.cuda()\n it...
[ [ "torch.cuda.LongTensor", "numpy.mean", "torch.topk" ] ]
kutaslab/mkpy
[ "4b6369a8e045611943d04f031d0dce28d68d79a4" ]
[ "tests/test_yhdr.py" ]
[ "\"\"\"smoke test top-level apparatus yaml header maps\"\"\"\nimport yaml\nimport pandas as pd\nimport glob\nimport os.path\nfrom mkpy import dpath\n\n\ndef test_load():\n test_files = glob.glob(os.path.join(\"data/\", \"SNN.yhdr\"))\n test_files = [f for f in test_files if \"bad\" not in f]\n for yhdr_f i...
[ [ "pandas.DataFrame.from_dict" ] ]
bobplatte/mllaunchpad
[ "4be60428b8091c3fb37e5cac01fdddef1b50180b" ]
[ "mllaunchpad/resource.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Stdlib imports\nfrom datetime import datetime\nimport getpass\nimport glob\nimport json\nimport logging\nimport os\nimport shutil\nimport sys\nfrom time import time\nimport typing\nfrom typing import Dict, Tuple, Type, TypeVar, Union\n\n# Third-party imports\nimport dill as pickle\nimp...
[ [ "pandas.read_sql", "pandas.read_csv" ] ]
Adrian123K/rnn
[ "ec33769a3b55bf988455ed5937173413d7f33372" ]
[ "stock_url_crawling.py" ]
[ "import pandas as pd\n\ncode_df = pd.read_html('http://kind.krx.co.kr/corpgeneral/corpList.do?method=download&searchType=13', header=0)[0] # 종목코드가 6자리이기 때문에 6자리를 맞춰주기 위해 설정해줌\ncode_df.종목코드 = code_df.종목코드.map('{:06d}'.format) # 우리가 필요한 것은 회사명과 종목코드이기 때문에 필요없는 column들은 제외해준다.\ncode_df = code_df[['회사명', '종목코드']] # 한글로...
[ [ "pandas.DataFrame", "pandas.read_html" ] ]
akrherz/talltowers
[ "3ed98201358eba3d67827109e495d8dbec48842b" ]
[ "plots/analog.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nmake plot of recent data from talltowers project, for display on website.\r\n\r\n@author: joe\r\n\"\"\"\r\n\r\nimport os\r\nimport json\r\nimport datetime\r\nfrom dateutil import tz\r\nimport psycopg2\r\nfrom pandas.io.sql import read_sql\r\nfrom pandas.plotting import register...
[ [ "matplotlib.dates.DateFormatter", "matplotlib.dates.HourLocator", "pandas.io.sql.read_sql", "matplotlib.dates.DayLocator", "pandas.plotting.register_matplotlib_converters" ] ]
rstofi/Efficient_catalog_cross-matching_skymining_hatcahon_2018
[ "f8dc7dbc965cc2e2ae0ab7801bc5f2799bdde173" ]
[ "Casey/visualization2.py" ]
[ "\"\"\"\n------------------------------\nMIT License\n\nCopyright (c) 2018 Hachastron\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation th...
[ [ "matplotlib.pyplot.errorbar", "matplotlib.pylab.ylabel", "matplotlib.pyplot.title", "numpy.genfromtxt", "matplotlib.pyplot.figure", "matplotlib.pyplot.tick_params", "matplotlib.pylab.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.clf...
Darktex/tensor-sensor
[ "38f11bbd3e0b7bbd0eeaa2da35a62274bbc2c7fa" ]
[ "testing/test_incr_eval.py" ]
[ "\"\"\"\nMIT License\n\nCopyright (c) 2020 Terence Parr\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify...
[ [ "torch.tensor" ] ]
inailuig/netket
[ "ab57a6fb019edb9ac298969950724781f2ae2b22" ]
[ "netket/jax/utils.py" ]
[ "# Copyright 2021 The NetKet 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...
[ [ "numpy.dtype" ] ]
jboynyc/spaCy
[ "29108e5a8702a4822cd1eb50f2bc3b25b5566d7f" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\nfrom setuptools import Extension, setup, find_packages\nimport sys\nimport platform\nimport numpy\nfrom distutils.command.build_ext import build_ext\nfrom distutils.sysconfig import get_python_inc\nfrom pathlib import Path\nimport shutil\nfrom Cython.Build import cythonize\nfrom Cython.Compi...
[ [ "numpy.get_include" ] ]
c-jg/datasets
[ "974c2be7272af3a71e9ae032c3c8af3e591b8814" ]
[ "tensorflow_datasets/core/dataset_builder_read_test.py" ]
[ "# coding=utf-8\n# Copyright 2021 The TensorFlow Datasets 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 ...
[ [ "tensorflow.TensorSpec" ] ]
AnaFOliveira/Segmentation-of-Lungs
[ "0c07c102e10558c2539ba1952a581fefa993e0f5" ]
[ "sample/Code/3DRegionGrowing/segmentation_3D_secondversion_naoiterativo.py" ]
[ "from segmentation_functions import resample, grow\nfrom automaticSeeding_second_Version import find_seed\nfrom finding_biggest_lung import arrange_slices, normalization, get_pixels_hu\nfrom seed_evaluation import evaluate_seed\nimport scipy.ndimage.interpolation as inter\nimport numpy as np\nimport os\nimport matp...
[ [ "numpy.array", "numpy.zeros", "scipy.io.loadmat", "numpy.save", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
krevas/transformers
[ "f17b437a0e8daed0fac504ed4d3ad4ea9bede6a7" ]
[ "src/transformers/modeling_xlm.py" ]
[ "# coding=utf-8\n# Copyright 2019-present, Facebook, Inc and the HuggingFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICE...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.AdaptiveLogSoftmaxWithLoss", "torch.nn.ModuleList", "torch.LongTensor", "numpy.cos", "torch.nn.CrossEntropyLoss", "numpy.sin", "torch.nn.LayerNorm", "torch.nn.init.constant_", "torch.nn.init.normal_", "torch.tensor", "to...
Bejita123/10-Days-Of-DL
[ "0c20f328ae8aaac9f6004be21030cee71ca0f145" ]
[ "Day5/Day 5.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport math\n\n# Original data\nx_data=[[1.,2.],[2.,3.],[3.,1.],[4.,3.],[5.,3.],[6.,2.]]\ny_data=[[0],[0],[0],[1],[1],[1]]\n\n# Logistic regression model class\nclass logistic(object):\n def __init__(self, learning_rate=0.01):\n # Weight variable\n self...
[ [ "tensorflow.keras.optimizers.SGD", "numpy.array", "tensorflow.GradientTape", "tensorflow.random.normal", "matplotlib.pyplot.xlabel", "tensorflow.matmul", "tensorflow.equal", "tensorflow.math.log", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib...
sprillo/softsort
[ "8dcb552804ccb3638ade1a53ef12c0e84f3831d8" ]
[ "tf/synthetic_experiment_learning_curves.py" ]
[ "import argparse\nimport os\nimport time\n\nimport numpy as np\nimport tensorflow as tf\nfrom scipy import stats\n\nimport util\n\nos.environ['KMP_DUPLICATE_LIB_OK'] = 'True'\n\nparser = argparse.ArgumentParser(description=\"Benchmark speed of softsort vs\"\n \" neuralsort\")\n\npars...
[ [ "tensorflow.set_random_seed", "tensorflow.multiply", "tensorflow.matrix_diag_part", "numpy.random.seed", "tensorflow.random_uniform_initializer", "tensorflow.train.MomentumOptimizer", "tensorflow.Session", "numpy.mean", "tensorflow.math.reduce_max", "tensorflow.device", ...
jogepari/crossvalmodel
[ "c64a5fc0335ba5c1a1c51e3dadff526c2d959503" ]
[ "crossvalmodel/crossvalmodel.py" ]
[ "import pandas as pd\nimport numpy as np\nimport sklearn\nfrom tqdm.auto import tqdm\nimport copy\nimport datetime\nimport scipy\nimport inspect\n\n\n__all__ = [\n 'CrossValModel',\n 'CrossValRegressor',\n 'CrossValClassifier',\n]\n\n\nclass CrossValModel:\n \"\"\"\n Cross-validation wrapper preservi...
[ [ "numpy.array", "pandas.DataFrame", "numpy.mean", "numpy.stack", "numpy.argmax", "pandas.concat", "sklearn.exceptions.NotFittedError" ] ]
fdmalone/pyscf
[ "021b17ac721e292b277d2b740e2ff8ab38bb6a4a" ]
[ "pyscf/nao/m_spline_diff2.py" ]
[ "# Copyright 2014-2018 The PySCF Developers. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless r...
[ [ "numpy.zeros" ] ]
betochimas/cugraph
[ "7100fd5d47577ca90b83c986620415d1a45fe999", "7100fd5d47577ca90b83c986620415d1a45fe999" ]
[ "python/cugraph/cugraph/tests/test_utils.py", "python/cugraph/cugraph/tests/test_overlap.py" ]
[ "# Copyright (c) 2020-2022, NVIDIA CORPORATION.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable...
[ [ "numpy.allclose", "numpy.random.randint" ], [ "scipy.sparse.csr_matrix", "numpy.isnan" ] ]
noboevbo/nobos_torch_lib
[ "11bc0a06b4cb5c273905d23c592cb3d847149a31" ]
[ "nobos_torch_lib/examples/datasets/rnnopar_dataset_example.py" ]
[ "import cv2\nimport numpy as np\nfrom nobos_commons.data_structures.constants.dataset_part import DatasetPart\nfrom nobos_commons.data_structures.skeletons.skeleton_stickman import SkeletonStickman\nfrom nobos_commons.visualization.img_utils import add_img_title\nfrom nobos_commons.visualization.pose2d_visualizer i...
[ [ "torch.utils.data.DataLoader", "numpy.zeros" ] ]
bsalanie/Cupid_Python
[ "c75cf244f7c95d33561fefcfa046d8a75160ba89" ]
[ "cupid_streamlit.py" ]
[ "\"\"\" Interactive Streamlit application that solves for the stable matching and estimates the parameters of the joint surplus \\\n in a `Choo and Siow 2006 <https://www.jstor.org/stable/10.1086/498585?seq=1>`_ model \\\n (homoskedastic, with singles)\n\"\"\"\nfrom math import pow\nimport numpy as np\nim...
[ [ "numpy.max", "numpy.full", "numpy.array", "numpy.empty", "numpy.random.rand", "numpy.zeros", "numpy.log", "pandas.DataFrame", "numpy.min", "numpy.arange", "numpy.outer", "numpy.logspace" ] ]
POFK/CosmAna
[ "153af155d243e38f64b8bdf79abc496163269219" ]
[ "CosmAna/Ext_C/libfftw/setup.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n\nimport os\nfrom distutils.core import setup\nfrom distutils.extension import Extension\nfrom Cython.Distutils import build_ext\n\nimport numpy\n\nos.environ[\"CC\"] = 'mpicc' # set CC compiler\nos.environ[\"LDSHARED\"] = 'mpicc -shared' # set linker_so\n#===================...
[ [ "numpy.get_include" ] ]
jiayiliu/gradio
[ "6fa11437c09845322df3b47f732a924338d17862" ]
[ "gradio/interpretation.py" ]
[ "from gradio.inputs import Image, Textbox\nfrom gradio.outputs import Label\nfrom gradio import processing_utils\nfrom skimage.segmentation import slic\nimport numpy as np\n\nexpected_types = {\n Image: \"numpy\",\n}\n\ndef default(separator=\" \", n_segments=20):\n \"\"\"\n Basic \"default\" interpretatio...
[ [ "numpy.max", "numpy.zeros", "numpy.copy", "numpy.min", "numpy.mean", "numpy.unique" ] ]
aws-samples/aws-neptune-sagemaker-knowledge-graph-bert
[ "33ed1b3a48a41a8fd09dec8c7cdc7af603735542" ]
[ "code/train.py" ]
[ "# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n# SPDX-License-Identifier: MIT-0\nimport os\nimport argparse\nimport json\n\nimport pandas as pd\nimport tensorflow as tf\n\nfrom tensorflow.keras.callbacks import ModelCheckpoint, EarlyStopping, Callback, TensorBoard\nfrom tensorflow.keras.util...
[ [ "sklearn.metrics.classification_report", "tensorflow.keras.utils.to_categorical", "pandas.DataFrame", "tensorflow.keras.callbacks.EarlyStopping" ] ]
JunMa11/SegWithDistMap
[ "dbea093a4ad63ab9775266722f7468bdca830bb4" ]
[ "code/test_LA.py" ]
[ "import os\nimport argparse\nimport torch\nfrom networks.vnet import VNet\nfrom test_util import test_all_case\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--root_path', type=str, default='../data/2018LA_Seg_Training Set/', help='Name of Experiment')\nparser.add_argument('--model', type=str, default...
[ [ "torch.load" ] ]
yuhonghong66/onnxmltools
[ "a7cab9fe950fece6fcc1a84d1a60f3f99a68c22c" ]
[ "onnxmltools/convert/keras/operator_converters/GRU.py" ]
[ "# -------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n# --------------------------------------------------------------------------\n...
[ [ "numpy.zeros" ] ]
golam-shovon/Targated_Advertising
[ "f4eb40b5ca3f49dfc929ff3ad2b4bb877e9663e2" ]
[ "venv/Lib/site-packages/tensorflow/python/ops/gen_string_ops.py" ]
[ "\"\"\"Python wrappers around TensorFlow ops.\r\n\r\nThis file is MACHINE GENERATED! Do not edit.\r\n\"\"\"\r\n\r\nimport collections as _collections\r\nimport six as _six\r\n\r\nfrom tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow\r\nfrom tensorflow.python.eager import context as _context\r\nfrom ...
[ [ "tensorflow.python.util.dispatch.dispatch", "tensorflow.python.eager.execute.make_str", "tensorflow.python.framework.ops.convert_n_to_tensor", "tensorflow.python.eager.context.context", "tensorflow.python.eager.execute.args_to_matching_eager", "tensorflow.python.eager.execute.record_gradie...
sir-sigurd/quilt
[ "1ca2be01aaef8a633c32d7e6ec472dee1a3d458d" ]
[ "api/python/tests/integration/test_packages.py" ]
[ "\"\"\" Integration tests for Quilt Packages. \"\"\"\nimport io\nimport os\nimport pathlib\nimport shutil\nimport tempfile\nfrom collections import Counter\nfrom contextlib import redirect_stderr\nfrom datetime import datetime\nfrom io import BytesIO\nfrom pathlib import Path\nfrom unittest import mock\nfrom unitte...
[ [ "pandas.DataFrame" ] ]
HuzuniV2/TFGP
[ "b9c98ab1af631e805005bbd1be620028de61195c" ]
[ "CSV_Handler.py" ]
[ "import tensorflow as tf\nfrom sklearn.model_selection import train_test_split\nimport numpy as np\n\n\ndef read_split_csv(fname, cols, rows, training_size):\n defaults = [tf.float64] * cols\n dataset = tf.data.experimental.CsvDataset(fname, defaults)\n #TODO -> ver isto das lists\n #dataset.shuffle(len...
[ [ "sklearn.model_selection.train_test_split", "numpy.array", "tensorflow.data.experimental.CsvDataset" ] ]