repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
luhuaei/xlnet
[ "ef415d43ab999165d5ac284962edf0675120e55c" ]
[ "data_utils.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport json\nimport os\nimport random\n\nfrom absl import flags\nimport absl.logging as _logging # pylint: disable=unused-import\n\nimport numpy as np\n\n\nimport tensorflow...
[ [ "tensorflow.concat", "tensorflow.FixedLenFeature", "tensorflow.zeros", "tensorflow.cast", "tensorflow.equal", "numpy.concatenate", "tensorflow.where", "tensorflow.random_shuffle", "tensorflow.io.gfile.Exists", "tensorflow.compat.v1.app.run", "numpy.random.randint", ...
jsleb333/paper-decision-trees-as-partitioning-machines
[ "0f354dac486a9845a9504419e31c84c7eb39507f", "0f354dac486a9845a9504419e31c84c7eb39507f" ]
[ "experiments/pruning.py", "tests/test_utils/test_convert_tree.py" ]
[ "from sklearn.model_selection import KFold\nfrom sklearn.metrics import zero_one_loss\nimport numpy as np\nfrom copy import copy\n\nfrom partitioning_machines import breiman_alpha_pruning_objective\n\n\ndef prune_with_bound(decision_tree, bound):\n \"\"\"\n Prunes the tree as described by Algorithm 3 in Appen...
[ [ "sklearn.metrics.zero_one_loss", "sklearn.model_selection.KFold" ], [ "sklearn.tree.DecisionTreeClassifier", "sklearn.datasets.load_iris" ] ]
tomevans/pyARC
[ "935e3d9b49bca36433e4fb85a43c42b1d10d561d" ]
[ "pyARC/examples/RunEmcee.py" ]
[ "from pyATMO_dev import pyATMO\nfrom pyARC_dev import pyARC\nimport numpy as np\nimport PrepDataset, InstallNamelistParameters\nimport pdb\n\n\n\"\"\"\nThis module demonstrates how to run an emcee retrieval on the synthetic\ndataset generated by the PrepDataset module. ATMO parameters are imported\nfrom the Install...
[ [ "numpy.random.random", "numpy.loadtxt" ] ]
AZdet/causal-infogan
[ "146b647863a27542ad4a1a01ddb033cdcab9843d" ]
[ "logger.py" ]
[ "# Code referenced from https://gist.github.com/gyglim/1f8dfb1b5c82627ae3efcfbbadb9f514\nimport tensorflow as tf\nimport numpy as np\nimport scipy.misc\n\ntry:\n from StringIO import StringIO # Python 2.7\nexcept ImportError:\n from io import BytesIO # Python 3.x\n\n\nclass Logger(object):\n\n def __init...
[ [ "tensorflow.summary.FileWriter", "numpy.min", "numpy.max", "tensorflow.Summary.Value", "numpy.prod", "tensorflow.HistogramProto", "tensorflow.Summary", "numpy.histogram", "numpy.sum" ] ]
vcarehuman/tf-pose-estimation-master
[ "443b2101449a41cdf69cc8f510b58bef8440b641" ]
[ "src/estimator_orginal.py" ]
[ "import itertools\nimport logging\nimport math\nimport pandas as pd\nfrom collections import namedtuple\nfrom datetime import datetime\nimport time\n\n\nimport cv2\nimport numpy as np\nimport tensorflow as tf\nfrom scipy.ndimage import maximum_filter, gaussian_filter\nfrom numpy import array\nimport matplotlib.pypl...
[ [ "numpy.rollaxis", "numpy.dot", "tensorflow.gfile.GFile", "numpy.ndarray", "numpy.arctan2", "numpy.cross", "tensorflow.get_default_graph", "numpy.where", "tensorflow.import_graph_def", "numpy.arange", "numpy.full", "numpy.copy", "tensorflow.Session", "numpy.z...
kylegenova/nerflet
[ "087ed7377c0552837c8ba0e4bead9334992283e9" ]
[ "run_nerf_helpers.py" ]
[ "import os\nimport sys\nimport tensorflow as tf\nimport numpy as np\nimport imageio\nimport json\n\n\n# Misc utils\n\ndef img2mse(x, y): return tf.reduce_mean(tf.square(x - y))\n\n\ndef mse2psnr(x): return -10.*tf.log(x)/tf.log(10.)\n\n\ndef to8b(x): return (255*np.clip(x, 0, 1)).astype(np.uint8)\n\n\n# Positional ...
[ [ "tensorflow.convert_to_tensor", "tensorflow.concat", "tensorflow.stack", "tensorflow.reduce_sum", "tensorflow.minimum", "tensorflow.cast", "tensorflow.where_v2", "tensorflow.linspace", "tensorflow.cumsum", "numpy.ones_like", "tensorflow.keras.Input", "tensorflow.Var...
ChenHao96/tensorflow
[ "82b76ae80ebf5d1f320a6787371b9522e7cd5a69" ]
[ "deepLearning/perceptron3/perceptron.py" ]
[ "import numpy as np\n\nnp.random.seed(42)\ninput_x = np.random.rand(200, 2)\nexample_y = []\n\nfor i in range(len(input_x)):\n result = 3 * input_x[i][0] + 4 * input_x[i][1] - 3.5\n example_y.append(result)\n\nw = np.random.random(2).reshape([2, 1])\nb = np.random.random(1)\n\ndef perceptron(X, W, b):\n re...
[ [ "numpy.dot", "numpy.log", "numpy.random.random", "numpy.random.seed", "numpy.random.rand", "numpy.float_" ] ]
ivanyu/ar-sudoku-solver
[ "50c55fc8c3debc8868ae1f5a6d47683bc45a4159" ]
[ "python/digit_recognizer_2/__init__.py" ]
[ "# -*- coding: utf-8 -*-\nimport os\n\nimport numpy as np\nimport torch\nimport torchvision as tv\n\nfrom .model import DigitRecognizer2\n\n\ndef create_recognizer():\n _digit_recognizer: DigitRecognizer2 = DigitRecognizer2()\n _path = os.path.join(\n os.path.dirname(os.path.dirname(__file__)),\n ...
[ [ "torch.cat", "torch.max", "torch.load" ] ]
mjtadema/pytris
[ "1c69e5757b877915ce98cd86fc603ac4f622e516" ]
[ "pytris/audio.py" ]
[ "# Code based on https://simpleaudio.readthedocs.io/en/latest/tutorial.html#waveobject-s\n# Song composition based on http://www.piano-keyboard-guide.com/how-to-play-the-tetris-theme-song-easy-piano-tutorial-korobeiniki/\n\nimport numpy as np\nimport simpleaudio as sa\n\n# Song improved by Lorenzo Gaifas\nsong = [\...
[ [ "numpy.hstack", "numpy.abs", "numpy.linspace" ] ]
haanme/DWIProstateMotionCorrection
[ "6ea9f52c54a92316ad0b2dcdec593c184e76ad28" ]
[ "bfitASCII_IO.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\n Created on Fri Apr 11 20:20:02 2014\r\n\r\n @author: merisaah\r\n \"\"\"\r\nimport os\r\nimport numpy as np\r\n\r\nclass bfitASCIIError(Exception):\r\n def __init__(self, value):\r\n self.value = value\r\n def __str__(self):\r\n return repr(self.va...
[ [ "numpy.mod", "numpy.array" ] ]
oisc/ChineseDiscourseParser
[ "1363716cc5caa9e9a82987f2ce76fc8b07b4cdfa" ]
[ "segmenter/svm/model.py" ]
[ "# coding: UTF-8\n\nimport logging\nfrom collections import OrderedDict\nfrom nltk import ParentedTree\nfrom sklearn.feature_extraction import DictVectorizer\nfrom sklearn.svm import LinearSVC\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass SVMCommaClassifier:\n def __init__(self, connectives, candidate=\",...
[ [ "sklearn.feature_extraction.DictVectorizer", "sklearn.svm.LinearSVC" ] ]
itsdaveba/rubik-solver
[ "eebae6cffc9f91e64d5f3e49d556a78df0e703f5" ]
[ "tests/test_cube.py" ]
[ "from .context import rubik_solver\r\nfrom .context import available_moves\r\n\r\nimport numpy as np\r\nimport unittest\r\n\r\n\r\nbenchmark_scrambles = [\r\n(\"F' D U' L2 B2 D2 B2 D B F U L2 R2 B2 U' L F' D U2 F' D2 U L U' B' U' B2 U R2 U\",\r\n\tnp.array([ 1, 2, 0, 1, 2, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, ...
[ [ "numpy.array", "numpy.array_equal" ] ]
LogIntelligence/LogADEmpirical
[ "48458aee65c1c84466b04dd4092fae79a7f341fd" ]
[ "logadempirical/neural_log/attention.py" ]
[ "from torch import Tensor\nimport torch.nn.functional as F\nimport torch\nfrom torch import nn\n\n\ndef scaled_dot_product_attention(query: Tensor, key: Tensor, value: Tensor) -> Tensor:\n temp = query.bmm(key.transpose(1, 2))\n scale = query.size(-1) ** 0.5\n softmax = F.softmax(temp / scale, dim=-1)\n ...
[ [ "torch.nn.Linear", "torch.nn.functional.softmax" ] ]
pachecotiago/autobasedoc
[ "14e70a454559435d8a8b8b4fde475c1ba6f94db7" ]
[ "autobasedoc/autoplot.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Sep 16 11:11:12 2015\r\n\r\n@author: johannes\r\n\"\"\"\r\nfrom __future__ import print_function\r\nfrom __future__ import unicode_literals\r\n\r\nimport os\r\nimport sys\r\n\r\nfrom io import BytesIO\r\nfrom functools import wraps\r\nfrom cycler import cycler\r\...
[ [ "matplotlib.use", "matplotlib.colors.cnames.update", "matplotlib.pyplot.ioff", "matplotlib.pyplot.clf", "matplotlib.pyplot.close" ] ]
abelatnvidia/IntroTF
[ "35216d1c149e2cfbf4a3374a2871d8119e585870" ]
[ "src/module_06/code_03.py" ]
[ "import os, glob, tensorflow as tf\n\n# create a file pattern to pick up csv files in pwd\nfile_pattern = os.path.join(os.getcwd(),'*.csv')\n\n# get list of csv files in the current directory\ncsv_files = glob.glob(file_pattern)\n\n# create a queue of files\nfile_queue = tf.train.string_input_producer(csv_files)\n\...
[ [ "tensorflow.constant", "tensorflow.TextLineReader", "tensorflow.decode_csv", "tensorflow.train.start_queue_runners", "tensorflow.train.Coordinator", "tensorflow.train.string_input_producer", "tensorflow.Session" ] ]
andurilhuang/Movie_Income_Prediction
[ "5c705fe60295a175e9dc54191df422fc49ceccd6" ]
[ "paper/historycode/Code/info_data.py" ]
[ "def info_data(): \n import os\n import requests\n import json\n import pandas as pd\n from datetime import datetime\n OMDB_KEY = \"4c427520\"\n\n\n #get imdb_id_list from csv\n profit_df = pd.read_csv('revenue.csv')\n # print profit_df.head()\n imdb_id_list = profit_df['imdb_id']\n ...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
scarecrow1123/pytorch-lightning
[ "b39f4798a6859d2237b48b29b39a2390164612c1" ]
[ "tests/utilities/test_dtype_device_mixin.py" ]
[ "import pytest\nimport torch\nimport torch.nn as nn\n\nfrom pytorch_lightning import Trainer, Callback\nfrom pytorch_lightning.utilities.device_dtype_mixin import DeviceDtypeModuleMixin\nfrom tests.base import EvalModelTemplate\n\n\nclass SubSubModule(DeviceDtypeModuleMixin):\n pass\n\n\nclass SubModule(nn.Modul...
[ [ "torch.device", "torch.cuda.device_count", "torch.cuda.is_available" ] ]
jbutle55/Mask_RCNN
[ "0a584309fa1198216a8d95787c93dace73da35e1" ]
[ "samples/shapes/shapes.py" ]
[ "\"\"\"\nMask R-CNN\nConfigurations and data loading code for the synthetic Shapes dataset.\nThis is a duplicate of the code in the noteobook train_shapes.ipynb for easy\nimport into other notebooks, such as inspect_model.ipynb.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for...
[ [ "numpy.logical_not", "numpy.linspace", "numpy.random.choice", "numpy.arange", "matplotlib.pyplot.subplots", "numpy.ones", "numpy.array", "numpy.zeros" ] ]
PaliC/pytorch
[ "d1a5612a3ea501b83a80b9ecfd6b4dd5eb125181" ]
[ "test/test_jit_fuser_te.py" ]
[ "import operator\nimport unittest\nimport contextlib\nimport math\nimport torch\nimport torch.nn.functional as F\nfrom torch.testing import FileCheck\nfrom typing import List\n\n# these needs to be set before `common_utils`\n# infers `GRAPH_EXECUTOR`.\n# this file **requires** these settings\n# and setting them aft...
[ [ "torch.all", "torch.randint", "torch.max", "torch.rand_like", "torch._C._debug_set_fusion_group_inlining", "torch.zeros", "torch._C._jit_set_profiling_mode", "torch._C._llvm_enabled", "torch._C._jit_set_texpr_reductions_enabled", "torch.cat", "torch.masked_fill", "t...
ILABUTK/handson-ml
[ "dd42ed2cae1d3c1e44dffba3a324c21154f13c01" ]
[ "xp_models/XP_RL/AnyLogic-Python/python_v2/RL_SIM.py" ]
[ "\"\"\"\nReinforcement learning.\n\"\"\"\n\n# import\nimport re\nimport json\nimport logging\nimport subprocess\nimport numpy as np\n\n\nclass RL_Sim_Env:\n \"\"\"\n Reinforcement learning class, using ANYLOGIC to simulate;\n - java_cmd: java command to run the model;\n - no transition function;\n \"...
[ [ "numpy.max", "numpy.argmax" ] ]
UdoGi/dark-matter
[ "3d49e89fa5e81f83144119f6216c5774176d203b" ]
[ "dark/mutations.py" ]
[ "import os\nfrom collections import defaultdict\nimport numpy as np\n\ntry:\n import matplotlib\n if not os.environ.get('DISPLAY'):\n # Use non-interactive Agg backend\n matplotlib.use('Agg')\n import matplotlib.pyplot as plt\nexcept ImportError:\n import platform\n if platform.python_i...
[ [ "numpy.arange", "matplotlib.use", "matplotlib.pyplot.subplots", "numpy.max", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
space-physics/transcar
[ "a9305bd29723beb45004a8882627fa518d8a1bb6" ]
[ "tests/test_all.py" ]
[ "#!/usr/bin/env python\nimport pandas\nfrom pathlib import Path\nimport pytest\nfrom pytest import approx\nimport transcar.base as transcar\nimport transcarread as tr\n\nroot = Path(__file__).parents[1]\nbeam = \"beam947.2\"\nrefdir = root / \"tests\" / beam\nkinfn = \"dir.output/emissions.dat\"\n\n\ndef test_run_t...
[ [ "pandas.read_csv" ] ]
lokax/duckdb
[ "c2581dfebccaebae9468c924c2c722fcf0306944" ]
[ "tools/pythonpkg/tests/fast/arrow/test_filter_pushdown.py" ]
[ "import duckdb\nimport os\nimport pytest\nimport tempfile\ntry:\n import pyarrow as pa\n import pyarrow.parquet as pq\n import pyarrow.dataset as ds\n import numpy as np\n import pandas as pd\n import re\n can_run = True\nexcept:\n can_run = False\n\n## DuckDB connection used in this test\nd...
[ [ "numpy.random.randn", "pandas.testing.assert_frame_equal", "pandas.date_range" ] ]
sanyabt/napdi-kg
[ "fa2f1ac0da13fceb88fd99a5832e0be5c57f88a1" ]
[ "machine_read_scripts/reachJSONextraction.py" ]
[ "import os, sys\nfrom indra.statements import stmts_from_json_file, stmts_to_json_file\nimport pandas as pd\nfrom indra.ontology.bio import bio_ontology\nimport indra.tools.assemble_corpus as ac\nimport re\nimport pickle\nimport requests\nfrom datetime import datetime, timedelta\nimport time\nfrom indra.sources imp...
[ [ "pandas.DataFrame" ] ]
Tarpelite/UniNLP
[ "176c2a0f88c8054bf69e1f92693d353737367c34" ]
[ "examples/run_glue.py" ]
[ "# coding=utf-8\r\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\r\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\...
[ [ "torch.load", "numpy.squeeze", "torch.utils.data.DataLoader", "torch.no_grad", "torch.cuda.manual_seed_all", "torch.cuda.is_available", "torch.device", "torch.distributed.get_rank", "torch.save", "torch.distributed.init_process_group", "torch.utils.data.distributed.Dist...
dstansby/solarsynoptic
[ "e8f2a4d58d8beb3fd5e8d85f6294148653e79e50" ]
[ "aia_helpers.py" ]
[ "from datetime import datetime, timedelta\nimport pathlib\nimport shutil\nimport urllib.request\nimport urllib.error\n\nfrom astropy.coordinates import SkyCoord, Longitude\nfrom astropy.time import Time\nimport astropy.units as u\nfrom astropy.wcs import WCS\nfrom reproject import reproject_interp\n\nimport numpy a...
[ [ "numpy.nanmax", "numpy.isfinite", "numpy.errstate", "numpy.exp", "numpy.zeros" ] ]
qwerty-Bk/dla_hw1
[ "305c71a4bb55c192bd0b6cbdd7dbb11b4731ab22" ]
[ "hw_asr/collate_fn/collate.py" ]
[ "import logging\nimport numpy as np\nimport torch\nfrom typing import List\nfrom speechbrain.utils.data_utils import pad_right_to\n\nlogger = logging.getLogger(__name__)\n\n\ndef collate_fn(dataset_items: List[dict]):\n \"\"\"\n Collate and pad fields in dataset items\n \"\"\"\n\n result_batch = {}\n ...
[ [ "numpy.array", "torch.transpose", "torch.cat" ] ]
andy971022/acg-project
[ "e42b0f9010f5f9fc2c7eb4b9b306ae6321ddfd51" ]
[ "taichi-experiment/sdf_renderer.py" ]
[ "import math\nimport time\n\nimport numpy as np\n\nimport taichi as ti\n\nti.init(arch=ti.gpu)\nres = 1280, 720\ncolor_buffer = ti.Vector.field(3, dtype=ti.f32, shape=res)\nmax_ray_depth = 6\neps = 1e-4\ninf = 1e10\n\nfov = 0.23\ndist_limit = 100\n\ncamera_pos = ti.Vector([0.0, 0.32, 3.7])\nlight_pos = [-1.5, 0.6, ...
[ [ "numpy.sqrt" ] ]
thoth291/holoviews
[ "98b657262e3c9322ad7848b950053d171d661c35" ]
[ "tests/operation/testdatashader.py" ]
[ "from unittest import SkipTest\nfrom nose.plugins.attrib import attr\n\nimport numpy as np\nfrom holoviews import (Dimension, Curve, Points, Image, Dataset, RGB, Path,\n Graph, TriMesh, QuadMesh, NdOverlay, Contours)\nfrom holoviews.element.comparison import ComparisonTestCase\nfrom holoviews....
[ [ "numpy.arange", "numpy.array", "numpy.zeros", "numpy.datetime64" ] ]
u6k/investment-machine-predict-prices
[ "54b433719ad80179043797c2720ed9900d8bd20c", "54b433719ad80179043797c2720ed9900d8bd20c" ]
[ "investment_stocks_predict_trend/predict_3.py", "investment_stocks_predict_trend/agent_2.py" ]
[ "import argparse\n\nfrom sklearn import ensemble\nfrom predict_base import PredictClassificationBase\n\n\nclass PredictClassification_3(PredictClassificationBase):\n def model_fit(self, x_train, y_train):\n return ensemble.RandomForestClassifier(n_estimators=200).fit(x_train, y_train)\n\n\nif __name__ == ...
[ [ "sklearn.ensemble.RandomForestClassifier" ], [ "pandas.read_csv", "numpy.random.randint", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
kandluis/droidlet
[ "3851f0bdac7bc63100cfbcf1c206a94658790352" ]
[ "craftassist/agent/dialogue_objects/schematic_helper.py" ]
[ "\"\"\"\nCopyright (c) Facebook, Inc. and its affiliates.\n\"\"\"\n\nimport random\nimport re\nimport numpy as np\nfrom typing import cast, List, Tuple, Union, Optional\n\n# TODO with subinterpret\nfrom base_agent.dialogue_objects import get_repeat_num\nimport block_data\nimport size_words\nfrom .block_helpers impo...
[ [ "numpy.min" ] ]
RadostW/stochastic
[ "1d437900e0314f18678353fd4794ecefb197761d" ]
[ "examples/sample.py" ]
[ "from pychastic.problems.kp_4_27 import KloedenPlaten4_27\nfrom pychastic.sde_solver import SDESolver\n\nproblem = KloedenPlaten4_27\nsolver = SDESolver()\nsolver.dt = 0.01\nsolution = solver.solve(problem)\n\nexact = problem.exact_solution(problem.x0, solution['time_values'], solution['wiener_values'])\n\nimport m...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.close" ] ]
proxodilka/ibis
[ "1943b6065d2ba89c35856b2d9b8399f15af11c01" ]
[ "ibis/pandas/execution/tests/test_functions.py" ]
[ "import decimal\nimport functools\nimport math\nimport operator\nfrom operator import methodcaller\n\nimport numpy as np\nimport pandas as pd\nimport pandas.util.testing as tm # noqa: E402\nimport pytest\n\nimport ibis\nimport ibis.expr.datatypes as dt # noqa: E402\nfrom ibis.pandas.udf import udf\n\npytestmark =...
[ [ "pandas.util.testing.assert_series_equal" ] ]
rkalahasty/PyHealth
[ "1ee0859d8d39a7fc6f8df48ef8d2bf6c17dcf4a5", "1ee0859d8d39a7fc6f8df48ef8d2bf6c17dcf4a5" ]
[ "pyhealth/models/ecg/rcrnet.py", "pyhealth/models/text/_loss.py" ]
[ "# -*- coding: utf-8 -*-\n\n# License: BSD 2 clause\n\nimport os\nimport torch\nimport torch.nn as nn\nimport pickle\nimport warnings\nimport torchvision.models as models\nfrom ._loss import callLoss\nfrom ._dlbase import BaseControler\nfrom pyhealth.data.data_reader.ecg import rcrnet_reader\nfrom collections impor...
[ [ "torch.nn.BatchNorm1d", "torch.nn.functional.softmax", "torch.nn.LSTM", "torch.nn.ReLU", "torch.utils.data.DataLoader", "numpy.concatenate", "torch.nn.Linear", "torch.nn.functional.sigmoid", "torch.nn.Conv1d", "torch.nn.MaxPool1d", "torch.flatten", "torch.nn.Adaptiv...
nulinspiratie/Qcodes
[ "d050d38ac83f532523a39549c3247dfa6096a36e" ]
[ "qcodes/instrument_drivers/AlazarTech/ATS.py" ]
[ "import socket\nimport ctypes\nfrom ctypes import wintypes as wt\nimport logging\nimport numpy as np\nimport os\n\nfrom qcodes.instrument.base import Instrument\nfrom qcodes.utils import validators\nfrom qcodes.instrument.parameter import Parameter, MultiParameter\n\n# TODO(damazter) (C) logging\n\n# these items ar...
[ [ "numpy.frombuffer", "numpy.array" ] ]
youngleox/gmu
[ "0ab963976098ce7861c462ddae136ac92edd9916", "0ab963976098ce7861c462ddae136ac92edd9916" ]
[ "cifar/models/oneshot.py", "simsiam/main_simsiam.py" ]
[ "import sys\nimport math\nimport numpy as np\nimport torch\nfrom torch import Tensor\nfrom torch.nn.init import constant_\nfrom torch.nn.modules import Module\nfrom torch.nn import functional as F\n\ndef stats(x):\n with torch.no_grad():\n if x.dim() == 4:\n #print(x.shape)\n #print(...
[ [ "torch.no_grad" ], [ "torch.distributed.init_process_group", "torch.multiprocessing.spawn", "torch.utils.data.distributed.DistributedSampler", "torch.cuda.set_device", "torch.manual_seed", "torch.load", "torch.utils.data.DataLoader", "torch.distributed.barrier", "torch....
1713mz/nanodet
[ "b446207c63f81dd4a2451728d141860544fbda99" ]
[ "nanodet/model/backbone/shufflenetv2.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.utils.model_zoo as model_zoo\n\nfrom ..module.activation import act_layers\n\nmodel_urls = {\n \"shufflenetv2_0.5x\": \"https://download.pytorch.org/models/shufflenetv2_x0.5-f707e7126e.pth\", # noqa: E501\n \"shufflenetv2_1.0x\": \"https://download.pytorch.o...
[ [ "torch.nn.Sequential", "torch.transpose", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.init.normal_", "torch.nn.BatchNorm2d", "torch.utils.model_zoo.load_url" ] ]
davesean/modular_semantic_segmentation
[ "5f9e34243915b862e8fef5e6195f1e29f4cebf50" ]
[ "experiments/eval_images_simDisc.py" ]
[ "from os import path, environ\nimport os\nimport glob\nimport sacred as sc\nimport cv2\nimport scipy.misc\nimport numpy as np\nimport tensorflow as tf\nimport zipfile\nfrom sacred.utils import apply_backspaces_and_linefeeds\nfrom experiments.utils import get_observer, load_data\nfrom xview.datasets import Cityscape...
[ [ "tensorflow.Graph", "numpy.asarray", "tensorflow.ConfigProto", "numpy.std", "tensorflow.GPUOptions", "numpy.mean", "numpy.array", "numpy.logical_and", "numpy.zeros" ] ]
sergeykochetkov/kidney-1st
[ "d4d543744a83a8b450af89f932a95a39b55fe893" ]
[ "src/03_generate_pseudo_labels/03_02_pseudo_label_dataset_a_dib/get_config.py" ]
[ "import torch\n\nVERSION = '03_02'\n\ndef get_config():\n config = {\n 'VERSION':VERSION,\n 'INPUT_PATH':'/mnt/750G/GIT/Kidney/data',\n 'OUTPUT_PATH':f'./result/{VERSION}/',\n 'external_data_path': '/mnt/750G/GIT/kidny_unlabeled_dib/DATASET_A_DIB',\n 'split_seed_list':[0],\n ...
[ [ "torch.cuda.is_available" ] ]
nguyenhoa93/pylidc
[ "8f3ef349b9573a894fac301ce8ccd9acbb9b8991" ]
[ "pylidc/Annotation.py" ]
[ "import os, warnings\nimport sqlalchemy as sq\nfrom sqlalchemy.orm import relationship\nfrom ._Base import Base\nfrom .Scan import Scan\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# For contour to boolean mask function.\nimport matplotlib.path as mplpath\n\n# For CT volume visualizer.\nfrom matplotlib...
[ [ "numpy.linspace", "numpy.round", "numpy.roll", "matplotlib.pyplot.tight_layout", "numpy.pad", "numpy.unique", "numpy.arange", "scipy.interpolate.RegularGridInterpolator", "numpy.diff", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.path.Path", "numpy.log...
TatianaPorras/MNIG_to_FMMSP
[ "1a62884237a4133f1417982d88f8a1421a972a08" ]
[ "algorithms/DNEH_SMR.py" ]
[ "from API.functions import c_range, makespan, PT, ct\n\ndef DNEH_SMR(Tn, U_s, Pn):\n \"\"\"\n Tn es la lista de números triangulares difusos del tiempo de producción del trabajo i en la unidad o máquina u, en secuencia de números naturales, 1, 2, 3, ... El prefijo 't' es por triangular difuso.\n\n U_s es e...
[ [ "numpy.argmin", "numpy.sum" ] ]
SunDevilThor/Flight-Schools
[ "b7ae51b1a15894824bc9dc888ceccc1d78c74e5d" ]
[ "Flight-Schools.py" ]
[ "# Flight Schools - Webscraping Project from Upwork\n\n# Objective: Gather data on all of the Airplane Flight Schools in the USA from:\n# https://www.flightschoollist.com/airplane-flight-schools/\n\n# And to create a spreadsheet with the following data:\n\n# 1. Business Name\n# 2. Owner/Director/CEO First and Last ...
[ [ "pandas.DataFrame" ] ]
dickronez/autokeras
[ "b31f2cafe77bf3a2f738289a89438fb72936117c" ]
[ "autokeras/utils.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.util import nest\n\n\ndef get_global_average_pooling(shape):\n return [tf.keras.layers.GlobalAveragePooling1D,\n tf.keras.layers.GlobalAveragePooling2D,\n tf.keras.layers.GlobalAveragePooling3D][len(shape) - 3]\n\n\ndef ge...
[ [ "tensorflow.compat.v1.data.get_output_shapes", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.data.Dataset.zip", "tensorflow.name_scope", "tensorflow.python.util.nest.flatten" ] ]
NovakVed/graph-drawing-algorithm
[ "9a73b3b7b6afe0f6222994166fe01c1e49698b60" ]
[ "Projekt.py" ]
[ "import grandalf\nfrom grandalf.layouts import SugiyamaLayout\nimport networkx as nx\nimport matplotlib.pyplot as plt\nimport csv\n\nG = nx.DiGraph() # Build your networkx graph here\n\nfilename = input(\"Napiši naziv datoteke koje želiš dodati: \")\nwith open(f\"{filename}.csv\") as file:\n reader = csv.reader(...
[ [ "matplotlib.pyplot.show" ] ]
makaveli10/cvu
[ "50b65cc0a6caa9e636804d3ce10a3ee611b44cd8", "50b65cc0a6caa9e636804d3ce10a3ee611b44cd8" ]
[ "cvu/preprocess/image/letterbox.py", "cvu/detector/yolov5/backends/yolov5_tensorrt.py" ]
[ "\"\"\"Original Code Taken From ultralytics/yolov5\nURL: https://github.com/ultralytics/yolov5/blob/master/utils/datasets.py\n\"\"\"\nfrom typing import Tuple\n\nimport numpy as np\nimport cv2\n\n\ndef letterbox(img: np.ndarray,\n new_shape: Tuple[int] = (640, 640),\n color: Tuple[int] = (...
[ [ "numpy.mod" ], [ "numpy.ravel" ] ]
maindolaamit/mllib
[ "03f46089b1d6661dcc3245118b7d108d124e645c", "03f46089b1d6661dcc3245118b7d108d124e645c" ]
[ "cnn/model_builder.py", "utils/charts.py" ]
[ "import importlib\nimport os\nfrom pathlib import Path\n\nimport pandas as pd\nfrom keras.callbacks import EarlyStopping, ModelCheckpoint, ReduceLROnPlateau\nfrom livelossplot.inputs.keras import PlotLossesCallback\nfrom sklearn.model_selection import KFold\nfrom tensorflow.keras.layers import Dropout\nfrom tensorf...
[ [ "pandas.concat", "tensorflow.python.keras.layers.Flatten", "tensorflow.keras.preprocessing.image.ImageDataGenerator", "tensorflow.python.keras.models.Sequential", "sklearn.model_selection.KFold", "pandas.DataFrame", "tensorflow.keras.optimizers.Adam", "tensorflow.python.keras.layer...
iamh2o/oxfs
[ "991e2f9dd2fc5e0e693b57298027a0edffc87fbb" ]
[ "files/iozone_xls_to_graph.py" ]
[ "#!/usr/bin/env python\n\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib\n\nclass XlxToGraph(object):\n def __init__(self):\n self.oxfs_iozone_xls = './oxfs_iozone.xls'\n self.sshfs_iozone_xls = './sshfs_iozone.xls'\n self.oxfs_xls = pd.read_excel(self.oxfs_iozone_xl...
[ [ "pandas.read_excel", "matplotlib.pyplot.title", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.text", "matplotlib.pyplot.show" ] ]
alexchungio/Slimming-Pytorch
[ "98ee08fffa7642d578cc4994b0eb8f534ebc5fb1" ]
[ "models/channel_selection.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\n\n\nclass channel_selection(nn.Module):\n \"\"\"\n Select channels from the output of BatchNorm2d layer. It should be put directly after BatchNorm2d layer.\n The output shape of this layer is determined by the number of 1 in `self.indexes`.\n \"\...
[ [ "numpy.resize", "torch.ones" ] ]
eudoxos/imfractal
[ "a33c5ae5771ba9d4437cb665c0c48dc492e74025" ]
[ "tests/test_bonesShow.py" ]
[ "\"\"\"\nCopyright (c) 2013 Rodrigo Baravalle\nAll rights reserved.\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n1. Redistributions of source code must retain the above copyright\nnotice, this list of conditions an...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "matplotlib.pyplot.subplot" ] ]
pranjukn/AI-Feynman
[ "92e67b01fc2b00ed6ebcacc67edf6122b4219ac7" ]
[ "aifeynman/S_gen_sym.py" ]
[ "import numpy as np\nfrom .RPN_to_eq import RPN_to_eq\nfrom scipy.optimize import fsolve\nfrom sympy import lambdify, N\nimport torch\nimport copy\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .get_pareto import Point, ParetoSet\nfrom .S_get_expr_complexity import get_expr_complexity\nfrom . import ...
[ [ "numpy.arange", "numpy.transpose", "torch.tensor", "numpy.append", "numpy.delete", "torch.no_grad", "numpy.mean", "torch.cuda.is_available", "numpy.std", "numpy.savetxt", "numpy.array", "numpy.flip", "numpy.loadtxt" ] ]
HuJiayin/spark
[ "f6fba2b196346103256fa32a797438fbd5cc001c" ]
[ "python/pyspark/ml/tuning.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo...
[ [ "numpy.argmax", "numpy.zeros", "numpy.argmin" ] ]
ProjectPepperHSB/Backend-Services
[ "06f0a6e58dbc06fc29e8144a149be4978363f036" ]
[ "analysis/weekly-report.py" ]
[ "# ----- I M P O R T S ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----\nimport sys, getpass, traceback\nimport warnings \n\nimport pandas as pd\nimport numpy as np\n# from sklearn.linear_model import LinearRegression\n\nfrom datetime import datetime, timedelta\n\nimport matplotlib.pyplot as ...
[ [ "matplotlib.backends.backend_pdf.PdfPages", "matplotlib.pyplot.gca", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.axis", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.style.use", "matplotlib.pyplot.figure" ] ]
tutu96177/mult_regression
[ "6c8f48f24f1a8c3cb0e8d3446c4a1f9404acdb64" ]
[ "core/data_process.py" ]
[ "# -*- coding: utf-8 -*-#\n\n#-------------------------------------------------------------------------------\n# Name: HLK-20C02(4℃)\n# Description: \n# Author: shichao\n# Date: 2019/7/17\n#-------------------------------------------------------------------------------\n\nimport os\nimport nu...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.legend", "pandas.read_csv", "pandas.to_datetime", "pandas.concat", "pandas.merge", "matplotlib.dates.DateFormatter", "matplotlib.pyplot.savefig", "pandas.DataFrame", "matplotlib.pyplot.plot", "matplotlib.dates.HourLocator", ...
RyanMoussouni/iSeeBetter
[ "af193ae0852f8e477fcd6875dce874eb5092a24a" ]
[ "SRGAN/model.py" ]
[ "import math\n\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\n\n\nclass Generator(nn.Module):\n def __init__(self, scale_factor):\n upsample_block_num = int(math.log(scale_factor, 2))\n\n super(Generator, self).__init__()\n self.block1 = nn.Sequential(\n nn....
[ [ "torch.nn.Sequential", "torch.nn.PReLU", "torch.nn.Conv2d", "torch.nn.PixelShuffle", "torch.nn.AdaptiveAvgPool2d", "torch.nn.LeakyReLU", "torch.nn.BatchNorm2d", "torch.nn.functional.tanh" ] ]
Ivancaminal72/mcv-m6-2018-team3
[ "dcdbc97d6d9534f1c0479e98113f35bca0084d86" ]
[ "Week4/utils.py" ]
[ "import glob\nimport os\nimport cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef rgb2gray(rgb):\n r, g, b = rgb[:,:,0], rgb[:,:,1], rgb[:,:,2]\n gray = 0.2989 * r + 0.5870 * g + 0.1140 * b\n return gray\n\ndef video_to_frame(filename, grayscale=True):\n vidcap = cv2.VideoCapture(filename)...
[ [ "matplotlib.pyplot.imshow", "numpy.absolute", "numpy.isnan", "numpy.arange", "numpy.nanvar", "matplotlib.pyplot.savefig", "numpy.ones", "numpy.nanmean", "matplotlib.pyplot.close", "numpy.count_nonzero", "numpy.array", "numpy.zeros", "numpy.where", "matplotli...
Thenerdstation/mpi4jax
[ "8e2fa86abcf6e775d1acea1b85fe44d15ff57387" ]
[ "mpi4jax/_src/collective_ops/sendrecv.py" ]
[ "import numpy as _np\nfrom mpi4py import MPI as _MPI\n\nfrom jax import abstract_arrays, core\nfrom jax.core import Primitive\nfrom jax.interpreters import ad, xla, batching\nfrom jax.lax import create_token\nfrom jax.lib import xla_client\n\nfrom ..utils import (\n HashableMPIType,\n default_primitive_impl,\...
[ [ "numpy.uintp", "numpy.prod" ] ]
rajesh1226/fastestimator
[ "0765c7478c0889cf4e2841d51a35c9a06a406472" ]
[ "fastestimator/xai/gradcam.py" ]
[ "# Copyright 2019 The FastEstimator 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 r...
[ [ "tensorflow.reduce_max", "tensorflow.concat", "tensorflow.gather_nd", "numpy.ones_like", "tensorflow.range", "numpy.asarray", "tensorflow.cast", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "tensorflow.reduce_min", "matplotlib.pyplot.subplots_adjust", ...
robinzixuan/chatbot
[ "f71eb2a0972563e81fd32d90bb764e91432dad27" ]
[ "nlp_chatbot/metrics.py" ]
[ "from . import PAD_INDEX\n\nimport numpy as np\n\n\ndef mlm_accuracy(predictions, targets):\n mlm_predictions, nsp_predictions = predictions\n mlm_targets, is_nexts = targets\n\n relevent_indexes = np.where(mlm_targets != PAD_INDEX)\n relevent_predictions = mlm_predictions[relevent_indexes]\n releven...
[ [ "numpy.where", "numpy.equal" ] ]
delta2323/chainerchem
[ "364dd2b26aec2d0b25d5e2b30a9510a9d44814af" ]
[ "chainer_chemistry/dataset/parsers/sdf_file_parser.py" ]
[ "from logging import getLogger\nimport numpy\nfrom rdkit import Chem\nfrom tqdm import tqdm\n\nfrom chainer_chemistry.dataset.parsers.base_parser import BaseFileParser\nfrom chainer_chemistry.dataset.preprocessors.common import MolFeatureExtractionError # NOQA\nfrom chainer_chemistry.dataset.preprocessors.mol_prep...
[ [ "numpy.asarray" ] ]
SriSatyaT/jina
[ "c687fac6dbe4c9c6bd02dcdcdfaee28458222cd7" ]
[ "jina/types/document/__init__.py" ]
[ "import base64\nimport io\nimport json\nimport mimetypes\nimport os\nimport urllib.parse\nimport urllib.request\nimport warnings\nfrom hashlib import blake2b\nfrom typing import (\n Iterable,\n Union,\n Dict,\n Optional,\n TypeVar,\n Any,\n Tuple,\n List,\n Type,\n)\n\nimport numpy as np\...
[ [ "numpy.frombuffer", "numpy.array", "scipy.sparse.issparse" ] ]
williamFalcon/theano-deep-neural-net
[ "94b7cbe56d504c94ed8851a01d6ed7b2b82029e5" ]
[ "dnn_demo.py" ]
[ "\nimport sys\nimport os\nfrom dnn.dnn import MLP\nimport pandas as pd\nimport numpy as np\n\n\ndef load_dataset():\n data_path = os.path.dirname(os.path.realpath(__file__)) + '/db/train.csv'\n train_df = pd.read_csv(data_path)\n\n # extract the x and y for the models\n # format for the nn\n X = trai...
[ [ "pandas.read_csv", "numpy.float32" ] ]
m95music/yukarin
[ "87e4e813e1b846720ef7a89162edf1c379700619" ]
[ "scripts/check_silence.py" ]
[ "\"\"\"\ncheck silence of wave.\n\"\"\"\n\nimport argparse\nimport glob\nimport math\nimport multiprocessing\nfrom pathlib import Path\nfrom pprint import pprint\n\nimport matplotlib.pyplot as plt\nimport numpy\nimport tqdm\nfrom sprocket.speech import FeatureExtractor\n\nfrom yukarin import Wave\nfrom yukarin.para...
[ [ "numpy.array", "matplotlib.pyplot.figure" ] ]
jgritans/torrent_finder
[ "4270ebab208727fe5ea559b97ed74b25ea2d37d3" ]
[ "torrents.py" ]
[ "import pandas as pd\nfrom web import soup\n\n\n\n\nclass EmptyTable(Exception):\n def __init__(self, message):\n self.message = message\n\n\nclass FailedDfCreation(Exception):\n def __init__(self, message):\n self.message = message\n\n\nclass HardToFixBetterSkip(Exception):\n def __init__(se...
[ [ "pandas.DataFrame" ] ]
kshi1126/CarND-Traffic-Sign-Classifier-Project
[ "7d96575933944309c6de0edc00ac9f03b077c0e2" ]
[ "Traffic_Sign_Classifier.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# # Self-Driving Car Engineer Nanodegree\n# \n# ## Deep Learning\n# \n# ## Project: Build a Traffic Sign Recognition Classifier\n# \n# In this notebook, a template is provided for you to implement your functionality in stages, which is required to successfully complete thi...
[ [ "matplotlib.pyplot.imshow", "tensorflow.nn.softmax_cross_entropy_with_logits", "numpy.expand_dims", "tensorflow.zeros", "tensorflow.nn.max_pool", "tensorflow.cast", "tensorflow.contrib.layers.flatten", "tensorflow.train.AdamOptimizer", "tensorflow.nn.conv2d", "tensorflow.nn...
sadmanca/soccerbot
[ "5e60eacb51ff1b063ae8c1caf7eb01053add43eb" ]
[ "soccer_strategy/src/strategy/dummy_strategy.py" ]
[ "import math\nimport numpy as np\nimport rospy\n\nimport config as config\nfrom strategy.strategy import Strategy\nfrom soccer_msgs.msg import GameState\nfrom robot import Robot\n\nHAVENT_SEEN_THE_BALL_TIMEOUT = 10\n\nclass DummyStrategy(Strategy):\n\n def __init__(self):\n self.havent_seen_the_ball_timeo...
[ [ "numpy.linalg.norm" ] ]
X0Leon/pyfin
[ "2bdf8ae5f5600838012e1f470a979f3e219df870" ]
[ "pyfin/data.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport datetime\n\nimport pandas as pd\nimport requests\n\nimport pyfin\nimport pyfin.utils as utils\n\n\ndef get(symbols, provider=None, common_dates=False, forward_fill=True,\n clean_symbols=True, column_names=None, symbol_field_sep=':',\n existing=None, **kwargs):\n \...
[ [ "pandas.to_datetime", "pandas.read_csv", "pandas.DataFrame" ] ]
sallypannn/pytorch-widedeep
[ "0c79deb5de7b5005613fd926dee726f3227f5375" ]
[ "pytorch_widedeep/models/wide_deep.py" ]
[ "import warnings\n\nimport torch\nimport torch.nn as nn\n\nfrom pytorch_widedeep.wdtypes import * # noqa: F403\nfrom pytorch_widedeep.models.tab_mlp import MLP\nfrom pytorch_widedeep.models.tabnet.tab_net import TabNetPredLayer\n\nwarnings.filterwarnings(\"default\", category=UserWarning)\n\nuse_cuda = torch.cuda....
[ [ "torch.zeros", "torch.nn.Linear", "torch.FloatTensor", "torch.cuda.is_available", "torch.device" ] ]
datduong/deepgoplus
[ "4e39e9785f196bc2be8fb37dc81a8481b63b1532" ]
[ "evaluate_naive.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nimport pandas as pd\nimport click as ck\n# from tensorflow.keras.models import Sequential, Model, load_model\n# from tensorflow.keras.layers import (\n# Dense, Dropout, Activation, Input, Reshape,\n# Flatten, BatchNormalization, Embedding,\n# Conv1D, MaxPooling1D,...
[ [ "matplotlib.pyplot.legend", "pandas.read_pickle", "matplotlib.pyplot.title", "sklearn.metrics.auc", "numpy.arange", "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.ylabel", "matplotlib.pyplot....
bm424/texpy
[ "8d78b568209a6da36fc831c6bc9e2b0cb4c740c8" ]
[ "orix/io/plugins/orix_hdf5.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2018-2022 the orix developers\n#\n# This file is part of orix.\n#\n# orix 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 Foundation, either version 3 of the License, or\n# (at ...
[ [ "numpy.shape", "numpy.dtype" ] ]
schrma/oloid
[ "49fc62cd83e9839620292139cc55e5ec848b386c" ]
[ "src/oloid/circle.py" ]
[ "import numpy as np\nfrom matplotlib.lines import Line2D\nfrom mpl_toolkits.mplot3d import proj3d\nfrom mpl_toolkits.mplot3d.art3d import Line3D\n\nimport geometric_functions\n\nclass circle(Line3D):\n def __init__(self,center_point, normal_vector, radius=1,nr_of_points=100):\n self.center_point = np.arra...
[ [ "numpy.linspace", "numpy.linalg.norm", "numpy.cos", "numpy.sin", "numpy.cross", "numpy.array" ] ]
Morgan-Gan/Slowfast-fb
[ "f7387d5f30d609f6d0e022a81c51729b647dae97" ]
[ "tools/test_net.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\n\"\"\"Multi-view test a video classification model.\"\"\"\n\nimport numpy as np\nimport os\nimport pickle\nimport torch\nfrom iopath.common.file_io import g_pathmgr\n\nimport slowfast.utils.checkpoint as cu\nimport s...
[ [ "torch.manual_seed", "torch.no_grad", "numpy.random.seed" ] ]
jtschindler/sculptor
[ "67b7ebfb05ee8ec9d00399c6d80c238d2104eebc" ]
[ "sculptor/specfitgui.py" ]
[ "\nimport numpy as np\n\nfrom PyQt5 import QtWidgets, QtCore\n\nfrom PyQt5.QtWidgets import QMainWindow, QWidget, QPushButton, QAction, \\\n QLabel, QTabWidget, QVBoxLayout, QHBoxLayout, QFileDialog, QLineEdit, \\\n QComboBox, QCheckBox, QGroupBox, QScrollArea\n\nfrom matplotlib.backends.backend_qt5agg import...
[ [ "matplotlib.backends.backend_qt5agg.NavigationToolbar2QT", "numpy.array", "numpy.abs" ] ]
mohamed-ezz/tflite_workshop_guc
[ "9a201072e9cc6ad1c849dc88e541900398e036c5" ]
[ "src/keras_layers/keras_layer_DecodeDetections1.py" ]
[ "'''\nA custom Keras layer to decode the raw SSD prediction output. Corresponds to the\n`DetectionOutput` layer type in the original Caffe implementation of SSD.\n\nCopyright (C) 2018 Pierluigi Ferrari\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in complian...
[ [ "tensorflow.boolean_mask", "tensorflow.concat", "tensorflow.constant", "tensorflow.range", "tensorflow.shape", "tensorflow.image.non_max_suppression", "tensorflow.reshape", "tensorflow.expand_dims", "tensorflow.exp", "tensorflow.gather", "tensorflow.nn.top_k", "tens...
BirdVox/mirdata
[ "42d9fddb5b84ad95b6fb15a56f1b572c77db9eb3" ]
[ "tests/test_jams_utils.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport pytest\nimport jams\n\nfrom mirdata import jams_utils, utils\n\n\ndef get_jam_data(jam, namespace, annot_numb):\n time = []\n duration = []\n value = []\n confidence = []\n for obs in jam.search(namespace=namespace)[annot_numb]['data']:\n ...
[ [ "numpy.array" ] ]
horoiwa/VisionML
[ "f1507b3acbb696a39d46037c1653fe2ca5702a0b" ]
[ "absoluteCLF/valid.py" ]
[ "import os\nimport glob\nimport pandas as pd\nimport pathlib\nimport shutil\nimport sys\n\nfrom PIL import Image\nimport numpy as np\nfrom skimage.segmentation import mark_boundaries\nimport matplotlib.pyplot as plt\nimport lime\nfrom lime import lime_image\n\nfrom src.models import load_model\nfrom src.util import...
[ [ "numpy.uint8", "numpy.array", "numpy.argmax" ] ]
SSantosLab/notMOSFiT
[ "58cc4a271ef1f1bbf8ae3eb2fc847d2d82c103f0" ]
[ "mosfit/modules/seds/multiblackbody.py" ]
[ "\"\"\"Definitions for the `MultiBlackbody` class.\"\"\"\nfrom math import pi\n\nimport numexpr as ne\nimport numpy as np\nfrom astropy import constants as c\nfrom mosfit.constants import DAY_CGS, FOUR_PI, KM_CGS, M_SUN_CGS # noqa: F401\nfrom mosfit.modules.seds.sed import SED\n\n\n# Important: Only define one ``M...
[ [ "numpy.array", "numpy.nan_to_num" ] ]
nuannuanhcc/DMRNet
[ "e6e2315219aac9146f55b37481d0c287f624dd7a" ]
[ "mmdetection/mmdet/models/detectors/double_head_rcnn.py" ]
[ "import torch\n\nfrom mmdet.core import bbox2roi, build_assigner, build_sampler\nfrom ..registry import DETECTORS\nfrom .two_stage import TwoStageDetector\n\n\n@DETECTORS.register_module\nclass DoubleHeadRCNN(TwoStageDetector):\n\n def __init__(self, reg_roi_scale_factor, **kwargs):\n super().__init__(**k...
[ [ "torch.zeros", "torch.ones", "torch.cat" ] ]
sakamotosan/pipeline_grid_search
[ "bcae3e8320f4fbe6cd016c4899a2418cac077abc" ]
[ "tests/test_pipeline_grid_search.py" ]
[ "\"\"\"\nTesting for pipeline_grid_search module.\n\"\"\"\n\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport time\n\nimport numpy as np\n\nfrom sklearn.base import BaseEstimator, TransformerMixin, ClassifierMixin\nfrom sklearn.cross_validation import StratifiedKFold\nfrom sklearn.da...
[ [ "sklearn.datasets.make_classification", "sklearn.cross_validation.StratifiedKFold", "sklearn.pipeline.Pipeline", "sklearn.svm.SVC", "sklearn.preprocessing.Normalizer", "sklearn.decomposition.PCA" ] ]
Pennsieve/timeseries-processor
[ "85766afa76182503fd66cec8382c22e757743f01" ]
[ "edf_processor/edf_processor/edf.py" ]
[ "import sys\nimport struct\nimport re\nimport numpy as np\nfrom datetime import datetime\n\nsecond_to_usecond = 1000000\n\ndef twosComp(val, bits):\n \"\"\"compute the 2's complement of int value val\"\"\"\n if (val & (1 << (bits - 1))) != 0: # if sign bit is set e.g., 8bit: 128-255\n val = val - (1 <<...
[ [ "numpy.array" ] ]
DocTorH123/PM_Checker
[ "84e8ba09104d005b67549012b4f4e95de20f94f2" ]
[ "PM/BPM.py" ]
[ "import librosa;import sys;import matplotlib.pyplot as plt\n\ntry:\n filename = input(\"Input your File Name\")\n y, sr = librosa.load(\"Test_Music/\"+filename)\n tempo, beat_frames = librosa.beat.beat_track(y=y,sr=sr)\n print('{:.2f}BPM'.format(tempo))\n beat_times = librosa.frames_to_time(beat_fram...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.axhline", "matplotlib.pyplot.show" ] ]
lovishjindal2503/TOPSIS_project1
[ "4ce4e15e04ac84b716a6ae6f4a50ac01fdb854d8" ]
[ "Topsis_lovish_101703312/topsis.py" ]
[ "import numpy as np\n\ndef Topsis(weights, numerical_data, impact):\n\n\ttry:\n\t\tif(numerical_data.shape[1] != weights.shape[0] or weights.shape != impact.shape or numerical_data.shape[1] != impact.shape[0]):\n\t\t\traise Exception(\"Given input is not correct\")\n\texcept Exception as e:\n\t\tprint(\"Given input...
[ [ "numpy.argsort", "numpy.array", "numpy.argmax" ] ]
phspo/snakemake-ngs-spa-typing
[ "de710308c1ad26303539d2998573d682caba3e25" ]
[ "scripts/createKmerErrorDistributionPlots.py" ]
[ "import json\nimport math\nfrom scipy.stats import poisson\nimport sys\nimport logging\n\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport numpy as np\nfrom matplotlib.ticker import MaxNLocator\n\nlogging.basicConfig(filename=snakemake.log[0], level=logging.DEBUG,format=\"%(asctime)s:%(levelname)s:%(m...
[ [ "matplotlib.pyplot.clf", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.unique" ] ]
thayes805/earthpy
[ "d34dfe9eb9e8b6ca0ded2541d3ddbac9cb15474b" ]
[ "examples/plot_raster_stack_crop.py" ]
[ "\"\"\"\nStack and Crop Raster Data Using EarthPy\n========================================\n\nLearn how to stack and crop satellite imagery using EarthPy\n\"\"\"\n\n###############################################################################\n# Stack and Crop Raster Data Using EarthPy\n# -----------------------...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
CSchoel/hh-modelica
[ "e84713a4a15bfcc5736755940e6af38bb6272521" ]
[ "scripts/plot_compare.py" ]
[ "import pandas as pd\nimport matplotlib.pyplot as plt\nimport os\n\n\ndef compare(afile, bfile):\n adata, bdata = [pd.read_csv(x, delimiter=\",\") for x in [afile, bfile]]\n f = plt.figure(figsize=(6, 2), dpi=300)\n ax = f.add_subplot()\n ax.plot(adata[\"time\"] * 1000, adata[\"v_m\"], label=\"modular\"...
[ [ "pandas.read_csv", "matplotlib.pyplot.figure" ] ]
Yannic/chromium
[ "ab32e8aacb08c9fce0dc4bf09eec456ba46e3710" ]
[ "tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py" ]
[ "#!/usr/bin/env python3\n#\n# Copyright 2015 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\n\"\"\"Loops Custom Tabs tests and outputs the results into a CSV file.\"\"\"\n\nimport collections\nimport contextlib\nim...
[ [ "numpy.array" ] ]
asafjo23/outliers-detection
[ "dd78e3161c02a2f8ae685ef31ad796787e305591" ]
[ "src/loss.py" ]
[ "import torch.nn.functional as F\nfrom tensorboardX import SummaryWriter\n\nfrom torch import Tensor, clone, clip, round, abs, sub, sum, tensor\nfrom torch.nn.modules.loss import _Loss\n\nfrom src.model import GaussianHistogram\nfrom src.utils import DataConverter, DataProcessor\n\n\nclass MiningOutliersLoss(_Loss)...
[ [ "torch.Tensor", "torch.clone", "torch.round", "torch.sum", "torch.sub", "torch.tensor", "torch.clip", "torch.nn.functional.mse_loss" ] ]
rgmaidana/stateEstimation
[ "f8f4102a20ea6dfc9b466a291244fea4fa802dd4" ]
[ "examples/dcmotor.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nfrom stateEstimation import KF\nfrom scipy.integrate import ode\nimport sys\n\n# Parameters\nsim_time = 10 # Simulation time\ninit_states = [0, 0] # Initial states\nsensor_err = 0.2 # Introduce gaussian error in...
[ [ "numpy.diag", "matplotlib.pyplot.legend", "scipy.integrate.ode", "numpy.ones", "matplotlib.pyplot.plot", "numpy.random.normal", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "numpy.array", "numpy.zeros", "matplotlib.pyplot.show", ...
kritikashah20/pandas
[ "361166f86da1a665a1b5808e0935c28f8cf56d34" ]
[ "pandas/core/indexes/interval.py" ]
[ "\"\"\" define the IntervalIndex \"\"\"\nfrom operator import le, lt\nimport textwrap\nfrom typing import TYPE_CHECKING, Any, List, Optional, Tuple, Union, cast\n\nimport numpy as np\n\nfrom pandas._config import get_option\n\nfrom pandas._libs import lib\nfrom pandas._libs.interval import Interval, IntervalMixin, ...
[ [ "numpy.linspace", "pandas.core.dtypes.common.is_dtype_equal", "pandas.core.indexes.base.Index.__le__", "pandas.core.dtypes.common.is_datetime64tz_dtype", "pandas._libs.interval.IntervalTree", "numpy.concatenate", "pandas.core.indexes.base.Index", "pandas._config.get_option", "n...
jiangxunmu/ASP
[ "cb12bcd7bf30cc28c09b3d3c10a40fa5dc8c9dc7" ]
[ "py/HW3/option_models/sabr.py" ]
[ " # -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Oct 10\n\n@author: jaehyuk\n\"\"\"\n\nimport numpy as np\nimport scipy.stats as ss\nimport scipy.optimize as sopt\nfrom . import normal\nfrom . import bsm\nimport pyfeng as pf\n\n'''\nMC model class for Beta=1\n'''\nclass ModelBsmMC:\n beta = 1.0 # fixed (no...
[ [ "numpy.log", "numpy.sqrt", "numpy.random.seed", "numpy.random.multivariate_normal", "numpy.random.normal", "numpy.fmax", "numpy.mean", "numpy.exp", "numpy.sum" ] ]
jgrss/cultionet
[ "91d2104aecaec3c8baace55915cf3a74492a3540" ]
[ "src/cultionet/scripts/cultionet.py" ]
[ "#!/usr/bin/env python\n\nimport argparse\nimport typing as T\nimport logging\nfrom pathlib import Path\nfrom datetime import datetime\n\nimport cultionet\nfrom cultionet.data.datasets import EdgeDataset\nfrom cultionet.utils.project_paths import setup_paths\nfrom cultionet.utils.normalize import get_norm_values\nf...
[ [ "torch.load" ] ]
sribaheti/aws-iot-analytics-demo
[ "113668d019756234548621aaa0814e0e0528bfd8" ]
[ "notebooks/processing.py" ]
[ "from __future__ import print_function\n\nimport time\nimport sys\nfrom io import StringIO\nimport os\nimport shutil\n\nimport argparse\nimport csv\nimport json\nimport numpy as np\nimport pandas as pd\nimport logging\n\nfrom sklearn.compose import ColumnTransformer\nfrom sklearn.externals import joblib\nfrom sklea...
[ [ "pandas.concat", "sklearn.preprocessing.OneHotEncoder", "sklearn.impute.SimpleImputer", "sklearn.preprocessing.StandardScaler", "pandas.get_dummies", "sklearn.compose.ColumnTransformer" ] ]
Javadzb/models
[ "5fff97264564bf132c20b24dc94b9fdbe6afd56e" ]
[ "research/object_detection/model_lib.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.logging.warning", "tensorflow.contrib.tpu.bfloat16_scope", "tensorflow.stack", "tensorflow.cast", "tensorflow.train.init_from_checkpoint", "tensorflow.contrib.learn.Experiment", "tensorflow.contrib.tpu.CrossShardOptimizer", "tensorflow.train.ExponentialMovingAverage", ...
cryptexis/debias
[ "a9e0106dcb8668b95e4654ccb3e7373a70ea37a3" ]
[ "models/adversarial_model.py" ]
[ "import tensorflow as tf\nimport numpy as np\nfrom utils.data import convert_categorical\nfrom models.base_model import BaseModel\n\n\nclass Discriminator:\n\n def __init__(self, discriminator_model, protected_variable):\n\n self.model = discriminator_model\n self.protected_variable = protected_var...
[ [ "tensorflow.keras.metrics.BinaryAccuracy", "tensorflow.norm", "tensorflow.keras.metrics.TruePositives", "tensorflow.greater", "tensorflow.keras.losses.CosineSimilarity", "tensorflow.stack", "tensorflow.keras.metrics.TrueNegatives", "tensorflow.cast", "tensorflow.keras.losses.Bi...
neale/PySATDNN
[ "85ed9f416702dc9bcbaf3e0a2e93af2ad1fdeee9" ]
[ "pysatdnn/models.py" ]
[ "#####################################\n# models.py\n# contains the definitions for the target neural network architectures\n#\n####################################\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass OneLayerDNN(nn.Module):\n def __init__(self, d_in, d_out):\n ...
[ [ "torch.nn.Linear" ] ]
jcydlxc/czsc
[ "9be21bec016b9bb1fe335142c746f8dc178de000" ]
[ "czsc/utils/echarts_plot.py" ]
[ "# coding: utf-8\n\"\"\"\n使用 pyecharts 定制绘图模块\n\n\"\"\"\n\nfrom pyecharts import options as opts\nfrom pyecharts.charts import HeatMap, Kline, Line, Bar, Scatter, Grid\nfrom pyecharts.commons.utils import JsCode\nfrom typing import List\nimport numpy as np\nfrom .ta import SMA, MACD\n\n\ndef heat_map(data: List[dic...
[ [ "numpy.array" ] ]
savatia/social-stock
[ "67c5122f16610c07e798a92d379ad31bac111915" ]
[ "backend/api/management/commands/fetch_sentiment.py" ]
[ "from optparse import make_option\n\nfrom django.core.management.base import BaseCommand\nimport pandas as pd\nimport django\n\nfrom ...models import Sentiment, Company\n\n\nclass Command(BaseCommand):\n\thelp = \"Whatever you want to print here\"\n\n\tdef add_arguments(self, parser):\n\t\tparser.add_argument('--fi...
[ [ "pandas.read_csv" ] ]
DucAnhPhi/NewsSearchEngine
[ "de274acc116d0a90b42c3279d4a4bd791867c67f" ]
[ "test/test_feature_extraction.py" ]
[ "import pytest\nimport json\nfrom ..embedding.model import EmbeddingModel\nfrom ..feature_extraction import FeatureExtraction\nimport numpy as np\n\nclass TestFeatureExtraction():\n @classmethod\n def setup_class(self):\n self.embedder_DE = EmbeddingModel(lang=\"de\")\n self.embedder_EN = Embedd...
[ [ "numpy.array" ] ]
AurelianTactics/dm_env_rpc
[ "08f76b83af759d3f940207c53a1955a2af17198c" ]
[ "dm_env_rpc/v1/tensor_utils_test.py" ]
[ "# Copyright 2019 DeepMind Technologies Limited. 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# Unles...
[ [ "numpy.uint32", "numpy.asarray", "numpy.uint8", "numpy.int32", "numpy.int8", "numpy.dtype", "numpy.testing.assert_array_equal", "numpy.int64", "numpy.frombuffer", "numpy.uint64", "numpy.float64", "numpy.float32", "numpy.array" ] ]
ShiNik/DeepLearning_Tensorflow
[ "a7faf8decc72b6c7b6e3ca08226ca33f792a82ab" ]
[ "dogs_vs_cats/src/data_prepration.py" ]
[ "from util import get_path\nfrom util import get_index_by_image_name\n\nimport random\nimport numpy as np\nfrom numpy import save\nimport os\nfrom os import listdir\nimport cv2\nimport keras\nfrom sklearn.model_selection import train_test_split\n\n\n\ndef split_and_save(config, data,labels):\n print(\"Pre-proces...
[ [ "numpy.array", "sklearn.model_selection.train_test_split", "numpy.save" ] ]
sjmielke/addons
[ "f126f9183e9dd62e78ac1cea3d4213626c1ea4d1" ]
[ "tensorflow_addons/image/distance_transform.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.convert_to_tensor", "tensorflow.no_gradient", "tensorflow.cast", "tensorflow.name_scope" ] ]