repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
joha2/ToOptixCore
[ "8ad17dcee349173a1b000c28de66e567ba2ad7a1" ]
[ "ToOptix/OptimizationController.py" ]
[ "from .FEMPy.CCXPhraser import CCXPhraser, FRDReader, DATReader\nfrom .FEMPy.CCXSolver import CCXSolver\nfrom .DensityMaterial import DensityMaterial\nfrom .TopologyOptimizer import TopologyOptimizer\nfrom .Filter import ElementFilter\nfrom .FEMPy.Geometry.STLPhraser import STL\nfrom .FEMPy.Geometry.Solid import So...
[ [ "numpy.median", "numpy.array" ] ]
flowersteam/curious
[ "05f0ce053c3614688c256ec34b08060808e62d81" ]
[ "baselines/her/her.py" ]
[ "import numpy as np\nfrom baselines import logger\n\n\ndef make_sample_her_transitions(goal_replay, her_replay_k, reward_fun, task_replay='', tasks_ag_id=None, tasks_g_id=None):\n \"\"\"Creates a sample function that can be used for HER experience replay.\n\n Args:\n goal_replay (in ['her', 'none']):...
[ [ "numpy.random.uniform", "numpy.argwhere", "numpy.random.randint" ] ]
ldda/PF-Net-Point-Fractal-Network
[ "83a3f73667882087b78bab43bbcd2167bf3e7289" ]
[ "comparison-test/3D_capsule_ae/Test_from_prn_to_capsule.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\n\nimport argparse\nimport torch\nimport torch.nn.parallel\nfrom torch.autograd import Variable\nimport torch.optim as optim\nimport random\nimport sys\nimport os\nimport numpy as np\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(BASE_DIR...
[ [ "torch.load", "torch.cuda.device_count", "torch.unsqueeze", "torch.FloatTensor", "torch.cuda.is_available", "numpy.savetxt", "torch.nn.DataParallel", "numpy.loadtxt" ] ]
joselusl/ars_lib_helpers
[ "02da9a83b104d2f4f928b97619d8396b0993e648" ]
[ "source/ars_lib_helpers.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nfrom numpy import *\n\nimport os\n\n\n\n# ROS\n\nimport rospy\n\nimport tf_conversions as tf\n\n\n\n\n\ndef normalize(v):\n norm = np.linalg.norm(v)\n if norm < 0.00001:\n return v\n return v / norm\n\n\n\nclass Quaternion:\n\n @staticmethod\n def normalize(v):\...
[ [ "numpy.dot", "numpy.linalg.inv", "numpy.linalg.norm", "numpy.array", "numpy.zeros", "numpy.roll" ] ]
lesscomfortable/fastai_v1
[ "bbc5c37329cf45f59bd2daaa2f56723cb7565643" ]
[ "dev_nb/nb_002.py" ]
[ "\n #################################################\n ### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###\n #################################################\n\nfrom nb_001b import *\nimport sys, PIL, matplotlib.pyplot as plt, itertools, math, random, collections, torch\nimport scipy.stats, sci...
[ [ "numpy.log", "matplotlib.pyplot.tight_layout", "torch.linspace", "torch.ones", "torch.Tensor", "torch.rand_like", "torch.eye", "matplotlib.pyplot.subplots", "numpy.cos", "numpy.sin", "torch.tensor", "torch.FloatTensor", "numpy.exp" ] ]
qlemaire22/speech-music-detection
[ "386106d4d794535c0272b939e64ebe02f91ea3a0" ]
[ "prepare_dataset/prepare_audio.py" ]
[ "import sys\nsys.path.append(\"..\")\nimport json\nimport os\nimport glob\nfrom tqdm import tqdm\nfrom subprocess import Popen, PIPE\nimport smd.config as audio_config\nimport re\nimport argparse\nimport smd.utils as utils\nimport smd.data.preprocessing as preprocessing\nimport numpy as np\nfrom shutil import copyf...
[ [ "numpy.zeros", "numpy.sum" ] ]
rhaps0dy/convnets-as-gps
[ "a10bb6fd26bea2163f41a4ef9171bf914db5bc76" ]
[ "deep_ckern/exkern.py" ]
[ "from gpflow.params import Parameterized\nimport tensorflow as tf\nimport numpy as np\n\n__all__ = ['ElementwiseExKern', 'ExReLU', 'ExErf']\n\n\nclass ElementwiseExKern(Parameterized):\n def K(self, cov, var1, var2=None):\n raise NotImplementedError\n\n def Kdiag(self, var):\n raise NotImplement...
[ [ "tensorflow.clip_by_value", "tensorflow.nn.relu", "tensorflow.sign", "numpy.sqrt", "tensorflow.shape", "tensorflow.ones_like", "tensorflow.asin", "tensorflow.sqrt", "tensorflow.acos", "tensorflow.erf" ] ]
tiankafei/java
[ "9ff39cb47b8f2144851856b4412b1b0b7781cb09", "9ff39cb47b8f2144851856b4412b1b0b7781cb09" ]
[ "tiankafei-code-python/analysis/classify_collection/ClassifyCollection.py", "tiankafei-code-python/analysis/related/Related.py" ]
[ "# -- coding: utf-8 -\n# 分类汇总分析算法\n\nimport pandas as pd\nfrom typing import Optional\nimport numpy as np\nimport scipy.stats as st\nfrom pydantic import BaseModel, Field\n\nmethod_view_name = '分类汇总分析算法'\nexample_index_name = '工业总产值-本期'\nexample_item_name = '轻工业'\n\n\nclass ItemParamDTO(BaseModel):\n item_name: ...
[ [ "numpy.array", "numpy.min", "numpy.median", "scipy.stats.t.ppf", "numpy.max", "numpy.std", "scipy.stats.scoreatpercentile", "scipy.stats.skew", "numpy.mean", "numpy.var", "scipy.stats.sem", "numpy.average", "scipy.stats.kurtosis", "numpy.sum" ], [ "s...
McGill-NLP/imagecode
[ "2c636c6c41d705b4c5861841f29ff689748113d1" ]
[ "baselines/crossencoders/volta/datasets/retrieval_dataset.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# Copyright (c) 2020, Emanuele Bugliarello (@e-bug).\n\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport os\nimport sys\nimport random\nimport jsonlines\nimport _pickle as cPick...
[ [ "torch.Tensor", "torch.zeros", "torch.tensor", "torch.stack", "numpy.array", "numpy.zeros" ] ]
adematti/mockfactory
[ "6b4129c192fa82a105c83fa882114d952b9be953" ]
[ "mockfactory/remap.py" ]
[ "\"\"\"\nA vectorisation of Duncan Campbell's script https://github.com/duncandc/cuboid_remap,\nbased on Jordan Carlson and Martin White's algorithm of arXiv:1003.3178.\n\"\"\"\nimport itertools\n\nimport numpy as np\n\nfrom .utils import BaseClass\n\n\ndef _make_array(value, shape, dtype='f8'):\n # Return numpy...
[ [ "numpy.min", "numpy.asarray", "numpy.arange", "numpy.ndim", "numpy.max", "numpy.atleast_2d", "numpy.ceil", "numpy.floor", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
TaktakTaktouk/DeOldify
[ "0ff6139bb09d0abdf535a724f05bdad3ec04dcc1", "0ff6139bb09d0abdf535a724f05bdad3ec04dcc1" ]
[ "app-video.py", "fid/inception.py" ]
[ "# import the necessary packages\nimport os\nimport sys\nimport requests\nimport ssl\nfrom flask import Flask\nfrom flask import request\nfrom flask import jsonify\nfrom flask import send_file\n\n\nfrom app_utils import download\nfrom app_utils import generate_random_filename\nfrom app_utils import clean_me\nfrom a...
[ [ "torch.cuda.is_available" ], [ "torch.nn.Sequential", "torch.cat", "torch.utils.model_zoo.load_url", "torch.nn.ModuleList", "torch.nn.functional.avg_pool2d", "torch.nn.MaxPool2d", "torch.nn.AdaptiveAvgPool2d", "torch.nn.functional.interpolate", "torch.nn.functional.max_...
takluyver/euroscipy-2017-packaging
[ "3834e618918ab0b4246345997e7d127edb8c9fa5" ]
[ "euroscipy2017.py" ]
[ "\"\"\"Sample package for demonstrating flit & flonda.\n\nThis code is from the matplotlib gallery, used under the matplotlib license.\nhttp://matplotlib.org/examples/images_contours_and_fields/streamplot_demo_features.html\nhttp://matplotlib.org/users/license.html\n\"\"\"\n\nimport numpy as np\nimport matplotlib.p...
[ [ "matplotlib.pyplot.subplots", "numpy.sqrt" ] ]
PSCLab-ASU/OpenICS
[ "e8f639f9278ce88c98f14daf026a56395cb64ca9", "e8f639f9278ce88c98f14daf026a56395cb64ca9" ]
[ "CSGM/mnist_vae/utils.py", "CSGM/mnist_vae/data_input.py" ]
[ "# pylint: disable = C0103, C0111, C0301, R0913, R0903, R0914\n\nimport os\nimport shutil\nimport tensorflow as tf\nimport scipy.misc\nimport numpy as np\n\n\ndef save_images(images, size, image_path):\n return imsave(inverse_transform(images), size, image_path)\n\n\ndef imsave(images, size, path):\n return s...
[ [ "tensorflow.train.get_checkpoint_state", "tensorflow.random_uniform", "numpy.zeros", "numpy.sqrt" ], [ "numpy.array" ] ]
MarcoGorelli/rsmtool
[ "8759f5bec09a8ba0dd2ca16f6af8ce100d5ea6a0", "8759f5bec09a8ba0dd2ca16f6af8ce100d5ea6a0" ]
[ "rsmtool/reader.py", "tests/test_comparer.py" ]
[ "\"\"\"\nClasses for reading data files (or dictionaries)\nand converting them to DataContainer objects.\n\n:author: Jeremy Biggs (jbiggs@ets.org)\n:author: Anastassia Loukina (aloukina@ets.org)\n:author: Nitin Madnani (nmadnani@ets.org)\n\n:organization: ETS\n\"\"\"\n\nimport warnings\n\nfrom functools import part...
[ [ "pandas.concat", "pandas.json_normalize", "pandas.read_json" ], [ "numpy.random.multivariate_normal", "scipy.stats.pearsonr", "pandas.DataFrame", "pandas.testing.assert_frame_equal", "numpy.isclose" ] ]
datacryptoanalytics/crypto-analysis
[ "b9ed389e05cdf4b51523d633dcae1b0b4af28363" ]
[ "algo/num-trades-binance-spot-v0.1-PT.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n@author: Felipe Soares\n\"\"\"\n\nimport requests\nimport json\nimport pandas as pd\nimport datetime as dt\nimport matplotlib.pyplot as plt\nfrom matplotlib import pyplot as plt\nimport pyfiglet\n\nascii_banner = pyfiglet.figlet_format(\"DataCrypto Analytics...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "pandas.DataFrame", "matplotlib.pyplot.gcf", "matplotlib.pyplot.plot", "matplotlib.pyplot.subplot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.style.use", "matplotlib.pyplot.ylabel" ] ]
QiangliangHuang/siamban
[ "940208cb26f8146f87f7534d1674791dcb62468a" ]
[ "tools/train.py" ]
[ "# Copyright (c) SenseTime. All Rights Reserved.\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport argparse\nimport logging\nimport os\nimport time\nimport math\nimport json\nimport random\nimport nump...
[ [ "torch.cuda.manual_seed", "numpy.random.seed", "torch.utils.data.distributed.DistributedSampler", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.utils.tensorboard.SummaryWriter", "torch.optim.SGD" ] ]
chinyitan/lenstronomy
[ "f605783a7ad045a0657f4e8217e90b69b5b819a1" ]
[ "lenstronomy/LensModel/profile_integrals.py" ]
[ "import copy\nimport scipy.integrate as integrate\nimport numpy as np\n\n__all__ = ['ProfileIntegrals']\n\n\nclass ProfileIntegrals(object):\n \"\"\"\n class to perform integrals of spherical profiles to compute:\n - projected densities\n - enclosed densities\n - projected enclosed densities\n \"\...
[ [ "numpy.sqrt" ] ]
DwyaneShi/profiler-ui
[ "d1e2a00bbea05127ad3b6a09a0ac52e621e33d97" ]
[ "ui.py" ]
[ "#!/usr/bin/env python\n\n# Copyright 2018 Google Inc. 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...
[ [ "tensorflow.flags.DEFINE_string", "tensorflow.flags.DEFINE_boolean", "tensorflow.flags.DEFINE_integer", "tensorflow.app.run" ] ]
polybit-tech/co-win
[ "2cdc9121036cd84fa6dd3a3db573f42f90287032" ]
[ "app.py" ]
[ "import streamlit as st\r\nfrom PIL import Image\r\nimport requests\r\nimport pandas as pd\r\nimport base64\r\nfrom fake_useragent import UserAgent\r\n\r\nst.set_page_config(page_title='Co-Win: Covid-19 Vaccination Tracker', page_icon='💉', layout = 'centered', initial_sidebar_state = 'expanded')\r\n\r\nua = UserAg...
[ [ "pandas.concat", "pandas.DataFrame" ] ]
amberww/s3prl
[ "d74784f80da2b5a84e64ff445e583163d215a3f9" ]
[ "upstream/cpc/expert.py" ]
[ "# -*- coding: utf-8 -*- #\n\"\"\"*********************************************************************************************\"\"\"\n# FileName [ upstream/cpc/expert.py ]\n# Synopsis [ the cpc wrapper ]\n# Author [ S3PRL ]\n# Copyright [ Copyleft(c), Speech Lab, NTU, Taiwan ]\n\"\"\"*****...
[ [ "torch.randn", "torch.nn.utils.rnn.pad_sequence", "torch.load" ] ]
levon003/ALSim
[ "9b7faff5359f730b1b52daeb4586fe4484d02f5c" ]
[ "src/alsim/data.py" ]
[ "import os\nimport json\nimport pickle\nimport numpy as np\n\nimport alsim.paths\n\n\ndef load_search_data():\n \"\"\"\n Load the external search_data dictionary from a JSON file at a particular place relative to the working directory.\n\n The search_data dict has a deep nested structure:\n outcome:\n ...
[ [ "numpy.array" ] ]
HorlavaNastassya/AD-DL
[ "58999a8300cea9a8f3b868a968281dc8f148a532" ]
[ "clinicaaddl/clinicaaddl/tools/deep_learning/iotools.py" ]
[ "# coding: utf8\nimport logging\nimport sys\n\nLOG_LEVELS = [logging.WARNING, logging.INFO, logging.DEBUG]\n\n\nclass StdLevelFilter(logging.Filter):\n def __init__(self, err=False):\n super().__init__()\n self.err = err\n\n def filter(self, record):\n if record.levelno <= logging.INFO:\n...
[ [ "torch.is_tensor" ] ]
j-c-cook/gFunctionDatabase
[ "dec8080e3c16bcdb8cf6827a0ba2c9665eeee190" ]
[ "gFunctionDatabase/Management/application.py" ]
[ "# Jack C. Cook\n# Thursday, September 16, 2021\nimport warnings\n\nfrom scipy.interpolate import interp1d, lagrange\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pygfunction as gt\n\n\nclass GFunction:\n def __init__(self, B: float, r_b_values: dict, D_values: dict,\n g_lts: dict,...
[ [ "numpy.log", "scipy.interpolate.lagrange", "matplotlib.pyplot.subplots", "scipy.interpolate.interp1d", "numpy.exp", "numpy.array" ] ]
63days/Transglot
[ "33fb913b3ded69fb8b8a1ab3f514184fe63d932f" ]
[ "transglot/in_out/rnn_data_preprocessing.py" ]
[ "import numpy as np\nfrom collections import defaultdict, Counter\nimport os.path as osp\nfrom transglot.in_out.numpy_dataset import NumpyDataset\nfrom transglot.simple_utils import sort_and_count_len_of_dict_values\nfrom transglot.in_out.game_data_preprocessing import condition_mask_of_data\nfrom transglot.in_out....
[ [ "numpy.log", "numpy.nditer", "numpy.logical_and", "numpy.random.choice", "numpy.random.seed", "numpy.pad", "numpy.unique", "numpy.setdiff1d", "numpy.ones", "numpy.random.shuffle", "numpy.max", "numpy.ceil", "numpy.argmax", "numpy.where", "numpy.array", ...
armando1793/networkx
[ "48326e1761c08d7a073aec53f7a644baf2249ef6" ]
[ "examples/algorithms/plot_krackhardt_centrality.py" ]
[ "#!/usr/bin/env python\n\"\"\"\n=====================\nKrackhardt Centrality\n=====================\n\nCentrality measures of Krackhardt social network.\n\"\"\"\n# Author: Aric Hagberg (hagberg@lanl.gov)\n# Date: 2005-05-12 14:33:11 -0600 (Thu, 12 May 2005)\n# Revision: 998\n\n# Copyright (C) 2004-2018 by\n# ...
[ [ "matplotlib.pyplot.show" ] ]
arshaali/artificial-trust-task-allocation
[ "98d8feed2ff8bdf508d8e9b5d1077c094d6037ec" ]
[ "code/generate_normaldist_tasks.py" ]
[ "# imports\nimport numpy as np\nfrom numpy.linalg import norm\n\nimport scipy.io as sio\n\nimport sklearn.metrics as metrics\n\nimport matplotlib.pyplot as plt\nfrom scipy import stats\n\n\nnum_iter = 10\n\nnum_tasks = 500 #Change to the number of tasks you want to generate in a set.\n\nsaving_new_tasks = True\n\n\...
[ [ "numpy.exp", "numpy.sqrt", "numpy.vstack", "scipy.io.savemat" ] ]
folkvir/qasino-simulation
[ "2412d505381334b52048aefd44752109a6b0dc73" ]
[ "scripts/spray-estimator.py" ]
[ "import argparse\nimport os\nfrom math import log\nimport matplotlib.pyplot as plt\nfrom functools import reduce\nimport numpy as np\nimport csv\n\ndef parseFile(file):\n print(\"Processing \", file)\n peers = {}\n with open(file, 'r') as csvfile:\n plots = csv.reader(csvfile, delimiter=',')\n ...
[ [ "matplotlib.pyplot.subplots" ] ]
cshanbo/tensor2tensor
[ "fd9b3150ad72140c05dfad7a4ebc4577be6c1c08" ]
[ "tensor2tensor/data_generators/text_encoder_test.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Tensor2Tensor 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 requir...
[ [ "tensorflow.test.main", "tensorflow.test.get_temp_dir" ] ]
vibinash/vision
[ "7d775d6a877412c963965ecca2eea71ee2def007" ]
[ "image_processing/morphological_transformation/image_closing.py" ]
[ "import cv2\nimport numpy as np\n\nimg = cv2.imread('../../images/letter_in.jpg', 0)\nret, thresh = cv2.threshold(img, 127,255, cv2.THRESH_BINARY_INV)\n\n# The size of the kernel affects the amount of erosion\nkernel = np.ones((5,5), np.uint8)\n\ndilation = cv2.dilate(thresh, kernel, iterations=3)\n\n# closing (rev...
[ [ "numpy.ones" ] ]
wurui1994/test
[ "027cef75f98dbb252b322113dacd4a9a6997d84f" ]
[ "Python/Graphics/Networkx/example2.py" ]
[ "import networkx as nx\nimport matplotlib.pyplot as plt\n\n# erdos renyi graph\n# generate a graph which has n=20 nodes, probablity p = 0.2.\nER = nx.random_graphs.erdos_renyi_graph(20, 0.2)\n# the shell layout\npos = nx.shell_layout(ER)\nnx.draw(ER, pos, with_labels = False, node_size = 30)\nplt.show()" ]
[ [ "matplotlib.pyplot.show" ] ]
rvolden/Mandalorion-Episode-III
[ "134683998023ad03cc88e1428c4a72fbd51938e0" ]
[ "defineAndQuantifyIsoforms.py" ]
[ "#!/usr/bin/env python3\n# Christopher Vollmers\n# Roger Volden\n\nimport os\nimport sys\nimport numpy as np\n\npath = sys.argv[2]\ninfile = sys.argv[1]\nupstream_buffer = int(sys.argv[4])\ndownstream_buffer = int(sys.argv[3])\nsubreads=sys.argv[5]\nfasta_file=sys.argv[6]\n\nminimum_read_count = 3\n\ndef find_peaks...
[ [ "numpy.arange", "numpy.median" ] ]
DDS-Lab/model-training
[ "2c96ecdb6dc803e06678b8b719c7463afaa946cb" ]
[ "tfr_util.py" ]
[ "# Original work Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n# Modifications Copyright 2018 Defense Innovation Unit Experimental.\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 t...
[ [ "tensorflow.python_io.TFRecordWriter", "tensorflow.train.FloatList", "tensorflow.train.BytesList", "numpy.array", "tensorflow.train.Int64List" ] ]
ravi03071991/NIPS-Global-Paper-Implementation-Challenge
[ "27c9916df95deb6f91745cc69392ef7db48005e8" ]
[ "eval/cifar100_vgg16.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport random as rn\n\n# The below is necessary in Python 3.2.3 onwards to\n# have reproducible behavior for certain hash-based operations.\n# See these references for further details:\n# https://docs.python.org/3.4/using/cmdline.html#envvar-PYTHONHASHSEED\n# https://gi...
[ [ "pandas.DataFrame.from_items", "tensorflow.get_default_graph", "numpy.log", "numpy.random.seed", "tensorflow.ConfigProto", "numpy.max", "numpy.std", "numpy.argmax", "numpy.mean", "numpy.log10", "tensorflow.set_random_seed", "numpy.argsort", "sklearn.model_select...
Anshul-GH/stackoverflow
[ "df75b2050a3c7e2e0741d09e52058e7273d48ed4" ]
[ "62108845.py" ]
[ "'''\nLoan_ID\nloan_status\nPrincipal\nterms\neffective_date\ndue_date\npaid_off_time\npast_due_days\nage\neducation\nGender\n'''\n\nimport pandas as pd\nimport string\n\ndf = pd.read_clipboard()\n\ndf['Loan_ID'] = df['Loan_ID'].apply(lambda x: string.capwords(x, sep='_'))\n\nprint(df)\n\n\nimport pandas as pd\n\nd...
[ [ "pandas.read_clipboard" ] ]
anish29292/pandas
[ "30724b9c6b00d00d9db8f8ea89664a7952e1d96f" ]
[ "pandas/io/sql.py" ]
[ "\"\"\"\nCollection of query wrappers / abstractions to both facilitate data\nretrieval and to reduce dependency on DB-specific API.\n\"\"\"\n\nfrom contextlib import contextmanager\nfrom datetime import date, datetime, time\nfrom functools import partial\nimport re\nimport warnings\n\nimport numpy as np\n\nimport ...
[ [ "pandas.core.dtypes.common.is_list_like", "pandas.core.api.DataFrame.from_records", "pandas.core.dtypes.common.is_datetime64tz_dtype", "numpy.dtype", "numpy.atleast_2d", "pandas.core.dtypes.missing.isna", "pandas.core.dtypes.common.is_dict_like", "pandas._libs.lib.infer_dtype", ...
seba-1511/dist_rl.pth
[ "0d2a24feff17f80dc2c75682889899feed13dfe6" ]
[ "examples/sync_bench.py" ]
[ "#!/usr/bin/env python\nfrom __future__ import print_function\n\nimport os\nimport randopt as ro\nimport torch as th\nimport torch.distributed as dist\nfrom torch.multiprocessing import Process\nfrom time import time\n\nfrom drl.utils import get_setup, parse_args\nfrom drl.training import train, test\n\ndef sync(te...
[ [ "torch.distributed.init_process_group", "torch.set_num_threads", "torch.distributed.get_world_size", "torch.distributed.all_reduce", "torch.multiprocessing.Process" ] ]
pscedu/mlstamps_oltr
[ "ad69b5ea25c0e5bc0024e0e98a14a962530fba52" ]
[ "shuffler/lib/subcommands/datasets/dbCoco.py" ]
[ "import os, sys, os.path as op\nimport numpy as np\nimport cv2\nimport logging\nfrom glob import glob\nimport shutil\nimport simplejson as json\nimport sqlite3\nfrom progressbar import progressbar\nfrom pprint import pformat\nfrom datetime import datetime\n\nfrom lib.backend import backendDb\nfrom lib.utils import ...
[ [ "numpy.array", "numpy.count_nonzero" ] ]
SivanKe/SyntheticDataHandwrittenCharacterRecognition
[ "c2b299009ddc24eab1bc2074787e82e566f79abc" ]
[ "Src/models/Attention/Loss.py" ]
[ "from __future__ import print_function\nimport math\nimport torch.nn as nn\nimport numpy as np\n\nclass Loss(object):\n \"\"\" Base class for encapsulation of the loss functions.\n This class defines interfaces that are commonly used with loss functions\n in training and inferencing. For information regar...
[ [ "torch.nn.NLLLoss" ] ]
welch16/microbiome-pipeline
[ "4216c45830581c3f6ba0b7d9ad6df3762deac724" ]
[ "prepare_sample_table.py" ]
[ "#! /usr/bin/env python\n\n# taken from\nimport os\nimport logging\nimport pandas as pd\nfrom collections import defaultdict\n\n\ndef get_sample_files(path,outfile='samples.tsv'):\n samples = defaultdict(dict)\n seen = set()\n for dir_name, sub_dirs, files in os.walk(os.path.abspath(path)):\n for fn...
[ [ "pandas.DataFrame" ] ]
coeusite/cnemc_calculator
[ "7874940adb38bcdf684e9032f55de10adfa10345" ]
[ "cnemc_calculator/calculate_aqi.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom .constants import *\nfrom .functions import *\n\ndef calculate_daily_aqi(data, column_names):\n ''' calculate_daily_aqi funcion\n \n data: a pandas dataframe\n column_names: names of factor columns insequence of ['SO2', 'NO2', 'PM10', 'CO', 'O3', 'O3_8H',...
[ [ "numpy.concatenate", "pandas.DataFrame" ] ]
Luke-Ludwig/DRAGONS
[ "d4ff4e462f64d547fbb727627875b72664255d1e", "0f5814caaa791bda47edf00407722247095f8427" ]
[ "astrodata/tests/test_object_construction.py", "gempy/testing.py" ]
[ "import astrodata\nimport numpy as np\nimport pytest\nfrom astrodata.testing import download_from_archive\nfrom astropy.io import fits\nfrom astropy.nddata import NDData\nfrom astropy.table import Table\n\n\n@pytest.fixture()\ndef testfile1():\n \"\"\"\n Pixels Extensions\n Index Content ...
[ [ "numpy.random.random", "numpy.abs", "numpy.ones", "numpy.all", "numpy.zeros" ], [ "numpy.testing.assert_allclose" ] ]
jswright-dstl/Fuzzy-Felt-Framework
[ "07e9a85c7c01c110efef6b6a18463bd17891f131" ]
[ "stonesoup/types/tests/test_state.py" ]
[ "# -*- coding: utf-8 -*-\nimport datetime\n\nimport numpy as np\nimport scipy.linalg\nimport pytest\n\nfrom ..angle import Bearing\nfrom ..array import StateVector, CovarianceMatrix\nfrom ..numeric import Probability\nfrom ..particle import Particle\nfrom ..state import State, GaussianState, ParticleState, \\\n ...
[ [ "numpy.diag", "numpy.allclose", "numpy.array_equal", "numpy.linalg.cholesky", "numpy.array" ] ]
jakegrigsby/spacetimeformer
[ "8d7b54ec7102c5c540927b717837f046cc3e5013" ]
[ "spacetimeformer/linear_model/linear_model.py" ]
[ "import torch\nfrom torch import nn\nimport torch.nn.functional as F\nimport pytorch_lightning as pl\n\nimport spacetimeformer as stf\n\nfrom .linear_ar import LinearModel\n\n\nclass Linear_Forecaster(stf.Forecaster):\n def __init__(\n self,\n d_x: int,\n d_yc: int,\n d_yt: int,\n ...
[ [ "torch.zeros_like", "torch.cat" ] ]
bewithaman/scipy
[ "9eea599120903c9f88fb16ba6b39af77cf7d70e5" ]
[ "scipy/signal/windows.py" ]
[ "\"\"\"The suite of window functions.\"\"\"\nfrom __future__ import division, print_function, absolute_import\n\nimport warnings\n\nimport numpy as np\nfrom scipy import special, linalg\nfrom scipy.fftpack import fft\nfrom scipy._lib.six import string_types\n\n__all__ = ['boxcar', 'triang', 'parzen', 'bohman', 'bla...
[ [ "numpy.abs", "numpy.linspace", "numpy.sqrt", "numpy.arange", "scipy.linalg.eig_banded", "scipy.special.i0", "numpy.arccosh", "numpy.cos", "numpy.ones", "numpy.concatenate", "numpy.sin", "scipy.fftpack.fft", "numpy.less_equal", "numpy.floor", "numpy.exp",...
deepmipt/rasa
[ "f0cc0ff6e515df2249998ff4e788009cccaecc02" ]
[ "rasa/nlu/featurizers/count_vectors_featurizer.py" ]
[ "import logging\nimport os\nimport re\nfrom typing import Any, Dict, List, Optional, Text\n\nfrom sklearn.feature_extraction.text import CountVectorizer\n\nfrom rasa.nlu import utils\nfrom rasa.nlu.config import RasaNLUModelConfig\nfrom rasa.nlu.featurizers import Featurizer\nfrom rasa.nlu.model import Metadata\nfr...
[ [ "sklearn.feature_extraction.text.CountVectorizer" ] ]
idlrl/flare
[ "33b71b4864812b89a28120b01fbc886e6e690376" ]
[ "flare/examples/dqn_example.py" ]
[ "from random import randint\nimport torch.nn as nn\nfrom flare.algorithm_zoo.simple_algorithms import SimpleQ\nfrom flare.framework.manager import Manager\nfrom flare.model_zoo.simple_models import SimpleModelQ\nfrom flare.framework.common_functions import rl_safe_batchnorm\nfrom flare.framework.agent import ExpRep...
[ [ "torch.nn.Linear", "torch.nn.ReLU" ] ]
Bibbidi-Babbidi-Boo/Domain-Decomposition
[ "5c33a84929e084cf458974f95310f997c6c5b1ec" ]
[ "ACNet.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras.layers import Dense, Conv2D, MaxPool2D ,Flatten\nimport numpy as np\nfrom tensorflow.nn.rnn_cell import BasicLSTMCell\n\n#parameters for training\nGRAD_CLIP = 32.\nKEEP_PROB1 = 1 # was 0.5\nKEEP_PROB2 = 1 # was ...
[ [ "tensorflow.nn.dynamic_rnn", "tensorflow.concat", "tensorflow.nn.rnn_cell.LSTMStateTuple", "numpy.random.randn", "numpy.square", "tensorflow.contrib.layers.variance_scaling_initializer", "tensorflow.get_collection", "tensorflow.keras.layers.Conv2D", "tensorflow.gradients", ...
weelingtan/LocIT
[ "0795a6cbb64a72b7906824b451d2bbb4559b080d" ]
[ "models/coral.py" ]
[ "# -*- coding: UTF-8 -*-\n\"\"\"\n\nCORAL.\n\n:author: Vincent Vercruyssen (2019)\n:license: Apache License, Version 2.0, see LICENSE for details.\n\"\"\"\n\nimport numpy as np\nimport scipy as sp\n\nfrom sklearn.utils.validation import check_X_y\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.neigh...
[ [ "numpy.dot", "numpy.eye", "sklearn.neighbors.KNeighborsClassifier", "sklearn.preprocessing.StandardScaler", "numpy.cov", "sklearn.utils.validation.check_X_y", "scipy.linalg.fractional_matrix_power", "numpy.zeros", "numpy.where", "numpy.vstack" ] ]
b2m/core
[ "9c5bbbac0f7bd0e0017870b8cafa0954d842d844" ]
[ "ocrd_utils/ocrd_utils/image.py" ]
[ "import sys\n\nimport numpy as np\nfrom PIL import Image, ImageStat, ImageDraw, ImageChops\n\nfrom .logging import getLogger\nfrom .introspect import membername\n\n__all__ = [\n 'adjust_canvas_to_rotation',\n 'adjust_canvas_to_transposition',\n 'bbox_from_points',\n 'bbox_from_polygon',\n 'bbox_from_...
[ [ "numpy.dot", "numpy.linalg.inv", "numpy.eye", "numpy.cos", "numpy.sin", "numpy.round", "numpy.deg2rad", "numpy.delete", "numpy.insert", "numpy.array" ] ]
RangerOnMars/TUP-NN-Train
[ "0f40038cecb09b0fff6adff44a1216aae0a492f4" ]
[ "yolox/core/trainer.py" ]
[ "#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Copyright (c) Megvii, Inc. and its affiliates.\n\nimport datetime\nimport os\nimport time\nfrom loguru import logger\nimport cv2\nimport numpy as np\nfrom teacher.teacher_model import Teacher\n\nimport torch\nfrom torch.nn.parallel import DistributedDataParallel as...
[ [ "torch.cuda.set_device", "torch.load", "torch.cuda.amp.autocast", "torch.cuda.amp.GradScaler", "torch.utils.tensorboard.SummaryWriter", "torch.nn.parallel.DistributedDataParallel" ] ]
sreesxlnc/kaggle-right-whale
[ "f5b8a369866144c7b9ccfeed803b578ae10abe3e" ]
[ "utils/__init__.py" ]
[ "import sys\nimport logging\n\nimport numpy as np\n\nfrom sklearn.cross_validation import ShuffleSplit\n# from sklearn.cross_validation import StratifiedShuffleSplit\nfrom sklearn.cross_validation import StratifiedKFold\n\n\nclass TrainSplit(object):\n def __init__(self, eval_size, stratify=True, random_state=No...
[ [ "sklearn.cross_validation.StratifiedKFold", "sklearn.cross_validation.ShuffleSplit" ] ]
astraw/matplotlib-ancient
[ "7272f102482941ada6e5fd874bdf7f185f420526" ]
[ "lib/matplotlib/projections/geo.py" ]
[ "import math\n\nimport numpy as np\nimport numpy.ma as ma\n\nimport matplotlib\nrcParams = matplotlib.rcParams\nfrom matplotlib.axes import Axes\nfrom matplotlib import cbook\nfrom matplotlib.patches import Circle\nfrom matplotlib.path import Path\nimport matplotlib.spines as mspines\nimport matplotlib.axis as maxi...
[ [ "numpy.sqrt", "numpy.arctan", "numpy.linspace", "matplotlib.transforms.Affine2D", "numpy.concatenate", "matplotlib.transforms.Transform.__init__", "numpy.any", "matplotlib.axes.Axes.cla", "numpy.ma.masked_where", "numpy.where", "numpy.ma.sin", "numpy.arcsin", "m...
ficinator/transformers
[ "f1e4db2aa80d72bfe9992476ccca52348a789db0" ]
[ "templates/adding_a_new_model/modeling_xxx.py" ]
[ "# coding=utf-8\n# Copyright 2018 XXX 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 applicabl...
[ [ "torch.nn.MSELoss", "torch.nn.Dropout", "torch.nn.CrossEntropyLoss", "torch.zeros_like", "torch.from_numpy", "numpy.transpose", "tensorflow.train.load_variable", "torch.nn.Linear", "tensorflow.train.list_variables", "torch.ones_like" ] ]
def-mycroft/swifter
[ "c93f0cebad68526a024ca3c4713cec2acdddcd02" ]
[ "swifter/swifter_tests.py" ]
[ "import unittest\nimport time\n\nimport numpy as np\nimport pandas as pd\nimport swifter\n\nprint(f\"Version {swifter.__version__}\")\n\n\ndef math_vec_square(x):\n return x ** 2\n\n\ndef math_foo(x, compare_to=1):\n return x ** 2 if x < compare_to else x ** (1 / 2)\n\n\ndef math_vec_multiply(row):\n retur...
[ [ "pandas.testing.assert_series_equal", "pandas.Series", "numpy.arange", "pandas.DataFrame", "numpy.random.normal", "pandas.testing.assert_frame_equal", "pandas.date_range", "numpy.random.uniform" ] ]
fabod/pro2_demos
[ "6ff1babf07eefa90db2a6d36727c290c7085c588" ]
[ "demo_snippets/14_Pandas/demos/visualization.py" ]
[ "import pandas as pd\nimport matplotlib.pyplot as plt\n\n\ndef main(csv):\n names = ['preg', 'plas', 'pres', 'skin', 'test', 'mass', 'pedi', 'age', 'class']\n df = pd.read_csv(csv, names=names)\n\n df.boxplot()\n df.hist()\n df.groupby(\"class\").hist()\n plt.show()\n" ]
[ [ "pandas.read_csv", "matplotlib.pyplot.show" ] ]
adamoudad/dissimilarity-approximation
[ "d5b2c7e56e1ff45f1409729fa25a6f409a049dcd" ]
[ "approximation/approx2/constraints.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n'''\n***********************\nGestion des contraintes\n***********************\n\nFonctions de manipulation des contraintes\n\n'''\n\nfrom dissimilarity import *\nfrom approximation.approx2.functions import *\n\nimport numpy as np\n\n\ndef ini_contraints(D0):\n ...
[ [ "numpy.zeros" ] ]
UnreliableBuilder/TFFL
[ "993493122ea908173eba68525482d5d522db236c" ]
[ "tensorflow_federated/python/research/triehh/triehh_tf_test.py" ]
[ "# Copyright 2020, The TensorFlow Federated Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a...
[ [ "tensorflow.constant", "tensorflow.zeros", "tensorflow.shape", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.test.main", "tensorflow.function" ] ]
yonycherkos/lung-disease-diagnosis
[ "0bf998e1a202247b584334888a6ffbf7a1e2e70d" ]
[ "chest_xray/predict.py" ]
[ "# import the necessary packages\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport os\nimport argparse\nimport cv2\nfrom tensorflow.keras.models import load_model\nfrom helper import config, utils, heatmap\n\n\ndef preprocess_image(image, target_size=(224, 224)):\n image = cv2.cvt...
[ [ "numpy.round", "tensorflow.keras.models.load_model", "numpy.array", "numpy.expand_dims" ] ]
aasensio/hazel2
[ "d9b551915f5d2bb399e03b054dffe4ca42fedeb5" ]
[ "hazel/parametric.py" ]
[ "from collections import OrderedDict\nimport numpy as np\nimport os\nfrom hazel.atmosphere import General_atmosphere\nfrom hazel.util import fvoigt\nfrom hazel.hsra import hsra_continuum\nfrom hazel.io import Generic_parametric_file\nimport copy\n\n__all__ = ['Parametric_atmosphere']\n\nclass Parametric_atmosphere(...
[ [ "numpy.log", "numpy.abs", "numpy.clip", "numpy.atleast_1d", "numpy.zeros" ] ]
LevinJ/carnd_advanced_lane_lines
[ "0abba7297d03556cb063f1934382dd862f6f98a7" ]
[ "thresholding/thresholding.py" ]
[ "import numpy as np\nimport matplotlib.image as mpimg\nimport matplotlib.pyplot as plt\nimport cv2\nimport os\n\n\n\nclass Thresholding:\n def __init__(self):\n \n \n return\n def abs_sobel_thresh(self, img, orient='x', thresh_min=0, thresh_max=255):\n # Convert to grayscale\n ...
[ [ "numpy.max", "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "numpy.zeros_like" ] ]
eyalbetzalel/GlowGAN
[ "144b8fef60d9dc38ca66c178a18c0c9a2a17c23e" ]
[ "GlowGan/realnvp_gan/fdiv.py" ]
[ "import numpy as np\ndef kld(p, q, revFlag=False):\n\n # Original Calculation : (1.0 / len(p)) * sum((np.log(p[i] / q[i]) for i in range(len(p)))\n\n # Variance calculation using Jack-Knife Resampling method :\n\n # Step 1 - Calculate xi :\n\n p_np = np.asarray(p)\n q_np = np.asarray(q)\n if revFl...
[ [ "numpy.log", "numpy.abs", "numpy.power", "numpy.asarray", "numpy.delete" ] ]
tmatsuo/python-bigquery
[ "8360487582f245d20893acbe8cbf92d0fc4cd9d9" ]
[ "google/cloud/bigquery/_pandas_helpers.py" ]
[ "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed t...
[ [ "pandas.Series", "pandas.DataFrame" ] ]
imademethink/MachineLearning_related_Python
[ "c7fd22d2d878d110e0a7bf679103a226952164e7", "c7fd22d2d878d110e0a7bf679103a226952164e7" ]
[ "prg06_scikitlearn/s2.py", "prg05_scipy/scipy01_kmeans_clustering.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn import linear_model\n\nhouse_price = np.array([245, 312, 279, 308, 199, 219, 405, 324, 319, 255])\n\nsize = np.array([1400, 1600, 1700, 1875, 1100, 1550, 2350, 2450, 1425, 1700])\n\nsize2 = np.arr...
[ [ "matplotlib.pyplot.scatter", "matplotlib.pyplot.plot", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ], [ "numpy.array", "numpy.random.rand", "scipy.cluster.vq.vq", "scipy.clu...
MthBr/well-plate-light-driven-predictions
[ "d313c5ff8f589516cb6f65f422626faed5bf6dd2", "d313c5ff8f589516cb6f65f422626faed5bf6dd2" ]
[ "well_plate_project/data_etl/backup_test/preprocessing_fabio.py", "well_plate_project/feature_eng/plot_rag_boundary.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Nov 2 12:52:01 2020\n\n@author: modal\n\"\"\"\n#%% Clean Memory and import pakage with folders\nfor i in list(globals().keys()):\n if(i[0] != '_'):\n exec('del {}'.format(i))\n\nfrom well_plate_project.config import data_dir, report...
[ [ "numpy.int0", "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "numpy.expand_dims", "numpy.uint8", "numpy.around", "numpy.float32", "matplotlib.pyplot.xticks", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ], [ "matplotlib.pyplot.col...
sheabrown/faraday_complexity
[ "49f5ead79d53bc62f41e5e8450316c03d25ccdef" ]
[ "final/loadData.py" ]
[ "import numpy as np\nfrom keras.utils import np_utils\n\nclass loadData:\n\t\"\"\"\n\tClass for loading in the testing, \n\ttraining, and validation datasets.\n\n\tFunctions:\n\t\t_loadTest()\n\t\t_loadTrain()\n\t\t_loadValid()\n\t\"\"\"\n\n\n\tdef __load(self, dir, abs=False):\n\t\tfeatures = np.load(dir + \"X_dat...
[ [ "numpy.load", "numpy.abs" ] ]
MIVRC-CV/MSRN_PyTorch
[ "a0e038de7eb42e21d2e88c38e6490b61a02c566e" ]
[ "OLD/model.py" ]
[ "import torch\nimport torch.nn as nn\nimport numpy as np\nimport math\nimport torch.nn.init as init\n\n\n# --------------------------MSRB------------------------------- #\n\nclass MSRB_Block(nn.Module):\n def __init__(self):\n super(MSRB_Block, self).__init__()\n \n channel = 64\n\n s...
[ [ "torch.nn.Sequential", "torch.add", "torch.cat", "torch.nn.Conv2d", "torch.nn.PixelShuffle", "torch.nn.ReLU" ] ]
DarthLazar/pyHalo
[ "aac61ed4dd6bb9df1f8295760c6ec5f6099f8983" ]
[ "pyHalo/Halos/HaloModels/coreTNFW.py" ]
[ "from pyHalo.Halos.halo_base import Halo\nfrom pyHalo.Halos.HaloModels.TNFW import TNFWFieldHalo, TNFWSubhalo\nfrom lenstronomy.LensModel.Profiles.tnfw import TNFW\nimport numpy as np\n\n\nclass coreTNFWBase(Halo):\n \"\"\"\n The main class for a cored NFW field halo profile\n\n See the base class in Halos...
[ [ "numpy.round" ] ]
MonashSmartStructures/OpenModal
[ "a76a258c420954eab4a8b4ef37b487616c9f6c62" ]
[ "OpenModal/analysis/lsce.py" ]
[ "\n# Copyright (C) 2014-2017 Matjaž Mršnik, Miha Pirnat, Janko Slavič, Blaž Starc (in alphabetic order)\n# \n# This file is part of OpenModal.\n# \n# OpenModal is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundat...
[ [ "numpy.log", "numpy.fft.irfft", "numpy.linalg.pinv", "numpy.append", "numpy.zeros" ] ]
Leengit/HistomicsDetect
[ "ae9114c6d40af299a460417fe9470764155156a9" ]
[ "histomics_detect/visualization/lnms_visualization.py" ]
[ "from typing import Tuple, List\n\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\n\nfrom histomics_detect.boxes.transforms import filter_edge_boxes\nfrom histomics_detect.anchors.create import create_anchors\nfrom histomics_detect.metrics import greedy_iou_mapping\nfrom histomics_detect.metrics.iou impor...
[ [ "tensorflow.constant", "tensorflow.shape", "tensorflow.greater", "tensorflow.reshape", "tensorflow.cast", "tensorflow.expand_dims", "tensorflow.gather", "tensorflow.keras.optimizers.Adam", "tensorflow.where", "matplotlib.pyplot.subplots_adjust", "tensorflow.split", ...
YaoshiHuang/DeepSDF_2D
[ "e0200dd3bb32d35b2947a92cfa77675d83e4ee8c" ]
[ "deep_sdf/metrics/chamfer.py" ]
[ "#!/usr/bin/env python3\n# Copyright 2004-present Facebook. All Rights Reserved.\n\nimport numpy as np\nfrom scipy.spatial import cKDTree as KDTree\nimport trimesh\n\n\ndef compute_trimesh_chamfer(gt_points, rec_blank):\n \"\"\"\n This function computes a symmetric chamfer distance, i.e. the sum of both chamf...
[ [ "numpy.square", "scipy.spatial.cKDTree" ] ]
CAMP-eXplain-AI/imba-explain
[ "e41b4ca5de63955cb0e925aad9599f38c5a3e973" ]
[ "imba_explain/explain_apis/concept_detector.py" ]
[ "import logging\nfrom collections import defaultdict\nfrom itertools import chain\nfrom typing import Dict, List, Optional, Sequence, Tuple, Union\n\nimport cv2\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom ignite.utils import setup_logger\nfrom tabulate import tabu...
[ [ "torch.permute", "numpy.min", "numpy.stack", "numpy.max", "numpy.std", "torch.quantile", "torch.no_grad", "numpy.mean", "torch.nn.functional.interpolate" ] ]
RawFisher/YOLOX
[ "bec9423bdd25a9e85b976c32d774e31a33fcefed", "bec9423bdd25a9e85b976c32d774e31a33fcefed" ]
[ "yolox/exp/simo_yolox.py", "yolox/exp/yolox_ea.py" ]
[ "#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.\n\nimport os\nimport random\n\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\n\nfrom .base_exp import BaseExp\n\n\nclass SIMOExp(BaseExp):\n def __init__(self):\n super().__i...
[ [ "torch.distributed.broadcast", "torch.LongTensor", "torch.utils.data.distributed.DistributedSampler", "torch.utils.data.SequentialSampler", "torch.utils.data.DataLoader", "torch.distributed.barrier", "torch.nn.functional.interpolate", "torch.optim.SGD", "torch.distributed.get_w...
mindThomas/acados
[ "f4c6311f7a0cf3736afa7e3b40fac7e53e4324cb", "f4c6311f7a0cf3736afa7e3b40fac7e53e4324cb" ]
[ "examples/acados_python/chain_mass/export_disturbed_chain_mass_model.py", "examples/acados_python/getting_started/ocp/example_sqp_rti_loop.py" ]
[ "#\n# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren,\n# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor,\n# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan,\n# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf, Moritz Diehl\n#\n# This file is pa...
[ [ "numpy.array" ], [ "numpy.diag", "numpy.linspace", "numpy.eye", "numpy.ndarray", "numpy.array", "numpy.zeros" ] ]
mapdwell/numpy-hilbert-curve
[ "e8712a74cb22953b341f9b3e0a275145c0d19102", "e8712a74cb22953b341f9b3e0a275145c0d19102" ]
[ "hilbert/encode.py", "hilbert/tests/test_gray.py" ]
[ "import numpy as np\n\nfrom .gray import gray2binary\n\ndef encode(locs, num_dims, num_bits):\n ''' Decode an array of locations in a hypercube into a Hilbert integer.\n\n This is a vectorized-ish version of the Hilbert curve implementation by John\n Skilling as described in:\n\n Skilling, J. (2004, April). Pro...
[ [ "numpy.logical_not", "numpy.swapaxes", "numpy.logical_xor", "numpy.pad", "numpy.reshape", "numpy.unpackbits" ], [ "numpy.testing.assert_equal", "numpy.random.seed", "numpy.random.geometric", "numpy.ones", "numpy.testing.assert_array_equal", "numpy.random.rand", ...
encryptogroup/CryptoSPN
[ "bb4cb6c035eaa02f8ac789ab66321d8e0160304b" ]
[ "example.py" ]
[ "\"\"\"\n@author: Amos Treiber\n\"\"\"\nimport logging\nimport sys\nimport numpy as np\nfrom spn.algorithms.Inference import log_likelihood\n\nfrom spn.structure.Base import Context\nfrom spn.structure.leaves.parametric.Parametric import Bernoulli\nfrom spn.algorithms.LearningWrappers import learn_parametric\nfrom ...
[ [ "numpy.random.binomial", "numpy.random.seed", "numpy.savetxt" ] ]
renchao-lu/iphreeqc
[ "efc07ccbb9698e7a97813db99716a55c49592a89" ]
[ "examples/com/python/Gypsum.py" ]
[ "\"\"\"Compares gypsum solubility for WATEQ4F and Pitzer databases.\n\"\"\"\n# Import standard library modules first.\nimport os\n# Then get third party modules.\nfrom win32com.client import Dispatch\nimport matplotlib.pyplot as plt\n\ndef selected_array(db_path, input_string):\n \"\"\"Load database via COM and ...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.axis", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
gpleiss/vision
[ "7a975284a88a3c722a92a7962180781df2acfa68" ]
[ "torchvision/models/inception.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.model_zoo as model_zoo\n\n\n__all__ = ['Inception3', 'inception_v3']\n\n\nmodel_urls = {\n # Inception v3 ported from TensorFlow\n 'inception_v3_google': 'https://download.pytorch.org/models/inception_v3_google-1a9a5a14....
[ [ "torch.cat", "torch.nn.functional.dropout", "torch.utils.model_zoo.load_url", "torch.nn.functional.avg_pool2d", "torch.nn.Conv2d", "scipy.stats.truncnorm", "torch.nn.Linear", "torch.nn.functional.relu", "torch.nn.BatchNorm2d", "torch.nn.functional.max_pool2d" ] ]
Nabagata/datasets
[ "dcaa4c76905bb9eb14b4e0947d1fce15c48aea0f", "dcaa4c76905bb9eb14b4e0947d1fce15c48aea0f" ]
[ "tensorflow_datasets/scripts/replace_fake_images.py", "tensorflow_datasets/core/dataset_builder.py" ]
[ "# coding=utf-8\n# Copyright 2020 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "numpy.ones_like" ], [ "tensorflow.compat.v2.data.Options", "tensorflow.compat.v2.device", "tensorflow.compat.v2.io.gfile.exists", "tensorflow.compat.v2.io.gfile.makedirs", "tensorflow.compat.v2.compat.v1.data.get_output_shapes", "tensorflow.compat.v2.io.gfile.listdir", "tensor...
alicebizeul/nobrainer
[ "6817eab85ea17cb733f04b1d9fa6cbcf328dc0ce" ]
[ "nobrainer/layers/dropout.py" ]
[ "\"\"\"Dropout layers in `tf.keras`.\"\"\"\n\nimport math\n\nimport tensorflow as tf\n\ntfk = tf.keras\ntfkl = tfk.layers\n\n# TODO: add `K.in_train_phase`.\n\n\nclass BernoulliDropout(tfkl.Layer):\n \"\"\"Bernoulli dropout layer.\n\n Outputs the input element multiplied by a random variable\n sampled from...
[ [ "tensorflow.math.log", "tensorflow.shape", "tensorflow.nn.dropout" ] ]
godweiyang/lightseq
[ "a23f6807c354410fbd3bb11a17918e99c7af6272" ]
[ "tests/fairseq_layers.py" ]
[ "\"\"\"\nCopyright 2021 The LightSeq Team\nCopyright Facebook Fairseq\nWe use layers from Facebook Fairseq as our baseline for unit test\n\"\"\"\n\nfrom typing import Dict, List, Optional\nimport math\nfrom copy import deepcopy\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom fairseq im...
[ [ "torch.nn.functional.dropout", "torch.nn.init.constant_", "torch.cat", "torch.zeros", "torch.sin", "torch.nn.Embedding", "torch.nn.Linear", "torch.nn.init.normal_", "torch.arange", "torch.device", "torch.cumsum", "torch.ones_like", "torch.cos", "torch.ne" ...
tariqdaouda/pegasus
[ "02c3ec09724f7c55b32831be509edc9d39bae7e5", "a4eef908ddcee7715ab18c632ea60f7f3aa5ea1c" ]
[ "tests/test_preprocessing.py", "pegasus/plotting/plot_qc.py" ]
[ "import unittest\n\nimport pegasus as pg\nimport anndata\nimport numpy as np\nfrom scipy.sparse import csr_matrix\n\n\nclass TestPreprocessing(unittest.TestCase):\n def test_log_norm(self):\n X = csr_matrix([[1, 11], [2, 20], [5, 6]])\n adata = anndata.AnnData(X)\n adata.var[\"robust\"] = Tr...
[ [ "scipy.sparse.csr_matrix" ], [ "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "numpy.unique", "matplotlib.pyplot.savefig", "matplotlib.pyplot.gcf", "matplotlib.pyplot.close", "numpy.argsort" ] ]
UCBerkeley-SCET/DataX-Berkeley
[ "f912d22c838b511d3ada4ecfa3548afd80437b74", "f912d22c838b511d3ada4ecfa3548afd80437b74" ]
[ "student-projects/fall-2020/OST-Imaging-and-Matching-Plastic/surface_recognition/comparisons/timeMeas_OldButGold.py", "student-projects/fall-2020/OST-Imaging-and-Matching-Plastic/mvp/MatchingVisualization.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Nov 23 11:59:55 2020\r\n\r\n@author: tobias.grab\r\n\"\"\"\r\n\r\nfrom skimage.transform import rotate\r\nfrom skimage.transform import downscale_local_mean\r\nimport keras\r\nfrom keras.layers import Input, Dense, Conv2D, MaxPooling2D, UpSampling2D, BatchNormali...
[ [ "numpy.std", "numpy.mean", "numpy.argpartition", "numpy.zeros", "numpy.sum" ], [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
yuzhoul1991/squad_challenge
[ "1289ed643b4b1c65ede2c02e06f8325ea3855b51" ]
[ "code/modules.py" ]
[ "# Copyright 2018 Stanford University\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agr...
[ [ "tensorflow.matmul", "tensorflow.nn.softmax", "tensorflow.concat", "tensorflow.transpose", "tensorflow.python.ops.rnn_cell.GRUCell", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.squeeze", "tensorflow.nn.bidirectional_dynamic_rnn", "tensorflow.contrib.layers.fully...
barak/autograd
[ "4a693a2daac6435cb6bddf6b18bd918a46591a82" ]
[ "examples/gmm.py" ]
[ "# Implements a Gaussian mixture model, in which parameters are fit using\n# gradient descent. This example runs on 2-dimensional data, but the model\n# works on arbitrarily-high dimension.\n\n\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nimport matplotlib.pyplot as plt\n\nimport...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.draw", "matplotlib.pyplot.pause", "matplotlib.pyplot.figure" ] ]
related-sciences/gwas-analysis
[ "c3e8fbc3dff1d25109b01a62fc372555306ecbb3" ]
[ "notebooks/platform/xarray/lib/stats/core.py" ]
[ "import xarray as xr\nimport pandas as pd\nimport numpy as np\nfrom xarray import Dataset, DataArray\nfrom typing import Optional, Union, Type, Tuple, Callable\nfrom typing_extensions import Literal\nfrom numpy import ndarray\nfrom .axis_intervals import ChunkInterval\nfrom ..dispatch import register_function, regi...
[ [ "numpy.asarray", "pandas.DataFrame" ] ]
lukasHoel/neural_renderer
[ "a122303459963650d04597cfb5f9ec36e3ea5318" ]
[ "neural_renderer/look.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn.functional as F\n\n\ndef vis(vertices):\n import open3d as o3d\n pcd = o3d.geometry.PointCloud()\n points = vertices[0].detach().cpu().numpy()\n pcd.points = o3d.utility.Vector3dVector(points)\n #o3d.visualization.draw_geometries([pcd])\n\n viewer...
[ [ "torch.nn.functional.normalize", "torch.cat", "numpy.asarray", "torch.is_tensor", "torch.from_numpy", "torch.tensor", "torch.cuda.FloatTensor", "torch.cross" ] ]
descarteslabs/descarteslabs-python
[ "efc874d6062603dc424c9646287a9b1f8636e7ac" ]
[ "descarteslabs/common/dltile/_tiling.py" ]
[ "\"\"\"Implementation details for tile.Grid.tiles_from_shape\"\"\"\n\nimport numpy as np\nimport shapely.geometry as geo\n\nfrom .exceptions import InvalidShapeError\nfrom .utm import (\n UTM_MIN_LAT,\n UTM_MAX_LAT,\n UTM_MIN_EAST,\n UTM_MAX_EAST,\n FALSE_EASTING,\n lonlat_to_utm,\n)\nfrom .utils ...
[ [ "numpy.ceil", "numpy.floor" ] ]
mssung94/coursework
[ "8bb683631d7c0d117b41a30868f775f5cea1d38e" ]
[ "2020_01_deep_learning/hw/hw1/perceptron.py" ]
[ "import os\nimport glob\nimport numpy as np\nimport matplotlib.pyplot\nimport imageio\nfrom tqdm import tqdm\nfig = matplotlib.pyplot.figure()\nplt = fig.add_subplot(111)\n\n# 퍼셉트론 클래스\nclass Perceptron():\n # 초기화\n def __init__(self,example,thresholds=0.0,eta=0.01,n_iter=10):\n self.thresholds = thre...
[ [ "numpy.arange", "numpy.random.normal", "numpy.sum" ] ]
fomorians/td-gammon
[ "b9471f40321fc86a937e5d2b74b4dc086ff47aa8" ]
[ "model.py" ]
[ "from __future__ import division\n\nimport time\nimport random\nimport numpy as np\nimport tensorflow as tf\n\nfrom backgammon.game import Game\nfrom backgammon.agents.human_agent import HumanAgent\nfrom backgammon.agents.random_agent import RandomAgent\nfrom backgammon.agents.td_gammon_agent import TDAgent\n\n# he...
[ [ "tensorflow.control_dependencies", "tensorflow.reduce_sum", "tensorflow.train.ExponentialMovingAverage", "tensorflow.group", "tensorflow.Variable", "tensorflow.merge_all_summaries", "tensorflow.gradients", "tensorflow.train.exponential_decay", "tensorflow.initialize_all_variabl...
ver217/ColossalAI
[ "b31daed4cfae438bdb656439e240c6efb9f87494" ]
[ "colossalai/zero/init_ctx/init_context.py" ]
[ "import contextlib\nimport functools\nfrom typing import Optional\n\nimport torch\nfrom colossalai.context.parallel_mode import ParallelMode\nfrom colossalai.core import global_context as gpc\nfrom colossalai.context.singleton_meta import SingletonMeta\nfrom colossalai.logging import get_dist_logger\nfrom colossala...
[ [ "torch.cuda.current_device", "torch.zeros" ] ]
ashleychontos/sortasurvey
[ "f54b6d81658916dc6d8e69ff0a91d069ecd8e440" ]
[ "sortasurvey/sample.py" ]
[ "import os\nimport glob\nimport numpy as np\nimport pandas as pd\n\nfrom sortasurvey.observing import Instrument\n\n\nclass Sample:\n \"\"\"\n Creates a filtered sample based on the provided survey program. The most common \n use of the sample is during the target selection process, which calls the \n g...
[ [ "pandas.concat", "numpy.array", "numpy.sum", "pandas.read_csv" ] ]
hupidong/bert
[ "16816eb43ae4246ea1563d708b4878a18a4c2e11" ]
[ "predicting_movie_reviews_with_bert_on_tf_hub.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[ ]:\n\n\n# Copyright 2019 Google Inc.\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-...
[ [ "tensorflow.metrics.true_negatives", "tensorflow.gfile.DeleteRecursively", "tensorflow.nn.log_softmax", "tensorflow.metrics.accuracy", "tensorflow.reduce_sum", "tensorflow.gfile.MakeDirs", "tensorflow.estimator.RunConfig", "tensorflow.Graph", "tensorflow.metrics.precision", ...
robotenique/mlAlgorithms
[ "612d7fb2dcf4430528f63d35d6f1d10a33fee1af" ]
[ "supervised/SVMclassifier/submit.py" ]
[ "import numpy as np\nimport scipy.io\n\nfrom Submission import Submission\nfrom Submission import sprintf\n\nhomework = 'support-vector-machines'\n\npart_names = [\n 'Gaussian Kernel',\n 'Parameters (C, sigma) for Dataset 3',\n 'Email Preprocessing',\n 'Email Feature Extraction',\n ]\n\nsrcs = [\n 'gaussianKe...
[ [ "numpy.round", "numpy.hstack", "numpy.arange" ] ]
gabbar-08/Coupon-Redemption-Prediction
[ "98a65f1ca2c14bf9d6430aeebcb1594b20211bcf" ]
[ "Eval/model.py" ]
[ "\r\n#Step 1 :- Importing dependancies and train test data generated\r\nfrom config import *\r\ntrain_data = pd.read_csv(\"data/train_data/train_feature.csv\")\r\ntest_data = pd.read_csv(\"data/test_data/test_feature.csv\")\r\n\r\n#Step 2 :- Getting train data insights and drop unnecessary columns, Splitting data i...
[ [ "sklearn.model_selection.train_test_split" ] ]
simonbing/HealthGen
[ "d5886a5a41dc36c6a70dece3dba3c60a90bf1fdd" ]
[ "healthgen/eval/gru_d_evaluator.py" ]
[ "\"\"\"\n2021 Simon Bing, ETHZ, MPI IS\n\"\"\"\nimport os\nimport numpy as np\nimport logging\nfrom absl import flags, app\nfrom healthgen.eval.base_evaluator import BaseEvaluator\nfrom healthgen.eval.models.gru_d.gru_d_model import gru_d_model\nimport torch\nfrom torch.utils.data import TensorDataset, DataLoader\n...
[ [ "sklearn.metrics.roc_auc_score", "torch.load", "torch.utils.data.DataLoader", "sklearn.metrics.confusion_matrix", "numpy.argmin", "numpy.zeros_like", "torch.cuda.is_available", "torch.device", "sklearn.metrics.f1_score", "numpy.where", "torch.save", "numpy.stack", ...
ChuchuHan/DMRNet
[ "b933f364c56af148593d7a3b9967479c03aec398" ]
[ "mmdetection/mmdet/datasets/prw.py" ]
[ "from .coco import CocoDataset\nfrom .registry import DATASETS\nimport numpy as np\nfrom collections import defaultdict\nfrom ..core.evaluation.bbox_overlaps import bbox_overlaps\nfrom tqdm import tqdm\nimport pandas as pd\nfrom sklearn.metrics import average_precision_score, precision_recall_curve\nimport os.path ...
[ [ "numpy.logical_not", "numpy.sum", "numpy.asarray", "numpy.arange", "numpy.cumsum", "numpy.nan_to_num", "numpy.ones", "numpy.concatenate", "numpy.mean", "numpy.nanmean", "numpy.prod", "sklearn.metrics.average_precision_score", "numpy.argsort", "numpy.maximum....
smalik169/cross-alligned-auto-encoder
[ "c6d6a6dbc7563676d7ba942b95c7f12f3c9a4991" ]
[ "model.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport numpy as np\n\n\ndef get_rnn(rnn_type, ninputs, nhid, nlayers, dropout=0, bidirectional=False):\n if rnn_type in ['LSTM', 'GRU']:\n return getattr(nn, rnn_type)(ninputs, nhid, nlayers, dropout=dropout,\n ...
[ [ "torch.nn.Softmax", "torch.nn.Dropout", "torch.nn.CrossEntropyLoss", "torch.Size", "torch.max", "torch.cat", "torch.nn.ModuleList", "torch.nn.RNN", "torch.nn.Conv2d", "torch.nn.Embedding", "torch.nn.Linear", "torch.nn.BCEWithLogitsLoss", "torch.nn.LeakyReLU", ...
AdamWang00/DeepSDF
[ "201e91168b2fad409d39bc13a0eeb4a77885c205" ]
[ "visualize_color_cloud.py" ]
[ "import trimesh\nfrom trimesh.viewer import SceneViewer\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nsdf_path = 'data/SdfSamples/3D-FUTURE-model/category_2/192ac441-48b7-4559-bc02-7c532171b531.npz'\nsdf_abs_threshold = 0.01\n\nsdf = np.load(sdf_path)\nsdf_pos = sdf[\"pos\"]\nsdf_neg = sdf[\"neg\"]\nsdf_a...
[ [ "numpy.concatenate", "numpy.load", "matplotlib.pyplot.show", "numpy.abs" ] ]
miguelmorin/tensorflow
[ "ffd4de40fb30cab04745c1f28e924c5e595ac390" ]
[ "tensorflow/python/eager/benchmarks_test.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.dot", "tensorflow.python.data.ops.dataset_ops.Dataset.from_tensors", "tensorflow.python.ops.gen_math_ops.mat_mul", "tensorflow.python.keras.layers.Dense", "tensorflow.python.pywrap_tensorflow.TFE_Py_FastPathExecute", "tensorflow.python.eager.profiler.stop", "tensorflow.python.ea...
vitorsrg/fklearn
[ "4c6323bf78983164351e977891287f883b4b20d7" ]
[ "tests/preprocessing/test_splitting.py" ]
[ "from collections import Counter\n\nimport hypothesis.strategies as st\nimport pandas as pd\nfrom hypothesis import given\nfrom hypothesis.extra.pandas import columns, data_frames, range_indexes\nfrom pandas.util.testing import assert_frame_equal\n\nfrom fklearn.preprocessing.splitting import space_time_split_datas...
[ [ "pandas.util.testing.assert_frame_equal", "pandas.concat", "pandas.to_datetime" ] ]