code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
# -*- coding: utf-8 -*- from __future__ import division import os import cv2 import numpy as np import sys from flaskholo.detector import roi_helpers from flaskholo.settings import detector_config from keras import backend as K from keras.layers import Input from keras.models import Model import flaskholo.detector.resn...
[ "cv2.putText", "keras.backend.image_data_format", "numpy.argmax", "cv2.getTextSize", "numpy.transpose", "numpy.expand_dims", "keras.models.Model", "numpy.zeros", "cv2.imread", "numpy.max", "numpy.random.randint", "numpy.array", "flaskholo.detector.roi_helpers.apply_regr", "cv2.rectangle", ...
[((755, 826), 'cv2.resize', 'cv2.resize', (['img', '(new_width, new_height)'], {'interpolation': 'cv2.INTER_CUBIC'}), '(img, (new_width, new_height), interpolation=cv2.INTER_CUBIC)\n', (765, 826), False, 'import cv2\n'), ((1170, 1198), 'numpy.transpose', 'np.transpose', (['img', '(2, 0, 1)'], {}), '(img, (2, 0, 1))\n',...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
[ "numpy.random.uniform", "numpy.where", "numpy.random.randint" ]
[((1167, 1203), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': 'inputs.shape'}), '(size=inputs.shape)\n', (1184, 1203), True, 'import numpy as np\n'), ((1718, 1749), 'numpy.where', 'np.where', (['bert_mask', 'inputs', '(-1)'], {}), '(bert_mask, inputs, -1)\n', (1726, 1749), True, 'import numpy as np\n'), ((...
import bisect import collections import datetime as dt import time from typing import List import discord import numpy as np import pandas as pd import seaborn as sns from discord.ext import commands from matplotlib import pyplot as plt from matplotlib import patches as patches from matplotlib import lines as mlines ...
[ "matplotlib.pyplot.title", "tle.util.discord_common.set_author_footer", "tle.util.codeforces_api.user.rating", "tle.util.graph_common.plot_rating_bg", "tle.util.codeforces_common.cache2.rating_changes_cache.get_users_with_more_than_n_contests", "tle.util.codeforces_common.user_db.get_handles_for_guild", ...
[((517, 561), 'pandas.plotting.register_matplotlib_converters', 'pd.plotting.register_matplotlib_converters', ([], {}), '()\n', (559, 561), True, 'import pandas as pd\n'), ((1554, 1587), 'tle.util.graph_common.plot_rating_bg', 'gc.plot_rating_bg', (['cf.RATED_RANKS'], {}), '(cf.RATED_RANKS)\n', (1571, 1587), True, 'fro...
from itertools import cycle, islice import numpy as np import matplotlib.pyplot as plt import matplotlib.tri as tri def roundrobin(*iterables): "roundrobin('ABC', 'D', 'EF') --> A D E B F C" # Recipe credited to <NAME> num_active = len(iterables) nexts = cycle(iter(it).__next__ for it in ite...
[ "matplotlib.pyplot.tripcolor", "matplotlib.pyplot.gca", "matplotlib.pyplot.triplot", "numpy.zeros", "matplotlib.pyplot.colorbar", "numpy.array", "itertools.islice", "matplotlib.tri.Triangulation" ]
[((1068, 1105), 'numpy.zeros', 'np.zeros', (['(2 * number_of_elements, 3)'], {}), '((2 * number_of_elements, 3))\n', (1076, 1105), True, 'import numpy as np\n'), ((1979, 2028), 'matplotlib.tri.Triangulation', 'tri.Triangulation', (['x', 'y', 'triangulation'], {'mask': 'mask'}), '(x, y, triangulation, mask=mask)\n', (19...
""" This module will provide unit conversion capabilities based on the Energistics Unit of Measure Standard v1.0. For more information regarding the Energistics standard, please see http://www.energistics.org/asset-data-management/unit-of-measure-standard Author: <NAME> August 17 - 2016 """ from __future__ import di...
[ "numpy.divide", "numpy.multiply", "lxml.etree.fromstring", "pkg_resources.resource_string", "lxml.etree.QName" ]
[((700, 761), 'pkg_resources.resource_string', 'pkg_resources.resource_string', (['resource_package', '"""/units.xml"""'], {}), "(resource_package, '/units.xml')\n", (729, 761), False, 'import pkg_resources\n'), ((769, 794), 'lxml.etree.fromstring', 'etree.fromstring', (['xmlFile'], {}), '(xmlFile)\n', (785, 794), Fals...
import os import numpy as np class FileUtils: """ Some static methods to support file/ folder delete and creation """ @staticmethod def create_dir(path): """ Create a directory if it doesnt exist :param path: :return: """ if not os.path.exists(path)...
[ "os.remove", "numpy.savetxt", "os.path.exists", "os.makedirs" ]
[((519, 539), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (533, 539), False, 'import os\n'), ((835, 882), 'numpy.savetxt', 'np.savetxt', (['path', 'data'], {'delimiter': '""","""', 'fmt': '"""%s"""'}), "(path, data, delimiter=',', fmt='%s')\n", (845, 882), True, 'import numpy as np\n'), ((300, 320),...
""" =============================== A demo of PBALL2D environment =============================== Illustration of PBall2D environment .. video:: ../../video_plot_pball.mp4 :width: 600 """ # sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_pball.jpg' import numpy as np from rlberry.envs.benchmarks.ball_expl...
[ "numpy.sin", "numpy.array", "numpy.cos", "rlberry.envs.benchmarks.ball_exploration.PBall2D" ]
[((354, 389), 'numpy.array', 'np.array', (['[[1.0, 0.1], [-0.1, 1.0]]'], {}), '([[1.0, 0.1], [-0.1, 1.0]])\n', (362, 389), True, 'import numpy as np\n'), ((411, 436), 'numpy.array', 'np.array', (['[1.0, 0.5, 0.5]'], {}), '([1.0, 0.5, 0.5])\n', (419, 436), True, 'import numpy as np\n'), ((457, 485), 'numpy.array', 'np.a...
# author: jussikai, timoh import os import numpy as np import matplotlib.pyplot as plt import sklearn from sklearn import model_selection import cv2 import tensorflow as tf from tensorflow.keras.layers import Dense, Activation, Flatten from tensorflow.keras.models import Model import efficientnet.tfkeras X = np.load...
[ "numpy.load", "tensorflow.keras.layers.Dense", "sklearn.model_selection.train_test_split", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Flatten" ]
[((313, 329), 'numpy.load', 'np.load', (['"""X.npy"""'], {}), "('X.npy')\n", (320, 329), True, 'import numpy as np\n'), ((334, 350), 'numpy.load', 'np.load', (['"""y.npy"""'], {}), "('y.npy')\n", (341, 350), True, 'import numpy as np\n'), ((432, 493), 'sklearn.model_selection.train_test_split', 'sklearn.model_selection...
from __future__ import print_function from __future__ import division from builtins import zip from builtins import range from past.utils import old_div from tkinter import * from tkinter.ttk import Notebook import tkinter.filedialog from tkinter.font import Font import os import webbrowser import pickle import copy i...
[ "pickle.dump", "webbrowser.open_new", "numpy.abs", "past.utils.old_div", "tkinter.font.Font", "matplotlib.pyplot.figure", "pickle.load", "numpy.arange", "builtins.range", "matplotlib.pyplot.close", "os.path.dirname", "matplotlib.pyplot.rcParams.update", "numpy.linspace", "matplotlib.pyplot...
[((441, 462), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (455, 462), False, 'import matplotlib\n'), ((80100, 80139), 'tkinter.font.Font', 'Font', ([], {'family': '"""Times New Roman"""', 'size': '(12)'}), "(family='Times New Roman', size=12)\n", (80104, 80139), False, 'from tkinter.font impor...
import pandas as pd import torch import math import numpy as np from statistics import mean from sklearn.metrics import r2_score from stewart_intro.train_nn import ( default_dt, default_include_known_forcing, ) from matplotlib import pyplot as plt def get_weighted_r2_score(true, pred, data): weights = np....
[ "matplotlib.pyplot.title", "numpy.random.seed", "matplotlib.pyplot.figure", "pandas.DataFrame", "matplotlib.pyplot.close", "numpy.random.choice", "matplotlib.pyplot.subplots", "numpy.stack", "matplotlib.pyplot.show", "statistics.mean", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.yl...
[((317, 373), 'numpy.concatenate', 'np.concatenate', (['([data.layer_mass.values] * true.shape[0])'], {}), '([data.layer_mass.values] * true.shape[0])\n', (331, 373), True, 'import numpy as np\n'), ((672, 690), 'numpy.random.seed', 'np.random.seed', (['(33)'], {}), '(33)\n', (686, 690), True, 'import numpy as np\n'), (...
import os.path as osp import os.path as osp import numpy as np import torch import torchvision from PIL import Image from torch.utils import data from torchvision import transforms from utils.transform import FixScaleRandomCropWH class densepassDataSet(data.Dataset): def __init__(self, root, list_path, max_iter...
[ "numpy.uint8", "utils.transform.FixScaleRandomCropWH", "torch.utils.data.DataLoader", "numpy.asarray", "numpy.transpose", "PIL.Image.open", "torchvision.utils.make_grid", "numpy.array", "torchvision.transforms.Normalize", "os.path.join", "torchvision.transforms.ToTensor" ]
[((4728, 4762), 'torch.utils.data.DataLoader', 'data.DataLoader', (['dst'], {'batch_size': '(4)'}), '(dst, batch_size=4)\n', (4743, 4762), False, 'from torch.utils import data\n'), ((3994, 4024), 'PIL.Image.open', 'Image.open', (["datafiles['label']"], {}), "(datafiles['label'])\n", (4004, 4024), False, 'from PIL impor...
from typing import List, Optional, Dict import datetime import numpy as np from pydantic import Field, validator from .base import Model from .atom import Atom from .parameter import Bond, Angle, Dihedral, Improper, Ring from .utils import require_package class Molecule(Model): """ATB Molecule""" molid: in...
[ "rdkit.Chem.Mol", "numpy.asarray", "rdkit.Chem.SanitizeMol", "pydantic.Field", "rdkit.Chem.RWMol", "pydantic.validator", "rdkit.Chem.Atom", "datetime.datetime.now" ]
[((409, 428), 'pydantic.Field', 'Field', ([], {'alias': '"""rnme"""'}), "(alias='rnme')\n", (414, 428), False, 'from pydantic import Field, validator\n'), ((829, 876), 'pydantic.Field', 'Field', ([], {'default': '(True)', 'alias': '"""symmetrise_charges"""'}), "(default=True, alias='symmetrise_charges')\n", (834, 876),...
from BLP import BLP import numpy as np from test import Faker from time import time """ This file provides some testing for the acceleration algorithm. Note: ---- Don't expect the test to work every time. There is a lot fine-tuning to do in each run and it is possible that this automatic run will fail due to this lac...
[ "numpy.empty", "test.Faker", "BLP.BLP", "time.time", "numpy.linalg.norm", "numpy.random.rand", "numpy.copyto" ]
[((445, 452), 'test.Faker', 'Faker', ([], {}), '()\n', (450, 452), False, 'from test import Faker\n'), ((499, 554), 'BLP.BLP', 'BLP', (['market.X1', 'market.X2', 'market.Z', 'market.M', 'market.S'], {}), '(market.X1, market.X2, market.Z, market.M, market.S)\n', (502, 554), False, 'from BLP import BLP\n'), ((587, 621), ...
import matplotlib.pyplot as plt import numpy as np import minepy def compute_alpha(npoints): NPOINTS_BINS = [1, 25, 50, 250, 500, 1000, 2500, 5000, 10000, 40000] ALPHAS = [0.85, 0.80, 0.75, 0.70, 0.65, 0.6, 0.55, 0.5, 0.45, 0.4] if npoints < 1: raise ValueError("the number of points must be >=1") ...
[ "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "numpy.sin", "numpy.arange", "minepy.MINE", "numpy.digitize", "matplotlib.pyplot.savefig" ]
[((596, 613), 'numpy.arange', 'np.arange', (['sample'], {}), '(sample)\n', (605, 613), True, 'import numpy as np\n'), ((1054, 1071), 'numpy.arange', 'np.arange', (['sample'], {}), '(sample)\n', (1063, 1071), True, 'import numpy as np\n'), ((1076, 1106), 'numpy.sin', 'np.sin', (['(2 * np.pi * f * x / Fs)'], {}), '(2 * n...
import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' import tensorflow as tf import numpy as np #np.set_printoptions(threshold=np.inf) import pickle from tensorflow.python.platform import gfile from tensorflow.examples.tutorials.mnist import input_data model_filename_before_quantization = "saved_model/cnn_sa_test.pb"; m...
[ "numpy.random.random_sample", "numpy.savetxt", "tensorflow.Session", "tensorflow.placeholder", "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "tensorflow.import_graph_def", "tensorflow.GraphDef" ]
[((3136, 3203), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""MNIST_data"""'], {'one_hot': '(True)', 'reshape': '(True)'}), "('MNIST_data', one_hot=True, reshape=True)\n", (3161, 3203), False, 'from tensorflow.examples.tutorials.mnist import input_data\n'), ((3208, ...
"""Extract training set. Randomly select frame to patch. Patches are stored in several npys. Each npy contains several batches. So there are n x batch_size patches in each npy. Return: a few npy with shape (n x width_patch x width_height x 1), dtype=np.float32 \in [0,1].""" import os, glob, gc, h5py import numpy as np...
[ "h5py.File", "os.makedirs", "math.ceil", "random.shuffle", "numpy.zeros", "os.path.exists", "gc.collect", "random.seed", "os.path.join", "numpy.vstack" ]
[((772, 825), 'numpy.zeros', 'np.zeros', (['(height_frame, width_frame)'], {'dtype': 'np.uint8'}), '((height_frame, width_frame), dtype=np.uint8)\n', (780, 825), True, 'import numpy as np\n'), ((1932, 2001), 'numpy.zeros', 'np.zeros', (['(num_patch, height_patch, width_patch, 1)'], {'dtype': 'np.float32'}), '((num_patc...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from models import InferSent, NLINet, ClassificationNet from data_utils import * import os import sys import time import argparse import copy import numpy as np import torch from torch.autograd import Variable import torch.nn as nn from torch import optim from torch.nn ...
[ "os.mkdir", "numpy.random.seed", "argparse.ArgumentParser", "numpy.argmax", "torch.cuda.device_count", "torch.device", "torch.no_grad", "utils.Error_all.Errors", "torch.load", "os.path.exists", "utils.statistic_all.stat", "random.seed", "models.InferSent", "models.NLINet", "torch.manual_...
[((995, 1018), 'models.InferSent', 'InferSent', (['params_model'], {}), '(params_model)\n', (1004, 1018), False, 'from models import InferSent, NLINet, ClassificationNet\n'), ((1273, 1298), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1296, 1298), False, 'import argparse\n'), ((3260, 3282), ...
""" SPDX-FileCopyrightText: 2021 International Photoacoustic Standardisation Consortium (IPASC) SPDX-FileCopyrightText: 2021 <NAME> SPDX-FileCopyrightText: 2021 <NAME> SPDX-License-Identifier: MIT """ import numpy as np from image_reconstruction.reconstruction_utils.beamforming import back_projection from image_reconst...
[ "image_reconstruction.reconstruction_utils.post_processing.log_compression", "image_reconstruction.reconstruction_utils.post_processing.hilbert_transform_1_d", "numpy.abs" ]
[((4857, 4901), 'image_reconstruction.reconstruction_utils.post_processing.hilbert_transform_1_d', 'hilbert_transform_1_d', (['reconstructed'], {'axis': '(0)'}), '(reconstructed, axis=0)\n', (4878, 4901), False, 'from image_reconstruction.reconstruction_utils.post_processing import hilbert_transform_1_d\n'), ((5038, 50...
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import math x = np.arange(0, 20, 0.25) F = 10*(1 + 3.33 * 0.50*np.sqrt(x) - .35*x) fig = plt.figure() ax = fig.add_subplot(111) # ax = fig.add_subplot(111, projection='3d') ax.plot(x, F) plt.xlim([0,20]) plt.ylim([0,80]) plt.xla...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "numpy.sqrt" ]
[((108, 130), 'numpy.arange', 'np.arange', (['(0)', '(20)', '(0.25)'], {}), '(0, 20, 0.25)\n', (117, 130), True, 'import numpy as np\n'), ((181, 193), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (191, 193), True, 'import matplotlib.pyplot as plt\n'), ((279, 296), 'matplotlib.pyplot.xlim', 'plt.xlim', ([...
import argparse import glob import sys import xml.etree.cElementTree as etree from datetime import datetime from math import atan2, cos, radians, sin, sqrt from typing import Any, List, Tuple import matplotlib.pyplot as plt import numpy as np import pandas as pd DF_COLS_DICT = ["lat", "lon", "ele", "dist"] MIN_FILES ...
[ "pandas.DataFrame", "matplotlib.pyplot.show", "argparse.ArgumentParser", "math.sqrt", "numpy.ravel", "math.radians", "xml.etree.cElementTree.iterparse", "datetime.datetime.now", "math.sin", "glob.glob", "matplotlib.pyplot.subplots", "sys.exit", "numpy.sqrt" ]
[((679, 698), 'glob.glob', 'glob.glob', (['args.dir'], {}), '(args.dir)\n', (688, 698), False, 'import glob\n'), ((1101, 1151), 'xml.etree.cElementTree.iterparse', 'etree.iterparse', (['xml_file'], {'events': "('start', 'end')"}), "(xml_file, events=('start', 'end'))\n", (1116, 1151), True, 'import xml.etree.cElementTr...
from __future__ import absolute_import import torch import torch.nn as nn import torch.nn.functional as F import utils.boxes as box_utils import utils.blob as blob_utils import utils.net as net_utils from core.config import cfg import numpy as np from sklearn.cluster import KMeans try: xrange # Python 2...
[ "utils.blob.zeros", "numpy.sum", "numpy.argmax", "sklearn.cluster.KMeans", "numpy.zeros", "torch.nonzero", "numpy.ones", "numpy.hstack", "numpy.argsort", "numpy.max", "numpy.where", "numpy.array", "utils.boxes.bbox_transform_inv", "torch.log", "numpy.vstack" ]
[((2877, 2911), 'numpy.zeros', 'np.zeros', (['(0, 4)'], {'dtype': 'np.float32'}), '((0, 4), dtype=np.float32)\n', (2885, 2911), True, 'import numpy as np\n'), ((2929, 2961), 'numpy.zeros', 'np.zeros', (['(0, 1)'], {'dtype': 'np.int32'}), '((0, 1), dtype=np.int32)\n', (2937, 2961), True, 'import numpy as np\n'), ((2978,...
""" Read in the results for different algorithms and different amounts of temporal binning and plot the -log(FPF) over the binning factor. """ # ----------------------------------------------------------------------------- # IMPORTS # ----------------------------------------------------------------------------- impor...
[ "hsr4hci.plotting.set_fontsize", "argparse.ArgumentParser", "pandas.read_csv", "hsr4hci.data.load_metadata", "time.time", "numpy.argsort", "hsr4hci.plotting.adjust_luminosity", "matplotlib.pyplot.subplots", "hsr4hci.config.get_experiments_dir", "matplotlib.pyplot.savefig" ]
[((979, 990), 'time.time', 'time.time', ([], {}), '()\n', (988, 990), False, 'import time\n'), ((1310, 1335), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1333, 1335), False, 'import argparse\n'), ((2255, 2290), 'hsr4hci.data.load_metadata', 'load_metadata', ([], {'name_or_path': 'dataset'})...
import pandas as pd import numpy as np import sqlite3 import click import os from .data_handling import check_sqlite_table from .report import plot_scores def export_tsv(infile, outfile, format, outcsv, transition_quantification, max_transition_pep, ipf, ipf_max_peptidoform_pep, max_rs_peakgroup_qvalue, peptide, max...
[ "os.path.basename", "pandas.merge", "click.echo", "numpy.min", "sqlite3.connect", "pandas.read_sql_query" ]
[((392, 415), 'sqlite3.connect', 'sqlite3.connect', (['infile'], {}), '(infile)\n', (407, 415), False, 'import sqlite3\n'), ((11066, 11119), 'click.echo', 'click.echo', (['"""Info: Reading peak group-level results."""'], {}), "('Info: Reading peak group-level results.')\n", (11076, 11119), False, 'import click\n'), ((1...
import tensorflow as tf import numpy as np import argparse import Nets import os import sys import time import cv2 import json import datetime import shutil from matplotlib import pyplot as plt from Data_utils import data_reader,weights_utils,preprocessing from Losses import loss_factory from Sampler import sampler_fac...
[ "Data_utils.weights_utils.get_var_to_restore_list", "tensorflow.reduce_sum", "numpy.sum", "argparse.ArgumentParser", "tensorflow.zeros_like", "numpy.clip", "tensorflow.local_variables_initializer", "tensorflow.ConfigProto", "numpy.exp", "Nets.get_stereo_net", "Losses.loss_factory.get_reprojectio...
[((2620, 2660), 'tensorflow.train.MomentumOptimizer', 'tf.train.MomentumOptimizer', (['args.lr', '(0.9)'], {}), '(args.lr, 0.9)\n', (2646, 2660), True, 'import tensorflow as tf\n'), ((4809, 4841), 'tensorflow.GPUOptions', 'tf.GPUOptions', ([], {'allow_growth': '(True)'}), '(allow_growth=True)\n', (4822, 4841), True, 'i...
"""This module provides a pseudo-random generator.""" # Module docstring import numpy XORSHIFT32_DEFAULT_SHIFTS = 13, 17, 5 """Default triple for xorshift32.""" # Attribute docstring def xorshift32(last_value, shift_triple=None): """Returns the next pseudo-random uint32 from current value and triple. S...
[ "numpy.uint32" ]
[((424, 448), 'numpy.uint32', 'numpy.uint32', (['last_value'], {}), '(last_value)\n', (436, 448), False, 'import numpy\n'), ((1098, 1116), 'numpy.uint32', 'numpy.uint32', (['seed'], {}), '(seed)\n', (1110, 1116), False, 'import numpy\n')]
#!/usr/bin/env python import argparse import os import cv2 import numpy as np import plantcv as pcv # Parse command-line arguments def options(): parser = argparse.ArgumentParser(description="Imaging processing with opencv") parser.add_argument("-i", "--image", help="Input image file.", required=True) pa...
[ "plantcv.analyze_object", "argparse.ArgumentParser", "plantcv.resize", "plantcv.analyze_color", "plantcv.get_nir", "numpy.copy", "cv2.cvtColor", "plantcv.naive_bayes_classifier", "plantcv.rgb2gray", "plantcv.find_objects", "plantcv.define_roi", "plantcv.analyze_bound", "plantcv.crop_position...
[((162, 231), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Imaging processing with opencv"""'}), "(description='Imaging processing with opencv')\n", (185, 231), False, 'import argparse\n'), ((1077, 1129), 'plantcv.readimage', 'pcv.readimage', ([], {'filename': 'args.image', 'debug': 'a...
import ipyvolume as ipv import ipywidgets as ipw import numpy as np from ipywidgets_bokeh import IPyWidget from bokeh.layouts import column, row from bokeh.models import Slider from bokeh.plotting import curdoc x, y, z = np.random.random((3, 1000)) ipv.quickscatter(x, y, z, size=1, marker="sphere") plot = ipv.current...
[ "numpy.radians", "ipyvolume.quickscatter", "ipywidgets.Button", "bokeh.models.Slider", "numpy.degrees", "numpy.random.random", "bokeh.plotting.curdoc", "ipywidgets_bokeh.IPyWidget", "bokeh.layouts.column", "bokeh.layouts.row" ]
[((223, 250), 'numpy.random.random', 'np.random.random', (['(3, 1000)'], {}), '((3, 1000))\n', (239, 250), True, 'import numpy as np\n'), ((251, 301), 'ipyvolume.quickscatter', 'ipv.quickscatter', (['x', 'y', 'z'], {'size': '(1)', 'marker': '"""sphere"""'}), "(x, y, z, size=1, marker='sphere')\n", (267, 301), True, 'im...
import argparse from abc import ABC from typing import Optional import numpy as np def create_treatment_assignment_dict( all_treatment_ids, sorted_selected_idx, propensities_of_selected_treatments ) -> dict: selected_treatment_ids = [all_treatment_ids[id] for id in sorted_selected_idx] return { "...
[ "numpy.random.uniform", "numpy.argsort", "numpy.max", "numpy.random.choice", "numpy.eye" ]
[((2177, 2243), 'numpy.random.choice', 'np.random.choice', ([], {'a': 'self.treatment_ids', 'p': 'propensity_probabilities'}), '(a=self.treatment_ids, p=propensity_probabilities)\n', (2193, 2243), True, 'import numpy as np\n'), ((3128, 3164), 'numpy.argsort', 'np.argsort', (['propensity_probabilities'], {}), '(propensi...
from src.constants import NUM_CORES import pandas as pd import numpy as np from multiprocessing.pool import Pool def parallelize_dataframe(df: pd.DataFrame, func, n_cores=NUM_CORES): df_split = np.array_split(df, n_cores) pool = Pool(n_cores) df = pd.concat(pool.map(func, df_split)) pool.clo...
[ "numpy.array_split", "multiprocessing.pool.Pool" ]
[((207, 234), 'numpy.array_split', 'np.array_split', (['df', 'n_cores'], {}), '(df, n_cores)\n', (221, 234), True, 'import numpy as np\n'), ((247, 260), 'multiprocessing.pool.Pool', 'Pool', (['n_cores'], {}), '(n_cores)\n', (251, 260), False, 'from multiprocessing.pool import Pool\n')]
import numpy as np matrix = np.random.randint(10, size=(5, 5)) print(matrix); i=0; j=0; shortestPath = []; while "true": if i >= 5: break; center = int(matrix[i][j]); nearElements = []; top = 0; if i > 0: nearElements.append([i - 1, j, (matrix[i - 1][j])]); top = (matrix[i...
[ "numpy.random.randint" ]
[((28, 62), 'numpy.random.randint', 'np.random.randint', (['(10)'], {'size': '(5, 5)'}), '(10, size=(5, 5))\n', (45, 62), True, 'import numpy as np\n')]
import numpy as np import pandas as pd import matplotlib.pyplot as plt import os from fastai.imports import * from fastai.transforms import * from fastai.conv_learner import * from fastai.model import * from fastai.dataset import * from fastai.sgdr import * from fastai.plots import * def reshape_img(matrix): """ ...
[ "numpy.stack", "pandas.read_csv", "matplotlib.pyplot.imshow", "numpy.array", "numpy.exp" ]
[((3629, 3658), 'pandas.read_csv', 'pd.read_csv', (['f"""{wd}train.csv"""'], {}), "(f'{wd}train.csv')\n", (3640, 3658), True, 'import pandas as pd\n'), ((3669, 3697), 'pandas.read_csv', 'pd.read_csv', (['f"""{wd}test.csv"""'], {}), "(f'{wd}test.csv')\n", (3680, 3697), True, 'import pandas as pd\n'), ((4246, 4274), 'mat...
from typing import Tuple import numpy as np import pandas as pd class DecisionStump: def __init__(self, epsilon: float = 1e-6): r"""A depth-1 decision tree classifier Args: epsilon: float To classify all the points in the training set as +1, the model ...
[ "pandas.DataFrame", "numpy.average", "pandas.Series", "numpy.argmin" ]
[((2456, 2476), 'pandas.DataFrame', 'pd.DataFrame', (['errors'], {}), '(errors)\n', (2468, 2476), True, 'import pandas as pd\n'), ((2612, 2644), 'numpy.argmin', 'np.argmin', (['errors_arr'], {'axis': 'None'}), '(errors_arr, axis=None)\n', (2621, 2644), True, 'import numpy as np\n'), ((4179, 4207), 'numpy.average', 'np....
# coding: utf-8 # ## Data Visualizations # In[141]: from matplotlib import pyplot as plt import numpy as np import os import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from scipy import stats get_ipython().magic('matplotlib inline') # In[7]: path = "./data/" file_list =...
[ "matplotlib.pyplot.title", "numpy.load", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "sklearn.manifold.TSNE", "plotly.offline.plot", "numpy.shape", "seaborn.distplot", "matplotlib.pyplot.set_title", "matplotlib.pyplot.ylabel", "plotly.offline.init_notebook_mode", "matplotlib.pyplot.xla...
[((321, 337), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (331, 337), False, 'import os\n'), ((368, 396), 'numpy.load', 'np.load', (['(path + file_list[0])'], {}), '(path + file_list[0])\n', (375, 396), True, 'import numpy as np\n'), ((538, 554), 'numpy.shape', 'np.shape', (['signal'], {}), '(signal)\n', (5...
import os import argparse import numpy as np import tensorflow as tf from tensorflow.keras import backend as K from model.model_fn import build_compile_model_pred def get_numpy_dataset(fname, batch_size=64): tmp = np.transpose(np.load(fname), [3,0,1,2]) BATCH_SIZE = batch_size test_dataset = tf.data.Datase...
[ "numpy.load", "numpy.save", "argparse.ArgumentParser", "model.model_fn.build_compile_model_pred", "numpy.zeros", "tensorflow.compat.v1.data.make_one_shot_iterator", "numpy.expand_dims", "skimage.transform.resize", "os.path.splitext", "skimage.io.imread" ]
[((615, 713), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""gamma-net predicts log10 gamma power for a given image"""'}), "(description=\n 'gamma-net predicts log10 gamma power for a given image')\n", (638, 713), False, 'import argparse\n'), ((929, 957), 'os.path.splitext', 'os.path....
""" To describe the workflow using some methods ** Intended to be used line by line """ import matplotlib.pyplot as plt # to be removed later. import numpy.ma as ma import numpy as np from astropy import wcs import data_reduction as dr import image_synthesis as im working_dir = "/home/pranshu/Downloads/work/Jupiter...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.ones", "data_reduction.BinaryConvert", "numpy.array", "numpy.ma.masked_array" ]
[((334, 352), 'data_reduction.BinaryConvert', 'dr.BinaryConvert', ([], {}), '()\n', (350, 352), True, 'import data_reduction as dr\n'), ((735, 749), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (743, 749), True, 'import numpy as np\n'), ((2110, 2122), 'matplotlib.pyplot.legend', 'plt.legend', ([], {}), '()\n'...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # @file snowflake_neural_logic.py # @brief # @author QRS # @blog qrsforever.github.io # @version 1.0 # @date 2019-06-01 17:19:23 ################################ jupyter-vim ####################################### # https://github.com/qrsforever/vim/blob/master/bundle/.conf...
[ "tensorflow.print", "tensorflow.logging.set_verbosity", "numpy.random.randint", "numpy.sin", "matplotlib.pyplot.gca", "tensorflow.stack", "tensorflow.placeholder", "matplotlib.patches.PathPatch", "memory_util.capture_stderr", "memory_util.vlog", "tensorflow.control_dependencies", "matplotlib.p...
[((826, 845), 'memory_util.vlog', 'memory_util.vlog', (['(1)'], {}), '(1)\n', (842, 845), False, 'import memory_util\n'), ((1079, 1121), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.ERROR'], {}), '(tf.logging.ERROR)\n', (1103, 1121), True, 'import tensorflow as tf\n'), ((1424, 1436), 't...
from cosmogrb.instruments.gbm import GBMGRB_CPL import popsynth from popsynth.aux_samplers.normal_aux_sampler import NormalAuxSampler from popsynth.aux_samplers.trunc_normal_aux_sampler import TruncatedNormalAuxSampler from popsynth.aux_samplers.lognormal_aux_sampler import LogNormalAuxSampler from cosmogrb.instrument...
[ "popsynth.aux_samplers.trunc_normal_aux_sampler.TruncatedNormalAuxSampler", "popsynth.populations.ParetoSFRPopulation", "numpy.sqrt", "popsynth.aux_samplers.lognormal_aux_sampler.LogNormalAuxSampler" ]
[((1452, 1606), 'popsynth.populations.ParetoSFRPopulation', 'popsynth.populations.ParetoSFRPopulation', ([], {'r0': 'r0_true', 'rise': 'rise_true', 'decay': 'decay_true', 'peak': 'peak_true', 'Lmin': 'Lmin_true', 'alpha': 'alpha_true', 'r_max': 'r_max'}), '(r0=r0_true, rise=rise_true, decay=\n decay_true, peak=peak_...
from skyfield.api import EarthSatellite, load, wgs84 from vpython.vpython import print_to_string import getData import numpy as np from vpython import * def inf_loop(): ts = load.timescale() line1 ,line2,name = getData.get_sat_data() satellite = EarthSatellite(line1, line2, name, ts) R = 6.563e+6 ...
[ "skyfield.api.load.timescale", "skyfield.api.wgs84.latlon_of", "skyfield.api.EarthSatellite", "getData.get_sat_data", "numpy.array" ]
[((179, 195), 'skyfield.api.load.timescale', 'load.timescale', ([], {}), '()\n', (193, 195), False, 'from skyfield.api import EarthSatellite, load, wgs84\n'), ((220, 242), 'getData.get_sat_data', 'getData.get_sat_data', ([], {}), '()\n', (240, 242), False, 'import getData\n'), ((259, 297), 'skyfield.api.EarthSatellite'...
# coding: utf-8 # # Introduction # In this assignment, we analyse signals using the Fast Fourier transform, or the FFT for short. The FFT is a fast implementation of the Discrete Fourier transform(DFT). It runs in $\mathcal{O}(n \log n)$ time complexity. We find the FFTs of various types of signals using the numpy.ff...
[ "matplotlib.pyplot.show", "numpy.sin", "numpy.cos", "numpy.linspace", "matplotlib.pyplot.subplots", "numpy.sqrt" ]
[((1048, 1063), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)'], {}), '(2)\n', (1060, 1063), True, 'import matplotlib.pyplot as plt\n'), ((1473, 1483), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1481, 1483), True, 'import matplotlib.pyplot as plt\n'), ((2106, 2121), 'matplotlib.pyplot.subplots', 'p...
import csv import glob import numpy as np save_path = './save/test/' def parse_scores(fname, maximize_F1=True): # f'ensumble_F1=({results['F1']:05.2f})_EM=({results['EM']:05.2f}).csv' str_list = fname.split('(') F1 = float(str_list[-2][:5]) EM = float(str_list[-1][:5]) if maximize_F1: retu...
[ "csv.writer", "numpy.argmax", "csv.DictReader", "numpy.array", "glob.glob" ]
[((2509, 2542), 'csv.writer', 'csv.writer', (['csv_fh'], {'delimiter': '""","""'}), "(csv_fh, delimiter=',')\n", (2519, 2542), False, 'import csv\n'), ((425, 441), 'numpy.array', 'np.array', (['counts'], {}), '(counts)\n', (433, 441), True, 'import numpy as np\n'), ((810, 855), 'glob.glob', 'glob.glob', (["(save_path +...
""" Contains the function 'ornstein_uhlenbeck' and auxiliary functions. """ import math import numpy as np def ornstein_uhlenbeck(n1, n2, h=0.1): """ Computes the Ornstein-Uhlenbeck covariance matrix with given size and correlation length. The entries of the matrix are given by cov[i,j] = exp(-||pos(...
[ "numpy.dstack", "numpy.zeros", "numpy.subtract.outer", "numpy.linalg.norm", "numpy.exp", "numpy.array" ]
[((964, 986), 'numpy.zeros', 'np.zeros', (['(n1 * n2, 2)'], {}), '((n1 * n2, 2))\n', (972, 986), True, 'import numpy as np\n'), ((1059, 1094), 'numpy.subtract.outer', 'np.subtract.outer', (['p[:, 0]', 'p[:, 0]'], {}), '(p[:, 0], p[:, 0])\n', (1076, 1094), True, 'import numpy as np\n'), ((1106, 1141), 'numpy.subtract.ou...
import os import glob import multiprocessing import itertools import argparse import numpy as np import pandas as pd import matplotlib.image as mpimg from sklearn.cluster import DBSCAN from subprocess import PIPE, Popen import scipy.spatial from scipy.optimize import curve_fit import warnings warnings.simplefilter(act...
[ "argparse.ArgumentParser", "pandas.read_csv", "qrdar.identify_codes", "numpy.isnan", "numpy.linalg.norm", "numpy.tile", "sklearn.cluster.DBSCAN", "pandas.DataFrame", "warnings.simplefilter", "pandas.merge", "numpy.identity", "qrdar.common.apply_rotation", "numpy.matrixlib.defmatrix.matrix", ...
[((295, 351), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'Warning'}), "(action='ignore', category=Warning)\n", (316, 351), False, 'import warnings\n'), ((1014, 1046), 'numpy.matrixlib.defmatrix.matrix', 'np.matrixlib.defmatrix.matrix', (['A'], {}), '(A)\n', (1043, 1046...
""" Functions for reading .csv files """ import numpy as np from . import functions as fn from .babelscan import Scan "----------------------------LOAD FUNCTIONS---------------------------------" def read_csv_file(filename): """ Reads text file, assumes comma separated and comments defined by # :param...
[ "numpy.genfromtxt" ]
[((1052, 1091), 'numpy.genfromtxt', 'np.genfromtxt', (['lines[n:]'], {'delimiter': '""","""'}), "(lines[n:], delimiter=',')\n", (1065, 1091), True, 'import numpy as np\n')]
import torch.nn as nn import numpy as np from .captionAPI import * class BaseAttack: def __init__(self, encoder, decoder, word_map, attack_norm, device, config): self.encoder = encoder self.decoder = decoder self.word_map = word_map self.attack_norm = attack_norm self.devi...
[ "torch.nn.MSELoss", "torch.nn.ReLU", "torch.nn.BCELoss", "torch.nn.Softmax", "numpy.array", "torch.nn.Flatten" ]
[((545, 562), 'torch.nn.Softmax', 'nn.Softmax', ([], {'dim': '(1)'}), '(dim=1)\n', (555, 562), True, 'import torch.nn as nn\n'), ((587, 615), 'torch.nn.BCELoss', 'nn.BCELoss', ([], {'reduction': '"""none"""'}), "(reduction='none')\n", (597, 615), True, 'import torch.nn as nn\n'), ((640, 668), 'torch.nn.MSELoss', 'nn.MS...
import numpy as np import matplotlib.pyplot as plt import pandas as pd from scipy.spatial import distance from pymongo import MongoClient import re import distance_calculation class GeneticAlgorithm: # Initialization def __init__(self, path=None, n_gene=256, n_parent=10, change_ratio=0.1): self.n_gene...
[ "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "matplotlib.pyplot.annotate", "numpy.empty", "pandas.read_csv", "numpy.zeros", "numpy.argsort", "numpy.random.randint", "numpy.arange", "scipy.spatial.distance.pdist", "matplotlib.pyplot.y...
[((5360, 5381), 'numpy.empty', 'np.empty', (['(0, 2)', 'int'], {}), '((0, 2), int)\n', (5368, 5381), True, 'import numpy as np\n'), ((467, 505), 'distance_calculation.DistCalculation', 'distance_calculation.DistCalculation', ([], {}), '()\n', (503, 505), False, 'import distance_calculation\n'), ((782, 828), 'numpy.zero...
import numpy as np import autoarray as aa def test__pixelization_index_for_sub_slim_index__matches_util(): grid = aa.Grid2D.manual_slim( [ [1.5, -1.0], [1.3, 0.0], [1.0, 1.9], [-0.20, -1.0], [-5.0, 0.32], [6.5, 1.0], ...
[ "numpy.full", "autoarray.util.mapper.adaptive_pixel_signals_from", "autoarray.Grid2DRectangular.overlay_grid", "numpy.array", "autoarray.Mapper", "autoarray.Grid2D.manual_slim", "autoarray.util.grid_2d.grid_pixel_indexes_2d_slim_from" ]
[((129, 321), 'autoarray.Grid2D.manual_slim', 'aa.Grid2D.manual_slim', (['[[1.5, -1.0], [1.3, 0.0], [1.0, 1.9], [-0.2, -1.0], [-5.0, 0.32], [6.5, 1.0\n ], [-0.34, -7.34], [-0.34, 0.75], [-6.0, 8.0]]'], {'pixel_scales': '(1.0)', 'shape_native': '(3, 3)'}), '([[1.5, -1.0], [1.3, 0.0], [1.0, 1.9], [-0.2, -1.0], [\n ...
import numpy as np from .DLX import DLX from .Node import Node class Sudoku: def solve(self, sudokArr): solver = DLX() solver.create_matrix(sudokArr) dlx_solution, found = solver.search() return dlx_solution, found # converts the quadruple linked list solution form back to nump...
[ "numpy.full" ]
[((620, 641), 'numpy.full', 'np.full', (['(9, 9)', '(-1.0)'], {}), '((9, 9), -1.0)\n', (627, 641), True, 'import numpy as np\n')]
"""# Part 2: Second Approach : Gilbert-Shannon-Reeds-Shuffling-Algorithm """ # Commented out IPython magic to ensure Python compatibility. import numpy as np import matplotlib.pyplot as plt # %matplotlib inline def get_random_number_for_right_deck(num): if num>0: return np.random.randint(0,num+1) els...
[ "matplotlib.pyplot.show", "numpy.random.binomial", "numpy.log2", "numpy.square", "numpy.random.randint", "numpy.array", "numpy.arange", "numpy.interp", "matplotlib.pyplot.subplots" ]
[((5526, 5542), 'numpy.arange', 'np.arange', (['(1)', '(53)'], {}), '(1, 53)\n', (5535, 5542), True, 'import numpy as np\n'), ((1301, 1324), 'numpy.array', 'np.array', (['shuffledCards'], {}), '(shuffledCards)\n', (1309, 1324), True, 'import numpy as np\n'), ((4156, 4202), 'numpy.interp', 'np.interp', (['y_intrsct', 'N...
import pandas as pd import numpy import numpy.random import os from sklearn.metrics import pairwise_distances import pickle TAGS = ["numerical-binsensitive"] #, "categorical-binsensitive"] TRAINING_PERCENT = 2.0 / 3.0 class ProcessedData(): def __init__(self, data_obj): self.data = data_obj self....
[ "sklearn.metrics.pairwise_distances", "numpy.arange", "numpy.random.shuffle" ]
[((966, 981), 'numpy.arange', 'numpy.arange', (['n'], {}), '(n)\n', (978, 981), False, 'import numpy\n'), ((994, 1017), 'numpy.random.shuffle', 'numpy.random.shuffle', (['a'], {}), '(a)\n', (1014, 1017), False, 'import numpy\n'), ((2545, 2597), 'sklearn.metrics.pairwise_distances', 'pairwise_distances', (['features'], ...
import cv2 import numpy as np from utils import conversions as conv def read_pair(pair_file_path, line_index=0): f = open(pair_file_path) line = f.readlines()[line_index].split() rgb_path = 'rgbd_dataset_freiburg2_desk/' + line[1] depth_path = 'rgbd_dataset_freiburg2_desk/' + line[3] timestamp = l...
[ "cv2.imread", "numpy.asarray", "numpy.zeros" ]
[((983, 1007), 'numpy.zeros', 'np.zeros', (['num'], {'dtype': 'int'}), '(num, dtype=int)\n', (991, 1007), True, 'import numpy as np\n'), ((759, 791), 'numpy.asarray', 'np.asarray', (['pose'], {'dtype': '"""double"""'}), "(pose, dtype='double')\n", (769, 791), True, 'import numpy as np\n'), ((339, 381), 'cv2.imread', 'c...
#!/usr/bin/env python import math import numpy as np import operator import pygame from scripts.grid import Grid from scripts.motors import Motors def action2drive(action): if action == "Reverse": return [-255, -255] elif action == "Left": return [-255, 255] elif action == "Right": ...
[ "scripts.motors.Motors", "scripts.grid.Grid", "math.sin", "numpy.mean", "numpy.array", "math.cos", "pygame.draw.polygon" ]
[((889, 903), 'scripts.grid.Grid', 'Grid', (['(300)', 'res'], {}), '(300, res)\n', (893, 903), False, 'from scripts.grid import Grid\n'), ((1152, 1162), 'scripts.motors.Motors', 'Motors', (['nb'], {}), '(nb)\n', (1158, 1162), False, 'from scripts.motors import Motors\n'), ((2792, 2839), 'pygame.draw.polygon', 'pygame.d...
#!/usr/bin/env python import numpy as np from . import pg_utilities from . import imports_and_exports import sys from numpy import matlib """ .. module:: analyse_tree :synopsis: One sentence synopis (brief) could appear in module index. :synopsis:A longer synopsis that could appear on the home page for that module...
[ "numpy.sum", "numpy.nan_to_num", "numpy.resize", "numpy.maximum", "numpy.double", "numpy.ones", "numpy.mean", "numpy.linalg.norm", "numpy.meshgrid", "numpy.copy", "numpy.extract", "numpy.std", "numpy.int", "numpy.linspace", "numpy.log10", "numpy.arccos", "numpy.trapz", "numpy.squar...
[((2484, 2514), 'numpy.zeros', 'np.zeros', (['num_elems'], {'dtype': 'int'}), '(num_elems, dtype=int)\n', (2492, 2514), True, 'import numpy as np\n'), ((3015, 3037), 'numpy.zeros', 'np.zeros', (['num_branches'], {}), '(num_branches)\n', (3023, 3037), True, 'import numpy as np\n'), ((3054, 3076), 'numpy.zeros', 'np.zero...
from __future__ import division import numpy as np from common_variables import user_column, item_colum, rating_column, threshold, k from metrics import precision, antiprecision, recall, fallout, ndcg_k, ndcl_k, mean_reciprocal_rank, anti_mean_reciprocal_rank from utils import change_relevance from statistics import me...
[ "metrics.mean_reciprocal_rank", "metrics.anti_mean_reciprocal_rank", "numpy.mean", "metrics.fallout", "statistics.mean", "utils.change_relevance", "metrics.ndcg_k", "metrics.precision", "metrics.antiprecision", "metrics.ndcl_k", "metrics.recall" ]
[((2765, 2785), 'numpy.mean', 'np.mean', (['recall_list'], {}), '(recall_list)\n', (2772, 2785), True, 'import numpy as np\n'), ((2800, 2821), 'numpy.mean', 'np.mean', (['fallout_list'], {}), '(fallout_list)\n', (2807, 2821), True, 'import numpy as np\n'), ((2838, 2861), 'numpy.mean', 'np.mean', (['precision_list'], {}...
import csv import sys import numpy import math from numpy import genfromtxt from numpy.linalg import inv import random from random import randint import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import axes3d, Axes3D #import time #start_time = time.time() PrintEnabled = 0 X = genfromtxt(sys.argv[1], delimit...
[ "math.exp", "matplotlib.pyplot.show", "random.randint", "mpl_toolkits.mplot3d.Axes3D", "csv.writer", "numpy.multiply", "numpy.zeros", "numpy.genfromtxt", "numpy.transpose", "random.random", "matplotlib.pyplot.figure", "numpy.linalg.inv", "numpy.linalg.det" ]
[((289, 327), 'numpy.genfromtxt', 'genfromtxt', (['sys.argv[1]'], {'delimiter': '""","""'}), "(sys.argv[1], delimiter=',')\n", (299, 327), False, 'from numpy import genfromtxt\n'), ((783, 808), 'numpy.zeros', 'numpy.zeros', ([], {'shape': '(N, 1)'}), '(shape=(N, 1))\n', (794, 808), False, 'import numpy\n'), ((833, 867)...
from albumentations import Compose, ElasticTransform, Flip, CoarseDropout, RandomCrop, pytorch, Normalize, Resize, \ HorizontalFlip, Rotate, PadIfNeeded, CenterCrop, Cutout import numpy as np class CustomCompose: def __init__(self,transforms): self.transforms = transforms def __call__(self, img):...
[ "numpy.array" ]
[((335, 348), 'numpy.array', 'np.array', (['img'], {}), '(img)\n', (343, 348), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- from __future__ import print_function import numpy as np from typing import Tuple, List, Iterable from sklearn import linear_model as lm from skultrafast.base_funcs.base_functions_np import _fold_exp, _coh_gaussian def _make_base(tup, taus, w=0.1, add_coh=True, add_const=False, norm=Fa...
[ "sklearn.linear_model.ElasticNetCV", "skultrafast.base_funcs.base_functions_np._coh_gaussian", "sklearn.linear_model.MultiTaskElasticNet", "numpy.abs", "sklearn.linear_model.ElasticNet", "numpy.empty", "numpy.empty_like", "skultrafast.base_funcs.base_functions_np._fold_exp", "numpy.hstack" ]
[((2215, 2256), 'numpy.empty', 'np.empty', (['(X.shape[1], tup.data.shape[1])'], {}), '((X.shape[1], tup.data.shape[1]))\n', (2223, 2256), True, 'import numpy as np\n'), ((2268, 2291), 'numpy.empty_like', 'np.empty_like', (['tup.data'], {}), '(tup.data)\n', (2281, 2291), True, 'import numpy as np\n'), ((2306, 2333), 'n...
from keras.losses import binary_crossentropy from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPool2D from keras import losses, Input, Model from keras.callbacks import EarlyStopping from keras.regularizers import l2, l1_l2 from keras.optimizers import SGD, Ada...
[ "sklearn.preprocessing.StandardScaler", "keras.layers.MaxPool2D", "numpy.isnan", "off_sample_utils.resize_image", "numpy.around", "sklearn.metrics.f1_score", "numpy.arange", "keras.regularizers.l1_l2", "numpy.unique", "sklearn.decomposition.TruncatedSVD", "keras.layers.Flatten", "keras.layers....
[((1161, 1173), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1171, 1173), False, 'from keras.models import Sequential\n'), ((6788, 6814), 'numpy.stack', 'np.stack', (['tta_list'], {'axis': '(0)'}), '(tta_list, axis=0)\n', (6796, 6814), True, 'import numpy as np\n'), ((12584, 12608), 'numpy.unique', 'np.u...
import fast_ffts import numpy as np def shift(data, deltax, deltay, phase=0, nthreads=1, use_numpy_fft=False, return_abs=False, return_real=True): """ FFT-based sub-pixel image shift http://www.mathworks.com/matlabcentral/fileexchange/18401-efficient-subpixel-image-registration-by-cross-correlation...
[ "numpy.meshgrid", "numpy.abs", "numpy.nan_to_num", "numpy.ceil", "numpy.fix", "numpy.isnan", "fast_ffts.get_ffts", "numpy.exp", "numpy.real" ]
[((428, 494), 'fast_ffts.get_ffts', 'fast_ffts.get_ffts', ([], {'nthreads': 'nthreads', 'use_numpy_fft': 'use_numpy_fft'}), '(nthreads=nthreads, use_numpy_fft=use_numpy_fft)\n', (446, 494), False, 'import fast_ffts\n'), ((743, 762), 'numpy.meshgrid', 'np.meshgrid', (['Nx', 'Ny'], {}), '(Nx, Ny)\n', (754, 762), True, 'i...
######################################################################## # Author(s): <NAME> # Date: 21 September 2021 # Desc: Code to apply SP3 corrections to satellite states ######################################################################## from datetime import datetime, timedelta from io im...
[ "numpy.zeros", "numpy.expand_dims", "datetime.datetime", "collections.defaultdict", "numpy.sin", "numpy.array", "datetime.timedelta", "numpy.cos", "scipy.interpolate.interp1d" ]
[((528, 567), 'datetime.datetime', 'datetime', (['(2014)', '(2)', '(16)', '(0)', '(0)', '(0)', '(0)', 'None'], {}), '(2014, 2, 16, 0, 0, 0, 0, None)\n', (536, 567), False, 'from datetime import datetime, timedelta\n'), ((1191, 1208), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1202, 1208), Fa...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Extract TEC values from an IONEX file given a specific time and geographic coordinate. Created on Tue Apr 24 11:46:57 2018 @author: mevius """ import numpy as np import datetime import scipy.ndimage.filters as myfilter import logging import os import ftplib import s...
[ "numpy.absolute", "os.remove", "numpy.abs", "os.path.isfile", "numpy.arange", "os.path.join", "logging.error", "numpy.zeros_like", "logging.warning", "datetime.timedelta", "numpy.ones_like", "numpy.remainder", "datetime.date", "os.system", "numpy.concatenate", "scipy.ndimage.filters.ga...
[((328, 368), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.ERROR'}), '(level=logging.ERROR)\n', (347, 368), False, 'import logging\n'), ((2173, 2223), 'numpy.arange', 'np.arange', (['start_lon', '(end_lon + step_lon)', 'step_lon'], {}), '(start_lon, end_lon + step_lon, step_lon)\n', (2182, 2223...
import numpy as np import luibeal as lb import torch import os DECK_PATH = os.path.join('.', 'data', 'rand_exp') def exponential(p0, exp, t): return p0 * np.exp(exp * t) def random_exponential_decline(tlim, lseq, p0_mean, exp_mean=-0.1): noise = 0.1 t = np.linspace(*tlim, lseq) p = exponential(p0_m...
[ "numpy.random.seed", "luibeal.input.Input", "luibeal.deck.Deck", "luibeal.util.save_as", "numpy.linspace", "numpy.exp", "numpy.random.normal", "os.path.join", "torch.from_numpy" ]
[((76, 113), 'os.path.join', 'os.path.join', (['"""."""', '"""data"""', '"""rand_exp"""'], {}), "('.', 'data', 'rand_exp')\n", (88, 113), False, 'import os\n'), ((271, 295), 'numpy.linspace', 'np.linspace', (['*tlim', 'lseq'], {}), '(*tlim, lseq)\n', (282, 295), True, 'import numpy as np\n'), ((389, 408), 'torch.from_n...
from psenet_ctw import PSENET_CTW import torch import numpy as np import cv2 import random import os torch.manual_seed(123456) torch.cuda.manual_seed(123456) np.random.seed(123456) random.seed(123456) def to_rgb(img): img = img.reshape(img.shape[0], img.shape[1], 1) img = np.concatenate((img, img, img), axis...
[ "numpy.random.seed", "os.makedirs", "torch.utils.data.DataLoader", "torch.manual_seed", "cv2.imwrite", "torch.cuda.manual_seed", "os.path.exists", "cv2.copyMakeBorder", "numpy.transpose", "random.seed", "numpy.array", "psenet_ctw.PSENET_CTW", "numpy.concatenate" ]
[((102, 127), 'torch.manual_seed', 'torch.manual_seed', (['(123456)'], {}), '(123456)\n', (119, 127), False, 'import torch\n'), ((128, 158), 'torch.cuda.manual_seed', 'torch.cuda.manual_seed', (['(123456)'], {}), '(123456)\n', (150, 158), False, 'import torch\n'), ((159, 181), 'numpy.random.seed', 'np.random.seed', (['...
import argparse import random import warnings import numpy as np import torch import torch.backends.cudnn import torch.distributed as dist import torch.nn.parallel as parallel import torch.optim as optim import torch.utils.data as data import engine from datasets import AugVocTrainDataset, AugVocValDataset, CLASSES f...
[ "engine.train_one_epoch", "numpy.random.seed", "argparse.ArgumentParser", "torch.random.manual_seed", "warnings.filterwarnings", "torch.distributed.init_process_group", "model.HungarianMatcher", "model.DetCriterion", "torch.optim.AdamW", "utils.distributed_logger.DistributedLogger", "torch.optim...
[((445, 478), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (468, 478), False, 'import warnings\n'), ((517, 542), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (540, 542), False, 'import argparse\n'), ((1788, 1805), 'random.seed', 'random.seed', ...
# !/usr/bin/python # -*-coding:utf-8-*- from keras.layers import Input, SpatialDropout1D, Dense from keras.layers import Bidirectional, GRU, Flatten, Dropout, Embedding from keras.preprocessing import text, sequence from keras.models import Model from sklearn.preprocessing import MultiLabelBinarizer import pandas as pd...
[ "numpy.average", "pandas.read_csv", "_pickle.dump", "keras.preprocessing.sequence.pad_sequences", "numpy.asanyarray", "keras.layers.Flatten", "keras.layers.Dropout", "keras.models.Model", "keras.layers.SpatialDropout1D", "keras.layers.GRU", "keras.preprocessing.text.Tokenizer", "keras.layers.D...
[((404, 421), 'keras.backend.clear_session', 'K.clear_session', ([], {}), '()\n', (419, 421), True, 'import keras.backend as K\n'), ((542, 559), 'keras.backend.clear_session', 'K.clear_session', ([], {}), '()\n', (557, 559), True, 'import keras.backend as K\n'), ((878, 919), 'pandas.read_csv', 'pd.read_csv', (['train_f...
import os import uuid import time import asyncio import base64 import numpy as np import tensorflow as tf from aiohttp import web from checkers_ai.model import Policy from checkers_ai.state import State class PolicyServer: maxBatchSz = 512 maxTOQ = 1e-5 clockSpeed = 1e-6 def __init__(self, model_pat...
[ "numpy.stack", "uuid.uuid4", "asyncio.sleep", "tensorflow.Session", "time.time", "aiohttp.web.json_response", "tensorflow.ConfigProto", "aiohttp.web.get", "aiohttp.web.run_app", "tensorflow.Graph", "aiohttp.web.Application", "checkers_ai.model.Policy" ]
[((587, 656), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {'allow_soft_placement': '(True)', 'log_device_placement': '(False)'}), '(allow_soft_placement=True, log_device_placement=False)\n', (601, 656), True, 'import tensorflow as tf\n'), ((707, 717), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (715, 717), T...
#%% import fnmatch, os, re import glob import math import cv2 import numpy as np import operator from matplotlib import pyplot as plt from keras.preprocessing.image import ImageDataGenerator, load_img, img_to_array, array_to_img point = '.' extension = 'jpg' point_extension = '.'+ extension tag = '_data_au{}_' import r...
[ "keras.preprocessing.image.ImageDataGenerator", "matplotlib.pyplot.show", "os.path.join", "matplotlib.pyplot.imshow", "keras.layers.Dropout", "matplotlib.pyplot.yticks", "keras.layers.Flatten", "random.choice", "keras.preprocessing.image.load_img", "keras.layers.Dense", "numpy.array", "keras.l...
[((422, 432), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (430, 432), True, 'from matplotlib import pyplot as plt\n'), ((807, 819), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (817, 819), False, 'from keras.models import Sequential\n'), ((1979, 2166), 'keras.preprocessing.image.ImageDataGener...
import keras from keras.models import Sequential from keras.models import load_model from keras.layers import Dense from keras.optimizers import Adam import numpy as np import random from collections import deque class Agent: def __init__(self, state_size, is_eval=False, model_name=""): self.state_size ...
[ "keras.models.load_model", "numpy.argmax", "random.sample", "keras.optimizers.Adam", "random.random", "keras.layers.Dense", "random.randrange", "keras.models.Sequential", "collections.deque" ]
[((452, 470), 'collections.deque', 'deque', ([], {'maxlen': '(2000)'}), '(maxlen=2000)\n', (457, 470), False, 'from collections import deque\n'), ((979, 991), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (989, 991), False, 'from keras.models import Sequential\n'), ((1638, 1659), 'numpy.argmax', 'np.argmax...
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "numpy.argmax", "paddle.stack", "numpy.mean", "numpy.arange", "numpy.logical_not", "ppcls.utils.misc.AverageMeter", "paddle.flip", "paddle.norm", "numpy.less", "numpy.asarray", "numpy.square", "sklearn.preprocessing.normalize", "paddle.divide", "numpy.concatenate", "numpy.subtract", "n...
[((1290, 1320), 'paddle.norm', 'paddle.norm', (['fused', '(2)', '(1)', '(True)'], {}), '(fused, 2, 1, True)\n', (1301, 1320), False, 'import paddle\n'), ((1333, 1359), 'paddle.divide', 'paddle.divide', (['fused', 'norm'], {}), '(fused, norm)\n', (1346, 1359), False, 'import paddle\n'), ((1744, 1755), 'time.time', 'time...
from torch import Tensor from scipy.spatial.transform import Rotation import torch import numpy as np from oil.utils.utils import export import random import torch @export class FixedSeedAll(object): def __init__(self, seed): self.seed = seed def __enter__(self): self.np_rng_state ...
[ "pywavefront.Wavefront", "numpy.random.seed", "torch.stack", "random.setstate", "numpy.random.get_state", "torch.manual_seed", "torch.cat", "torch.random.set_rng_state", "numpy.random.set_state", "random.seed", "numpy.array", "torch.random.get_rng_state", "torch.zeros", "torch.no_grad", ...
[((952, 1016), 'torch.zeros', 'torch.zeros', (['*k.shape[:-1]', '(3)', '(3)'], {'device': 'k.device', 'dtype': 'k.dtype'}), '(*k.shape[:-1], 3, 3, device=k.device, dtype=k.dtype)\n', (963, 1016), False, 'import torch\n'), ((1296, 1354), 'torch.zeros', 'torch.zeros', (['*K.shape[:-1]'], {'device': 'K.device', 'dtype': '...
# The MIT License (MIT) # # Copyright (c) 2015-2016 Massachusetts Institute of Technology. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation ...
[ "os.path.abspath", "os.path.basename", "numpy.std", "numpy.testing.assert_almost_equal", "bandicoot.io.read_csv", "numpy.mean", "numpy.linalg.norm", "numpy.dot", "os.chdir", "bandicoot.spatial.churn_rate" ]
[((1664, 1735), 'bandicoot.io.read_csv', 'bc.io.read_csv', (['"""churn_user"""', '"""samples"""'], {'describe': '(False)', 'warnings': '(False)'}), "('churn_user', 'samples', describe=False, warnings=False)\n", (1678, 1735), True, 'import bandicoot as bc\n'), ((1821, 1867), 'bandicoot.spatial.churn_rate', 'bc.spatial.c...
import copy import numpy as np import numpy.random as npr import matplotlib import matplotlib.pyplot as plt def SubPlotData(K, data, labels2, means2): if data.shape[0] == 2: proj = "rectilinear" elif data.shape[0] == 3: proj = "3d" else: return -1 "Generate plots with more than...
[ "matplotlib.pyplot.draw", "matplotlib.colors.get_named_colors_mapping", "numpy.where", "matplotlib.pyplot.subplots" ]
[((570, 671), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(2)'], {'sharey': '(True)', 'sharex': '(True)', 'tight_layout': '(True)', 'subplot_kw': "{'projection': proj}"}), "(1, 2, sharey=True, sharex=True, tight_layout=True, subplot_kw=\n {'projection': proj})\n", (582, 671), True, 'import matplotlib.pyp...
#!/usr/bin/env python # Set of isotropic filters to use in calculations import numpy as np import typeutils as tu def Wtophatkspace(kR, R = None ) : """Returns the Fourier Transform of the real space top hat window function which is 1 when r < R, and 0 otherwise. args: kR: unit less quantity returns: array...
[ "matplotlib.pyplot.xscale", "matplotlib.pyplot.show", "numpy.logspace", "matplotlib.pyplot.legend", "typeutils.isiterable", "numpy.sin", "numpy.cos", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((893, 909), 'typeutils.isiterable', 'tu.isiterable', (['R'], {}), '(R)\n', (906, 909), True, 'import typeutils as tu\n'), ((1977, 2000), 'numpy.logspace', 'np.logspace', (['(-6)', '(5)', '(100)'], {}), '(-6, 5, 100)\n', (1988, 2000), True, 'import numpy as np\n'), ((2226, 2248), 'matplotlib.pyplot.legend', 'plt.legen...
############################################################################### ############################################################################### # Name: set_adc.py # Coder: <NAME> # Description: ############################################################################### #############################...
[ "higgs.create_parser", "matplotlib.pyplot.show", "log.logger.info", "numpy.empty", "numpy.append", "matplotlib.pyplot.figure", "numpy.arange", "higgs.HiggsController" ]
[((7718, 7739), 'higgs.create_parser', 'higgs.create_parser', ([], {}), '()\n', (7737, 7739), False, 'import higgs\n'), ((1440, 1572), 'higgs.HiggsController', 'higgs.HiggsController', ([], {'host': 'host', 'our_host': 'our_host', 'rx_cmd_port': 'rx_cmd_port', 'tx_cmd_port': 'tx_cmd_port', 'connect_type': 'connect_type...
import argparse import biggie import time import numpy as np import matplotlib import os matplotlib.use("Agg") import matplotlib.pyplot as plt import matplotlib.animation as manimation import seaborn import models import datatools FIG = plt.figure(figsize=(10, 10)) AX = FIG.gca() def render(z_out, y_true, fps, ou...
[ "time.asctime", "datatools.load_mnist_npz", "argparse.ArgumentParser", "biggie.Stash", "numpy.asarray", "models.pwrank", "matplotlib.pyplot.draw", "matplotlib.pyplot.figure", "matplotlib.use", "seaborn.color_palette" ]
[((90, 111), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (104, 111), False, 'import matplotlib\n'), ((241, 269), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 10)'}), '(figsize=(10, 10))\n', (251, 269), True, 'import matplotlib.pyplot as plt\n'), ((616, 649), 'seaborn.color_...
# -*- coding: utf-8 -*- # @Time : 2019/10/22 21:42 # @Author : Esbiya # @Email : <EMAIL> # @File : geetest.py # @Software: PyCharm import os import random import requests import time import json from PIL import Image import cv2 import numpy as np session = requests.session() session.headers = { 'Content...
[ "requests.session", "os.mkdir", "os.path.abspath", "random.randint", "cv2.cvtColor", "cv2.imwrite", "os.path.exists", "PIL.Image.open", "time.time", "cv2.imread", "numpy.min", "numpy.max", "cv2.matchTemplate" ]
[((269, 287), 'requests.session', 'requests.session', ([], {}), '()\n', (285, 287), False, 'import requests\n'), ((1076, 1092), 'PIL.Image.open', 'Image.open', (['path'], {}), '(path)\n', (1086, 1092), False, 'from PIL import Image\n'), ((1939, 1965), 'cv2.imread', 'cv2.imread', (['slider_path', '(0)'], {}), '(slider_p...
""" Active Fairness Run through questions """ from sklearn.metrics import classification_report from sklearn.metrics import accuracy_score from sklearn.metrics import confusion_matrix from sklearn.ensemble import RandomForestClassifier from sklearn.tree import DecisionTreeClassifier from sklearn.calibration import _Si...
[ "pandas.DataFrame", "copy.deepcopy", "sklearn.calibration._SigmoidCalibration", "numpy.sum", "numpy.abs", "numpy.argmax", "random.sample", "numpy.zeros", "time.time", "numpy.shape", "sklearn.isotonic.IsotonicRegression", "numpy.mean", "numpy.array", "pandas.Series", "numpy.arange", "pa...
[((27455, 27477), 'copy.deepcopy', 'deepcopy', (['all_features'], {}), '(all_features)\n', (27463, 27477), False, 'from copy import deepcopy\n'), ((31491, 31547), 'numpy.zeros', 'np.zeros', (['tree.tree_single_value_shape'], {'dtype': 'np.float32'}), '(tree.tree_single_value_shape, dtype=np.float32)\n', (31499, 31547),...
import unittest import numpy as np from PyANN.utils import add_col, remove_col class TestUtils(unittest.TestCase): def test_add_col(self): matrix: np.ndarray = np.ones((5, 5)) matrix_with_col: np.ndarray = add_col(matrix) self.assertTrue(matrix.shape[0] == matrix_with_col.shape[0]) ...
[ "unittest.main", "PyANN.utils.add_col", "PyANN.utils.remove_col", "numpy.ones" ]
[((710, 725), 'unittest.main', 'unittest.main', ([], {}), '()\n', (723, 725), False, 'import unittest\n'), ((176, 191), 'numpy.ones', 'np.ones', (['(5, 5)'], {}), '((5, 5))\n', (183, 191), True, 'import numpy as np\n'), ((231, 246), 'PyANN.utils.add_col', 'add_col', (['matrix'], {}), '(matrix)\n', (238, 246), False, 'f...
#!/usr/bin/env python # adapted from # https://github.com/opencv/opencv/blob/master/samples/python/lk_track.py ''' Lucas-Kanade tracker ==================== Lucas-Kanade sparse optical flow demo. Uses goodFeaturesToTrack for track initialization and back-tracking for match verification between frames. ''' import n...
[ "umucv.stream.autoStream", "numpy.zeros_like", "cv2.circle", "cv2.cvtColor", "numpy.float32", "cv2.imshow", "time.time", "cv2.goodFeaturesToTrack", "numpy.int32", "cv2.calcOpticalFlowPyrLK", "cv2.destroyAllWindows" ]
[((835, 847), 'umucv.stream.autoStream', 'autoStream', ([], {}), '()\n', (845, 847), False, 'from umucv.stream import autoStream\n'), ((2425, 2447), 'cv2.destroyAllWindows', 'cv.destroyAllWindows', ([], {}), '()\n', (2445, 2447), True, 'import cv2 as cv\n'), ((866, 903), 'cv2.cvtColor', 'cv.cvtColor', (['frame', 'cv.CO...
""" Tutorials / horn antenna Description at: http://openems.de/index.php/Tutorial:_Horn_Antenna (C) 2011,2012,2013 <NAME> <<EMAIL>> Python Adaptation : ESIR Project 2015 """ from pylayers.em.openems.openems import * import scipy.constants as cst import numpy as np # setup the simulation unit = 1e-3 # all length i...
[ "numpy.sin", "numpy.array" ]
[((637, 655), 'numpy.array', 'np.array', (['[20, 20]'], {}), '([20, 20])\n', (645, 655), True, 'import numpy as np\n'), ((3087, 3106), 'numpy.sin', 'np.sin', (['HA.angle[0]'], {}), '(HA.angle[0])\n', (3093, 3106), True, 'import numpy as np\n'), ((3135, 3154), 'numpy.sin', 'np.sin', (['HA.angle[0]'], {}), '(HA.angle[0])...
# various analytic mass profiles: Hernquist, NFW, Plummer, Isothermal, Miyamoto-Nagai (for disks) import numpy as np import astropy.units as u from astropy import constants from .cosmo_tools import * G = constants.G.to(u.kpc * u.km**2. / u.Msun/ u.s**2.) class NFW: def __init__(self, Mvir, r, cvir): """ ...
[ "numpy.sqrt", "numpy.log", "astropy.constants.G.to" ]
[((205, 262), 'astropy.constants.G.to', 'constants.G.to', (['(u.kpc * u.km ** 2.0 / u.Msun / u.s ** 2.0)'], {}), '(u.kpc * u.km ** 2.0 / u.Msun / u.s ** 2.0)\n', (219, 262), False, 'from astropy import constants\n'), ((945, 962), 'numpy.sqrt', 'np.sqrt', (['(-2 * phi)'], {}), '(-2 * phi)\n', (952, 962), True, 'import n...
import numpy as np import matplotlib.pyplot as plt import csv import math def sigmoid(x): return 1./(1.+np.exp(-x)) def sigmoid2(x): print(x) return 1./(1.+math.exp(-x)) def main(): x = np.random.uniform(-5.,5.,10000) x = np.sort(x) # y = [] # for xx in x: # y.append(sigmoid(xx)) y = sigmoid(x) plt.plot...
[ "numpy.random.uniform", "math.exp", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.sort", "numpy.exp" ]
[((195, 230), 'numpy.random.uniform', 'np.random.uniform', (['(-5.0)', '(5.0)', '(10000)'], {}), '(-5.0, 5.0, 10000)\n', (212, 230), True, 'import numpy as np\n'), ((232, 242), 'numpy.sort', 'np.sort', (['x'], {}), '(x)\n', (239, 242), True, 'import numpy as np\n'), ((312, 331), 'matplotlib.pyplot.plot', 'plt.plot', ([...
"""@package MuSCADeT """ import numpy as np def asinh_norm(data, Q = 10, bands = [0,1,2], range = 1): """Normalises frames in a data-cube for rgb display Parameter: ---------- data: 'array' Cube of images with size nbxn1xn2 Q: 'int' Stretching parameter for the arcsinh function. ...
[ "numpy.ma.min", "numpy.transpose", "numpy.max", "numpy.arcsinh", "numpy.ma.max" ]
[((683, 697), 'numpy.ma.min', 'np.ma.min', (['img'], {}), '(img)\n', (692, 697), True, 'import numpy as np\n'), ((842, 857), 'numpy.max', 'np.max', (['normimg'], {}), '(normimg)\n', (848, 857), True, 'import numpy as np\n'), ((989, 1026), 'numpy.transpose', 'np.transpose', (['normimg'], {'axes': '(1, 2, 0)'}), '(normim...
import os import click import numpy as np import skimage.io as io import matplotlib.pyplot as plt from scipy.stats import pearsonr def sq_sinv(y,y_): # To avoid log(0) = -inf y_[y_==0] = 1 y[y==0] = 1 alpha = np.mean(np.log(y_) - np.log(y)) err = (np.log(y) - np.log(y_) + alpha) ** 2 return (np...
[ "numpy.log", "click.option", "scipy.stats.pearsonr", "click.command", "numpy.mean", "numpy.array", "os.path.join", "os.listdir" ]
[((445, 460), 'click.command', 'click.command', ([], {}), '()\n', (458, 460), False, 'import click\n'), ((462, 585), 'click.option', 'click.option', (['"""--gt_path"""'], {'type': 'click.STRING', 'default': '""""""', 'help': '"""Path to the folder containing the ground-truth images"""'}), "('--gt_path', type=click.STRI...
import argparse import glob from operator import gt from pathlib import Path import pickle import mayavi.mlab as mlab import numpy as np import torch import re from pcdet.config import cfg, cfg_from_yaml_file from pcdet.datasets import DatasetTemplate from pcdet.models import build_network, load_data_to_gpu from pcdet...
[ "pcdet.models.load_data_to_gpu", "visual_utils.visualize_utils.draw_scenes", "numpy.load", "argparse.ArgumentParser", "pcdet.config.cfg_from_yaml_file", "numpy.fromfile", "mayavi.mlab.show", "pcdet.utils.common_utils.create_logger", "pathlib.Path", "pickle.load", "re.findall", "torch.no_grad" ...
[((1719, 1768), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""arg parser"""'}), "(description='arg parser')\n", (1742, 1768), False, 'import argparse\n'), ((2671, 2709), 'pcdet.config.cfg_from_yaml_file', 'cfg_from_yaml_file', (['args.cfg_file', 'cfg'], {}), '(args.cfg_file, cfg)\n', (2...
# Copyright (C) 2015, <NAME> <<EMAIL>> # # LICENSE: THE SOFTWARE IS PROVIDED "AS IS" UNDER THE # ACADEMIC FREE LICENSE (AFL) v3.0. # import numpy as np from mpi4py import MPI from utils import accel from _layermodels import LayerModel from utils.decorators import DocInherit doc_inherit = DocInherit #----------------...
[ "numpy.zeros_like", "numpy.argmax", "numpy.argmin", "numpy.exp", "numpy.dot", "utils.accel.log" ]
[((3309, 3330), 'numpy.dot', 'np.dot', (['W', 'input_data'], {}), '(W, input_data)\n', (3315, 3330), True, 'import numpy as np\n'), ((3780, 3796), 'numpy.zeros_like', 'np.zeros_like', (['I'], {}), '(I)\n', (3793, 3796), True, 'import numpy as np\n'), ((1254, 1278), 'numpy.zeros_like', 'np.zeros_like', (['self._dsY'], {...
seedNum=10 import random, os, statistics, argparse, json random.seed(seedNum) import numpy numpy.random.seed(seedNum) os.environ["CUDA_VISIBLE_DEVICES"]="-1" import tensorflow as tf tf.random.set_seed(seedNum) from rdkit import Chem from rdkit.Chem import AllChem from sklearn import preprocessing, decomposition, clu...
[ "tensorflow.random.set_seed", "numpy.random.seed", "argparse.ArgumentParser", "rdkit.Chem.AllChem.MolFromSmiles", "statistics.stdev", "keras.optimizers.Adam", "sklearn.model_selection.KFold", "keras.models.Model", "keras.layers.Dense", "random.seed", "tensorflow.keras.initializers.RandomNormal",...
[((57, 77), 'random.seed', 'random.seed', (['seedNum'], {}), '(seedNum)\n', (68, 77), False, 'import random, os, statistics, argparse, json\n'), ((91, 117), 'numpy.random.seed', 'numpy.random.seed', (['seedNum'], {}), '(seedNum)\n', (108, 117), False, 'import numpy\n'), ((184, 211), 'tensorflow.random.set_seed', 'tf.ra...
from models.transformers.bert import BERT from tests.entities.embedding_configuration import EmbeddingConfiguration from typing import List from models.model_base import ModelBase from services.vocabulary_service import VocabularyService import numpy as np import pickle from models.simple.skip_gram import SkipGram from...
[ "unittest.main", "scipy.spatial.distance.cosine", "os.remove", "models.transformers.bert.BERT", "os.path.exists", "numpy.argsort", "dependency_injector.providers.Factory", "tests.entities.embedding_configuration.EmbeddingConfiguration", "models.simple.cbow.CBOW", "dependency_injection.ioc_containe...
[((1720, 1734), 'dependency_injection.ioc_container.IocContainer', 'IocContainer', ([], {}), '()\n', (1732, 1734), False, 'from dependency_injection.ioc_container import IocContainer\n'), ((6733, 6781), 'os.path.join', 'os.path.join', (['output_folder', '"""context-words.csv"""'], {}), "(output_folder, 'context-words.c...
import numpy as np import pandas as pd import cv2 import os import matplotlib.pyplot as plt from tqdm import tqdm from pdb import * from pathlib import Path from skimage.io import imread #export from fastai.torch_basics import * from fastai.data.all import * from fastai.vision.all import * # from PIL import Images VA...
[ "numpy.stack", "numpy.sum", "numpy.maximum", "cv2.threshold", "numpy.zeros", "numpy.finfo", "pathlib.Path", "numpy.where", "numpy.array", "numpy.exp", "cv2.boundingRect" ]
[((3190, 3221), 'cv2.threshold', 'cv2.threshold', (['img', '(127)', '(255)', '(0)'], {}), '(img, 127, 255, 0)\n', (3203, 3221), False, 'import cv2\n'), ((3394, 3415), 'cv2.boundingRect', 'cv2.boundingRect', (['cnt'], {}), '(cnt)\n', (3410, 3415), False, 'import cv2\n'), ((3464, 3478), 'numpy.array', 'np.array', (['bbox...
import cv2 import numpy as np cap = cv2.VideoCapture(2) _, prev = cap.read() prev = cv2.flip(prev, 1) _, new = cap.read() new = cv2.flip(new, 1) while True: diff = cv2.absdiff(prev, new) diff = cv2.cvtColor(diff, cv2.COLOR_BGR2GRAY) diff = cv2.blur(diff, (5,5)) _,thresh = cv2.threshold(diff, 10, 255, cv2.THRES...
[ "numpy.ones", "cv2.rectangle", "cv2.absdiff", "cv2.imshow", "cv2.line", "cv2.contourArea", "cv2.dilate", "cv2.cvtColor", "cv2.boundingRect", "cv2.destroyAllWindows", "cv2.circle", "cv2.minEnclosingCircle", "cv2.waitKey", "cv2.flip", "cv2.threshold", "cv2.blur", "cv2.VideoCapture", ...
[((38, 57), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(2)'], {}), '(2)\n', (54, 57), False, 'import cv2\n'), ((87, 104), 'cv2.flip', 'cv2.flip', (['prev', '(1)'], {}), '(prev, 1)\n', (95, 104), False, 'import cv2\n'), ((131, 147), 'cv2.flip', 'cv2.flip', (['new', '(1)'], {}), '(new, 1)\n', (139, 147), False, 'import c...
# Copyright 2020 The PEGASUS Authors.. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
[ "absl.testing.absltest.main", "numpy.array", "pegasus.ops.python.text_encoder_utils.create_text_encoder" ]
[((2403, 2418), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (2416, 2418), False, 'from absl.testing import absltest\n'), ((1014, 1081), 'pegasus.ops.python.text_encoder_utils.create_text_encoder', 'text_encoder_utils.create_text_encoder', (['"""sentencepiece"""', '_SPM_VOCAB'], {}), "('sentencepiec...
""" ## Author: <NAME>, <NAME> """ import numpy as np from project.size import size from project.zeros import zeros from project.dfimdalpha import dfimdalpha from project.d2fimdalpha2 import d2fimdalpha2 from project.trace_matrix import trace_matrix from project.log_prior_pdf import log_prior_pdf d...
[ "project.d2fimdalpha2.d2fimdalpha2", "project.dfimdalpha.dfimdalpha", "numpy.asarray", "numpy.transpose", "project.log_prior_pdf.log_prior_pdf", "numpy.linalg.inv", "project.size.size", "project.trace_matrix.trace_matrix" ]
[((564, 650), 'project.log_prior_pdf.log_prior_pdf', 'log_prior_pdf', (['alpha', 'bpopdescr', 'ddescr'], {'return_gradient': '(True)', 'return_hessian': '(True)'}), '(alpha, bpopdescr, ddescr, return_gradient=True,\n return_hessian=True)\n', (577, 650), False, 'from project.log_prior_pdf import log_prior_pdf\n'), ((...
import numpy as np import matplotlib as mpl from datetime import datetime, timedelta from floodsystem.stationdata import build_station_list from floodsystem.datafetcher import fetch_measure_levels import matplotlib.pyplot as plt def polyfit(dates, levels, p): days = mpl.dates.date2num(dates) d0 = np.min(d...
[ "matplotlib.dates.date2num", "numpy.poly1d", "numpy.min", "numpy.polyfit" ]
[((277, 302), 'matplotlib.dates.date2num', 'mpl.dates.date2num', (['dates'], {}), '(dates)\n', (295, 302), True, 'import matplotlib as mpl\n'), ((312, 324), 'numpy.min', 'np.min', (['days'], {}), '(days)\n', (318, 324), True, 'import numpy as np\n'), ((437, 456), 'numpy.polyfit', 'np.polyfit', (['x', 'y', 'p'], {}), '(...
from __future__ import absolute_import, division, print_function, unicode_literals import tensorflow as tf from tensorflow.keras import backend as K import os import numpy as np import matplotlib.pyplot as pl import argparse from numpy.random import seed seed(1) from tensorflow import set_random_seed set_random_seed(2...
[ "tensorflow.keras.preprocessing.image.ImageDataGenerator", "tensorflow.keras.backend.min", "numpy.random.seed", "argparse.ArgumentParser", "tensorflow.keras.layers.Dense", "tensorflow.keras.backend.max", "tensorflow.set_random_seed", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.backend.var"...
[((256, 263), 'numpy.random.seed', 'seed', (['(1)'], {}), '(1)\n', (260, 263), False, 'from numpy.random import seed\n'), ((303, 321), 'tensorflow.set_random_seed', 'set_random_seed', (['(2)'], {}), '(2)\n', (318, 321), False, 'from tensorflow import set_random_seed\n'), ((332, 418), 'argparse.ArgumentParser', 'argpars...
#! /usr/bin/env python # # Description: # # # Usage: # python # import sys import numpy as np from scipy.optimize import curve_fit import matplotlib.pyplot as plt import seaborn as sns sns.set(style="darkgrid") def kozeny_carman(x, x_c, gamma, C): """ TODO """ dx = x - x_c y = np.log10(C) + gamma * np....
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.subplots", "scipy.optimize.curve_fit", "numpy.max", "numpy.loadtxt", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.ylabel", "numpy.log10", "matplotlib.pyplot.xlabel", "seaborn.set" ]
[((188, 213), 'seaborn.set', 'sns.set', ([], {'style': '"""darkgrid"""'}), "(style='darkgrid')\n", (195, 213), True, 'import seaborn as sns\n'), ((624, 647), 'numpy.loadtxt', 'np.loadtxt', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (634, 647), True, 'import numpy as np\n'), ((783, 794), 'numpy.log10', 'np.log10', (['k']...
import pickle import re import string import pkg_resources from gensim.models import KeyedVectors import numpy as np class Preprocessor(object): char_search = re.compile(r"[^\u0020\u0027\u002b-\u002e\u0030-\u0039\u0041-\u005a\u0061-\u007a]") strip_multi_ws = re.compile(r"( {2,})") word_re = re.compile(r...
[ "gensim.models.KeyedVectors.load", "pkg_resources.resource_filename", "numpy.mean", "pickle.load", "re.compile" ]
[((167, 268), 're.compile', 're.compile', (['"""[^\\\\u0020\\\\u0027\\\\u002b-\\\\u002e\\\\u0030-\\\\u0039\\\\u0041-\\\\u005a\\\\u0061-\\\\u007a]"""'], {}), "(\n '[^\\\\u0020\\\\u0027\\\\u002b-\\\\u002e\\\\u0030-\\\\u0039\\\\u0041-\\\\u005a\\\\u0061-\\\\u007a]'\n )\n", (177, 268), False, 'import re\n'), ((271, 29...
import os import sys import numpy as np from numpy import savez_compressed from PIL import Image from tqdm import tqdm import multiprocessing from util_functions import get_normals_from_depth PRODUCTION = False if PRODUCTION: FOLDER_NAME = 'depth_production' TARGET_FOLDER = 'normals_production' else: FOL...
[ "PIL.Image.open", "numpy.savez_compressed", "util_functions.get_normals_from_depth", "os.path.join", "os.listdir" ]
[((553, 594), 'os.path.join', 'os.path.join', (['""".."""', 'FOLDER_NAME', 'img_name'], {}), "('..', FOLDER_NAME, img_name)\n", (565, 594), False, 'import os\n'), ((803, 869), 'numpy.savez_compressed', 'savez_compressed', (['f"""../{TARGET_FOLDER}/{outfile}"""', 'img_arr_normals'], {}), "(f'../{TARGET_FOLDER}/{outfile}...
from bfmplot import pl import numpy as np x = np.arange(0, 2*np.pi, 0.01) y = np.arange(0, 2*np.pi, 0.01) X, Y = np.meshgrid(x,y) Z = np.cos(X) * np.sin(Y) * 20 pl.imshow(Z) pl.colorbar() pl.show()
[ "bfmplot.pl.colorbar", "numpy.meshgrid", "bfmplot.pl.imshow", "numpy.sin", "numpy.arange", "bfmplot.pl.show", "numpy.cos" ]
[((47, 76), 'numpy.arange', 'np.arange', (['(0)', '(2 * np.pi)', '(0.01)'], {}), '(0, 2 * np.pi, 0.01)\n', (56, 76), True, 'import numpy as np\n'), ((79, 108), 'numpy.arange', 'np.arange', (['(0)', '(2 * np.pi)', '(0.01)'], {}), '(0, 2 * np.pi, 0.01)\n', (88, 108), True, 'import numpy as np\n'), ((114, 131), 'numpy.mes...
# coding: utf-8 # /*########################################################################## # Copyright (C) 2021 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restrictio...
[ "numpy.int_", "os.path.basename", "h5py.special_dtype", "numpy.float32", "numpy.asarray", "os.path.isfile", "numpy.array", "datetime.datetime.now", "logging.getLogger" ]
[((4544, 4571), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (4561, 4571), False, 'import logging\n'), ((4628, 4656), 'h5py.special_dtype', 'h5py.special_dtype', ([], {'vlen': 'str'}), '(vlen=str)\n', (4646, 4656), False, 'import h5py\n'), ((5271, 5295), 'os.path.isfile', 'os.path.isfil...
#!/usr/bin/env python # -*- coding: utf-8 -*- import matplotlib as mpl mpl.use("Agg") import matplotlib.cm import matplotlib.font_manager as fm def mpl_setdefaults(): mpl.rc('font', **{'family': 'serif', 'serif': ['stix']}) mpl.rcParams["text.usetex"] = True mpl.rcParams["text.latex.unicode"] = True mpl.rcParam...
[ "matplotlib.rc", "numpy.amin", "numpy.empty", "numpy.logspace", "numpy.ones", "matplotlib.pyplot.figure", "scipy.interpolate.interp1d", "matplotlib.colors.LinearSegmentedColormap.from_list", "numpy.zeros_like", "matplotlib.pyplot.close", "matplotlib.ticker.MultipleLocator", "numpy.log10", "m...
[((73, 87), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (80, 87), True, 'import matplotlib as mpl\n'), ((171, 227), 'matplotlib.rc', 'mpl.rc', (['"""font"""'], {}), "('font', **{'family': 'serif', 'serif': ['stix']})\n", (177, 227), True, 'import matplotlib as mpl\n'), ((1474, 1501), 'numpy.array', '...
#debug import os from scipy import ndimage from PIL import Image import numpy as np from matplotlib import pyplot as plt # Load raw speckle images in .dat format # Convert .dat to .tiff # Load .tiff image # calculate speckle contrast (Dynamic Imaging of Cerebral Blood Flow Using Laser Speckle) # Add dimensions to ...
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.get_cmap", "os.getcwd", "numpy.square", "matplotlib.pyplot.colorbar", "PIL.Image.open", "matplotlib.pyplot.figure", "numpy.array", "scipy.ndimage.uniform_filter", "numpy.linspace", "os.listdir", "matplotlib.pyplot.save...
[((785, 832), 'PIL.Image.open', 'Image.open', (['"""./../data/interim/datauint16.tiff"""'], {}), "('./../data/interim/datauint16.tiff')\n", (795, 832), False, 'from PIL import Image\n'), ((1128, 1155), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(12, 5)'}), '(figsize=(12, 5))\n', (1138, 1155), True, 'fr...