repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
luiarthur/CytofRepFAM.jl | [
"1f997d1620d74861c5bde5559ebdd1e6c449b9e7"
] | [
"runs/patients/runs/cluster-viz/plot_fam_tsne.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport seaborn as sns\nimport os\n\nos.makedirs('img', exist_ok=True)\n\nfor phi in (0, 1, 100, 10000): # (0, 1, 25, 50, 100, 1000)\n path_to_fam = 'img/fam-phi{}-clusterings.csv'.format(phi)\n fam_orig = np.loadtxt(path_to_fam).astyp... | [
[
"pandas.DataFrame",
"numpy.loadtxt",
"matplotlib.pyplot.close",
"numpy.unique"
]
] |
lonestar686/diluvian | [
"b206c65fff457d4014c8ca76aeb954569bf28916"
] | [
"diluvian/diluvian.py"
] | [
"# -*- coding: utf-8 -*-\n\n\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom collections import deque\nimport itertools\nimport logging\nfrom multiprocessing import (\n Manager,\n Process,\n )\nimport os\nimport random\n\nimport numpy as np\nimport pytoml as toml... | [
[
"numpy.logical_not",
"numpy.count_nonzero",
"numpy.array",
"numpy.zeros_like",
"numpy.asarray",
"numpy.isin",
"numpy.zeros",
"numpy.array_equal",
"numpy.exp2",
"numpy.array_str",
"numpy.logical_and",
"numpy.flipud",
"numpy.any",
"numpy.all",
"numpy.sqrt"... |
AnhTran01/PPOPT | [
"4f62ee5363100766a7524ca6bbe03ddd64b32b8d"
] | [
"tests/other_tests/test_general_utils.py"
] | [
"import numpy\nfrom src.ppopt.utils.general_utils import make_column, make_row, select_not_in_list, remove_size_zero_matrices\n\n\ndef test_make_column_1():\n test_case = make_column([1, 1, 1, 1])\n correct_result = numpy.array([[1], [1], [1], [1]])\n\n assert numpy.allclose(correct_result, test_case)\n ... | [
[
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.eye",
"numpy.allclose"
]
] |
xiaocn/ImageClassifer | [
"3075150aa7ef547333729dcff5876147682c6694"
] | [
"src/nets/nasnet/pnasnet.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport copy\nimport tensorflow as tf\n\nfrom nets.nasnet import nasnet\nfrom nets.nasnet import nasnet_utils\n\narg_scope = tf.contrib.framework.arg_scope\nslim = tf.contrib.slim\n\n\ndef large_imagene... | [
[
"tensorflow.nn.relu",
"tensorflow.test.is_gpu_available",
"tensorflow.logging.info",
"tensorflow.transpose",
"tensorflow.variable_scope",
"tensorflow.nn.softmax",
"tensorflow.contrib.training.HParams"
]
] |
etijskens/ET-rng | [
"2e987bd088dd8bc1680b91412ea431b400a3e7d6"
] | [
"perf/rng.py"
] | [
"import et_rng\nf90 = et_rng.frng.f90\nfrom et_stopwatch import Stopwatch\nimport numpy as np\nimport pprint\n\"\"\"\nhere is the output on my mac:\nNote that the Numpy version is returning an array of random numbers, whereas the Python and fortran\nversions just create random numbers and store them in always the s... | [
[
"numpy.random.randint"
]
] |
KatharineShapcott/syncopy | [
"7b24eda65cf752e395538db5260cd3075029081f"
] | [
"syncopy/specest/mtmfft.py"
] | [
"# -*- coding: utf-8 -*-\n# \n# Spectral estimation with (multi-)tapered FFT\n# \n\n# Builtin/3rd party package imports\nimport numpy as np\nimport scipy.signal.windows as spwin\n\n# Local imports\nfrom syncopy.shared.computational_routine import ComputationalRoutine\nfrom syncopy.datatype import padding\nimport sy... | [
[
"numpy.full",
"numpy.array",
"numpy.fft.rfft",
"numpy.tile",
"numpy.linspace",
"numpy.floor"
]
] |
jbohnslav/BigGAN-PyTorch | [
"489a058ed8930966e180fe9379bc9b8e6b083785"
] | [
"datasets.py"
] | [
"''' Datasets\r\n This file contains definitions for our CIFAR, ImageFolder, and HDF5 datasets\r\n'''\r\nimport os\r\nimport os.path\r\nimport sys\r\nfrom PIL import Image\r\nimport numpy as np\r\nfrom tqdm import tqdm, trange\r\n\r\nimport torchvision.datasets as dset\r\nimport torchvision.transforms as transfo... | [
[
"numpy.concatenate",
"numpy.delete",
"numpy.asarray",
"numpy.random.seed",
"numpy.load",
"numpy.shape",
"torch.from_numpy",
"numpy.savez_compressed"
]
] |
dgorelik/differential-privacy-library | [
"5a7a267c591320036615a52dfad1918dc3718e62",
"5a7a267c591320036615a52dfad1918dc3718e62"
] | [
"diffprivlib/mechanisms/binary.py",
"tests/tools/test_mean.py"
] | [
"# MIT License\n#\n# Copyright (C) IBM Corporation 2019\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\n# rights to use, copy, ... | [
[
"numpy.random.random",
"numpy.exp"
],
[
"numpy.random.random",
"numpy.array",
"numpy.mean"
]
] |
cmelani/timecop-1 | [
"108802c685b2b5d2df0cb576fa1b124386b8658d"
] | [
"engines/helpers.py"
] | [
"from keras.models import Sequential\nfrom keras.layers.recurrent import LSTM\nfrom keras.layers.core import Dense, Activation, Dropout\nimport pandas as pd\nimport numpy as np\nfrom sklearn.metrics import mean_squared_error,mean_absolute_error\nimport statsmodels.api as sm\n\ndef trendline(data, order=1):\n\n c... | [
[
"numpy.array",
"sklearn.metrics.mean_squared_error",
"pandas.DataFrame",
"sklearn.metrics.mean_absolute_error",
"numpy.abs"
]
] |
JacobHanouna/agents | [
"94647342e48abe8915bade94ab6251152631ac29",
"e906d512d86ca2358d13bc8fc2b2440141b8794c"
] | [
"tf_agents/agents/behavioral_cloning/behavioral_cloning_agent_test.py",
"tf_agents/environments/gym_wrapper_test.py"
] | [
"# coding=utf-8\n# Copyright 2018 The TF-Agents 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 b... | [
[
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.cast",
"tensorflow.nest.map_structure",
"tensorflow.constant",
"tensorflow.executing_eagerly",
"tensorflow.nest.flatten",
"tensorflow.squeeze",
"tensorflow.compat.v1.ini... |
rahulbordoloi/Rare-One-Hot-Enocder | [
"53c64a4e39ab7e179f7967037298fc251083a320"
] | [
"Test/Package_Test.py"
] | [
"# Import Package\nimport pandas as pd\nimport RLOHE as r # Rare Label One-Hot Encoder\nimport warnings\n\n# Other Settings\nwarnings.filterwarnings('ignore')\npd.options.display.float_format = '{:.6f}'.format\npd.set_option('display.max_columns', 256)\n\n\n# Main Method\nif __name__ == '__main__':\n\n ... | [
[
"pandas.read_csv",
"pandas.set_option"
]
] |
ejlouw/veroku | [
"27de540846d33ab21c931cfd3f87ef6fbb88620e"
] | [
"veroku/factors/experimental/nonlinear_gaussian.py"
] | [
"\"\"\"\nA module for instantiating and performing operations on Non-linear Gaussian functions.\n\"\"\"\n\n# Standard imports\nimport operator\nimport copy\n\n# Third-party imports\nimport numpy as np\n\n# Local imports\nfrom veroku.factors import _factor_utils\nfrom veroku.factors._sigma_points import get_sigma_po... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.tile"
]
] |
OmarJabri7/RoboCupChallenge | [
"f115d4b376887726e1dac5852c818da72b6acf54"
] | [
"robocup_ws/src/Planner/src/striker_controller.py"
] | [
"from game_interfaces.msg import PlayerCommand\nimport numpy as np\nfrom BasicCommonActions.go_to_action import simple_go_to_action, go_to_fast\nfrom game_interfaces.msg import Position\nfrom BasicCommonActions.plan_supporting_functions import TeamMasterSupporting\n\n\nclass Team1Striker:\n def __init__(self, in... | [
[
"numpy.sign",
"numpy.hypot",
"numpy.argsort"
]
] |
KyraKerz/phyre | [
"cec6c9be22f96fef6793fba079935b2071735ac5"
] | [
"agents/random_agents.py"
] | [
"import random\n\nimport numpy as np\nimport phyre\nfrom tqdm import tqdm_notebook\n\nimport animations\n\nrandom.seed(0)\n\n# Evaluation Setup\neval_setup = 'ball_cross_template'\nfold_id = 0 # For simplicity, we will just use one fold for evaluation.\ntrain_tasks, dev_tasks, test_tasks = phyre.get_fold(eval_setu... | [
[
"numpy.asarray",
"numpy.save"
]
] |
mariafabiano/childrens_asr_transfer_learning | [
"901e0a9e9cf4412655452b490c47f32d60484a84"
] | [
"wav2vec2_data.py"
] | [
"from collections import defaultdict\nimport glob\nimport os\nimport re\nimport numpy as np\n\nimport librosa\nfrom torch.utils.data import Dataset\n\nclass MySTDataset(Dataset):\n \"\"\"MyST dataset.\"\"\"\n\n def __init__(self, data_path, sample_rate=16000,\n\t\t chars_to_ignore_regex='[\\,\\?\\... | [
[
"numpy.array"
]
] |
chrisvalx/scipy | [
"41f812e6aafd9b5698c56ef17d175da223bd6b76"
] | [
"scipy/spatial/tests/test_distance.py"
] | [
"#\n# Author: Damian Eads\n# Date: April 17, 2008\n#\n# Copyright (C) 2008 Damian Eads\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# 1. Redistributions of source code must retain the above copyright\n#... | [
[
"numpy.testing.assert_allclose",
"numpy.dot",
"numpy.random.rand",
"numpy.testing.suppress_warnings",
"numpy.finfo",
"numpy.int_",
"scipy.spatial.distance.wminkowski",
"numpy.issubdtype",
"numpy.full_like",
"numpy.linalg.norm",
"scipy.spatial.distance.is_valid_y",
"... |
alisure-fork/PoolNet | [
"b951056a7bcfb1f80024da9df5145289205e3391"
] | [
"main_my3_bs1_Res50.py"
] | [
"import os\nimport cv2\nimport math\nimport time\nimport torch\nimport random\nimport numbers\nimport numpy as np\nfrom torch import nn\nfrom PIL import Image\nimport scipy.misc as sm\nfrom torch.nn import init\nfrom torch.optim import Adam\nfrom torch.utils import data\nfrom torch.backends import cudnn\nfrom torch... | [
[
"torch.cat",
"torch.nn.BatchNorm2d",
"numpy.mean",
"torch.load",
"torch.sigmoid",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"numpy.random.randint",
"torch.utils.data.DataLoader",
"torch.Tensor",
"torch.nn.functional.binary_cross_entropy_with_logits",
"numpy.array"... |
fabianp/scipy-lecture-notes | [
"716752791585c5d127b4fc524ed732de8c928fdc"
] | [
"pyplots/image_spectral_clustering.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom scikits.learn.feature_extraction import image\nfrom scikits.learn.cluster import spectral_clustering\n\n################################################################################\nl = 100\nx, y = np.indices((l, l))\n\ncenter1 = (28, 24)\ncenter2 = (... | [
[
"numpy.ones",
"numpy.random.randn",
"matplotlib.pyplot.figure",
"numpy.indices",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot"
]
] |
llayer/cmsopen | [
"876e35eb4dfdf727ae91be5c2db29fc087325db7"
] | [
"inferno/training/train.py"
] | [
"from pytorch_inferno.inferno import *\nfrom pytorch_inferno.callback import *\nfrom pytorch_inferno.model_wrapper import *\nfrom pytorch_inferno.data import *\nfrom fastcore.all import partialler\nfrom torch import optim, autograd, nn, Tensor\nimport pandas as pd\nimport numpy as np\n\nimport training.hep_model as... | [
[
"torch.nn.Linear",
"numpy.histogram",
"torch.nn.Sigmoid",
"pandas.DataFrame",
"torch.nn.ReLU",
"numpy.argsort",
"torch.nn.BCELoss"
]
] |
jcbird/ppv | [
"d550f4fff9cb0309d43b0d51e1406355ee0231be"
] | [
"src/ppv/groups.py"
] | [
"from . import ppv\nfrom . import plate\nimport numpy as np\nfrom astropy import units as u\nfrom astropy.coordinates import SkyCoord\nfrom astropy.time import Time\nfrom astropy.table import vstack, Column\nfrom copy import copy\n\n\ndef available_plateruns():\n return ppv.available_plateruns()\n\n\ndef indx_in... | [
[
"numpy.where",
"numpy.array",
"numpy.unique",
"numpy.in1d"
]
] |
burhanmudassar/smallObject | [
"55b6022eeeb8b0a34c8bf435505d0969d78a8e26"
] | [
"lib/layers/functions/detection.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.backends.cudnn as cudnn\nfrom torch.autograd import Function\nfrom torch.autograd import Variable\nfrom lib.utils.box_utils import decode,nms\n# from lib.utils.nms.nms_wrapper import nms\nfrom lib.utils.timer import Timer\nfrom lib.nms.gpu_nms import gpu_nms\nfrom ... | [
[
"torch.zeros"
]
] |
caiyancheng/heyhey | [
"7756afdbe27beed2d6ac5a4ed9876fecebd32251"
] | [
"baselines/main.py"
] | [
"import matplotlib.pyplot as plt\nimport torch\nimport numpy as np\nfrom torchvision import models\nfrom torchvision import transforms\nfrom torchvision import models\nfrom PIL import Image\nfrom torch.utils.data import DataLoader\nfrom net.fcn import FCN32,FCN16,FCN8\nfrom net.linknet import LINKNET\nfrom net.segn... | [
[
"matplotlib.pyplot.subplot",
"numpy.array",
"torch.argmax",
"matplotlib.pyplot.savefig",
"torch.no_grad",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"torch.LongTensor",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.imshow",
... |
gargnupur/tools | [
"fc7be06c76a6c85a71221a610409d0c46ddea710"
] | [
"perf_dashboard/regression_alerts/views.py"
] | [
"# Copyright Istio 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 or agreed to i... | [
[
"pandas.read_csv"
]
] |
pjstanle/reV | [
"c22c620749747022a65d2a98a99beef804849ee6"
] | [
"reV/offshore/offshore.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nreV offshore wind analysis module. This module uses the NRWAL library to\nassess offshore losses and LCOE to complement the simple SAM windpower module.\n\nEverything in this module operates on the native wind resource resolution.\n\"\"\"\nimport numpy as np\nimport pandas as pd\ni... | [
[
"numpy.max",
"numpy.isnan",
"numpy.median",
"pandas.DataFrame",
"numpy.mean",
"pandas.read_csv"
]
] |
lrusnac/pandas | [
"a170e977dc8cc270bdcdee904658f9b6e20c8e86"
] | [
"pandas/core/arrays/timedeltas.py"
] | [
"from datetime import timedelta\nfrom typing import List, Optional, Union\n\nimport numpy as np\n\nfrom pandas._libs import lib, tslibs\nfrom pandas._libs.tslibs import (\n BaseOffset,\n NaT,\n NaTType,\n Period,\n Tick,\n Timedelta,\n Timestamp,\n iNaT,\n to_offset,\n)\nfrom pandas._libs... | [
[
"pandas.core.nanops.nansum",
"pandas.core.dtypes.common.is_string_dtype",
"pandas._libs.tslibs.NaT.to_datetime64",
"pandas.core.ops.common.unpack_zerodim_and_defer",
"pandas.core.arrays.datetimelike.validate_inferred_freq",
"pandas._libs.tslibs.Timedelta",
"pandas.core.arrays.datetimel... |
Nikoleta-v3/APIs | [
"1493c9ad1c7d9135aae57ac069674fa97f6a26fc"
] | [
"src/arcas/tools.py"
] | [
"import hashlib\nimport itertools\nfrom xml.etree import ElementTree\n\nimport pandas as pd\nimport requests\n\nimport ratelimit\n\n\nclass APIError(Exception):\n \"\"\"An API Error Exception.\"\"\"\n\n def __init__(self, status):\n self.status = status\n\n def __str__(self):\n return \"APIEr... | [
[
"pandas.concat"
]
] |
jfear/larval_gonad_ovary | [
"b0941dbdd450aae5efd6ff60632e6eec7574ab69"
] | [
"scrnaseq-wf/scripts/raw_by_cluster.py"
] | [
"import pandas as pd\n\nraw = pd.read_parquet(snakemake.input.raw[0])\nclusters = pd.read_parquet(snakemake.input.cluster[0])\nraw_cluster = raw.T.join(clusters).groupby('cluster').sum().T\nraw_cluster.columns = [f'clus{x}' for x in raw_cluster.columns]\nraw_cluster.to_parquet(snakemake.output[0])\n"
] | [
[
"pandas.read_parquet"
]
] |
chendeheng611/pymatting | [
"06689a44e34eabc5edb81c7bd99e1f039796bd15"
] | [
"pymatting/alpha/estimate_alpha_lkm.py"
] | [
"from pymatting.laplacian.lkm_laplacian import lkm_laplacian\nfrom pymatting.util.util import trimap_split\nfrom pymatting.solver.cg import cg\nimport numpy as np\n\n\ndef estimate_alpha_lkm(image, trimap, laplacian_kwargs={}, cg_kwargs={}):\n \"\"\"\n Estimate alpha from an input image and an input trimap us... | [
[
"numpy.clip"
]
] |
bask0/h2m | [
"4505b7958b3bd524b059d9585294f27e8a22fc1e"
] | [
"src/dataprocessing/datasets/ds_swe_monthly.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nPreprocess snow water equivalent dataset.\n\nCRUNCEP/v8/:\nhttp://www.globsnow.info/\n\nIn:\nSpatial: 0.25 deg\nTemporal: daily\n\nOut:\nSpatial: 1 deg\nTemporal: monthly\n\nSteps:\n1) Harmonize\n2) Gapfilling: Fill SWE values with 0 where 24 days of data are missing (SWE\n has... | [
[
"pandas.Timedelta"
]
] |
densmirn/sdc | [
"30e53955a88506a5134d75d843205dbd5d576051"
] | [
"examples/series/series_astype.py"
] | [
"# *****************************************************************************\n# Copyright (c) 2020, Intel Corporation All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# Redistribut... | [
[
"pandas.Series"
]
] |
slamavl/quantarhei | [
"d822bc2db86152c418e330a9152e7866869776f7",
"d822bc2db86152c418e330a9152e7866869776f7"
] | [
"quantarhei/qm/liouvillespace/tdredfieldtensor.py",
"quantarhei/qm/liouvillespace/rates/ratematrix.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy\nimport scipy\n\nfrom .redfieldtensor import RedfieldRelaxationTensor\nfrom ...core.time import TimeDependent\n\nclass TDRedfieldRelaxationTensor(RedfieldRelaxationTensor, TimeDependent):\n \n \n \n def _implementation(self, ham, sbi):\n \"\"\" Reference imp... | [
[
"numpy.dot",
"numpy.zeros",
"scipy.interpolate.UnivariateSpline",
"numpy.linalg.eigh",
"numpy.exp",
"numpy.real",
"numpy.transpose",
"scipy.linalg.inv",
"numpy.imag",
"numpy.linalg.inv"
],
[
"numpy.zeros"
]
] |
pblottiere/openspectra | [
"cae5dddd6cba9722a57e28ecc54525dfbe8584ea"
] | [
"openspectra/openspectra_file.py"
] | [
"# Developed by Joseph M. Conti and Joseph W. Boardman on 1/21/19 6:29 PM.\n# Last modified 1/21/19 6:29 PM\n# Copyright (c) 2019. All rights reserved.\nimport copy\nimport logging\nimport math\nimport re\nfrom abc import ABC, abstractmethod\nfrom math import cos, sin\nfrom pathlib import Path\nfrom typing impor... | [
[
"numpy.float64",
"numpy.array",
"numpy.arange",
"numpy.frombuffer"
]
] |
IanHawke/numerical-methods-course | [
"f402faa23ab5ce6a72a7b3b5bf292d5f3c18c645"
] | [
"exercises/solution_03_07.py"
] | [
"import numpy as np\n\ndef simpson(f, a, b, nstrips):\n '''\n Compute the quadrature of f on [a, b].\n\n Parameters\n ----------\n\n f : function\n The integrand\n a : float\n The start of the domain\n b : float\n The end of the domain\n nstrips : int\n The number... | [
[
"numpy.linspace"
]
] |
ponll/machine_learning_hello_world | [
"7c16ae4f37dab3e4e0495804943d760e9dfa0907"
] | [
"machine_learning_hello_world.py"
] | [
"'''\r\nfor a series of inputs x, there is an output y with the relationship y=f(x). Machine learning attempts to build a data model based \r\non features of the data, this statistical model g(x) is an approximation of f(x). In this case the output is a binary class - did\r\nthe passenger survive or not. The inputs... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"sklearn.ensemble.GradientBoostingClassifier"
]
] |
SeaOfOcean/mlflow | [
"83aabfd00096ed0939fc319bb20719957e573088"
] | [
"mlflow/pyfunc/scoring_server/__init__.py"
] | [
"\"\"\"\nScoring server for python model format.\nThe passed int model is expected to have function:\n predict(pandas.Dataframe) -> pandas.DataFrame\n\nInput, expected intext/csv or application/json format,\nis parsed into pandas.DataFrame and passed to the model.\n\nDefines two endpoints:\n /ping used for hea... | [
[
"pandas.DataFrame",
"pandas.read_json",
"numpy.array",
"pandas.read_csv"
]
] |
jancervenka/airbus-ship-detection | [
"87cb1c786182afa248a324f65b23153aa998e6ae"
] | [
"asdc/tests/test_backend.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# 2020, Jan Cervenka\n\nimport json\nimport numpy as np\nfrom unittest import TestCase, main\nfrom .utils import MockRedis, MockKerasModel\nfrom ..service.constants import REQUEST_BATCH_SIZE, QUEUE_NAME\nfrom ..service.backend import RequestProcessor\n\n\nclass Backe... | [
[
"numpy.testing.assert_array_equal",
"numpy.ones",
"numpy.zeros"
]
] |
rohankumardubey/bayesianpy | [
"a5f69ac6153b010051019e442a27274e5f38eed2"
] | [
"bayesianpy/dask/cross_validation.py"
] | [
"import dask.array as da\nimport numpy as np\nimport numbers\nimport dask.dataframe as dd\nimport bayesianpy.utils.list\n\nclass KFold:\n\n def __init__(self, n_splits):\n if not isinstance(n_splits, numbers.Integral):\n raise ValueError('The number of folds must be of Integral type. '\n ... | [
[
"numpy.ones"
]
] |
maledicente/cursos | [
"00ace48da7e48b04485e4ca97b3ca9ba5f33a283"
] | [
"Data_Science/grafico-bar.py"
] | [
"from matplotlib import pyplot as plt\nmovies = [\"Annie Hall\", \"Ben-Hur\", \"Casablanca\", \"Gandhi\", \"West Side Story\"]\nnum_oscars = [5, 11, 3, 8, 10]\n\n# barras possuem o tamanho padrão de 0.8, então adicionaremos 0.1 às\n# coordenadas à esquerda para que cada barra seja centralizada\nxs = [i + 0.1 for i,... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
paulttt/mAP_3Dvolume | [
"ad54ba1126c3a1d19958be83f5568860c565842e"
] | [
"vol3d_eval_custom.py"
] | [
"import numpy as np\nimport datetime\nimport time\n\nclass VOL3Deval:\n # Interface for evaluating video instance segmentation on the YouTubeVIS dataset.\n #\n # The usage for YTVOSeval is as follows:\n # cocoGt=..., cocoDt=... # load dataset and results\n # E = VOL3Deval(cocoGt,cocoDt); # in... | [
[
"numpy.logical_not",
"numpy.array",
"numpy.savetxt",
"numpy.zeros",
"numpy.searchsorted",
"numpy.ones",
"numpy.tile",
"numpy.mean",
"numpy.where",
"numpy.arange",
"numpy.abs",
"numpy.cumsum",
"numpy.hstack",
"numpy.spacing",
"numpy.isin"
]
] |
zrphercule/glow | [
"3dab5984680e9acc3dd2b96157ff205b1ef46c93"
] | [
"torch_glow/tests/nodes/quantized_conv2d_test.py"
] | [
"from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport unittest\n\nimport torch\nfrom tests import utils\n\n\nclass TestQuantizedConv2d(utils.TorchGlowTestCase):\n @unittest.skip(reason=\"Requires freezing\")\n def test_quantized_conv2d_unpacked(self):\n \"\"\"Bas... | [
[
"torch.zeros",
"torch.cat",
"torch.quantization.convert",
"torch.quantization.QuantStub",
"torch.nn.Sequential",
"torch.quantization.prepare",
"torch.no_grad",
"torch.quantization.DeQuantStub",
"torch.quantization.QuantWrapper",
"torch.nn.Conv2d",
"torch.nn.quantized.De... |
chris4540/DT2119-Final-Project | [
"a9e665d2fcc91442bcd80171fe557b09fcd71d00"
] | [
"scripts/get_train_dataset.py"
] | [
"\"\"\"\nGenerate the training dataset.\n\nThe number of phone should be 48 after using this script.\n\nRead data:\n>>> data = np.load('data/raw/full_traindata.npz')\n>>> data['phone_to_idx'].item() # the mapping\n>>> traindata = data['data'] # training features\n\n\nPrerequisite:\n data/raw/phone_to_idx.json\n... | [
[
"pandas.read_csv",
"numpy.savez",
"numpy.delete",
"numpy.argwhere"
]
] |
kjersbry/pyRiemann | [
"f39734a5547d2c87a9b0585172e75beb0b1d5c71",
"f39734a5547d2c87a9b0585172e75beb0b1d5c71"
] | [
"tests/test_clustering.py",
"tests/test_spatialfilters.py"
] | [
"import numpy as np\nfrom numpy.testing import assert_array_equal\nimport pytest\nfrom pyriemann.clustering import Kmeans, KmeansPerClassTransform, Potato\n\n\ndef generate_cov(Nt, Ne):\n \"\"\"Generate a set of cavariances matrices for test purpose.\"\"\"\n rs = np.random.RandomState(1234)\n diags = 2.0 +... | [
[
"numpy.array",
"numpy.empty",
"numpy.random.RandomState",
"numpy.sum",
"numpy.diag"
],
[
"numpy.array",
"numpy.empty",
"numpy.random.RandomState",
"numpy.sum",
"numpy.testing.assert_array_equal",
"numpy.random.randn",
"numpy.eye",
"numpy.identity",
"nump... |
Jelso13/DancingLinksSudoku | [
"43b12afe514a055e2eb89bdff34002ca84d4531c"
] | [
"solve.py"
] | [
"import numpy as np\nimport sys\nfrom project.Sudoku import Sudoku\n\n\ndef sudoku_solver(sudoku):\n sudoku = np.array(sudoku)\n s = Sudoku()\n solExample, fExample = s.solve(sudoku.astype(int))\n x = s.returnSol(solExample, fExample)\n return x\n\nif __name__ == \"__main__\":\n args = sys.argv[1:... | [
[
"numpy.array"
]
] |
uhecr-project/fancy | [
"c6015b21fd88aecfb7e45f2aec438d5bda0df050"
] | [
"fancy/interfaces/integration.py"
] | [
"from re import T\nfrom scipy import integrate, interpolate\nimport h5py\nfrom tqdm import tqdm as progress_bar\n\nfrom ..detector.exposure import *\n\nfrom multiprocessing import Pool, cpu_count\n\n__all__ = ['ExposureIntegralTable']\n\n\nclass ExposureIntegralTable():\n \"\"\"\n Handles the building and sto... | [
[
"scipy.integrate.dblquad"
]
] |
WENGIF/youmin_textclassifier | [
"15410aaba009019ec387a8e64aec4734ae396922"
] | [
"youmin_textclassifier/models/general.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\" 常规的算法,如lr、bayes等 \"\"\"\n\nimport numpy as np\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.externals import joblib\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.naive_bayes import GaussianNB, MultinomialNB\nfrom sklearn.svm import SVC\n\n\n... | [
[
"sklearn.externals.joblib.load",
"sklearn.externals.joblib.dump",
"numpy.max",
"numpy.argmax"
]
] |
eric8607242/darts | [
"34c79a0956039f56a6a87bfb7f4b1ae2af615bea"
] | [
"cnn/donas_utils/optim.py"
] | [
"import logging \n\nimport torch\nimport torch.nn as nn\n\ndef get_lr_scheduler(optimizer, step_per_epoch, CONFIG):\n if CONFIG.lr_scheduler == \"cosine\":\n lr_scheduler = torch.optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max=step_per_epoch*CONFIG.epochs)\n elif CONFIG.lr_scheduler == \"step\":\... | [
[
"torch.optim.lr_scheduler.StepLR",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.bmm",
"torch.nn.functional.log_softmax",
"torch.tensor",
"torch.mean"
]
] |
ArjunVarma39/Tensorflow-2.0-Computer-Vision-Cookbook | [
"92ea6713f664cff9eccaaccea8ac756f808e2066"
] | [
"ch8/recipe2/unet.py"
] | [
"import cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow_datasets as tfdata\nimport tensorflow_docs as tfdocs\nimport tensorflow_docs.plots\nfrom tensorflow.keras.layers import *\nfrom tensorflow.keras.losses import \\\n SparseCategoricalCrossentropy\nfrom tens... | [
[
"matplotlib.pyplot.savefig",
"tensorflow.argmax",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.close",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"numpy.random.uniform",
"matplotlib.pyplot.style.use",
"tensorflow.keras.optimizers.RMSprop",
"numpy.hstack",
"ten... |
WoodResourcesGroup/EPIC_AllPowerLabs | [
"bf3240672f02fa93243cb2241e9c49249ce710aa"
] | [
"px2db.py"
] | [
"#!/usr/bin/env python\n\nimport pandas as pd\nimport cec_utils as ut\nimport sys\n\nsrc_file = sys.argv[1]\ndbname = sys.argv[2]\nsch = sys.argv[3]\ntblname = sys.argv[4]\n\neng = ut.dbconfig(dbname)\ndata = pd.read_csv(src_file)\ndata.columns = [i.lower() for i in data.columns]\ndata.to_sql(tblname, eng, schema=s... | [
[
"pandas.read_csv"
]
] |
robertbsnook/booking_quote | [
"e6a8a97a82daf53fdf3b5b64450aed035a7eda12"
] | [
"src/booking/Package_booking.py"
] | [
"#!/usr/bin/env python\nimport datetime\nimport pandas as pd\nfrom tabulate import tabulate\n\n\nclass TravelRoute:\n def __init__(self, destination, dangerous, urgency, dimension, weight):\n self.destination = destination\n self.dangerous = dangerous\n self.urgency = urgency\n self.d... | [
[
"pandas.read_csv"
]
] |
katherinelamb/data | [
"cb0cdcd73bc06f13e94b4b02fbd0203cc972560e"
] | [
"scripts/india_plfs/daily_wage_data/preprocess.py"
] | [
"# 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agr... | [
[
"pandas.read_excel",
"pandas.to_numeric"
]
] |
astrojuanlu/d3rlpy | [
"e27852664647b7774f56ec775437b0ca73a24f3f"
] | [
"d3rlpy/algos/torch/dqn_impl.py"
] | [
"import copy\nfrom typing import Optional, Sequence\n\nimport numpy as np\nimport torch\nfrom torch.optim import Optimizer\n\nfrom ...gpu import Device\nfrom ...models.builders import create_discrete_q_function\nfrom ...models.encoders import EncoderFactory\nfrom ...models.optimizers import OptimizerFactory\nfrom .... | [
[
"torch.no_grad"
]
] |
GSxiongkun/pyprobml | [
"a3fe8086844ae0885e3f21d30be5f2e6448cdeba"
] | [
"scripts/cifar_viz_tf.py"
] | [
"# Based on\n# https://github.com/tensorflow/docs/blob/master/site/en/tutorials/keras/basic_classification.ipynb\n# (MIT License)\n\nfrom __future__ import absolute_import, division, print_function\n\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\nfigdir = \"../figures\"\ndef save_fig(fname): plt... | [
[
"numpy.random.seed",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"numpy.shape",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.subplot"
]
] |
kimlindner/TURL | [
"72d3dad8073dfe821551b35d59c02febf71aad3a"
] | [
"run_table_RE_finetuning.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. 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... | [
[
"torch.device",
"torch.distributed.get_world_size",
"torch.cuda.manual_seed_all",
"torch.utils.data.RandomSampler",
"numpy.random.seed",
"torch.distributed.init_process_group",
"torch.no_grad",
"torch.utils.data.SequentialSampler",
"torch.nn.parallel.DistributedDataParallel",
... |
StephenCurry-LH/ecg | [
"f6dffeb108515d7307773112482d4d8f81ba9442",
"f6dffeb108515d7307773112482d4d8f81ba9442"
] | [
"models_test/resnet.py",
"ecg-new/utils/dft.py"
] | [
"# -*- coding: utf-8 -*-\n'''\n@time: 2019/9/8 20:14\n直接修改torch的resnet\n@ author: javis\n'''\n\nimport torch.nn as nn\nimport math\nimport torch.utils.model_zoo as model_zoo\nfrom models_test.modules import *\n\ndef conv3x3(in_planes, out_planes, stride=1):\n \"\"\"3x3 convolution with padding\"\"\"\n return ... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.Conv1d",
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.nn.AdaptiveAvgPool1d",
"torch.nn.BatchNorm1d",
"torch.nn.MaxPool1d",
"torch.randn"
],
[
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.savefig",
"matplotlib... |
sabopSCR/models | [
"97764e1526377bcb7e7f9b6ff847c33ce185753b"
] | [
"research/object_detection/inputs.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.compat.v1.string_to_hash_bucket_fast",
"tensorflow.compat.v1.ones_like",
"tensorflow.compat.v1.equal",
"tensorflow.compat.v1.shape",
"tensorflow.compat.v1.estimator.export.ServingInputReceiver",
"tensorflow.compat.v1.to_float",
"tensorflow.compat.v1.ones",
"tensorflow.c... |
SinisterFour/FinancialOracleServer | [
"54bc7d6845b340c0bcc991f94c53c07292135ed4"
] | [
"app/test_endpoint.py"
] | [
"import requests\nimport json\nimport numpy as np\nfrom sklearn.linear_model import LinearRegression\n\nPROD = \"TODO: SET THIS WHEN AVAILABLE\"\nLOCALHOST = \"http://127.0.0.1:5000\"\n\ndef get_linear_regression_test(environment):\n link = environment + \"/linear_reggression\"\n reader = np.genfromtxt(\"./da... | [
[
"numpy.genfromtxt"
]
] |
oliverphilcox/ChempyMulti | [
"1ab0d0c56a03c4f4b710ee8f0142bcccc7e84e22"
] | [
"Chempy/wrapper.py"
] | [
"import numpy as np \nfrom .weighted_yield import SSP, lifetime_Argast, lifetime_Raiteri\nfrom .imf import IMF\nfrom .yields import SN2_feedback, AGB_feedback, SN1a_feedback, Hypernova_feedback\n\nclass SSP_wrap():\n '''\n This is the wrapper around the SSP function. It preloads the needed classes and calls a... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.empty",
"numpy.zeros",
"numpy.lib.recfunctions.append_fields",
"numpy.copy",
"numpy.load",
"numpy.save",
"numpy.mean",
"numpy.std",
"numpy.where",
"numpy.unique",
"numpy.isfinite",
"numpy.abs",
"numpy.hstack",... |
yellowzp/algorithm_model_learning | [
"4c8c2e29f4724fe565e73bb243709d7c302178c9"
] | [
"sklearn/util.py"
] | [
"#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport matplotlib.pyplot as plt\n\n\nclass Util(object):\n \"\"\"\n utility tools\n \"\"\"\n\n @classmethod\n def plot(cls, points, lines, title=\"test\", x_label=\"X\", y_label=\"Y\", save_path=\"\"):\n \"\"\"\n 绘制二维坐标图\n :para... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.scatter"
]
] |
vlouf/cpol_processing | [
"097994422c46773754e04a3d4911b81c01673fa5"
] | [
"cpol_processing/production.py"
] | [
"\"\"\"\nCPOL Level 1b main production line. These are the drivers function.\n\n@title: production\n@author: Valentin Louf\n@email: valentin.louf@bom.gov.au\n@copyright: Valentin Louf (2017-2021)\n@institution: Bureau of Meteorology and Monash University\n@date: 30/03/2021\n\n.. autosummary::\n :toctree: generat... | [
[
"numpy.zeros_like",
"numpy.ones_like"
]
] |
mirand863/hiclass | [
"49a4bcded7e0a50621f2efa79145dd2d60a87332"
] | [
"tests/test_BinaryPolicy.py"
] | [
"from pathlib import Path\nfrom scipy.sparse import csr_matrix\nimport networkx as nx\nimport numpy as np\nimport pytest\nfrom numpy.testing import assert_array_equal\n\nfrom hiclass.BinaryPolicy import (\n BinaryPolicy,\n ExclusivePolicy,\n LessExclusivePolicy,\n ExclusiveSiblingsPolicy,\n Inclusive... | [
[
"numpy.array",
"scipy.sparse.csr_matrix",
"numpy.testing.assert_array_equal"
]
] |
sergeLabo/depthai_blazepose_labo | [
"c9d6808c1e0b406c541e012df28ac7cd7ebfa422"
] | [
"ge_osc.py"
] | [
"\n# Echap pour finir proprement le script\n# Espace pour bascule, plein écran / normal\n\n\nimport os\nfrom time import time, sleep\nfrom threading import Thread\n\nimport cv2\nimport numpy as np\n\nfrom oscpy.server import OSCThreadServer\n\nfrom pynput.mouse import Button, Controller\n\nfrom filtre import moving... | [
[
"numpy.array"
]
] |
sousouhou/BA-ScaleFreeNetwork | [
"1c22f05b414dd57fdd1a70d738069a96fa69f6aa"
] | [
"BA-ScaleFreeNetwork.py"
] | [
"# barabasi albert model algorithm to generate a scale free network.\r\n# Refer to https://en.wikipedia.org/wiki/Barab%C3%A1si%E2%80%93Albert_model\r\n\r\nimport numpy as np\r\nimport random\r\n\r\n# Generated graph is bidirectional, edges are in pairs a->b and b->a\r\n# Every node is not self-linked.\r\ndef BA_SFN... | [
[
"numpy.sum",
"numpy.zeros"
]
] |
tatuanb/monai_V1 | [
"ff9bbfa82763de46cbac75553e340633e3d84ecb",
"ff9bbfa82763de46cbac75553e340633e3d84ecb"
] | [
"tests/test_dataloader.py",
"tests/test_handler_hausdorff_distance.py"
] | [
"# Copyright 2020 - 2021 MONAI Consortium\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agre... | [
[
"torch.as_tensor",
"numpy.asarray"
],
[
"torch.zeros_like",
"torch.tensor",
"numpy.zeros",
"torch.ones"
]
] |
Acornagain/lux | [
"161b6c3dbeccb23ff7eb0e6f12b7c59691ee8df9"
] | [
"lux/executor/PandasExecutor.py"
] | [
"# Copyright 2019-2020 The Lux Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl... | [
[
"pandas.to_datetime",
"numpy.histogram",
"pandas.reset_option",
"numpy.array",
"pandas.cut",
"pandas.DataFrame",
"pandas.api.types.is_datetime64_any_dtype",
"pandas.api.types.is_float_dtype",
"pandas.option_context",
"pandas.api.types.is_string_dtype",
"pandas.api.types... |
shubaoyu/CRSLab | [
"a05730e8b2c03df278587be34923fa818945d4c4"
] | [
"crslab/model/crs/tgredial/tg_policy.py"
] | [
"# @Time : 2020/12/9\n# @Author : Yuanhang Zhou\n# @Email : sdzyh002@gmail.com\n\n# UPDATE:\n# @Time : 2021/1/7, 2020/12/15, 2021/1/4\n# @Author : Xiaolei Wang, Yuanhang Zhou, Yuanhang Zhou\n# @Email : wxl1999@foxmail.com, sdzyh002@gmail, sdzyh002@gmail.com\n\nr\"\"\"\nTGReDial_Policy\n===============\nRefere... | [
[
"torch.nn.Linear",
"torch.mean",
"torch.cat",
"torch.nn.CrossEntropyLoss"
]
] |
kentakuramochi/deep_learning_from_scratch | [
"8b78369f6da316a6c14c16f729c658d959454b0e"
] | [
"chap5/gradient_check.py"
] | [
"# !usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport sys, os\nsys.path.append(os.pardir)\nimport numpy as np\nfrom dataset.mnist import load_mnist\nfrom two_layer_net import TwoLayerNet\n\n(x_train, t_train), (x_test, t_text) = \\\n load_mnist(normalize=True, one_hot_label=True)\n\nnetwork = TwoLayerNet(inp... | [
[
"numpy.abs"
]
] |
google/seqio | [
"ef7e20b18a0aa071f329bf2b9310ed0fad3dc7a2"
] | [
"seqio/dataset_providers.py"
] | [
"# Copyright 2021 The SeqIO 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 or ... | [
[
"tensorflow.compat.v2.io.gfile.glob",
"numpy.array",
"tensorflow.compat.v2.data.TFRecordDataset",
"tensorflow.compat.v2.data.TextLineDataset",
"tensorflow.compat.v2.cast",
"tensorflow.compat.v2.io.parse_single_example",
"tensorflow.compat.v2.io.gfile.exists",
"tensorflow.compat.v2.... |
BZ-2453/DeepBass | [
"a0f4ab8613994a8cfcf732fa2b2b2840313264d4"
] | [
"src/model/nsynth/utils.py"
] | [
"# Copyright 2017 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 appli... | [
[
"tensorflow.nn.in_top_k",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"numpy.random.rand",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.MomentumOptimizer",
"numpy.sign",
"tensorflow.clip_by_value",
"numpy.cos",
"tensorflow.to_float",
"tensorflow.tile",
... |
GUZHIXIANG/DAA_taguchi | [
"5c77f0a326b53e0cc908cf08714fd470870877ec"
] | [
"HDP_HSMM/basic/distributions.py"
] | [
"from __future__ import division\nimport numpy as np\nnp.seterr(divide='ignore')\nfrom numpy import newaxis as na\nfrom numpy.core.umath_tests import inner1d\nimport scipy.stats as stats\nimport scipy.special as special\nimport scipy.linalg\nimport matplotlib.pyplot as plt\nimport copy\nfrom abstractions import Gib... | [
[
"numpy.dot",
"numpy.core.umath_tests.inner1d",
"numpy.random.chisquare",
"numpy.linalg.qr",
"numpy.outer",
"numpy.concatenate",
"numpy.random.normal",
"numpy.empty",
"numpy.nan_to_num",
"numpy.log",
"numpy.random.poisson",
"numpy.seterr",
"numpy.eye",
"numpy... |
Lelin-HUNUST/VISTA | [
"7bf34132d719cb0e5e803b92cd15451df58a9a5d",
"7bf34132d719cb0e5e803b92cd15451df58a9a5d"
] | [
"det3d/models/backbones/scn.py",
"det3d/datasets/utils/eval.py"
] | [
"import time\n\nimport numpy as np\nimport spconv.pytorch as spconv \nfrom spconv.pytorch import ops\nfrom spconv.pytorch import SparseConv3d, SubMConv3d\nimport torch\nfrom det3d.models.utils import Empty, change_default_args\nfrom det3d.torchie.cnn import constant_init, kaiming_init\nfrom det3d.torchie.trainer im... | [
[
"torch.nn.ReLU",
"numpy.array"
],
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.stack",
"numpy.cos"
]
] |
apaszke/jax | [
"a3997ba98c67f96ac1b44fa3e6f2420ea4ccacdd"
] | [
"jax/interpreters/xla.py"
] | [
"# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.take",
"numpy.get_printoptions",
"numpy.dtype",
"numpy.array2string"
]
] |
multinucliated/ARC | [
"7c545605eb25ba3d76c2ba12b23b26d548a31373"
] | [
"src/manual_solve.py"
] | [
"#!/usr/bin/python\n\nimport json\nimport os\nimport re\n\nimport numpy as np\n\n\n### YOUR CODE HERE: write at least three functions which solve\n### specific tasks by transforming the input x and returning the\n### result. Name them according to the task ID as in the three\n### examples below. Delete the three ex... | [
[
"numpy.all",
"numpy.array"
]
] |
kpaxiotis/3DWaveletVivadoHLS | [
"bcc33f49be9d58db401aac224aba573bc0bda802"
] | [
"c_files/power_read.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\nprj = [2, 5, 8, 12, 14]\nnum_of_prj = 4\nsol_list = []\npower = []\n\n# for i in range(1, num_of_prj):\nfor i in prj:\n\n directory = \"C:/thesisRepo/c_files/dwt_prj\" + str(i) + \"/solution1/project1/project1.runs/impl_1/design_1_wrapper_power_routed.rpt\"... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.bar"
]
] |
shifty21/neural-numpy | [
"85c97f19c830f82b92b43986bdc2efcb6e114076"
] | [
"src/utils/fixed_point.py"
] | [
"import numpy as np\nfrom rig.type_casts import NumpyFixToFloatConverter, NumpyFloatToFixConverter\n\n\nclass FixedPoint:\n def __init__(self):\n # self.float_to_fixed = NumpyFloatToFixConverter(signed=True, n_bits=8, n_frac=4)\n self.float_to_fixed = NumpyFloatToFixConverter(\n signed=T... | [
[
"numpy.right_shift"
]
] |
siavash-khodadadeh/MetaLearning-TF2.0 | [
"de852bd3b2ff46f8d390cebf561add3a166ee855",
"de852bd3b2ff46f8d390cebf561add3a166ee855"
] | [
"models/lasiumprotonetsvae/protonets_vae_mini_imagenet.py",
"models/sml/sml_celeba_cactus.py"
] | [
"import tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\n\nfrom databases import MiniImagenetDatabase\n\nfrom models.lasiumprotonetsvae.database_parsers import MiniImagenetParser\nfrom models.lasiumprotonetsvae.protonets_vae import ProtoNetsVAE\nfrom models.lasiumprotonetsvae.vae... | [
[
"tensorflow.keras.activations.relu",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.MaxPool2D",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.Model",
"tensorflow.keras.layers.Conv2DTranspose",
... |
gfardell/TomoPhantom | [
"454876a9383dbe031a4449631a7a7914e3bc9f43"
] | [
"Demos/Python/2D/Model2D_t.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nGPLv3 license (ASTRA toolbox)\nNote that the TomoPhantom package is released under Apache License, Version 2.0\n\nScript to generate temporal (2D + time) analytical phantoms and their sinograms\nIf one needs to modify/add phantoms, please edit Phantom2DLibr... | [
[
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.title",
"matplotlib.pyplot.close",
"numpy.shape",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.pause",
"numpy.sqrt",
"numpy.linspace",
"matplotlib.pyplot.imshow"
]
] |
sdcubber/kaggle_carvana | [
"44f6c7f1e80be2caa3c7ad4c7fb69067af45fe8f"
] | [
"src/main.py"
] | [
"from data.config import *\n# custom modules\nimport time\nimport models.models as mo\nimport models.model_utils as mu\nimport processing.processing_utils as pu\nimport processing.augmentation as pa\nfrom data.data_utils import CarvanaDataset\n\nfrom torch.utils.data import DataLoader\nimport torchvision.transforms... | [
[
"torch.utils.data.DataLoader"
]
] |
cphatak/SLADS-Net | [
"025b1bc3fbfd8018dc50ad1b95c3459e8c8d5d1f"
] | [
"code/computeFeatures.py"
] | [
"#! /usr/bin/env python3\nimport numpy as np\nimport numpy.matlib as matlib\nfrom computeDifference import computeDifference\n\n\ndef computeFeatures(MeasuredValues,MeasuredIdxs,UnMeasuredIdxs,SizeImage,NeighborValues,NeighborWeights,NeighborDistances,TrainingInfo,ReconValues,ReconImage,Resolution,ImageType):\n ... | [
[
"sklearn.kernel_approximation.RBFSampler",
"numpy.sum",
"numpy.shape",
"numpy.power",
"numpy.sqrt",
"numpy.gradient"
]
] |
bahleg/pt.darts | [
"44c7d46b74dc99cbe9fd535af7179988f77b1b9c"
] | [
"models/cnn_var_naive/search_cells.py"
] | [
"\"\"\" CNN cell for architecture search \"\"\"\nimport torch\nimport torch.nn as nn\nimport models.cnn_var_naive.ops as ops\n\n\nclass SearchCell(nn.Module):\n \"\"\" Cell for search\n Each edge is mixed and continuous relaxed.\n \"\"\"\n def __init__(self, n_nodes, C_pp, C_p, C, reduction_p, reductio... | [
[
"torch.cat",
"torch.nn.ModuleList"
]
] |
guangxingli/python-neo | [
"88b58a43e50bef3788e42504f47e507d169c5802"
] | [
"neo/test/coretest/test_base.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nTests of the neo.core.baseneo.BaseNeo class and related functions\n\"\"\"\n\nfrom datetime import datetime, date, time, timedelta\nfrom decimal import Decimal\nfrom fractions import Fraction\nimport sys\n\ntry:\n import unittest2 as unittest\nexcept ImportError:\n import unit... | [
[
"numpy.array"
]
] |
malihass/PelePhysics | [
"1215a6b65818ddfe9705af07f5774d74c4fe949a"
] | [
"Support/Fuego/Pythia/pythia-0.5/packages/fuego/fuego/serialization/f/FPickler.py"
] | [
"#!/usr/bin/env python\n#\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n#\n# Michael A.G. Aivazis\n# California Institute of Technology\n# (C) 1998-2003 All Rights Reserved\n#\n# <LicenseText>\n#\n# ... | [
[
"numpy.log",
"numpy.sqrt",
"numpy.polyfit",
"numpy.zeros"
]
] |
benodry/tensorpack-medical | [
"c9d4006262ab16dc04980215778a740343ea5dcd"
] | [
"examples/AutomaticViewPlanning/DQN/sampleTrain.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# File: sampleTrain.py\n# Author: Amir Alansary <amiralansary@gmail.com>\n\n\n\nimport warnings\nwarnings.simplefilter(\"ignore\", category=ResourceWarning)\n\n\n\nimport numpy as np\nimport SimpleITK as sitk\nfrom tensorpack import logger\nfrom IPython.core.debugger... | [
[
"numpy.array",
"numpy.asarray",
"numpy.percentile",
"numpy.shape",
"numpy.arange"
]
] |
dilayercelik/OOP | [
"c57aaa0acc38bafc6d9fd69a10926c62612e722d"
] | [
"Udacity_AI_Python/Gaussian Class/answer.py"
] | [
"import math\nimport matplotlib.pyplot as plt\n\nclass Gaussian():\n \"\"\" Gaussian distribution class for calculating and \n visualizing a Gaussian distribution.\n \n Attributes:\n mean (float) representing the mean value of the distribution\n stdev (float) representing the standard devi... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
shahad-mahmud/asr_tf | [
"130124ccaf23fabe3e7a6f138d9403a7c0946ef3"
] | [
"tensorflow_asr/losses/rnnt_loss.py"
] | [
"# Copyright 2020 Huy Le Nguyen (@usimarit) and M. Yusuf Sarıgöz (@monatis)\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n... | [
[
"tensorflow.exp",
"tensorflow.ones",
"tensorflow.reshape",
"tensorflow.scatter_nd",
"tensorflow.reverse",
"tensorflow.zeros_like",
"tensorflow.python.ops.gen_array_ops.matrix_diag_part_v2",
"tensorflow.stack",
"tensorflow.tile",
"tensorflow.one_hot",
"tensorflow.cast",
... |
Wetterprophet/fingerspelling-gesture-glove | [
"7652c5025526f56273c4287b4b77b830a4979d0b"
] | [
"arduino_python/computeCentroid.py"
] | [
"import numpy as np\nimport arduino_python.measureData as mD\nimport arduino_python.DBA_multivariate as DBA\nfrom scipy import stats\nimport matplotlib.pyplot as plt\n\n\n\ndef main(file_name, pins, smoothing):\n\n \"\"\"\n Returns dictionary of centroids of training data by class labels\n Using multivaria... | [
[
"scipy.stats.zscore",
"numpy.array",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.std",
"matplotlib.pyplot.show",
"numpy.around",
"numpy.unique"
]
] |
spragunr/echolocation | [
"f78bd53afc3ff965f38f871fe3463da3a2820a35"
] | [
"view.py"
] | [
"import h5py\nimport sys\nimport matplotlib.pyplot as plt\nfrom scipy import signal\nimport numpy as np\n\ndata = h5py.File(sys.argv[1], 'r')\ni = 0\nwhile True:\n entered = input(\"which? (enter for next)\")\n if entered == \"\":\n i += 1\n else:\n i = entered\n rows = 5\n for row in r... | [
[
"matplotlib.pyplot.subplot",
"scipy.signal.spectrogram",
"numpy.log",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow"
]
] |
c-abird/meshio | [
"21301c3c5df3b196c60bea0cf71f27736f9a337e"
] | [
"meshio/h5m/_h5m.py"
] | [
"\"\"\"\nI/O for h5m, cf.\n<https://www.mcs.anl.gov/~fathom/moab-docs/html/h5mmain.html>.\n\"\"\"\nimport logging\nfrom datetime import datetime\n\nimport numpy\n\nfrom .. import __about__\nfrom .._helpers import register\nfrom .._mesh import CellBlock, Mesh\n\n# def _int_to_bool_list(num):\n# # From <https://s... | [
[
"numpy.dtype"
]
] |
MicahChambers/autodet | [
"9fea777f50b16f46d1eea0e5bbd5a7e983f3300a"
] | [
"autodet/Decoder.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\n\nfrom autodet.Residual import Residual\n\n\nclass Decoder(nn.Module):\n def __init__(self, ichannels, ochannels):\n super(Decoder, self).__init__()\n self.layer1 = Residual(ichannels=ichannels, ochannels=20, kradius=1)\n self.layer2 =... | [
[
"torch.nn.functional.sigmoid",
"torch.nn.functional.softsign"
]
] |
Abrahamon/TransTrack | [
"d339429125c076192b6512ef85270bb373204e9e"
] | [
"models/reid/deformable_detrtrack_train.py"
] | [
"# Modified by Peize Sun, Rufeng Zhang\n# ------------------------------------------------------------------------\n# Deformable DETR\n# Copyright (c) 2020 SenseTime. All Rights Reserved.\n# Licensed under the Apache License, Version 2.0 [see LICENSE for details]\n# -------------------------------------------------... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.stack",
"torch.nn.ModuleList",
"torch.ones",
"torch.nn.CrossEntropyLoss",
"torch.nn.init.constant_",
"torch.tensor",
"torch.zeros_like",
"torch.zeros",
"torch.device",
"torch.nn.functional.l1_loss",
"torch.nn.GroupNorm",
... |
JeremyZhao1998/PaddleNLP | [
"5a34684a7f0c8a186043fed386be4b62cb85fb15"
] | [
"paddlenlp/ops/faster_transformer/sample/decoding_sample.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.random.seed"
]
] |
bluetiger9/Vitis-AI | [
"f61061eef7550d98bf02a171604c9a9f283a7c47"
] | [
"tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/quantization/keras/vitis/vitis_quantize.py"
] | [
"# Copyright 2019 Xilinx 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 ... | [
[
"tensorflow.keras.utils.custom_object_scope",
"tensorflow.get_logger"
]
] |
quecloud/rpxdock | [
"41f7f98f5dacf24fc95897910263a0bec2209e59"
] | [
"rpxdock/homog.py"
] | [
"import numpy as np, itertools as it, functools as ft\n\ndef is_valid_quat_rot(quat):\n assert quat.shape[-1] == 4\n return np.isclose(1, np.linalg.norm(quat, axis=-1))\n\ndef quat_to_upper_half(quat):\n ineg0 = (quat[..., 0] < 0)\n ineg1 = (quat[..., 0] == 0) * (quat[..., 1] < 0)\n ineg2 = (quat[..., 0] ... | [
[
"numpy.random.rand",
"numpy.minimum",
"numpy.tan",
"numpy.cos",
"numpy.zeros_like",
"numpy.sin",
"numpy.empty",
"numpy.linalg.norm",
"numpy.arcsin",
"numpy.prod",
"numpy.argmax",
"numpy.sqrt",
"numpy.around",
"numpy.cross",
"numpy.linalg.inv",
"numpy... |
xairc/lung_nodule_detector | [
"4e77015680b3bbc89f80f4833bbc93b9fc3e9870"
] | [
"make_FROC_submit_native.py"
] | [
"import numpy as np\nimport sys\n\nsys.path.append('../')\n\nfrom training.layers import nms, iou, acc\nimport time\nimport multiprocessing as mp\nimport math\nimport SimpleITK as sitk\nimport os\nfrom config_training import config\nimport pandas\nimport csv\nimport io\n\nsave_dir = 'results/res18_split_focal/bbox/... | [
[
"numpy.array",
"numpy.round",
"pandas.DataFrame",
"numpy.load",
"pandas.read_csv"
]
] |
eric-vader/HD-BO-Additive-Models | [
"0d7e1d46194af2e3d402631caec6e7be9a50376a"
] | [
"hdbo/febo/models/gpm.py"
] | [
"import numpy as np\nimport torch\nfrom febo.utils import locate, get_logger\nfrom febo.utils.config import ConfigField, Config, assign_config, Configurable\nfrom febo.models import ConfidenceBoundModel\nfrom febo.models.model import ModelConfig\n\nfrom stpy.gauss_procc import GaussianProcess\nfrom stpy.kernels imp... | [
[
"torch.cat",
"torch.ones"
]
] |
sheromon/wheat-detection | [
"b9ee9cb1c94c64b6635490f6986b34cf42b59b5c"
] | [
"wheat/visualization.py"
] | [
"\"\"\"A couple of functions for visualizing the dataset in Jupyter notebooks\"\"\"\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nimport torchvision.transforms as T\nimport torchvision.transforms.functional as F\n\n\n# this conversion is needed because albumentations transforms return\n# image... | [
[
"numpy.asarray"
]
] |
Cardio-AI/3d-mri-domain-adaptation | [
"2a1b8332039aa25b8291cfd746cbcf87f71068c2"
] | [
"src/utils/Loss_and_metrics.py"
] | [
"from tensorflow.keras import backend as K\nimport tensorflow as tf\nimport numpy as np\nimport tensorflow.keras as keras\nfrom functools import partial\nfrom tensorflow.keras.losses import mse\nfrom src.data.Dataset import get_metadata_maybe, ensure_dir\n\ndef max_volume_loss(min_probability=0.8,):\n \"\"\"\n ... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.keras.backend.sum",
"numpy.asarray",
"tensorflow.keras.backend.variable",
"numpy.zeros",
"tensorflow.keras.backend.flatten",
"tensorflow.keras.backend.square",
"numpy.logical_and",
"tensorflow.keras.backend.epsilon",
"tensorflow.r... |
Dudestin/bisenetv2-tensorflow | [
"0c9761a7d0fd6ac4bdb3abb7195d01caf22d4716"
] | [
"tools/segcomp/freeze_segcomp_bisenetv2_model.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# @Time : 2020/1/15 上午10:49\n# @Author : MaybeShewill-CV\n# @Site : https://github.com/MaybeShewill-CV/bisenetv2-tensorflow\n# @File : freeze_segcomp_bisenetv2_model.py\n# @IDE: PyCharm\n\"\"\"\nFreeze bisenetv2 model\n\"\"\"\nimport argparse\n\nimport ten... | [
[
"tensorflow.GraphDef",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.gfile.GFile",
"tensorflow.ConfigProto",
"tensorflow.python.framework.graph_util.remove_training_nodes",
"tensorflow.variable_scope",
"tensorflow.squeeze",
"tensorflow.placeholder",
"tensorflo... |
LawrenceZ1A/MultipurposeProject | [
"54d5898301d01c33dd771b29e2e19e20d3875a21"
] | [
"Keras/how-to-forecast.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport sys\nimport warnings\n\nif not sys.warnoptions:\n warnings.simplefilter('ignore')\n\n\n# In[107]:\n\n\nimport tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\nfrom sklearn.preprocessi... | [
[
"tensorflow.compat.v1.nn.dynamic_rnn",
"tensorflow.compat.v1.disable_v2_behavior",
"numpy.min",
"numpy.mean",
"tensorflow.compat.v1.reset_default_graph",
"sklearn.preprocessing.MinMaxScaler",
"tensorflow.compat.v1.layers.dense",
"tensorflow.compat.v1.set_random_seed",
"matplotl... |
LASER-UMASS/Diva | [
"7dbb532cc6feec1e39c560b30a8e70f2691df365"
] | [
"Diva/models/term_encoder.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport math\nfrom collections import defaultdict\nfrom time import time\nfrom itertools import chain\nfrom lark.tree import Tree\nimport os\nfrom gallina import traverse_postorder\nimport pdb\n\n\nnonterminals = [\n 'constr__constr',\n 'co... | [
[
"torch.cat",
"torch.stack",
"torch.tanh",
"torch.nn.functional.linear",
"torch.nn.init.uniform_",
"torch.Tensor"
]
] |
larkinandy/Green-Space-Virtual-Reality | [
"f8679eea4e0aa388afdbf3b93d58ed375f57e4bd"
] | [
"Twitter_SMA/calcWeekly_tfidf.py"
] | [
"# calcWeekly_tfidf\n# created by Andrew Larkin\n# for Scoial Media Analytics course project\n# December 5, 2017\n\n# This script partitions Tweets from a raw csv file into weekly subsets,\n# writes the subsets to text files, and calculates weekly idf scores\n# for for each subset using trigrams\n\n# import modules... | [
[
"pandas.read_csv",
"sklearn.feature_extraction.text.TfidfVectorizer"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.