repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
vishalbelsare/pfhedge | [
"bc4ae304f9dc887b0e4d581f8ad42700a4eea9ad"
] | [
"examples/example_readme.py"
] | [
"import sys\n\nsys.path.append(\"..\")\n\n\ndef print_as_comment(obj):\n print(\"\\n\".join(f\"# {line}\" for line in str(obj).splitlines()))\n\n\nif __name__ == \"__main__\":\n import torch\n\n torch.manual_seed(42)\n\n # --- Prepare instruments\n\n from pfhedge.instruments import BrownianStock\n ... | [
[
"torch.manual_seed"
]
] |
cac765/ee486-capstone-team10 | [
"fdc986e12c31df91f59ded40ba5822e629a03dcd",
"fdc986e12c31df91f59ded40ba5822e629a03dcd"
] | [
"utils/density_clustering.py",
"testing/transform/transform_test.py"
] | [
"import numpy as np\n\nfrom sklearn.cluster import DBSCAN\nfrom sklearn.preprocessing import StandardScaler\n\ndef Count_Clusters( X ):\n\n # Compute DBSCAN\n if len(X) > 0:\n db = DBSCAN(eps=0.1175*480, min_samples=1).fit(X) \n core_samples_mask = np.zeros_like(db.labels_, dtype=bool)\n ... | [
[
"numpy.zeros_like",
"sklearn.cluster.DBSCAN"
],
[
"numpy.array",
"numpy.float32",
"numpy.zeros"
]
] |
Hasnae-bouhmady/Sudoku-Solver-machine-learning | [
"9cf967d274df24ba473c12134f7d91ffbd3637bc"
] | [
"backend/base.py"
] | [
"from flask import Flask, request, jsonify, send_file\nfrom flask_cors import CORS\nimport os, io, sys\nimport numpy as np\nimport base64\nimport cv2\nfrom Extract_Puzzle import extract_puzzle\nfrom Puzzle import *\nfrom Draw import *\nfrom tensorflow.keras.models import load_model\nfrom io import BytesIO\n\napp = ... | [
[
"numpy.array",
"numpy.savetxt",
"numpy.zeros",
"tensorflow.keras.models.load_model",
"numpy.loadtxt",
"numpy.fromstring"
]
] |
Joeklepko/akshare | [
"b290fad80cd6fed992b2b18496582cd6c7ae0d90",
"b290fad80cd6fed992b2b18496582cd6c7ae0d90",
"b290fad80cd6fed992b2b18496582cd6c7ae0d90"
] | [
"akshare/stock/stock_zh_zrbg_hx.py",
"akshare/stock/stock_info.py",
"akshare/fund/fund_manager.py"
] | [
"#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\"\"\"\nDate: 2019/10/25 15:56\nDesc: 和讯财经-上市公司社会责任报告数据, http://stockdata.stock.hexun.com/zrbg/\n\"\"\"\nfrom akshare.utils import demjson\nimport requests\nimport pandas as pd\nfrom tqdm import tqdm\n\nfrom akshare.stock.cons import (hx_headers,\n ... | [
[
"pandas.DataFrame"
],
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.read_html"
],
[
"pandas.DataFrame",
"pandas.to_numeric"
]
] |
argearriojas/rltools | [
"88d3b6eb2712b0dc410f5d27ccd1fe3e7efbdbd6"
] | [
"rltools/utils/visualization.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef get_layout(desc):\n desc = np.asarray(desc, dtype='c')\n\n zeros = np.zeros_like(desc, dtype=np.float)\n walls = (desc == b'W').astype(np.float)\n holes = (desc == b'H').astype(np.float)\n candy = (desc == b'C').astype(np.float)\n nails... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.asarray",
"numpy.minimum",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow"
]
] |
NSCL/yolact_instance | [
"c3c7973fddac0caafa8cc70c269ee3d833081978"
] | [
"eval.py"
] | [
"from data import COCODetection, get_label_map, MEANS, COLORS\nfrom yolact import Yolact\nfrom utils.augmentations import BaseTransform, FastBaseTransform, Resize\nfrom utils.functions import MovingAverage, ProgressBar\nfrom layers.box_utils import jaccard, center_size\nfrom utils import timer\nfrom utils.functions... | [
[
"numpy.array",
"torch.stack",
"torch.cuda.synchronize",
"torch.no_grad",
"numpy.ones",
"numpy.hstack",
"matplotlib.pyplot.title",
"torch.set_default_tensor_type",
"numpy.save",
"torch.sum",
"torch.from_numpy",
"matplotlib.pyplot.show",
"numpy.searchsorted",
... |
DataFactorTOP/triage | [
"f8d16c745fcb81740cb402671117d647e497c5a7"
] | [
"src/triage/component/catwalk/predictors.py"
] | [
"import verboselogs, logging\nlogger = verboselogs.VerboseLogger(__name__)\n\nimport math\n\nimport numpy as np\nfrom sqlalchemy.orm import sessionmaker\nfrom sqlalchemy import or_\n\nfrom .utils import db_retry, retrieve_model_hash_from_id, save_db_objects, sort_predictions_and_labels, AVAILABLE_TIEBREAKERS\nfrom ... | [
[
"pandas.DataFrame",
"numpy.fromiter"
]
] |
rcharan/phutball | [
"b0ae375d06d1b4e27b511e5b6729aeb278c7886f"
] | [
"pytorch-implementation/lib/utilities.py"
] | [
"from collections import namedtuple\nfrom functools import reduce\nfrom itertools import product as cartesian_product\nfrom itertools import chain\nfrom tensorflow.keras.utils import Progbar\n\n###############################################################################\n#\n# Configuration\n#\n##################... | [
[
"tensorflow.keras.utils.Progbar"
]
] |
monika19950721/PaddleNLP | [
"d8931a5253dfc4f110daec73d96b0cc78d150042"
] | [
"paddlenlp/transformers/unified_transformer/tokenizer.py"
] | [
"# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.ones"
]
] |
seanswyi/biobert-pytorch | [
"7787ba74414112fd1ad5a4f34846e9a4d15584da"
] | [
"relation-extraction/glue_dataset.py"
] | [
"import logging\nimport json\nimport os\nimport time\nimport warnings\nimport dataclasses\nfrom dataclasses import dataclass, field\nfrom enum import Enum\nfrom typing import List, Optional, Union\n\nimport torch\nfrom torch.utils.data.dataset import Dataset\nfrom transformers.data.processors.glue import glue_conve... | [
[
"torch.save",
"torch.load"
]
] |
yashikota/oit | [
"49f88306ceeb130c3443a32551f00d644fad6203"
] | [
"tool/extract.py"
] | [
"from importlib.resources import path\nimport os\nfrom pathlib import Path\nimport cv2\nfrom cv2 import threshold\nimport numpy as np\nfrom pdf2image import convert_from_path\nimport glob\nfrom tqdm import tqdm\nfrom PIL import Image\nimport pyocr\nimport pyocr.builders\nimport re\nfrom pdfminer.high_level import e... | [
[
"numpy.array"
]
] |
CAB-LAB/cube-config | [
"a6b8ebdf76344841d3204298c0e4782a78e4f282"
] | [
"cube/providers/oc.py"
] | [
"import os\nfrom datetime import datetime\nfrom dateutil.parser import parse\n\nimport netCDF4\nimport numpy\nimport xarray as xr\n\n\nfrom esdl.cate.cube_gen import CateCubeSourceProvider\n\n\nclass OCProvider(CateCubeSourceProvider):\n def __init__(self, cube_config, name='oc', dir=None, resampling_order=None)... | [
[
"numpy.flipud"
]
] |
qylabs/gap_sdk | [
"6d255c70883cf157d76d006b2dbf55bc6974b21f"
] | [
"tools/nntool/interpreter/commands/tensors.py"
] | [
"# Copyright (C) 2020 GreenWaves Technologies, SAS\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n\n... | [
[
"numpy.atleast_1d",
"numpy.abs",
"numpy.array_str",
"numpy.save"
]
] |
aditya1601/conv_vae | [
"fcd5bc92a9960d67a3cd2fd2fd962cecc2492f98"
] | [
"train.py"
] | [
"import tensorflow as tf\nfrom tensorflow import keras\nimport tensorflow_datasets as tfds\nfrom vae import VarAutoEncoder\n\n\n# Load Data\ndef preprocess(image, _):\n \"\"\"Return normalized image for both input and output label\"\"\"\n image = tf.cast(image, tf.float32)/255.\n image = tf.where(image < 0... | [
[
"tensorflow.keras.optimizers.Adam",
"tensorflow.cast",
"tensorflow.where"
]
] |
HansGiesen/hudson | [
"7642e50279290bf1e4cc930c88eece5ce025b4ed",
"7642e50279290bf1e4cc930c88eece5ce025b4ed"
] | [
"analysis/callouts/search_time.py",
"analysis/graphs/figure_6.py"
] | [
"#!/usr/bin/env python3\n\nimport os\nimport pandas as pd\nimport sqlalchemy\nimport yaml\n\nscript_dir = os.path.dirname(os.path.realpath(\"__file__\"))\nwith open('../../cfg.yml', 'r') as cfg_file:\n data = cfg_file.read()\ntuner_cfg = yaml.safe_load(data)\ndatabase = tuner_cfg['database'].replace('mysql', 'my... | [
[
"pandas.read_sql_query"
],
[
"matplotlib.pyplot.rcParams.update",
"numpy.isnan",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.step",
"numpy.std",
"matplotl... |
EmptyOps/LGM-Net | [
"55c035fb0f4d4a06c6af7dbf76381107580e9894"
] | [
"meta_matching_network.py"
] | [
"\"\"\"\nIn this file, I reimplement the function, and change the APIs to make it flexible to change functions.\nSince the whole architecture has clear architecture, so here it will not be too difficult.\n\"\"\"\nimport tensorflow as tf\nimport tensorflow.contrib.rnn as rnn\nfrom tensorflow.python.ops.nn_ops import... | [
[
"tensorflow.exp",
"tensorflow.contrib.layers.batch_norm",
"tensorflow.constant_initializer",
"tensorflow.nn.conv2d",
"tensorflow.matmul",
"numpy.min",
"tensorflow.reshape",
"tensorflow.gradients",
"numpy.mean",
"tensorflow.stack",
"tensorflow.control_dependencies",
... |
cfcooney/BiModNeuroCNN | [
"f79da6150b4186bcbc15d876394f4af8a47076d0"
] | [
"BiModNeuroCNN/utils.py"
] | [
"\"\"\"\nName: Ciaran Cooney\nDate: 12/01/2019\nDescription: Functions required for data processing and training of \nCNNs on imagined speech EEG data.\n\"\"\"\n\nimport pickle\nimport os\nimport numpy as np \nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport time\nfrom functools i... | [
[
"numpy.concatenate",
"numpy.array",
"matplotlib.pyplot.colorbar",
"numpy.zeros",
"pandas.DataFrame.from_dict",
"matplotlib.pyplot.xlabel",
"pandas.DataFrame",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tick_par... |
GinoBacallao/hgdp_tgp | [
"b674a79ad60da4c78b0b55a77e4cc4f138e9057e"
] | [
"variant_calling/variant_calling_pipeline.py"
] | [
"#!/usr/bin/env python3\n\n__author__ = 'Lindo Nkambule'\n\nimport hailtop.batch as hb\nimport hail as hl\nimport pandas as pd\nimport os\n\nfrom variant_calling.get_file_size import bytes_to_gb\nfrom variant_calling.scatter_interval import scatter_interval_list\nfrom variant_calling.haplotype_caller import haploty... | [
[
"pandas.read_csv"
]
] |
hrishismm/football_league_tables | [
"3b2450afb33623fbe6dbcc87f73493b684f9eb26"
] | [
"football.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\n\nimport requests\nimport pandas as pd\nfrom bs4 import BeautifulSoup\n\n\n\nprint(\"\\n1)Premier League\\n2)Champoions League\\n3)La-liga\\n4)Serie A\\n5)Bundesliga\")\n#To get input from the user\nchoice=int(input(\"Enter your choice:\"))\nif(choice==1):\n ... | [
[
"pandas.DataFrame"
]
] |
bsipocz/ginga | [
"766995b47851661dece5739297544864de35a486"
] | [
"ginga/mplw/ImageViewMpl.py"
] | [
"#\n# ImageViewMpl.py -- classes for the display of FITS files in a\n# Matplotlib FigureCanvas\n# \n# Eric Jeschke (eric@naoj.org)\n#\n# Copyright (c) Eric R. Jeschke. All rights reserved.\n# This is open-source software licensed under a BSD license.\n# Please see the file LICENSE.txt ... | [
[
"matplotlib.lines.Line2D"
]
] |
huhai463127310/Dain-App | [
"72bd18cf13f5a218bb99978891e1b9fbed77c8a2"
] | [
"DainDataset.py"
] | [
"import torch.utils.data as data\nimport torch\nfrom torch.autograd import Variable\nimport numpy\nimport PIL\nimport PIL.Image\nimport psnr\nimport RenderData\n\nclass DainDataset(data.Dataset):\n def __init__(self, my_list, pad, diffScenes = -1, frameFormat = \"RGB\", addPadding = True, useHalf = False):\n se... | [
[
"torch.nn.functional.pad",
"numpy.array",
"torch.unsqueeze"
]
] |
tovogt/xarray | [
"95bb9ae4233c16639682a532c14b26a3ea2728f3"
] | [
"xarray/tests/test_cupy.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pytest\n\nimport xarray as xr\n\ncp = pytest.importorskip(\"cupy\")\n\n\n@pytest.fixture\ndef toy_weather_data():\n \"\"\"Construct the example DataSet from the Toy weather data example.\n\n https://docs.xarray.dev/en/stable/examples/weather-data.html\n\n He... | [
[
"numpy.random.seed",
"pandas.date_range",
"numpy.random.randn",
"numpy.sin"
]
] |
Dyphis/MusicTransformer-pytorch | [
"f40ec69b842663d745fec096977bd1a6ff104106"
] | [
"new_model.py"
] | [
"from custom.layers import *\nfrom custom.criterion import *\nfrom custom.layers import Encoder, Decoder\nfrom custom.config import config\n\nimport sys\nimport torch\nimport torch.distributions as dist\nimport random\nimport utils\n\nimport torch\nfrom tensorboardX import SummaryWriter\nfrom progress.bar import Ba... | [
[
"torch.nn.Linear",
"torch.distributions.OneHotCategorical",
"torch.cat"
]
] |
skywolf829/DeepMammo | [
"1297bfd9d4d6a292b050996fcacfa299db7271f3"
] | [
"Solution1/classifier_auc.py"
] | [
"import os\nimport pickle\nimport argparse\nfrom os.path import isfile, isdir\nimport numpy as np\nimport tensorflow as tf\nfrom keras.preprocessing.image import load_img, img_to_array\nfrom sklearn.svm import SVC, LinearSVC\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import accuracy... | [
[
"matplotlib.use",
"numpy.append",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"tensorflow.Session",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.save",
"numpy.shape",
"tensorflow.placeholder",
"matplotlib.pyplot.sh... |
LSD-FIUNA/CEC_RL_versus_EA | [
"58a8d816d31378c07349498985c0304941dfa2dc"
] | [
"MAGeneralization/MA_DDQL_generalization/DeepQLearning_generalization.py"
] | [
"\n\"\"\"\n Training of a Deep Q-Learning for the Multi-agent Ypacarai Case\n\n\"\"\"\nimport sys\n\nimport numpy as np\nfrom DDQNAgent import DDQNAgent\nfrom Environment import Lake\nimport torch\nfrom tqdm import trange\nimport signal\nimport argparse\nimport os\nfrom datetime import datetime\nfrom torch.utils... | [
[
"numpy.array",
"numpy.savetxt",
"numpy.random.seed",
"numpy.sum",
"torch.cuda.empty_cache"
]
] |
WildflowerSchools/poseconnect | [
"5d0c188b7f8477f4b8020fa3f9d510a39581713b"
] | [
"poseconnect/visualize.py"
] | [
"import cv_utils\n# import cv2 as cv\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nimport matplotlib.colors\nfrom pandas.plotting import register_matplotlib_converters\nimport seaborn as sns\nimport slugify\nimport string\nimport os\nimport logging\n\n... | [
[
"numpy.concatenate",
"pandas.isnull",
"numpy.isnan",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots",
"numpy.nanmean",
"numpy.stack",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"numpy.nanmedian",
"pandas.plotting.register_matplotlib_converters"
]
] |
jiuney/Multicampus_AI | [
"39ba60a1daf7f344d6e4dd55f28d3ae1021eab4b"
] | [
"3-ComputerVision/codes/mission08-03.py"
] | [
"from tkinter import *\nfrom tkinter.simpledialog import *\nfrom tkinter.filedialog import *\nimport math\nimport os\nimport os.path\nimport pymysql\nimport datetime\n\n\n####################\n#### 함수 선언부 ####\n####################\n# 메모리를 할당해서 리스트(참조)를 반환하는 함수\ndef malloc(h, w, initValue=0) :\n retMemory= []\n ... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot"
]
] |
Nahid-Hassan/code-snippets | [
"24bd4b81564887822a0801a696001fcbeb6a7a75",
"24bd4b81564887822a0801a696001fcbeb6a7a75",
"24bd4b81564887822a0801a696001fcbeb6a7a75"
] | [
"python3/numpy/basicOperationAll.py",
"python3/numpy/Comparisons Masks and Boolean Logic.py",
"python3/numpy/numpy.zeros.py"
] | [
"\"\"\"\nCreated on Sun Mar 17 20:01:22 2019\n@author: nahid\n\"\"\"\nimport numpy as np\n \na = np.array([1, 2, 5, 3])\n \n# add 1 to every element\nprint (\"Adding 1 to every element:\", a+1)\n \n# subtract 3 from each element\nprint (\"Subtracting 3 from each element:\", a-3)\n \n# multiply each element by 10\np... | [
[
"numpy.array",
"numpy.sin",
"numpy.exp",
"numpy.sqrt"
],
[
"numpy.max",
"numpy.array",
"numpy.count_nonzero",
"numpy.random.RandomState",
"numpy.median",
"numpy.sum",
"numpy.any",
"numpy.arange",
"numpy.all",
"pandas.read_csv"
],
[
"numpy.zeros"
... |
inamasa12/baby-steps-of-rl-ja | [
"b596d9192f66b569ea7148d67537526eb2719581"
] | [
"FN/value_function_agent.py"
] | [
"import random\nimport argparse\nimport numpy as np\nfrom sklearn.neural_network import MLPRegressor\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.externals import joblib\nimport gym\nfrom fn_framework import FNAgent, Trainer, Observer\n\n\nclass ValueFunctio... | [
[
"numpy.max",
"numpy.array",
"sklearn.preprocessing.StandardScaler",
"sklearn.externals.joblib.dump",
"sklearn.externals.joblib.load",
"numpy.random.uniform",
"sklearn.neural_network.MLPRegressor",
"sklearn.pipeline.Pipeline",
"numpy.vstack"
]
] |
stgeke/pyJac-v2 | [
"bdd6940c27681e3b19ee41efb31abd20a89d1be8"
] | [
"pyjac/tests/test_chem_utils.py"
] | [
"# local imports\nfrom pyjac.core.rate_subs import polyfit_kernel_gen, assign_rates\nfrom pyjac.loopy_utils.loopy_utils import kernel_call\nfrom pyjac.tests import TestClass\nfrom pyjac.tests.test_utils import _generic_tester\n\n# modules\nfrom nose.plugins.attrib import attr\nimport numpy as np\n\n\nclass SubTest(... | [
[
"numpy.zeros_like",
"numpy.array"
]
] |
Aidan-Jackson/CHEME_599_Amphiphiliphile- | [
"d3286e8b9c6994440da3ddc02981e9d09c5da8d9"
] | [
"package/amph/segmentation.py"
] | [
"#Class for functions using the segmentation method. Cannot be used to track particles across frames.\nclass segmentation: \n def Detect_bright_spots(test_img, low_thresh = 0.9):\n '''\n Short summary: This function will count the number of bright spots in a image.\n\n Extended summary: This... | [
[
"numpy.max",
"scipy.ndimage.label",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.imread",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
LukeBailey181/addax | [
"8a1e855c34f6c836f7dc06157f37416d0b16750c"
] | [
"analysis/degree.py"
] | [
"import math\n\n\n\nimport numpy as np\n\n\nimport matplotlib\nimport matplotlib.pyplot as plt\n\n\n\ndef PlotDegrees(degrees):\n \"\"\"\n Plot the degree distribution.\n\n @param degrees: a list of degrees from the graph\n \"\"\"\n # get the number of vertices in the grpah\n nvertices = len(degre... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
dwhite54/arcface-tf2 | [
"b835b17238503942580a325bb408644120b61230"
] | [
"modules/models.py"
] | [
"import tensorflow as tf\nfrom tensorflow.keras import Model\nfrom tensorflow.keras.layers import (\n Dense,\n Dropout,\n Flatten,\n Input,\n)\nfrom tensorflow.keras.applications import (\n MobileNetV2,\n ResNet50\n)\nfrom .layers import (\n BatchNormalization,\n ArcMarginPenaltyLogists\n)\n... | [
[
"tensorflow.keras.applications.ResNet50",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Flatten",
"tensorflow.norm",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.Model",
"tensorflow.keras.applications.MobileNetV2",
"tensorflow.keras.regularizers.l2"
]
] |
honshj/PaddleSleeve | [
"1e7e172bed7e2336f8842677a1917b51cc604b19"
] | [
"Robustness/perceptron/zoo/ssd_300/layers_loss_bbox/keras_layer_DecodeDetectionsFast.py"
] | [
"from __future__ import division\nimport numpy as np\nimport tensorflow as tf\nimport keras.backend as K\nfrom keras.engine.topology import InputSpec\nfrom keras.engine.topology import Layer\n\n\nclass DecodeDetectionsFast(Layer):\n \"\"\"\n A Keras layer to decode the raw SSD prediction output.\n\n Input ... | [
[
"tensorflow.exp",
"tensorflow.size",
"tensorflow.range",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.image.non_max_suppression",
"tensorflow.expand_dims",
"tensorflow.cond",
"tensorflow.not_equal",
"tensorflow.argmax",
"tensorflow.nn.top_k",
"tensorflow.con... |
Deltares/MeshWrapper | [
"b625fb14256f8e45ce61d89e4d08898df9fb640b"
] | [
"tests/test_utils.py"
] | [
"import numpy as np\nimport pytest\nfrom numpy.testing import assert_array_equal\n\nfrom meshkernel import InputError, Mesh2dFactory, MeshKernel, __version__\n\n\ndef test_create_rectilinear_mesh_simple():\n \"\"\"Test create_rectilinear_mesh``by creating a simple 2x2 mesh\n\n 6---7---8\n | | |\n 3-... | [
[
"numpy.array"
]
] |
UtopiaLLC/subseasonal_toolkit | [
"35e120a010606d10a7d94cdfbf4cb8347a234dfb"
] | [
"subseasonal_toolkit/models/salient/train_keras_hindcasts.py"
] | [
"\"\"\"Train NNs ensemble members for a given salient's submodel \r\n\r\nExample:\r\n $ python src/models/salient/train_keras_hindcasts.py salient_fri_hindcasts_2010 -n 50 -s 0 -r contest \r\n\r\nAttributes:\r\n batch_size (int): number of training examples used in one iteration during \r\n the tra... | [
[
"numpy.concatenate",
"numpy.reshape",
"numpy.zeros",
"numpy.rollaxis",
"numpy.random.permutation",
"numpy.mean",
"numpy.where",
"numpy.amin",
"numpy.stack",
"numpy.amax",
"numpy.timedelta64",
"numpy.abs",
"numpy.arange",
"matplotlib.pyplot.show",
"matplo... |
yaweiwang1232/EDCNN | [
"9f86adafe8cbefe37dc6b4929f5eded55dcf391c"
] | [
"edcnn_rbp47.py"
] | [
"import sys\nimport shutil, os\nfrom shutil import copyfile\n\nimport sklearn\nfrom sklearn import metrics\nfrom collections import OrderedDict\nimport numpy as np\nimport random\nimport pdb\nfrom sklearn.metrics import roc_curve, auc, roc_auc_score, f1_score\nfrom sklearn.preprocessing import LabelBinarizer\nfrom ... | [
[
"torch.nn.Linear",
"sklearn.utils.class_weight.compute_sample_weight",
"torch.cuda.is_available",
"torch.load",
"torch.nn.CrossEntropyLoss",
"numpy.concatenate",
"torch.sigmoid",
"torch.nn.MaxPool2d",
"torch.autograd.Variable",
"numpy.arange",
"torch.utils.data.DataLoad... |
deeplearning-wisc/stud | [
"b667a369e368181ef6e913c32f26e574bead9b56"
] | [
"src/data/pair_sampler_multi_random.py"
] | [
"import torch\nfrom torch.utils.data.sampler import Sampler\n\nfrom detectron2.utils import comm\n\nimport copy\nimport itertools\nimport math\nimport numpy as np\nimport random\nfrom collections import defaultdict\nfrom typing import Optional\n\n__all__ = [\"PairTrainingMultiRandomSampler\", \"PairMultirandomDataL... | [
[
"numpy.asarray",
"torch.arange",
"torch.Generator",
"torch.randperm",
"torch.flip"
]
] |
koz4k/tensor2tensor | [
"859306bb577ec1119e6d9fbdea4ac0743a7fe927"
] | [
"tensor2tensor/rl/rl_utils.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Tensor2Tensor Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"numpy.mean"
]
] |
pfnet-research/deep-table | [
"a19c0c3048484017d5f24806604c3b3470bcf550"
] | [
"deep_table/augmentation/utils.py"
] | [
"import torch\nfrom torch import Tensor\n\n\ndef generate_mask(*size: int, mask_prob: float) -> Tensor:\n \"\"\"\n Args:\n *size (int): Shape of the expected values.\n mask_prob (float): The probability of masking.\n\n Returns:\n Tensor: If True, these features should be masked.\n ... | [
[
"torch.rand"
]
] |
xwjBupt/brats_segmentation-pytorch | [
"760be1acb147d349ddb171fa2f44e03a60bcfa8c"
] | [
"utils/metric/histogram.py"
] | [
"# build-in modules\nimport math\n\n# third-party modules\nimport scipy\n\n# own modules\n\n# ////////////////////////////// #\n# Bin-by-bin comparison measures #\n# ////////////////////////////// #\n\ndef minowski(h1, h2, p = 2): # 46..45..14,11..43..44 / 45 us for p=int(-inf..-24..-1,1..24..inf) / float @array, +... | [
[
"scipy.sum",
"scipy.seterr",
"scipy.sqrt",
"scipy.square",
"scipy.power",
"scipy.asarray",
"scipy.absolute",
"scipy.isnan",
"scipy.repeat",
"scipy.multiply",
"scipy.log",
"scipy.minimum"
]
] |
dlg4nlp/dlg4nlp.github.io | [
"aa5f260d586fdf65b7128ee533a1910b85d1452c"
] | [
"scripts/dataentry/socials.py"
] | [
"import csv\nimport random\nfrom collections import defaultdict\nfrom dataclasses import dataclass\nfrom typing import List, Dict\n\nimport pytz\nimport ruamel\nfrom openpyxl import load_workbook\nfrom ruamel import yaml\n\nfrom datetime import datetime\n\nimport pandas as pd\n\n# https://docs.google.com/spreadshee... | [
[
"pandas.DataFrame",
"pandas.read_excel"
]
] |
llMuShu/NEW_repstp | [
"314ba30e4ab2af2b23a435db49a8eb4b89e48680"
] | [
"style_paraphrase/evaluation/scripts/acceptability.py"
] | [
"from scipy.stats import kendalltau\nimport tqdm\nimport collections\nimport itertools\nimport numpy as np\nimport torch\nimport argparse\nimport subprocess\nimport re\n\nfrom fairseq.data.data_utils import collate_tokens\nfrom fairseq.models.roberta import RobertaModel\n\nfrom utils import Bcolors\n\nparser = argp... | [
[
"torch.no_grad",
"torch.exp"
]
] |
Willjay90/tf-coreml | [
"9b9ec7e9507db73c5b77b0d718bf03ab719ef003"
] | [
"tfcoreml/_shape_sensitive_layers.py"
] | [
"from tensorflow.python.util import compat\nimport numpy as np\nfrom _interpret_shapes import _interpret_shape as interpret_shape\nimport _layers\n\ndef _remove_beginning_unit_dimensions(in_tuple):\n for i, value in enumerate(in_tuple):\n if value == 1:\n continue\n else:\n return in_tuple[i:]\n\nd... | [
[
"numpy.array",
"numpy.transpose",
"numpy.reshape",
"tensorflow.python.util.compat.as_bytes"
]
] |
Kyrpel/keras | [
"c9e2b4dbf1a51f721c9364116ab4d8ccca8d9e44"
] | [
"keras/layers/preprocessing/image_preprocessing.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.v2.sin",
"tensorflow.compat.v2.clip_by_value",
"tensorflow.compat.v2.shape",
"tensorflow.compat.v2.cast",
"tensorflow.compat.v2.TensorSpec",
"tensorflow.compat.v2.map_fn",
"tensorflow.compat.v2.reduce_all",
"tensorflow.compat.v2.is_tensor",
"tensorflow.python... |
So-Cool/fat-forensics | [
"6fa252a1d90fe543242ef030a5f8a3f9c9f692fe",
"6fa252a1d90fe543242ef030a5f8a3f9c9f692fe"
] | [
"fatf/utils/array/validation.py",
"fatf/utils/data/tests/test_transformation.py"
] | [
"\"\"\"\nThe :mod:`fatf.utils.array.validation` module holds numpy array validators.\n\"\"\"\n# Author: Kacper Sokol <k.sokol@bristol.ac.uk>\n# License: new BSD\n\nimport warnings\n\nfrom typing import Union\n\nimport numpy as np\n\nimport fatf.utils.tools as fut\n\n__all__ = ['is_numerical_dtype',\n 'is_... | [
[
"numpy.version.version.split"
],
[
"numpy.zeros_like",
"numpy.array",
"numpy.array_equal"
]
] |
microsoft/neurips21-self-supervised-bug-detection-and-repair | [
"4e51184a63aecd19174ee40fc6433260ab73d56e"
] | [
"buglab/controllers/detectordatascoringworker.py"
] | [
"import argparse\nimport logging\nimport math\nimport time\nfrom itertools import cycle, islice\nfrom tempfile import TemporaryDirectory\nfrom threading import Thread\nfrom typing import NoReturn\n\nimport msgpack\nimport torch\nimport zmq\nfrom dpu_utils.utils import run_and_debug\nfrom tqdm import tqdm\n\nfrom bu... | [
[
"torch.cuda.is_available"
]
] |
PraveenVenugopal/pyodds | [
"5ec93222180440dbde4c67d6dad6d0a696a320dd",
"5ec93222180440dbde4c67d6dad6d0a696a320dd"
] | [
"test/IOTest/run_time_pandas.py",
"test/IOTest/run_time_pandas_query.py"
] | [
"import datetime\nimport pandas as pd\nimport numpy as np\nimport time\n\nepochs = 10000\ntodays_date = datetime.datetime.now().date()\n\ncolumns = ['ts','a','b', 'c','d','e']\ntrange = pd.date_range('2019-10-01', periods=epochs, freq='1min')\n\nts = pd.DataFrame(columns=columns)\ncurrent_time = time.clock()\nfor i... | [
[
"pandas.DataFrame",
"pandas.date_range",
"numpy.random.uniform"
],
[
"pandas.to_datetime",
"pandas.read_csv"
]
] |
urbanmatthias/Auto-PyTorch | [
"fe7c51b33c48041e405ef2975ee691c0539691ab"
] | [
"autoPyTorch/core/autonet_classes/autonet_feature_classification.py"
] | [
"from autoPyTorch.core.autonet_classes.autonet_feature_data import AutoNetFeatureData\n\nclass AutoNetClassification(AutoNetFeatureData):\n preset_folder_name = \"feature_classification\"\n\n # OVERRIDE\n @staticmethod\n def _apply_default_pipeline_settings(pipeline):\n from autoPyTorch.pipeline.... | [
[
"torch.nn.Softmax"
]
] |
HecatePhy/directed_graphsage | [
"0e35f8971d44b8b3477fd7339225e1a69da4456a"
] | [
"edge/graphsage/encoders.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport torch.nn.functional as F\n\nclass Encoder(nn.Module):\n \"\"\"\n Encodes a node's using 'convolutional' GraphSage approach\n \"\"\"\n def __init__(self, features, feature_dim,\n embed_dim, adj_lists, aggregator,\n ... | [
[
"torch.FloatTensor",
"torch.LongTensor",
"torch.cat",
"torch.nn.init.xavier_uniform_"
]
] |
Yosshi999/ACE | [
"6dffd16cb2ea3d3c4959538de8bd02164ffa9051"
] | [
"tcav/tcav_test.py"
] | [
"\"\"\"\nCopyright 2018 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n https://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing... | [
[
"tensorflow.contrib.training.HParams",
"numpy.array",
"tensorflow.python.platform.googletest.main"
]
] |
selmanakinci/stable-baselines3 | [
"be279b6cdc6178c6146d8cee972a49a1e6ae7c11"
] | [
"tests/test_run.py"
] | [
"import numpy as np\nimport pytest\n\nfrom stable_baselines3 import A2C, PPO, SAC, TD3\nfrom stable_baselines3.common.noise import NormalActionNoise, OrnsteinUhlenbeckActionNoise\n\nnormal_action_noise = NormalActionNoise(np.zeros(1), 0.1 * np.ones(1))\n\n\n@pytest.mark.parametrize('action_noise', [normal_action_no... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
skn123/rebook | [
"177daa7c5fe20354888ebc76b300e87f3adcb918"
] | [
"rebook/training.py"
] | [
"# coding=utf-8\n\nfrom __future__ import division, print_function\n\nimport cv2\nimport freetype\nimport numpy as np\n\nfrom numpy import newaxis\n\nimport lib\n\n# from feature_sign import feature_sign_search\n\nchars = 'abcdefghijklmnopqrstuvwxyz' + \\\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + \\\n '1234567890.\\'\... | [
[
"numpy.concatenate",
"numpy.pad",
"numpy.lib.stride_tricks.as_strided",
"numpy.array",
"numpy.percentile",
"numpy.logical_and",
"numpy.sqrt"
]
] |
yanbarurobotics/PythonPilot | [
"eb07c620320c90ba85941041d08678a6142f988f"
] | [
"pilot/perception/lane_fitting/leasts_based.py"
] | [
"#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n# File : leasts_based.py\n# Environment : Python 3.5.2\n# OpenCV 3.4.5\n\"\"\"\nLane Fitting using Least Square\n\"\"\"\n\nimport cv2\nimport collections\nimport time\nimport numpy as np\nimport matplotlib.cm as cm\nfrom matplotlib import pyplot as ... | [
[
"numpy.max",
"numpy.array",
"numpy.clip",
"sklearn.linear_model.LinearRegression",
"numpy.copy",
"numpy.min",
"numpy.mean",
"numpy.flipud",
"numpy.arange",
"numpy.int_",
"numpy.dstack",
"numpy.hstack",
"numpy.average",
"numpy.vstack"
]
] |
Thinh127/Statics_Python | [
"2d4aad9a14619ce0c84d4c7bca9dacd66b2be566"
] | [
"statsmodels/examples/ex_proportion.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n\nCreated on Sun Apr 21 07:59:26 2013\n\nAuthor: Josef Perktold\n\"\"\"\n\nimport numpy as np\nimport statsmodels.stats.proportion as sms\nimport statsmodels.stats.weightstats as smw\n\nfrom numpy.testing import assert_almost_equal\n\n\n# Region, Eyes, Hair, Count\nss = '''\\\n1 bl... | [
[
"numpy.testing.assert_almost_equal",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"numpy.repeat",
"matplotlib.pyplot.show"
]
] |
mranonymous2691/ddp-dlrm | [
"c9a80eb3241b805df847cfdd2247fd0234d4dde1"
] | [
"benchmark/single_machine_launch.py"
] | [
"import torch.multiprocessing as mp\nimport pt_rpc_client\nimport pt_rpc_server\nimport grpc_client\nimport grpc_server\n\ndef main():\n ctx = mp.get_context('spawn')\n\n\n print(\"#######==== gRPC ===#######\")\n server_proc = ctx.Process(target=grpc_server.run)\n server_proc.start()\n import time ;... | [
[
"torch.multiprocessing.get_context"
]
] |
michaelgsharp/NimbusML | [
"50031157265f49eec85d27fe67582d9ddaf01ef9",
"50031157265f49eec85d27fe67582d9ddaf01ef9"
] | [
"src/python/nimbusml/model_selection/cv.py",
"src/python/nimbusml/tests/scikit/test_uci_adult_scikit.py"
] | [
"# --------------------------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n# --------------------------------------------------------------------------------------------\n\nimport inspect\nimport ti... | [
[
"pandas.DataFrame"
],
[
"pandas.util.testing.assert_frame_equal",
"numpy.random.seed",
"pandas.DataFrame",
"sklearn.utils.testing.assert_greater",
"numpy.mean",
"sklearn.utils.testing.assert_equal",
"sklearn.decomposition.PCA",
"sklearn.base.clone",
"sklearn.pipeline.Pi... |
siljeci/negi-stuff | [
"4d525801f34555bb8f585e49a8613f268d619080"
] | [
"negi_stuff/modules/zarray.py"
] | [
"# project name: wrf_management\n# created by diego aliaga daliaga_at_chacaltaya.edu.bo\n'''extra functions for xarray'''\nimport numpy as np\nimport xarray as xr\nimport cftime\nimport pandas as pd\nfrom os.path import expanduser\n\ndef compressed_netcdf_save(\n ds:xr.Dataset,\n path:str,\n sh... | [
[
"pandas.to_datetime",
"numpy.logical_not",
"numpy.sum",
"numpy.cos",
"numpy.deg2rad"
]
] |
SamKG/PsyNeuLink | [
"70558bcd870868e1688cb7a7c424d29ca336f2df"
] | [
"Scripts/Models (Under Development)/Predator-Prey Model DEMO.py"
] | [
"import timeit\nimport numpy as np\nfrom psyneulink import *\nfrom double_dqn import DoubleDQNAgent\n\n# *********************************************************************************************************************\n# *********************************************** CONSTANTS ********************************... | [
[
"numpy.array",
"numpy.abs"
]
] |
anajevtic11/Machine_learning_classification_for_Covid19_diagnosis | [
"2ef5e31ceb96759da1c46eba31ec7bfc07e81660"
] | [
"Covid_prediction_classification_approaches.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jan 26 07:54:08 2021\n\n@author: Stefanos Baros and Ana Jevtic\n\n\"\"\"\n\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.lin... | [
[
"sklearn.metrics.confusion_matrix",
"sklearn.metrics.plot_confusion_matrix",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.metrics.accuracy_score",
"sklearn.linear_model.LogisticRegression",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.show",
"pandas.read_cs... |
avalanchesiqi/twitter-sampling | [
"d277bf510b0aa043dd3b87743057a9c4bfc19c87"
] | [
"data/plot_SI_fig2_rate_coloring.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\" Plot arriving of rate limit messages and #messages per second.\n\nUsage: python plot_SI_fig2_rate_coloring.py\nInput data files: ./rate_limit_2015-09-08.txt\nTime: ~1M\n\"\"\"\n\nimport sys, os, platform, json\nfrom datetime import datetime\n\nimport matplot... | [
[
"matplotlib.use",
"matplotlib.pyplot.savefig",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show",
"matplotlib.ticker.FuncFormatter"
]
] |
WGraterol64/SentiLib | [
"79401f8275e2ad438033b6810a4da2ae8a763d7a",
"79401f8275e2ad438033b6810a4da2ae8a763d7a",
"79401f8275e2ad438033b6810a4da2ae8a763d7a"
] | [
"SentiLib/image_utils/models/fusion_model.py",
"SentiLib/image_utils/models/YOLOv3.py",
"SentiLib/image_utils/models/context_net.py"
] | [
"\"\"\"\n\tThe models implemented here are the architectures to use the original EmbraceNets and the proposed EmbraceNet +.\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom .utils.componets import WeightedSum, EmbraceNet\n\nimport numpy as np\n\nclass ModelOne(nn.Module):\n\t'... | [
[
"torch.nn.Linear",
"torch.device",
"torch.cat",
"torch.nn.Dropout",
"torch.stack",
"torch.nn.Sequential",
"torch.nn.Parameter",
"torch.ones",
"torch.nn.ReLU",
"torch.sum"
],
[
"torch.zeros",
"torch.device",
"torch.stack",
"numpy.zeros",
"torch.no_gra... |
mattgwwalker/PyOgg | [
"7da10d799c6a5d36570743724921530964073ddb"
] | [
"pyogg/__init__.py"
] | [
"import builtins\nimport collections\nimport copy\nimport ctypes\nimport random\nimport struct\nfrom . import ogg\nfrom .ogg import PyOggError, PYOGG_OGG_AVAIL\n\nfrom . import vorbis\nfrom.vorbis import PYOGG_VORBIS_AVAIL, PYOGG_VORBIS_FILE_AVAIL, PYOGG_VORBIS_ENC_AVAIL\n\nfrom . import opus\nfrom.opus import PYOG... | [
[
"numpy.frombuffer"
]
] |
DDMGNI/viVorticity2D | [
"ad3ae6f71848db42485638a3b9fe74333e05a38d"
] | [
"examples/gaussian_blob.py"
] | [
"\nimport numpy as np\n\n\nxcenter = 0.0\nycenter = 0.0\nxsigma = 0.1\nysigma = 0.2\n\n\ndef vorticity(x, y, Lx, Ly):\n return gaussian(x, xcenter, xsigma) * gaussian(y, ycenter, ysigma)\n\n\ndef gaussian(x, center, sigma):\n return 1. / (sigma * np.sqrt(2*np.pi)) * np.exp(-0.5 * ((x-center)/sigma)**2 )\n"
... | [
[
"numpy.exp",
"numpy.sqrt"
]
] |
manuvazquez/py2gift | [
"5240b18745375540ca63155bc138daee969b42ab"
] | [
"py2gift/time.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: 50_time.ipynb (unless otherwise specified).\n\n__all__ = ['TimeKeeper']\n\n# Cell\nimport json\nfrom typing import Union\n\nimport pandas as pd\n\n# Cell\nclass TimeKeeper:\n\n def __init__(self) -> None:\n\n self.df = pd.DataFrame(columns=['time'])\n se... | [
[
"pandas.DataFrame"
]
] |
lowandrew/geneSipprV2 | [
"349a805178f7f19ea55837ea88dfec34e97d6587"
] | [
"sixteenS/sixteenS_probes.py"
] | [
"#!/usr/bin/env python 3\n\nimport subprocess\nimport time\nfrom sipprCommon.sippingmethods import *\nfrom sipprCommon.objectprep import Objectprep\nfrom accessoryFunctions.accessoryFunctions import *\nfrom accessoryFunctions.metadataprinter import *\n\n__author__ = 'adamkoziol'\n\n\nclass ProbeSippr(Sippr):\n\n ... | [
[
"numpy.std"
]
] |
juliansmidek/pandas | [
"8945a4267588ec2608bec7be6745f6beff0373da"
] | [
"pandas/tests/indexes/multi/test_constructors.py"
] | [
"from datetime import (\n date,\n datetime,\n)\nimport itertools\n\nimport numpy as np\nimport pytest\n\nfrom pandas._libs.tslib import Timestamp\n\nfrom pandas.core.dtypes.cast import construct_1d_object_array_from_listlike\n\nimport pandas as pd\nfrom pandas import (\n Index,\n MultiIndex,\n Series... | [
[
"pandas.DatetimeIndex",
"pandas._libs.tslib.Timestamp",
"pandas.MultiIndex.from_frame",
"pandas.period_range",
"pandas._libs.tslib.Timestamp.today",
"pandas.DataFrame",
"pandas.timedelta_range",
"pandas.MultiIndex",
"numpy.array",
"pandas.MultiIndex.from_tuples",
"panda... |
juliotux/astropop | [
"cb8e5b7527fe04de82d1322615c78510bf0ae5b0",
"cb8e5b7527fe04de82d1322615c78510bf0ae5b0"
] | [
"astropop/astrometry/manual_wcs.py",
"astropop/math/array.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nimport six\nimport numpy as np\nfrom astropy.wcs import WCS\n\nfrom .coords_utils import guess_coordinates\nfrom ..logger import logger\n\n__all__ = ['wcs_from_coords']\n\n_angles = {\n 'left': 180,\n 'right': 0,\n 'top': 90,\n 'bottom'... | [
[
"numpy.multiply",
"numpy.radians"
],
[
"numpy.indices",
"numpy.ravel",
"numpy.hypot"
]
] |
QTransportLabUAM/Qcodes | [
"b4cf7d58bc1bf3be97af6bf48f57cb6b87d588bb",
"3687bd555b74e066b92e02699cfdc044f63bdc85"
] | [
"qcodes/instrument_drivers/QDev/QDac_channels.py",
"qcodes/instrument_drivers/Spectrum/M4i.py"
] | [
"# QCoDeS driver for QDac using channels\n\nimport time\nimport visa\nimport logging\nimport numpy as np\n\nfrom datetime import datetime\nfrom functools import partial\nfrom operator import xor\nfrom collections import OrderedDict\n\nfrom qcodes.instrument.channel import InstrumentChannel, ChannelList\nfrom qcodes... | [
[
"numpy.sign"
],
[
"numpy.round",
"numpy.mean",
"numpy.frombuffer"
]
] |
ashuven63/tf_audio | [
"015c72eac3f4e448dd8ab852843e902771496532",
"015c72eac3f4e448dd8ab852843e902771496532"
] | [
"tensorflow/python/training/checkpointable_utils_test.py",
"tensorflow/python/feature_column/feature_column_test.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.training.saver.latest_checkpoint",
"tensorflow.python.eager.context.graph_mode",
"tensorflow.python.ops.variable_scope.variable_scope",
"tensorflow.python.ops.variable_scope.get_variable",
"tensorflow.python.ops.state_ops.assign",
"tensorflow.python.training.saver.Saver"... |
muyeby/AMRBART | [
"8f52f9d6a23dcf4132d2cc1272d6605ebc78a16f"
] | [
"pre-train/dataset.py"
] | [
"# coding:utf-8\nimport linecache\nimport os\nimport torch\nfrom logging import getLogger\nfrom pathlib import Path\nfrom typing import Any, Callable, Dict, List, NewType, Optional, Tuple, Union\nfrom transformers import (\n AutoTokenizer,\n DataCollatorForLanguageModeling,\n)\n\n# import git\nfrom torch.util... | [
[
"torch.stack",
"torch.tensor"
]
] |
semelianova/ibis | [
"d328b94e83a1df714faffc724cf1f0d3a2ebd62c"
] | [
"ibis/expr/datatypes.py"
] | [
"import builtins\nimport collections\nimport datetime\nimport functools\nimport itertools\nimport numbers\nimport re\nimport typing\nfrom typing import Any as GenericAny\nfrom typing import (\n Callable,\n Iterator,\n List,\n Mapping,\n NamedTuple,\n Optional,\n Sequence,\n)\nfrom typing import... | [
[
"pandas.Timestamp"
]
] |
diCagri/content | [
"c532c50b213e6dddb8ae6a378d6d09198e08fc9f"
] | [
"Packs/Phishing/Scripts/PhishingDedupPreprocessingRule/PhishingDedupPreprocessingRule.py"
] | [
"import dateutil # type: ignore\n\nimport demistomock as demisto\nfrom CommonServerPython import *\nfrom CommonServerUserPython import *\nimport pandas as pd\nfrom bs4 import BeautifulSoup\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom numpy import dot\nfrom numpy.linalg import norm\nfrom email... | [
[
"pandas.DataFrame",
"numpy.dot",
"sklearn.feature_extraction.text.CountVectorizer",
"numpy.linalg.norm"
]
] |
ingdanielguerrero/gwl_pysmm | [
"4207c313937e2bddb48fc6325ff4107cb47ae2f7"
] | [
"scripts/script.py"
] | [
"import numpy as np\nimport pandas as pd\nimport geemap\n\nfrom datetime import datetime, date\nfrom ipywidgets import interact, HTML, interact_manual, interactive, HBox, VBox, fixed, widgets\n\nimport ee\nimport matplotlib.pyplot as plt\n\n\nee.Initialize()\naoi_ee = ee.FeatureCollection('users/dafguerrerom/FAO/PY... | [
[
"pandas.read_pickle",
"pandas.Grouper",
"pandas.date_range",
"matplotlib.pyplot.subplots"
]
] |
harlanhutton/bundle-adjusting-NeRF | [
"33e7f659416aa69b53eb7b1d7ee9eafed5c3ed63"
] | [
"model/planar_mult.py"
] | [
"import numpy as np\nimport os,sys,time\nimport torch\nimport torch.nn.functional as torch_F\nimport torchvision\nimport torchvision.transforms.functional as torchvision_F\nimport tqdm\nfrom easydict import EasyDict as edict\nimport PIL\nimport PIL.Image,PIL.ImageDraw\nimport imageio\nimport os\n\nimport util,util_... | [
[
"torch.zeros",
"torch.nn.Linear",
"torch.cat",
"numpy.array",
"torch.stack",
"torch.nn.ModuleList",
"torch.arange",
"torch.no_grad",
"torch.randn",
"torch.nn.functional.grid_sample",
"torch.tensor",
"numpy.sqrt",
"torch.nn.functional.relu",
"torch.nn.init.ze... |
whitmans-max/python-examples | [
"881a8f23f0eebc76816a0078e19951893f0daaaa",
"881a8f23f0eebc76816a0078e19951893f0daaaa"
] | [
"tkinter/matplotlib-canvas/button-in-navigationbar/main.py",
"sklearn/digits/main.py"
] | [
"import tkinter as tk\nfrom matplotlib.backends.backend_tkagg import (\n FigureCanvasTkAgg, NavigationToolbar2Tk)\nfrom matplotlib.figure import Figure\nimport matplotlib.pyplot as plt\n\n# --- functions ---\n\ndef eggs():\n print(\"eggs\")\n\n# --- main ---\n\nx = [1, 2, 3, 4]\ny = [1, 2, 3, 4]\nAS = [10/2**... | [
[
"matplotlib.figure.Figure",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg",
"matplotlib.backends.backend_tkagg.NavigationToolbar2Tk"
],
[
"sklearn.metrics.classification_report",
"sklearn.metrics.confusion_matrix",
"sklearn.datasets.load_digits",
"sklearn.svm.SVC"
]
] |
juan43ramirez/L0_regularization | [
"dbefaa0a855334ceee27d451b223c116f3f5cab4"
] | [
"models.py"
] | [
"import torch\nimport torch.nn as nn\nfrom l0_layers import L0Conv2d, L0Dense\nfrom base_layers import MAPConv2d, MAPDense\nfrom utils import get_flat_fts\nfrom copy import deepcopy\nimport torch.nn.functional as F\n\n\nclass L0MLP(nn.Module):\n def __init__(self, input_dim, num_classes, layer_dims=(300, 100), N... | [
[
"torch.nn.functional.avg_pool2d",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.cuda.is_available"
]
] |
karoly-hars/GANs_for_cats_and_flowers | [
"abca66c2822b1d783246cb034a6e18d268d725cb"
] | [
"train.py"
] | [
"import json\nimport argparse\nimport random\nimport os\nimport torch\nfrom torch.utils.data import DataLoader\nfrom utils import save_image_grid\nfrom cat_dataset import Catfaces64Dataset\nfrom flowers_dataset import Flowers64Dataset\nfrom networks import Generator, DCGANDiscriminator, WGANDiscriminator, weights_i... | [
[
"torch.manual_seed",
"torch.cuda.is_available",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.BCELoss",
"torch.randn"
]
] |
emerging-welfare/random_sampling-vs-keyword_filtering | [
"7c42790173e868d53a5238f3d329bada4d65a108"
] | [
"src/evaluate_cross_lingual.py"
] | [
"import json\nimport pandas\nimport numpy as np\nimport random\nfrom glob import glob\nfrom src.data import * \nfrom src.bert import build_bert, get_bert\nfrom sklearn.metrics import classification_report\nfrom sklearn.model_selection import train_test_split\n\npretrained_model = 'bert-base-multilingual-cased'\n# p... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.metrics.classification_report"
]
] |
DukiChoi/MakeGraphUsingTinyEKFDLL | [
"f955789e0991b74f7e8f4f49889005a16fd928be"
] | [
"my_tiny_ekf/graph_maker.py"
] | [
"\r\n# * MakeGraphUsingTinyEKFDLL\r\n# *\r\n# * Copyright (C) 2022 DukiChoi\r\n# *\r\n# * MIT License\r\n\r\n# -*- coding: utf-8 -*-\r\nfrom calendar import c\r\nfrom inspect import _void\r\nimport numpy as np\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.animation as animation... | [
[
"numpy.array",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
gchure/phd | [
"cf5941e467ee57c6c93c78dda151335cb320f831",
"cf5941e467ee57c6c93c78dda151335cb320f831"
] | [
"src/chapter_09/code/ch9_figS8.py",
"src/chapter_09/code/ch9_figS10-S11.py"
] | [
"# %%\n# -*- coding: utf-8 -*-\nimport sys\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport phd.stats\nimport phd.viz\nimport scipy.stats\ncolors, palette = phd.viz.phd_style()\n\n\n# Load the data\ndata = pd.read_csv('../../data/ch9_mscl_si/complete_mcmc_trac... | [
[
"matplotlib.pyplot.savefig",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.tight_layout",
"pandas.read_csv"
],
[
"numpy.log",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"numpy.logspace",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.fig... |
kallam/FileTransforms | [
"fd44fce1d272f5d1f0158cd3ff740b34be6552e8"
] | [
"FileTransforms/Result.py"
] | [
"from typing import List, Dict, Tuple, Union\nimport collections\nimport os\nimport csv\nfrom .FileType import FileType\nfrom .csv_utils import write_csv\n\ntry:\n import pandas as pd\nexcept ModuleNotFoundError:\n pass\n\n\nclass BaseOutputFile:\n\n def __init__(self, filename: str = 'default.csv', file_t... | [
[
"pandas.DataFrame",
"pandas.ExcelWriter"
]
] |
khuangaf/Youtube-8M-2018 | [
"af6597ce709b4ae7bdce41241d84afff36eb981b"
] | [
"eval.py"
] | [
"# Copyright 2016 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app... | [
[
"tensorflow.flags.DEFINE_integer",
"tensorflow.local_variables_initializer",
"tensorflow.add_to_collection",
"tensorflow.cast",
"tensorflow.set_random_seed",
"tensorflow.flags.DEFINE_string",
"tensorflow.get_default_graph",
"tensorflow.summary.histogram",
"tensorflow.Variable",... |
thomasdorch/gdsfactory | [
"26dccc90d1df9c4b8f2f3c7ceccb385aaf237aff",
"26dccc90d1df9c4b8f2f3c7ceccb385aaf237aff"
] | [
"gdsfactory/simulation/simphony/components/coupler_ring_fdtd.py",
"gdsfactory/simulation/simphony/components/bend_circular.py"
] | [
"from simphony import Model\n\nimport gdsfactory as gf\nfrom gdsfactory.simulation.simphony.model_from_gdsfactory import model_from_gdsfactory\n\n\ndef coupler_ring_fdtd(\n factory=gf.c.coupler_ring, width=0.5, length_x=4.0, gap=0.2, radius=5\n) -> Model:\n r\"\"\"Return half ring model based on Lumerical 3D ... | [
[
"matplotlib.pyplot.show",
"numpy.linspace"
],
[
"numpy.deg2rad",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
LJ-Jiahe/fuzzy_measure_fusion | [
"d265f3266548eb5f7a629710b200d6b253955cd8"
] | [
"tools/merge_output.py"
] | [
"import datetime\nimport os\nimport pickle\nimport sys\nfrom tkinter.filedialog import askopenfilenames\n\nimport numpy as np\n\ndef merge_output():\n # Load output file\n file_list = askopenfilenames(title='Load output file', initialdir='./output')\n\n first_file = file_list[0]\n with open(first_file, ... | [
[
"numpy.append"
]
] |
nuguziii/Medical-Imaging | [
"b35c5c0b3ba25d31be560197a22d78d61e7c5645"
] | [
"src/utils/evaluation_3d.py"
] | [
"# Copyright (C) 2013 Oskar Maier\n#\n# This program 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 your option) any later version.\n#\n# This program is distr... | [
[
"numpy.count_nonzero",
"numpy.array",
"numpy.asarray",
"scipy.ndimage.morphology.generate_binary_structure",
"scipy.ndimage.measurements.find_objects",
"numpy.mean",
"scipy.stats.pearsonr",
"scipy.ndimage.measurements.label",
"numpy.unique",
"scipy.ndimage._ni_support._norm... |
Clarit7/rlcard | [
"c14a79c8ad2e48d0424d8ba73789a073d4875464"
] | [
"rlcard/envs/simpledoudizhu.py"
] | [
"import numpy as np\n\nfrom rlcard.envs import Env\n\nclass SimpleDoudizhuEnv(Env):\n ''' SimpleDoudizhu Environment\n '''\n\n def __init__(self, config):\n from rlcard.games.simpledoudizhu import Game\n from rlcard.games.doudizhu.utils import encode_cards\n from rlcard.games.doudizhu.... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
amirmehman21/opendr_internal | [
"020b23d62ed1d325b1926d1d592b5f2e65212750"
] | [
"src/opendr/perception/object_detection_2d/retinaface/retinaface_learner.py"
] | [
"# Copyright 2020-2021 OpenDR European Project\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 applicab... | [
[
"numpy.max",
"numpy.zeros_like",
"numpy.zeros",
"numpy.round",
"numpy.min"
]
] |
CarlosW1998/DigitalImageProcessing | [
"69365877e07b676f13487585ffdf029a243b0fa8"
] | [
"NumpyTutorial/Questions on NumPy Sorting and Searching.py"
] | [
"import numpy as np\n\n#Questions on NumPy Sorting and Searching\n# How to get the indices of the sorted array using NumPy in Python?\n#argsort Returns the indices that would sort an array.\nnp.argsort(np.array([3, 1, 2]))\n\n# Finding the k smallest values of a NumPy array\n#sort Return a sorted copy of an array.\... | [
[
"numpy.searchsorted",
"numpy.matrix",
"numpy.array",
"numpy.sort"
]
] |
arshjot/Face-Tracking | [
"2cf3eef8f7b849429ff7eeaae4bd3d5d77ecdf20"
] | [
"face_tracking/eye.py"
] | [
"import math\nimport numpy as np\nimport cv2\nfrom .pupil import Pupil\n\n\nclass Eye(object):\n \"\"\"\n This class creates a new frame to isolate the eye and\n initiates the pupil detection.\n \"\"\"\n\n def __init__(self, original_frame, landmarks, side, calibration):\n self.frame = None\n ... | [
[
"numpy.max",
"numpy.full",
"numpy.array",
"numpy.zeros",
"numpy.min"
]
] |
Kulanx/sleeping_quality_evaluator | [
"e89fd538d13c28eae2382fe9ec1b80aafbc2cedb"
] | [
"codeferm/houghcirclesdet.py"
] | [
"\"\"\"\nCreated on Jul 24, 2017\n\n@author: sgoldsmith\n\nCopyright (c) Steven P. Goldsmith\n\nAll rights reserved.\n\"\"\"\n\nimport cv2, numpy, detectbase\n\n\nclass houghcirclesdet(detectbase.detectbase):\n \"\"\"Hough Circles detector using ROI.\n \n Hough Gradient Method.\n \n \"\"\"\n \n ... | [
[
"numpy.around"
]
] |
youkaichao/tianshou | [
"a9f9940d17e0ec464611f9fa535de391e62fe8bd"
] | [
"tianshou/policy/modelfree/ddpg.py"
] | [
"import torch\nimport numpy as np\nfrom copy import deepcopy\nfrom typing import Dict, Tuple, Union, Optional\n\nfrom tianshou.policy import BasePolicy\nfrom tianshou.exploration import BaseNoise, GaussianNoise\nfrom tianshou.data import Batch, ReplayBuffer, to_torch_as\n\n\nclass DDPGPolicy(BasePolicy):\n \"\"\... | [
[
"torch.no_grad"
]
] |
lambert-x/video_semisup | [
"ccc759dcf159969aa93865bc2a0b18a0c3494044"
] | [
"mmaction/datasets/pipelines/loading.py"
] | [
"import io\nimport os\nimport os.path as osp\nimport shutil\nimport warnings\n\nimport mmcv\nimport numpy as np\nimport torch\nfrom mmcv.fileio import FileClient\nfrom torch.nn.modules.utils import _pair\n\nfrom ...utils import get_random_string, get_shm_dir, get_thread_id\nfrom ..builder import PIPELINES\n\n\n@PIP... | [
[
"torch.zeros",
"numpy.concatenate",
"numpy.array",
"torch.nn.modules.utils._pair",
"numpy.max",
"numpy.random.rand",
"numpy.zeros",
"numpy.pad",
"numpy.copy",
"numpy.load",
"numpy.loadtxt",
"numpy.arange",
"numpy.random.randint",
"numpy.transpose",
"nump... |
wvanzeist/gw-scripts | [
"a42feaf9a1be070a2286c7f2c3ca2cc52b0648b7"
] | [
"riroriro/tests/test_detectabilityfuns.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nUnit tests for the detectabilityfuns module.\n\"\"\"\n\nimport numpy as np\nimport pytest\nimport riroriro.detectabilityfuns as det\n\ndef test_detectabilityfuns_errors():\n \"\"\"\n Testing improper inputs to detectabilityfuns functions.\n \"\"\"\n... | [
[
"numpy.isclose"
]
] |
hepham/Dstar | [
"37d36a3442da8c19a23d09b296406d34675a1be7"
] | [
"python/python/d_star_lite.py"
] | [
"from priority_queue import PriorityQueue, Priority\nfrom grid import OccupancyGridMap\nimport numpy as np\nfrom utils import heuristic, Vertex, Vertices\nfrom typing import Dict, List\n\nOBSTACLE = 255\nUNOCCUPIED = 0\n\n\nclass DStarLite:\n def __init__(self, map: OccupancyGridMap, s_start: (int, int), s_goal:... | [
[
"numpy.ones"
]
] |
nalvarez508/cs458 | [
"e36a7a962fd78d53610add4ed752bac083f10b19"
] | [
"Project 3/p3_3.py"
] | [
"import numpy as np\nfrom sklearn.svm import NuSVC\nimport matplotlib.pyplot as plt\n\n# (a) generate 2-class data points\nnp.random.seed(0)\nx = np.random.rand(300,2) * 10 - 5\ny = np.logical_xor(x[:,0]>0, x[:,1]>0)\n\n# (b) develop nonlinear SVM binary classifier\nclf = NuSVC(gamma='auto')\nclf.fit(x,y)\n\n# (c) ... | [
[
"numpy.logical_xor",
"numpy.random.rand",
"numpy.random.seed",
"sklearn.svm.NuSVC",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter",
"numpy.linspace",
"matplotlib.pyplot.contour"
]
] |
sarvex/model-remediation | [
"c0592dccfa4706577fe94786cf3d59d4b80cd825",
"c0592dccfa4706577fe94786cf3d59d4b80cd825"
] | [
"tensorflow_model_remediation/min_diff/losses/loss_utils_test.py",
"tensorflow_model_remediation/min_diff/losses/kernels/base_kernel_test.py"
] | [
"# coding=utf-8\n# Copyright 2021 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl... | [
[
"tensorflow.test.main"
],
[
"tensorflow.test.main"
]
] |
Smallflyfly/My-Faster-R-CNN | [
"57d7c8b433bf19f71c2ea3dc61fadc414a8897bb"
] | [
"lib/datasets/imdb.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# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom ... | [
[
"numpy.zeros_like",
"numpy.zeros",
"numpy.where",
"numpy.arange",
"numpy.sort",
"numpy.hstack",
"numpy.vstack"
]
] |
tanmaygaikwad/lale | [
"798e222a5a6d74bb92ab868e9eee3e12d03c1060"
] | [
"lale/sklearn_compat.py"
] | [
"# Copyright 2019 IBM Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"sklearn.base.clone"
]
] |
gcfntnu/rna-seq | [
"12466e4790a6e7724cedeb14c159307ea99316d1"
] | [
"rules/bfq/scripts/counts_qc.py"
] | [
"#!/usr/bin env python\n\nimport sys\nimport argparse\nimport warnings\nwarnings.filterwarnings(\"ignore\", message=\"numpy.dtype size changed\")\n\nimport yaml\nimport pandas as pd\nimport numpy as np\n\n\ndef high_index(E, n_top=10):\n order = E.values.sum(1).argsort()[::-1]\n keep = order[:n_top]\n gene... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.concat"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.