repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
alexandrebouayad/Cirq | [
"4ba730b17b6af6265ee6458eb40172b847bd5684"
] | [
"examples/examples_test.py"
] | [
"# pylint: disable=wrong-or-nonexistent-copyright-notice\nimport itertools\n\nimport networkx\nimport numpy as np\nimport pytest\nimport matplotlib.pyplot as plt\n\nimport cirq\nimport examples.basic_arithmetic\nimport examples.bb84\nimport examples.bell_inequality\nimport examples.bernstein_vazirani\nimport exampl... | [
[
"numpy.random.uniform",
"matplotlib.pyplot.switch_backend",
"numpy.array"
]
] |
hyperknot/pgairspace | [
"51f02b54cd12bf4c8c3e7077aaccfaed15c40cfa"
] | [
"pgairspace/geom.py"
] | [
"import os\nimport pyproj\nfrom shapely.geometry import Point, LineString, asShape\nfrom shapely.geometry.polygon import Polygon\nfrom .utils import read_json\n\n\ndef generate_circle(lon, lat, radius_meters):\n points = list()\n for dir in range(0, 360, 15):\n p = offset_point(lon, lat, radius_meters,... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show"
]
] |
polyc/compilers-classifier | [
"0d7b56a5196110459c9bbd0b9e358ec4ac269d42"
] | [
"test_bl_set.py"
] | [
"\nimport numpy as np\nimport pandas as pd\nimport random\n\nimport joblib\n\nfrom sklearn.feature_extraction.text import *\n\nprint('Libraries imported.')\n\n\"\"\"#Import Dataset e print it\"\"\"\nfilename = 'train_dataset.jsonl'\ndb = pd.read_json(filename,lines=True)\n#print(db)\n\nfilename='test_dataset_blind.... | [
[
"pandas.DataFrame",
"pandas.read_json"
]
] |
zyf668/ml_code | [
"fdd2d6c48550860fd481f7d128d41d95d946539b"
] | [
"number_recognization/num_clf_cnn.py"
] | [
"# -*- coding: utf-8 -*-\r\n\r\nimport tensorflow as tf\r\nfrom tensorflow.examples.tutorials.mnist import input_data\r\nimport numpy as np\r\n\r\n\r\n### hyper parameters ###\r\nIMG_X = 28\r\nIMG_Y = 28\r\nINPUT_DIM = IMG_X * IMG_Y\r\nOUTPUT_DIM = 10\r\nLR = 1e-4\r\nMAX_LOOP = 10000\r\nBATCH_SIZE = 50\r\nKEEP_PROB... | [
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.reshape",
"tensorflow.matmul",
"tensorflow.Variable",
"tensorflow.nn.dropout",
"tensorflow.nn.max_pool",
"tensorflow.global_variables_initializer",
"tensorflow.constant",
"numpy.argmax",
"tensorflow.cast",
"... |
Sanjay8874/pandas | [
"a2e599499667b256bc5b8b13a75f0601eccfd432",
"a2e599499667b256bc5b8b13a75f0601eccfd432",
"a2e599499667b256bc5b8b13a75f0601eccfd432"
] | [
"asv_bench/benchmarks/index_object.py",
"pandas/tests/indexes/multi/test_reindex.py",
"pandas/tests/io/parser/test_read_fwf.py"
] | [
"import numpy as np\nimport pandas.util.testing as tm\nfrom pandas import (Series, date_range, DatetimeIndex, Index, RangeIndex,\n Float64Index)\n\n\nclass SetOperations(object):\n\n params = (['datetime', 'date_string', 'int', 'strings'],\n ['intersection', 'union', 'symmetric_di... | [
[
"pandas.Series",
"pandas.date_range",
"pandas.Float64Index",
"numpy.arange",
"pandas.RangeIndex",
"pandas.util.testing.makeStringIndex"
],
[
"pandas.util.testing.assert_raises_regex",
"pandas.util.testing.assert_numpy_array_equal",
"pandas.MultiIndex.from_product",
"num... |
mayank0926/pidnn-double-pendulum | [
"e6f77ffc22ca4ff31dfd6a327e5fec0b61df17a0"
] | [
"dp_driver.py"
] | [
"import torch\nimport yaml\nimport numpy as np\nimport pandas as pd\nimport os\nimport sys\nfrom dp_datagen import double_pendulum_data\nfrom dp_pidnn import pidnn_driver\nfrom dp_dataloader import testloader\nfrom dp_ff import ff_driver\n\nif len(sys.argv) > 2:\n config_filename = sys.argv[2]\nelse:\n config... | [
[
"numpy.random.uniform",
"pandas.DataFrame",
"numpy.arange",
"numpy.max",
"numpy.log",
"numpy.min",
"numpy.array",
"numpy.std",
"numpy.linspace",
"numpy.mean"
]
] |
ShubhamGupta577/Amazing-Python-Scripts | [
"deeb542a77b96fdcfbe21440eee4c620fa06daa9"
] | [
"corona cases forecasting/main.py"
] | [
"# importing libraries\r\nimport numpy as np\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nfrom statsmodels.tsa.arima_model import ARIMA\r\nimport datetime\r\nfrom datetime import date\r\nimport warnings\r\nwarnings.filterwarnings('ignore')\r\nplt.style.use('fivethirtyeight')\r\nfrom pmdarima import ... | [
[
"matplotlib.pyplot.autoscale",
"matplotlib.pyplot.style.use",
"pandas.date_range",
"matplotlib.pyplot.xticks",
"pandas.read_csv",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot"
]
] |
richarajpal/deep_qa | [
"d918335a1bed71b9cfccf1d5743321cee9c61952"
] | [
"tests/tensors/backend_test.py"
] | [
"# pylint: disable=no-self-use,invalid-name\nimport numpy\nfrom deep_qa.tensors.backend import hardmax\nfrom deep_qa.testing.test_case import DeepQaTestCase\nfrom keras import backend as K\n\n\nclass TestBackendTensorFunctions(DeepQaTestCase):\n def test_hardmax(self):\n batch_size = 3\n knowledge_... | [
[
"numpy.ones",
"numpy.argmax",
"numpy.count_nonzero",
"numpy.max",
"numpy.random.rand"
]
] |
zbsjila/CarND-Advanced-Lane-Lines | [
"07f93a4926741a12fdb873e6f6b0fb77550cf492"
] | [
"scripts/process_image_with_parameters.py"
] | [
"#!/usr/bin/env python\n## import\nimport sys\nimport lanefindlib\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\nimport cv2\nimport pickle\nimport os\n\n## argin\nif len(sys.argv) < 4 or len(sys.argv) > 5:\n print(\"Syntax error! Usage: \");\n print(sys.argv[0], \"../t... | [
[
"numpy.linalg.inv",
"matplotlib.pyplot.show",
"matplotlib.image.imsave",
"matplotlib.image.imread"
]
] |
FlyBrainLab/FBLClient | [
"c85de23d428a38fe13491b2f5eb30b690610108e"
] | [
"flybrainlab/utilities/neurowatch.py"
] | [
"\"\"\"\nThis file contains some utilities from Neurowatch for visualizing local files of neurons and meshes in FlyBrainLab.\n\"\"\"\n\nimport json\nimport pandas as pd\n\ndef loadJSON(client, file_name, uname=None, mesh_class = 'Neuropil'):\n \"\"\"Loads a mesh stored in the .json format.\n # Arguments\n ... | [
[
"pandas.read_csv"
]
] |
zhouliupku/LGtagging_LSTM | [
"4db0d34f7544913b75e66253ef63a08fb74cc993"
] | [
"lg_utils.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Oct 21 00:11:24 2019\n\n@author: Zhou\n\"\"\"\n\nimport os\nimport re\nimport pickle\nimport numpy as np\nimport pandas as pd\nimport itertools\n\nimport config\n\ndef convert_to_orig(s):\n \"\"\"\n Convert string from database to corresponding original text\n ... | [
[
"numpy.array",
"numpy.average",
"numpy.isnan"
]
] |
ewellchen/Entanglement_detection | [
"6622ffbdfb09c12389af79e35a98b65b367f15f7"
] | [
"2-qubit/generate_data.py"
] | [
"#!/usr/bin/env python3\r\n# -*- coding: utf-8 -*-\r\nimport numpy as np\r\nfrom tools import mkdir\r\n\r\n\r\n# 1. Create a random Complex matrix H.\r\n# 2. Make it positive, and normalize to unity.\r\n\r\nclass Generate_separable_state(object):\r\n def __init__(self, name='sep_train_set', size=10000, sub_dim=2... | [
[
"numpy.save",
"numpy.sum",
"numpy.dot",
"numpy.zeros",
"numpy.matrix",
"numpy.random.random",
"numpy.arange",
"numpy.linalg.eigvals",
"numpy.random.normal",
"numpy.concatenate",
"numpy.array",
"numpy.real",
"numpy.imag"
]
] |
srihari-humbarwadi/neural-structured-learning | [
"345b8d644dd7745179263bf6dc9aeb8a921528f4"
] | [
"neural_structured_learning/examples/graph_keras_mlp_cora.py"
] | [
"# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"tensorflow.data.TFRecordDataset",
"tensorflow.io.parse_single_example",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.Sequential",
"tensorflow.keras.Model",
"tensorflow.keras.backend.cast",
"tensorflow.io.FixedLenFeat... |
alwc/Text-Image-Augmentation-python | [
"20da2089280098d09069407f7da09eac78eb2eb7"
] | [
"warp_mls.py"
] | [
"# -*- coding:utf-8 -*-\r\n# Author: RubanSeven\r\nimport math\r\n\r\nimport numpy as np\r\n\r\n\r\nclass WarpMLS:\r\n def __init__(self, src, src_pts, dst_pts, dst_w, dst_h, trans_ratio=1.):\r\n self.src = src\r\n self.src_pts = src_pts\r\n self.dst_pts = dst_pts\r\n self.pt_count = ... | [
[
"numpy.zeros_like",
"numpy.sum",
"numpy.ceil",
"numpy.zeros",
"numpy.floor",
"numpy.arange",
"numpy.clip",
"numpy.expand_dims",
"numpy.array"
]
] |
juancastillo0/tfjs | [
"a53aae8fd99762ab41a25ac362ece95b4bbb8cf6"
] | [
"tfjs-converter/python/tensorflowjs/converters/fold_batch_norms.py"
] | [
"# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed t... | [
[
"numpy.vectorize",
"numpy.copy",
"numpy.nditer",
"tensorflow.core.framework.node_def_pb2.NodeDef",
"tensorflow.python.framework.tensor_util.make_tensor_proto",
"tensorflow.python.platform.tf_logging.warning",
"tensorflow.core.framework.graph_pb2.GraphDef"
]
] |
PYH-torder/robot-test | [
"381df1e8911d8ca43c2a57613a7a75e674fea7b6"
] | [
"source/mq/dyccon.py"
] | [
"import sys\nimport time\nimport os\nimport config\nimport setmq\nfrom socket import *\nimport numpy as np\nimport time\nimport binascii\n\n#๋์์ปคํผ๋จธ์ ์ํ ๊ฐ์ ธ์ค๊ธฐ\nhost = \"192.168.103.140\"\ngseq = 0\ngcrc_16 = 0x8005\ntable_crc = []\n\ndef buildTable16(aPoly):\n for i in range(0, 256):\n data = np.uint16(i << ... | [
[
"numpy.uint16"
]
] |
AkshayJainG/veles | [
"21106f41a8e7e7e74453cd16a5059a0e6b1c315e"
] | [
"veles/tests/test_velescli.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n.. invisible:\n _ _ _____ _ _____ _____\n | | | | ___| | | ___/ ___|\n | | | | |__ | | | |__ \\ `--.\n | | | | __|| | | __| `--. \\\n \\ \\_/ / |___| |___| |___/\\__/ /\n \\___/\\____/\\_____|____/\\____/\n\nCreated on Jun 9, 2014\n\nโโโโโโโโโโโ... | [
[
"numpy.empty",
"numpy.random.get_state"
]
] |
Xia-Sam/pandas | [
"74748b9967d102e8c91ad2ef96733c0c1dc98821"
] | [
"pandas/core/indexes/category.py"
] | [
"import operator\nimport warnings\n\nimport numpy as np\n\nfrom pandas._libs import index as libindex\nimport pandas.compat as compat\nfrom pandas.compat.numpy import function as nv\nfrom pandas.util._decorators import Appender, cache_readonly\n\nfrom pandas.core.dtypes.common import (\n ensure_platform_int, is_... | [
[
"pandas.core.common.values_from_object",
"pandas.compat.iteritems",
"pandas.core.indexes.base.default_pprint",
"numpy.asarray",
"pandas.core.dtypes.common.is_list_like",
"pandas.core.config.get_option",
"pandas.core.dtypes.common.is_categorical_dtype",
"pandas.core.algorithms.take_... |
pection/packnet-sfm | [
"d5673567b649e6bfda292c894cacdeb06aa80913"
] | [
"scripts/deploy_model2.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport argparse\nimport numpy as np\nimport torch\nimport os\nimport sys\n\nsys.path.append(os.getcwd())\n\nfrom packnet_sfm.models.SelfSupModel import SelfSupModel\n\nmodel = SelfSupModel()\n\nPATH = '/home/ai/work/data/experiments/default_config-t... | [
[
"torch.load"
]
] |
dubreuia/magenta | [
"acd6dedc315ea159c6f15750dd09aabdadc47515"
] | [
"magenta/music/performance_lib.py"
] | [
"# Copyright 2019 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.logging.debug"
]
] |
leliyliu/Fixed-Point-Training | [
"0f31512abbbab9216bd852c27be5c3774663d62e"
] | [
"models/modules/cptconv.py"
] | [
"from collections import namedtuple\nimport math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd.function import InplaceFunction, Function\n\n__all__ = ['CPTConv2d']\n\nQParams = namedtuple('QParams', ['range', 'zero_point', 'num_bits']) # ็ฑไธไธช้จๅ็ปๆ็่กจ็คบ\n\n_DEFAULT_FLATTEN = ... | [
[
"torch.nn.functional.conv2d",
"torch.rand",
"torch.no_grad",
"torch.tensor",
"torch.max",
"torch.zeros"
]
] |
kyunghoon-jung/MacaronRL | [
"b95be35fc95be7eb5aede2315a714984b282587a"
] | [
"Value_Based/Rainbow/agent.py"
] | [
"import gym\nimport numpy as np\nimport time\nimport os\nimport cv2\nimport matplotlib.pyplot as plt\nfrom collections import deque\nfrom IPython.display import clear_output\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim \nimport torch.nn.functional as F \nfrom torch.nn.utils import clip_grad_n... | [
[
"torch.sum",
"torch.FloatTensor",
"torch.load",
"numpy.zeros",
"matplotlib.pyplot.figure",
"torch.linspace",
"torch.no_grad",
"torch.zeros",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"torch.cuda.is_available",
"numpy.clip"... |
BlockchainClimateInstitute/price_microservice | [
"33c62abe6d107d1da2f54e9e44a90f18aaf916a9"
] | [
"evalml/tests/pipeline_tests/classification_pipeline_tests/test_classification.py"
] | [
"from itertools import product\n\nimport pandas as pd\nimport pytest\nfrom pandas.testing import assert_series_equal\n\nfrom evalml.demos import load_breast_cancer, load_wine\n\n\n@pytest.mark.parametrize(\"problem_type\", [\"binary\", \"multi\"])\ndef test_new_unique_targets_in_score(X_y_binary, logistic_regressio... | [
[
"pandas.Series"
]
] |
XiaoYaoNet/MPIRF | [
"45c6559fc2eeb51c52905fcc6dabe2075e7ffb2b"
] | [
"src/DataClass/Scanner/MScanner.py"
] | [
"# coding=UTF-8\nimport numpy as np\n\nfrom DataClass.BassClass.ScannerBase import *\n\n\nclass MScannerClass(ScannerBaseClass):\n\n def __init__(self,\n VirtualPhantom,\n SelectGradietX=2.0,\n SelectGradietY=2.0,\n DriveFrequencyX=2500000.0 / 102.0... | [
[
"numpy.ones",
"numpy.transpose",
"numpy.zeros",
"numpy.reshape",
"numpy.sinh",
"numpy.add"
]
] |
Abezzam10/Recommender | [
"af72672b22a2c716706afb3e8fc120b5d498ecc3"
] | [
"Recommender_sys.py"
] | [
"import pandas as pd\r\nimport matplotlib\r\nimport matplotlib.pyplot as plt\r\nfrom sklearn.metrics.pairwise import pairwise_distances\r\nimport numpy as np\r\n\r\n# pass in column names for each CSV as the column name is not given in the file and read them using pandas.\r\n# You can check the column names from th... | [
[
"pandas.read_csv",
"numpy.abs",
"numpy.zeros",
"sklearn.metrics.pairwise.pairwise_distances"
]
] |
eashanadhikarla/kibana-data-retrieval | [
"167c1595f2fbb622e4549f598b272a0fe2163089"
] | [
"pacing/model.py"
] | [
"from __future__ import absolute_import, print_function\n\n# --- System ---\nimport os\nimport sys\nimport time\nimport warnings\n\n# --- Utility ---\nimport pandas as pd\nimport numpy as np\nimport math\nimport random\nimport logging\nimport pickle\nimport warnings\nwarnings.filterwarnings('ignore')\nfrom sklearn.... | [
[
"torch.utils.data.DataLoader",
"torch.nn.init.xavier_uniform_",
"torch.no_grad",
"numpy.random.seed",
"torch.cuda.is_available",
"torch.nn.init.zeros_",
"torch.nn.Dropout",
"torch.save",
"torch.sigmoid",
"pandas.read_csv",
"sklearn.preprocessing.MinMaxScaler",
"torc... |
HubukiNinten/imgaug | [
"2570c5651ed1c90addbaffc0f8be226646c55334"
] | [
"imgaug/augmentables/batches.py"
] | [
"from __future__ import print_function, division, absolute_import\n\nimport copy\nimport collections\n\nimport numpy as np\n\nfrom .. import imgaug as ia\nfrom . import normalization as nlib\nfrom . import utils as utils\n\nDEFAULT = \"DEFAULT\"\n\n_AUGMENTABLE_NAMES = [\n \"images\", \"heatmaps\", \"segmentatio... | [
[
"numpy.all",
"numpy.zeros"
]
] |
MichaelLee-ceo/FedSAUC | [
"8c00008772213562ff6a07bf9fa92c3831713118"
] | [
"fedml_api/distributed/fedavg/MyModelTrainer.py"
] | [
"import logging\nimport colorama\n\nimport torch\nfrom torch import nn\n\ntry:\n from fedml_core.trainer.model_trainer import ModelTrainer\nexcept ImportError:\n from FedML.fedml_core.trainer.model_trainer import ModelTrainer\n\ncolorama.init()\n\nclass MyModelTrainer(ModelTrainer):\n\n def get_model_param... | [
[
"torch.no_grad",
"torch.Tensor",
"torch.nn.CrossEntropyLoss",
"torch.max"
]
] |
nobu-g/cohesion-analysis | [
"bf2e22c1aff51f96fd2aaef6359839646548c3be"
] | [
"src/scorer.py"
] | [
"import argparse\nimport io\nimport logging\nimport sys\nfrom collections import OrderedDict\nfrom dataclasses import dataclass\nfrom pathlib import Path\nfrom typing import List, Dict, Set, Union, Optional, TextIO\n\nimport pandas as pd\nfrom jinja2 import Template, Environment, FileSystemLoader\nfrom kyoto_reader... | [
[
"pandas.notnull",
"pandas.Series",
"pandas.concat",
"pandas.DataFrame"
]
] |
hzitoun/neat-EO | [
"3519f1b2a5b4eb6b1b8ec38bce0e722efb61a94b"
] | [
"neat_eo/tools/dataset.py"
] | [
"import os\nimport sys\nimport torch\nimport numpy as np\nfrom tqdm import tqdm\nfrom torch.utils.data import DataLoader\nfrom neat_eo.core import load_config, check_classes, check_channels\nfrom neat_eo.tiles import tiles_from_dir, tile_label_from_file, tiles_from_csv\n\n\ndef add_parser(subparser, formatter_class... | [
[
"torch.utils.data.DataLoader",
"numpy.log"
]
] |
Michael-Beukman/NEATNoveltyPCG | [
"2441d80eb0f6dd288a00ebb56c432963cefc879d"
] | [
"src/games/game.py"
] | [
"from typing import Tuple\nimport numpy as np\nfrom games.level import Level\nclass Game:\n \"\"\"\n A game can be played (by a human/agent/etc).\n It requires a level and has some rules.\n \"\"\"\n def __init__(self, level: Level):\n self.level = level\n self.current_pos = np.a... | [
[
"numpy.array"
]
] |
godweiyang/ParaGen | [
"9665d1244ea38a41fc06b4e0a7f6411985e2221f"
] | [
"examples/glat/glat/glat_length_search.py"
] | [
"import torch\nfrom torch import Tensor\nfrom typing import Callable, Tuple\nfrom paragen.utils.ops import local_seed\nfrom paragen.modules.utils import create_padding_mask_from_length\nfrom paragen.modules.search.abstract_search import AbstractSearch\n\n\"\"\"\nArgs: window_size L\n\ninput: length [B], encoder_out... | [
[
"torch.sum",
"torch.stack",
"torch.tensor",
"torch.minimum",
"torch.maximum"
]
] |
jefflai108/fairseq | [
"fd3f3e7712a7084b9219e45e7b3dc843c69797ba"
] | [
"examples/speech_recognition/w2l_decoder.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"\nWav2letter decoders.\n\"\"\"\n\nimport gc\nimport itertools as it\nimport os.path as osp\nimport w... | [
[
"torch.FloatTensor",
"torch.load",
"torch.no_grad",
"torch.from_numpy",
"torch.IntTensor",
"torch.LongTensor"
]
] |
abhinavsp0730/datasets | [
"3c69b42456fb947a7af7086a3310b972bd1ae3fb"
] | [
"tensorflow_datasets/object_detection/kitti.py"
] | [
"# coding=utf-8\n# Copyright 2020 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ... | [
[
"numpy.random.set_state",
"numpy.random.seed",
"numpy.random.get_state"
]
] |
mfwofford/ginga | [
"e1b4d04e32b49229fd1345f8a909bc614140cafd"
] | [
"ginga/util/io_rgb.py"
] | [
"#\n# io_rgb.py -- RGB image file handling.\n#\n# This is open-source software licensed under a BSD license.\n# Please see the file LICENSE.txt for details.\n#\nimport sys\nimport time\nimport mimetypes\nfrom io import BytesIO\n\nimport numpy as np\n\nfrom ginga.BaseImage import Header, ImageError\nfrom ginga.util ... | [
[
"numpy.array",
"scipy.misc.imsave",
"scipy.misc.imresize",
"numpy.fromfile"
]
] |
mherbert93/DS-Unit-3-Sprint-2-SQL-and-Databases | [
"c322a132ca53ab7fad04da3bd8b3c7f982d8ce65"
] | [
"module2-sql-for-analysis/insert_titanic.py"
] | [
"import psycopg2\nimport sqlite3\nimport os\nfrom dotenv import load_dotenv\nimport pandas as pd\nfrom sqlalchemy import create_engine\n\nload_dotenv()\n\nDB_NAME = os.getenv(\"DB_NAME\")\nDB_USER = os.getenv(\"DB_USER\")\nDB_PW = os.getenv(\"DB_PW\")\nDB_HOST = os.getenv(\"DB_HOST\")\nDB_URL = os.getenv(\"DB_URL\"... | [
[
"pandas.read_csv"
]
] |
bos-lab/piret | [
"23ecdf80331d72612bb2f48ab3207117673c373d"
] | [
"piret/maps/star.py"
] | [
"#! /usr/bin/env python\n\n\"\"\"Luigi Tasks to perform various RNA seq functions, from Mapping to Counting.\n\nMapping is done using hisat2 and counting is done using featurecounts\nand stringtie\n\"\"\"\n\nimport os\nimport luigi\nimport sys\ndir_path = os.path.dirname(os.path.realpath(__file__))\nlib_path = os.p... | [
[
"pandas.DataFrame.from_dict"
]
] |
simonydbutt/b2a | [
"0bf4a6de8547d73ace22967780442deeaff2d5c6"
] | [
"Backtest/main/Simul/TestStrat.py"
] | [
"from Backtest.main.Exit.Exit import Exit\nfrom Backtest.main.Utils.TimeUtil import TimeUtil\nfrom Backtest.main.Visual.StratVisual import StratVisual\nfrom Backtest.main.Utils.AssetBrackets import AssetBrackets\nfrom Backtest.main.Entrance.Enter import Enter\nimport numpy as np\n\n\nclass TestStrat:\n def __ini... | [
[
"numpy.nanmax",
"numpy.nanmean",
"numpy.nanstd",
"numpy.median",
"numpy.nanmin"
]
] |
vishalbelsare/GEM | [
"ea1cb5f9f28c0d2f49646442ccfd2b6ea7b6cab8"
] | [
"gem/evaluation/evaluate_link_prediction.py"
] | [
"try: import cPickle as pickle\nexcept: import pickle\nfrom gem.evaluation import metrics\nfrom gem.utils import evaluation_util, graph_util\nimport numpy as np\nimport networkx as nx\n\nimport sys\nsys.path.insert(0, './')\nfrom gem.utils import embed_util\n\n\ndef evaluateStaticLinkPrediction(digraph, graph_embed... | [
[
"numpy.std",
"numpy.mean"
]
] |
Huxx0804/gibbon_lib | [
"b1f4e565f336f6ce7399f6e5e8e10392d5712dea"
] | [
"gibbon/fem/_score_point.py"
] | [
"import uuid\nimport numpy as np\nfrom shapely.geometry import Point, LineString\nfrom ._finite_cell import FiniteCell\n\n\nclass ScorePoint:\n def __init__(\n self,\n coords: list,\n value: float = 1,\n influence_range: float = 2000\n ):\n self.uuid = str(uuid.uuid4())\n ... | [
[
"numpy.array"
]
] |
jordanmkoncz/openpilot | [
"7502daf28ff6f217de67f5bc1139eac79a4fa6a6"
] | [
"selfdrive/controls/lib/driver_monitor.py"
] | [
"import numpy as np\nfrom common.realtime import DT_CTRL, DT_DMON\nfrom selfdrive.controls.lib.drive_helpers import create_event, EventTypes as ET\nfrom common.filter_simple import FirstOrderFilter\nfrom common.stat_live import RunningStatFilter\n\n_AWARENESS_TIME = 100. # 1.6 minutes limit without user touching s... | [
[
"numpy.array",
"numpy.arctan2",
"numpy.sqrt"
]
] |
wutb15/pai | [
"649200b70fac69e9f33bdd10b50995761eeb8bbe"
] | [
"contrib/profiler/profiler.py"
] | [
"# Copyright (c) Microsoft Corporation\n# All rights reserved.\n#\n# MIT License\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the... | [
[
"numpy.array",
"numpy.average"
]
] |
codelibs/logana | [
"48b475e9fd5224821bfba7d41e755d8d64806651"
] | [
"python/ranking/loganary/ranking/model.py"
] | [
"import dataclasses\nimport logging\nfrom typing import Any, Callable, Dict, List, Optional, Tuple\n\nimport tensorflow as tf\nimport tensorflow_ranking as tfr\nfrom loganary.ranking.common import get_ndcg_metric\nfrom tensorflow.python.feature_column.feature_column_v2 import FeatureColumn\nfrom tensorflow.python.o... | [
[
"tensorflow.compat.v1.data.make_one_shot_iterator",
"tensorflow.estimator.TrainSpec",
"tensorflow.concat",
"tensorflow.compat.v1.layers.flatten",
"tensorflow.feature_column.categorical_column_with_vocabulary_file",
"tensorflow.compat.v1.layers.batch_normalization",
"tensorflow.estimato... |
vish119/Neural-Network-for-XOR-and-Binary-Image-Classification | [
"10e27cc5618c2c399826af06aae6a2e86b4b3df2"
] | [
"dataset.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport sys\n\nsys.path.append('../../core')\nfrom imgutils import *\n\n\nclass xor(object):\n \"\"\"\n Class that creates a xor dataset. Note that for the grading of the project, this method\n might be changed, although it's output format will not be. T... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.random.permutation",
"matplotlib.pyplot.axis",
"numpy.floor",
"numpy.asarray",
"matplotlib.pyplot.title",
"numpy.random.multivariate_normal",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"numpy.stack",
"matplotlib.pyplot.... |
JLans/chemprop | [
"4907f77d6ad3a316b70744a6b4cb5e290bd98d40"
] | [
"chemprop/train/cross_validate.py"
] | [
"from collections import defaultdict\nimport csv\nfrom logging import Logger\nimport logging\nimport os\nimport sys\nfrom typing import Callable, Dict, List, Tuple\n\nimport numpy as np\nimport pandas as pd\n\nfrom .run_training import run_training\nfrom chemprop.args import TrainArgs\nfrom chemprop.constants impor... | [
[
"numpy.nanmean",
"numpy.array",
"numpy.nanstd"
]
] |
williamchevremont/dynamix | [
"445a85b331278097a0c997dfecd73c39dc8f1afd"
] | [
"dynamix/correlator/dense.py"
] | [
"from math import sqrt\nfrom collections import namedtuple\nimport numpy as np\nimport pyopencl.array as parray\nfrom os import path\nfrom multiprocessing import cpu_count\nfrom ..utils import nextpow2, updiv, get_opencl_srcfile, get_next_power\nfrom .common import OpenclCorrelator, BaseCorrelator\n\nfrom silx.math... | [
[
"numpy.zeros_like",
"numpy.sum",
"numpy.dot",
"numpy.zeros",
"numpy.diag",
"numpy.correlate",
"numpy.int32",
"numpy.shape",
"numpy.array",
"numpy.std",
"numpy.where",
"numpy.mean"
]
] |
waltervrossem/tomso | [
"6502bfda598d2b8d13e8e06249c4687fe2bb5f37"
] | [
"tomso/fgong.py"
] | [
"\"\"\"\nFunctions for manipulating FGONG files.\n\"\"\"\n\nimport numpy as np\nfrom tomso.common import integrate, DEFAULT_G\nfrom tomso.adipls import fgong_to_amdl\n\n\ndef load_fgong(filename, N=-1, return_comment=False):\n \"\"\"Given an FGONG file, returns NumPy arrays `glob` and `var` that\n correspond ... | [
[
"numpy.array",
"numpy.sqrt",
"numpy.exp",
"numpy.mod"
]
] |
Isakon/Viral_Tweets_Predictions_Challenge_1st_Place_Solution | [
"f4b52748d7b87ad092051c6982553b9550895354"
] | [
"code/exp_cv688180_lgb_refactored_jun23/utils.py"
] | [
"import os\nimport numpy as np\nimport pandas as pd\n\ndef compare_data(test,\n compare_path='/home/isakev/challenges/viral_tweets/data/processed/a_test_data_lgb_NoImpute_NoOhe_jun23.csv'):\n print(\"preprocessed path:\\n\", compare_path)\n # print(\"cfg.test_preprocessed_path\\n:\", cfg.test_... | [
[
"pandas.read_csv",
"numpy.sum",
"numpy.sort",
"numpy.argsort"
]
] |
nmoran/CosmiQ_SN6_Baseline | [
"063b62605eb9e426ac4407e48c46735ffb420dd5"
] | [
"baseline.py"
] | [
"#!/usr/bin/env python\n\nimport os\nimport sys\nimport glob\nimport math\nimport uuid\nimport shutil\nimport pathlib\nimport argparse\nimport numpy as np\nimport pandas as pd\nimport geopandas as gpd\nimport skimage\nimport torch\nimport tqdm\nimport gdal\n\nimport solaris as sol\n\nimport model\n\ndef makeemptyfo... | [
[
"numpy.flipud",
"pandas.read_csv",
"pandas.DataFrame",
"numpy.shape",
"numpy.where"
]
] |
anooptp/maml | [
"fdd95f3d60c9281d871d89b25b073e87b6ba4e52"
] | [
"maml/apps/pes/tests/test_gap.py"
] | [
"# coding: utf-8\n# Copyright (c) Materials Virtual Lab\n# Distributed under the terms of the BSD License.\n\nimport os\nimport shutil\nimport unittest\nimport tempfile\n\nimport numpy as np\nfrom pymatgen.core import Structure\nfrom monty.os.path import which\nfrom monty.serialization import loadfn\nfrom maml.apps... | [
[
"numpy.array",
"numpy.testing.assert_array_almost_equal"
]
] |
zheng-da/pyHGT | [
"b654495053c82edcc8a7e1e00b7873ac93e6e59d"
] | [
"conv.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom torch_geometric.nn import GCNConv, GATConv\nfrom torch_geometric.nn.conv import MessagePassing\nfrom torch_geometric.nn.inits import glorot, uniform\nfrom torch_geometric.utils import softmax\nimport mat... | [
[
"torch.ones",
"torch.nn.Linear",
"torch.nn.functional.sigmoid",
"torch.cos",
"torch.nn.Embedding",
"torch.sin",
"torch.arange",
"torch.nn.ModuleList",
"torch.zeros",
"torch.nn.Dropout",
"torch.Tensor",
"torch.nn.functional.gelu"
]
] |
cparrarojas/epidemic-inference | [
"598e14bc434b846c0fb5f53f70db131d3928122d"
] | [
"app.py"
] | [
"import dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport pandas as pd\nimport plotly.graph_objs as go\n\nimport matplotlib\nfrom matplotlib import cm\nimport numpy as np\n\nlinecolours = ['rgba(0,114,178,1.)', 'rgba(230,159,0,1.)']\n\nmagma_cmap = cm.get_cmap('magma')\n\nmagma_r... | [
[
"pandas.read_csv",
"matplotlib.cm.get_cmap",
"matplotlib.colors.Normalize"
]
] |
DPBayes/DP-HMC-Neurips2021 | [
"ff8b828e8fc150ee59a3a271ef33dd75dd17bfe5"
] | [
"result.py"
] | [
"import metrics\nimport jax.numpy as np\nimport pandas as pd\n\nclass MCMCMetrics:\n def __init__(self, result, true_posterior):\n chains = result.get_final_chain()\n self.samples, self.dim, self.num_chains = chains.shape\n self.epsilon = result.epsilon\n self.delta = result.delta\n\n... | [
[
"pandas.DataFrame"
]
] |
soerenwolfers/scilog | [
"ca66a6a7b8d267c8f2998b2a935b35b8f95b7558"
] | [
"scilog/scilog.py"
] | [
"import timeit\nimport pickle\nimport os\nimport errno\nimport datetime\nimport shutil\nimport warnings\nimport traceback\nimport pstats\nimport io\nimport sys\nimport gc\nimport inspect\nimport importlib\nimport re\nimport pathlib\nimport types\nimport operator\nimport subprocess\nimport shlex\nimport json\nimport... | [
[
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.cumsum",
"numpy.random.get_state"
]
] |
goncaloperes/mcdm | [
"2316d06adee76c4d82aef43522d31505d0f431e6"
] | [
"mcdm/tests/test_correlate.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) 2020 Dimitrios-Georgios Akestoridis\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation... | [
[
"numpy.array",
"numpy.testing.assert_allclose"
]
] |
chelini/iree-llvm-sandbox | [
"28978acb424bbac552f04856b28eb6c87478c289"
] | [
"python/examples/depthwise_conv/definitions.py"
] | [
"import itertools\n\nfrom typing import Any, List, Mapping, Optional, Sequence, Tuple, Union\n\nimport numpy as np\n\nfrom mlir.ir import *\nfrom mlir.dialects import arith, builtin, linalg, scf, std, tensor\n\nfrom ..core.compilation import attach_inplaceable_attributes, attach_passthrough\nfrom ..core.problem_def... | [
[
"numpy.ones",
"numpy.allclose",
"numpy.zeros",
"numpy.dtype",
"torch.permute",
"torch.reshape",
"numpy.random.rand",
"numpy.prod",
"numpy.array"
]
] |
tontsam/audioset_tagging_cnn | [
"223f0a92fb753a34ac145a64c6713ee497fbda0c"
] | [
"pytorch/pytorch_utils.py"
] | [
"import numpy as np\nimport time\nimport torch\nimport torch.nn as nn\n\n\ndef move_data_to_device(x, device):\n if 'float' in str(x.dtype):\n x = torch.Tensor(x)\n elif 'int' in str(x.dtype):\n x = torch.LongTensor(x)\n else:\n return x\n\n return x.to(device)\n\n\ndef do_mixup(x, ... | [
[
"torch.rand",
"torch.no_grad",
"numpy.concatenate",
"torch.LongTensor",
"torch.cat",
"torch.Tensor"
]
] |
DTRademaker/pdb2sql | [
"e4ddb4bd554b5623ca7101ebc4f4cd9acc0a422a"
] | [
"pdb2sql/align.py"
] | [
"import numpy as np\nfrom .pdb2sqlcore import pdb2sql\nfrom .interface import interface\nfrom .transform import rot_xyz_around_axis\n\n\ndef align(pdb, axis='x', export=True, **kwargs):\n \"\"\"Align the max principal component of a structure along one of the cartesian axis\n\n Arguments:\n pdb {str, p... | [
[
"numpy.arctan2",
"numpy.argmin",
"numpy.cov",
"numpy.arccos",
"numpy.argmax",
"numpy.array",
"numpy.linalg.norm",
"numpy.mean"
]
] |
JudyJin/torchTS | [
"2856e1bae8be3b9fdc23dcc2e8339674f1558ba5"
] | [
"tests/nn/test_loss.py"
] | [
"import pytest\nimport torch\n\nfrom torchts.nn.loss import masked_mae_loss, mis_loss, quantile_loss\n\n\n@pytest.fixture\ndef y_true():\n data = [1, 2, 3]\n return torch.tensor(data)\n\n\n@pytest.fixture\ndef y_pred():\n data = [1.1, 1.9, 3.1]\n return torch.tensor(data)\n\n\ndef test_masked_mae_loss(y... | [
[
"torch.tensor"
]
] |
gabrieloexle/mercury-ml | [
"cc663f84a26ee66ae105bbfc0cd1cbd5629031cd"
] | [
"mercury_ml/common/providers/data_wrappers/pandas.py"
] | [
"class PandasDataWrapper():\n \"\"\"\n A DataWrapper with a Pandas DataFrame as its underlying data\n \"\"\"\n\n def __init__(self, underlying, field_names):\n self.underlying = underlying\n self.field_names = field_names\n\n def slice_on_column_names(self, column_names):\n \"\"\... | [
[
"pandas.concat"
]
] |
furgerf/advent-of-code-2019 | [
"f2c6ad9d401c91a7b04bb699d233a7d6ec9da2ac"
] | [
"day_13/day_13.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom enum import Enum, unique\n\nimport numpy as np\n\nfrom day import Day\nfrom intcode import Intcode\n\n\nclass Day13(Day):\n\n @unique\n class TileType(Enum):\n NOTHING = 0\n WALL = 1\n BLOCK = 2\n PADDLE = 3\n BALL = 4\n\n class GameMap:\n\n ... | [
[
"numpy.where",
"numpy.sign",
"numpy.zeros"
]
] |
KaidongLi/pytorch-LatticePointClassifier | [
"5c00bb0f808a928ea57acb8a79364d62eb955cee"
] | [
"data_analysis/conv_att2npz.py"
] | [
"import os\n\nimport pdb\n\nimport argparse\nimport numpy as np\n\nPEND_ORIG = 'orig'\n# PEND_NEW = 'splat'\nPEND_ATT = 'adv'\nPEND_ATT_FAIL = 'adv_f'\nPEND_ATT2D = '2dimg'\nPEND_PRED = 'pred'\n\nparser = argparse.ArgumentParser(\n description='test shape net show image')\nparser.add_argument('--img_dir', defaul... | [
[
"numpy.array",
"numpy.concatenate"
]
] |
Noba1anc3/recommenders | [
"fb886881137ca3add05bb0d478a4751207ca5559"
] | [
"tensorflow_recommenders/layers/loss.py"
] | [
"# Copyright 2022 The TensorFlow Recommenders 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 ... | [
[
"tensorflow.gather",
"tensorflow.shape",
"tensorflow.reshape",
"tensorflow.range",
"tensorflow.nn.top_k",
"tensorflow.expand_dims",
"tensorflow.math.argmax",
"tensorflow.clip_by_value",
"numpy.finfo",
"tensorflow.transpose"
]
] |
MikePham05/segmentation_models.pytorch | [
"f61acfedf5e5b122430abb71181126bf1a288a94"
] | [
"segmentation_models_pytorch/losses/lovasz.py"
] | [
"\"\"\"\nLovasz-Softmax and Jaccard hinge loss in PyTorch\nMaxim Berman 2018 ESAT-PSI KU Leuven (MIT License)\n\"\"\"\n\nfrom __future__ import print_function, division\nfrom typing import Optional\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom torch.nn.modules.loss impo... | [
[
"torch.autograd.Variable",
"torch.movedim",
"torch.sort",
"torch.nn.functional.relu"
]
] |
miwojc/scikit-learn-mooc | [
"9eb67c53173218b5cd3061712c827c6a663e425a"
] | [
"python_scripts/trees_ex_02.py"
] | [
"# %% [markdown]\n# # ๐ Exercise M5.02\n#\n# The aim of this exercise is to find out whether a decision tree\n# model is able to extrapolate.\n#\n# By extrapolation, we refer to values predicted by a model outside of the\n# range of feature values seen during the training.\n#\n# We will first load the regression d... | [
[
"pandas.read_csv"
]
] |
bsmithyman/zephyr | [
"ef74caadd74cc357b503560c3800e26c49587e61"
] | [
"zephyr/Dispatcher.py"
] | [
"import numpy as np\nfrom IPython.parallel import Reference, interactive\nfrom SimPEG import Survey, Problem, Mesh, Solver as SimpegSolver\nfrom SimPEG.Parallel import RemoteInterface, SystemSolver\nfrom SimPEG.Utils import CommonReducer\nfrom zephyr.Survey import SurveyHelm\nfrom zephyr.Problem import ProblemHelm\... | [
[
"numpy.conj",
"numpy.linspace",
"numpy.zeros"
]
] |
danielgrijalva/steven-wilson-analysis | [
"6b27f37f66482504f9bdf11f3a13fc4897f122f8"
] | [
"get_lyrics.py"
] | [
"import pandas as pd\nimport lyricwikia \n\nsw = pd.read_csv('Steven Wilson.csv')\npt = pd.read_csv('Porcupine Tree.csv')\n\nsw_songs = sw['name']\npt_songs = pt['name']\n\nsw_lyrics = []\npt_lyrics = []\n\nfor song in sw_songs:\n try:\n lyrics = lyricwikia.get_lyrics('Steven Wilson', song)\n clean... | [
[
"pandas.read_csv"
]
] |
hzy5660251/memcnn | [
"1293468e4ee4ed83fcf9da36940065bbe72dd54b"
] | [
"memcnn/models/tests/test_revop.py"
] | [
"import pytest\nimport torch\nimport torch.nn\nimport numpy as np\nimport copy\nfrom memcnn.models.affine import AffineAdapterNaive, AffineAdapterSigmoid\nfrom memcnn import ReversibleBlock\n\n\ndef set_seeds(seed):\n np.random.seed(seed)\n torch.manual_seed(seed)\n\n\n@pytest.mark.parametrize('coupling', ['a... | [
[
"torch.nn.BatchNorm2d",
"numpy.allclose",
"torch.autograd.grad",
"torch.nn.MSELoss",
"torch.chunk",
"torch.manual_seed",
"torch.rand",
"numpy.random.seed",
"torch.equal",
"torch.exp",
"numpy.random.random",
"torch.nn.Conv2d",
"torch.zeros",
"torch.cat",
... |
ncullen93/ANTsPy | [
"a4c990dcd5b7445a45ce7b366ee018c7350e7d9f"
] | [
"ants/core/ants_image.py"
] | [
"\n\n__all__ = ['copy_image_info',\n 'set_origin',\n 'get_origin',\n 'set_direction',\n 'get_direction',\n 'set_spacing',\n 'get_spacing',\n 'image_physical_space_consistency',\n 'image_type_cast']\n\nimport os\nimport numpy as np\nfrom... | [
[
"numpy.allclose",
"numpy.asarray"
]
] |
tkg-framework/TKG-framework | [
"98586b7199bda0e96d74b2ea02c62226901822cc"
] | [
"tkge/models/loss/MarginRankingLoss.py"
] | [
"from tkge.models.loss import Loss\n\nimport torch\n\n\n@Loss.register(name=\"margin_ranking_loss\")\nclass MarginRankingLoss(Loss):\n def __init__(self, config):\n super().__init__(config)\n\n self.margin = self.config.get(\"train.loss.margin\")\n self.reduction = self.config.get(\"train.lo... | [
[
"torch.ones_like",
"torch.nn.MarginRankingLoss"
]
] |
gmabey/numpy | [
"9e9ec3821c1d6a055543e54336ecb2c98ec42c5f"
] | [
"numpy/distutils/fcompiler/intel.py"
] | [
"# http://developer.intel.com/software/products/compilers/flin/\nfrom __future__ import division, absolute_import, print_function\n\nimport sys\n\nfrom numpy.distutils.ccompiler import simple_version_match\nfrom numpy.distutils.fcompiler import FCompiler, dummy_fortran_file\n\ncompilers = ['IntelFCompiler', 'IntelV... | [
[
"numpy.distutils.ccompiler.simple_version_match",
"numpy.distutils.fcompiler.dummy_fortran_file",
"numpy.distutils.fcompiler.FCompiler.get_flags_linker_so",
"numpy.distutils.fcompiler.new_fcompiler"
]
] |
JonathanRaiman/dali-cython-stub | [
"e258469aeb1d4cb3e4cdf5c07e8948f461a038f1"
] | [
"dali/utils/misc.py"
] | [
"import dill as pickle\nimport inspect\nimport numpy as np\nimport types\n\nfrom os import makedirs, listdir\nfrom os.path import join, exists\n\nimport dali.core as D\n\nclass RunningAverage(object):\n def __init__(self, alpha=0.95):\n self.alpha = alpha\n self.value = None\n\n def update(self,... | [
[
"numpy.median"
]
] |
jjmachan/PySyft | [
"41a525443881bfd94ccb488d7a24765c1778ac05"
] | [
"test/torch_test.py"
] | [
"# python -m unittest -v test/torch_test.py\n\n\nimport unittest\nfrom unittest import TestCase\n\nimport random\nimport syft as sy\nimport numpy as np\nfrom syft.core.frameworks.torch import utils as torch_utils\nfrom syft.core.frameworks import encode\nfrom syft.core.frameworks.torch.tensor import _GeneralizedPo... | [
[
"torch.stack",
"torch.addcmul",
"torch.eq",
"torch.ByteTensor",
"torch.addmm",
"torch.nn.Conv2d",
"torch.native_eq",
"torch.cross",
"torch.max",
"torch.cat",
"torch.add",
"torch.ones",
"torch.ge",
"torch.manual_seed",
"torch.dist",
"torch.IntTensor",... |
ARudiuk/mne-python | [
"63feb683cd1f8ddd598a78d12c8ef522f9ca2d78"
] | [
"mne/label.py"
] | [
"# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n# Martin Luessi <mluessi@nmr.mgh.harvard.edu>\n# Denis Engemann <denis.engemann@gmail.com>\n#\n# License: BSD (3-clause)\n\nfrom collections import defaultdict\nfrom colorsys import hsv_to_rgb, rgb_to_hsv\nfrom os import pat... | [
[
"numpy.sum",
"numpy.intersect1d",
"numpy.any",
"numpy.argsort",
"numpy.asarray",
"matplotlib.cm.get_cmap",
"numpy.isscalar",
"numpy.vstack",
"scipy.linalg.norm",
"numpy.argmin",
"numpy.abs",
"numpy.where",
"numpy.linspace",
"numpy.nonzero",
"numpy.mean",... |
tlsgusdn1107/BRAIN | [
"7664e276d0de16f27b0c40d5a83b5fe751830b15"
] | [
"BRAIN/Scripts/PREPROCESSING (DONE)/PRE_POST_SCALP_SEGMENTATION/4middlereg_v2.py"
] | [
"from __future__ import division\nfrom sympy import *\nimport numpy as np\nimport nibabel as nib\n\ndef middle_reg(a,b):\n \n A = nib.load(str(a))\n AA = np.array(A.dataobj)\n B = []\n for x in range(AA.shape[0]):\n for y in range(AA.shape[1]):\n for z in range(AA.shape[2]):\n ... | [
[
"numpy.array",
"numpy.eye",
"numpy.zeros"
]
] |
segrelab/MiCoNE-synthetic-data | [
"330957b5d1c8ce8f27f915c8c5ceaedbcb1447b5"
] | [
"scripts/data_generation/create_samplesheets.py"
] | [
"#!/usr/bin/env python3\n\nimport pathlib\nfrom typing import List\n\nimport pandas as pd\n\nHEADER = [\"id\", \"otu_table\", \"obs_metadata\", \"sample_metadata\", \"children_map\"]\n\n\ndef main(files: List[pathlib.Path], name: str) -> None:\n \"\"\"Create samplesheet for list of files\"\"\"\n data = []\n ... | [
[
"pandas.DataFrame"
]
] |
SvtFilatov/PredictPricesSoccer | [
"ad50823ff49e696332c1a7e1e1b0559d6d5d511e"
] | [
"main.py"
] | [
"import streamlit as st\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom datetime import datetime\nimport warnings\nwarnings.filterwarnings('ignore')\nimport random\n\nst.title('ะัะพะณะฝะพะทะธัะพะฒะฐะฝะธะต ัะตะฝั ัััะฑะพะปะธััะพะฒ')\n\nst.markdown('ะฆะตะปัั ััะพะณะพ ะฟัะพะตัะฐ ะฑัะปะพ ะฟัะตะดัะบะฐะทะฐะฝะธะต ัะตะฝ ะฝะฐ ะผะพะปะพะดัั
ะฐัะฐะบ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xticks",
"pandas.read_csv",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.subplot",
"numpy.max",
"matplotlib.pyplot.ylim"
]
] |
zhanglirong1999/YOLOX | [
"8b96c9c954e773a68cb439506bedd3b80406cc7d"
] | [
"yolox/models/yolo_head.py"
] | [
"#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Copyright (c) Megvii Inc. All rights reserved.\n\nimport math\nfrom loguru import logger\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom yolox.utils import bboxes_iou, meshgrid\n\nfrom .losses import IOUloss\nfrom .network_blocks imp... | [
[
"torch.cuda.empty_cache",
"torch.min",
"torch.stack",
"torch.nn.L1Loss",
"torch.no_grad",
"torch.zeros_like",
"torch.full",
"torch.exp",
"torch.topk",
"torch.log",
"torch.nn.ModuleList",
"torch.cuda.amp.autocast",
"torch.nn.BCEWithLogitsLoss",
"torch.arange"... |
svecjan/pytorch | [
"09d221e8d439bc748b162c028f7eece202688adf"
] | [
"torch/utils/data/datapipes/dataframe/datapipes.py"
] | [
"import random\n\nfrom torch.utils.data import (\n DFIterDataPipe,\n IterDataPipe,\n functional_datapipe,\n)\n\ntry:\n import pandas # type: ignore[import]\n # pandas used only for prototyping, will be shortly replaced with TorchArrow\n WITH_PANDAS = True\nexcept ImportError:\n WITH_PANDAS = F... | [
[
"torch.utils.data.functional_datapipe",
"pandas.DataFrame",
"pandas.concat"
]
] |
seeclong/apollo | [
"99c8afb5ebcae2a3c9359a156a957ff03944b27b"
] | [
"modules/tools/mapshow/roadshow.py"
] | [
"#!/usr/bin/env python\n\n###############################################################################\n# Copyright 2017 The Apollo 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 ... | [
[
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show"
]
] |
awesome-archive/Py3plex | [
"a099acb992441c1630208ba13694acb8e2a38895"
] | [
"py3plex/core/HINMINE/dataStructures.py"
] | [
"## core data structures\n\nimport networkx as nx\nimport numpy as np\nimport scipy.sparse as sp\nfrom .decomposition import get_calculation_method\n\nclass Class:\n def __init__(self, lab_id, name, members):\n self.name = name\n self.id = lab_id\n self.index = -1\n self.members = mem... | [
[
"numpy.sum",
"scipy.sparse.csr_matrix"
]
] |
SimoCnt/Leaders-tweets-analysis-during-Covid-19-pandemic | [
"cab6e3d8bf80dcfc487642755fc6567fdc4e26ff"
] | [
"topic_modeling.py"
] | [
"\"\"\"\n@author: Salvatore Calderaro\n@author: Simone Contini\n\"\"\"\n\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.decomposition import LatentDirichletAllocation as LDA\nfrom textblob import TextBlob\nfrom wordcloud import WordCloud\... | [
[
"matplotlib.pyplot.legend",
"sklearn.feature_extraction.text.CountVectorizer",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.pie",
"numpy.argmax",
"sklearn.decomposition.LatentDirichletAllocation",
"matplotlib.pyplot.... |
carchrae/tensorflow | [
"04f2870814d2773e09dcfa00cbe76a66a2c4de88"
] | [
"tensorflow/python/keras/optimizer_v2/adadelta_test.py"
] | [
"# Copyright 2015 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.platform.test.is_built_with_rocm",
"tensorflow.python.eager.context.eager_mode",
"tensorflow.python.framework.test_util.run_in_graph_and_eager_modes",
"tensorflow.python.keras.optimizer_v2.adadelta.Adadelta",
"tensorflow.python.ops.embedding_ops.embedding_lookup",
"tenso... |
abhishekvermasg/automl | [
"b4cd80b396836aada750aef47c2287bfe1ac4105"
] | [
"efficientdet/keras/anchors.py"
] | [
"# Copyright 2020 Google Research. 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... | [
[
"numpy.vstack",
"tensorflow.gather",
"tensorflow.stack",
"tensorflow.unstack",
"tensorflow.range",
"numpy.concatenate",
"numpy.swapaxes",
"numpy.arange",
"tensorflow.cast",
"numpy.expand_dims",
"tensorflow.convert_to_tensor",
"tensorflow.not_equal",
"numpy.sqrt"... |
rahul-jha98/sphereface_pytorch | [
"bcacf44722fe53e2c30faca725933bf695b45620"
] | [
"train.py"
] | [
"from __future__ import print_function\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\ntorch.backends.cudnn.bencmark = True\n\nimport os,sys,cv2,random,datetime\nimport argparse\nimport numpy as np\n\nfrom dataset import Imag... | [
[
"numpy.zeros",
"torch.save",
"torch.autograd.Variable",
"torch.cuda.is_available",
"torch.from_numpy",
"torch.max",
"numpy.array"
]
] |
dengdifan/SMAC3 | [
"4739741fe9f6b0b92d419bac8f0a6252858a55dc"
] | [
"test/test_runhistory/test_runhistory2epm.py"
] | [
"__author__ = \"Katharina Eggensperger\"\n__copyright__ = \"Copyright 2015, ML4AAD\"\n__license__ = \"GPLv3\"\n__maintainer__ = \"Katharina Eggensperger\"\n__email__ = \"eggenspk@cs.uni-freiburg.de\"\n__version__ = \"0.0.1\"\n\nimport unittest\n\nimport numpy as np\n\nfrom smac.tae import StatusType\nfrom smac.runh... | [
[
"numpy.array",
"numpy.random.RandomState",
"numpy.all",
"numpy.log"
]
] |
ulandz/vnpy | [
"bd6399e77364e434b89b8e866faad2556d1935aa"
] | [
"vnpy/app/cta_strategy/backtesting.py"
] | [
"from collections import defaultdict\nfrom datetime import date, datetime, timedelta\nfrom dateutil.relativedelta import relativedelta\nfrom typing import Callable\nfrom itertools import product\nfrom functools import lru_cache\nfrom time import time\nimport platform\nimport multiprocessing\n#empyrical้ฃ้ฉๆๆ ่ฎก็ฎๆจกๅ\nfro... | [
[
"matplotlib.pyplot.style.use",
"numpy.mean",
"numpy.histogram",
"scipy.stats.describe",
"matplotlib.pyplot.figure",
"pandas.DataFrame",
"numpy.set_printoptions",
"numpy.seterr",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"numpy.log",
"numpy.sqrt",
"n... |
GabrielUlisses/pandas | [
"6430d5324ae2b602b314a7851e9c1f4c5313cceb"
] | [
"pandas/tests/util/test_hashing.py"
] | [
"import numpy as np\nimport pytest\n\nimport pandas as pd\nfrom pandas import DataFrame, Index, MultiIndex, Series\nimport pandas._testing as tm\nfrom pandas.core.util.hashing import hash_tuples\nfrom pandas.util import hash_array, hash_pandas_object\n\n\n@pytest.fixture(\n params=[\n Series([1, 2, 3] * 3... | [
[
"pandas._testing.assert_numpy_array_equal",
"pandas.timedelta_range",
"pandas.Series",
"pandas._testing.makePeriodIndex",
"numpy.asarray",
"pandas._testing.assert_series_equal",
"pandas._testing.makeMissingDataframe",
"pandas.Timestamp",
"pandas._testing.makeMixedDataFrame",
... |
carterbox/xdesign | [
"2ab9f5835b518a7c5b564243d365c8ee4410156f"
] | [
"src/xdesign/metrics/fullref.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Defines full-referene image quality metricsself.\n\nThese methods require a ground truth in order to make a quality assessment.\n\n.. moduleauthor:: Daniel J Ching <carterbox@users.noreply.github.com>\n\"\"\"\n\n__author__ = \"Daniel Ching\"\n__copyright__ = \"... | [
[
"numpy.sum",
"numpy.ones",
"scipy.ndimage.zoom",
"numpy.stack",
"scipy.ndimage.filters.gaussian_filter",
"numpy.vstack",
"numpy.nanmean",
"numpy.atleast_3d",
"numpy.corrcoef",
"numpy.zeros",
"numpy.min",
"numpy.array",
"numpy.log2",
"numpy.nanprod",
"num... |
WorldEditors/PaddleHelix | [
"7dbe947417538d7478fbab4438905b30c1d709c3"
] | [
"apps/pretrained_compound/pretrain_gnns/pretrain_contextpred.py"
] | [
"#!/usr/bin/python \n#-*-coding:utf-8-*- \n# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed unde... | [
[
"numpy.array",
"numpy.argmax",
"numpy.mean"
]
] |
janpipek/physt | [
"bf6b05952b7d09bbbdae2b077f0989c392eac13e"
] | [
"tests/test_special.py"
] | [
"import numpy as np\nimport pytest\n\nfrom physt import special_histograms\nfrom physt.special_histograms import AzimuthalHistogram, azimuthal\n\n\n@pytest.fixture\ndef empty_azimuthal() -> AzimuthalHistogram:\n return azimuthal(\n np.zeros(\n 0,\n ),\n np.zeros(\n 0,\n... | [
[
"numpy.sqrt",
"numpy.allclose",
"numpy.empty",
"numpy.zeros",
"numpy.random.seed",
"numpy.asarray",
"numpy.random.normal",
"numpy.array_equal",
"numpy.array"
]
] |
kbrezinski/complexity | [
"2077825c8ec64df03dfb9f791b7578d64cb35567"
] | [
"tools/plot.py"
] | [
"\nfrom scipy import stats\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndef loglog(sums2,interval=None,type=None,plot=False,smoothing=None):\n\n if type is None:\n\n y = [np.log(item) for item in sums2]\n x = [1/(vel+1) for vel in interval]\n slope, yInt, _,_,_ = stats.linregress(... | [
[
"numpy.ravel",
"numpy.log",
"scipy.stats.linregress",
"sklearn.linear_model.HuberRegressor",
"matplotlib.pyplot.scatter"
]
] |
yuiiiiiiii/trashbin | [
"f8af682a4aaf84ec2e35e03364d6a5248b2aeb52"
] | [
"sampling_methods/represent_cluster_centers.py"
] | [
"# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed... | [
[
"numpy.sort",
"numpy.argmin",
"numpy.argsort",
"sklearn.cluster.MiniBatchKMeans"
]
] |
awlange/brainsparks | [
"05baff28da347172083672c940406f5696893201"
] | [
"src/calrissian/layers/max_pool_1d.py"
] | [
"from .layer import Layer\nfrom ..activation import Activation\nfrom .convolution_1d import Convolution1D\n\nimport numpy as np\n\n\nclass MaxPool1D(Layer):\n \"\"\"\n Convolve input but only feed forward the maximum activation\n \"\"\"\n\n def __init__(self, input_size=0, n_filters=0, pool_size=1, stri... | [
[
"numpy.zeros_like",
"numpy.asarray",
"numpy.argmax"
]
] |
cxiang26/mygluon_cv | [
"1dfebd27afc7d788424b21dfd69007c7576dcbbe"
] | [
"gluoncv/model_zoo/fcos/fcos_target.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\n\nimport os\nimport sys\n\nimport numpy as np\nimport mxnet as mx\nfrom mxnet import nd\nfrom mxnet import autograd\nfrom mxnet.gluon import nn\n# from IPython import embed\n\nclass FCOSTargetGenerator(nn.Block):\n \"\"\"Generate FCOS targets\"\"\... | [
[
"numpy.ceil"
]
] |
ryanofarrell/ncaa-basketball | [
"628bda58cb1320431edf38ab407ba70ca5f80008"
] | [
"code/Vegas Analysis.py"
] | [
"\n# %% Imports\nimport pandas as pd\nimport numpy as np\nimport plotly.express as px\nimport plotly.graph_objects as go\nfrom plotly.subplots import make_subplots\nfrom sklearn.ensemble import RandomForestRegressor, RandomForestClassifier, GradientBoostingClassifier\nfrom sklearn.metrics import r2_score, roc_curve... | [
[
"numpy.sum",
"sklearn.metrics.roc_curve",
"pandas.read_csv",
"pandas.DataFrame",
"numpy.abs",
"sklearn.metrics.roc_auc_score",
"pandas.to_datetime",
"sklearn.ensemble.RandomForestRegressor",
"pandas.merge",
"sklearn.metrics.r2_score",
"sklearn.ensemble.RandomForestClass... |
signofthefour/tacotron | [
"660d3448a0a0dcf6efd4f7629f203f121c271fff"
] | [
"audio.py"
] | [
"from __future__ import print_function, division\n\nimport numpy as np\nimport librosa\nfrom tqdm import tqdm\nimport math\nimport tensorflow as tf\nimport soundfile as sf\n\nn_fft = 2048\nwin_length = 1200\nhop_length = int(win_length/4)\nmax_audio_length = 108000\n\n# decoder output width r\nr = 2\n\ndef reshape_... | [
[
"numpy.append",
"numpy.reshape",
"numpy.abs",
"numpy.exp",
"numpy.arange",
"numpy.random.rand",
"numpy.angle",
"numpy.array_equal",
"numpy.pad",
"numpy.linalg.norm",
"numpy.split"
]
] |
RachitKeertiDas/LitSocBot | [
"863c629eb53e8783ebaea50fedabce3971c8a33b"
] | [
"main.py"
] | [
"from typing import Optional\nimport discord as dc\nimport os\nfrom discord.ext.commands.core import command\nimport requests\nimport json\nfrom CowsAndBulls import CowsAndBulls\nimport Anagram as ana\nimport feedparser\nimport random\nimport discord\nfrom discord.ext import commands\nfrom dotenv import load_dotenv... | [
[
"numpy.zeros"
]
] |
Pandinosaurus/closed-form-matting | [
"5fb39478fb9fc938c583a6786adc17cea6dd9c4c"
] | [
"test_matting.py"
] | [
"\"\"\"Tests for Closed-Form matting and foreground/background solver.\"\"\"\nimport unittest\n\nimport cv2\nimport numpy as np\n\nimport closed_form_matting\n\nclass TestMatting(unittest.TestCase):\n def test_solution_close_to_original_implementation(self):\n image = cv2.imread('testdata/source.png', cv2... | [
[
"numpy.abs"
]
] |
luphord/monte-carlo-contracts | [
"e7723e6304bb5df6f5f2b18225be8feeb09f60e6"
] | [
"tests/test_mcc.py"
] | [
"import unittest\n\nimport numpy as np\nfrom pandas.testing import assert_frame_equal\nfrom dataclasses import dataclass\nfrom typing import Callable\nfrom mcc import (\n parser,\n IndexedCashflows,\n DateIndex,\n Model,\n TermStructuresModel,\n ObservableBool,\n KonstFloat,\n LinearRate,\n ... | [
[
"numpy.ones",
"numpy.isclose",
"numpy.int_",
"numpy.int64",
"numpy.random.RandomState",
"numpy.datetime64",
"numpy.isnat",
"numpy.float64",
"numpy.allclose",
"numpy.linspace",
"numpy.int8",
"numpy.sqrt",
"numpy.float_",
"numpy.zeros",
"numpy.float32",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.