repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
christophe-rannou/imbalanced-learn | [
"c3f3b0fd9815e206ea63f3f11728f097608bf580"
] | [
"examples/ensemble/plot_balance_cascade.py"
] | [
"\"\"\"\n===============\nBalance cascade\n===============\n\nAn illustration of the balance cascade ensemble method.\n\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport seaborn as sns\nfrom sklearn.datasets import make_classification\nfrom sklearn.decomposition import PCA\n\nfrom imblearn.ense... | [
[
"numpy.random.rand",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"sklearn.decomposition.PCA",
"sklearn.datasets.make_classification"
]
] |
ann0218/codehome | [
"a5eb10c849743f42f4bcf440b6a62a351b38e8a9"
] | [
"mean shift.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\nnp.set_printoptions(threshold=np.inf)\nfrom sklearn import datasets\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom scipy.spatial import distance\n\n\ndef neigbourhood_points(X, x_centroid, dist=3):\n eligible_X = []\n for x in X:\n distance_betwee... | [
[
"numpy.concatenate",
"numpy.array",
"scipy.spatial.distance.euclidean",
"numpy.zeros",
"numpy.argmin",
"matplotlib.pyplot.clf",
"numpy.set_printoptions",
"numpy.copy",
"matplotlib.pyplot.grid",
"numpy.random.randn",
"numpy.mean",
"matplotlib.pyplot.scatter",
"ma... |
zenithfang/supervised_dispnet | [
"f81dfccfdc944e015d8fae17e24b3e664bec14d6"
] | [
"models/Disp_vgg_feature.py"
] | [
"import torch.cuda\nimport torch.nn as nn\nimport torch\nimport torch.utils.model_zoo as model_zoo\nimport torch.nn.functional as F\nimport torchvision.models as models\n#from .model_utils import * #use . represent relative address\n#from utils.util_functions import unsqueeze_dim0_tensor\n\ndef upsample_nn_nearest(... | [
[
"torch.cat",
"torch.nn.Sigmoid",
"torch.nn.init.constant_",
"torch.nn.functional.interpolate",
"torch.nn.LeakyReLU",
"torch.nn.init.xavier_uniform_",
"torch.nn.ConvTranspose2d",
"torch.utils.model_zoo.load_url",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
yuexy/mmocr | [
"82488024db159266e66ea6b0d6f84a5a18e87362"
] | [
"mmocr/models/ner/losses/masked_cross_entropy_loss.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nfrom torch import nn\nfrom torch.nn import CrossEntropyLoss\n\nfrom mmocr.models.builder import LOSSES\n\n\n@LOSSES.register_module()\nclass MaskedCrossEntropyLoss(nn.Module):\n \"\"\"The implementation of masked cross entropy loss.\n\n The mask has 1 for real... | [
[
"torch.nn.CrossEntropyLoss"
]
] |
yozoon/TrenchDepositionAutomation | [
"4eb1dd9fbabe7a782aa2070de144240616c00472"
] | [
"trench_automation/util.py"
] | [
"from os import listdir, path\n\nimport numpy as np\nimport sklearn.neighbors as neighbors\nimport vtk\nfrom vtk.util.numpy_support import vtk_to_numpy\n\n\ndef extract_line(filename):\n # Read the VTP file\n reader = vtk.vtkXMLPolyDataReader()\n reader.SetFileName(filename)\n reader.Update()\n\n # E... | [
[
"numpy.array",
"sklearn.neighbors.NearestNeighbors",
"numpy.vstack"
]
] |
NSLS-II/pyCHX | [
"e82e343903e477c4359b03c4d079eb1e5202c25f"
] | [
"pyCHX/chx_generic_functions.py"
] | [
"from pyCHX.chx_libs import *\n#from tqdm import *\nfrom pyCHX.chx_libs import ( colors, markers )\nfrom scipy.special import erf\n\nfrom skimage.filters import prewitt\nfrom skimage.draw import line_aa, line, polygon, ellipse, circle\n\nfrom modest_image import imshow\nimport matplotlib.cm as mcm\nfrom matplotl... | [
[
"numpy.rot90",
"numpy.ones_like",
"numpy.ma.sum",
"numpy.argmin",
"numpy.load",
"numpy.min",
"numpy.exp",
"numpy.mean",
"numpy.tile",
"numpy.where",
"numpy.radians",
"numpy.sort",
"numpy.cos",
"scipy.ndimage.measurements.center_of_mass",
"numpy.cumsum",
... |
rohitdwivedula/nfhs5 | [
"1872fa7a84bccfb0882c07b30223fc98024691f2"
] | [
"get_districtwise_links.py"
] | [
"from bs4 import BeautifulSoup\nimport pandas as pd\nimport requests\n\nstate_links = pd.read_csv(\"statewise_links.csv\")\ndistrictwise_links = pd.DataFrame(columns=['state', 'district', 'link'])\n\nfor index, row in state_links.iterrows():\n print(f\"Processing state #{index} {row['state']} at link {row['link'... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
kaityo256/python_gs | [
"d825db5eff9048863a9bed1a52c77e329c6518ff"
] | [
"gs_anime.py"
] | [
"import matplotlib.pyplot as plt\nfrom numba import jit\nimport numpy as np\n\n# python gs_jit.py 1.91s user 0.16s system 119% cpu 1.736 total\n\n\n@jit\ndef laplacian(ix, iy, s):\n ts = 0.0\n ts += s[ix-1, iy]\n ts += s[ix+1, iy]\n ts += s[ix, iy-1]\n ts += s[ix, iy+1]\n ts -= 4.0*s[ix, iy]\n ... | [
[
"matplotlib.pyplot.savefig",
"numpy.zeros",
"matplotlib.pyplot.imshow"
]
] |
itamargr/Mask-RCNN-TF2 | [
"cc5064b2dcfa9e1e91ed99c9e82b173d73308f1e"
] | [
"mrcnn/model.py"
] | [
"\"\"\"\r\nMask R-CNN\r\nThe main Mask R-CNN model implementation.\r\n\r\nCopyright (c) 2017 Matterport, Inc.\r\nLicensed under the MIT License (see LICENSE for details)\r\nWritten by Waleed Abdulla\r\n\"\"\"\r\n\r\nimport os\r\nimport random\r\nimport datetime\r\nimport re\r\nimport math\r\nimport logging\r\nfrom ... | [
[
"tensorflow.exp",
"numpy.random.choice",
"tensorflow.image.non_max_suppression",
"numpy.copy",
"tensorflow.unique",
"tensorflow.reshape",
"numpy.where",
"tensorflow.sqrt",
"numpy.sort",
"tensorflow.stack",
"tensorflow.control_dependencies",
"numpy.broadcast_to",
... |
jiachens/auto_LiRPA | [
"cc1ff18e8fbc938953b20ae6a030a25761cb0b78"
] | [
"tests/test_rectangle_patches.py"
] | [
"import torch\nimport random\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision\nfrom auto_LiRPA import BoundedModule, BoundedTensor\nfrom auto_LiRPA.perturbations import *\nimport sys\nsys.path.append('../examples/vision')\nimport models\nfrom testcase import TestCase\n... | [
[
"torch.nn.Linear",
"torch.nn.BatchNorm2d",
"torch.nn.Conv2d",
"torch.load",
"torch.Tensor"
]
] |
Ensteinjun/mediapipe | [
"38be2ec58f2a1687f4ffca287094c7bbd7791f58"
] | [
"mediapipe/util/sequence/media_sequence.py"
] | [
"\"\"\"Copyright 2019 The MediaPipe Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agre... | [
[
"numpy.array"
]
] |
eumiro/pandas | [
"781d9983ac54f9c6ee17accc0fd4ed55cdf71bbd"
] | [
"pandas/core/dtypes/cast.py"
] | [
"\"\"\"\nRoutines for casting.\n\"\"\"\n\nfrom contextlib import suppress\nfrom datetime import datetime, timedelta\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Dict,\n List,\n Optional,\n Sequence,\n Set,\n Sized,\n Tuple,\n Type,\n Union,\n)\n\nimport numpy as np\n\nfrom pandas... | [
[
"numpy.array_equal",
"pandas.core.arrays.floating.FLOAT_STR_TO_DTYPE.get",
"pandas.core.dtypes.common.ensure_int32",
"pandas.core.dtypes.common.is_float_dtype",
"pandas.core.dtypes.common.is_datetime64_dtype",
"pandas._libs.lib.infer_dtype",
"numpy.empty",
"numpy.prod",
"pandas... |
foroozandehgroup/nmr_sims | [
"a035bdf75f467f88e96f1ef90c26b9dd3b5c2884"
] | [
"nmr_sims/_sanity.py"
] | [
"# _sanity.py\n# Simon Hulse\n# simon.hulse@chem.ox.ac.uk\n# Last Edited: Fri 18 Feb 2022 13:48:21 GMT\n\nfrom dataclasses import dataclass\nimport re\nfrom typing import Any, Dict, Iterable, Tuple, Union\nimport numpy as np\nfrom nmr_sims import nuclei\n\n\ndef is_multiple_of_one_half(x):\n return round(x, 10) ... | [
[
"numpy.abs",
"numpy.zeros"
]
] |
feigelman/LNAplusplus | [
"091218a8f956ce8750ae2dee0be775dc5e7ca6bf"
] | [
"examples/runBirthDeath.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nThis is an LNA++ application example with a simple birth-death process \ninvolving a constitutively active DNA, and stochastic production and \ndegradation of mRNA and protein:\n\nModel of birth-death process:\n==============================\n k_m\nD... | [
[
"matplotlib.use",
"numpy.max",
"matplotlib.pyplot.savefig",
"numpy.min",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show",
"numpy.squeeze"
]
] |
HuaijiaLin/AGSS-VOS | [
"e9272365aa45bf098316d7111238fe0ab8df8a17"
] | [
"train_davis.py"
] | [
"import sys\r\n\r\nimport os\r\nimport time\r\nimport logging\r\nimport numpy as np\r\nimport argparse\r\nimport random\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.parallel\r\nimport torch.backends.cudnn as cudnn\r\nimport torch.optim as optim\r\nfrom torch.utils import data\r\nimport torch.nn.f... | [
[
"torch.nonzero",
"torch.cat",
"torch.nn.functional.upsample",
"torch.FloatTensor",
"torch.optim.Adam",
"numpy.mean",
"torch.cuda.empty_cache",
"torch.load",
"torch.zeros_like",
"torch.nn.DataParallel"
]
] |
LSN1220/torch_example | [
"b1230c8f702487225566b5be13947bd6f7904556"
] | [
"mtcnn-pytorch/mtcnn/core/utils.py"
] | [
"import numpy as np\nimport time\n\ndef IoU(box, boxes):\n \"\"\"Compute IoU between detect box and gt boxes\n\n Parameters:\n ----------\n box: numpy array , shape (5, ): x1, y1, x2, y2, score\n input box\n boxes: numpy array, shape (n, 4): x1, y1, x2, y2\n input ground truth boxes\n\n... | [
[
"numpy.minimum",
"numpy.where",
"numpy.true_divide",
"numpy.maximum"
]
] |
dpaiton/DeepSparseCoding | [
"5ea01fa8770794df5e13743aa3f2d85297c27eb1"
] | [
"tf1x/modules/sae_module.py"
] | [
"import tensorflow as tf\n\nfrom DeepSparseCoding.tf1x.utils.trainable_variable_dict import TrainableVariableDict\nimport DeepSparseCoding.tf1x.utils.entropy_functions as ef\nfrom DeepSparseCoding.tf1x.modules.ae_module import AeModule\nfrom DeepSparseCoding.tf1x.modules.activations import sigmoid\n\nclass SaeModul... | [
[
"tensorflow.add",
"tensorflow.multiply",
"tensorflow.reduce_mean",
"tensorflow.compat.v1.variable_scope"
]
] |
Austaon/GroupRecommendationThesis | [
"4a4b8c2f230d7db3b6b36342ab06b02f146462ae"
] | [
"Experiment Processing/experiment2/survey_fatigue.py"
] | [
"import statistics\n\nimport matplotlib.pyplot as plt\nfrom matplotlib import pyplot\n\nfrom database.session import Session\n\n\ndef survey_fatigue():\n \"\"\"\n Analysis to check if survey fatigue was present in the survey.\n The survey key to consider can be changed in the code below.\n\n Calculates ... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.locator_params",
"matplotlib.pyplot.subplots"
]
] |
nextBillyonair/Attention | [
"3e2dfecd63abd762633888895f3ba721c903f439"
] | [
"src/tf_schedulers.py"
] | [
"import torch\nimport torch.nn.functional as F\nimport math\n\n\ndef constant_annealing(model, iteration, max_iterations, start_tf=1.0):\n model.teacher_forcing = min(1, max(start_tf, 0))\n\ndef linear_annealing(model, iteration, max_iterations, start_tf=1.0):\n value = start_tf * (1 - iteration / max_iterati... | [
[
"torch.tensor"
]
] |
Sundrops/pytorch-faster-rcnn | [
"3279e7c20b7996839b30e8287e5eb7e5b1f1f793"
] | [
"lib/layer_utils/anchor_target_layer.py"
] | [
"# --------------------------------------------------------\n# Faster R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Xinlei Chen\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfro... | [
[
"numpy.array",
"numpy.empty",
"numpy.ascontiguousarray",
"numpy.sum",
"numpy.ones",
"torch.from_numpy",
"numpy.where",
"numpy.arange"
]
] |
MaryumSayeed/SYD-PYpline | [
"cfdd5bb2880cc4d2ab90af048ae6cc5994862076"
] | [
"pysyd/plots.py"
] | [
"import os\nimport pickle\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom astropy.convolution import convolve, Box1DKernel\n\nfrom pysyd import functions\nfrom pysyd import models\nfrom pysyd import utils\n\n\ndef set_plot_params():\n \"\"\"\n Sets the matplotlib parameters.\n\n Returns\n ---... | [
[
"matplotlib.pyplot.rcParams.update",
"numpy.zeros_like",
"numpy.absolute",
"numpy.ma.masked_inside",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.close",
"numpy.exp",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotl... |
Evangeline98/Multi-Label-Classification-with-CNN-and-RNN | [
"59ea2093b347fc43600c0d54ca74ab09c80e3ddb"
] | [
"attention/train.py"
] | [
"import os, sys\nimport torch.nn.functional as F\nimport time\nimport torch.backends.cudnn as cudnn\nimport torch.optim\nimport torch.utils.data\nimport torchvision.transforms as transforms\nfrom torch import nn\nfrom torch.nn.utils.rnn import pack_padded_sequence,pad_packed_sequence\nfrom models import Encoder, De... | [
[
"numpy.array",
"numpy.zeros",
"pandas.DataFrame",
"numpy.mean",
"torch.nn.functional.log_softmax",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.utils.rnn.pack_padded_sequence",
"pandas.read_csv",
"torch.nn.CrossEntropyLoss"
]
] |
HephaestusProject/pytorch-binaryconnect | [
"0a07a524522e993366749a865ae4bdf927cea3b5"
] | [
"tests/test_net.py"
] | [
"import pytest\nimport pytorch_lightning\nimport torch\nfrom omegaconf import OmegaConf\n\nfrom src.model.net import BinaryConv, BinaryLinear\n\n\n@pytest.fixture(scope=\"module\")\ndef fix_seed():\n pytorch_lightning.seed_everything(777)\n torch.backends.cudnn.deterministic = True\n torch.backends.cudnn.b... | [
[
"torch.cuda.is_available",
"torch.randn"
]
] |
malmgrek/gammy | [
"20ca24b45fa81ad29453123a13e19b3ff7ae33ab"
] | [
"gammy/utils.py"
] | [
"\"\"\"Miscellaneous utilities\n\n\"\"\"\n\nimport functools\nfrom typing import (Callable, Dict, Generator, Iterable, List, Tuple)\n\nimport numpy as np\nimport scipy as sp\nfrom scipy import interpolate\n\n\n#\n# Functional\n# ~~~~~~~~~~\n#\n\n\n# TODO: A proper curry\ndef curryish(f: Callable) -> Callable:\n ... | [
[
"numpy.array",
"scipy.interpolate.interp1d",
"numpy.dot",
"numpy.sum",
"scipy.linalg.block_diag",
"numpy.exp",
"numpy.diff",
"numpy.identity",
"numpy.linalg.svd",
"numpy.outer",
"numpy.hstack",
"numpy.diag"
]
] |
Hiroshiba/hihobot-synthesis | [
"93c149885ec1be5ee9bcfcb8ad99785cb1eb6731"
] | [
"hihobot_synthesis/config.py"
] | [
"import json\nfrom pathlib import Path\nfrom typing import Tuple, List, Dict, NamedTuple, Optional\n\nimport numpy as np\n\n\nclass Config(NamedTuple):\n lowest_frequency: Optional[float]\n\n mgc_dim: int\n lf0_dim: int\n vuv_dim: int\n bap_dim: int\n\n duration_linguistic_dim: int\n acoustic_l... | [
[
"numpy.array"
]
] |
IchiruTake/Bit2Edge | [
"4eec1703426042bb3b823d6e244427b86595ac76"
] | [
"Bit2Edge_Updated/Preprocessing.py"
] | [
"import gc\r\nfrom logging import warning\r\nfrom time import perf_counter\r\nfrom typing import Callable, List, Optional, Tuple, Union, Set, Dict, Any\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom numpy import ndarray\r\nfrom scipy.sparse import coo_matrix, spmatrix, csc_matrix, csr_matrix\r\n\r\nfrom .... | [
[
"matplotlib.pyplot.xlim",
"numpy.where",
"pandas.read_csv",
"numpy.dtype",
"numpy.uint8",
"pandas.DataFrame",
"numpy.logical_and",
"numpy.arange",
"numpy.array",
"numpy.delete",
"numpy.zeros",
"matplotlib.pyplot.autoscale",
"matplotlib.pyplot.hist",
"numpy.a... |
AmeyaWagh/miniflow | [
"0f0706692e0098e61df60f64038a80c1eb83e695"
] | [
"miniflow_python/MiniFlow.py"
] | [
"#! /usr/bin/python\nimport numpy as np\n\nclass Node(object):\n def __init__(self, inbound_nodes=[]):\n # Nodes from which this Node receives values\n self.inbound_nodes = inbound_nodes\n # Nodes to which this Node passes values\n self.outbound_nodes = []\n # A calculated valu... | [
[
"numpy.array",
"numpy.dot",
"numpy.exp",
"numpy.mean"
]
] |
Akey20/Missions_to_Mars | [
"b17872643a1c377c98d9d4b67bb287ebe3481db5"
] | [
"scrape_mars.py"
] | [
"#imports\nfrom splinter import Browser\nfrom bs4 import BeautifulSoup\nfrom webdriver_manager.chrome import ChromeDriverManager\nimport pandas as pd\nimport time\nimport requests\nimport json\n\n\ndef scrape_info():\n \n # init_browser()\n executable_path = {'executable_path': ChromeDriverManager().insta... | [
[
"pandas.read_html"
]
] |
sjesupaul/paintingClassifier | [
"7c8f157beeb086d23e9df7c72d263eba00ad4a93"
] | [
"artClassifierApp/app/__init__.py"
] | [
"from flask import Flask, jsonify, request, render_template\n\nfrom sklearn.linear_model import LogisticRegression\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\nimport os\n\ndef get_image_score(image_path):\n full_path = os.getcwd()+'/app/static/images/'+image_path\n image_data = tf.gfile... | [
[
"tensorflow.GraphDef",
"tensorflow.Session",
"tensorflow.import_graph_def",
"tensorflow.gfile.GFile",
"tensorflow.gfile.FastGFile"
]
] |
hofaflo/pyedflib | [
"2911382c93415925278c330058fc2640e1211324"
] | [
"pyedflib/edfwriter.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright (c) 2019 - 2020 Simon Kern\n# Copyright (c) 2015 - 2020 Holger Nahrstaedt\n# Copyright (c) 2011, 2015, Chris Lee-Messer\n# Copyright (c) 2016-2017 The pyedflib Developers\n# <https://github.com/holgern/pyedflib>\n# See LICENSE for license details.\n\nimp... | [
[
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.round",
"numpy.min",
"numpy.arange",
"numpy.size",
"numpy.issubdtype"
]
] |
jlashner/hmf | [
"c7ef7ce77b83a147dfc7a887d667775eca1a7e48"
] | [
"tests/test_halofit.py"
] | [
"import inspect\nimport os\n\nLOCATION = \"/\".join(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))).split(\"/\")[:-1])\nfrom nose.tools import raises\nimport sys\nsys.path.insert(0, LOCATION)\nfrom hmf import transfer\nimport numpy as np\n\n\ndef test_takahashi():\n t = transfer.Transfe... | [
[
"numpy.isclose"
]
] |
PoCFrance/Underflow | [
"214ab77db4a169548d68b463fb40df3f42bc80d0"
] | [
"regularflow/utils_regularflow/toolbox.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Sep 13 10:39:59 2019\n\n@author: slo\n\"\"\"\n\nimport torch\nfrom .qfunction import Qfunction\nfrom torch.optim import RMSprop\nfrom.state import State\nimport numpy as np\nimport math as math\nfrom time import process_time\nimport random\n\n... | [
[
"numpy.array",
"torch.no_grad",
"numpy.random.randint",
"numpy.eye"
]
] |
dutta-alankar/PH-354-2018-IISc-Assignment-Problems | [
"370dbbc447749cebe148a6ffffb48ea978b2949b"
] | [
"hw1/05/5.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sat Jan 6 05:35:36 2018\r\n\r\n@author: Alankar\r\n\"\"\"\r\n\r\nimport numpy as np\r\n\r\ndef wave_vec(E,V,m=1,hbar=1):\r\n k1 = np.sqrt(2*m*E)/hbar\r\n k2 = np.sqrt(2*m*(E-V))/hbar\r\n return(k1,k2)\r\n\r\ndef Ref(k1,k2):\r\n R = (k1-k2)/(k1+k2)\r\n ... | [
[
"numpy.abs",
"numpy.sqrt"
]
] |
sarvarkaxxorov/MassQueryLanguage | [
"b7618ba7fb5343c252c5691dc574f4193fb8e83e"
] | [
"workflow/bin/merged_extracted.py"
] | [
"import argparse\nimport os\nimport glob\nimport json\nimport uuid\nimport pandas as pd\n\nfrom massql import msql_extract\n\n\ndef _export_extraction(all_spectra, output_mzML_filename, output_mgf_filename, output_json_filename):\n # Returns two dataframes\n\n # Renumbering the scans when merging\n scan = ... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
lxkain/tracking | [
"00ed9a0b31c4880687a42df3bf9651e68e0c4360",
"00ed9a0b31c4880687a42df3bf9651e68e0c4360"
] | [
"signalworks/tracking/tracking.py",
"tests/test_load_audio.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Tracks\nEach track has a fs and a duration. There are 4 kinds of tracks:\n\n1 Event - times\n2 Wave - values\n3 TimeValue - values at times, duration\n4 Partition - values between times\n\nAll track intervals are of the type [), and duration points to the next unoccupied sample == le... | [
[
"numpy.abs"
],
[
"numpy.any"
]
] |
GavinNL/gcsg | [
"f5d47d9f035ea28a08e5eeeaf36500792a32f848"
] | [
"plot_points.py"
] | [
"#!/bin/env python3\nimport numpy as np\nimport pylab as pl\nimport sys\nfrom matplotlib import collections as mc\n\n\narray = []\nlines = []\npointsx = []\npointsy = []\n\nwith open(sys.argv[1]) as f:\n\n for line in f: # read rest of lines\n array = [float(x) for x in line.split()]\n lines.appen... | [
[
"matplotlib.collections.LineCollection",
"numpy.sqrt"
]
] |
Boltuzamaki/30-Days-AI-Projects | [
"04c48a3951ccdd7e1bd5776cde419d0e77d9822b"
] | [
"8th day - Real Time twitter sentiment analysis/Python code/Scraping and performing sentiment analysis of tweets in real time .py"
] | [
"\n# coding: utf-8\n\n# # Importing libraries\n\n# In[14]:\n\n\nfrom contraction import CONTRACTION_MAP\nimport re\nimport pickle\nimport math\nimport re\nimport time\nimport tensorflow as tf\nfrom tensorflow import keras\nimport pandas as pd\nimport nltk\nfrom contraction import CONTRACTION_MAP # Its a py file... | [
[
"tensorflow.keras.preprocessing.sequence.pad_sequences",
"pandas.DataFrame"
]
] |
ZeyadOsama/apollo | [
"89e7d7b264b78ace7ef4239899e2dab2568174fa"
] | [
"apollo/engine/genre_classification/tagger.py"
] | [
"import argparse\n\nimport numpy as np\n\nfrom apollo.engine.genre_classification.extractor import extractor\n\n\ndef top_tags(file_name, model='MSD_musicnn', topN=5, input_length=10, input_overlap=False, print_tags=True,\n save_tags=False):\n taggram, tags = extractor(file_name, model=model, input_l... | [
[
"numpy.mean"
]
] |
janusassetallocation/CsvUploader | [
"051abca8658ceda2df035327a59ea7c0f499f31e"
] | [
"tests/test_headercsv.py"
] | [
"import py\nfrom csvuploader import HeaderCsv\nimport pandas as pd\nfrom pandas.util.testing import assert_frame_equal\nfrom StringIO import StringIO\n\n\ndef test_load_file(request):\n test_dir = py.path.local(request.module.__file__)\n with test_dir.dirpath('data', 'simple.csv').open('r') as f:\n tex... | [
[
"pandas.DataFrame"
]
] |
zenitheesc/report-maker | [
"ab932c2bf71549e9015be240dfed8a9fdd1b0069"
] | [
"MAIN/statistics.py"
] | [
"import pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport numpy as np\nimport folium as fl\nfrom time import sleep\nimport selenium.webdriver\nimport os\n\n# --------------------------------------------------------------------------------------------\n\n# Uses the 1.5xIQR method to identi... | [
[
"numpy.percentile",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.clf",
"pandas.Series"
]
] |
kristinakupf/Histo_StrengthInDiversity | [
"1c7f6156f5a7504c03f66881301bbca264789f7e"
] | [
"SS_pretrain/utils.py"
] | [
"import time\nimport torch\nimport pickle\nimport torchvision.transforms as t\nimport torch.utils.data as data\nimport numpy as np\nfrom PIL import Image\nfrom tqdm import tqdm\nimport os\nimport h5py\nimport random\nfrom shutil import copyfile\nimport io\nfrom PIL import Image\nimport math\nimport matplotlib.pyplo... | [
[
"torch.utils.data.ConcatDataset",
"torch.rand",
"numpy.uint8",
"torch.stack",
"torch.save",
"numpy.load",
"numpy.random.randint",
"torch.load"
]
] |
fac2003/attention-is-all-you-need-pytorch | [
"892e7b6de7d92c8acb78800a9da33e2b00918374"
] | [
"src/org/campagnelab/dl/funnel/transformer/train_transformer.py"
] | [
"import time\n\nimport torch\nfrom torch.autograd import Variable\nimport numpy as np\n\nfrom src.org.campagnelab.dl.CheckGradients import register_hooks\nfrom src.org.campagnelab.dl.funnel.transformer.Batching import Batch\nfrom src.org.campagnelab.dl.funnel.transformer.FunnelTransformerModel import make_funnel_mo... | [
[
"torch.max",
"torch.autograd.Variable",
"torch.ones",
"numpy.random.randint",
"torch.LongTensor"
]
] |
jinumohan173/tensorflow | [
"c967084e6af90b560b47435ff4d3292677353bfe"
] | [
"tensorflow/python/ops/image_grad_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.image.resize_bilinear",
"numpy.array",
"numpy.reshape",
"numpy.random.seed",
"tensorflow.test.compute_gradient_error",
"tensorflow.test.compute_gradient",
"tensorflow.gradients",
"tensorflow.image.resize_nearest_neighbor",
"tensorflow.constant",
"numpy.fabs",
... |
awslabs/adatune | [
"87d106de0433c6437c2b0b1d436c9f3aded7e134"
] | [
"adatune/mu_adam.py"
] | [
"# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in th... | [
[
"numpy.max",
"numpy.minimum",
"torch.optim.SGD",
"numpy.sign",
"numpy.power"
]
] |
mahdi-darvish/GANs-augmented-pet-classifier | [
"399e86c022c007c66d48055a977f82ce498c51fc"
] | [
"landmark_detection/pet/animal_data_generator.py"
] | [
"\nimport pet.utils.general\nimport pet.utils.image\nimport numpy as np\nimport keras\nimport pet.utils.sampling\nfrom keras.applications import mobilenet_v2\nimport os\n\nclass animal_generator(keras.utils.Sequence):\n def __init__(self, path, output_type, include_landmarks=False, batch_size=64, shuffle=True,\n... | [
[
"numpy.random.choice",
"numpy.asarray",
"numpy.round",
"numpy.random.shuffle",
"numpy.random.random_sample"
]
] |
nknezek/MAC_waves | [
"2bf87fb6d8a24d0c046b19ff7011dd81ce36f285"
] | [
"src/macmodel_bdiv.py"
] | [
"import macmodel\nimport numpy as np\nfrom numpy import sin, cos, tan\n\nclass Model(macmodel.Model):\n\n def make_A(self):\n Nk = self.Nk\n Nl = self.Nl\n E = self.E\n Pm = self.Pm\n N = self.N\n th = self.th\n Br = self.Br\n Bth = self.Bth\n Bph = ... | [
[
"numpy.ones",
"numpy.cos"
]
] |
argonne-lcf/PINO | [
"95f830bdaafb2c03f7153df9e59e4832223a6108"
] | [
"solver/legacy_solver.py"
] | [
"import torch\nimport math\nimport scipy.io\nfrom timeit import default_timer\nfrom tqdm import tqdm\n\n\nclass GaussianRF(object):\n\n def __init__(self, dim, size, alpha=2, tau=3, sigma=None, boundary=\"periodic\", device=None):\n\n self.dim = dim\n self.device = device\n\n if sigma is Non... | [
[
"torch.rfft",
"torch.zeros",
"torch.arange",
"torch.irfft",
"torch.unsqueeze",
"torch.abs",
"torch.cuda.is_available",
"torch.ifft",
"torch.randn"
]
] |
TheCacophonyProject/python-api | [
"49b9e1c9aa16b0f47344c3e57dbe27b232372719"
] | [
"examples/example0.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Example of querying the Cacophony Project Servers via a REST API using a Python Client.\"\"\"\n# #### Configuration\n\nimport logging, sys, os\n\nlogging.basicConfig(\n format=\"%(asctime)s : %(module)s :%(levelname)s : %(message)s\",\n level=logging.DEBUG,\n stream=sys.stdo... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.pivot_table",
"pandas.concat"
]
] |
roychowdhuryresearch/HFO-Classification | [
"c672852257410664b0351a3f9505ca6ad0d3c315"
] | [
"data_preprocessing/create_data_90min/label_filter_90.py"
] | [
"from utilities import dump_pickle\nimport numpy as np\nimport os\nimport pandas as pd\nimport seaborn as sns\nimport numpy as np\ndef fetch_hfo_add_info(stats, csv_dir ,pt_name):\n \"\"\"\n Get soz and removed, spike information from csv\n \"\"\"\n df = pd.DataFrame() \n df['channel_name'] = np.ch... | [
[
"pandas.DataFrame",
"numpy.squeeze",
"pandas.merge"
]
] |
Zamony/qlearning4k | [
"8d7e54e97c00e0e066567adf8246e94e125b35ae"
] | [
"qlearning4k/games/snake.py"
] | [
"__author__ = \"Fariz Rahman\"\r\n\r\nimport numpy as np\r\nfrom .game import Game\r\n\r\n\r\nactions = {0:'left', 1:'right', 2:'up', 3:'down', 4:'idle'}\r\nforbidden_moves = [(0, 1), (1, 0), (2, 3), (3, 2)]\r\n\r\nclass Snake(Game):\r\n\r\n def __init__(self, grid_size=10, snake_length=3):\r\n self.grid_... | [
[
"numpy.ones",
"numpy.random.randint"
]
] |
prorevizor/noc | [
"37e44b8afc64318b10699c06a1138eee9e7d6a4e"
] | [
"core/text.py"
] | [
"# ---------------------------------------------------------------------\n# Various text-processing utilities\n# ---------------------------------------------------------------------\n# Copyright (C) 2007-2020 The NOC Project\n# See LICENSE for details\n# ------------------------------------------------------------... | [
[
"numpy.array"
]
] |
sohailalam2/qstrader | [
"e6d86a3ac3dc507b26e27b1f20c2949a69438ef7"
] | [
"examples/moving_average_cross_backtest.py"
] | [
"from collections import deque\nimport datetime\n\nimport numpy as np\n\nfrom qstrader import settings\nfrom qstrader.strategy.base import AbstractStrategy\nfrom qstrader.event import SignalEvent, EventType\nfrom qstrader.compat import queue\nfrom qstrader.trading_session import TradingSession\n\n\nclass MovingAver... | [
[
"numpy.mean"
]
] |
joschout/pyIDS | [
"959353fc9eca1e8a327d360120cfad375d5918ab"
] | [
"pyids/test/test_ids_classifier.py"
] | [
"import unittest\nimport pandas as pd\nimport random\n\nfrom pyids.ids_classifier import IDS, mine_CARs\nfrom pyarc.qcba.data_structures import QuantitativeDataFrame\n\nclass TestIDSClassifier(unittest.TestCase):\n\n def test_model_fitting(self):\n df = pd.read_csv(\"C:/code/python/interpretable_decision_... | [
[
"pandas.read_csv"
]
] |
wojtek11530/PKD-for-BERT-Model-Compression | [
"c8a005e8127645a4d1609e9c08646b8013a8c62b",
"c8a005e8127645a4d1609e9c08646b8013a8c62b"
] | [
"BERT/examples/run_gpt2.py",
"BERT/examples/lm_finetuning/finetune_on_pregenerated.py"
] | [
"#!/usr/bin/env python3\n\nimport argparse\nimport logging\nfrom tqdm import trange\n\nimport torch\nimport torch.nn.functional as F\nimport numpy as np\n\nfrom pytorch_pretrained_bert import GPT2LMHeadModel, GPT2Tokenizer\n\nlogging.basicConfig(format = '%(asctime)s - %(levelname)s - %(name)s - %(message)s',\n ... | [
[
"torch.cat",
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.no_grad",
"torch.random.manual_seed",
"torch.multinomial",
"torch.full",
"torch.cuda.is_available",
"torch.tensor",
"torch.ones_like",
"torch.nn.functional.softmax",
"torch.topk"
],
[
"numpy.... |
pcampeti/plancklens | [
"44b8a932551cb6534965892cd7c72b0a9cd8c3a5"
] | [
"plancklens/nhl.py"
] | [
"\"\"\"Calculation of semi-analytical noise biases module.\n\n\"\"\"\nfrom __future__ import print_function\n\nimport os\nimport pickle as pk\nimport numpy as np\nimport healpy as hp\n\nfrom plancklens import qresp, utils, utils_spin as uspin\nfrom plancklens.helpers import mpi, sql\n\n\ndef get_nhl(qe_key1, qe_key... | [
[
"numpy.concatenate",
"numpy.zeros",
"numpy.arange",
"numpy.all",
"numpy.unique"
]
] |
clems4ever/tensorstream | [
"61bff14f65f71bdd4ab58aefbd6eda79ec5863cb",
"61bff14f65f71bdd4ab58aefbd6eda79ec5863cb"
] | [
"tensorstream/meta/factory_spec.py",
"tensorstream/finance/momentum.py"
] | [
"import numpy as np\nimport tensorflow as tf\n\nfrom tensorstream.streamable import Streamable\nfrom tensorstream.meta.factory import Factory\nfrom tensorstream.tests import TestCase\n\nclass MultiplyBy(Streamable):\n def __init__(self, nb):\n super().__init__()\n self.nb = nb\n\n def step(self, x, prev_x=N... | [
[
"numpy.testing.assert_almost_equal",
"tensorflow.constant",
"tensorflow.Session",
"tensorflow.placeholder"
],
[
"tensorflow.constant"
]
] |
danenigma/Traditional-Computer-Vision | [
"04e66c8d6bdb3e5eb5d1ab05674e4a5ea3b9f823"
] | [
"Scene-Classification-With-Spatial-Pyramid-Matching/network_layers.py"
] | [
"import numpy as np\r\nimport scipy.ndimage\r\nfrom skimage.measure import block_reduce\r\nimport util\r\nimport os,time\r\n#for testing \r\nimport torch.nn as nn\r\nimport torch\r\nimport deep_recog\r\ndef extract_deep_feature(x,vgg16_weights):\r\n\t'''\r\n\tExtracts deep features from the given VGG-16 weights.\r\... | [
[
"numpy.matmul",
"numpy.zeros",
"numpy.random.randn",
"numpy.maximum",
"numpy.fliplr"
]
] |
Lkiraa/Contiki-ng | [
"87b55a9233d5588b454f6f5ec580ee9af1ae88f8"
] | [
"arch/cpu/arm/CMSIS/CMSIS/DSP/Testing/PatternGeneration/Interpolate.py"
] | [
"import os.path\nimport numpy as np\nimport itertools\nimport Tools\nfrom scipy.interpolate import interp1d,interp2d\n\n# Those patterns are used for tests and benchmarks.\n# For tests, there is the need to add tests for saturation\n\n# Get lists of points in row order for use in CMSIS function\ndef getLinearPoints... | [
[
"scipy.interpolate.interp1d",
"numpy.sin",
"numpy.arange",
"numpy.cos",
"scipy.interpolate.interp2d",
"numpy.size",
"numpy.linspace",
"numpy.meshgrid"
]
] |
ebucheli/TC1002S | [
"ff4647845a8e87bdb002d977501311fed96accd4"
] | [
"k_means_solution.py"
] | [
"import numpy as np\nimport random\nimport matplotlib.pyplot as plt\nimport matplotlib\n\nfrom io_utilities import load_data\nfrom visualizations import show_clusters_centroids\n\ndef distance(a,b):\n \"\"\"\n Compute Euclidean Distance Between Two Points\n Input:\n a (list): an n-dimensional list o... | [
[
"matplotlib.pyplot.show",
"numpy.array",
"numpy.mean",
"numpy.argmin"
]
] |
microprediction/nevergrad | [
"5e4c00d74e84dfb0283ab3d35dd85fde0bb49c29"
] | [
"nevergrad/functions/base.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\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\nimport inspect\nfrom pathlib import Path\nimport numbers\nimport numpy as np\nimport nevergrad.common.typing as... | [
[
"numpy.round",
"pandas.DataFrame",
"pandas.read_csv",
"numpy.array"
]
] |
roma-goodok/scannet_experiments | [
"8039fade13f9bd5664633f6a567f6785a5f9e3d2"
] | [
"scannet_kekas/callbacks/csv_logger.py"
] | [
"\"A `Callback` that saves tracked metrics into a persistent file.\"\n# Contribution from devforfu: https://nbviewer.jupyter.org/gist/devforfu/ea0b3fcfe194dad323c3762492b05cae\n\nimport pandas as pd\nfrom fastai.basic_train import Learner, LearnerCallback\n\nfrom fastai_sparse.core import Any\n\n__all__ = ['CSVLogg... | [
[
"pandas.read_csv"
]
] |
ilyakz/alpha-game2 | [
"fe492a59cd99b99b74979f81d407156dc7d0a08d"
] | [
"cube_tic_tac_toe_3d/CubeTicTacToeGame.py"
] | [
"from __future__ import print_function\nfrom cube_tic_tac_toe_3d.CubeTicTacToeLogic import Board\nfrom framework.Game import Game\nimport numpy as np\nimport pygame\nimport math\n\n\nclass CubeTicTacToeGame(Game):\n \"\"\"\n Game класс для кубических крестиков - ноликов. Потомок класса Game.\n \"\"\"\n ... | [
[
"numpy.rot90",
"numpy.array",
"numpy.reshape",
"numpy.copy",
"numpy.fliplr"
]
] |
sophiaalexander/GANs-for-High-Schoolers | [
"b33c36a399f49f5b48d76dd8141859990aaba285"
] | [
"netdissect/renormalize.py"
] | [
"import numpy, torch, PIL\nfrom torchvision import transforms\n\ndef as_tensor(data, source=None, mode='zc'):\n renorm = renormalizer(source=source, mode=mode)\n return renorm(data)\n\ndef as_image(data, source='zc', mode='byte'):\n assert len(data.shape) == 3\n renorm = renormalizer(source=source, mode... | [
[
"numpy.array"
]
] |
conscienceli/node21_detection_baseline | [
"d9eadaf1b0a81320b5c38d8b8a74eec86aa0d80a"
] | [
"training_utils/scouter/tools/prepare_things.py"
] | [
"import torch\nimport os\nimport torch.distributed as dist\nfrom collections import defaultdict, deque\nfrom torch.utils.data import DataLoader\nfrom prefetch_generator import BackgroundGenerator\n\n\ndef init_distributed_mode(args):\n if 'RANK' in os.environ and 'WORLD_SIZE' in os.environ:\n args.rank = ... | [
[
"torch.distributed.get_world_size",
"torch.distributed.is_available",
"torch.distributed.init_process_group",
"torch.save",
"torch.cuda.device_count",
"torch.cuda.set_device",
"torch.distributed.is_initialized",
"torch.tensor",
"torch.distributed.all_reduce",
"torch.distrib... |
GeneKong/wavy | [
"94598d65477c7479ae509b59ef5f64c1976c0589"
] | [
"test/unit_tests/test_wave_file.py"
] | [
"import numpy\nimport pytest\nfrom re import escape as esc\nfrom wavy import *\n\n\n@pytest.mark.parametrize('sample_width, data, channels, tags', [\n (8, numpy.array([1, 2], dtype=numpy.uint8), 1, None),\n (16, numpy.array([1, 2], dtype=numpy.int16), 1, None),\n (24, numpy.array([1, 2], dtype=numpy.int32)... | [
[
"numpy.array",
"numpy.array_equal"
]
] |
H-B-P/censorwork | [
"65731d2360d4ac78a413781e130972c75aa8ee35"
] | [
"gamma/k_and_t/gen_data.py"
] | [
"import numpy as np\nimport pandas as pd\n\nimport random\n\nc_k = 4\nm_k = 0.5\n\nc_t = 6\nm_t = 0.5\n\ncensor_mean = 30\ncensor_sig = 1\n\npossible_xes = [0,1,2,3,4,5,6,7,10]\n\nnrows = 10000\n\nx = np.random.choice(possible_xes, nrows)\n\n\nk = c_k + m_k*x\nt = c_t + m_t*x\n\ntrue_y = np.random.gamma(k,t,nrows)\... | [
[
"numpy.random.gamma",
"numpy.random.normal",
"numpy.random.choice",
"pandas.DataFrame"
]
] |
ericmjl/openfold | [
"3ea45f90dbd314095d56bcf033e515555092dd15"
] | [
"openfold/np/residue_constants.py"
] | [
"# Copyright 2021 AlQuraishi Laboratory\n# Copyright 2021 DeepMind Technologies Limited\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/LIC... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"numpy.dot",
"numpy.sin",
"numpy.zeros",
"numpy.eye",
"numpy.stack",
"numpy.transpose",
"numpy.arange",
"numpy.sqrt",
"numpy.cos",
"numpy.cross"
]
] |
shub1095/elasticsearch-py | [
"778c7e4ac000b51ced7c9a1a588200ec395e40ca"
] | [
"test_elasticsearch/test_serializer.py"
] | [
"# -*- coding: utf-8 -*-\n# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses this file to you under\n# the Apache License, Version 2.0 (t... | [
[
"numpy.zeros",
"pandas.Timestamp",
"pandas.Categorical",
"numpy.bool_",
"pandas.Series",
"numpy.datetime64"
]
] |
BMI203-2022/project3 | [
"3a1935f98b47ef425f8c0551436e16e9e846f396"
] | [
"test/test_mst.py"
] | [
"# write tests for bfs\nimport pytest\nimport numpy as np\nfrom mst import Graph\nfrom sklearn.metrics import pairwise_distances\n\n\ndef check_mst(adj_mat: np.ndarray, \n mst: np.ndarray, \n expected_weight: int, \n allowed_error: float = 0.0001):\n \"\"\" Helper function ... | [
[
"sklearn.metrics.pairwise_distances",
"numpy.loadtxt"
]
] |
theLongLab/phx-nn | [
"81e0f87faa82d6995b37095815655224cb5bf438"
] | [
"data_split.py"
] | [
"# data_split.py\n\nfrom pathlib import Path\nimport sys\nfrom typing import Optional\n\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n\n\ndef main(test_size: float, seed: Optional[int]) -> None:\n \"\"\"\n Splits the data based on test set proportion.\n \"\"\"\n processed_d... | [
[
"sklearn.model_selection.train_test_split"
]
] |
johannah/balloon-learning-environment | [
"cdb2e582f2b03c41f037bf76142d31611f5e0316"
] | [
"balloon_learning_environment/env/balloon/solar.py"
] | [
"# coding=utf-8\n# Copyright 2022 The Balloon Learning Environment 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... | [
[
"numpy.sin",
"numpy.tan",
"numpy.exp",
"numpy.cos",
"numpy.clip",
"numpy.floor"
]
] |
mashrikt/pyro | [
"0097b3008327d87a27506b1da2528bf989080495"
] | [
"tests/distributions/test_shapes.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nimport torch\n\nimport pyro.distributions as dist\n\n\ndef test_categorical_shape():\n probs = torch.ones(3, 2) / 2\n d = dist.Categorical(probs)\n assert d.batch_shape == (3,)\n assert d.event_shape == ()\n assert d.shape() == (3,)... | [
[
"torch.zeros",
"torch.ones"
]
] |
unc-optimization/FedDR | [
"4097eb447a99c7180388527a2d05974906b77eb1"
] | [
"FedDR/main.py"
] | [
"import numpy as np\r\nimport argparse\r\nimport importlib\r\nimport random\r\nimport os, time\r\nimport tensorflow as tf\r\nfrom flearn.utils.model_utils import read_data\r\n\r\n# GLOBAL PARAMETERS\r\nOPTIMIZERS = ['fedavg', 'fedprox', 'feddr', 'fedpd']\r\nDATASETS = ['FEMNIST', 'synthetic_iid', 'synthetic_0_0', '... | [
[
"numpy.random.seed",
"tensorflow.logging.set_verbosity",
"tensorflow.set_random_seed"
]
] |
NOWUM/EnSysMod | [
"18c8a2198db3510e667c1f0298d00a3dfcb0aab7"
] | [
"ensysmod/crud/energy_transmission_distance.py"
] | [
"from typing import List\n\nimport pandas as pd\nfrom sqlalchemy.orm import Session\n\nfrom ensysmod import crud\nfrom ensysmod.crud.base import CRUDBase\nfrom ensysmod.model import EnergyTransmissionDistance\nfrom ensysmod.schemas import EnergyTransmissionDistanceCreate, EnergyTransmissionDistanceUpdate\n\n\n# noi... | [
[
"pandas.DataFrame"
]
] |
queirozfcom/auto-tagger | [
"d9c0339648562ceca2d7cd10a02aaf56d353ae7b"
] | [
"social-tags/src/helpers/embeddings.py"
] | [
"import os\nimport numpy as np\n\n\ndef read_glove_wiki_weighted(d, weight_index, glove_dir = None):\n\n if glove_dir is None:\n glove_dir = \"/media/felipe/SAMSUNG/GloVe\"\n\n supported_dimensions = [50, 100, 200, 300]\n\n if d not in supported_dimensions:\n raise ValueError(\"argument d mus... | [
[
"numpy.asarray"
]
] |
seattleboy/allennlp | [
"6c87ff59c478c47ba03d4ac0ea693ac7b0fd80b6"
] | [
"allennlp/tests/modules/elmo_test.py"
] | [
"# pylint: disable=no-self-use,invalid-name,protected-access\nimport os\nimport json\nimport warnings\n\nwith warnings.catch_warnings():\n warnings.filterwarnings(\"ignore\", category=FutureWarning)\n import h5py\nimport numpy\nimport torch\n\nfrom allennlp.common.testing import AllenNlpTestCase\nfrom allennl... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.random.randint"
]
] |
cculianu/Bitcoin-Static | [
"8b19e8a83990d20bc25ef138a5050b23591fbb80"
] | [
"test/functional/bchn-txbroadcastinterval.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) 2020 The Bitcoin Static developers\n# Author matricz\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"\nTest that inv messages are sent according to\nan exponential distribution ... | [
[
"scipy.stats.expon"
]
] |
fred3m/astropyp | [
"414c9e6d84da2604c6466b2046827d8b1988edab"
] | [
"astropyp/phot/phot.py"
] | [
"from __future__ import division\nimport logging\nimport warnings\nfrom collections import OrderedDict\nimport numpy as np\nimport astropy.units as apu\n\nimport astropyp.catalog\nfrom astropyp.phot import detect\n\ntry:\n import six\nexcept ImportError:\n try:\n from astropy.extern import six\n exc... | [
[
"numpy.array",
"scipy.optimize.curve_fit",
"numpy.zeros",
"numpy.geterr",
"numpy.seterr",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"sklearn.cluster.DBSCAN",
"numpy.arange",
"numpy.sqrt",
"matplotlib.pyplot.show",
"numpy.log10",
"numpy.meshgrid",... |
WestXu/JAQS | [
"3c9389afab518f188b8628af72297d750c07dfb1"
] | [
"jaqs/trade/strategy.py"
] | [
"# encoding: utf-8\n\"\"\"\nClasses defined in strategy module\n\"\"\"\n\nfrom __future__ import print_function\nimport abc\nfrom abc import abstractmethod\nfrom six import with_metaclass\n\nimport numpy as np\nimport pandas as pd\n\nfrom jaqs.data.basic import GoalPosition\nfrom jaqs.util.sequence import SequenceG... | [
[
"numpy.isinf",
"numpy.isnan",
"numpy.random.rand",
"pandas.merge",
"pandas.DataFrame",
"numpy.sqrt",
"pandas.concat",
"numpy.isfinite",
"numpy.int64"
]
] |
cascino/poke-gan | [
"da0e18da78cbbe4cda73deacdfbf5254eccedfba"
] | [
"main.py"
] | [
"import torch\nimport os\nfrom PIL import Image\nfrom torch.utils.data import Dataset, DataLoader\nfrom torch import nn, optim\nfrom torch.autograd import Variable\nfrom torchvision import transforms, utils\n\n'''Vanilla Generative Adversarial Network'''\n\n# disciminator network\nclass D(nn.Module):\n def __ini... | [
[
"torch.nn.Sigmoid",
"torch.autograd.Variable",
"torch.nn.Tanh",
"torch.save",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"torch.nn.ConvTranspose2d",
"torch.manual_seed",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",... |
ASethi77/StateOfTheMedia | [
"98512ba5e5242d7d9c2bdb0f6725d4ae0170ca8b"
] | [
"src/model/linear_regression_model.py"
] | [
"from .regression_model import RegressionModel\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.metrics import mean_squared_error\n\nclass LinearRegressionModel(RegressionModel):\n def __init__(self, train_data):\n RegressionModel.__init__(self, train_data)\n self.model = LinearRegr... | [
[
"sklearn.metrics.mean_squared_error",
"sklearn.linear_model.LinearRegression"
]
] |
ArtesiaWater/observations | [
"f04193dc3bfafc0bd9c465e30b16194ca411f266"
] | [
"tests/test_002_obs_objects.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Created on Fri Jan 31 13:26:04 2020.\n\n@author: oebbe\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nfrom hydropandas import obs_collection as oc\nfrom hydropandas import observation as obs\n\n# import sys\n# sys.path.insert(1, \"..\")\n\n\n# TEST_DIR = os.path.dirname(os.path.... | [
[
"numpy.random.random",
"pandas.date_range",
"numpy.random.randint",
"numpy.random.rand"
]
] |
ajabri/MONAI | [
"49e6bb8235ef7a9745d144d773f6377c9b1e5b71"
] | [
"tests/test_convert_to_multi_channel.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... | [
[
"numpy.array",
"numpy.testing.assert_equal"
]
] |
gaguilar/nlp | [
"a05ef16695fd8cdfc23cf07eba48d5e1b2d843e5"
] | [
"tests/test_arrow_dataset.py"
] | [
"import os\nimport pickle\nimport tempfile\nfrom unittest import TestCase\n\nimport numpy as np\nimport pandas as pd\nimport pyarrow as pa\n\nfrom nlp import concatenate_datasets\nfrom nlp.arrow_dataset import Dataset\nfrom nlp.features import ClassLabel, Features, Sequence, Value\nfrom nlp.info import DatasetInfo\... | [
[
"numpy.array",
"tensorflow.data.TFRecordDataset",
"pandas.DataFrame.from_dict",
"tensorflow.io.FixedLenFeature",
"numpy.ones",
"tensorflow.constant",
"tensorflow.io.parse_single_example",
"numpy.arange",
"tensorflow.io.VarLenFeature",
"torch.Tensor"
]
] |
rohankumardubey/manim | [
"b3b7d214adff2088f6c75cbc814cbbf8f1a9b4e4"
] | [
"manimlib/mobject/types/dot_cloud.py"
] | [
"import numpy as np\nimport moderngl\n\nfrom manimlib.constants import GREY_C\nfrom manimlib.constants import YELLOW\nfrom manimlib.constants import ORIGIN\nfrom manimlib.mobject.types.point_cloud_mobject import PMobject\nfrom manimlib.utils.iterables import resize_preserving_order\n\n\nDEFAULT_DOT_RADIUS = 0.05\nD... | [
[
"numpy.full",
"numpy.array",
"numpy.zeros"
]
] |
AxelGard/university-projects | [
"0c9a6e785f1918c6ed0fd365b2d419c9f52edb50"
] | [
"tsks24-sig/lab3/preamble.py"
] | [
"import numpy as np\nfrom scipy import signal, misc\nimport imageio\nfrom matplotlib import pyplot as plt\nplt.rcParams['image.interpolation'] = 'nearest'\n\nclass Error:\n def __init__(self, original, altered):\n self.mse = np.mean((original-altered)**2)\n self.psnr = 10*np.log10(255**2/self.mse)\... | [
[
"numpy.log10",
"numpy.mean"
]
] |
jungin500/pytorch-lightning | [
"b5f2b3e12c099282d475c8ec4d058064c433d7d5"
] | [
"pytorch_lightning/strategies/horovod.py"
] | [
"# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"torch.device",
"torch.cuda.empty_cache",
"torch.cuda.set_device"
]
] |
linupi/silx | [
"51bc5cbc696880e7cf13feb3ff2476a5c32422d4"
] | [
"silx/gui/data/NXdataWidgets.py"
] | [
"# coding: utf-8\n# /*##########################################################################\n#\n# Copyright (c) 2017-2020 European Synchrotron Radiation Facility\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Soft... | [
[
"numpy.ones_like",
"numpy.ones",
"numpy.ravel",
"numpy.arange",
"numpy.isscalar",
"numpy.meshgrid"
]
] |
ruclion/AutoVC_one_hot_ls | [
"db400a224b2e4544a480e0ab3f62b51b570d378c"
] | [
"data_loader_hujk17.py"
] | [
"import os\nimport torch\nimport numpy as np\nimport pickle as pkl\nfrom torch.utils import data\n\n \n\nspeaker_id_dict_path = '/ceph/home/hujk17/AutoVC_hujk17/full_106_spmel_nosli/speaker_seen_unseen.txt'\n\n\ndef text2list(file):\n f = open(file, 'r').readlines()\n file_list = [i.strip() for i in f]\n r... | [
[
"numpy.pad",
"numpy.random.randint",
"numpy.load",
"torch.utils.data.DataLoader"
]
] |
mjjjjm/helmholtz | [
"8ebe8e28fc4752c4da1d97b0ab3f25ae9debc44e"
] | [
"ex1d_pointSource.py"
] | [
"import os, sys, time\nimport numpy as np\nimport dolfin as df\n\nfrom HelmholtzSolver import *\n\n## =====================================================================================\n\n## -------------------------------------------------------------------------------------\ndef waveSpeed(x):\n return 1.0\n... | [
[
"numpy.array"
]
] |
ashawkey/FocalLoss.pytorch | [
"5e9fcc6ad28302900e4fb41cf543524b435eab84"
] | [
"focalloss.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport numpy as np\n\nclass FocalLoss(nn.Module):\n '''Multi-class Focal loss implementation'''\n def __init__(self, gamma=2, weight=None):\n super(FocalLoss, self).__init__()\n self.gamma = gamma... | [
[
"torch.nn.functional.nll_loss",
"torch.exp",
"torch.nn.functional.log_softmax"
]
] |
Lhumd/reactive_planners-1 | [
"5d8bd04da3d06fb2f968aa23a0c6713dcd773f44"
] | [
"python/reactive_planners/demos/bolt_step_adjustment.py"
] | [
"\"\"\" @namespace Demos of Bolt step adjustment\n@file\n@copyright Copyright (c) 2017-2019,\n New York University and Max Planck Gesellschaft,\n License BSD-3-Clause\n@example\n\"\"\"\nimport numpy as np\nimport pybullet as p\nfrom matplotlib import pyplot as plt\nfrom robot_properties_bolt.con... | [
[
"numpy.array",
"numpy.matrix",
"numpy.zeros",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.linalg.pinv",
"matplotlib.pyplot.figure",
"numpy.eye",
"numpy.sqrt",
"matplotlib.pyplot.show",
"nump... |
TanselArif-21/ds_modules_101 | [
"047516e8aa2086e7c0628e23785f9f3ba14b271c"
] | [
"ds_modules_101/Data/__init__.py"
] | [
"import pkg_resources\nimport pandas as pd\n\ntitanic_f = pkg_resources.resource_filename(__name__, 'titanic/titanic.csv')\ntitanic_df = pd.read_csv(titanic_f)\n\nibd_f = pkg_resources.resource_filename(__name__, 'ibd/IBD.csv')\nibd_df = pd.read_csv(ibd_f)\n\nhr_f = pkg_resources.resource_filename(__name__, 'HR/HR.... | [
[
"pandas.read_csv"
]
] |
rhett-chen/airobot | [
"5c098e675c48a2b47ab931df02731c5e0b256bda"
] | [
"scripts/ur5e/sim/camera_pitch.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\nfrom airobot import Robot\n\n\ndef main():\n \"\"\"\n This function demonstrates how the pitch angle (\n the pitch angle that is defined in robot.setup_camera) changes\n the camera view.\n \"\"\"\n robot = Robot('ur5e', pb_cfg={'gui': True})... | [
[
"matplotlib.pyplot.gca",
"numpy.random.rand",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.imshow"
]
] |
vagrantxiao/pylearn2 | [
"95dca41d8f4818399d891fed9bd0c4bedca8efc7"
] | [
"pylearn2/datasets/svhn.py"
] | [
"\"\"\"\n.. todo::\n\n WRITEME\n\"\"\"\nimport os\nimport gc\nimport warnings\ntry:\n import tables\nexcept ImportError:\n warnings.warn(\"Couldn't import tables, so far SVHN is \"\n \"only supported with PyTables\")\nimport numpy\nfrom theano.compat.six.moves import xrange\nfrom theano im... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.nonzero",
"numpy.transpose",
"numpy.arange"
]
] |
clemenshage/grslra | [
"00f61b4ef08208d12e8e803d10f8ebbe16d8614a"
] | [
"experiments/4_grpca/video/print_frames.py"
] | [
"from scipy.io import loadmat\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n# This script prints selected frames of the stored escalator video sequence\n\ndata = loadmat('escalator_130p.mat')\n\nX = data[\"X\"]\ndimensions = data[\"dimensions\"][0]\n\nframenumbers = [1806, 1813, 1820]\n\nfor framenum... | [
[
"numpy.reshape",
"matplotlib.pyplot.savefig",
"scipy.io.loadmat",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.imshow"
]
] |
Sigma-i/traveling-salesman-problem_hybrid | [
"dcb0d263282b6ba94323f1d4e30aee7713ad2b90"
] | [
"traveling_salesman_problem.py"
] | [
"# Copyright 2020 Sigma-i Co.\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.random.choice",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.random.randint",
"matplotlib.pyplot.tight_layout",
"numpy.arange",
"numpy.sqrt"
]
] |
khf118/Unscented-Kalman-Filter | [
"8cb35a9c8246f849a26bf3692ed8ecace963b956"
] | [
"nis_plot.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\nx = \"2 2 6 2 1 2 6 2 0 2 2 0 1 5 2 7 6 4 4 3 2 0 1 0 2 10 0 1 3 2 1 1 0 3 1 2 0 0 0 0 3 0 2 0 0 2 7 2 4 9 4 2 2 1 0 1 3 7 1 1 0 6 6 2 2 6 1 2 3 10 3 5 2 1 0 2 1 2 0 1 4 5 1 1 1 4 0 3 0 0 2 1 1 4 1 1 7 3 2 2 2 4 0 2 0 2 1 2 0 1 3 3 2 2 1 1 0 2 1 2 5 5 1 3 3 2 ... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot"
]
] |
jplalor/transformers-android-demo | [
"926c98ca827319880e25ae18b985e056972c5014"
] | [
"model_converter/nsmc/jit_compile.py"
] | [
"import os\nimport sys\nimport argparse\nsys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))\n\nimport torch\nimport numpy as np\nfrom transformers import ElectraTokenizer, ElectraConfig\n\nfrom model import ElectraForSequenceClassification\n\n\nparser = argparse.ArgumentParser... | [
[
"torch.no_grad",
"torch.jit.load",
"torch.jit.save",
"torch.tensor",
"torch.jit.trace"
]
] |
lyq628/NLP-Tutorials | [
"7c9d117a3542695e79419c835ba9e98ef80800b8"
] | [
"pytorch/transformer.py"
] | [
"import torch.nn as nn\nfrom torch.nn.functional import cross_entropy,softmax, relu\nimport numpy as np\nimport torch\nfrom torch.utils import data\nimport utils\nfrom torch.utils.data import DataLoader\nimport argparse\n\nMAX_LEN = 11\n\nclass MultiHead(nn.Module):\n def __init__(self, n_head, model_dim, drop_r... | [
[
"torch.nn.Linear",
"torch.ones",
"torch.cuda.is_available",
"numpy.cos",
"torch.reshape",
"numpy.sin",
"torch.nn.LayerNorm",
"torch.sqrt",
"torch.tensor",
"torch.utils.data.DataLoader",
"numpy.arange",
"numpy.expand_dims",
"torch.device",
"torch.nn.functiona... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.