repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
kelvin95/EPOSearch
[ "020f0a8890437449dd7bb37534697aa9f71e8305" ]
[ "toy_experiments/solvers/moo_mtl.py" ]
[ "# This code is from\n# Multi-Task Learning as Multi-Objective Optimization\n# Ozan Sener, Vladlen Koltun\n# Neural Information Processing Systems (NeurIPS) 2018 \n# https://github.com/intel-isl/MultiObjectiveOptimization\n\nimport numpy as np\n\nfrom .min_norm_solvers_numpy import MinNormSolver\n\n\ndef moo_mtl_se...
[ [ "numpy.stack", "numpy.dot", "numpy.random.randn", "numpy.array" ] ]
cyankaet/bumps
[ "427d077fd95f2d9a09eeb8677d045547061cff42" ]
[ "doc/examples/peaks/plot.py" ]
[ "import sys\nimport json\n\nimport numpy as np\nimport pylab\n\ndef plot(X,Y,theory,data,err):\n #print \"theory\",theory[1:6,1:6]\n #print \"data\",data[1:6,1:6]\n #print \"delta\",(data-theory)[1:6,1:6]\n pylab.subplot(3,1,1)\n pylab.pcolormesh(X,Y, data)\n pylab.subplot(3,1,2)\n pylab.pcolor...
[ [ "numpy.array" ] ]
glangsto/pyspeckit
[ "346b24fb828d1d33c7891cdde7609723e51af34c" ]
[ "pyspeckit/spectrum/speclines/optical.py" ]
[ "\"\"\"\nStorage for optical spectral line information.\n\"\"\"\nfrom __future__ import print_function\n\nimport numpy as np\n\ndef hydrogen(nu,nl, vacuum=True):\n \"\"\"\n Compute the rest wavelength of Hydrogen recombination lines in angstroms\n \"\"\"\n rydberg = 10973731.6 # m^-1\n protontoelectr...
[ [ "numpy.array", "numpy.sort", "numpy.argsort" ] ]
bartbroere/lir
[ "041f1cea40366937d56c43bb15712873eb3e8a0a" ]
[ "lir/ece.py" ]
[ "\"\"\"\nEmpirical Cross Entrpy (ECE)\n\nThe discrimination and calibration of the LRs reported by some systems can also\nbe measured separately. The empirical cross entropy (ECE) plot is a graphical\nway of doing this.\n\nThe ECE is the average of -P(Hp) * log2(P(Hp|LRi)) for all LRi when Hp is true,\nand -P(Hd) *...
[ [ "numpy.log2", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlim", "numpy.arange", "numpy.errstate", "numpy.power", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib....
woffett/mmpose
[ "cf8cbf49759e745896b70ce69d412518568af33b" ]
[ "mmpose/datasets/datasets/top_down/topdown_onehand10k_dataset.py" ]
[ "import copy as cp\nimport os\nimport os.path as osp\nfrom collections import OrderedDict\n\nimport json_tricks as json\nimport numpy as np\n\nfrom mmpose.datasets.builder import DATASETS\nfrom .topdown_base_dataset import TopDownBaseDataset\n\n\n@DATASETS.register_module()\nclass TopDownOneHand10KDataset(TopDownBa...
[ [ "numpy.ones", "numpy.sum", "numpy.zeros", "numpy.max", "numpy.random.rand", "numpy.array", "numpy.linalg.norm" ] ]
HayetBD/Text-to-image
[ "7ead7e03bb8ee42f457281bc250cd88161fb5dcd" ]
[ "Unsplash_webscrapping.py" ]
[ "import time\r\nimport pandas as pd\r\nfrom selenium import webdriver\r\n\r\n# Scrapping images and their caption from unsplash website\r\n# saving these images url and captions into a csv file\r\n\r\nWEBSITE = 'http://unsplash.com/s/photos/landscape-forest-mountain'\r\ncolumns = ['description', 'url']\r\nimageset ...
[ [ "pandas.DataFrame" ] ]
mtrbean/pandas
[ "c0ff67a22df9c18da1172766e313732ed2ab6c30" ]
[ "pandas/core/dtypes/common.py" ]
[ "\"\"\" common type operations \"\"\"\nfrom typing import Any, Callable, Union\nimport warnings\n\nimport numpy as np\n\nfrom pandas._libs import algos, lib\nfrom pandas._libs.tslibs import conversion\nfrom pandas.compat import PY36\n\nfrom pandas.core.dtypes.dtypes import (\n CategoricalDtype,\n DatetimeTZDt...
[ [ "pandas._libs.lib.infer_dtype", "pandas.core.dtypes.dtypes.PeriodDtype.is_dtype", "scipy.sparse.issparse", "numpy.dtype", "pandas.core.dtypes.inference.is_scalar", "pandas.core.dtypes.inference.is_string_like", "pandas.core.dtypes.dtypes.DatetimeTZDtype.is_dtype", "numpy.asarray", ...
vijayperiasamy-eb/dd-trace-py
[ "2b0d396fc7f76582e8ffedff48933245a77ebaf2" ]
[ "tests/test_span.py" ]
[ "import mock\nimport time\n\nfrom unittest.case import SkipTest\n\nfrom ddtrace.context import Context\nfrom ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY\nfrom ddtrace.span import Span\nfrom ddtrace.ext import errors, priority\nfrom .base import BaseTracerTestCase\n\n\nclass SpanTestCase(BaseTracerTestCase):\...
[ [ "numpy.int64" ] ]
nifarn/PyMarlin
[ "ea1f5f927aa85112ecebc206d53b5c3ee65704fa" ]
[ "pymarlin/plugins/hf_ner/module_classes.py" ]
[ "import os\nimport dataclasses\nimport numpy as np\n\nimport torch\nfrom torch.utils.data import DataLoader\nfrom torch.optim import Adam\nfrom torch.optim.lr_scheduler import OneCycleLR\n\nfrom pymarlin.core import module_interface, data_interface\nfrom transformers import AutoModelForTokenClassification\n\nfrom p...
[ [ "torch.tensor", "numpy.argmax", "torch.optim.lr_scheduler.OneCycleLR" ] ]
ChristopherGS/rolltec_motion
[ "45105ddd0a8eb1f4eb5075b1dd807cbbc3b49505" ]
[ "ML_Sandbox/data_prep.py" ]
[ "import pandas as pd\nimport numpy as np\n\nfrom manage_state import set_state, set_stand_state\nfrom utilities import combine_csv, concat_data, blank_filter, resolve_acc_gyro, resolve_acc_gyro_labels\nfrom rolltec_features import create_features\n\ndef combine_state_features(directory, state, window=40, stand=0):\...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
gadial/qiskit-terra
[ "0fc83f44a6e80969875c738b2cee7bc33223e45f" ]
[ "test/python/circuit/library/test_qft.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2020.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio...
[ [ "numpy.conj", "numpy.empty", "numpy.exp" ] ]
mattp256/wheele
[ "724e2df031017051085000ac49849e4bb03b69cb" ]
[ "cone_finder/scripts/cone_pose_trainer.py" ]
[ "#!/usr/bin/env python\nimport cv2\nimport numpy as np\nimport math\nimport csv\nimport rospy\nfrom sensor_msgs.msg import Image\nfrom geometry_msgs.msg import PoseStamped\nfrom std_msgs.msg import Float32\nfrom cv_bridge import CvBridge, CvBridgeError\nimport sys\nimport threading\n\nfrom dynamic_reconfigure.serve...
[ [ "numpy.sqrt", "numpy.array" ] ]
jason-sa/amazon_product_trend_classification
[ "d73b94338354bfdf1d6e83942560d0f95716ecd6" ]
[ "py_files/AmazonReviews.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom datetime import datetime, timedelta\nimport os\nimport pickle\nimport re\nfrom collections import defaultdict\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import accuracy_score, f1_score, precision_score, recall_score, confusion_matrix,...
[ [ "pandas.read_pickle", "matplotlib.pyplot.legend", "pandas.read_csv", "matplotlib.pyplot.figure", "sklearn.metrics.roc_curve", "pandas.DataFrame", "matplotlib.pyplot.xlabel", "sklearn.metrics.f1_score", "sklearn.metrics.accuracy_score", "pandas.to_datetime", "sklearn.met...
eczy/Box-World
[ "228f06d07b3cf95e29a6f49b9abec89a612e675b" ]
[ "box_world_env.py" ]
[ "import gym\nfrom gym.spaces.discrete import Discrete\nfrom gym.spaces import Box\n\nimport matplotlib.pyplot as plt\nfrom collections import deque\n\nfrom .boxworld_gen import *\n\nclass BoxWorld(gym.Env):\n \"\"\"Boxworld representation\n Args:\n n (int): Size of the field (n x n)\n goal_length (i...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.show" ] ]
nialov/fractopo
[ "a59ca168950d07e1961f1009479ce71c2aa9c2d7" ]
[ "tests/__init__.py" ]
[ "\"\"\"\nTest parameters i.e. sample data, known past errors, etc.\n\"\"\"\nfrom functools import lru_cache\nfrom pathlib import Path\nfrom traceback import print_tb\nfrom typing import List\n\nimport geopandas as gpd\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom click.testing import Result\nfrom hy...
[ [ "numpy.array", "pandas.Series" ] ]
yxnchen/SLM-Lihang-Notes
[ "8effca5f809a1b3e563661d9a2f6774ab915e37a" ]
[ "code/perceptron.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on: 2019/4/10 13:46\n\n@author: its_cyx\n\"\"\"\n\nfrom utils import load_mldata\nfrom sklearn.linear_model import Perceptron\n\nX_train, y_train, X_test, y_test = load_mldata.fetch_mnist()\n\n# 二分类:数字5和其他\ny_train_5 = (y_train == 5)\ny_train_5 = y_train_5.ravel()\ny_test_5...
[ [ "sklearn.linear_model.Perceptron" ] ]
susheels/adgcl
[ "2605ef8f980934c28d545f2556af5cc6ff48ed18" ]
[ "unsupervised/convs/wgin_conv.py" ]
[ "from typing import Callable, Union\n\nimport torch\nfrom torch import Tensor\nfrom torch_geometric.nn.conv import MessagePassing\nfrom torch_geometric.typing import OptPairTensor, Adj, Size\n\nfrom unsupervised.convs.inits import reset\n\n\nclass WGINConv(MessagePassing):\n\tdef __init__(self, nn: Callable, eps: f...
[ [ "torch.Tensor" ] ]
quangmnh/UltimaTTTBot
[ "2307a164934ac82ec318662dfe8ecb063b68e113" ]
[ "P2.py" ]
[ "# // _ooOoo_\n# // o8888888o\n# // 88\" . \"88\n# // (| -_- |)\n# // O\\ = /O\n# // ____/`---'\\____\n# // .' \\\\| |// `.\n# // / \\\\||| : |||// \\\n# // / _||||| -:- ...
[ [ "numpy.array" ] ]
miguel-mzbi/MachineLearning-DataMining
[ "d589e89c85ccc7cba129c9a489c49f61a4298c5d" ]
[ "HW3/ratingprank.py" ]
[ "# Input: number of iterations L\n# number of labels k\n# matrix X of features, with n rows (samples), d columns (features)\n# X[i,j] is the j-th feature of the i-th sample\n# vector y of labels, with n rows (samples), 1 column\n# y[i] is the label (1 or 2 ... or k) of the...
[ [ "numpy.dot", "numpy.reshape", "numpy.zeros" ] ]
rheinonen/hw_ml
[ "516f707ef2ec2b611333df1c1f94fcab4a9e8457" ]
[ "prepare_data.py" ]
[ "from boutdata.collect import collect\nfrom boututils import calculus as calc\nimport math\nimport numpy as np\nimport bout_field as bf\n\n\nphi=bf.Field(name='phi',dx=0.1)\nn=bf.Field(name='n',dx=0.1)\nvort=bf.Field(name='vort',dx=0.1)\n\nprint('collecting data')\nphi.collect()\nn.collect()\nvort.collect()\n\nprin...
[ [ "numpy.savez", "numpy.add", "numpy.divide", "numpy.repeat" ] ]
ehgh/product-rationalization
[ "42aaa8167f2981a9e2d9790ff2743310acdc3f81" ]
[ "p_q_search.py" ]
[ "import basket_completion as bc\nimport basket_generation as bg\nimport sys\nimport itertools\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport os\nimport pandas\nimport warnings\nimport pickle\nwarnings.simplefilter(action='ignore', category=FutureWarning)\n\nsys.path.insert(0, \".....
[ [ "numpy.load", "numpy.save", "numpy.set_printoptions", "matplotlib.pyplot.clf", "numpy.array" ] ]
Matej-Chmel/KVContest-data-test-suite
[ "ff6db5a16b6653a9bb85876a88451dd8b9cc8bad" ]
[ "src/common/graph.py" ]
[ "from itertools import zip_longest\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndef extract_sublist(source, idx, default=0):\n \"\"\"Return list from elements at idx for each sublist in source\n or default if such element is empty string.\n Args:\n source (list): List of sublists.\n ...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
RunzeXU/dissecting-reinforcement-learning
[ "36b418481aed016901c2da5132d44b05074929e9" ]
[ "src/assignment_multiArmedBandit/epsilon_greedy_agent_bandit_mingap.py" ]
[ "#!/usr/bin/env python\n\n# MIT License\n# Copyright (c) 2017 Massimiliano Patacchiola\n# https://mpatacchiola.github.io/blog/\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software with...
[ [ "numpy.true_divide", "numpy.zeros", "numpy.random.choice", "numpy.full", "numpy.amax", "numpy.std", "numpy.where", "numpy.random.randint", "numpy.mean" ] ]
eth-sri/transformation-smoothing
[ "12a653e881a6d61c5c63a3e16d58292435486cbd" ]
[ "util.py" ]
[ "import PIL\nimport PIL.Image\nfrom functional import compose\nimport numpy as np\nimport argparse\n\n\nlmap = compose(list, map)\n\n\ndef str2bool(v):\n if v.lower() in ('yes', 'true', 't', 'y', '1'):\n return True\n elif v.lower() in ('no', 'false', 'f', 'n', '0'):\n return False\n else:\n ...
[ [ "numpy.round", "numpy.transpose" ] ]
atlan-antillia/keras-efficientdet
[ "8dd3eccd5812063927dd32ff00a6e4164904ca76" ]
[ "losses.py" ]
[ "\"\"\"\r\nCopyright 2017-2018 Fizyr (https://fizyr.com)\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless require...
[ [ "tensorflow.keras.backend.sum", "tensorflow.keras.backend.less", "tensorflow.gather_nd", "tensorflow.keras.backend.cast_to_floatx", "tensorflow.sigmoid", "tensorflow.keras.backend.abs", "tensorflow.keras.backend.binary_crossentropy", "tensorflow.keras.backend.not_equal", "tenso...
kaitumisuuringute-keskus/quantipy3
[ "4066f22d1bda38a7082fb055d8a35bef8a7cd786" ]
[ "tests/test_link.py" ]
[ "import unittest\nimport os.path\nimport pandas as pd\n# import numpy as np\nfrom quantipy import dataframe_fix_string_types\nfrom quantipy.core.link import Link\nfrom quantipy.core.stack import Stack\nfrom quantipy.core.helpers.functions import load_json\nfrom quantipy.core.view_generators.view_maps import Quantip...
[ [ "pandas.read_csv" ] ]
xuhancn/pytorch
[ "5c7d916c3d287f6c86f4d59ca1e2b8cc4cd9cd3e" ]
[ "test/test_jit_cuda_fuser.py" ]
[ "# Owner(s): [\"oncall: jit\"]\n\nimport unittest\nimport os\nimport random\nimport enum\nimport copy\nfrom functools import reduce\nimport operator\nimport warnings\n\nimport torch\nfrom torch.nn import functional\nfrom torch.profiler import profile, ProfilerActivity\n\nfrom torch.testing._internal.codegen.random_...
[ [ "torch.cuda.manual_seed_all", "torch.cuda.manual_seed", "torch.testing._internal.common_utils.run_tests", "torch.rand", "torch.nn.functional.softmax", "torch.ops.aten.add_", "torch.softmax", "torch.jit.trace", "torch.native_layer_norm", "torch.jit._state._python_cu.drop_all...
vincent841/cameracalib
[ "94356af0bc14c61551710acbc287fba010b87e76" ]
[ "ArucoTrackerRS.py" ]
[ "import pyrealsense2 as rs\nimport numpy as np\nimport cv2\nimport cv2.aruco as aruco\nimport glob\n\ncalibFile = cv2.FileStorage(\"calibData.xml\", cv2.FILE_STORAGE_READ)\ncmnode = calibFile.getNode(\"cameraMatrix\")\nmtx = cmnode.mat()\ndcnode = calibFile.getNode(\"distCoeff\")\ndist = dcnode.mat()\n\ncriteria = ...
[ [ "numpy.all" ] ]
DraganaMana/mne-python
[ "83d48ec9e93bc176ae7fb8d000521ba3bd6b4c3c" ]
[ "mne/source_estimate.py" ]
[ "# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n# Matti Hamalainen <msh@nmr.mgh.harvard.edu>\n# Martin Luessi <mluessi@nmr.mgh.harvard.edu>\n# Mads Jensen <mje.mads@gmail.com>\n#\n# License: BSD (3-clause)\n\nimport copy\nimport os.path as op\nimport numpy as np\...
[ [ "numpy.ones", "numpy.sum", "scipy.sparse.block_diag", "scipy.spatial.distance.cdist", "numpy.intersect1d", "numpy.any", "numpy.argsort", "numpy.asarray", "numpy.insert", "numpy.vstack", "scipy.linalg.norm", "numpy.in1d", "numpy.abs", "scipy.sparse.hstack", ...
jpk2f2/CMP_SC_4650_3
[ "2b1a84557ac280c70d7e19e4fdc6677ce10745dc" ]
[ "python/filters.py" ]
[ "import numpy as np\n\n# prewitt x and y filters\nPREWITTX = np.array([[-1, 0, 1], [-1, 0, 1], [-1, 0, 1]], np.float32)\nPREWITTY = np.array([[-1, -1, -1], [0, 0, 0], [1, 1, 1]], np.float32)\n\n# Sobel x and y filters\nSOBELX = np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]], np.float32)\nSOBELY = np.array([[-1, -2, ...
[ [ "numpy.array" ] ]
mhearne-usgs/earthquake-sequence
[ "3b642a6c202894b0ea421635f0f258fa045fa271" ]
[ "sequence/seqdb.py" ]
[ "import sqlite3\nfrom collections import OrderedDict\nfrom datetime import datetime, timedelta\nimport logging\n\nimport pandas as pd\nfrom shapely.geometry import Polygon\n\nfrom impactutils.extern.openquake.geodetic import geodetic_distance\n\nEQTABLE = OrderedDict([('id', 'integer primary key'),\n ...
[ [ "pandas.read_sql_query" ] ]
NickLalo/beginners-pytorch-deep-learning
[ "491e4ec7e1faa6c274082f548e8ea5b5bd2e687c" ]
[ "chapter2/download.py" ]
[ "# download.py\n\nimport os\nimport sys\nimport urllib3\nfrom urllib.parse import urlparse\nimport pandas as pd\nimport itertools\nimport shutil\n\nfrom urllib3.util import Retry\n\nurllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\n\nclasses = [\"cat\", \"fish\"]\nset_types = [\"train\", \"test\"...
[ [ "pandas.read_csv" ] ]
dejanzelic/frigate
[ "3b04169c8b53b5653ad9b26d5bbe6313cbeff08d" ]
[ "process_clip.py" ]
[ "import sys\nimport click\nimport os\nimport datetime\nfrom unittest import TestCase, main\nfrom frigate.video import process_frames, start_or_restart_ffmpeg, capture_frames, get_frame_shape\nfrom frigate.util import DictFrameManager, EventsPerSecond, draw_box_with_label\nfrom frigate.motion import MotionDetector\n...
[ [ "numpy.zeros" ] ]
SkBlaz/supertest
[ "5d99034af820cc10c8f70271b55cc90c42328709" ]
[ "examples/example_visualization.py" ]
[ "# simple plot of a larger file\nfrom py3plex.visualization.multilayer import hairball_plot, plt\nfrom py3plex.visualization.colors import colors_default\nfrom py3plex.core import multinet\nfrom py3plex.wrappers import train_node2vec_embedding\nfrom py3plex.visualization.embedding_visualization import embedding_too...
[ [ "numpy.mean" ] ]
liangyy/haplotype-po
[ "2a6830095bcfa4298ad04ce0790888dbccd4a426" ]
[ "scripts/haplotype_imputation/impute_otf_multi_chr.py" ]
[ "##\n# Implement idea 2: multi-chromosome version\n##\n\nimport argparse\nparser = argparse.ArgumentParser(prog='impute_otf_multi_chr.py', description='''\n Impute parental origin of haplotypes and observed phenotypes.\n It takes preloaded phenotypes, covariates, and genotypes \n (generated by impute_otf_p...
[ [ "torch.set_num_threads", "numpy.load" ] ]
twmht/mmcv
[ "44e7eee835c3bc138ee0f667228777eca3db1a17" ]
[ "mmcv/runner/base_module.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport copy\nimport warnings\nfrom abc import ABCMeta\nfrom collections import defaultdict\nfrom logging import FileHandler\n\nimport torch.nn as nn\n\nfrom mmcv.runner.dist_utils import master_only\nfrom mmcv.utils.logging import get_logger, logger_initialized, pri...
[ [ "torch.nn.ModuleDict.__init__", "torch.nn.Sequential.__init__", "torch.nn.ModuleList.__init__" ] ]
Jungyhuk/plotcoder
[ "4c5fe923dc69227c58d93f55b8a89fd8bb960703" ]
[ "run.py" ]
[ "import argparse\nimport math\nimport random\nimport sys\nimport os\nimport json\nimport numpy as np\nimport time\n\nimport torch\n\nimport arguments\nimport models\nimport models.data_utils.data_utils as data_utils\nimport models.model_utils as model_utils\nfrom models.model import PlotCodeGenerator\n\ndef create_...
[ [ "torch.cuda.is_available", "numpy.random.seed" ] ]
nusc2016/lambdata-DS15
[ "b98d13d2155c741bb4fdda7f0ad74cbb12be3bb1" ]
[ "my_script.py" ]
[ "import pandas\n\ndef enlarge(n):\n return n * 100\n\nprint(\"HELLO WORLD\")\n\ndf = pandas.DataFrame({\"state\": [\"CT\", \"CO\", \"CA\", \"TX\"]})\nprint(df.head())\n\nprint(\"-----------------\")\nx = 5\nprint(\"NUMBER\", x)\nprint(\"ENLARGED NUMBER\", enlarge(x)) # invoking our function!!" ]
[ [ "pandas.DataFrame" ] ]
peipeiwang6/Genomic_prediction_in_Switchgrass
[ "1fba3508c0d81d16e0629e3cf94ff4d174a85b13" ]
[ "Other_data_processing_scripts/35_randomize.py" ]
[ "import os,sys\nimport pandas as pd\nimport numpy\nfrom numpy import random\nfrom numpy.random import shuffle\nfile = sys.argv[1]\ndf = pd.read_csv(file, sep=',', index_col = None, header = 0)\n# rowname = df.index.tolist()\n# row = shuffle(rowname)\n# df.index = rowname\nshuffle(df.ID)\ndf.to_csv(file, index=False...
[ [ "pandas.read_csv", "numpy.random.shuffle" ] ]
naternguyen/NAS_FinalExam
[ "da838b7df9615160d67092fade919e2251cf753f" ]
[ "feeders/feederBoth.py" ]
[ "import numpy as np\nimport pickle\nimport torch\nfrom torch.utils.data import Dataset\nimport sys\n\nsys.path.extend(['../'])\nfrom feeders import tools\n\n\nclass Feeder(Dataset):\n def __init__(self, data_path1, data_path2, label_path,\n random_choose=False, random_shift=False, random_move=Fal...
[ [ "numpy.load", "matplotlib.pyplot.pause", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.array", "matplotlib.pyplot.ion", "numpy.concatenate" ] ]
rohandhanraj/Auto-AI-Pipeline
[ "d5f39715c802db45afae0d5978d228bf0bcd2f0a" ]
[ "controller/project_controller/projects/WaferFaultDetection_new/best_model_finder/tuner.py" ]
[ "import uuid\n\nimport numpy\n\nimport pandas\nfrom sklearn.ensemble import RandomForestClassifier, RandomForestRegressor\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.svm import SVC, SVR\nfrom s...
[ [ "numpy.random.uniform", "sklearn.svm.SVC", "sklearn.linear_model.Ridge", "sklearn.svm.SVR", "sklearn.linear_model.LinearRegression", "sklearn.tree.DecisionTreeRegressor", "sklearn.linear_model.SGDRegressor", "sklearn.linear_model.RidgeCV", "pandas.DataFrame", "sklearn.metri...
chance-alvarado/dementia-classifier
[ "8c0d1735e072665c65c8d0bc4de32d0fa25fde87" ]
[ "resources/dementia_analysis.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Defining functions and classes for classification of dementia features.\n\nThe contents of this module define functions and classes for cleaning,\nvisualizing, and making predictions based on clinical datasets collected by\nthe Open Access Series of Imaging Studies (OASIS) project.\n...
[ [ "sklearn.svm.SVC", "sklearn.metrics.plot_roc_curve", "pandas.read_csv", "sklearn.preprocessing.MinMaxScaler", "numpy.argsort", "matplotlib.pyplot.subplots", "matplotlib.pyplot.title", "sklearn.metrics.confusion_matrix", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show",...
andrewtarzia/PoreMapper
[ "fc98324275e0e4fb3735b9a9cc4a79a34567eca2" ]
[ "pore_mapper/inflater.py" ]
[ "\"\"\"\nInflater\n========\n\n#. :class:`.Inflater`\n\nGenerator of blob guests using nonbonded interactions and growth.\n\n\"\"\"\n\nfrom __future__ import annotations\nfrom collections import abc\nimport typing\n\nimport numpy as np\nfrom copy import deepcopy\nfrom scipy.spatial.distance import cdist\n\nfrom .ho...
[ [ "scipy.spatial.distance.cdist", "numpy.argwhere", "numpy.log10", "numpy.min", "numpy.where", "numpy.linalg.norm" ] ]
DMGREENHOUSE/inference-tools
[ "4b007cdcb6ae31dad6a5edf6cb50b6a9120c27e7" ]
[ "inference/mcmc.py" ]
[ "\"\"\"\n.. moduleauthor:: Chris Bowman <chris.bowman.physics@gmail.com>\n\"\"\"\n\nimport sys\nfrom warnings import warn\nfrom copy import copy, deepcopy\nfrom multiprocessing import Process, Pipe, Event, Pool\nfrom time import time\nfrom random import choice\n\nimport matplotlib.pyplot as plt\nfrom numpy import a...
[ [ "numpy.diff", "matplotlib.pyplot.tight_layout", "numpy.random.seed", "matplotlib.pyplot.yscale", "numpy.log", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.plot", "numpy.cov", "numpy.isfinite", "matplotlib.pyplot.figure", "numpy.savez", "matplotlib.pyplot.savefig",...
acninetyfive/blokus
[ "509fc993097b9fd527005c281fb61ea97e4a55af" ]
[ "board.py" ]
[ "import numpy as np\nfrom piece import Piece\nimport time\nfrom scipy.ndimage import convolve\n\nclass Board:\n\n\tdef __init__(self, size = 20, player_colors = [1,2,3,4]):\n\t\tself.size = size\n\t\tself.board = np.zeros((size,size), dtype = int)\n\t\tself.start_squares = [[0,0], [0, size-1], [size-1, 0], [size-1,...
[ [ "numpy.argwhere", "numpy.zeros", "scipy.ndimage.convolve", "numpy.hstack", "numpy.array", "numpy.where" ] ]
aerometu/rbfopt
[ "4aba6186aa7d49c10551601d77e2484f88ffee39" ]
[ "tests/test_rbfopt_utils.py" ]
[ "\"\"\"Test the module rbfopt_utils in RBFOpt.\n\nThis module contains unit tests for the module rbfopt_utils.\n\nLicensed under Revised BSD license, see LICENSE.\n(C) Copyright International Business Machines Corporation 2016.\n\n\"\"\"\n\nfrom __future__ import print_function\nfrom __future__ import division\nfro...
[ [ "numpy.sqrt", "numpy.random.uniform", "numpy.searchsorted", "numpy.random.seed", "numpy.exp", "numpy.min", "numpy.array", "numpy.random.randint", "numpy.linalg.norm" ] ]
bgshin/rn
[ "5a0649533b5aba05556cc6f9607e28c95e3b9e55" ]
[ "keras_not_working/train.py" ]
[ "import tensorflow as tf\nimport keras.backend.tensorflow_backend as ktf\nfrom keras.callbacks import ModelCheckpoint\nfrom soclevr import load_all, Timer\nimport os\nimport argparse\nimport numpy as np\nfrom model import RN, RN2\n\n\ndef run(attempt, gpunum):\n os.environ[\"CUDA_VISIBLE_DEVICES\"] = gpunum\n ...
[ [ "tensorflow.GPUOptions", "tensorflow.ConfigProto" ] ]
diabolical-ninja/AllTheNames
[ "cdf8a181b80ee3250b76f30cd0b875368d60570c" ]
[ "src/data_collection/MatthiasWinkelmann_firstname_database.py" ]
[ "\"\"\"Firstnames Database from Github User MatthiasWinkelmann.\n\nSource:\n - https://github.com/MatthiasWinkelmann/firstname-database\n\"\"\"\nimport sys\nfrom pathlib import Path\n\nimport pandas as pd\n\nsys.path.append(str(Path(__file__).parent.parent))\n\nimport utils as ut # noqa\n\nnames_url = \"https:/...
[ [ "pandas.read_csv", "pandas.melt" ] ]
bitan1998/DSDA-PROJECT
[ "55c94f130bde487128e3b5c02d6f2c2622192766" ]
[ "KNN MODEL/knn.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n\nnames=['AGE','TB','DB','TP','Albumin','A/G','sgpt','sgot','ALKPHOS','GENDER']\ndataset=pd.read_csv(\"Indian Liver Patient Dataset.csv\")\n##||REMOVING NAN FILES AS COLLEGE GAVE BAD DATASET||##\ndataset1=dataset.dropna(subset = ['AGE','TB...
[ [ "sklearn.metrics.classification_report", "pandas.read_csv", "matplotlib.pyplot.figure", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "sklearn.metrics.confusion_matrix", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "sklearn.preprocessing.StandardScaler", "...
UKPLab/emnlp2021-hypercoref-cdcr
[ "205ebfc79d022c5db096fe218fd158a769a71415" ]
[ "hypercoref/python/common_components/commoncrawl.py" ]
[ "import pprint\nfrom datetime import datetime\n\nimport cdx_toolkit\nimport pandas as pd\nimport tqdm\nfrom typing import Optional\n\nfrom python import *\nfrom python.pipeline import GLOBAL, ComponentBase, DEVELOPMENT_MODE\n\n\nclass CommonCrawl(ComponentBase):\n TIMESTAMP_FORMAT = \"%Y%m%d%H%M%S\" # applies ...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
ciceklab/targeted_brain_tumor_margin_assessment
[ "2cf729019dfc1785992208a69c353a659c9b6448" ]
[ "train_with_your_data/scripts/cpmg/pathologic_classification/control_tumor/load_fully_quantified_cpmg_data.py" ]
[ "import pdb\r\nimport pickle\r\nimport pandas as pd\r\nimport os \r\nimport numpy as np\r\nimport sys\r\nsys.path.insert(1,\"../\")\r\nsys.path.insert(1,\"../../\")\r\nsys.path.insert(1,\"../../../\")\r\nfrom config_u import base\r\nproject_base_path = base\r\ncurrent_path = \"scripts/cpmg/pathologic_classification...
[ [ "numpy.array", "numpy.where", "numpy.divide" ] ]
awesome-archive/nball4tree
[ "62621d01671136771c6d720d19c01ea7eeef9a3f" ]
[ "nball4tree/main_training_process.py" ]
[ "import os\nimport copy\nimport time\nimport decimal\nimport operator\nimport numpy as np\nfrom distutils.dir_util import copy_tree\nfrom nball4tree.config import cgap, L0, R0, DIM, DECIMAL_PRECISION\nfrom nball4tree.util_train import get_children\nfrom nball4tree.util_vec import vec_norm, qsr_DC, qsr_DC_degree, qs...
[ [ "numpy.sqrt", "numpy.dot", "numpy.linalg.norm" ] ]
sarrouti/VQG
[ "eb9cbe3ba4f75d85fc55f5f1e746b1f2190f0b2b" ]
[ "models/encoder_cnn.py" ]
[ "\n\"\"\"\nCreated on Tue Jun 23 20:15:11 2020\n\n@author: sarroutim2\n\"\"\"\n\n\"\"\"Genearates a representation for an image input.\n\"\"\"\n\nimport torch.nn as nn\nimport torch\nimport torchvision.models as models\n\n\nclass EncoderCNN(nn.Module):\n \"\"\"Generates a representation for an image input.\n ...
[ [ "torch.nn.Linear", "torch.nn.BatchNorm1d" ] ]
zaltoprofen/chainer
[ "3b03f9afc80fd67f65d5e0395ef199e9506b6ee1" ]
[ "chainermn/communicators/_memory_utility.py" ]
[ "import ctypes\n\nimport mpi4py.MPI\nimport numpy as np\n\nimport chainer.backends\ntry:\n import cupy as cp\n _cupy_avail = True\nexcept Exception:\n _cupy_avail = False\n\n\nclass HostPinnedMemory(object):\n\n def __init__(self):\n if not _cupy_avail:\n raise RuntimeError('HostPinned...
[ [ "numpy.dtype", "numpy.frombuffer" ] ]
sjawabidgely/tensorflow
[ "f5de234d7f601214443f371e90fbadc8f128bb9a" ]
[ "tensorflow/python/eager/function.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.eager.tape.push_new_tape", "tensorflow.python.framework.ops.register_tensor_conversion_function", "tensorflow.python.eager.tape.pop_tape", "tensorflow.python.framework.errors.raise_exception_on_not_ok_status", "tensorflow.python.util.nest.flatten", "tensorflow.python.eag...
nikwitt/cdmft
[ "ebca66c760e0f6618a0b475eeeb5ace3cd229a2c" ]
[ "cdmft/operators/hubbard.py" ]
[ "import numpy as np, itertools as itt\nfrom scipy.linalg import expm, inv\nfrom pytriqs.operators import c as C, c_dag as CDag, n as N, dagger\n\nfrom cdmft.gfoperations import sum\nfrom cdmft.transformation import GfStructTransformationIndex\n\n\nclass Hubbard:\n \"\"\"\n meant as abstract class, realization...
[ [ "numpy.sqrt", "numpy.matrix", "numpy.array", "numpy.sum" ] ]
yul69-cell/HELAO
[ "a39372eb385ee93b711443d9cbd56c5ec737ff70" ]
[ "orchestrator/orchestrator_edep.py" ]
[ "import os\nimport sys\nimport time\nfrom copy import copy\nimport matplotlib.pyplot as plt\nimport numpy as np\n# from impedance.circuits import Randles, CustomCircuit\n\n\nif __package__:\n # can import directly in package mode\n print(\"importing actions from package path\")\nelse:\n # interactive kerne...
[ [ "numpy.ones", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "numpy.array", "numpy.where", "numpy.linspace", "numpy.percentile" ] ]
cclauss/CMasher
[ "8ecaadd26e8a71bf7cf3ade493aef763612ff21b" ]
[ "cmasher/colormaps/redshift/redshift.py" ]
[ "# %% IMPORTS\n# Package imports\nfrom matplotlib.cm import register_cmap\nfrom matplotlib.colors import ListedColormap\n\n# All declaration\n__all__ = ['cmap']\n\n# Author declaration\n__author__ = \"Ellert van der Velden (@1313e)\"\n\n# Package declaration\n__package__ = 'cmasher'\n\n\n# %% GLOBALS AND DEFINITION...
[ [ "matplotlib.cm.register_cmap", "matplotlib.colors.ListedColormap" ] ]
ombretta/3D-ResNets-PyTorch
[ "a5b0f092c36c5256257ba854fbc50718c35244fb" ]
[ "cluster_print_results.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Mar 30 17:00:15 2021\n\n@author: ombretta\n\"\"\"\n\nimport os\nfrom tensorboard.backend.event_processing.event_accumulator import EventAccumulator\nimport numpy as np\nfrom matplotlib import pyplot as plt\nimport json\nimport sys\n\n\ndef mai...
[ [ "numpy.max", "numpy.argmax" ] ]
lzmisscc/pytorch-image-models
[ "a32aa96d109292bfef00a631c501bd6c2bd44fdf" ]
[ "dataset_v2.py" ]
[ "import json\nimport jsonlines\nimport tqdm\nimport random\nimport re\nfrom random import shuffle\nimport PIL\nfrom PIL import Image\nimport numpy as np\nimport os.path as osp\nfrom torch.utils.data import Dataset\nimport lmdb\nimport cv2\nimport math\n\nrandom.seed(100)\nFLAG_TRAIN = True\ntrain = 'data_v3/label_e...
[ [ "numpy.frombuffer" ] ]
inmaugarc/FutureSales
[ "87ef9a3c483efcb81741e9f56d4b5634281942a0" ]
[ "training.py" ]
[ "\"\"\"\r\n This file is to train data with a machine learning model\r\n\"\"\"\r\n# Let's import libraries\r\nimport pickle\r\nimport pandas as pd\r\n\r\nfrom xgboost import XGBRegressor\r\nfrom sklearn import linear_model\r\nfrom sklearn.base import BaseEstimator, RegressorMixin\r\nfrom sklearn.model_selection ...
[ [ "sklearn.metrics.mean_squared_error", "sklearn.linear_model.Ridge", "sklearn.linear_model.LinearRegression", "pandas.concat", "sklearn.linear_model.Lasso", "sklearn.model_selection.train_test_split" ] ]
MartinJakomin/SIMF
[ "e04110ddcaed887abc58084686d00f84fdc6a8c8" ]
[ "simf/models/base.py" ]
[ "import logging\r\nimport sys\r\n\r\nimport numpy as np\r\nimport scipy.sparse as sps\r\n\r\nfrom simf.initialization import a_col, random_normal, bias_from_data, bias_zero\r\n\r\n\r\nclass BaseFactorization(object):\r\n\r\n def __init__(self, max_iter=20, epsilon=0, regularization=0.02, learning_rate=0.01, init...
[ [ "numpy.append", "scipy.sparse.issparse", "numpy.abs", "numpy.copy", "scipy.sparse.coo_matrix", "numpy.isnan", "numpy.pad", "numpy.average" ] ]
guotao0628/DeepNet
[ "1ae74d8b44d715bf67c7d64a8efafff4b7c7937a" ]
[ "edgelm/fairseq/models/text_to_speech/tts_transformer.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\r\n#\r\n# This source code is licensed under the MIT license found in the\r\n# LICENSE file in the root directory of this source tree.\r\n\r\nimport logging\r\nfrom typing import List, Optional\r\n\r\nimport torch\r\nfrom torch import nn\r\n\r\nfrom fairseq.models...
[ [ "torch.empty", "torch.nn.init.calculate_gain", "torch.ones", "torch.nn.Linear", "torch.nn.BatchNorm1d", "torch.nn.Embedding", "torch.nn.init.normal_", "torch.nn.Conv1d", "torch.nn.ReLU", "torch.zeros", "torch.cat", "torch.nn.Dropout" ] ]
sfreund-DLR/tankoh2
[ "92ff080f7034a7eb1cdabed5089c79fd01af4d11" ]
[ "src/tankoh2/control_doe.py" ]
[ "\"\"\"create DOEs and execute design workflow\n\nCaution:\nThis module requires fa_pytuils and delismm!\nPlease contatct the developers for these additional packages.\n\"\"\"\n\nimport os\nfrom collections import OrderedDict\nimport datetime\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom delismm.mode...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "numpy.array", "numpy.linspace" ] ]
Redict/rg_sound_generation
[ "6db8826d0797650bc5c1555a60cc9c6b3f82050d" ]
[ "audio_annotator/audio_annotator/create_spectrograms.py" ]
[ "import os\nimport librosa\nimport librosa.display\nimport matplotlib.pyplot as plt\n\nfrom tqdm import tqdm\n\n\ndef create_spectrograms():\n audio_dir = os.path.join('audio_annotator', 'static')\n files = [x for x in os.listdir(audio_dir) if x.lower().endswith('.wav')]\n\n for f in tqdm(files):\n ...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.close", "matplotlib.pyplot.savefig" ] ]
Code-the-Change-YYC/YW-NLP
[ "a2ff0c96f449e81998fca6fa083350cf22eac382" ]
[ "models/svm_model.py" ]
[ "import numpy as np\nfrom sklearn.pipeline import Pipeline\n\nfrom models.model import Model, ArrayLike\nfrom preprocess.report_data import ReportData\nfrom preprocess.report_data_d import ColName\n\nfrom training.description_classification.utils import load_svm, SVMPipeline\n\n\nclass SVMDescriptionClf(Model[SVMPi...
[ [ "numpy.array" ] ]
joel99/midlevel-reps
[ "f0b4a4d8ccf09a0488cd18af24723172aff99446" ]
[ "evkit/utils/viz/core.py" ]
[ "import numpy as np\nfrom skimage.transform import resize\nimport skimage\nimport torchvision.utils as tvutils\nimport torch\n\n\ndef rescale_for_display( batch, rescale=True, normalize=False ):\n '''\n Prepares network output for display by optionally rescaling from [-1,1],\n and by setting some...
[ [ "torch.zeros", "numpy.clip", "torch.cat", "numpy.array" ] ]
xbodx/DeepPavlov
[ "4b60bf162df4294b8b0db3b72786cdd699c674fa", "4b60bf162df4294b8b0db3b72786cdd699c674fa" ]
[ "deeppavlov/models/preprocessors/squad_preprocessor.py", "deeppavlov/models/morpho_tagger/cells.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" ], [ "tensorflow.keras.backend.dot", "tensorflow.keras.initializers.Constant", "tensorflow.keras.backend.softmax", "tensorflow.keras.layers.Dropout", "tensorflow.keras.backend.greater", "tensorflow.keras.backend.clip", "tensorflow.keras.backend.bias_add", "ten...
zhangbo2008/vqvae_pytorch
[ "98f2f2386328245ae26ac999528c7dda57680aca" ]
[ "dvq/data/cifar10.py" ]
[ "from torch.utils.data import DataLoader\nfrom torchvision import transforms as T\nfrom torchvision.datasets import CIFAR10\n\nimport pytorch_lightning as pl\n\nclass CIFAR10Data(pl.LightningDataModule):\n \"\"\" returns cifar-10 examples in floats in range [0,1] \"\"\"\n\n def __init__(self, args):\n ...
[ [ "torch.utils.data.DataLoader" ] ]
Xtuden-com/language
[ "70c0328968d5ffa1201c6fdecde45bbc4fec19fc" ]
[ "language/serene/training.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl...
[ [ "tensorflow.compat.v2.distribute.get_strategy", "tensorflow.compat.v2.keras.callbacks.ModelCheckpoint", "tensorflow.compat.v2.data.Dataset.from_tensor_slices", "tensorflow.compat.v2.keras.metrics.Precision", "tensorflow.compat.v2.keras.metrics.TrueNegatives", "tensorflow.compat.v2.constant...
AthKouloumvakos/sunpy
[ "686a9c455e5b725feb005b91b74ce000368f0654" ]
[ "sunpy/coordinates/frames.py" ]
[ "\"\"\"\nCommon solar physics coordinate systems.\n\nThis submodule implements various solar physics coordinate frames for use with\nthe `astropy.coordinates` module.\n\"\"\"\nfrom contextlib import contextmanager\n\nimport numpy as np\n\nimport astropy.units as u\nfrom astropy.coordinates import ConvertError, Quan...
[ [ "numpy.sqrt", "numpy.fmin", "numpy.cos", "numpy.errstate" ] ]
marinaevers/regional-correlations
[ "8ca91a5283a92e75f3d99f870c295ca580edb949" ]
[ "backend/helper/pearson.py" ]
[ "import numpy as np\nfrom joblib import Parallel, delayed\nimport multiprocessing\n\nnum_cores = multiprocessing.cpu_count()\n\n\ndef pearson_corr_distance_matrix(timelines, lag=0):\n if lag == 0:\n return np.corrcoef(timelines)\n\n def corr(timelines, timeline, lag):\n corr_mat = np.zeros((1, l...
[ [ "numpy.array", "numpy.corrcoef" ] ]
vishalbelsare/bayesian_bootstrap
[ "57a093a128ac1aaf7ff7a6cf70f6b05d684589d7" ]
[ "bayesian_bootstrap/tests/test_bootstrap.py" ]
[ "import unittest\nimport numpy as np\nimport scipy\nimport random\nimport bayesian_bootstrap.bootstrap as bb\nfrom bayesian_bootstrap.bootstrap import (\n mean,\n var,\n bayesian_bootstrap,\n central_credible_interval,\n highest_density_interval,\n BayesianBootstrapBagging,\n covar,\n)\nfrom sk...
[ [ "numpy.random.uniform", "scipy.stats.pearsonr", "numpy.var", "sklearn.linear_model.LinearRegression", "numpy.random.seed", "numpy.abs", "numpy.random.normal", "numpy.linspace", "numpy.mean" ] ]
yannick-t/probabilistic_forecasting_of_energy_time_series_using_deep_learning
[ "98a2b12270e79045b8704e9d9cc506ffadb95127" ]
[ "code/util/visualization/main_unc_forecast_visualization.py" ]
[ "from datetime import datetime\n\nimport matplotlib.pyplot as plt\nimport torch\n\nfrom evaluation.evaluate_forecasting_util import timeframe\nfrom load_forecasting.forecast_util import dataset_df_to_np\nfrom load_forecasting.post_processing import recalibrate\nfrom load_forecasting.predict import predict_transform...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplot", "torch.cuda.is_available", "torch.device" ] ]
jvario/inside_Airbnb-Athens-
[ "8abae93756d1e4388f770dfb073ec27cfc9bacbf" ]
[ "helper_functions/join_main_category.py" ]
[ "import pandas as pd\nimport collections as col\nimport numpy as np\n\n\ndef join_main_category(new_category, sub_categories, word_dict, size, data):\n '''\n this function joins sub_categories into a main category\n ==============================================================\n input:\n ...
[ [ "pandas.Series", "numpy.zeros" ] ]
mohammadbashiri/bashiri-et-al-2021
[ "c7c15ea0bf165d4d3db2ff63a04a1e78c29bf44c" ]
[ "lib/nnsysident/nnsysident/utility/data_helpers.py" ]
[ "import numpy as np\nimport torch.utils.data as utils\n\nfrom neuralpredictors.data.samplers import RepeatsBatchSampler\n\n\ndef get_oracle_dataloader(dat, toy_data=False, oracle_condition=None, verbose=False, file_tree=False):\n\n if toy_data:\n condition_hashes = dat.info.condition_hash\n else:\n ...
[ [ "torch.utils.data.DataLoader", "numpy.where", "numpy.unique" ] ]
abrahambotros/pytorch-lightning
[ "a5538af3558cf544dffd92b1b8bab3a5793f0ba0" ]
[ "tests/utilities/test_dtype_device_mixin.py" ]
[ "import pytest\nimport torch\nimport torch.nn as nn\n\nfrom pytorch_lightning import Trainer, Callback\nfrom pytorch_lightning.utilities.device_dtype_mixin import DeviceDtypeModuleMixin\nfrom tests.base import EvalModelTemplate\n\n\nclass SubSubModule(DeviceDtypeModuleMixin):\n pass\n\n\nclass SubModule(nn.Modul...
[ [ "torch.cuda.is_available", "torch.device", "torch.cuda.device_count" ] ]
charlesmackin/tiny
[ "bf8afc5cfc15e12efdd3bca0d559adfdfc435981" ]
[ "v0.5/training/anomaly_detection/eval_functions_eembc.py" ]
[ "'''\nMLCommons\ngroup: TinyMLPerf (https://github.com/mlcommons/tiny)\n\nimage classification on cifar10\n\neval_functions_eembc.py: performances evaluation functions from eembc\n\nrefs:\nhttps://github.com/SiliconLabs/platform_ml_models/blob/master/eembc/Methodology/eval_functions_eembc.py\n'''\n\nimport numpy as...
[ [ "numpy.sum", "matplotlib.pyplot.legend", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.pyplot.grid", "numpy.argmax", "matplotlib.pyplot.xlim", "numpy.arange", "matplotlib.pyplot.title", "numpy.amin", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", ...
adrianjav/lipschitz-standardization
[ "d97b9c069802ef15ff747583b42b94c0bc3e2940" ]
[ "utils/probabilistc_model.py" ]
[ "from __future__ import annotations\n\nfrom typing import List\nfrom functools import reduce\n\nimport torch\nfrom utils.distributions import get_distribution_by_name, Base\n\n\ndef _get_distributions(dists_names) -> List[Base]:\n dists = []\n\n for i, name in enumerate(dists_names):\n is_gammatrick = ...
[ [ "torch.stack", "torch.masked_select" ] ]
JGCRI/stitches
[ "a55e5801279bd153bb7bcc247422e29eecbbc209" ]
[ "stitches/make_tas_archive.py" ]
[ "# Define the functions used to get Get the weighted global mean temperature\n# from pangeo CMIP6 results.\n\n# Import packages\nimport stitches.fx_pangeo as pangeo\nimport stitches.fx_data as data\nimport stitches.fx_util as util\nimport os\nimport pkg_resources\nimport pandas as pd\n\n\ndef get_global_tas(path):\...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
i2mint/meshed
[ "4201f9efcce4f2859ffc8253811ac9335f21856b" ]
[ "meshed/makers.py" ]
[ "\"\"\"Makers\"\"\"\n\nfrom contextlib import suppress\nfrom typing import Mapping, Iterable, TypeVar, Callable\nfrom itertools import product\nfrom collections import defaultdict\n\n\nT = TypeVar('T')\n\nwith suppress(ModuleNotFoundError, ImportError):\n from numpy.random import randint, choice\n\n def rando...
[ [ "numpy.random.randint", "numpy.random.choice" ] ]
dmitryvinn/SparseConvNet
[ "0bf2476b08e688fa53abf956e4e5232793dea64c" ]
[ "sparseconvnet/denseToSparse.py" ]
[ "# Copyright 2016-present, Facebook, Inc.\n# All rights reserved.\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\nfrom torch.autograd import Function\nfrom torch.nn import Module\nfrom .utils import *\nfrom .metadata import Me...
[ [ "torch.nn.Module.__init__" ] ]
amitmate/visualwakeword
[ "24412fc830b6f579156bb1106eeffa68e90b02d4" ]
[ "EvalTFLiteModel.py" ]
[ "#!/usr/bin/env python\r\n# coding: utf-8\r\n\r\n# In[ ]:\r\n\r\n\r\nimport numpy as np\r\nimport tensorflow as tf\r\n\r\ntf.enable_eager_execution()\r\n\r\ndef eval_model(interpreter, coco_ds):\r\n total_seen = 0\r\n num_correct = 0\r\n\r\n for img, label in coco_ds:\r\n total_seen += 1\r\n interpreter.se...
[ [ "tensorflow.cast", "tensorflow.enable_eager_execution", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.lite.Interpreter" ] ]
yahu911/DMGCN2.0
[ "a0370dbbdaa756330dc6ff18b58e6f7fa44b3513" ]
[ "layer/gcn.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Oct 16\r\nKeras Implementation of Deep Multiple Graph Convolution Neural Network (DMGCN) model in:\r\nHu Yang, Wei Pan, Zhong Zhuang.\r\n@author: Hu Yang (hu.yang@cufe.edu.cn)\r\n\"\"\"\r\n\r\nfrom keras.layers import Layer\r\nfrom keras import activations, initi...
[ [ "tensorflow.cast" ] ]
moliushang/wireframe_
[ "57dd774e20740af9aadd7151d64b40cc915abb5c" ]
[ "linepx/datasets/transforms.py" ]
[ "import math\nimport numpy as np\nimport torch\nimport random\n\n# ipt is nparray with dimension (height, width, channel)\n# xml is nparray with dimension (height, width)\n\ndef addNoise(ipt, miu, std):\n noise = np.random.normal(miu, std, ipt.shape)\n noise = np.float32(noise)\n return ipt + noise\n\n\nde...
[ [ "numpy.random.normal", "numpy.fliplr", "numpy.float32" ] ]
baderex/AIArtathon
[ "e72c7ef73bbc2eb0eaf9cc906e34d801cdd13d15" ]
[ "src/projector.py" ]
[ "# Copyright (c) 2019, NVIDIA Corporation. All rights reserved.\n#\n# This work is made available under the Nvidia Source Code License-NC.\n# To view a copy of this license, visit\n# https://nvlabs.github.io/stylegan2/license.html\n\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL']='2'\nimport numpy as np\nimport tens...
[ [ "numpy.sum", "tensorflow.placeholder", "tensorflow.zeros", "numpy.tile", "tensorflow.shape", "tensorflow.reshape", "tensorflow.roll", "numpy.reshape", "tensorflow.reduce_mean", "numpy.asarray", "numpy.cos", "numpy.random.RandomState", "tensorflow.assign", "t...
tmtmaj/Exploiting-PrLM-for-NLG-tasks
[ "e8752593d3ee881cf9c0fb5ed26d26fcb02e6dd5", "e8752593d3ee881cf9c0fb5ed26d26fcb02e6dd5" ]
[ "fairseq/models/bart/hub_interface.py", "fairseq/data/denoising_dataset.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\r\n#\r\n# This source code is licensed under the MIT license found in the\r\n# LICENSE file in the root directory of this source tree.\r\n\r\nimport copy\r\nimport logging\r\n\r\nimport numpy as np\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functi...
[ [ "torch.nn.functional.log_softmax", "torch.tensor" ], [ "torch.ones", "torch.FloatTensor", "torch.distributions.Categorical", "numpy.argsort", "numpy.random.random", "torch.cumsum", "torch.arange", "torch.randperm", "torch.zeros", "torch.LongTensor", "torch.c...
lighthall-lab/nipype-legacy
[ "6c23846aa50c2ce34653f9517d95f02b071dc52d" ]
[ "nipype/pipeline/engine/tests/test_utils.py" ]
[ "# -*- coding: utf-8 -*-\n# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n\"\"\"Tests for the engine utils module\n\"\"\"\nfrom __future__ import print_function, division, unicode_literals, absolute_import\nfrom builtins import range, open\n\nimpor...
[ [ "numpy.array" ] ]
Akuchi612/keras-attention-mechanism
[ "63fc19fd8f0618da98a8122ee755d0a9e7e33a73" ]
[ "attention_lstm.py" ]
[ "from keras.layers import merge\nfrom keras.layers.core import *\nfrom keras.layers.recurrent import LSTM\nfrom keras.models import *\n\nfrom attention_utils import get_activations, get_data_recurrent\n\nINPUT_DIM = 2\nTIME_STEPS = 20\n# if True, the attention vector is shared across the input_dimensions where the ...
[ [ "matplotlib.pyplot.show", "pandas.DataFrame" ] ]
maxspahn/exotica
[ "f748a5860939b870ab522a1bd553d2fa0da56f8e" ]
[ "exotica_core/test/test_box_qp.py" ]
[ "import numpy as np\nimport pyexotica as exo\nimport unittest\nfrom numpy import testing as nptest\nfrom scipy.optimize import minimize\n\nclass TestBoxQP(unittest.TestCase):\n \"\"\"Tests BoxQP implementation against scipy.\"\"\" \n \n def test_zero_q(self):\n np.random.seed(100)\n\n # check...
[ [ "numpy.matmul", "scipy.optimize.minimize", "numpy.random.seed", "numpy.abs", "numpy.testing.assert_allclose", "numpy.random.normal", "numpy.array" ] ]
AssafZohar/eddington
[ "c67536c41a66a1f96d0aa85d5113b11b79759a7e" ]
[ "src/eddington/fit_function_class.py" ]
[ "\"\"\"Fitting function to evaluate with the fitting algorithm.\"\"\"\nimport functools\nfrom dataclasses import InitVar, dataclass, field\nfrom typing import Callable, Optional, Dict\n\nimport numpy as np\n\nfrom eddington.exceptions import FitFunctionRuntimeError\nfrom eddington.fit_functions_registry import FitF...
[ [ "numpy.insert" ] ]
itisaby/HacktoberFest2021
[ "dffeabb306082b276a9065ca318d3adc47bd6177" ]
[ "Gradient Descent/KNN Iris/Classification.py" ]
[ "from sklearn import datasets\nfrom sklearn.neighbors import KNeighborsClassifier\n\n#loading Datasets\niris = datasets.load_iris()\n\n# print(iris.DESCR)\n\nfeatures = iris.data\nlabels = iris.target\nprint(features[0], labels[0])\n\n#Training the data\nclf = KNeighborsClassifier()\n\nclf.fit(features, labels)\n\n...
[ [ "sklearn.neighbors.KNeighborsClassifier", "sklearn.datasets.load_iris" ] ]
shredEngineer/MagnetiCalc
[ "bfccb8b6ef9a4642d30b2f0639b0ab41784598ad" ]
[ "magneticalc/SamplingVolume.py" ]
[ "\"\"\" Sampling volume module. \"\"\"\n\n# ISC License\n#\n# Copyright (c) 2020–2021, Paul Wilhelm, M. Sc. <anfrage@paulwilhelm.de>\n#\n# Permission to use, copy, modify, and/or distribute this software for any\n# purpose with or without fee is hereby granted, provided that the above\n# copyright notice and t...
[ [ "numpy.ceil", "numpy.zeros", "numpy.fmod", "numpy.floor", "numpy.array", "numpy.linspace" ] ]
chunweiyuan/numpy
[ "bfe43b26969231cfe8196868280c07f0c0aa8f50" ]
[ "numpy/ma/tests/test_core.py" ]
[ "# pylint: disable-msg=W0400,W0511,W0611,W0612,W0614,R0201,E1102\n\"\"\"Tests suite for MaskedArray & subclassing.\n\n:author: Pierre Gerard-Marchant\n:contact: pierregm_at_uga_dot_edu\n\"\"\"\nfrom __future__ import division, absolute_import, print_function\n\n__author__ = \"Pierre GF Gerard-Marchant\"\n\nimport w...
[ [ "numpy.ones", "numpy.ma.core.maximum_fill_value", "numpy.multiply", "numpy.subtract", "numpy.testing.assert_equal", "numpy.ma.core.mvoid", "numpy.ma.core.ones", "numpy.asarray", "numpy.ma.core.allclose", "numpy.testing.assert_warns", "numpy.ma.core.empty", "numpy.ma...
bulletPr/label-efficient-unsupervised-learning
[ "8e320dd96dab8de97d304e0fb6550cf3ae2aa022" ]
[ "datasets.py" ]
[ "from __future__ import print_function\nimport torch.utils.data as data\nfrom PIL import Image\nimport os\nimport os.path\nimport errno\nimport torch\nimport json\nimport codecs\nimport numpy as np\nimport sys\nimport torchvision.transforms as transforms\nimport argparse\nimport json\n\n#Part Dataset\nclass PartDat...
[ [ "numpy.array", "torch.from_numpy", "numpy.loadtxt" ] ]
sumau/PredictCode
[ "e2a2d5a8fa5d83f011c33e18d4ce6ac7e1429aa8" ]
[ "tests/kernels_test.py" ]
[ "import numpy as np\nimport scipy.stats as stats\nimport scipy.linalg\nimport pytest\nimport open_cp.kernels as testmod\nimport open_cp.data\nimport unittest.mock as mock\nimport shapely.geometry\n\ndef slow_gaussian_kernel_new(pts, mean, var):\n \"\"\"Test case where `pts`, `mean`, `var` are all of shape 2.\"\"...
[ [ "numpy.sum", "numpy.diag", "numpy.asarray", "numpy.log", "numpy.abs", "numpy.testing.assert_array_equal", "numpy.cos", "numpy.empty_like", "scipy.stats.kde.gaussian_kde", "numpy.mean", "numpy.eye", "numpy.floor_divide", "numpy.arange", "numpy.std", "nump...
eduardodut/Trabalho_final_estatistica_cd
[ "fbedbbea6bdd7a79e1d62030cde0fab4e93fc338", "fbedbbea6bdd7a79e1d62030cde0fab4e93fc338" ]
[ ".history/src/Simulador_20200712191028.py", ".history/src/Simulador_20200712172903.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom Matriz_esferica import Matriz_esferica\nfrom Individuo import Individuo, Fabrica_individuo\nimport random\nfrom itertools import permutations \nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import ListedColormap\nfrom scipy.sparse import csr_matrix, lil_matri...
[ [ "numpy.zeros", "matplotlib.colors.ListedColormap", "pandas.DataFrame", "matplotlib.pyplot.show", "matplotlib.pyplot.matshow", "numpy.where" ], [ "numpy.zeros", "numpy.where", "pandas.DataFrame", "matplotlib.colors.ListedColormap" ] ]
arvindershinh/DevnagriLipi
[ "77539f2ecae68809bea5286a2113f1b723ae0a0f" ]
[ "DevnagriLipiTrainer/Archive/TensorFlow4_ConvNN - V6.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Jul 28 22:26:40 2018\n\n@author: Arvinder Shinh\n\"\"\"\nimport tensorflow as tf\nfrom PIL import Image\nimport numpy as np\nimport os\nfrom tensorflow import saved_model as sm\n\n\nimageFiles=os.listdir('image')\n\nSerializedImgContainer=[]\nLabelContainer=[]\n\nfor...
[ [ "tensorflow.summary.scalar", "tensorflow.reduce_max", "tensorflow.reshape", "tensorflow.train.Feature", "tensorflow.train.FloatList", "tensorflow.matmul", "tensorflow.name_scope", "tensorflow.summary.FileWriter", "tensorflow.nn.softmax", "tensorflow.random_normal", "ten...
google-research/ibc
[ "c2f6775418c3d7b1ffd0e822fc0050c834030d15" ]
[ "networks/layers/spectral_norm.py" ]
[ "# coding=utf-8\n# Copyright 2022 The Reach ML Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by...
[ [ "tensorflow.compat.v2.keras.initializers.RandomNormal", "tensorflow.compat.v2.keras.layers.InputSpec" ] ]
Beautyya/BenchENA
[ "776cd1dd035d73c4af369d0106d010b932f64782" ]
[ "algs/nsga_net/model/micro_encoding.py" ]
[ "# NASNet Search Space https://arxiv.org/pdf/1707.07012.pdf\n# code modified from DARTS https://github.com/quark0/darts\nimport numpy as np\nfrom collections import namedtuple\n\nimport torch\nfrom algs.nsga_net.model.micro_models import NetworkCIFAR as Network\n\nGenotype = namedtuple('Genotype', 'normal normal_co...
[ [ "torch.randn", "torch.autograd.Variable", "numpy.random.seed", "numpy.random.randint" ] ]