repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
ani-poroorkara/jpas
[ "0409bbe2f9de39089ee72342558be8fc25d8ac97" ]
[ "backend/scripts/utility/liveData.py" ]
[ "import pymongo\nimport json\nimport os\nimport pandas as pd\nfrom linkedInutility import get_db_connection\nimport pymongo\nimport logging\ndef livedata(cfg):\n logging.info(\"Creating Database connection\")\n db_connection = get_db_connection(cfg)\n dblist=db_connection.list_database_names()\n if \"LinkedInJob\" ...
[ [ "pandas.read_csv" ] ]
softbankrobotics-research/NeurIPS19-SBDRL
[ "9ea43a256da1fbb7fa32e07fa5e97700abb4d47a", "9ea43a256da1fbb7fa32e07fa5e97700abb4d47a" ]
[ "code/symmetry_based_disentanglement_a_la_WM/flatland/flat_game/generate_data_small_ball.py", "code/symmetry_based_disentanglement_a_la_WM/vae/arch_torch.py" ]
[ "from env import Env\nimport numpy as np\nfrom tqdm import trange\nimport time\nimport math\nimport pickle as pk\nimport random\nimport pymunk\nfrom constants import *\nimport torch\n\n\nprint(pymunk.version)\n\nagent_parameters = {\n 'radius': 8,\n 'speed': 10,\n 'rotation_speed' : math.pi/8,\n 'living...
[ [ "numpy.array", "numpy.random.binomial", "numpy.save", "torch.load" ], [ "torch.nn.Linear", "numpy.array", "torch.nn.ConvTranspose2d", "numpy.save", "torch.nn.Conv2d", "torch.randn_like", "numpy.append", "torch.exp" ] ]
HDUAIS/MARL_Bench
[ "f592d20ddbcb2039453cf56221083d4ac64dee46" ]
[ "src/learners/dmaq_qatten_learner.py" ]
[ "# From https://github.com/wjh720/QPLEX/, added here for convenience.\nimport copy\nfrom components.episode_buffer import EpisodeBatch\nfrom modules.mixers.dmaq_general import DMAQer\n# from modules.mixers.dmaq_qatten import DMAQ_QattenMixer\nimport torch.nn.functional as F\nimport torch as th\nfrom torch.optim imp...
[ [ "torch.stack", "torch.optim.RMSprop", "torch.gather", "torch.nn.utils.clip_grad_norm_", "numpy.squeeze", "torch.mean" ] ]
XTJ21/ArknightsAutoHelper
[ "74ea7b232d7eed6cc783b27762197cdb68c368f9" ]
[ "imgreco/itemdb.py" ]
[ "from dataclasses import dataclass\nimport os\nimport logging\nimport json\nfrom functools import lru_cache\n\nimport cv2\nimport numpy as np\n\nimport app\nfrom util import cvimage as Image\n\nlogger = logging.getLogger(__name__)\n\nnet_file = app.cache_path / 'ark_material.onnx'\nindex_file = app.cache_path / 'in...
[ [ "numpy.array" ] ]
evangibson/lights_in_space
[ "de84d9e4f80c1a3fc4471afd370d69a9d78edc06" ]
[ "support/ga.py" ]
[ "# Import libraries\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport warnings\nimport copy\nimport pandas as pd\n\n\nclass dna:\n \"\"\"Makes up the components of a population\"\"\"\n def __init__(self,\n chromosome_length=9,\n number_of_genes=2,\n ...
[ [ "pandas.DataFrame", "numpy.random.randint" ] ]
Julio-Yanes/NiMARE
[ "36bb05034041998519814b55fe402489147fdd63", "36bb05034041998519814b55fe402489147fdd63" ]
[ "nimare/parcellate/mapbot.py", "nimare/annotate/topic/lda.py" ]
[ "\"\"\"\nMeta-analytic parcellation based on text (MAPBOT).\n\"\"\"\nimport numpy as np\nimport pandas as pd\nfrom sklearn.decomposition import NMF\nfrom scipy.spatial.distance import cdist\nfrom nilearn.masking import apply_mask, unmask\n\nfrom ..base import Parcellator\nfrom ..due import due\nfrom .. import refer...
[ [ "numpy.dot", "numpy.sum", "numpy.ones", "numpy.where", "sklearn.decomposition.NMF", "scipy.spatial.distance.cdist" ], [ "pandas.DataFrame" ] ]
TheCodez/pytorch-LiLaNet
[ "8a39326ad8c2150ac5cb4dfa9b7ae2a4ef4a91e8" ]
[ "train_kitti.py" ]
[ "import os\nimport warnings\nfrom argparse import ArgumentParser\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom ignite.contrib.handlers import ProgressBar\nfrom ignite.contrib.handlers.tensorboard_logger import *\nfrom ignite.engine import Events, Engine\nfrom ignite.metrics import Runnin...
[ [ "torch.no_grad", "torch.cuda.device_count", "torch.manual_seed", "torch.cuda.is_available", "torch.load", "torch.nn.DataParallel" ] ]
jichilen/frcon
[ "f8646d39eae2fc648c7359aed63e89c85fee81d6" ]
[ "lib/roi_data_layer/minibatch.py" ]
[ "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Xinlei Chen\n# --------------------------------------------------------\n\n\"\"\"Compute minibatch blobs for training ...
[ [ "numpy.where", "numpy.array" ] ]
marcodemutti/SofAr-project
[ "6e807072f8567490cf5b4ebcf81d37ab5e8a4109" ]
[ "Math/math_pkg/scripts/J_computations.py" ]
[ "import numpy as np\n\ndef geometric_vectors(T_abs):\n \"\"\"!\n Computes the vectors needed to compute geometric jacobian.\n @param Tabs: the transformation matrices from joint to 0 frame in current configuration\n @return geom_v: geometric vectors exctracted from Tabs that allow to compute the jacobian.\n \"...
[ [ "numpy.concatenate", "numpy.array", "numpy.dot", "numpy.transpose" ] ]
sbelenki/fastMRI
[ "9a359ffe340e9265491744e381d92241b36a6455", "9a359ffe340e9265491744e381d92241b36a6455" ]
[ "banding_removal/fastmri/model/classifiers/resnet_r1_simple.py", "banding_removal/fastmri/transforms/kspace.py" ]
[ "\"\"\"\nCopyright (c) Facebook, Inc. and its affiliates.\n\nThis source code is licensed under the MIT license found in the\nLICENSE file in the root directory of this source tree.\n\"\"\"\n\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torch.autograd import Variable\nimport torch...
[ [ "torch.nn.Linear", "torch.nn.AdaptiveAvgPool2d", "torch.nn.init.constant_", "torch.nn.Sequential", "torch.nn.init.kaiming_normal_", "torch.nn.GroupNorm", "torch.nn.Conv2d", "torch.nn.functional.relu" ], [ "numpy.zeros", "torch.max", "numpy.fft.ifftshift", "numpy...
mlazzarin/qibo
[ "e82bc3e27c5182be7b6f0b23bd20bc1057e31701", "e82bc3e27c5182be7b6f0b23bd20bc1057e31701" ]
[ "src/qibo/tests/test_core_callbacks.py", "src/qibo/tests/test_core_hamiltonians_trotter.py" ]
[ "\"\"\"Test methods defined in `qibo/core/callbacks.py`.\"\"\"\nimport pytest\nimport numpy as np\nfrom qibo.models import Circuit, AdiabaticEvolution\nfrom qibo import gates, callbacks, K\nfrom qibo.config import EIGVAL_CUTOFF\n\n\n# Absolute testing tolerance for the cases of zero entanglement entropy\n_atol = 1e...
[ [ "numpy.concatenate", "numpy.array", "numpy.sin", "numpy.trace", "numpy.zeros", "numpy.log", "numpy.linalg.eigh", "numpy.ones", "numpy.where", "numpy.linalg.eigvalsh", "numpy.einsum", "numpy.sqrt", "numpy.cos", "numpy.abs", "numpy.random.random", "num...
marcia-marques/metroclima-crds
[ "eec46982a0a83a211ee8bace333fb1cb1e691d3b" ]
[ "src/pycrds/datafile.py" ]
[ "import os\nimport glob\nimport pandas as pd\nimport dask.dataframe as dd\nimport pathlib\nfrom datetime import datetime, timedelta\n\n\ndef read_data(dir_name, usecols, dtype, date_range=None):\n \"\"\"\n Return a dataframe with concatenated data.\n Set timestamp as index.\n\n Parameters:\n dir_...
[ [ "pandas.to_datetime", "pandas.read_csv" ] ]
gyfastas/CS7319E1G16
[ "03126af04766abcb269d0c8db481c96c856d21ef" ]
[ "datasets/debug_dataset.py" ]
[ "import torch\n\nfrom .casia_dataset import CasiaDataset\n\n\nclass DebugDataset(CasiaDataset):\n\n def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n self._debug_image = torch.rand(3, 120, 120)\n self._debug_label = torch.tensor(1)\n\n def __getitem__(self, idx):\...
[ [ "torch.rand", "torch.tensor" ] ]
yotamitai/Highway_Disagreements
[ "18dccaa67b238700691c0f89b9fc2dfc2dab6751" ]
[ "highway_disagreements/configs/reward_functions.py" ]
[ "import math\n\nimport numpy as np\n\nfrom highway_env.envs import HighwayEnv, Action\nfrom gym.envs.registration import register\n\nfrom highway_env.utils import lmap\nfrom highway_env.vehicle.controller import ControlledVehicle\n\n\nclass ParallelDriver(HighwayEnv):\n \"\"\"rewarded for driving in parallel to ...
[ [ "numpy.clip" ] ]
expertailab/ISAAQ
[ "133e25adbf5c219aceef6e7f38135de248371cb1", "133e25adbf5c219aceef6e7f38135de248371cb1" ]
[ "tqa_ndq_ensembler.py", "pretrainings/pretrainings_tmc.py" ]
[ "from transformers import RobertaTokenizer\nimport numpy as np\nimport json\nfrom tqdm import tqdm\nimport torch\nimport random\nimport sys\nimport argparse\n\nfrom aux_methods import get_data_ndq, process_data_ndq, validation_ndq, get_upper_bound, ensembler\n\ndef main(argv):\n parser = argparse.ArgumentParser(...
[ [ "torch.device", "torch.cuda.manual_seed_all", "numpy.random.seed", "torch.manual_seed", "torch.load" ], [ "torch.device", "torch.cuda.manual_seed_all", "numpy.random.seed", "torch.manual_seed", "torch.load" ] ]
FurenDeng/cora
[ "c252b84626dadde5c49458258cfb9284a71a40f8" ]
[ "cora/util/sphfunc.py" ]
[ "\"\"\"Special functions for calculations on the sphere.\n\nThese routines require `pygsl` to be installed. Although these functions are\navailable in `scipy` they tend to be inaccurate at large values of `l`.\n\"\"\"\n# === Start Python 2/3 compatibility\nfrom __future__ import (absolute_import, division,\n ...
[ [ "numpy.logical_or", "numpy.array", "numpy.sin", "numpy.triu_indices", "numpy.broadcast_arrays", "numpy.arcsin", "numpy.exp", "numpy.logical_and", "numpy.arccosh", "numpy.where", "numpy.atleast_1d", "numpy.cos", "numpy.empty_like" ] ]
shanglidan/under_water
[ "ed487c73666221762cdddd665d2e0330c0a67176" ]
[ "tools/visual_data.py" ]
[ "import matplotlib.pyplot as plt\r\nfrom matplotlib.pyplot import savefig\r\nimport os\r\nfrom PIL import Image\r\nimport json\r\nimport numpy as np\r\n\r\n\r\ndef show_boxes(im, bboxs, segs, img, color):\r\n\r\n # Display in largest to smallest order to reduce occlusion\r\n # min_area = 99999\r\n # bbox_m...
[ [ "numpy.array" ] ]
thesilenthero/reporting
[ "c1174765db01ae5ba9bffbd77a0fb133ae691c09" ]
[ "tools/report_readers.py" ]
[ "import csv\r\n\r\nimport os\r\nimport pandas as pd\r\nfrom datetime import datetime\r\nimport parsedatetime as pdt\r\nimport xlwings as xw\r\n\r\nfrom .prisma import MediaPlan\r\nfrom .config import dcm_report_path\r\nfrom api import run_and_download_report, Report\r\n\r\nimport warnings\r\n\r\n\r\ndef get_files_i...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
akouminov/LipNet
[ "e61d270921707f49b10b932610e978bdeefd4935" ]
[ "evaluation/predict.py" ]
[ "from lipnet.lipreading.videos import Video\nfrom lipnet.lipreading.visualization import show_video_subtitle\nfrom lipnet.core.decoders import Decoder\nfrom lipnet.lipreading.helpers import labels_to_text\nfrom lipnet.utils.spell import Spell\nfrom lipnet.model2 import LipNet\nfrom tensorflow.keras.optimizers impor...
[ [ "numpy.random.seed", "numpy.array", "tensorflow.compat.v1.keras.backend.image_data_format", "tensorflow.keras.optimizers.Adam" ] ]
HalmonLui/square-hackathon
[ "62d5be7a229f9e39e27a546c164facd779d28aa4" ]
[ "backend/discoverpage/discoverpage_metrics.py" ]
[ "import json\nfrom heapq import nlargest, nsmallest\nimport pandas as pd\nimport numpy as np\n# Recommended, Hot Deals, Trending Near you\n\n\"\"\"\nSo... current brute force approach:\nrecommendations ---> top 5 ratings (maybe incorporate distance(?))\ntrending near you ----> grab top 10 near you in distance and o...
[ [ "pandas.DataFrame" ] ]
PySilentSubstitution/silent-sub
[ "ca1ec4c9f6dcd444a87149bbe6dfe00140f4c375" ]
[ "pysilsub/CIE.py" ]
[ "#!/usr/bin/env python3\r\n# -*- coding: utf-8 -*-\r\n'''\r\npysilsub.CIE\r\n============\r\n\r\nConvenience functions for accessing CIE standards.\r\n\r\nObtained from http://www.cvrl.org/\r\n\r\n@author: jtm\r\n\r\n'''\r\n\r\nfrom typing import Optional, Union\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\n\...
[ [ "numpy.array", "pandas.Int64Index", "pandas.DataFrame", "pandas.Series", "numpy.vstack" ] ]
ymouad/adapt
[ "899bb5ce9af093b6d98210e384daa49c96c3d203" ]
[ "adapt/metrics.py" ]
[ "import inspect\nimport copy\n\nimport numpy as np\nimport tensorflow as tf\nfrom scipy import linalg\nfrom sklearn.metrics import pairwise\nfrom sklearn.base import clone\nfrom sklearn.model_selection import train_test_split\nfrom adapt.utils import get_default_discriminator\nfrom tensorflow.keras.optimizers impor...
[ [ "numpy.dot", "numpy.copy", "sklearn.metrics.pairwise.rbf_kernel", "numpy.mean", "numpy.finfo", "numpy.iscomplexobj", "sklearn.metrics.pairwise.euclidean_distances", "numpy.concatenate", "scipy.linalg.eig", "numpy.transpose", "sklearn.base.clone", "tensorflow.keras.o...
Accenture/Docknet
[ "eb3cad13701471a7aaeea1d573bc5608855bab52" ]
[ "src/docknet/data_generator/island_data_generator.py" ]
[ "from typing import Tuple\n\nimport numpy as np\n\nfrom docknet.data_generator.data_generator import DataGenerator\nfrom docknet.util.geometry import polar_to_cartesian, random_to_polar\n\n\nclass IslandDataGenerator(DataGenerator):\n \"\"\"\n The chessboard data generator generates two classes (0 and 1) of 2...
[ [ "numpy.array" ] ]
matarof/tpu
[ "d2e3b810134b200214f42cb004f20fe6b8e2cab4" ]
[ "models/official/unet3d/tpu_executor.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.compat.v1.distribute.cluster_resolver.TPUClusterResolver", "tensorflow.compat.v1.gfile.MakeDirs", "tensorflow.compat.v1.summary.FileWriter", "tensorflow.compat.v1.Session.reset", "tensorflow.compat.v1.Graph", "tensorflow.compat.v1.estimator.tpu.TPUEstimator", "tensorflow.co...
KarrLab/wc_sim
[ "5b0ee03c3d19193fa67a3797d4258b753e6bc576" ]
[ "wc_sim/model_utilities.py" ]
[ "\"\"\" A set of static methods that help prepare Models for simulation.\n\n:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>\n:Date: 2017-04-10\n:Copyright: 2016-2018, Karr Lab\n:License: MIT\n\"\"\"\n\nfrom enum import Enum\nfrom numpy.random import RandomState\nfrom scipy.constants import Avogadro\nimport coll...
[ [ "numpy.isnan" ] ]
henchc/CLFL_2016
[ "b57fb2e532f218cc57b8434c0b0d8a702dcc35ed" ]
[ "CLFL_ngram.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n\n# Created at UC Berkeley 2015\n# Authors: Christopher Hench\n# ======================================================================...
[ [ "numpy.average", "pandas.DataFrame", "sklearn.preprocessing.LabelBinarizer", "pandas.concat" ] ]
zhiyu1998/JavaStudyXmind
[ "80a10f52ee8aacc247bcf3e295777cac644528d4", "80a10f52ee8aacc247bcf3e295777cac644528d4" ]
[ "Deep-Learning-Notes/9 GoogleNet/predict.py", "Deep-Learning-Notes/18 Vision Transformer/model.py" ]
[ "import torch\nfrom model import GoogleNet\nfrom PIL import Image\nfrom torchvision import transforms\nimport matplotlib.pyplot as plt\nimport json\n\nimport os\nos.environ['KMP_DUPLICATE_LIB_OK'] = 'TRUE'\n\ndevice = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n\ndata_transform = transforms....
[ [ "torch.no_grad", "torch.softmax", "torch.unsqueeze", "torch.cuda.is_available", "torch.load", "matplotlib.pyplot.show", "torch.argmax", "matplotlib.pyplot.imshow" ], [ "torch.nn.Linear", "torch.rand", "torch.nn.Dropout", "torch.nn.Identity", "torch.zeros", ...
hofaflo/mne-python
[ "041068d510cc746b0a994609a59213f279be0c81" ]
[ "mne/io/meas_info.py" ]
[ "# -*- coding: utf-8 -*-\n# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Matti Hämäläinen <msh@nmr.mgh.harvard.edu>\n# Teon Brooks <teon.brooks@gmail.com>\n# Stefan Appelhoff <stefan.appelhoff@mailbox.org>\n#\n# License: BSD-3-Clause\n\nfrom collections import Counter, Ord...
[ [ "numpy.full", "numpy.array", "numpy.dot", "numpy.array_equal", "numpy.zeros_like", "numpy.isnan", "numpy.char.decode", "numpy.eye", "numpy.allclose", "numpy.atleast_1d", "numpy.arange", "numpy.all", "numpy.char.encode", "numpy.hstack", "numpy.iinfo", ...
macodroid/strawberry_disease_classification
[ "41900bc958e53077099370d0fb25f2a5ed7c99da" ]
[ "model.py" ]
[ "import torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass ConvNet(nn.Module):\n def __init__(self):\n super(ConvNet, self).__init__()\n # convolution layers\n self.conv1 = nn.Conv2d(in_channels=3, out_channels=64, kernel_size=(3, 3), stride=(2, 2), padding=1)\n self.bn1 = nn....
[ [ "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.Conv2d", "torch.nn.functional.relu", "torch.nn.Dropout2d" ] ]
renie26/CR_motion
[ "5e73f4e788b5c6345af8703918f3fc9dfa90faae" ]
[ "scripts/pre-prosessing/json2txt.py" ]
[ "# python ../json2txt.py face00103135 \"1\"\n\nimport os\nimport numpy as np\nimport pandas as pd\nimport sys\nimport pickle\n\nsearchterm = sys.argv[1] + '_keypoints.csv'\nmodel = int(sys.argv[2])\n\n# 1: upper body, 2: lower body, 3: left side, 4: right side, 5: legs and arms\nmodel_col_set = [['#head_JA', '#r_sh...
[ [ "pandas.read_csv" ] ]
eteters/Sampling-NCRF-BIP-Final
[ "59bf3d0bb1e571cfaa8dc70916bd54faff9d4e04" ]
[ "wsi/utils/make_tiff.py" ]
[ "import openslide\nfrom PIL import Image\n\nimport numpy as np\nimport json\nimport libtiff\nimport sys\nsys.setrecursionlimit(200000)\n\n\n\n\n\n\n\n\n# Work in progress\nfilename = \"Tumor_001.json\"\nreal_image_name = \"tumor_001.tif\"\nnew_image_name = \"tumor_mask_001.tiff\"\nlevel = 5\n\n\nwith open(filename,...
[ [ "numpy.zeros" ] ]
modsim/junn
[ "a40423b98c6a3739dd0b2ba02d546a5db91f9215" ]
[ "junn/networks/mixins/weighted_loss.py" ]
[ "\"\"\"Weightes loss mixin.\"\"\"\nimport tensorflow as tf\n\nfrom ...common.functions import convolve, get_gaussian_kernel\nfrom .tile_based_network import TilebasedNetwork\n\n\n@tf.function\ndef calculate_weightmap(\n image, sigma=3.5, overlap_ratio=2.5, inner_ratio=0.75, empty=0.25\n):\n \"\"\"\n Calcul...
[ [ "tensorflow.shape", "tensorflow.concat" ] ]
UBC-Solar/Simulation
[ "296ce78bb24b3bd7849d07a62bc544f98f212db1" ]
[ "examples/max_distance_from_speed_using_arrays.py" ]
[ "import numpy as np\n\nimport simulation\nfrom simulation.common import helpers\nfrom simulation.optimization.bayesian import BayesianOptimization\nfrom simulation.optimization.random import RandomOptimization\nfrom simulation.utils.InputBounds import InputBounds\n\n\"\"\"\nDescription: Given an hourly driving spee...
[ [ "numpy.array", "numpy.fromiter" ] ]
alanhdu/pytorch-lightning
[ "b7a22ba046ba57072a71b12d16caff000e66f798", "b7a22ba046ba57072a71b12d16caff000e66f798" ]
[ "tests/checkpointing/test_checkpoint_callback_frequency.py", "tests/accelerators/test_accelerator_connector.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.ones" ], [ "torch.device" ] ]
taoxianpeng/pytorch-AutoEncoders
[ "cb0edd050c763f0fc29f8275c266b151f5d5dca9" ]
[ "src/StackedAutoEncoder/models.py" ]
[ "import torch\nfrom torch import nn, optim, functional, utils\nimport torchvision\nfrom torchvision import datasets, utils\n\nimport time, os\n\n\nclass AutoEncoderLayer(nn.Module):\n \"\"\"\n fully-connected linear layers for stacked autoencoders.\n This module can automatically be trained when training e...
[ [ "torch.nn.Linear", "torch.nn.Sigmoid" ] ]
uvidyadharan/fmltc
[ "a35e3d3ff6b34e4a2b1084822e0546996d87d9bf" ]
[ "server/tflite_creator.py" ]
[ "# Copyright 2020 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.lite.TFLiteConverter.from_saved_model", "tensorflow.io.gfile.GFile" ] ]
elijahr/python-portaudio
[ "8434396cf7a9faa8934cab289749daf08b04d0b3" ]
[ "src/portaudio/stream_helpers.py" ]
[ "import asyncio\nfrom functools import reduce\nfrom operator import mul\n\nfrom typing import TYPE_CHECKING, Any, Union\nfrom ringbuf import Array, concatenate\n\nfrom . import exceptions, pa\n\ntry:\n import numpy as np\nexcept ImportError:\n np = None\n\nif TYPE_CHECKING:\n from . import streams\n\n\nasy...
[ [ "numpy.ascontiguousarray", "numpy.array" ] ]
Devalent/aws-realtime-predictions
[ "2b8c34a9dc19ad789e38e3350c9ec5fed8522cc1" ]
[ "pipeline/preprocess.py" ]
[ "import argparse\nimport json\nimport logging\nimport pathlib\n\nimport boto3\nimport pandas as pd\n\nlogger = logging.getLogger()\nlogger.setLevel(logging.INFO)\nlogger.addHandler(logging.StreamHandler())\n\nfeature_columns_names = [\"country\", \"dos\", \"dtype\", \"dbrowser\"]\nclass_column_name = \"category\"\n...
[ [ "pandas.read_csv" ] ]
paroque28/tensorflow-yolov4-tflite-1
[ "ad582a20d74a97bda78cbbc78a180ea5c7afa335" ]
[ "convert_trt.py" ]
[ "import tensorflow as tf\nfrom absl import app, flags, logging\nfrom absl.flags import FLAGS\nimport numpy as np\nimport cv2\nfrom tensorflow.python.compiler.tensorrt import trt_convert as trt\nimport core.utils as utils\nfrom tensorflow.python.saved_model import signature_constants\nimport os\nfrom tensorflow.comp...
[ [ "tensorflow.python.compiler.tensorrt.trt_convert.TrtGraphConverterV2", "tensorflow.compat.v1.ConfigProto", "tensorflow.compat.v1.InteractiveSession", "numpy.copy", "tensorflow.constant", "tensorflow.python.compiler.tensorrt.trt_convert.DEFAULT_TRT_CONVERSION_PARAMS._replace", "tensorfl...
catalystneuro/hussaini-lab-to-nwb
[ "c3b2338fffb1d727a923bd361eac7215e93f31fe" ]
[ "hussaini_lab_to_nwb/tint_conversion/export_spike_waveforms.py" ]
[ "import os\nimport struct\nfrom pathlib import Path\n\nimport numpy as np\nimport spiketoolkit as st\n\nfrom .utils import get_group_property_name, assert_group_names_match\n\n\ndef parse_generic_header(filename):\n \"\"\"\n Given a binary file with phrases and line breaks, enters the\n first word of a phr...
[ [ "numpy.concatenate", "numpy.tile", "numpy.unique" ] ]
IINemo/isanlp_rst
[ "2d71b4fa874e6777aa437989024294bf9f6983c0" ]
[ "src/maintenance/utils/parse_rs3_rightbranch.py" ]
[ "\"\"\"\nScript to convert Rhetorical Structure Theory trees from .rs3 format\nto relationships examples pairs.\n\"\"\"\n\nfrom rs3_feature_extraction import ParsedToken\nimport re, sys, codecs, os, tempfile, subprocess, ntpath\nimport xml\nfrom xml.dom import minidom\nfrom xml.parsers.expat import ExpatError\nfrom...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
NatalieP-J/spectralspace
[ "66c53878febaf6aee919cfc86c34b5dc21465343" ]
[ "spectralspace/examples/psm.py" ]
[ "\nimport numpy as np\n\n## Polynomial Model from Yuan-Sen Ting (Rix+ 2017) ##\n\ndatadir = '/geir_data/scr/price-jones/Code/synspec/data/'\n\npsminfo = np.load('{0}/kurucz_quadratic_psm.npz'.format(datadir))\ncoeff_array = psminfo['coeff_array']\n\n# a set of training labels\ntraining_labels = psminfo['training_la...
[ [ "numpy.array", "numpy.dot", "numpy.arange", "numpy.einsum", "numpy.hstack" ] ]
MTandHJ/PyTorch-Robust
[ "3f046fce515a7ed66ab34079329cd3496ca5087c" ]
[ "AVmixup/src/loadopts.py" ]
[ "\nfrom typing import Callable, Tuple\nimport numpy as np\nimport torch\nimport torchvision\nimport foolbox as fb\n\nimport time\nfrom tqdm import tqdm\n\n\nfrom models.base import AdversarialDefensiveModule\nfrom .base import AdversaryForValid\nfrom .config import *\nfrom .utils import getLogger, mkdirs\n\n\n\ncla...
[ [ "torch.utils.data.Subset", "torch.tensor", "numpy.random.shuffle", "numpy.random.seed" ] ]
markmelnic/Carsen-Crawler
[ "6f5a7b7b7ba7cdad04c0dd30a53d17239dda6965" ]
[ "crawler/visualizer.py" ]
[ "import time\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\n\n# generate the live graph\ndef live_graph(crawler):\n plt.style.use(\"dark_background\")\n fig, (links_plot, perf_plot) = plt.subplots(2)\n fig.canvas.set_window_title(\"Crawler Activity Visualizer\")\n\n # timest...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.style.use" ] ]
Joanna0123/QueryInst
[ "6f75240610439e92bca5398054e3f7adc37bfd53" ]
[ "mmdet/models/roi_heads/track_roi_head.py" ]
[ "import torch\nimport numpy as np\n\nfrom mmdet.core import bbox2result, bbox2roi, bbox_xyxy_to_cxcywh, bbox_flip\nfrom mmdet.core.bbox.samplers import PseudoSampler\nfrom ..builder import HEADS\nfrom .cascade_roi_head import CascadeRoIHead\n\nfrom mmcv.ops.nms import batched_nms\n\ndef mask2results(mask_preds, det...
[ [ "numpy.concatenate", "torch.cat", "torch.from_numpy" ] ]
Site-Command/lightning-flash
[ "bfff08ded9cf193cce1cd16e7034d8005de172ae", "bfff08ded9cf193cce1cd16e7034d8005de172ae" ]
[ "flash/core/classification.py", "tests/core/test_finetuning.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.sigmoid", "torch.argmax", "torch.softmax" ], [ "torch.rand", "torch.randint" ] ]
sophiaalthammer/parm
[ "ecf2dce5ee225b18e1ed3736a86696cc81e0797c" ]
[ "preprocessing/coliee21_task2_dpr.py" ]
[ "import os\r\nimport argparse\r\nimport jsonlines\r\nimport json\r\nimport pickle\r\nimport matplotlib.pyplot as plt\r\nimport csv\r\nfrom preprocessing.dpr_preprocessing import corpus_to_ctx_file\r\nfrom eval.eval_bm25_coliee2021 import read_label_file\r\nfrom preprocessing.coliee21_task2_bm25 import ranking_eval,...
[ [ "matplotlib.pyplot.annotate", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter" ] ]
ludmila-kuncarova/matched_markets
[ "ded2469997e5bf5b87613f35c38aeb6d35c0ca6e" ]
[ "matched_markets/tests/test_tbr_iroas.py" ]
[ "# Copyright 2020 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed...
[ [ "numpy.random.seed", "numpy.random.normal" ] ]
fredzett/datastack
[ "ece795599c33ccbefcaef32f89559188b0185d58", "ece795599c33ccbefcaef32f89559188b0185d58", "ece795599c33ccbefcaef32f89559188b0185d58" ]
[ "datastack/helper.py", "datastack/datacolumn.py", "tests/tests_verbs/test_order_by.py" ]
[ "from typing import Dict\nimport numpy as np\nfrom numpy.lib.arraysetops import isin\n\n# Checks if dicts in DataTable._data are equal\n# needed because nested dicts containing different types (e.g. np.ndarray)\ndef _dicts_equal(a: Dict, b: Dict) -> bool:\n # Check if labels / columns are equal\n if a.keys() ...
[ [ "numpy.allclose", "numpy.array_equal", "numpy.asarray" ], [ "numpy.array", "numpy.pad", "numpy.array_equal", "numpy.asarray", "numpy.sum", "numpy.nansum", "numpy.allclose", "numpy.hstack" ], [ "numpy.array" ] ]
wm75/gemini2cbio
[ "1464f9799d6310a54cc5ff701d1358f9c0acaefd" ]
[ "converter_panda.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*- \n\nimport pandas as pd\n\nimport config\n\n\n#read input and save as df\ndf = pd.read_csv(config.inputfile, sep='\\t')\n\n\n#replace empty cells in columns impact and impact_so with Targeted Region \ndf['impact'] = df.impact.fillna('Targeted_Region')\ndf['impact_so']...
[ [ "pandas.read_csv" ] ]
ReinFS/password-generator
[ "85635061723e66ae7a8aa141dd31b138834ad365" ]
[ "main.py" ]
[ "import numpy as np\nfrom random import randint\n\nhighAlfabhet = np.array([\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"])\nlowAlfabhet = np.array([\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j...
[ [ "numpy.array" ] ]
louisccc/code2vec
[ "125ab5ab7e4bda68a4ba6dbe4babe2854c7bca80" ]
[ "cores/code2vec.py" ]
[ "from pathlib import Path\nfrom tqdm import tqdm\nimport pickle\nimport numpy as np\nimport tensorflow as tf\n\n\nclass code2vec(tf.keras.Model): \n\n def __init__(self, config):\n super(code2vec, self).__init__()\n\n self.config = config \n\n self.def_parameters()\n\n def def_parameters(...
[ [ "tensorflow.initializers.glorot_normal", "tensorflow.multiply", "tensorflow.concat", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.nn.embedding_lookup", "tensorflow.nn.softmax", "tensorflow.nn.dropout" ] ]
donehower/pandas
[ "ed20822a54e3863b393554ecca801654af105555" ]
[ "pandas/tests/arithmetic/test_timedelta64.py" ]
[ "# Arithmetic tests for DataFrame/Series/Index/Array classes that should\n# behave identically.\nfrom datetime import datetime, timedelta\n\nimport numpy as np\nimport pytest\n\nfrom pandas.errors import NullFrequencyError, OutOfBoundsDatetime, PerformanceWarning\n\nimport pandas as pd\nfrom pandas import (\n Da...
[ [ "pandas.DatetimeIndex", "pandas.offsets.Minute", "pandas.offsets.Day", "pandas.tests.arithmetic.test_datetime64.assert_invalid_comparison", "numpy.negative", "pandas.util.testing.box_expected", "numpy.multiply", "pandas.Timestamp", "pandas.UInt64Index", "pandas.util.testing...
LeandroTeodoroRJ/SistemasDeControlePython
[ "83122f45f55faac0bd069668dc6e1c19f6e6fcd4" ]
[ "Revisao_Ex1_Polos_Simples.py" ]
[ "'''\r\nExercício – Pólos Simples \r\n1. Para o sistema representado pela seguinte equação diferencial: \r\n\r\ndiff(y, t, 2) + 5*diff(y, t, 1) + 6*y = u\r\n\r\nDetermine: \r\n(a) A função de transferência; \r\n(b) A equação característica; \r\n(c) Os pólos e os zeros; \r\n(d) A estabilidade do sistema; \r\n(e...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.arange" ] ]
sean-engelstad/funtofem
[ "1f905089c45f856ec6f34c5401dc3029c1651460" ]
[ "funtofem/mphys/mphys_meld.py" ]
[ "import numpy as np\nimport openmdao.api as om\nfrom mphys import Builder\n\nfrom funtofem import TransferScheme\n\nclass MeldDispXfer(om.ExplicitComponent):\n \"\"\"\n Component to perform displacement transfer using MELD\n \"\"\"\n def initialize(self):\n self.options.declare('xfer_object', rec...
[ [ "numpy.array", "numpy.zeros" ] ]
courspython/matplotlib
[ "d03f05332e33167d93f3c67f5a929ddd22dcb8d9" ]
[ "lib/matplotlib/tri/triplot.py" ]
[ "from __future__ import print_function\nfrom matplotlib.cbook import ls_mapper\nfrom matplotlib.patches import PathPatch\nfrom matplotlib.path import Path\nfrom matplotlib.tri.triangulation import Triangulation\nimport numpy as np\n\n\ndef triplot(ax, *args, **kwargs):\n \"\"\"\n Draw a unstructured triangula...
[ [ "matplotlib.path.Path", "matplotlib.tri.triangulation.Triangulation.get_from_args_and_kwargs", "matplotlib.patches.PathPatch" ] ]
jc-bao/panda-gym
[ "1860bf7459d50fc1a3677d937c984034fd936a7e", "1860bf7459d50fc1a3677d937c984034fd936a7e" ]
[ "examples/tower_test.py", "panda_gym/envs/robots/panda_2.py" ]
[ "import gym\nimport panda_gym\nimport numpy as np\n\ndef policy(obs, timestep):\n goal = obs['desired_goal']\n goal1_pos = goal[:3]\n # goal2_pos = goal[3:]\n obs = obs['observation']\n robot1_obs = obs[:7]\n robot2_obs = obs[7:14]\n task_obs = obs[14:]\n obj1_pos = task_obs[:3]\n # obj2_...
[ [ "numpy.concatenate", "numpy.array", "numpy.linalg.norm" ], [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.random.randn", "numpy.clip" ] ]
nikhilaravi/pytorch3d-1
[ "2480723adf1ce8a5cfca5c190f5fba7a48549f75" ]
[ "pytorch3d/renderer/cameras.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nimport math\nimport numpy as np\nfrom typing import Tuple, Optional, Sequence\nimport torch\nimport torch.nn.functional as F\n\nfrom pytorch3d.transforms import Rotate, Transform3d, Translate\n\nfrom .utils import TensorProperties, convert_...
[ [ "torch.zeros", "torch.nn.functional.normalize", "torch.cat", "torch.cos", "torch.stack", "numpy.zeros", "torch.tan", "torch.is_tensor", "torch.sin", "numpy.eye", "torch.ones", "torch.tensor", "torch.cross" ] ]
Childhoo/Chen_Matcher
[ "ca89a4774a083d10177186020c35f60c3e8b7b37" ]
[ "examples/hesaffnet/hesaffnet.py" ]
[ "#!/usr/bin/python2 -utt\n# -*- coding: utf-8 -*-\nimport torch\nimport torch.nn as nn\nimport numpy as np\nimport sys\nimport os\nimport time\n\nfrom PIL import Image\nfrom torch.autograd import Variable\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nfrom tqdm import tqdm\nimport math\nimport ...
[ [ "numpy.array", "numpy.savetxt", "torch.no_grad", "torch.load" ] ]
GreenAIproject/ICT4S22
[ "e1af70be3240c3532b8c46889cfdb9ac4dbdaa21" ]
[ "src/energy_experiment.py" ]
[ "from text_classification import generate_model, model_validation\nfrom modify_dataset import modify_dataset_and_raw_data_with_percentage_size_to_keep\nfrom modify_dataset import modify_dataset_select_features\n\nfrom sklearn.svm import SVC\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.naive_bayes ...
[ [ "sklearn.ensemble.BaggingClassifier", "sklearn.ensemble.AdaBoostClassifier", "sklearn.naive_bayes.ComplementNB", "sklearn.ensemble.RandomForestClassifier", "sklearn.neighbors.KNeighborsClassifier", "sklearn.svm.SVC", "sklearn.tree.DecisionTreeClassifier" ] ]
ssrivastava836/visualizing-the-weather-data-set
[ "0114300f0240533c863d9c04ea0e8c5f895b4df5" ]
[ "code.py" ]
[ "# --------------\n# --------------\r\n# Import the required Libraries\r\nfrom matplotlib import pyplot as plt\r\nimport numpy as np\r\nimport pandas as pd\r\nimport calendar\r\nimport seaborn as sns\r\nimport warnings\r\nwarnings.filterwarnings(\"ignore\")\r\n\r\n\r\n# Generate a line chart that visualizes the rea...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.xticks", "matplotlib.pyplot.subplot" ...
nkjulia/magenta
[ "063d320d59276a15afa0f8a3a8d386ad74594070", "063d320d59276a15afa0f8a3a8d386ad74594070", "063d320d59276a15afa0f8a3a8d386ad74594070" ]
[ "magenta/models/improv_rnn/improv_rnn_config_flags.py", "magenta/models/onsets_frames_transcription/audio_label_data_utils_test.py", "magenta/models/onsets_frames_transcription/melspec_input.py" ]
[ "# Copyright 2021 The Magenta 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 applicable law o...
[ [ "tensorflow.compat.v1.app.flags.DEFINE_string" ], [ "numpy.concatenate", "numpy.testing.assert_array_equal", "tensorflow.compat.v1.test.main", "numpy.zeros" ], [ "tensorflow.compat.v1.signal.linear_to_mel_weight_matrix", "tensorflow.compat.v1.pad", "tensorflow.compat.v1.add...
AndreasWunsch/CNN_KarstSpringModeling
[ "9239f5ac6920cdc82956289d9b480ed8558908ea" ]
[ "Example Code/heatmaps_calculation.py" ]
[ "# -*- coding: utf-8 -*-.\n\n\"\"\"\ndoi of according publication [preprint]:\nhttps://doi.org/10.5194/hess-2021-403\n\nContact: andreas.wunsch@kit.edu\nORCID: 0000-0002-0585-9549\n\nhttps://github.com/AndreasWunsch/CNN_KarstSpringModeling/\nMIT License\n\nlarge parts opf the code from Sam Anderson (https://github....
[ [ "numpy.random.choice", "tensorflow.data.Dataset.from_tensor_slices", "numpy.copy", "numpy.half", "numpy.mean", "numpy.size", "pandas.read_csv", "tensorflow.random.set_seed", "pandas.DataFrame", "numpy.arange", "numpy.random.randint", "numpy.mod", "tensorflow.mat...
shan18/TensorNet
[ "c79a0c64152dbeb3499d204994772858326f668c" ]
[ "tensornet/engine/learner.py" ]
[ "import math\nimport time\nimport torch\nfrom copy import deepcopy\n\nfrom tensornet.engine.ops.regularizer import l1\nfrom tensornet.engine.ops.checkpoint import ModelCheckpoint\nfrom tensornet.engine.ops.tensorboard import TensorBoard\nfrom tensornet.data.processing import InfiniteDataLoader\nfrom tensornet.utils...
[ [ "torch.no_grad", "torch.pow", "torch.abs", "torch.div", "torch.sum" ] ]
Kanasani-Monica/tensorpack
[ "18b19d6dec901415ab8877a1405145cb5dda919b" ]
[ "examples/DoReFa-Net/alexnet-dorefa.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# File: alexnet-dorefa.py\n# Author: Yuxin Wu, Yuheng Zou ({wyx,zyh}@megvii.com)\n\nimport cv2\nimport tensorflow as tf\nimport argparse\nimport numpy as np\nimport os\nimport sys\n\n\nfrom tensorpack import *\nfrom tensorpack.tfutils.summary import add_param_summary...
[ [ "tensorflow.train.AdamOptimizer", "tensorflow.nn.relu", "numpy.load", "tensorflow.clip_by_value", "tensorflow.get_variable" ] ]
vsl9/NeMo
[ "4137c2b4e3cba0ec5ca1da7b58b3ff97fdb25e50", "4137c2b4e3cba0ec5ca1da7b58b3ff97fdb25e50", "4137c2b4e3cba0ec5ca1da7b58b3ff97fdb25e50" ]
[ "nemo/collections/asr/parts/features.py", "nemo/collections/nlp/utils/callbacks/joint_intent_slot.py", "nemo/collections/asr/greedy_ctc_decoder.py" ]
[ "# Taken straight from Patter https://github.com/ryanleary/patter\n# TODO: review, and copyright and fix/add comments\nimport math\n\nimport librosa\nimport torch\nimport torch.nn as nn\nfrom torch_stft import STFT\n\nfrom nemo import logging\nfrom nemo.collections.asr.parts.perturb import AudioAugmentor\nfrom nemo...
[ [ "torch.zeros", "torch.cat", "torch.arange", "torch.finfo", "torch.no_grad", "torch.ceil", "torch.randn_like", "torch.tensor", "torch.nn.functional.pad" ], [ "sklearn.metrics.confusion_matrix", "numpy.asarray", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.t...
ICinoI/pandapipes
[ "48dd088cdaaa21349f915547cd0f1d539885325c" ]
[ "pandapipes/component_models/pump_component.py" ]
[ "# Copyright (c) 2020-2021 by Fraunhofer Institute for Energy Economics\n# and Energy System Technology (IEE), Kassel, and University of Kassel. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.\n\nfrom operator import itemgetter\n\nimport nump...
[ [ "numpy.dtype" ] ]
shuuchen/UNet
[ "15722282e8342895a5003cb21dfae70e436b31cf" ]
[ "models/res_unet_classifier.py" ]
[ "import torch\nfrom torch import nn\nimport torch.nn.functional as F\n\n\nclass ResUNet(nn.Module):\n def __init__(\n self,\n in_channels=1,\n out_channels=2,\n depth=5,\n wf=6,\n padding=True,\n batch_norm=True,\n up_mode='upconv',\n ):\n \"\"\"\...
[ [ "torch.cat", "torch.nn.ModuleList", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.ReLU", "torch.nn.Upsample", "torch.nn.Conv2d", "torch.nn.functional.max_pool2d" ] ]
gngdb/ROMP
[ "a940af92e266530f4fe65807ab5920f0b4246511" ]
[ "src/lib/models/smpl.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is\n# holder of all proprietary rights on this computer program.\n# You can only use this computer program if you have closed\n# a license agreement with MPG or you get the right to use the computer\n# program from som...
[ [ "torch.cat", "torch.stack", "torch.einsum", "numpy.load", "torch.bmm", "torch.ones", "torch.nn.Parameter", "torch.eye", "torch.nn.functional.pad", "numpy.concatenate", "torch.sqrt", "torch.norm", "torch.unsqueeze", "torch.tensor", "torch.index_select", ...
qyuga/alpaca-trade-api-python
[ "495d494610f6f852a1c151548934c8209e7b1f86" ]
[ "alpaca_trade_api/entity.py" ]
[ "import pandas as pd\nimport pprint\nimport re\n\nISO8601YMD = re.compile(r'\\d{4}-\\d{2}-\\d{2}T')\nNY = 'America/New_York'\n\n\nclass Entity(object):\n '''This helper class provides property access (the \"dot notation\")\n to the json object, backed by the original object stored in the _raw\n field.\n ...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.Timestamp", "pandas.MultiIndex.from_product", "pandas.concat" ] ]
armando-fandango/tensorflow-addons
[ "a7065e7297022f9086cdabcfe4798ee1691daedf" ]
[ "tensorflow_addons/seq2seq/attention_wrapper.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.array_ops.identity", "tensorflow.python.ops.math_ops.matmul", "tensorflow.python.ops.array_ops.where", "tensorflow.python.ops.array_ops.ones", "tensorflow.python.ops.math_ops.tanh", "tensorflow.python.framework.tensor_shape.dimension_value", "tensorflow.python.op...
Elizaaaaa/deep-learning-containers
[ "6274ecb264645070d11b27e5c7e60d2e4110537d" ]
[ "test/dlc_tests/container_tests/bin/examples/KerasMXNet/cifar10_resnet.py" ]
[ "\"\"\"Trains a ResNet on the CIFAR10 dataset.\n \nResNet v1\n[a] Deep Residual Learning for Image Recognition\nhttps://arxiv.org/pdf/1512.03385.pdf\n \nResNet v2\n[b] Identity Mappings in Deep Residual Networks\nhttps://arxiv.org/pdf/1603.05027.pdf\n\"\"\"\n \nfrom __future__ import print_function\nimport keras\nf...
[ [ "numpy.sqrt", "numpy.mean" ] ]
MMnash/ParlAI
[ "7429016bce901b00f9bf4b06c82687d49cd548fa" ]
[ "projects/light_whoami/agents/pacer.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\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\"\"\"\nPACER: Partial And Complete Efficient Re-ranking.\n\nSee `PacerTreeSearchMixin.modify_logprobs` for a com...
[ [ "torch.nn.functional.log_softmax" ] ]
thomascherickal/strawberryfields
[ "f8e030b6e75554e8d59d232d3aa285b1168d2e76" ]
[ "tests/frontend/test_sf_plot.py" ]
[ "# Copyright 2019-2020 Xanadu Quantum Technologies 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-2.0\n\n# Unless required by ap...
[ [ "numpy.arange" ] ]
klarh/flowws-structure-pretraining
[ "d54103d30df98ed846768d6e0ed851edcd53bfcc", "d54103d30df98ed846768d6e0ed851edcd53bfcc" ]
[ "flowws_structure_pretraining/tasks/internal.py", "flowws_structure_pretraining/analysis/EmbeddingPlotter.py" ]
[ "import bisect\nimport collections\n\nimport freud\nimport numpy as np\n\nFrame = collections.namedtuple(\n \"Frame\",\n [\n \"box\",\n \"positions\",\n \"types\",\n \"context\",\n \"index_i\",\n \"index_j\",\n \"weights\",\n \"rijs\",\n \"tijs\",...
[ [ "numpy.concatenate", "numpy.add.reduceat", "numpy.array", "numpy.asarray", "numpy.random.default_rng", "numpy.logical_and", "numpy.eye", "numpy.where" ], [ "matplotlib.colors.ListedColormap", "numpy.random.default_rng" ] ]
stes/scikit-kinematics
[ "1a4d7212c8fff93428cb1d56ac6d77faa32e6bc5" ]
[ "skinematics/sensors/yei.py" ]
[ "'''\nImport data saved with yei-sensors, through subclassing \"IMU_Base\"\n'''\n\n'''\nAuthor: Thomas Haslwanter\nDate: Sept-2017\n'''\n\nimport numpy as np\nimport pandas as pd\nimport re\nimport abc\n\n# To ensure that the relative path works\nimport os\nimport sys\n\nparent_dir = os.path.abspath(os.path.join( o...
[ [ "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.plot" ] ]
Zhengymm/DCP
[ "6faf311f0519c50b213c248b23108119453075b4" ]
[ "runDCP.py" ]
[ "from __future__ import print_function, division\n\nimport argparse\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom sklearn.cluster import KMeans\nfrom torch.nn.parameter import Parameter\nfrom torch.optim import Adam\nfrom evaluation import eva\nfrom utils import load_data, load_graph...
[ [ "torch.device", "sklearn.cluster.KMeans", "torch.no_grad", "torch.nn.functional.mse_loss", "torch.cuda.set_device", "torch.cuda.is_available", "torch.tensor", "torch.load", "torch.nn.init.xavier_normal_", "torch.Tensor", "torch.sum" ] ]
darianyang/molecool
[ "0654a88bfb5a6ef2137ea9f74dcae86b7827f999" ]
[ "molecool/io/pdb.py" ]
[ "\"\"\"\nFunctions for manipulating PDB files.\n\"\"\"\n\nimport os\nimport numpy as np\n\ndef open_pdb(f_loc):\n \"\"\"\n This function reads in a pdb file and returns the atom names and coordinates.\n\n Parameters\n ----------\n f_loc : string for file location\n\n Returns\n -------\n sym ...
[ [ "numpy.array" ] ]
remi-pr/tridesclous
[ "074f425fd40f1fb76f619f74cc024dd9817b7ee7", "074f425fd40f1fb76f619f74cc024dd9817b7ee7" ]
[ "tridesclous/gui/isiviewer.py", "tridesclous/tests/test_matplotlibplot.py" ]
[ "from .myqt import QT\nimport pyqtgraph as pg\n\nimport numpy as np\nimport pandas as pd\n\nfrom .base import WidgetBase\n\n\n\nclass MyViewBox(pg.ViewBox):\n doubleclicked = QT.pyqtSignal()\n def mouseDoubleClickEvent(self, ev):\n self.doubleclicked.emit()\n ev.accept()\n def raiseContextMen...
[ [ "numpy.concatenate", "numpy.histogram", "numpy.arange", "numpy.diff" ], [ "matplotlib.pyplot.show", "numpy.arange", "numpy.random.randint", "numpy.random.randn" ] ]
mkturkcan/NoiseIgnoringNetworks
[ "5803d666d6c97075d18673825dc07c20bb3e5375" ]
[ "autokeras/tasks/structured_data_mixin.py" ]
[ "import pandas as pd\n\n\nclass StructuredDataMixin(object):\n\n def check(self, column_names, column_types):\n if column_types:\n for column_type in column_types.values():\n if column_type not in ['categorical', 'numerical']:\n raise ValueError(\n ...
[ [ "pandas.read_csv" ] ]
murphp30/radiospectra
[ "0730784abf740a527343386264f5711b08c12f7f" ]
[ "radiospectra/spectrogram2/tests/test_psp_rfs.py" ]
[ "from pathlib import Path\nfrom datetime import datetime\nfrom unittest import mock\n\nimport numpy as np\n\nimport astropy.units as u\nfrom astropy.time import Time\nfrom sunpy.net import attrs as a\n\nfrom radiospectra.spectrogram2 import Spectrogram\nfrom radiospectra.spectrogram2.sources import RFSSpectrogram\n...
[ [ "numpy.zeros" ] ]
ACea15/pyNastran
[ "5ffc37d784b52c882ea207f832bceb6b5eb0e6d4", "5ffc37d784b52c882ea207f832bceb6b5eb0e6d4", "5ffc37d784b52c882ea207f832bceb6b5eb0e6d4" ]
[ "pyNastran/op2/dev/aero_eqs.py", "pyNastran/op2/tables/oes_stressStrain/complex/oes_shear.py", "pyNastran/bdf/mesh_utils/shift.py" ]
[ "#pylint: disable=C0301,W0612,C0111,R0201,C0103,W0613,R0914\nimport numpy as np\n\ndef merge(amatrix, bmatrix):\n return amatrix + bmatrix\n\ndef run(Gka, Wkk, Skj, AJJI, DJK,\n K, KALX, KARX, KALL, KALLI, KAXL, Ka_rl, Ka_rr, Ka_lli,\n K2JE, KARL, KARZX, KSALL, KSALLI, KAA, Ka_lr, K2RZX,\n K...
[ [ "numpy.log", "numpy.ones", "numpy.linalg.inv", "numpy.zeros" ], [ "numpy.allclose", "numpy.array_equal", "numpy.zeros" ], [ "numpy.searchsorted", "numpy.array" ] ]
ishine/VITS-1
[ "6b76bab881c801322ee3a8d8815ec06dd1c80980" ]
[ "module/dataset_util.py" ]
[ "#encoding:utf-8\n\nimport random\nimport numpy as np\nimport matplotlib as mpl\nmpl.use('Agg')# AGG(Anti-Grain Geometry engine)\nimport matplotlib.pyplot as plt\nimport os\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data as data\nimport torchvision\nfrom torchvision impo...
[ [ "matplotlib.use", "torch.zeros", "torch.hann_window", "torch.save", "torch.squeeze", "torch.LongTensor", "torch.load", "torch.zeros_like", "torch.nn.functional.pad" ] ]
hpparvi/triceratops
[ "7521ee5c5a493871b95e60ae0092fbb5d74db2da" ]
[ "triceratops/priors.py" ]
[ "import numpy as np\nfrom astropy import constants\nfrom .funcs import (file_to_contrast_curve,\n separation_at_contrast,\n trilegal_results)\n\nMsun = constants.M_sun.cgs.value\nRsun = constants.R_sun.cgs.value\nRearth = constants.R_earth.cgs.value\nG = constants.G.cgs.value\n...
[ [ "numpy.isnan", "numpy.log", "numpy.exp", "numpy.cos", "numpy.log10" ] ]
hidden-beauty/hiddenbeauty-tools
[ "ba93138f94079b89d7f9d89328509e201837bd07" ]
[ "hiddenbeauty/utils.py" ]
[ "import pymesh\nimport math\nimport os\nimport numpy as np\n\ndef get_fast_bbox(mesh):\n\n bbox = [[100000,100000,100000], [0,0,0]]\n for vertex in mesh.vertices:\n\n if vertex[0] > bbox[1][0]:\n bbox[1][0] = vertex[0]\n if vertex[0] < bbox[0][0]:\n bbox[0][0] = vertex[0]\n...
[ [ "numpy.array", "numpy.dot" ] ]
PeterWolf93/PupilLabs_VR_Calibration
[ "5904804d5eab83805cc1ded04b9de31239b5771a" ]
[ "Calib_Tools/pix2deg.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Aug 6 10:58:17 2018\r\n\r\n@author: P. Wolf\r\n\r\ntitle: pix2deg\r\n\"\"\"\r\n#%% Imports\r\nimport numpy as np\r\n\r\n#%% main function\r\ndef pix2deg(x_px,y_px,cfg,mode):\r\n if mode == '2D':\r\n x_rad = np.arctan((x_px * cfg.screen_width)/(cfg.scre...
[ [ "numpy.arctan" ] ]
wiheto/dfcbenchmarker
[ "d2381d7173a40234d217301e91a0d883bf555d4c" ]
[ "dfcbenchmarker/plot.py" ]
[ "import matplotlib.pyplot as plt\nimport dfcbenchmarker\nimport numpy as np\nimport scipy.stats as sps\nfrom matplotlib.ticker import LinearLocator\nimport seaborn as sns\nimport os\nplt.style.use('seaborn-whitegrid')\n\n\n\ndef plot_timeseries(x,plot_autocorr='no',fig_dir=None,fig_prefix=None,cm='Set2',limitaxis=1...
[ [ "numpy.isnan", "matplotlib.pyplot.savefig", "matplotlib.pyplot.suptitle", "scipy.stats.spearmanr", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "matplotlib.ticker.LinearLocator", "numpy.arange", "matplotlib.pyplot.tight_layout", "...
jinjiren/chainer-DRCN
[ "5494f4c9f37bb6ac634d659988af1c48bfd4e8dc" ]
[ "utils.py" ]
[ "\"\"\"\nContains all helpers for DRCN\n\"\"\"\nimport datetime\nimport json\nimport os\n\nimport numpy as np\nimport scipy.ndimage as ndi\n\n\ndef prepare_dir(args):\n # customize the output path\n date = datetime.datetime.now()\n date_str = date.strftime(\"%m%d%H%M%S\")\n if args.source_only:\n ...
[ [ "numpy.array", "numpy.dot", "scipy.ndimage.interpolation.affine_transform", "numpy.sin", "numpy.rollaxis", "numpy.stack", "numpy.random.uniform", "numpy.cos" ] ]
kxxt/taichi
[ "15f39b79c258080f1e34fcbdc29646d9ced0a4fe" ]
[ "python/taichi/examples/features/io/export_mesh.py" ]
[ "import os\n\nimport numpy as np\n\nimport taichi as ti\n\n# A 2D grid with quad faces\n# y\n# |\n# z---/\n# x\n# 19---15---11---07---03\n# | | | | |\n# 18---14---10---06---02\n# | | | | |\n# 17---13---19---05---01\n# | | | ...
[ [ "numpy.array", "numpy.random.rand", "numpy.zeros", "numpy.ones", "numpy.arange" ] ]
ptillet/Fixup
[ "bdf6cb4b77717ab2ac2fa02adc4160aba06c1b56" ]
[ "fairseq/fairseq/modules/multihead_attention_zero.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nimport torch\nfrom tor...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.init.constant_", "torch.nn.functional.dropout", "torch.nn.init.xavier_uniform_", "torch.bmm", "torch.nn.functional.linear", "torch.Tensor" ] ]
AlbertSuarez/donework
[ "3cd11e153a20d7b4d2ba69e9536d332224c79579" ]
[ "src/gpt_2/src/interactive_conditional_samples.py" ]
[ "#!/usr/bin/env python3\nimport fire\nimport json\nimport os\nimport numpy as np\nimport tensorflow as tf\n\nfrom src import *\nimport src.gpt_2.src.model as model\nimport src.gpt_2.src.sample as sample\nimport src.gpt_2.src.encoder as encoder\n\n\ngeneratedText = \"\"\ninputText = \"\"\nrandomness = 85\n\n\ndef in...
[ [ "tensorflow.set_random_seed", "numpy.random.seed", "tensorflow.Graph", "tensorflow.train.Saver", "tensorflow.placeholder" ] ]
microsoft/AdversarialGMM
[ "7a5cd51353c8a81e16c01220b71f77e4e1102add", "7a5cd51353c8a81e16c01220b71f77e4e1102add" ]
[ "mliv/dgps.py", "montecarlo/mcpy/plotting.py" ]
[ "# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n\nimport numpy as np\n\n# continuously differentiable\nfn_dict_cdiff = {'2dpoly': 1, 'sigmoid': 2,\n 'sin': 3, 'frequent_sin': 4,\n '3dpoly': 7, 'linear': 8}\n# continuous but not differentiable\nfn_dict_cont...
[ [ "numpy.random.normal", "numpy.searchsorted", "numpy.amin", "numpy.random.uniform", "numpy.random.randint", "numpy.arange", "numpy.sqrt", "numpy.power", "numpy.hstack" ], [ "numpy.median", "numpy.min", "numpy.mean", "numpy.max", "numpy.concatenate", "...
shalei120/HopfieldLM
[ "3fba4ee05bfc7f5041593f95457ffdf0bdc094a3" ]
[ "modules/functional.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom torch.tensor import Tensor\nfrom typing import Optional, Tuple, Union\n\n\ndef hopfield_core_forward(query, # type: Tensor\n key, # type: Tensor\n value, ...
[ [ "torch.jit._unwrap_optional", "torch.nn.functional.dropout", "torch.no_grad", "torch.bmm", "torch.ones", "torch.nn.functional.linear", "torch.jit.is_scripting", "torch.tensor", "torch.nn.functional.handle_torch_function", "torch.nn.functional.softmax", "torch.nn.functio...
tetsuoh0103/optuna
[ "b057b467948690c840d9608659ce22b675a8d047" ]
[ "optuna/visualization/matplotlib/_parallel_coordinate.py" ]
[ "from collections import defaultdict\nimport math\nfrom typing import Callable\nfrom typing import cast\nfrom typing import DefaultDict\nfrom typing import List\nfrom typing import Optional\n\nimport numpy as np\n\nfrom optuna._experimental import experimental\nfrom optuna._study_direction import StudyDirection\nfr...
[ [ "numpy.column_stack" ] ]
JoshVarty/BananaCollector_DoubleQLearning
[ "7594212d187ba60f6c701b471cc9d3cae871131c" ]
[ "model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass QNetwork(nn.Module):\n \"\"\"Actor (Policy) Model.\"\"\"\n\n def __init__(self, state_size, action_size, seed, fc1_units=64, fc2_units=64):\n \"\"\"Initialize parameters and build model.\n Params\n ======\n ...
[ [ "torch.manual_seed", "torch.nn.Linear" ] ]
ixaxaar/pytorch-sublstm
[ "879d3df6407dfa653fbd1e501a6af02191759421" ]
[ "test/test_cell.py" ]
[ "#!/usr/bin/env python3\n\nimport pytest\nimport numpy as np\n\nimport torch.nn as nn\nimport torch as T\nfrom torch.autograd import Variable as var\nimport torch.nn.functional as F\nfrom torch.nn.utils import clip_grad_norm\nimport torch.optim as optim\nimport numpy as np\n\nimport sys\nimport os\nimport math\nimp...
[ [ "torch.Size", "torch.randn" ] ]
zwhitfield/TE_EVEs_assignEVEtaxonomy
[ "3ae30d209fa19a4b8ebc6125ab0e0a2935df6bf4" ]
[ "ClassifyEVEtaxonomy.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Nov 18 11:04:04 2016\n\n@author: zwhitfield\n\"\"\"\nimport sys\nimport pandas as pd\n\noutputdir = str(sys.argv[1])\nfileName = str(sys.argv[2])\n\n#outputdir=\"/home/zwhitfield/Desktop/ForMarkGenomePaper/FrozenData/Aag2_assembly/\"\ntaxonomyCategories = ['superking...
[ [ "pandas.read_csv", "pandas.merge" ] ]
joaramirezra/open-source-contribution
[ "12556ac54e54e1f71687d7f774f2e11873f0effa" ]
[ "PYTHON/python_for_music/play_music.py" ]
[ "# get iris data from sklearn\nimport sklearn\nfrom sklearn.datasets import load_iris\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.metrics import accuracy_score\n\n# load iris data\niris = load_iris()\n\n\n# split data\nX_train, X_test, y_tr...
[ [ "sklearn.model_selection.train_test_split", "sklearn.neighbors.KNeighborsClassifier", "sklearn.datasets.load_iris" ] ]
merfishtools/merfishtools-evaluation
[ "5499abe9d9f1e0e5bf649bdc38001592cbe1a159" ]
[ "scripts/experiment-diffexp.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib as mpl\nmpl.use(\"agg\")\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nbf_categories = [-np.inf, 0, 2, 6, 10, np.inf]\nbf_labels = [0, 1, 2, 3, 4]\n#bf_labels = [\"no evidence\", \"weak\", \"positive\", \"strong\", \"very strong\"]\n\nests = p...
[ [ "matplotlib.use", "pandas.read_table", "pandas.cut", "numpy.asarray", "matplotlib.pyplot.savefig" ] ]
pdec/PhiSpy_deprekate
[ "f3d686f995d4422cc214d3173f7f84522c746357" ]
[ "scripts/plot_stats.py" ]
[ "#!/usr/bin/python3\n__author__ = 'Przemek Decewicz'\n\nfrom argparse import ArgumentParser, RawDescriptionHelpFormatter\nfrom glob import glob\nfrom os import makedirs, path\nfrom sys import argv\nimport matplotlib.pyplot as plt\nimport matplotlib\nmatplotlib.use('Agg')\nimport numpy as np\nfrom io import TextIOWr...
[ [ "matplotlib.use", "matplotlib.pyplot.savefig", "numpy.genfromtxt", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.pyplot.margins", "matplotlib.pyplot.subplots_adjust" ] ]