repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
amri369/skin-lesion-segmentation
[ "f777393cfefd9344607ac580de2b5896b60926da" ]
[ "utils/eval.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom tqdm import tqdm\n\nfrom dice_loss import dice_coeff\n\n\ndef eval_net(net, loader, device):\n \"\"\"Evaluation without the densecrf with the dice coefficient\"\"\"\n net.eval()\n mask_type = torch.float32 if net.n_classes == 1 else torch.long\n n_val...
[ [ "torch.sigmoid", "torch.nn.functional.cross_entropy", "torch.no_grad" ] ]
sixy6e/geospatial-h5
[ "09fadd92f4a054d27b9428eda9501c24e723952c" ]
[ "examples/attribute_table_example.py" ]
[ "#!/usr/bin/env python\n\nimport numpy\nfrom scipy import ndimage\nimport pandas\nfrom geoh5 import kea\nfrom geoh5.kea import common as kc\n# https://github.com/sixy6e/image-processing\nfrom image_processing.segmentation import Segments\n\n\"\"\"\nOnce completed open the file in tuiview to see the colourised segme...
[ [ "scipy.ndimage.label", "numpy.random.ranf", "pandas.DataFrame", "numpy.random.randint" ] ]
arung-northwestern/pyIsoP
[ "aed84adad302e0e576cdf089cf03030d9a4b2855" ]
[ "pyIsoP/histo.py" ]
[ "class histo:\n \n #*####### # # ####### ###### ##### # # # # ### ##### ####### ####### ##### ###### # # #\n #*# ## # # # # # # # # # # # # # # # # # # # # # # ## ##\n #*# # # # # # # # ...
[ [ "pandas.read_csv", "numpy.reshape", "numpy.isnan", "numpy.array", "numpy.histogram" ] ]
tmastny/siuba
[ "7a234bc6d03b7ad3ba6054c8899fd27ccb7f05aa" ]
[ "siuba/experimental/pd_groups/groupby.py" ]
[ "from pandas.core.groupby import DataFrameGroupBy, SeriesGroupBy\nimport inspect\nfrom pandas.core import algorithms\nimport pandas as pd\n\n\n# Custom SeriesGroupBy class ==================================================\n\nclass GroupByAgg(SeriesGroupBy):\n def __init__(self, *args, orig_grouper, orig_obj, sh...
[ [ "pandas.core.algorithms.take_1d", "pandas.Series" ] ]
yingCMU/deep-reinforcement-learning
[ "d1a9b6c5d4d310e8fdd75ff2d39003a12a1343b2" ]
[ "dqn/exercise/model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass QNetwork(nn.Module):\n \"\"\"Actor (Policy) Model.\"\"\"\n\n def __init__(self, state_size, action_size, seed):\n \"\"\"Initialize parameters and build model.\n Params\n ======\n state_size (int): Di...
[ [ "torch.nn.Linear", "torch.manual_seed" ] ]
kelvinkoh0308/addons
[ "75e847bae25fc64b5c08a26f6bc8c669cba5b169" ]
[ "tensorflow_addons/text/crf_test.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.constant", "tensorflow.test.main", "tensorflow.squeeze", "numpy.ones", "tensorflow.expand_dims", "numpy.argmax", "numpy.logaddexp.reduce", "numpy.array", "numpy.zeros", "tensorflow.reduce_logsumexp" ] ]
CHarpprecht/premise
[ "ead72ab613f083a5a11d57677d876f4ef258ccdd" ]
[ "premise/cement.py" ]
[ "import copy\nimport uuid\nimport numpy as np\nimport wurst\nfrom wurst import searching as ws\nfrom wurst import transformations as wt\nfrom .activity_maps import InventorySet\nfrom .geomap import Geomap\nfrom .utils import *\nfrom datetime import date\n\n\nclass Cement:\n \"\"\"\n Class that modifies clinke...
[ [ "numpy.nanargmax", "numpy.clip", "numpy.isnan", "numpy.nan_to_num", "numpy.nanargmin", "numpy.array", "numpy.where" ] ]
jameshgrn/ESIP_DEV
[ "5f890daabee5013ae495ed2c5da3cc028a00d094" ]
[ "fill_reference_table.py" ]
[ "# %% Section: MetaInfo\n__author__ = ['John Franey', 'Jake Gearon']\n__credits__ = ['John Franey', 'Jake Gearon', 'Earth Science Information Partners (ESIP)']\n__version__ = '1.0.0'\n__maintainer__ = 'John Franey'\n__email__ = 'franeyjohn96@gmail.com'\n__status__ = 'Development'\ndef replace_reference_id_table():\...
[ [ "pandas.concat", "pandas.read_csv" ] ]
best-of-acrv/fcos
[ "47e5624973b256b8c74ce2c00fca50e62c19c66a" ]
[ "fcos/core/modeling/rpn/retinanet/inference.py" ]
[ "import torch\r\n\r\nfrom ..inference import RPNPostProcessor\r\nfrom ..utils import permute_and_flatten\r\nfrom ....modeling.box_coder import BoxCoder\r\nfrom ....structures.bounding_box import BoxList\r\nfrom ....structures.boxlist_ops import cat_boxlist\r\nfrom ....structures.boxlist_ops import boxlist_nms\r\nfr...
[ [ "torch.nonzero", "torch.full" ] ]
timoteogb/finn-hlslib
[ "6efd5dee886ba7cc542ab69ae3c8b09d4a1ed1af" ]
[ "tb/gen_params_stmr.py" ]
[ "# Copyright (c) 2021, Xilinx, Inc.\n# All rights reserved.\n# \n# Redistribution and use in source and binary forms, with or without \n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, \n# t...
[ [ "numpy.array_split", "numpy.zeros", "numpy.hsplit", "numpy.random.choice" ] ]
markneville/CSI-Net
[ "9c78e46d9e2ff9d5813862e83879f6d88ea56e4a" ]
[ "model/resnet_upsample.py" ]
[ "import scipy.io as sio\r\nfrom torch.utils.data import TensorDataset, DataLoader\r\nimport numpy as np\r\n# from model import locNN\r\nimport torch\r\nimport torch.nn as nn\r\nfrom torch.autograd import Variable\r\nimport torch.nn.functional as F\r\nimport matplotlib.pyplot as plt\r\nimport math\r\n\r\n\r\n# 3x3 C...
[ [ "torch.nn.Sequential", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.nn.Upsample", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
tyomitch/nltk
[ "943b7bb3181118710ea4f22e0b63ce25adfffa08" ]
[ "nltk/cluster/util.py" ]
[ "# Natural Language Toolkit: Clusterer Utilities\n#\n# Copyright (C) 2001-2022 NLTK Project\n# Author: Trevor Cohn <tacohn@cs.mu.oz.au>\n# Contributor: J Richard Snape\n# URL: <https://www.nltk.org/>\n# For license information, see LICENSE.TXT\nimport copy\nfrom abc import abstractmethod\nfrom math import sqrt\nfro...
[ [ "numpy.dot", "numpy.array", "numpy.identity", "numpy.transpose" ] ]
kunde122/ERNIE1
[ "050327e968b2d7d9090ab882a5dd6b0fdeca80b4" ]
[ "ernie/finetune/sequence_label.py" ]
[ "# Copyright (c) 2019 PaddlePaddle 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 ...
[ [ "numpy.argmax", "numpy.sum" ] ]
josephcslater/python-control
[ "e080cef44e718c7c0e3a286fcc3adae405936b14" ]
[ "control/tests/statesp_test.py" ]
[ "\"\"\"statesp_test.py - test state space class\n\nRMM, 30 Mar 2011 based on TestStateSp from v0.4a)\nRMM, 14 Jun 2019 statesp_array_test.py coverted from statesp_test.py to test\n with use_numpy_matrix(False)\nBG, 26 Jul 2020 merge statesp_array_test.py differences into statesp_test.py\n ...
[ [ "numpy.diag", "numpy.dot", "numpy.matrix", "numpy.exp", "numpy.testing.assert_equal", "numpy.eye", "numpy.testing.assert_almost_equal", "numpy.zeros", "numpy.testing.assert_array_almost_equal", "numpy.full_like", "scipy.linalg.eigvals", "numpy.testing.assert_allclos...
Skeftical/SuRF-Reproducibility
[ "589096b2caa4f173a00f617dd083a042e7b27f5b" ]
[ "codebase/query_generation.py" ]
[ "from pathlib import Path\nimport numpy as np\nimport os\nimport sys\nimport itertools\nfrom pathlib import Path\nimport logging\nlogging.basicConfig(stream=sys.stdout, level=logging.DEBUG,)\nlogger = logging.getLogger(\"__main__\")\ndef generate_boolean_vector(f,q,r,DIMS):\n \"\"\"\n Generate boolean vector ...
[ [ "numpy.linspace", "numpy.ones", "numpy.identity", "numpy.mean", "numpy.random.uniform", "numpy.array", "numpy.loadtxt" ] ]
Milozms/OpenNRE
[ "93dc39823645bfebcfb562dd734528dc5c3ce12f" ]
[ "dev.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport time\nimport datetime\nimport os\nimport network\nimport json\nfrom sklearn.metrics import average_precision_score\nimport sys\n\ntf.app.flags.DEFINE_string('export_path','./data/KBP/','path to data')\n\n# config_file = open(os.path.join('data', \"config\"), 'r')...
[ [ "tensorflow.app.flags.DEFINE_string", "tensorflow.app.flags.DEFINE_integer", "tensorflow.app.flags.DEFINE_float", "tensorflow.app.run" ] ]
EmmmmmBoom/KOPRA
[ "2e1ec412b11c709adc01898dfade9315b494e719" ]
[ "code/model.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nimport torch.optim as optim\r\nimport dgl\r\nimport math\r\nfrom torch.utils.data import DataLoader\r\n\r\n\r\nclass GATLayer(nn.Module):\r\n def __init__(self, in_dim, out_dim, device):\r\n super(GATLayer, self).__init__()\r\n ...
[ [ "torch.nn.MarginRankingLoss", "torch.nn.functional.softmax", "torch.nn.Dropout", "torch.cat", "torch.sum", "torch.nn.Embedding", "torch.tensor", "torch.nn.Linear", "torch.matmul", "torch.bmm", "torch.nn.functional.leaky_relu", "torch.where", "torch.full_like" ...
zamanianlab/polyAudit
[ "040088703e40b207faa4abb7197d0f38e28bf924" ]
[ "polyAudit.py" ]
[ "import sys\nimport argparse\nimport pathlib\nfrom Bio import SeqIO\nfrom Bio import AlignIO\nfrom Bio.Align import AlignInfo\nimport csv\nimport pandas as pd\n\n\ndef primertrim(records, primers, output):\n # remove PacBio primers\n trimmed_records = []\n with open(primers) as primer_file:\n primer...
[ [ "pandas.read_csv", "pandas.DataFrame.from_dict" ] ]
antorsae/fMoW
[ "39c99dad6045282f89593803baa8c9457cbf3ec0" ]
[ "code/data_ml_functions/dataFunctions.py" ]
[ "\"\"\"\r\nCopyright 2017 The Johns Hopkins University Applied Physics Laboratory LLC\r\nand Andres Torrubia\r\nAll rights reserved.\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...
[ [ "numpy.unique", "numpy.asarray", "numpy.clip", "numpy.float32", "numpy.array", "numpy.zeros" ] ]
ludwigschwardt/katbeam
[ "9e4dbb4c1218b4b33f046a853d80dcc42c447855" ]
[ "tests/test_jimbeam.py" ]
[ "import pytest\nimport numpy as np\nimport matplotlib\n# Enforce a non-interactive Matplotlib backend\nmatplotlib.use('agg')\nimport matplotlib.pylab as plt # noqa: E402\n\nfrom katbeam import JimBeam # noqa: E402\n\n\ndef test_unknown_model_name():\n with pytest.raises(ValueError):\n JimBeam('MKAT-AA-U...
[ [ "matplotlib.use", "numpy.meshgrid", "matplotlib.pylab.subplots", "numpy.linspace" ] ]
dalonlobo/textsplit
[ "edbdd7b640b71f777065e312eccd684cc21fcee6" ]
[ "tests/test_textsplit.py" ]
[ "import unittest\nimport numpy as np\nfrom ..algorithm import split_greedy, split_optimal, get_total, get_gains\nfrom ..tools import get_penalty, P_k\n\nDIM = 20\n\ndef getDoc(segment_len, n_seg):\n return np.vstack([np.tile(w, (segment_len, 1))\n for w in np.random.random((n_seg, DIM))])\n\...
[ [ "numpy.random.random", "numpy.min", "numpy.tile", "numpy.percentile", "numpy.diff", "numpy.isclose" ] ]
MarcoMiretti/scikit-fuzzy
[ "4c3aebd4f187887e6ffe04f35bfbaf4d42da4491" ]
[ "skfuzzy/fuzzymath/fuzzy_ops.py" ]
[ "\"\"\"\nfuzzy_ops.py : Package of general operations on fuzzy sets, fuzzy membership\n functions, and their associated universe variables.\n\"\"\"\n\nfrom __future__ import division, print_function\nimport numpy as np\n\n\ndef cartadd(x, y):\n \"\"\"\n Cartesian addition of fuzzy membership vec...
[ [ "numpy.asarray", "numpy.zeros_like", "numpy.exp", "numpy.where", "numpy.hstack", "numpy.ones_like", "numpy.diff", "numpy.interp", "numpy.zeros", "numpy.log", "numpy.nonzero", "numpy.atleast_2d", "numpy.delete", "numpy.fmax", "numpy.argsort", "numpy.m...
mchaker/lab-molpal
[ "f4db7ee2ca51515b4246604867a93a3aac08107d" ]
[ "scripts/fingerprints.py" ]
[ "import argparse\nimport csv\nfrom functools import partial\nimport gzip\nfrom itertools import chain, islice\nimport os\nfrom pathlib import Path\nimport sys\nfrom typing import Iterable, Iterator, List, Optional, Set, Tuple\n\nimport h5py\nimport numpy as np\nimport ray\nfrom rdkit import Chem, DataStructs\nfrom ...
[ [ "numpy.vstack" ] ]
beegieb/MultiArmedBandits
[ "0ff3b0f45281d8819ae3c2f1086a7cd9626c225f" ]
[ "algorithms.py" ]
[ "from __future__ import division\nfrom scipy import random, exp, log, sqrt, argmax, array, stats\n\nTINY = 1e-6\n\n\nclass BaseBandit(object):\n \"\"\"\n Baseclass for Bandit Algorithms. This is intended to be inherited by other Bandits to provide core functions.\n\n The BaseBandit takes care of basic init...
[ [ "scipy.random.multinomial", "scipy.log", "scipy.argmax", "scipy.stats.beta", "scipy.sqrt", "scipy.random.beta", "scipy.random.randn", "scipy.random.choice", "scipy.array", "scipy.random.dirichlet", "scipy.random.rand" ] ]
fsx950223/TensorRT
[ "ab20a8ac26da03df5e434b4f9d1da0156ca019b6" ]
[ "samples/python/uff_custom_plugin/model.py" ]
[ "#\n# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "tensorflow.logging.set_verbosity" ] ]
jiansfoggy/16-720B
[ "6395555449fa297f19efb42970e480f1b382e38a" ]
[ "HW3/code/InverseCompositionAffine.py" ]
[ "import numpy as np\nfrom scipy.interpolate import RectBivariateSpline\n\ndef validate_coords(y, x, ny, nx):\n\ta = np.logical_and(np.logical_and(x>=0, x<=nx-1), np.logical_and(y>=0, y<=ny-1))\n\treturn a.nonzero()[0]\n\ndef InverseCompositionAffine(It, It1):\n\t# Input: \n\t#\tIt: template image\n\t#\tIt1: Current...
[ [ "numpy.hstack", "scipy.interpolate.RectBivariateSpline", "numpy.meshgrid", "numpy.gradient", "numpy.reshape", "numpy.arange", "numpy.logical_and", "numpy.multiply", "numpy.matmul", "numpy.linalg.norm", "numpy.ones", "numpy.linalg.lstsq", "numpy.array" ] ]
marlohmann/allenact
[ "f29dd6f0ec62425b02ca07fee815b1a82627a28e" ]
[ "projects/tutorials/babyai_go_to_local_bc_offpolicy.py" ]
[ "import os\nfrom typing import Optional, List, Tuple\n\nimport torch\nfrom gym_minigrid.minigrid import MiniGridEnv\n\nfrom plugins.babyai_plugin.babyai_constants import BABYAI_EXPERT_TRAJECTORIES_DIR\nfrom plugins.minigrid_plugin.minigrid_offpolicy import (\n MiniGridOffPolicyExpertCELoss,\n create_minigrid_...
[ [ "torch.cuda.is_available" ] ]
WadhwaniAI/utilities
[ "3ca351302d8381926ef562e52f6454a2ea230cac" ]
[ "utilities/viz.py" ]
[ "import numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport matplotlib\nmatplotlib.use('Agg')\nfrom sklearn.metrics import classification_report\n\ndef gt_vs_pred(targets, predictions):\n sorted_ind = np.argsort(targets)\n targets = targets[sorted_ind]\n predict...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.scatter", "matplotlib.use", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "pandas.DataFrame.from_dict", "numpy.argsort", "numpy.array", "sklearn.metrics.classification_report", "matplotli...
Chappie733/Polynomial-Neural-Network-comparison
[ "550a91ee3c6ea4cdd16bfee0fddc277c038b9166" ]
[ "PolLayer.py" ]
[ "import numpy as np\r\nimport random\r\n\r\nMAX_INITIAL_WEIGHT = -1\r\nMIN_INITIAL_WEIGHT = 1\r\n\r\nMAX_INITIAL_BIAS = -1\r\nMIN_INITIAL_BIAS = 1\r\n\r\nMAX_INITIAL_EXP = 1\r\nMIN_INITIAL_EXP = 1\r\n\r\ndef norm(x):\r\n\treturn 1 if x>= 0 else -1\r\n\r\ndef np_pow(a, b):\r\n\treturn np.sign(a) * (np.abs(a) ** b)\r...
[ [ "numpy.sign", "numpy.exp", "numpy.abs" ] ]
aktgpt/brevis
[ "0c3dcabd241ea50cafbc2012250804e1ecb7555e" ]
[ "brevis/test/lupi_tester.py" ]
[ "import os\nimport random\n\nimport cv2\nimport numpy as np\nimport pandas as pd\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom skimage.metrics import structural_similarity as ssim\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data.sampler import WeightedRandomSampler...
[ [ "numpy.minimum", "torch.cat", "torch.utils.data.DataLoader", "torch.sum", "pandas.DataFrame", "torch.no_grad", "numpy.mean", "torch.logical_and", "torch.nn.L1Loss", "numpy.square", "numpy.arange", "torch.from_numpy", "numpy.std", "torch.mul", "numpy.zero...
shkarupa-alex/tfswin
[ "ba9f5c8bb4848bb07da1758eb3b22c2d86df8607" ]
[ "tfswin/tests/test_winatt.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom keras import keras_parameterized, layers\nfrom keras.utils.generic_utils import register_keras_serializable\nfrom tfswin.winatt import WindowAttention\nfrom testing_utils import layer_multi_io_test\n\n\n@register_keras_serializable('TFSwin')\nclass WindowAttentionS...
[ [ "numpy.array", "tensorflow.squeeze", "numpy.random.random", "tensorflow.test.main" ] ]
ekzhu/nserc-subjects
[ "2964715bdb1cd5ab07e18f7c09f8ad73e25ab00a" ]
[ "mlp.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom sklearn.utils import shuffle\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer\nfrom sklearn.naive_bayes import MultinomialNB\nfrom sklearn.linear_model import SGDClassifier\nfrom sklearn.pipe...
[ [ "pandas.concat", "pandas.read_csv", "pandas.notnull", "sklearn.utils.shuffle", "numpy.max", "sklearn.preprocessing.LabelEncoder" ] ]
janfrancu/gnn-model-explainer
[ "2f86bad871594842b68f47b9ede51180c645c47a" ]
[ "generate_synth_graphs.py" ]
[ "import os\nimport numpy as np\nimport gengraph\nimport utils.featgen as featgen\nimport json\n\nfrom networkx.readwrite import json_graph, write_gexf\n\n\ndef syn_task1(input_dim=10, seed=0):\n return gengraph.gen_syn1(\n feature_generator=featgen.ConstFeatureGen(np.ones(input_dim, dtype=float)), seed=seed...
[ [ "numpy.array", "numpy.random.default_rng", "numpy.ones" ] ]
cj-mclaughlin/SuperPoint
[ "3806a1dfb4e95b1cc0ad27ef95c40877f35633dc" ]
[ "superpoint/experiment.py" ]
[ "import logging\nimport yaml\nimport os\nimport argparse\nimport numpy as np\nfrom contextlib import contextmanager\nfrom json import dumps as pprint\n\nfrom superpoint.datasets import get_dataset\nfrom superpoint.models import get_model\nfrom superpoint.utils.stdout_capturing import capture_outputs\nfrom superpoin...
[ [ "tensorflow.compat.v1.set_random_seed", "tensorflow.compat.v1.reset_default_graph", "numpy.random.seed", "tensorflow.compat.v1.disable_v2_behavior" ] ]
forki/Labs
[ "403ee5e05fcd280bf8123b874a7e9bb2b6dc390c" ]
[ "RegressionLab/RegressionLab/regression.py" ]
[ "'''\nThis script perfoms the basic process for applying a machine learning\nalgorithm to a dataset using Python libraries.\n\nThe four steps are:\n 1. Download a dataset (using pandas)\n 2. Process the numeric data (using numpy)\n 3. Train and evaluate learners (using scikit-learn)\n 4. Plot and compare re...
[ [ "sklearn.cross_validation.train_test_split", "sklearn.svm.SVR", "pandas.read_table", "matplotlib.pyplot.close", "sklearn.preprocessing.MinMaxScaler", "sklearn.preprocessing.StandardScaler", "numpy.array", "matplotlib.pyplot.show" ] ]
Youngermaster/Scikit-Learn-Platzi
[ "299b3bf8af106cb8e99ffe6b9e953a3948532599" ]
[ "regularization.py" ]
[ "import pandas as pd\nimport sklearn\n\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.linear_model import Lasso\nfrom sklearn.linear_model import Ridge\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import mean_squared_error\n\nif __name__ == \"__main__\":\n datas...
[ [ "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.linear_model.Lasso", "sklearn.metrics.mean_squared_error", "sklearn.linear_model.Ridge", "sklearn.linear_model.LinearRegression" ] ]
tansyab1/LightNetPlus
[ "ed226e5454b2144063a6d8132b07c90e6a64e2d3" ]
[ "modules/dropout.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom torch import nn\n\n\nclass DropBlock2D(nn.Module):\n r\"\"\"Randomly zeroes spatial blocks of the input tensor.\n As described in the paper\n `DropBlock: A regularization method for convolutional networks`_ ,\n dropping whole blocks of feature map all...
[ [ "torch.set_printoptions", "torch.ones", "torch.ones_like" ] ]
yaoyiran/ContrastiveBLI
[ "9df31a66ffd9c6eea60c94b7e224e759ab6628c3" ]
[ "C2/src/data_loader.py" ]
[ "import re\nimport os\nimport glob\nimport numpy as np\nimport random\nimport pandas as pd\nimport json\nfrom torch.utils.data import Dataset\nimport logging\nfrom tqdm import tqdm\nimport torch\nLOGGER = logging.getLogger(__name__)\n\n\n\ndef erase_and_mask(s, erase_len=5):\n if len(s) <= erase_len: return s\n ...
[ [ "numpy.load" ] ]
Samuel-Nathanson/LeagueMusicPlayer
[ "4a6b45cd4d31a677b71e4e5297498ebd4a71bc15" ]
[ "sample.py" ]
[ "from riotwatcher import LolWatcher, ApiError\nimport pandas as pd\n\n# global variables \napi_key = 'RGAPI-7a2dab8c-d30a-4b75-a7bc-db7eb25dcf31'\n\nwatcher = LolWatcher(api_key)\nmy_region = 'na1'\n\nsummoner_names = ['jnw309', 'cadoo29', 'yolobadger', 'SI0N', 'Fr33 Smoke']\nsummoners = []\n\n# Max 100 Requests ev...
[ [ "pandas.DataFrame" ] ]
ErikGartner/actor
[ "a2d10671600088019cd1e14607dfb00eb71c4853" ]
[ "dataset/openpose-caffe/cache_panoptic.py" ]
[ "# From Python\n# It requires OpenCV installed for Python and OpenPose built with Python API support.\n# Tested for OpenPose ~1.4.0\nimport argparse\nimport glob\nimport json\nimport os\nimport sys\nimport time\nfrom sys import platform\n\nimport cv2\n\nimport matplotlib.pyplot as plt\nfrom scipy.io import savemat\...
[ [ "numpy.array", "scipy.io.savemat" ] ]
YosefLab/Cassiopeia
[ "010072b307f7eadbf10dc4af8b2165e48f1736a7" ]
[ "cassiopeia/solver/ILPSolver.py" ]
[ "\"\"\"\nImplements the Cassiopeia-ILP solver, as described in Jones et al, Genome Biol\n2020. Briefly, this algorithm infers the maximum parsimony tree by solving for\na Steiner Tree over an inferred potential graph of potential intermediate\nevolutionary states.\n\"\"\"\nimport datetime\nimport logging\nimport ti...
[ [ "numpy.array" ] ]
DomnenkoB/Hybrid-Search-Engine
[ "955e559f66723249d8810bb0ecbefd3de571dee0" ]
[ "hybrid_search_engine/index.py" ]
[ "from collections import defaultdict\n\nimport numpy as np\nimport pandas as pd\nfrom nltk import word_tokenize\n\nfrom hybrid_search_engine import nlp_engine\nimport hybrid_search_engine.utils.text_processing as processing\n\n\ndef build_index_from_df(df: pd.DataFrame, columns, id_column, filtering_columns=[], min...
[ [ "pandas.concat", "numpy.sqrt", "numpy.linalg.norm", "pandas.DataFrame", "pandas.isna", "numpy.array", "numpy.zeros" ] ]
mhamaneamogh50/All_Python_Pro
[ "e943d1924f160a98e5df612b920a67ef80be3b61" ]
[ "matplotlib_1.py" ]
[ "import matplotlib.pyplot as plt\r\n#plt.plot([1,2,3,4],[4,8,6,1],'-o') #adding dot and line\r\n#plt.plot([5,6,7,8],'-go') #addind red and dot line\r\n#plt.plot([9,10,11,12],'-ro')\r\n#plt.title(\"Design by amogh\")\r\n#fig, ax = plt.subplots() # Create a figure containing a single axes.\r\n#ax.plot([1, 2, 3, 4], ...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ] ]
Sandbergo/learn2branch
[ "a77ef5a22405484ca94181add6aa23297b30e9e7" ]
[ "11_analyze_data.py" ]
[ "\"\"\"\nAnalyze features of the generated problems.\n\"\"\"\nimport os\nimport sys\nimport importlib\nimport gzip\nimport argparse\nimport csv\nimport math\nimport numpy as np\nimport pandas as pd\nimport time\nimport pickle\nimport pathlib\nimport torch\n\n# import utilities\nfrom utilities_mlp import MLPDataset ...
[ [ "torch.device", "numpy.random.RandomState", "torch.utils.data.DataLoader", "numpy.where" ] ]
calemen/permafrostanalytics
[ "31428bb7b4c0fc20ec06e1c472867542e506d8f5" ]
[ "ideas/eternal_sunshine/christian/train.py" ]
[ "#!/usr/bin/env python3\n# Copyright 2019 Christian Henning\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.random.seed", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.cuda.is_available", "torch.cuda.manual_seed_all", "torch.device" ] ]
db-bionlp/CLNER
[ "d8ddc6dbee17251622584b894dbb5765850b0add" ]
[ "flair/trainers/old_kd_trainer.py" ]
[ "from .trainer import *\nfrom flair.training_utils import store_teacher_predictions\nfrom flair.list_data import ListCorpus\nimport math\nimport random\nimport pdb\nimport copy\nfrom flair.datasets import CoupleDataset\nfrom ..custom_data_loader import ColumnDataLoader\nfrom torch.optim.adam import Adam\nimport tor...
[ [ "torch.nn.functional.softmax", "torch.utils.tensorboard.SummaryWriter" ] ]
humlab-unesco/unesco_data_collection
[ "7c49b8c61e52007f507a426582e164c82c7fe67d" ]
[ "tests/courier/overlap_check_test.py" ]
[ "from io import StringIO\nfrom pathlib import Path\nfrom tempfile import TemporaryDirectory\n\nimport pandas as pd\nimport pytest\n\nfrom courier.config import get_config\nfrom courier.overlap_check import (\n get_articles_with_overlap_of_two_or_more_other_articles,\n get_overlapping_pages,\n save_overlapp...
[ [ "pandas.read_csv" ] ]
CrepeGoat/FEHnt
[ "4d728c3022ce320a374edfbdc5d23b4482b62e21" ]
[ "static_frame/core/index_level.py" ]
[ "\n\nimport typing as tp\nfrom collections import deque\n\nimport numpy as np\n\nfrom static_frame.core.hloc import HLoc\nfrom static_frame.core.index import Index\nfrom static_frame.core.index import ILoc\nfrom static_frame.core.index import IndexGO\nfrom static_frame.core.array_go import ArrayGO\n\nfrom static_fr...
[ [ "numpy.empty" ] ]
akash-harijan/cataract-detection
[ "ccb7045290a7a002bba1ff68220d19ec3a79ea2d" ]
[ "src/models/predict_model.py" ]
[ "import tensorflow as tf\nfrom tensorflow import keras\nimport cv2\n\n\nif __name__ == \"__main__\":\n\n import os\n print(os.getcwd())\n\n model = keras.models.load_model('./../../models/final-700imgs.h5')\n img = cv2.imread('./../../data/external/Test/cataract/img315.jpeg')\n resized = cv2.resize(i...
[ [ "tensorflow.keras.models.load_model" ] ]
wangjiehui11235/ultron
[ "ade46fdcff7eaf01187cdf9b9fb1d6a04ae972b7" ]
[ "ultron/factor/combine/kutil.py" ]
[ "# -*- coding: utf-8 -*-\nimport pandas as pd\ndef calc_ic(factor_df, return_df, factor_list, return_col_name='target_return', ic_type='spearman'):\n \"\"\"\n 计算因子IC值, 本月和下月因子值的秩相关\n params:\n factor_df: DataFrame, columns=['ticker', 'tradeDate', factor_list]\n return_df: DataFrame, c...
[ [ "pandas.concat" ] ]
Datamuseum-DK/R1000.HwDoc
[ "cb0841540a4ac184a08957daac1a470b6916a663" ]
[ "ImageProcessing/schematics.py" ]
[ "#!/usr/local/bin/python3\n#\n# Copyright (c) 2021 Poul-Henning Kamp\n# All rights reserved.\n#\n# Author: Poul-Henning Kamp <phk@phk.freebsd.dk>\n#\n# SPDX-License-Identifier: BSD-2-Clause\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the foll...
[ [ "numpy.amin", "numpy.amax", "numpy.array", "numpy.zeros" ] ]
willianfco/shap
[ "895a796b20cb2ab6b158a4cd4326d8f4d00ca615" ]
[ "shap/explainers/_kernel.py" ]
[ "from ..utils._legacy import convert_to_instance, convert_to_model, match_instance_to_data, match_model_to_data\nfrom ..utils._legacy import convert_to_instance_with_index, convert_to_link, IdentityLink, convert_to_data, DenseData, SparseData\nfrom ..utils import safe_isinstance\nfrom scipy.special import binom\nfr...
[ [ "numpy.sqrt", "numpy.squeeze", "pandas.DataFrame", "numpy.concatenate", "numpy.hstack", "scipy.sparse.issparse", "numpy.reshape", "numpy.arange", "scipy.sparse.isspmatrix_lil", "numpy.frompyfunc", "sklearn.linear_model.lars_path", "sklearn.linear_model.Lasso", "...
supercatex/ML_Turtorial
[ "d84d62e3bf55fcbaa5bfd90e2df929c87cfb4cdc" ]
[ "dataset/main.py" ]
[ "import os\nimport cv2\nimport numpy as np\n\n\n_INPUT_DIR = \"./images/\"\n_OUTPUT_DIR = \"./output/\"\n_TEST_DIR = \"./test/\"\n_NUM_OF_SAMPLES = 3000\n_SAMPLE_SIZE = (100, 100)\n\n\ndef add_noise(img):\n h, w, c = img.shape\n if c != 4:\n raise Exception(\"Only PNG format supported!\")\n\n dst = ...
[ [ "numpy.random.choice", "numpy.array", "numpy.float32", "numpy.random.randint" ] ]
rontho1992/election_feed
[ "5987a388e23bff33cf37a2923d21dcac5075adbb" ]
[ "parappa/strategies.py" ]
[ "from datetime import datetime as dt\nimport pandas as pd\nimport csv\n\nclass ElectionStrategies:\n\n def __init(self):\n pass\n\n def ap_init(self,state, results, party):\n no_fips = [\"NH\"]\n fips = [\"IA\",\"SC\",\"NV\"]\n self.state = state\n\n if self.state in no_fips...
[ [ "pandas.read_csv" ] ]
NISystemsEngineering/rpyc-rfmx-remoting
[ "b90c7b84a61a7d063680bcc692bc8c32374291dd" ]
[ "rpyc/client/RFmxNRULModAccSingleCarrier.py" ]
[ "# DEMO EXAMPLE: Client side execution of RFmx NR on a remote server\r\nfrom pathlib import PureWindowsPath\r\nimport rpyc.utils.classic\r\nfrom matplotlib import pyplot\r\n\r\n# # # # # User Parameters # # # # # #\r\nhost_name = 'semoore-pxi' # Name or IP address of the RPyC server\r\nhost_port = 18...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
S-Manglik/gs-quant
[ "af22aa8574571db45ddc2a9627d25a26bd00e09b" ]
[ "gs_quant/timeseries/econometrics.py" ]
[ "# Copyright 2018 Goldman Sachs.\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to in wr...
[ [ "pandas.Series", "numpy.cov", "numpy.var", "numpy.array", "numpy.empty" ] ]
SimplisticCode/ODA-ML
[ "2c66bd7b8cb0d98dd9606a8a5439606b832f56bf" ]
[ "NearestCentroid.py" ]
[ "from collections import defaultdict\nimport numpy as np\nfrom numpy import sort\n\n\nclass NearestCentroid():\n def __init__(self):\n self.centroids = None\n\n def fit(self, X, y):\n subrows = defaultdict(list)\n for i in range(len(y)):\n # Collect indices of exemplars for the...
[ [ "numpy.linalg.norm" ] ]
datduong/pytorch-image-models
[ "05c9b52ca65b01e57f8cea2b6447882488aba4f6" ]
[ "validate.py" ]
[ "#!/usr/bin/env python\n\"\"\" ImageNet Validation Script\n\nThis is intended to be a lean and easily modifiable ImageNet validation script for evaluating pretrained\nmodels or training checkpoints against ImageNet or similarly organized image datasets. It prioritizes\ncanonical PyTorch, standard Python style, and ...
[ [ "torch.jit.script", "torch.nn.CrossEntropyLoss", "torch.jit.optimized_execution", "torch.randn", "torch.cuda.empty_cache", "torch.no_grad" ] ]
yx9527/insightface
[ "4eae1d4e0d4232789df1968d099cd6219752a4a3" ]
[ "detection/scrfd/mmdet/datasets/retinaface.py" ]
[ "import itertools\nimport logging\nimport os.path as osp\nimport tempfile\nfrom collections import OrderedDict\n\nimport mmcv\nimport numpy as np\nfrom mmcv.utils import print_log\nfrom terminaltables import AsciiTable\n\nfrom mmdet.core import eval_recalls\nfrom .builder import DATASETS\nfrom .custom import Custom...
[ [ "numpy.array", "numpy.zeros" ] ]
Octave-byte/pAPY
[ "cb077aeb49228262daa4c53da9dc88d0ab89d2a2" ]
[ "script_supabase_stat_apy.py" ]
[ "# -*- coding: utf-8 -*-\r\n\r\n# Import the os module\r\nimport os\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom datetime import date\r\nimport requests\r\nfrom pandas import json_normalize \r\nimport uuid\r\n\r\n###############\r\n## Data prep\r\n###############\r\n\r\nr = requests.get('https://iunmfujgowt...
[ [ "pandas.merge", "pandas.json_normalize" ] ]
jonathanjameswatson/kivygames
[ "7636580956562af0814c973f94afede926cfa4b9" ]
[ "kivygames/games/noughtsandcrosses/__init__.py" ]
[ "import numpy as np\n\nfrom kivygames.games import Game\n\nimport kivygames.games.noughtsandcrosses.c as c\n\n\nclass CellOccupiedError(Exception):\n pass\n\n\nclass NoughtsAndCrosses(Game):\n minPlayers = 2\n maxPlayers = 2\n hasAI = True\n\n gridShape = (3, 3)\n\n def __init__(self):\n Ga...
[ [ "numpy.zeros", "numpy.count_nonzero" ] ]
buzmakov/tography_scripts
[ "1551cbe033bce61cb8d52c8a855b3071c67367a8" ]
[ "misc/epif_stones.py" ]
[ "# ---\n# jupyter:\n# jupytext:\n# formats: ipynb,py:percent\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.2'\n# jupytext_version: 1.2.4\n# kernelspec:\n# display_name: Python 3\n# language: python\n# name: python3\n# ---\n\n#...
[ [ "numpy.power", "numpy.asarray", "numpy.median", "numpy.linalg.norm", "numpy.percentile", "numpy.ones", "scipy.ndimage.label", "numpy.max", "numpy.std", "numpy.mean", "numpy.ndindex", "numpy.histogram", "numpy.zeros", "scipy.ndimage.morphology.distance_transf...
paulolimac/Copulas
[ "26d700b5cf203d1e71e50bb86b9c3dd6f25dfe1a" ]
[ "copulas/bivariate/clayton.py" ]
[ "import numpy as np\n\nfrom copulas.bivariate.base import Bivariate, CopulaTypes\n\n\nclass Clayton(Bivariate):\n \"\"\"Class for clayton copula model.\"\"\"\n\n copula_type = CopulaTypes.CLAYTON\n theta_interval = [-1, float('inf')]\n invalid_thetas = [0]\n\n def generator(self, t):\n \"\"\"R...
[ [ "numpy.zeros", "numpy.multiply", "numpy.power" ] ]
Tevien/bryolo
[ "05d15ff0eab936e085f7339616e2874032c6c935" ]
[ "utils/datasets.py" ]
[ "# YOLOv5 dataset utils and dataloaders\n\nimport glob\nimport hashlib\nimport json\nimport logging\nimport os\nimport random\nimport shutil\nimport time\nfrom itertools import repeat\nfrom multiprocessing.pool import ThreadPool, Pool\nfrom pathlib import Path\nfrom threading import Thread\n\nimport cv2\nimport num...
[ [ "torch.zeros", "torch.cat", "numpy.flipud", "numpy.concatenate", "numpy.all", "torch.utils.data.distributed.DistributedSampler", "numpy.clip", "numpy.fliplr", "numpy.arange", "numpy.unique", "torch.from_numpy", "numpy.stack", "torch.tensor", "numpy.save", ...
Orange-OpenSource/AIVC
[ "8534111d1e08cdbf7efa92ebbb105af3c9044521" ]
[ "src/real_life/encode.py" ]
[ "# Software Name: AIVC\n# SPDX-FileCopyrightText: Copyright (c) 2021 Orange\n# SPDX-License-Identifier: BSD 3-Clause \"New\"\n#\n# This software is distributed under the BSD-3-Clause license.\n#\n# Authors: Theo Ladune <theo.ladune@orange.com>\n# Pierrick Philippe <pierrick.philippe@orange.com>\n\nimport o...
[ [ "numpy.random.randint" ] ]
eusojk/soil_apis
[ "630ddd49802c351b44df28225707a53adad782b5" ]
[ "make_static_soil_db.py" ]
[ "import os\nimport glob\nimport argparse\nimport sys\nimport pandas as pd\nimport soilapis.extract_country_bbox as ecb\nfrom pathlib import Path\nfrom soilapis.calculator import SoilConnector\nfrom shutil import copyfile, copyfileobj\n\ndirname = ''\n\ndef make_static_soil_db(soil_dir, country='Thailand'):\n \"\...
[ [ "pandas.read_csv" ] ]
hyruuk/NeuroPy-MLToolbox
[ "47aa6340cdf510ff2ecc9415a1863902040a0896" ]
[ "mlneurotools/utils.py" ]
[ "\"\"\"collection of useful tools that help with setting up a pipeline\n\nAuthor: Arthur Dehgan\"\"\"\nimport time\nimport functools\nimport numpy as np\nfrom scipy.io import loadmat\nfrom .stats import rm_outliers\n\n\ndef compute_relatives(cond1, cond2, **kwargs):\n \"\"\"Computes the relative changes.\n\n ...
[ [ "numpy.asarray", "numpy.random.RandomState", "scipy.io.loadmat", "numpy.concatenate" ] ]
navigator8972/pymanopt
[ "b9f53fa2d187c22ae75f65c71aeeb2bfa8b9c37f" ]
[ "tests/manifolds/test_positive_matrices.py" ]
[ "import autograd.numpy as np\nfrom numpy import testing as np_testing\n\nfrom pymanopt.manifolds import Positive\n\nfrom ._manifold_tests import ManifoldTestCase\n\n\nclass TestPositiveVectors(ManifoldTestCase):\n def setUp(self):\n self.m = m = 3\n self.n = n = 1\n self.k = k = 2\n s...
[ [ "numpy.testing.assert_allclose" ] ]
CowherdChris/droidlet
[ "8d965c1ebc38eceb6f8083c52b1146c1bc17d5e1" ]
[ "droidlet/lowlevel/locobot/locobot_mover.py" ]
[ "\"\"\"\nCopyright (c) Facebook, Inc. and its affiliates.\n\"\"\"\nimport os\nimport sys\nimport math\nimport copy\nimport time\nimport logging\nfrom collections.abc import Iterable\nfrom prettytable import PrettyTable\nimport Pyro4\nimport numpy as np\n\nif \"/opt/ros/kinetic/lib/python2.7/dist-packages\" in sys.p...
[ [ "numpy.dot", "numpy.abs", "numpy.multiply", "numpy.clip", "numpy.linalg.inv", "numpy.ones", "numpy.sign", "numpy.array" ] ]
andrewseidl/ibis
[ "1468b8c4f96d9d58f6fa147a2579b0d9e5796186" ]
[ "ibis/pandas/execution/strings.py" ]
[ "import itertools\nimport operator\n\nfrom functools import reduce\n\nimport regex as re\n\nimport numpy as np\nimport pandas as pd\n\nimport toolz\n\nfrom pandas.core.groupby import SeriesGroupBy\n\nimport ibis\n\nimport ibis.expr.operations as ops\n\nfrom ibis.pandas.dispatch import execute_node\nfrom ibis.pandas...
[ [ "pandas.isnull" ] ]
UMBCvision/Contextual-Adversarial-Patches
[ "602fd267c2562f45ba65d10edb856a1144b8ca5f" ]
[ "dataset.py" ]
[ "#!/usr/bin/python\n# encoding: utf-8\n\nimport os\nimport random\nimport torch\nimport numpy as np\nfrom torch.utils.data import Dataset\nfrom PIL import Image\nfrom utils import read_truths_args, read_truths\nfrom image import *\n\nimport pdb\n\n\n# WARNING: for physical world attack\nclass listDataset(Dataset):\...
[ [ "torch.from_numpy", "torch.zeros" ] ]
MuhamedAbdalla/Automatic-Audio-Book-Based-On-Emotion-Detection
[ "72130ad037b900461af5be6d80b27ab29c81de5e" ]
[ "backend/microservices/TTS/VC/vocoder/vocoder_dataset.py" ]
[ "from torch.utils.data import Dataset\r\nfrom pathlib import Path\r\nfrom VC.vocoder import audio\r\nimport VC.vocoder.hparams as hp\r\nimport numpy as np\r\nimport torch\r\n\r\n\r\nclass VocoderDataset(Dataset):\r\n def __init__(self, metadata_fpath: Path, mel_dir: Path, wav_dir: Path):\r\n print(\"Using...
[ [ "numpy.pad", "numpy.clip", "numpy.stack", "torch.tensor", "numpy.load", "numpy.random.randint" ] ]
crisgompec/ImbalancedDataset
[ "a758a740689d010180c77cc4e977c810d2a360ca" ]
[ "Dataset2/classifiers.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.ensemble import AdaBoostClassifier\nfrom sklearn.decomposition import PCA\nfrom sklearn.svm import SVC\nfrom sklearn.calibration import CalibratedClassifierCV\nfrom sklearn.model_sel...
[ [ "numpy.dot", "numpy.log", "sklearn.naive_bayes.GaussianNB", "numpy.multiply", "sklearn.decomposition.PCA", "sklearn.model_selection.train_test_split", "numpy.ones", "sklearn.neighbors.KNeighborsClassifier", "sklearn.tree.DecisionTreeClassifier", "numpy.shape", "numpy.me...
BrandonGower-Winter/ABM-gecco2022
[ "2178c91397011bb11453b0c7f0252f9c9aacca6e" ]
[ "src/main_vis.py" ]
[ "# Note! This script will only work if the agents have the same attributes\nimport math\n\nimport Animate\nimport json\nimport numpy as np\nimport os\nimport pandas\nimport statistics\nimport matplotlib.pyplot as plt\n\nfrom ECAgent.Environments import discreteGridPosToID\nfrom CythonFunctions import CAgentUtilityF...
[ [ "pandas.read_csv", "matplotlib.pyplot.subplots", "numpy.subtract.outer", "numpy.argmax", "numpy.mean" ] ]
eduardohenriquearnold/coop-3dod-infra
[ "05c6620b6856efa5d5a060efc4a874ba5b5460c0" ]
[ "lib/models/voxelnet.py" ]
[ "from .model import model\nfrom .torch_util import Conv2d, Conv3d\nfrom .region_proposal_network import RPN\nimport torch.nn.functional as F\nimport torch.nn as nn\nimport torch\nimport time\n\nimport logging\nlogger = logging.getLogger('global')\n\nclass FCN(nn.Module):\n def __init__(self, inplanes, planes):\n...
[ [ "torch.nn.Conv2d", "torch.nn.BatchNorm2d", "torch.device", "torch.nn.ReLU", "torch.nn.functional.max_pool2d" ] ]
sunzhe09/Myproject
[ "a152f0d6199998c52a20ee51ab7d22f5e0e1de7e" ]
[ "is_my_face.py" ]
[ "\r\nimport tensorflow as tf\r\nimport cv2\r\nimport sys\r\nimport os\r\nimport dlib\r\nfrom sklearn.model_selection import train_test_split\r\nfrom train_faces import cnnLayer,size,x,keep_prob_5,keep_prob_75\r\n\r\noutput = cnnLayer() \r\npredict = tf.argmax(output, 1) \r\n\r\nsaver = tf.train.Saver() \r\nsess ...
[ [ "tensorflow.train.Saver", "tensorflow.argmax", "tensorflow.train.latest_checkpoint", "tensorflow.Session" ] ]
heypaprika/You_Only_Look_Once
[ "7ba648a2af051b43317aee6956f8f5a441c661f4" ]
[ "utilities/dataloader.py" ]
[ "import sys\nimport os\n\nimport torch\nfrom torch.utils.data import Dataset\nimport numpy as np\n\nfrom PIL import Image\n\nfrom convertYolo.Format import YOLO as cvtYOLO\nfrom convertYolo.Format import VOC as cvtVOC\n\nimport torchvision\nimport torchvision.transforms as transforms\n\nimport matplotlib.pyplot as ...
[ [ "torch.stack", "numpy.array", "numpy.zeros", "torch.from_numpy" ] ]
i008/zeroml
[ "849258d34606698aba44c5f0028254025755e8ff" ]
[ "tests/conftest.py" ]
[ "import uuid\nfrom pathlib import Path\n\nimport numpy as np\nimport pandas as pd\nimport PIL.Image\nimport pytest\n\n\n@pytest.fixture\ndef random_pil_image() -> PIL.Image:\n image = PIL.Image.fromarray(np.random.randn(224, 224, 3).astype(\"uint8\"))\n return image\n\n\n@pytest.fixture\ndef create_image_test...
[ [ "numpy.random.randn", "pandas.DataFrame", "numpy.ones" ] ]
guillaumekln/estimator
[ "9c750bc38582d4c2f18c533bf2f8aa36c51b2f75" ]
[ "tensorflow_estimator/python/estimator/canned/dnn.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.util.tf_export.estimator_export", "tensorflow.python.layers.normalization.BatchNormalization", "tensorflow.python.feature_column.feature_column_lib.DenseFeatures", "tensorflow.python.ops.init_ops.glorot_uniform_initializer", "tensorflow.python.summary.summary.histogram", ...
sjforeman/cora
[ "48d127d9e00b1fb1cf2024004d1d1e7441fd1e1f" ]
[ "cora/util/nputil.py" ]
[ "\"\"\"Utility functions to help with pure numpy stuff.\"\"\"\n# === Start Python 2/3 compatibility\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nfrom future.builtins import * # noqa pylint: disable=W0401, W0614\nfrom future.builtins.disabled import * # noqa pylint: disabl...
[ [ "scipy.linalg.eigh", "scipy.linalg.cholesky", "numpy.random.standard_normal", "numpy.flatnonzero" ] ]
z33bs/multi-agent-deep-RL-solves-tennis
[ "0bb9f47905b8213f73e02890f858aea00070b59d" ]
[ "ddpgagent.py" ]
[ "import random\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom torch.optim import Adam\nfrom network import Network\n\nACTION_SIZE = 2\nSTATE_SIZE = 24\nACTOR_HIDDEN_DIMS = [256, 128]\nCRITIC_HIDDEN_DIMS = [512, 256]\nTAU = 1e-3 # For soft-updates of target\nACTOR_LR = 1e-3\nCRITIC_LR = 1e...
[ [ "numpy.random.seed", "torch.cat", "numpy.clip", "torch.from_numpy", "torch.tensor", "torch.no_grad", "numpy.random.rand" ] ]
rajevac/deitel-intro-to-python-exercises
[ "05f427d35ebb4bd315904f6919659335b1bf3fc9" ]
[ "07-Array-Oriented-Programming-with-NumPy/7-1-Filling-Arrays.py" ]
[ "import numpy as np\n\nones = np.ones((2, 3), dtype=int)\nprint(ones)\n\nzeros = np.zeros((3, 3), dtype=int)\nprint(zeros)\n\narr_13 = np.full((2, 5), 13)\nprint(arr_13)\n\n" ]
[ [ "numpy.zeros", "numpy.full", "numpy.ones" ] ]
gene891212/testAI-for-school
[ "6620b352506c74c7be0b98fcc7ca07a3820b3414" ]
[ "python/predict.py" ]
[ "# The steps implemented in the object detection sample code: \n# 1. for an image of width and height being (w, h) pixels, resize image to (w', h'), where w/h = w'/h' and w' x h' = 262144\n# 2. resize network input size to (w', h')\n# 3. pass the image to network and do inference\n# (4. if inference speed is too sl...
[ [ "tensorflow.lite.Interpreter", "numpy.array" ] ]
lseventeen/nnUNet
[ "c4972006383e438de1fa7ed7ae318d09fcffc965" ]
[ "nnunet/inference/predict_simple.py" ]
[ "# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\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# ...
[ [ "torch.cuda.empty_cache" ] ]
flaviorangel/test-joss-paper
[ "480eae9c685ed3d96e9c5971d0b9ea1356eaf7d9" ]
[ "ross/tests/test_bearing_seal_element.py" ]
[ "import numpy as np\nimport pytest\nimport os\nfrom numpy.testing import assert_allclose\nimport math\n\nfrom ross.bearing_seal_element import (\n BearingElement,\n BallBearingElement,\n RollerBearingElement,\n)\n\n\n@pytest.fixture\ndef bearing0():\n Kxx_bearing = np.array(\n [8.5e07, 1.1e08, 1....
[ [ "numpy.array", "numpy.zeros", "numpy.linspace", "numpy.testing.assert_allclose" ] ]
toedtli/rg_text_to_sound
[ "871d51918a34743067fb6fd58534f5eabd28c2f5" ]
[ "playground/beat_toedtli/mymodels/UnifiedKeywordExtractor.py" ]
[ "import numpy as np\n#import tensorflow as tf\n#import tensorflow_hub as hub\n#import tensorflow_text as text # Registers the ops.\nfrom tts_pipeline.pipelines.waterfall.pipeline import (\n WaterfallKeywordExtractor,\n WaterfallEmbedder,\n WaterfallDimensionalityReducer\n)\nimport spacy\nfrom sklearn.clus...
[ [ "numpy.median", "numpy.array", "sklearn.cluster.KMeans" ] ]
PierBeneventano/test_pytorch
[ "287437b333c36e27f9ab97ab627a2e0a12683fed" ]
[ "make_makefile_3a.py" ]
[ "import os\nimport numpy as np\ncwd = os.getcwd() # get the current working directory\n\ndef create_makefile(choice_dict):\n f = open(f\"{cwd}/makefile\",'w')\n f.write(\".PHONY = help setup test run clean environment\\n\\n\")\n f.write(\".DEFAULT_GOAL = setup\\n\")\n f.write(\"setup:\\n\")\n\n for...
[ [ "numpy.array" ] ]
shankhiremath/BT5051_CFA
[ "7b57801bc74ad16ca97663087dd28aa1228efe67" ]
[ "2D_case1.py" ]
[ "#CASE NO. 1\n#Input is 4 adjacent people at the top of the 2D grid\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\nfrom matplotlib.animation import FuncAnimation\n\nprint(\"2D diffusion equation solver\")\n\nppl_length = 10\nmax_iter_time = 150\n\nD = 2 #Diffus...
[ [ "matplotlib.pyplot.pcolormesh", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.clf", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.hist", "numpy.empty", "matplo...
GW-Wang-thu/StrainNet3D
[ "cfb235fe03685e3b5bb68c3700b0810a3aa62ca4" ]
[ "Preprocess.py" ]
[ "import numpy as np\nimport cv2\nimport os\nimport re\n\n\ndef gen_dataset(in_dir, out_dir, train_percent, start_idx=300):\n filenames = os.listdir(in_dir)\n filenames = [os.path.join(in_dir, f) for f in filenames if f.endswith('LR.tif')]\n for i in range(len(filenames)):\n print('\\r', '%d of %d fi...
[ [ "numpy.random.seed", "numpy.random.rand", "numpy.stack", "numpy.random.randint" ] ]
cvigoe/DRL4MAAS
[ "95539197c9b82a34f9128fd265749d0f8f76157f" ]
[ "rlkit/rlkit/torch/policy_gradient/mdpo.py" ]
[ "\"\"\"\nImplementation of Mirror Descent Policy Optimization.\nhttps://arxiv.org/pdf/1707.06347.pdf\n\nAuthor: Ian Char\nDate: April 10, 2021\n\"\"\"\nfrom collections import OrderedDict, namedtuple\nfrom typing import Tuple\n\nimport numpy as np\nimport torch\nimport torch.optim as optim\nfrom rlkit.core.loss imp...
[ [ "torch.no_grad", "torch.nn.MSELoss" ] ]
JordanRex/YAAML
[ "feedfae7f238c326235c1542cf8afcbdf020bf8d" ]
[ "src/algos/logit.py" ]
[ "from sklearn.linear_model import LogisticRegression\n\n# implementing only the baseline logistic model\n# need to add support for parameter tuning\n\n#kfold = model_selection.KFold(n_splits=5, random_state=1)\nmodelCV = LogisticRegression()\n# Create regularization penalty space\npenalty = ['l1', 'l2']\n# Create r...
[ [ "sklearn.linear_model.LogisticRegression" ] ]
JianhuanZhuo/RecBole
[ "fb9ee722bb1349db113af15b9bf6a14a2bccd0eb" ]
[ "recbole/model/general_recommender/ncl.py" ]
[ "# -*- coding: utf-8 -*-\n\nr\"\"\"\nNCL\n################################################\n\nReference:\n Zihan Lin*, Changxin Tian*, Yupeng Hou*, Wayne Xin Zhao. \"Improving Graph Collaborative Filtering with Neighborhood-enriched Contrastive Learning.\" in WWW 2022.\n\"\"\"\n\nimport numpy as np\nimport scipy...
[ [ "torch.mean", "torch.cat", "torch.sparse.mm", "torch.nn.Embedding", "torch.FloatTensor", "torch.split", "scipy.sparse.coo_matrix", "torch.Size", "scipy.sparse.dok_matrix", "scipy.sparse.diags", "torch.from_numpy", "torch.mul", "torch.LongTensor", "numpy.powe...
Diemo-zz/KiezBurnTokenRedistribution
[ "2ae141cfb7984c9e7a032b616921d38462f409b1" ]
[ "scrape_budget3.py" ]
[ "from selenium import webdriver\nfrom time import sleep\nimport pandas as pd\nfrom DreamsList import DreamList\n\n\ndef load_all_dreams(driver):\n sleep(5)\n def find_button(driver):\n mt7 = driver.find_elements_by_xpath(\"//button\")\n button = None\n for b in mt7:\n divs = b....
[ [ "pandas.DataFrame" ] ]
lsgai/selene
[ "ad23904cad2a5a292732ff350e7689c0b9e511f4" ]
[ "selene_sdk/predict/_variant_effect_prediction.py" ]
[ "import math\n\nimport numpy as np\n\nfrom ._common import _truncate_sequence\nfrom ._common import predict\n\n\nVCF_REQUIRED_COLS = [\"#CHROM\", \"POS\", \"ID\", \"REF\", \"ALT\"]\n\n\n# TODO: Is this a general method that might belong in utils?\ndef read_vcf_file(input_path,\n strand_index=None,\...
[ [ "numpy.vstack", "numpy.array", "numpy.array_equal" ] ]
zaustinj33/SysAnalysisRNABS
[ "730014b1a9ab5fd869bc6a265dfe369421c74f8e" ]
[ "Figure_4/plot_genes_sites_from_meRanCall.py" ]
[ "import glob\nimport pandas as pd\nimport os, sys, re\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n#%%\n\"\"\"\nAccumulates 1) unique genes 2) unique sites counts for all samples. Plots the output.\n\"\"\"\nheaders = ['#SeqID', 'refPos', 'strand', 'Base', 'cov', 'C_count','methRate...
[ [ "matplotlib.pyplot.axvline", "pandas.read_csv", "matplotlib.pyplot.yscale", "matplotlib.pyplot.savefig", "pandas.DataFrame", "matplotlib.pyplot.xlim", "matplotlib.pyplot.close", "matplotlib.pyplot.xticks", "matplotlib.pyplot.show" ] ]
robertoxmed/ls_mxc
[ "5b62fcf35592f90cd239390e14149c28b97b8692" ]
[ "bench/bench.py" ]
[ "#!/usr/bin/python\nimport numpy as np\nimport os\nimport optparse\nimport sys\nimport shutil\nimport textwrap\nimport smtplib\nimport time\nimport matplotlib.pyplot as plt\nimport csv\nimport zipfile\nimport tempfile\nfrom email.mime.multipart import MIMEMultipart\nfrom email.mime.text import MIMEText\nfrom email....
[ [ "matplotlib.pyplot.legend", "numpy.polyfit", "numpy.poly1d", "numpy.log", "numpy.linspace", "numpy.arange", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
FanWangEcon/pyecon
[ "42b89bdae5dc871018a175d9dfb8d8f8f4729e50" ]
[ "setup.py" ]
[ "from setuptools import setup, find_packages\nfrom codecs import open\nimport numpy\nimport os\nfrom Cython.Build import cythonize\n\n# thanks Pipy for handling markdown now\nROOT = os.path.abspath(os.path.dirname(__file__))\n\nwith open(os.path.join(ROOT, 'README.md'), encoding=\"utf-8\") as f:\n README = f.rea...
[ [ "numpy.get_include" ] ]
refitt/ref
[ "3ccc398e7b95f77549ab77884b87f40abdd3effb" ]
[ "tests/unit/test_forecast.py" ]
[ "# SPDX-FileCopyrightText: 2019-2021 REFITT Team\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Unit tests for forecast interface.\"\"\"\n\n\n# type annotations\nfrom typing import Dict, Any\n\n# standard libs\nimport io\nimport json\nimport string\nimport random\n\n# external libs\nimport numpy as np\nfrom astrop...
[ [ "numpy.random.rand" ] ]
Weizhuo-Zhang/car_detection_recognition
[ "7413992a5a7319f838b6b38597c1caee8dfdb641" ]
[ "server/yolo3/utils.py" ]
[ "\"\"\"Miscellaneous utility functions.\"\"\"\r\n\r\nfrom functools import reduce\r\n\r\nfrom PIL import Image,ImageFile\r\nImageFile.LOAD_TRUNCATED_IMAGES = True\r\nimport numpy as np\r\nfrom matplotlib.colors import rgb_to_hsv, hsv_to_rgb\r\n\r\ndef compose(*funcs):\r\n \"\"\"Compose arbitrarily many functions...
[ [ "numpy.logical_and", "matplotlib.colors.hsv_to_rgb", "numpy.random.shuffle", "numpy.random.rand", "numpy.array", "numpy.zeros" ] ]
ltindall/BirdsEye
[ "8a2dd1727097dc8308fbc292c619689b188ab62d" ]
[ "birdseye/utils.py" ]
[ "\"\"\"\nParticle Filter helper functions\n\"\"\"\nimport configparser\nimport json\nimport math\nimport os\nfrom collections import defaultdict\nfrom io import BytesIO\nfrom itertools import permutations\nfrom itertools import product\nfrom pathlib import Path\n\nimport imageio\nimport matplotlib.pyplot as plt\nim...
[ [ "numpy.dot", "numpy.radians", "numpy.sqrt", "numpy.linspace", "numpy.flipud", "pandas.DataFrame", "numpy.arctan2", "numpy.mean", "scipy.ndimage.filters.gaussian_filter", "numpy.hstack", "matplotlib.pyplot.tight_layout", "numpy.arange", "numpy.sin", "numpy.co...