code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import numpy as np import matplotlib.pyplot as plt import random def mutation(pop, number_of_individuals, F): index1 = np.random.randint(number_of_individuals) index2 = np.random.randint(number_of_individuals) index3 = np.random.randint(number_of_individuals) # print("1: ", index1) # print("2: ", ...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "numpy.square", "matplotlib.pyplot.draw", "numpy.random.randint", "numpy.array", "numpy.mean", "numpy.random.rand", "matplotlib.pyplot.pause" ]
[((125, 165), 'numpy.random.randint', 'np.random.randint', (['number_of_individuals'], {}), '(number_of_individuals)\n', (142, 165), True, 'import numpy as np\n'), ((179, 219), 'numpy.random.randint', 'np.random.randint', (['number_of_individuals'], {}), '(number_of_individuals)\n', (196, 219), True, 'import numpy as n...
# Copyright 2017. <NAME>. All rights reserved # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the # following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following # dis...
[ "pandas.read_csv", "h5py.File", "numpy.uint32" ]
[((2252, 2275), 'h5py.File', 'h5py.File', (['h5file', 'mode'], {}), '(h5file, mode)\n', (2261, 2275), False, 'import h5py\n'), ((2491, 2538), 'pandas.read_csv', 'pd.read_csv', (['csvfile'], {'sep': '""" """', 'na_values': '"""NONE"""'}), "(csvfile, sep=' ', na_values='NONE')\n", (2502, 2538), True, 'import pandas as pd...
from nltk.corpus import stopwords from nltk.stem.lancaster import LancasterStemmer from nltk.stem import SnowballStemmer, PorterStemmer from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer from . import __path__ as ROOT_PATH from nltk.tokenize import word_tokenize, sent_tokenize from copy import...
[ "sklearn.feature_extraction.text.CountVectorizer", "nltk.stem.PorterStemmer", "sklearn.feature_extraction.text.TfidfVectorizer", "nltk.stem.SnowballStemmer", "copy.copy", "nltk.stem.lancaster.LancasterStemmer", "nltk.tokenize.sent_tokenize", "numpy.random.randint", "nltk.corpus.stopwords.words", "...
[((2495, 2505), 'copy.copy', 'copy', (['text'], {}), '(text)\n', (2499, 2505), False, 'from copy import copy\n'), ((2523, 2553), 're.sub', 're.sub', (['urlpat', '""""""', 'clean_text'], {}), "(urlpat, '', clean_text)\n", (2529, 2553), False, 'import re\n'), ((2915, 2940), 'nltk.tokenize.word_tokenize', 'word_tokenize',...
# script for generating user-user projection. # copied from anthony's notebook mostly, with modifications to split users by timestamp from snap_import_user_projection import UnimodalUserProjection from pyspark.sql import SparkSession, functions as F spark = SparkSession.builder.getOrCreate() input_path = "src/data/pr...
[ "numpy.ceil", "pyspark.sql.functions.expr", "pyspark.sql.SparkSession.builder.getOrCreate", "scipy.optimize.fsolve", "pyspark.sql.types.LongType", "random.random", "numpy.array", "snap_import_user_projection.UnimodalUserProjection", "pyspark.sql.functions.col", "numpy.random.choice" ]
[((259, 293), 'pyspark.sql.SparkSession.builder.getOrCreate', 'SparkSession.builder.getOrCreate', ([], {}), '()\n', (291, 293), False, 'from pyspark.sql import SparkSession, functions as F\n'), ((2391, 2410), 'numpy.array', 'np.array', (['edge_list'], {}), '(edge_list)\n', (2399, 2410), True, 'import numpy as np\n'), (...
""" Class for walker with approximate average-patterns, in particular the approximate MFPT from root to target. """ import pattern_walker as rw import numpy as np import networkx as nx __all__ = [ 'MF_patternWalker', 'overlap_MF_patternWalker' ] class MF_patternWalker(rw.fullProbPatternWalker): """ ...
[ "numpy.sum", "numpy.float", "networkx.shortest_path", "numpy.array", "networkx.to_numpy_array", "networkx.DiGraph", "numpy.prod" ]
[((10013, 10023), 'numpy.float', 'np.float', ([], {}), '()\n', (10021, 10023), True, 'import numpy as np\n'), ((10809, 10821), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (10819, 10821), True, 'import networkx as nx\n'), ((18976, 18999), 'numpy.prod', 'np.prod', (['branch_weights'], {}), '(branch_weights)\n', (...
import numpy as np import matplotlib.pyplot as plt X = np.linspace(-np.pi, np.pi, 256) C = np.cos(X) S = np.sin(X) plt.plot(X, C) plt.plot(X, S) plt.show()
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.sin", "numpy.cos", "numpy.linspace" ]
[((59, 90), 'numpy.linspace', 'np.linspace', (['(-np.pi)', 'np.pi', '(256)'], {}), '(-np.pi, np.pi, 256)\n', (70, 90), True, 'import numpy as np\n'), ((96, 105), 'numpy.cos', 'np.cos', (['X'], {}), '(X)\n', (102, 105), True, 'import numpy as np\n'), ((111, 120), 'numpy.sin', 'np.sin', (['X'], {}), '(X)\n', (117, 120), ...
''' Author: jianzhnie Date: 2022-01-19 17:15:05 LastEditTime: 2022-03-04 18:30:51 LastEditors: jianzhnie Description: ''' import json import os import sys import numpy as np import torch import torch.nn as nn import torch.optim as optim from tqdm.auto import tqdm from nlptoolkit.data.utils.utils import PAD_TOKEN, g...
[ "sys.path.append", "nlptoolkit.models.elmo.elmo_model.BiLM", "nlptoolkit.data.utils.utils.get_loader", "torch.nn.CrossEntropyLoss", "tqdm.auto.tqdm", "torch.cuda.is_available", "nlptoolkit.datasets.elmodataset.BiLMDataset", "numpy.exp", "nlptoolkit.datasets.elmodataset.load_corpus", "os.path.join"...
[((496, 521), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (511, 521), False, 'import sys\n'), ((1250, 1284), 'nlptoolkit.datasets.elmodataset.load_corpus', 'load_corpus', (["configs['train_file']"], {}), "(configs['train_file'])\n", (1261, 1284), False, 'from nlptoolkit.datasets.elmoda...
import os import re import pandas as pd #%matplotlib inline from datetime import datetime from PIL import Image import numpy as np import sys import shutil from distutils import dir_util import re import glob import chainer import chainer.links as L import chainer.functions as F import chainer.cuda as cuda from chaine...
[ "argparse.ArgumentParser", "cupy.empty", "pandas.read_csv", "cupy.hstack", "chainer.no_backprop_mode", "chainer.iterators.MultithreadIterator", "chainer.serializers.load_npz", "os.path.exists", "cupy_augmentation.cupy_augmentation", "util.make_accuracy_image", "datetime.datetime.now", "chainer...
[((12467, 12520), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Chainer v4.0.0"""'}), "(description='Chainer v4.0.0')\n", (12490, 12520), False, 'import argparse\n'), ((15758, 15820), 'pandas.read_csv', 'pd.read_csv', (['"""./dataset/weight_of_remark_new.csv"""'], {'index_col': '(0)'}),...
import os import numpy as np from Simulation import Simulation from utils import is_empty, erase_files if __name__ == "__main__": # step to begin and step to end for all the simulations step_to_begin = 0 step_to_end = 5000 # list of number of boids, must be same size than list_directories var l...
[ "os.mkdir", "utils.is_empty", "Simulation.Simulation", "os.path.exists", "numpy.arange", "utils.erase_files" ]
[((768, 846), 'Simulation.Simulation', 'Simulation', ([], {'list_num_boids': 'num_boids', 'repository': 'directory', 'step': 'step_to_begin'}), '(list_num_boids=num_boids, repository=directory, step=step_to_begin)\n', (778, 846), False, 'from Simulation import Simulation\n'), ((921, 956), 'os.path.exists', 'os.path.exi...
import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim from config import cfg # TODO: argscope for detailed setting in fpn and rpn def create_anchors(feats, stride, scales, aspect_ratios=[0.5, 1, 2], base_size=16): feat_size = cfg.image_size / stride num_ratios = len(aspect_ratios) ...
[ "numpy.maximum", "config.cfg.bbox_mean.reshape", "tensorflow.maximum", "tensorflow.gather_nd", "tensorflow.reshape", "tensorflow.image.crop_and_resize", "numpy.arange", "tensorflow.sqrt", "tensorflow.split", "tensorflow.nn.softmax", "tensorflow.contrib.slim.conv2d", "tensorflow.logical_and", ...
[((384, 407), 'numpy.array', 'np.array', (['aspect_ratios'], {}), '(aspect_ratios)\n', (392, 407), True, 'import numpy as np\n'), ((453, 478), 'numpy.zeros', 'np.zeros', (['(num_ratios, 2)'], {}), '((num_ratios, 2))\n', (461, 478), True, 'import numpy as np\n'), ((746, 801), 'numpy.hstack', 'np.hstack', (['(ctr - 0.5 *...
""" Here we do inference on a DICOM volume, constructing the volume first, and then sending it to the clinical archive This code will do the following: 1. Identify the series to run HippoCrop.AI algorithm on from a folder containing multiple studies 2. Construct a NumPy volume from a set of DICOM files 3. ...
[ "PIL.Image.new", "numpy.sum", "os.walk", "pydicom.Dataset", "os.path.join", "numpy.max", "pydicom.filewriter.dcmwrite", "numpy.random.choice", "PIL.ImageDraw.Draw", "datetime.datetime.now", "numpy.stack", "subprocess.Popen", "os.stat", "datetime.date.today", "time.sleep", "os.listdir",...
[((1621, 1638), 'numpy.sum', 'np.sum', (['(pred == 1)'], {}), '(pred == 1)\n', (1627, 1638), True, 'import numpy as np\n'), ((1657, 1674), 'numpy.sum', 'np.sum', (['(pred == 2)'], {}), '(pred == 2)\n', (1663, 1674), True, 'import numpy as np\n'), ((1694, 1710), 'numpy.sum', 'np.sum', (['(pred > 0)'], {}), '(pred > 0)\n...
# ------------------------------------------------------------ # Copyright (c) 2017-present, SeetaTech, Co.,Ltd. # # Licensed under the BSD 2-Clause License. # You should have received a copy of the BSD 2-Clause License # along with the software. If not, See, # # <https://opensource.org/licenses/BSD-2-Clause> # # ...
[ "numpy.random.uniform", "numpy.random.randn", "dragon.Tensor.Ref", "numpy.linalg.qr", "numpy.zeros", "numpy.prod", "dragon.config.GetRandomSeed", "dragon.operators.rnn.rnn_param.RNNParamSet", "dragon.workspace.RunOperator", "numpy.sign", "numpy.diag", "numpy.sqrt", "warnings.warn", "dragon...
[((2918, 3013), 'dragon.core.tensor_utils.FromShape', 'FromShape', ([], {'shape': '[self._weights_count]', 'name': "(self.name + '/weights' if self.name else None)"}), "(shape=[self._weights_count], name=self.name + '/weights' if self.\n name else None)\n", (2927, 3013), False, 'from dragon.core.tensor_utils import ...
""" Routines for plotting time-dependent vertical profiles. """ import numpy import matplotlib.pyplot as plt import cf_units import matplotlib import os import iris from . import utility import matplotlib.dates as mdates __all__ = [ 'plot_timeprofile', 'make_timeprofile_plot', 'save_timeprofile_figure', ] ...
[ "matplotlib.dates.MonthLocator", "numpy.abs", "matplotlib.dates.epoch2num", "iris.analysis.Nearest", "matplotlib.pyplot.figure", "matplotlib.colors.LogNorm", "matplotlib.dates.HourLocator", "cf_units.Unit", "matplotlib.pyplot.close", "matplotlib.pyplot.colorbar", "matplotlib.dates.DateFormatter"...
[((1139, 1196), 'numpy.hstack', 'numpy.hstack', (['(coord.bounds[:, 0], coord.bounds[[-1], 1])'], {}), '((coord.bounds[:, 0], coord.bounds[[-1], 1]))\n', (1151, 1196), False, 'import numpy\n'), ((1260, 1335), 'cf_units.Unit', 'cf_units.Unit', (['"""seconds since 1970-01-01 00:00:00-00"""'], {'calendar': '"""gregorian""...
import sys import numpy def solve(M, call, value, end, garments, mat): aux = [] M -= value if M < 0: return sys.maxsize if call == end: return M if(mat[M][call] != -1): return mat[M][call] aux = [int(solve(M, call+1, a, end, garments, mat)) for a in garments[call]]...
[ "numpy.zeros", "numpy.place" ]
[((535, 563), 'numpy.zeros', 'numpy.zeros', ([], {'shape': '(201, 21)'}), '(shape=(201, 21))\n', (546, 563), False, 'import numpy\n'), ((572, 602), 'numpy.place', 'numpy.place', (['mat', '(mat == 0)', '(-1)'], {}), '(mat, mat == 0, -1)\n', (583, 602), False, 'import numpy\n')]
import random import unittest import numpy as np from scipy.stats import norm from ..StoneModel import StoneModel, ReqFuncSolver, logpdf_sum, StoneMod def get_random_vars(): kai = random.random() kx = random.random() vi = random.randint(1, 30) R = random.random() Li = random.random() return (k...
[ "unittest.main", "random.randint", "scipy.stats.norm.logpdf", "numpy.isinf", "numpy.isnan", "random.random", "numpy.array", "numpy.log10" ]
[((185, 200), 'random.random', 'random.random', ([], {}), '()\n', (198, 200), False, 'import random\n'), ((210, 225), 'random.random', 'random.random', ([], {}), '()\n', (223, 225), False, 'import random\n'), ((235, 256), 'random.randint', 'random.randint', (['(1)', '(30)'], {}), '(1, 30)\n', (249, 256), False, 'import...
import os import glob import torch import random import logging import argparse import zipfile import numpy as np from tqdm import tqdm, trange from torch.utils.data import DataLoader from transformers import (BertConfig, BertTokenizer) from modeling import MonoBERT from dataset import RelevantDataset, get_collate_fun...
[ "dataset.get_collate_function", "tqdm.tqdm", "dataset.RelevantDataset", "argparse.ArgumentParser", "logging.basicConfig", "os.makedirs", "os.path.exists", "torch.cuda.device_count", "transformers.BertTokenizer.from_pretrained", "torch.cuda.is_available", "numpy.array", "transformers.BertConfig...
[((336, 363), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (353, 363), False, 'import logging\n'), ((364, 494), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s-%(levelname)s-%(name)s- %(message)s"""', 'datefmt': '"""%d %H:%M:%S"""', 'level': 'logging.INFO'}...
#!/usr/bin/env python3.5 # -*- coding: utf-8 -*- import re import numpy as np __author__ = '<NAME>' kb = 8.617e-5 # unit eV / K class ReadInput(object): def __init__(self, filename='formation energy input.txt'): with open(filename, 'r') as fp: lines = fp.readlines() fo...
[ "numpy.savetxt", "numpy.array", "numpy.loadtxt", "numpy.linspace", "numpy.dot", "numpy.vstack" ]
[((2320, 2365), 'numpy.linspace', 'np.linspace', (['order.vbm', 'order.cbm'], {'num': 'points'}), '(order.vbm, order.cbm, num=points)\n', (2331, 2365), True, 'import numpy as np\n'), ((2982, 3028), 'numpy.vstack', 'np.vstack', (['(fermi_level, min_formation_energy)'], {}), '((fermi_level, min_formation_energy))\n', (29...
# -*- coding: utf-8 -*- """ Created on Tue Sep 12 15:01:44 2017 @author: """ import sys reload(sys) sys.setdefaultencoding('cp932') tes = sys.getdefaultencoding() import os import cv2 import numpy as np import pyws as m import winxpgui from PIL import ImageGrab from PyQt4 import QtGui, QtCore ...
[ "PyQt4.QtCore.QTimer", "PyQt4.QtGui.QWidget", "PyQt4.QtGui.QLabel", "sys.getdefaultencoding", "PyQt4.QtGui.QVBoxLayout", "PyQt4.QtGui.QLineEdit", "cv2.cvtColor", "PyQt4.QtGui.QMainWindow", "sys.setdefaultencoding", "datetime.datetime.now", "PIL.ImageGrab.grab", "numpy.asarray", "PyQt4.QtGui....
[((114, 145), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""cp932"""'], {}), "('cp932')\n", (136, 145), False, 'import sys\n'), ((153, 177), 'sys.getdefaultencoding', 'sys.getdefaultencoding', ([], {}), '()\n', (175, 177), False, 'import sys\n'), ((4044, 4107), 'ConfigParser.RawConfigParser', 'ConfigParser....
import argparse from td import OneStepTD from off_pol_td import OffPolicyTD from driving import DrivingEnv, TRAVEL_TIME from sarsa import Sarsa from windy_gridworld import WindyGridworld import numpy as np from randomwalk import RandomWalk, NotSoRandomWalk, LEFT, RIGHT from cliff import TheCliff import matplotlib.pyplo...
[ "seaborn.heatmap", "argparse.ArgumentParser", "td_afterstate.TDAfterstate", "td.OneStepTD", "off_pol_td.OffPolicyTD", "max_bias_mdp.MaxBiasMDP", "matplotlib.pyplot.figure", "numpy.mean", "car_rental_afterstate.CarRentalAfterstateEnv", "numpy.linalg.norm", "driving.DrivingEnv", "matplotlib.pypl...
[((2297, 2309), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (2307, 2309), True, 'import matplotlib.pyplot as plt\n'), ((2347, 2359), 'driving.DrivingEnv', 'DrivingEnv', ([], {}), '()\n', (2357, 2359), False, 'from driving import DrivingEnv, TRAVEL_TIME\n'), ((2535, 2586), 'td.OneStepTD', 'OneStepTD', ([...
'''Constructs project specific dictionary containing prior model related objects To construct the dictionary, the code will create an instance of the PriorHandler class. Utilizing the methods of this class then loads the covariance related objects. Inputs: - hyperp: dictionary storing set hyperparameter values ...
[ "utils_data.prior_handler.PriorHandler", "numpy.expand_dims" ]
[((1113, 1183), 'utils_data.prior_handler.PriorHandler', 'PriorHandler', (['hyperp', 'options', 'filepaths', 'options.parameter_dimensions'], {}), '(hyperp, options, filepaths, options.parameter_dimensions)\n', (1125, 1183), False, 'from utils_data.prior_handler import PriorHandler\n'), ((1341, 1370), 'numpy.expand_dim...
import numpy as np A=np.array([[1,-2j],[2j,5]]) print(A) #A=L.dot(L^H) with A is positive definite matrix and L is lower triangular matrix. L=np.linalg.cholesky(A) print(L) print(L.dot(L.T.conj())) a=np.array([[4,12,-16],[12,37,-43],[-16,-43,98]]) L=np.linalg.cholesky(a) print(L) L_T=L.transpose() print(L.dot(L_T)...
[ "numpy.array", "numpy.linalg.cholesky" ]
[((22, 55), 'numpy.array', 'np.array', (['[[1, -2.0j], [2.0j, 5]]'], {}), '([[1, -2.0j], [2.0j, 5]])\n', (30, 55), True, 'import numpy as np\n'), ((145, 166), 'numpy.linalg.cholesky', 'np.linalg.cholesky', (['A'], {}), '(A)\n', (163, 166), True, 'import numpy as np\n'), ((204, 259), 'numpy.array', 'np.array', (['[[4, 1...
# ============================================================================= # PROJECT CHRONO - http://projectchrono.org # # Copyright (c) 2019 projectchrono.org # All rights reserved. # # Use of this source code is governed by a BSD-style license that can be found # in the LICENSE file at the top level of the distr...
[ "pychrono.core.ChFrameD", "pychrono.core.ChBodyEasyCylinder", "pychrono.irrlicht.ChVisualSystemIrrlicht", "pychrono.core.ChLinkMotorRotationSpeed", "pychrono.core.ChSystemNSC", "pychrono.core.ChVectorD", "pychrono.core.ChFunction_Const", "pychrono.core.ChLinkLockPrismatic", "numpy.linspace", "pych...
[((1084, 1104), 'pychrono.core.ChSystemNSC', 'chrono.ChSystemNSC', ([], {}), '()\n', (1102, 1104), True, 'import pychrono.core as chrono\n'), ((1157, 1185), 'pychrono.core.ChVectorD', 'chrono.ChVectorD', (['(-1)', '(0.5)', '(0)'], {}), '(-1, 0.5, 0)\n', (1173, 1185), True, 'import pychrono.core as chrono\n'), ((1349, 1...
import dataclasses import logging from typing import ClassVar import numpy as np import torch from .annrescaler import AnnRescaler from .. import headmeta from ..visualizer import Cif as CifVisualizer from ..utils import create_sink, mask_valid_area LOG = logging.getLogger(__name__) @dataclasses.dataclass class Ci...
[ "numpy.full", "numpy.logical_and", "numpy.zeros", "numpy.expand_dims", "numpy.isnan", "numpy.linalg.norm", "numpy.round", "logging.getLogger" ]
[((259, 286), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (276, 286), False, 'import logging\n'), ((2145, 2201), 'numpy.zeros', 'np.zeros', (['(n_fields, field_h, field_w)'], {'dtype': 'np.float32'}), '((n_fields, field_h, field_w), dtype=np.float32)\n', (2153, 2201), True, 'import num...
import keras import matplotlib.pyplot as plt from keras.models import Sequential, load_model from keras.layers.core import Dense, Dropout, Activation import numpy as np from skimage.transform import resize def draw(image): fig = plt.figure(figsize=(4, 4)) ax = fig.add_subplot(111) ax.set_aspect('equal') ...
[ "keras.layers.core.Dense", "numpy.zeros", "matplotlib.pyplot.figure", "skimage.transform.resize", "keras.layers.core.Dropout", "keras.models.Sequential", "matplotlib.pyplot.savefig" ]
[((234, 260), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(4, 4)'}), '(figsize=(4, 4))\n', (244, 260), True, 'import matplotlib.pyplot as plt\n'), ((597, 619), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""fig.png"""'], {}), "('fig.png')\n", (608, 619), True, 'import matplotlib.pyplot as plt\n'), ((...
import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib.ticker import MaxNLocator from typing import Union, List import numpy as np from ..storage import History from .util import to_lists_or_default def plot_epsilons( histories: Union[List, History], labels: Union[List, str] = None,...
[ "numpy.log10", "matplotlib.ticker.MaxNLocator", "matplotlib.pyplot.subplots", "numpy.log" ]
[((1646, 1660), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1658, 1660), True, 'import matplotlib.pyplot as plt\n'), ((2307, 2332), 'matplotlib.ticker.MaxNLocator', 'MaxNLocator', ([], {'integer': '(True)'}), '(integer=True)\n', (2318, 2332), False, 'from matplotlib.ticker import MaxNLocator\n'), (...
#!/usr/bin/env python3 import socket import numpy as np import cv2 import os import time import struct class Camera(object): def __init__(self): # Data options (change me) self.im_height = 720 # 848x480, 1280x720 self.im_width = 1280 # self.resize_height = 720 # self.res...
[ "socket.socket", "numpy.isinf", "numpy.fromstring", "numpy.isnan" ]
[((537, 586), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (550, 586), False, 'import socket\n'), ((1900, 1987), 'numpy.fromstring', 'np.fromstring', (['data[9 * 4 + 9 * 4 + 16 * 4:9 * 4 + 9 * 4 + 16 * 4 + 4]', 'np.float32'], {}), '(data[9 *...
""" ====================== DMP as Potential Field ====================== A Dynamical Movement Primitive defines a potential field that superimposes several components: transformation system (goal-directed movement), forcing term (learned shape), and coupling terms (e.g., obstacle avoidance). """ print(__doc__) impor...
[ "matplotlib.pyplot.subplot", "numpy.zeros_like", "matplotlib.pyplot.show", "movement_primitives.dmp.CouplingTermObstacleAvoidance2D", "numpy.copy", "matplotlib.pyplot.plot", "movement_primitives.dmp_potential_field.plot_potential_field_2d", "matplotlib.pyplot.setp", "numpy.random.RandomState", "mo...
[((527, 556), 'numpy.array', 'np.array', (['[0, 0]'], {'dtype': 'float'}), '([0, 0], dtype=float)\n', (535, 556), True, 'import numpy as np\n'), ((566, 595), 'numpy.array', 'np.array', (['[1, 1]'], {'dtype': 'float'}), '([1, 1], dtype=float)\n', (574, 595), True, 'import numpy as np\n'), ((607, 628), 'numpy.array', 'np...
# Copyright (c) 2021, <NAME>. # 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 writing, s...
[ "cugraph.louvain", "cugraph.dask.get_chunksize", "cugraph.Graph", "cugraph.sssp", "cugraph.pagerank", "cugraph.weakly_connected_components", "numpy.random.default_rng", "cugraph.katz_centrality", "cugraph.generators.rmat", "cugraph.bfs", "cugraph.DiGraph" ]
[((1534, 1677), 'cugraph.generators.rmat', 'rmat', (['scale', '(2 ** scale * edgefactor)', '(0.1)', '(0.2)', '(0.3)', '(seed or 42)'], {'clip_and_flip': '(False)', 'scramble_vertex_ids': '(True)', 'create_using': 'None', 'mg': '(False)'}), '(scale, 2 ** scale * edgefactor, 0.1, 0.2, 0.3, seed or 42,\n clip_and_flip=...
import os import cv2 import argparse import subprocess import numpy as np import time import signal import curses def interrupted(signum, frame): raise TimeoutError signal.signal(signal.SIGALRM, interrupted) #sense_usuage=500 # MB #update_intervel=5#300 #300 # 5 min def Arguments(): parser = argparse.Argument...
[ "subprocess.Popen", "cv2.circle", "cv2.putText", "argparse.ArgumentParser", "cv2.waitKey", "curses.initscr", "numpy.zeros", "time.strftime", "os.path.exists", "curses.endwin", "time.sleep", "signal.alarm", "signal.signal", "cv2.imshow", "cv2.getWindowProperty" ]
[((169, 211), 'signal.signal', 'signal.signal', (['signal.SIGALRM', 'interrupted'], {}), '(signal.SIGALRM, interrupted)\n', (182, 211), False, 'import signal\n'), ((303, 328), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (326, 328), False, 'import argparse\n'), ((3049, 3095), 'numpy.zeros', '...
""" Functions and Classes used to fit an estimate of an unabsorbed continuum to a QSO spectrum. """ # p2.6+ compatibility from __future__ import division, print_function, unicode_literals try: unicode except NameError: unicode = basestring = str import numpy as np import matplotlib.pyplot as pl import matplot...
[ "numpy.abs", "numpy.ones", "numpy.isnan", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.gca", "numpy.interp", "os.path.lexists", "matplotlib.pyplot.draw", "matplotlib.transforms.blended_transform_factory", "numpy.linspace", "numpy.repeat", "numpy.ceil", "numpy.median", "...
[((2483, 2502), 'numpy.ones', 'np.ones', (['npts', 'bool'], {}), '(npts, bool)\n', (2490, 2502), True, 'import numpy as np\n'), ((2515, 2536), 'numpy.zeros', 'np.zeros', (['npts', 'float'], {}), '(npts, float)\n', (2523, 2536), True, 'import numpy as np\n'), ((2546, 2567), 'numpy.zeros', 'np.zeros', (['npts', 'float'],...
from pathlib import Path import shutil import pandas as pd import torch from torch.utils.data import Dataset import pickle import numpy as np import torchvision.transforms.functional as F from torchvision import transforms import tarfile import datetime import pytz from PIL import Image from tqdm import tqdm from sklea...
[ "pandas.read_csv", "sklearn.metrics.accuracy_score", "numpy.asarray", "PIL.Image.open", "pathlib.Path", "sklearn.metrics.f1_score", "sklearn.metrics.precision_recall_fscore_support" ]
[((2625, 2645), 'pathlib.Path', 'Path', (['self._data_dir'], {}), '(self._data_dir)\n', (2629, 2645), False, 'from pathlib import Path\n'), ((2765, 2806), 'pandas.read_csv', 'pd.read_csv', (["(self.root / 'clean_data.csv')"], {}), "(self.root / 'clean_data.csv')\n", (2776, 2806), True, 'import pandas as pd\n'), ((5295,...
# -*- coding: utf-8 -*- """ Created on Sat Jan 9 11:37:59 2021 @author: Prachi """ import numpy as np import argparse import sys import os import matplotlib.pyplot as plt import pickle from pdb import set_trace as bp import subprocess import scipy.io as sio from scipy.sparse import coo_matrix import...
[ "numpy.load", "numpy.diag_indices_from", "argparse.ArgumentParser", "numpy.sum", "numpy.triu", "numpy.empty", "numpy.ones", "numpy.argsort", "os.path.isfile", "numpy.linalg.norm", "numpy.arange", "numpy.exp", "numpy.unique", "numpy.transpose", "numpy.genfromtxt", "pic_dihard_ami.PIC_di...
[((366, 377), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (375, 377), False, 'import os\n'), ((508, 643), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Do speaker clsutering based onmy ahc"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='Do speaker clsu...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import io import json import math import os import numpy as np from PIL import Image from PIL import ImageFile import tensorflow.compat.v2 as tf from absl import logging from absl import app from absl import...
[ "cv2.resize", "numpy.save", "os.path.basename", "cv2.cvtColor", "cv2.transpose", "absl.flags.DEFINE_string", "absl.logging.info", "cv2.VideoCapture", "absl.app.run", "absl.flags.DEFINE_integer", "absl.flags.DEFINE_boolean", "os.path.splitext", "cv2.flip", "absl.flags.DEFINE_list", "os.pa...
[((343, 411), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""acivity"""', '"""swing"""', '"""The class of test images."""'], {}), "('acivity', 'swing', 'The class of test images.')\n", (362, 411), False, 'from absl import flags\n'), ((412, 532), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""input_d...
# we need to cross validate all the methods import sys # sys.path.append(r'C:\Leenoy\Postdoc 1st year\IBL\Code_camp_September_2019\data_code_camp\dim_red_WG\umap-master') sys.path.append('/Users/dep/Workspaces/Rodent/IBL/ibllib') sys.path.append('/Users/dep/Workspaces/Rodent/IBL/code_camp/ibl-dimensionality_reduc...
[ "sys.path.append", "dim_reduce.bin_types", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "mpl_toolkits.mplot3d.Axes3D", "sklearn.manifold.TSNE", "numpy.split", "sklearn.manifold.LocallyLinearEmbedding", "matplotlib.pyplot.ion", "pathlib.Path", "matplotlib.pyplot.figure", "sklearn.manifo...
[((176, 234), 'sys.path.append', 'sys.path.append', (['"""/Users/dep/Workspaces/Rodent/IBL/ibllib"""'], {}), "('/Users/dep/Workspaces/Rodent/IBL/ibllib')\n", (191, 234), False, 'import sys\n'), ((236, 332), 'sys.path.append', 'sys.path.append', (['"""/Users/dep/Workspaces/Rodent/IBL/code_camp/ibl-dimensionality_reducti...
import numpy as np from sklearn import model_selection from sklearn import datasets from sklearn.ensemble import GradientBoostingRegressor from sklearn.metrics import mean_squared_error import matplotlib.pyplot as plt import seaborn as sns class Friedman1Test: """This class encapsulates the Friedman1 regression ...
[ "matplotlib.pyplot.title", "seaborn.set_style", "matplotlib.pyplot.show", "sklearn.datasets.make_friedman1", "sklearn.model_selection.train_test_split", "sklearn.ensemble.GradientBoostingRegressor", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "numpy.delete", "sklearn.metrics.mean_squar...
[((3234, 3260), 'seaborn.set_style', 'sns.set_style', (['"""whitegrid"""'], {}), "('whitegrid')\n", (3247, 3260), True, 'import seaborn as sns\n'), ((3383, 3413), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""n First Features"""'], {}), "('n First Features')\n", (3393, 3413), True, 'import matplotlib.pyplot as plt\n'...
import numpy as np def TAPOHardLaw(r, tau0, q, b, H): sigma = tau0 + q * (1 - np.exp(-b * r)) + H * r return sigma r = np.arange(0, 0.2, 0.01) tau0 = np.average([22.3, 24.88, 23.92]) q = np.average([7.76, 6.19, 6.23]) b = np.average([40.59, 49.48, 47.46]) H = np.average([8.11, 6.82, 13.58]) stress = TAPOHar...
[ "numpy.average", "numpy.arange", "numpy.exp", "numpy.vstack" ]
[((130, 153), 'numpy.arange', 'np.arange', (['(0)', '(0.2)', '(0.01)'], {}), '(0, 0.2, 0.01)\n', (139, 153), True, 'import numpy as np\n'), ((161, 193), 'numpy.average', 'np.average', (['[22.3, 24.88, 23.92]'], {}), '([22.3, 24.88, 23.92])\n', (171, 193), True, 'import numpy as np\n'), ((198, 228), 'numpy.average', 'np...
import os import numpy as np from ReconstructOrder.utils import mManagerReader from ReconstructOrder.utils import imBitConvert if __name__ == '__main__': RawDataPath = '/flexo/ComputationalMicroscopy/Projects/brainarchitecture' ProcessedPath = RawDataPath ImgDir = '2019_01_04_david_594CTIP2_647SATB2_20X' ...
[ "ReconstructOrder.utils.mManagerReader", "numpy.sin", "ReconstructOrder.utils.imBitConvert", "numpy.cos", "os.path.join" ]
[((479, 519), 'os.path.join', 'os.path.join', (['RawDataPath', 'ImgDir', 'SmDir'], {}), '(RawDataPath, ImgDir, SmDir)\n', (491, 519), False, 'import os\n'), ((621, 713), 'ReconstructOrder.utils.mManagerReader', 'mManagerReader', (['img_sm_path', 'OutputPath'], {'input_chan': 'input_chan', 'output_chan': 'output_chan'})...
#! /usr/bin/python2 # -*- coding: utf-8 -*- # Using AC for the construction of galaxies import numpy as np import scipy.stats.distributions as dis from mayavi import mlab from itertools import repeat, izip, ifilter class Star(object): "Clase para definir una Estrella""" def __init__(self, r, angle, state=...
[ "itertools.ifilter", "mayavi.mlab.show", "mayavi.mlab.points3d", "scipy.stats.distributions.rv_discrete", "numpy.sin", "numpy.arange", "numpy.cos", "mayavi.mlab.view", "mayavi.mlab.pipeline.gaussian_splatter" ]
[((4493, 4537), 'mayavi.mlab.view', 'mlab.view', (['(49)', '(31.5)', '(52.8)', '(4.2, 37.3, 20.6)'], {}), '(49, 31.5, 52.8, (4.2, 37.3, 20.6))\n', (4502, 4537), False, 'from mayavi import mlab\n'), ((4542, 4553), 'mayavi.mlab.show', 'mlab.show', ([], {}), '()\n', (4551, 4553), False, 'from mayavi import mlab\n'), ((659...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from typing import Union, Callable, Dict, TypeVar, Optional, List import itertools import tensorflow as tf import numpy as np TF_EXECUTABLE_ND_ARRAY = TypeVar('TF_EXECUTABLE_ND_ARRAY', tf.Tensor, np.ndarray) de...
[ "tensorflow.clip_by_value", "tensorflow.gather_nd", "tensorflow.floor", "tensorflow.reduce_prod", "numpy.arange", "tensorflow.compat.v1.name_scope", "tensorflow.concat", "tensorflow.stack", "tensorflow.cast", "typing.TypeVar", "tensorflow.name_scope", "numpy.stack", "tensorflow.range", "nu...
[((226, 282), 'typing.TypeVar', 'TypeVar', (['"""TF_EXECUTABLE_ND_ARRAY"""', 'tf.Tensor', 'np.ndarray'], {}), "('TF_EXECUTABLE_ND_ARRAY', tf.Tensor, np.ndarray)\n", (233, 282), False, 'from typing import Union, Callable, Dict, TypeVar, Optional, List\n'), ((474, 500), 'tensorflow.convert_to_tensor', 'tf.convert_to_tens...
import json from argparse import ArgumentParser import tensorflow as tf import cv2 import sys import numpy as np from PIL import Image def cut_faces(image, faces_coord): faces = [] for (x, y, w, h) in faces_coord: faces.append(image[y: y + h, x: x + w]) return faces def resize(images, size=(224...
[ "tensorflow.keras.models.load_model", "argparse.ArgumentParser", "cv2.putText", "numpy.argmax", "cv2.waitKey", "cv2.imshow", "tensorflow.config.experimental.set_memory_growth", "numpy.expand_dims", "cv2.VideoCapture", "cv2.rectangle", "numpy.array", "cv2.CascadeClassifier", "PIL.Image.fromar...
[((907, 958), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (951, 958), True, 'import tensorflow as tf\n'), ((1063, 1130), 'tensorflow.config.experimental.set_memory_growth', 'tf.config.experimental.set_memory_growth', (['physic...
# Copyright (c) 2019, Vienna University of Technology (TU Wien), Department of # Geodesy and Geoinformation (GEO). # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source ...
[ "yeoda.errors.TileNotAvailable", "geospade.raster.SpatialRef", "veranda.io.timestack.GeoTiffRasterTimeStack", "numpy.arange", "yeoda.errors.DimensionUnkown", "yeoda.errors.LoadingDataError", "shapely.geometry.Polygon", "yeoda.errors.IOClassNotFound", "yeoda.errors.FileTypeUnknown", "veranda.io.tim...
[((65923, 65978), 'pandas.concat', 'pd.concat', (['inventories'], {'ignore_index': '(True)', 'join': '"""inner"""'}), "(inventories, ignore_index=True, join='inner')\n", (65932, 65978), True, 'import pandas as pd\n'), ((11604, 11633), 'copy.deepcopy', 'copy.deepcopy', (['self.inventory'], {}), '(self.inventory)\n', (11...
import numpy as np import pyximport; pyximport.install(setup_args={"include_dirs":np.get_include()}) from cam_viewer.data_structures.state_machine import ThreadedSocketedStateMachine, JMsg import cam_viewer.data_util.cy_scatter as ct import pyqtgraph as pg import time from PyQt5.QtCore import QObject, pyqtSignal cla...
[ "PyQt5.QtCore.pyqtSignal", "cam_viewer.data_util.cy_scatter.apply_roi", "numpy.get_include", "cam_viewer.data_util.cy_scatter.create_color_data", "cam_viewer.data_util.cy_scatter.scatter_data" ]
[((398, 432), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', (['np.ndarray', 'np.ndarray'], {}), '(np.ndarray, np.ndarray)\n', (408, 432), False, 'from PyQt5.QtCore import QObject, pyqtSignal\n'), ((450, 462), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', ([], {}), '()\n', (460, 462), False, 'from PyQt5.QtCore import QObject, pyq...
# -*- coding: utf-8 -*- """ 動く背景動画を作成する ====================== Description. """ # import standard libraries import os # import third-party libraries import numpy as np from colour import write_image, read_image from multiprocessing import Pool, cpu_count # import my libraries # information __author__ = '<NAME>' _...
[ "os.path.abspath", "colour.write_image", "numpy.hstack", "numpy.arange", "os.path.splitext", "colour.read_image", "numpy.vstack", "multiprocessing.cpu_count" ]
[((1147, 1197), 'colour.write_image', 'write_image', (['out_img', 'out_name'], {'bit_depth': '"""uint16"""'}), "(out_img, out_name, bit_depth='uint16')\n", (1158, 1197), False, 'from colour import write_image, read_image\n'), ((1355, 1374), 'colour.read_image', 'read_image', (['bg_file'], {}), '(bg_file)\n', (1365, 137...
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 # ============================================== # # =========== C: Coarse Grain Fitter =========== # # ============================================== # # Written by <NAME> # August 2019 # # ================ Requiremets ================ # from matplot...
[ "matplotlib.pyplot.show", "numpy.std", "matplotlib.pyplot.scatter", "scipy.interpolate.UnivariateSpline", "BINAnalysis.Histogram", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.savefig" ]
[((1665, 1705), 'BINAnalysis.Histogram', 'boandi.Histogram', (['mes_type', 'values', 'step'], {}), '(mes_type, values, step)\n', (1681, 1705), True, 'import BINAnalysis as boandi\n'), ((1959, 1981), 'scipy.interpolate.UnivariateSpline', 'UnivariateSpline', (['x', 'y'], {}), '(x, y)\n', (1975, 1981), False, 'from scipy....
import numpy as np import random as random from random import sample import copy as cp from HandEvaluator import HandEvaluator from keras.models import Sequential from keras.layers import LSTM, Dense, Merge from keras.optimizers import Adam from keras.models import load_model # Some useful methods. def is_discard_r...
[ "keras.models.load_model", "keras.layers.Merge", "numpy.sum", "random.randint", "numpy.argmax", "keras.layers.LSTM", "numpy.asarray", "random.random", "numpy.max", "keras.layers.Dense", "HandEvaluator.HandEvaluator", "keras.models.Sequential", "numpy.vstack" ]
[((1284, 1299), 'HandEvaluator.HandEvaluator', 'HandEvaluator', ([], {}), '()\n', (1297, 1299), False, 'from HandEvaluator import HandEvaluator\n'), ((1795, 1807), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1805, 1807), False, 'from keras.models import Sequential\n'), ((2234, 2246), 'keras.models.Seque...
import os import numpy as np import h5py from .utils import timestamp2array, timestamp2vec_origin, transtr, transtrlong, transtr24 def external_taxibj(datapath, fourty_eight, previous_meteorol): def f(tsx, tsy, ext_time): exd = ExtDat(datapath) tsx = np.asarray([exd.get_bjextarray(N, ext_time, fo...
[ "h5py.File", "numpy.asarray", "numpy.hstack", "numpy.timedelta64", "os.path.join", "numpy.vstack" ]
[((1507, 1553), 'os.path.join', 'os.path.join', (['datapath', 'dataset', '"""Holiday.txt"""'], {}), "(datapath, dataset, 'Holiday.txt')\n", (1519, 1553), False, 'import os\n'), ((1997, 2046), 'os.path.join', 'os.path.join', (['datapath', 'dataset', '"""Meteorology.h5"""'], {}), "(datapath, dataset, 'Meteorology.h5')\n"...
# Copyright (c) 2003-2019 by <NAME> # # TreeCorr is free software: redistribution and use in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions...
[ "test_helper.assert_raises", "numpy.arctan2", "numpy.abs", "numpy.floor", "treecorr.Catalog", "fitsio.read", "numpy.isclose", "numpy.exp", "os.path.join", "numpy.testing.assert_almost_equal", "test_helper.do_pickle", "numpy.genfromtxt", "numpy.random.RandomState", "numpy.arcsin", "numpy....
[((3214, 3289), 'treecorr.NNNCorrelation', 'treecorr.NNNCorrelation', ([], {'min_sep': '(5)', 'max_sep': '(20)', 'nbins': '(20)', 'bin_type': '"""LogRUV"""'}), "(min_sep=5, max_sep=20, nbins=20, bin_type='LogRUV')\n", (3237, 3289), False, 'import treecorr\n'), ((3646, 3772), 'treecorr.NNNCorrelation', 'treecorr.NNNCorr...
import numpy as np import shutil import pytest import pysixtrack import CollimationToolKit as ctk #------------------------------------------------------------------------------- #--- basic foil class with default scatter function ------------------------- #------------ should act like LimitRect ---------------------...
[ "pysixtrack.Particles", "numpy.random.uniform", "numpy.zeros_like", "numpy.ones_like", "shutil.which", "pytest.skip", "CollimationToolKit.elements.LimitFoil", "pysixtrack.elements.LimitRect", "numpy.array_equal", "numpy.sqrt" ]
[((2371, 2448), 'CollimationToolKit.elements.LimitFoil', 'ctk.elements.LimitFoil', ([], {'min_x': 'foil_min_x', 'scatter': 'ctk.ScatterFunctions.GLOBAL'}), '(min_x=foil_min_x, scatter=ctk.ScatterFunctions.GLOBAL)\n', (2393, 2448), True, 'import CollimationToolKit as ctk\n'), ((463, 549), 'pysixtrack.elements.LimitRect'...
import logging import os import numpy as np from flask import Flask, jsonify, request from flask_cors import CORS from tensorflow import keras logging.basicConfig(level=logging.INFO) base_path = os.path.abspath(os.path.dirname(__file__)) logging.info('base path: {}'.format(base_path)) app = Flask(__name__) CORS(app)...
[ "logging.basicConfig", "numpy.argmax", "flask_cors.CORS", "flask.request.args.get", "os.path.dirname", "flask.Flask", "numpy.expand_dims", "logging.info", "flask.jsonify", "numpy.array", "os.path.join" ]
[((145, 184), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (164, 184), False, 'import logging\n'), ((295, 310), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (300, 310), False, 'from flask import Flask, jsonify, request\n'), ((311, 320), 'flask_c...
import numpy as np import operator _DeBug_ = False Smth = 2 BGloop= 10 PixNo = 25 PixNo_1_2 = 12 DirNo = 15 DirAgl= [i*(180//DirNo) for i in range(DirNo)] RowNo = lambda row: row//PixNo ColNo = lambda col: col//PixNo def checkTri(angle, fac=0): if (fac==0): # 0 +/- 30 if ( angle >=30 and angle < 90): #(60) ...
[ "numpy.full", "numpy.average", "numpy.copy", "numpy.argmax", "numpy.std", "numpy.empty", "numpy.zeros", "numpy.append", "numpy.tan", "numpy.array", "numpy.cos", "numpy.arctan", "numpy.ndarray", "numpy.unique" ]
[((14876, 14911), 'numpy.full', 'np.full', (['(DirNo, 3)', '(0)'], {'dtype': 'float'}), '((DirNo, 3), 0, dtype=float)\n', (14883, 14911), True, 'import numpy as np\n'), ((1695, 1707), 'numpy.empty', 'np.empty', (['(91)'], {}), '(91)\n', (1703, 1707), True, 'import numpy as np\n'), ((1814, 1834), 'numpy.zeros', 'np.zero...
# You can run this example via # # $ civis-compute submit iris.py # $ <JOBID> # $ civis-compute status # $ civis-compute get <JOBID> # import os import pickle import numpy as np from sklearn.datasets import load_iris from sklearn.ensemble import RandomForestClassifier # Civis Platform container configurat...
[ "sklearn.ensemble.RandomForestClassifier", "sklearn.datasets.load_iris", "pickle.dump", "numpy.random.seed", "numpy.arange", "os.path.join", "numpy.random.shuffle" ]
[((462, 473), 'sklearn.datasets.load_iris', 'load_iris', ([], {}), '()\n', (471, 473), False, 'from sklearn.datasets import load_iris\n'), ((531, 552), 'numpy.arange', 'np.arange', (['X.shape[0]'], {}), '(X.shape[0])\n', (540, 552), True, 'import numpy as np\n'), ((553, 574), 'numpy.random.seed', 'np.random.seed', (['(...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01_data.ipynb (unless otherwise specified). __all__ = ['RegionST', 'extract_region', 'coords2bbox', 'split_region', 'merge_tifs', 'filter_region', 'filter_cloudy', 'n_least_cloudy', 'download_topography_data', 'download_data', 'download_data_ts', 'get_event_da...
[ "os.remove", "banet.geo.downsample", "banet.geo.open_tif", "pathlib.Path", "rasterio.coords.BoundingBox", "requests.get", "pandas.Timedelta", "ee.Initialize", "pandas.date_range", "rasterio.Env", "numpy.concatenate", "numpy.nanmax", "pandas.Timestamp", "json.load", "ee.ImageCollection", ...
[((5042, 5076), 'ee.Geometry.Rectangle', 'ee.Geometry.Rectangle', (['region.bbox'], {}), '(region.bbox)\n', (5063, 5076), False, 'import ee\n'), ((6043, 6052), 'pathlib.Path', 'Path', (['"""."""'], {}), "('.')\n", (6047, 6052), False, 'from pathlib import Path\n'), ((6191, 6206), 'ee.Initialize', 'ee.Initialize', ([], ...
#https://towardsdatascience.com/outlier-detection-with-isolation-forest-3d190448d45e #reference link # importing libaries ---- import numpy as np import pandas as pd import matplotlib.pyplot as plt from pylab import savefig from sklearn.ensemble import IsolationForest # Generating data ---- rng = np.random.RandomStat...
[ "pandas.DataFrame", "sklearn.ensemble.IsolationForest", "numpy.random.RandomState" ]
[((300, 325), 'numpy.random.RandomState', 'np.random.RandomState', (['(42)'], {}), '(42)\n', (321, 325), True, 'import numpy as np\n'), ((438, 481), 'pandas.DataFrame', 'pd.DataFrame', (['X_train'], {'columns': "['x1', 'x2']"}), "(X_train, columns=['x1', 'x2'])\n", (450, 481), True, 'import pandas as pd\n'), ((601, 643...
# -*- coding: utf-8 -*- """ Created on Sun Oct 22 16:37:22 2017 @author: dzhaojie """ #import HelpFunctionsForCellTracking as HFCT import os import numpy as np from skimage import io def extract_intensity(num_of_field): F=io.imread('C:/Users/Desktop/AVG_flatfield-5x-590 nm LED.tif') F=F.ast...
[ "skimage.io.imread", "numpy.floor", "numpy.square", "numpy.zeros", "numpy.sort", "numpy.unique" ]
[((246, 307), 'skimage.io.imread', 'io.imread', (['"""C:/Users/Desktop/AVG_flatfield-5x-590 nm LED.tif"""'], {}), "('C:/Users/Desktop/AVG_flatfield-5x-590 nm LED.tif')\n", (255, 307), False, 'from skimage import io\n'), ((918, 938), 'numpy.unique', 'np.unique', (['xyl[:, 4]'], {}), '(xyl[:, 4])\n', (927, 938), True, 'i...
import numpy as np from correlations import * from normalizations import * # equal weighting def equal_weighting(X): N = np.shape(X)[1] return np.ones(N) / N # entropy weighting def entropy_weighting(X): # normalization for profit criteria criteria_type = np.ones(np.shape(X)[1]) pij = sum_normal...
[ "numpy.sum", "numpy.log", "numpy.std", "numpy.zeros", "numpy.ones", "numpy.hstack", "numpy.shape" ]
[((357, 370), 'numpy.shape', 'np.shape', (['pij'], {}), '(pij)\n', (365, 370), True, 'import numpy as np\n'), ((380, 396), 'numpy.zeros', 'np.zeros', (['(m, n)'], {}), '((m, n))\n', (388, 396), True, 'import numpy as np\n'), ((712, 729), 'numpy.std', 'np.std', (['X'], {'axis': '(0)'}), '(X, axis=0)\n', (718, 729), True...
import matplotlib.pyplot as plt import numpy as np import time from pydmd import HODMD def myfunc(x): return np.cos(x)*np.sin(np.cos(x)) + np.cos(x*.2) x = np.linspace(0, 10, 64) y = myfunc(x) snapshots = y plt.plot(x, snapshots, '.') plt.show() hodmd = HODMD(svd_rank=0, exact=True, opt=True, d=30).fit(snapsh...
[ "matplotlib.pyplot.subplot", "numpy.random.uniform", "matplotlib.pyplot.show", "pydmd.HODMD", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.linspace", "numpy.cos" ]
[((165, 187), 'numpy.linspace', 'np.linspace', (['(0)', '(10)', '(64)'], {}), '(0, 10, 64)\n', (176, 187), True, 'import numpy as np\n'), ((216, 243), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'snapshots', '"""."""'], {}), "(x, snapshots, '.')\n", (224, 243), True, 'import matplotlib.pyplot as plt\n'), ((244, 254), ...
# -*- coding: utf-8 -*- """ Created on Mon Mar 16 17:02:17 2020 @author: rowe1 """ from __future__ import print_function import numpy as np import os import tensorflow as tf from tensorflow import keras import matplotlib.pyplot as plt os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' os.environ["PATH"] += os.pathsep + 'C:/P...
[ "numpy.sum", "matplotlib.pyplot.plot", "tensorflow.keras.layers.Dense", "matplotlib.pyplot.legend", "numpy.reshape", "tensorflow.keras.layers.Input", "numpy.random.rand", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig" ]
[((5691, 5711), 'numpy.sum', 'np.sum', (['temp_fitness'], {}), '(temp_fitness)\n', (5697, 5711), True, 'import numpy as np\n'), ((1440, 1493), 'matplotlib.pyplot.plot', 'plt.plot', (['generations', 'best', '"""r-"""'], {'label': '"""Best"""', 'lw': '(2)'}), "(generations, best, 'r-', label='Best', lw=2)\n", (1448, 1493...
# Data-enriching GAN (DeGAN)/ DCGAN for retrieving images from a trained classifier from __future__ import print_function import argparse import os import random import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data import t...
[ "argparse.ArgumentParser", "dcgan_model.Generator", "torch.randn", "torch.full", "numpy.random.randint", "torch.device", "torchvision.transforms.Normalize", "torch.nn.functional.normalize", "alexnet.AlexNet", "torch.nn.BCELoss", "random.randint", "torchvision.transforms.Scale", "torch.load",...
[((652, 667), 'tensorboardX.SummaryWriter', 'SummaryWriter', ([], {}), '()\n', (665, 667), False, 'from tensorboardX import SummaryWriter\n'), ((870, 895), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (893, 895), False, 'import argparse\n'), ((2663, 2690), 'random.seed', 'random.seed', (['opt...
from tensorflow.keras.preprocessing import image import numpy as np from .augment_and_mix import augment_and_mix import albumentations def segmentation_alb(input_image, label, mean, std, augmentation_dict): transforms = get_aug(augmentation_dict) if len(transforms) > 0: aug = albumentations.Compose(t...
[ "albumentations.Compose", "tensorflow.keras.preprocessing.image.ImageDataGenerator", "numpy.random.randint", "albumentations.OneOf" ]
[((2096, 2137), 'tensorflow.keras.preprocessing.image.ImageDataGenerator', 'image.ImageDataGenerator', ([], {}), '(**data_gen_args)\n', (2120, 2137), False, 'from tensorflow.keras.preprocessing import image\n'), ((2157, 2198), 'tensorflow.keras.preprocessing.image.ImageDataGenerator', 'image.ImageDataGenerator', ([], {...
import os import cv2 import gym import torch import random import numpy as np from six import iteritems from datetime import datetime def seed(seed): torch.cuda.manual_seed(seed) torch.manual_seed(seed) np.random.seed(seed) random.seed(seed) def evaluate_policy(env, policy, eval_episodes=10, max_tim...
[ "numpy.uint8", "numpy.random.seed", "numpy.multiply", "os.makedirs", "torch.manual_seed", "torch.cuda.manual_seed", "numpy.expand_dims", "os.path.exists", "cv2.addWeighted", "random.seed", "numpy.array", "cv2.applyColorMap", "cv2.resize" ]
[((156, 184), 'torch.cuda.manual_seed', 'torch.cuda.manual_seed', (['seed'], {}), '(seed)\n', (178, 184), False, 'import torch\n'), ((189, 212), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (206, 212), False, 'import torch\n'), ((217, 237), 'numpy.random.seed', 'np.random.seed', (['seed'], {}),...
from unittest import mock import chainer import numpy as np import pytest from deep_sentinel.models.dnn.model.layers import mid chainer.global_config.train = False chainer.global_config.enable_backprop = False @pytest.fixture def activate_func(): m = mock.MagicMock() m.side_effect = lambda x: x return ...
[ "unittest.mock.MagicMock", "deep_sentinel.models.dnn.model.layers.mid.MidLayer", "numpy.arange", "numpy.array", "pytest.mark.parametrize" ]
[((433, 610), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""data, n_units"""', '[([[[0, 0], [0, 0]], [[0, 0], [0, 0]]], 5), ([[[0], [0], [0], [0]], [[0], [\n 0], [0], [0]]], 4), ([[[0, 0, 0], [0, 0, 0]]], 3)]'], {}), "('data, n_units', [([[[0, 0], [0, 0]], [[0, 0], [0, \n 0]]], 5), ([[[0], [0], [0],...
#!/usr/bin python3 """ Stats functions for the GUI """ import time import os import warnings from math import ceil, sqrt import numpy as np from lib.Serializer import PickleSerializer class SavedSessions(object): """ Saved Training Session """ def __init__(self, sessions_data): self.serializer = P...
[ "numpy.poly1d", "warnings.simplefilter", "math.ceil", "numpy.polyfit", "time.gmtime", "time.time", "os.path.isfile", "os.path.join" ]
[((515, 539), 'os.path.isfile', 'os.path.isfile', (['filename'], {}), '(filename)\n', (529, 539), False, 'import os\n'), ((1785, 1796), 'time.time', 'time.time', ([], {}), '()\n', (1794, 1796), False, 'import time\n'), ((1925, 1973), 'os.path.join', 'os.path.join', (['self.modeldir', '"""trainingstats.fss"""'], {}), "(...
import matplotlib.pyplot as plt import tensorflow as tf import numpy as np def images_from_samples(samples, dimensions=(5, 5), epoch=None, save=True): # Remove channel dimension if present if samples.ndim > 3 and samples.shape[-1] == 1: samples = samples.squeeze(axis=3) fig = plt.figure(figsize=di...
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "tensorflow.summary.scalar", "matplotlib.pyplot.imshow", "tensorflow.reduce_mean", "matplotlib.pyplot.axis", "tensorflow.placeholder", "matplotlib.pyplot.figure", "tensorflow.summary.FileWriter", "tensorflow.summary.histogram", "tensorflow.n...
[((299, 329), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': 'dimensions'}), '(figsize=dimensions)\n', (309, 329), True, 'import matplotlib.pyplot as plt\n'), ((781, 791), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (789, 791), True, 'import matplotlib.pyplot as plt\n'), ((2053, 2114), 'tensorfl...
from __future__ import division from io import BytesIO import os import os.path as op import numpy as np from PIL import Image from traits.api import String, Tuple, provides from .cacheing_decorators import lru_cache from .i_tile_manager import ITileManager from .tile_manager import TileManager @provides(ITileMan...
[ "io.BytesIO", "numpy.load", "os.path.isdir", "traits.api.provides", "os.path.exists", "PIL.Image.fromarray", "os.path.join", "os.listdir" ]
[((303, 325), 'traits.api.provides', 'provides', (['ITileManager'], {}), '(ITileManager)\n', (311, 325), False, 'from traits.api import String, Tuple, provides\n'), ((1880, 1896), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (1890, 1896), False, 'import os\n'), ((872, 890), 'numpy.load', 'np.load', (['tile_p...
import numpy as np from time import time from keras.datasets import mnist from tmu.tsetlin_machine import TMCoalescedClassifier import copy clauses = 64 T = int(clauses*0.75) s = 5.0 patch_size = 3 resolution = 8 number_of_state_bits = 8 (X_train_org, Y_train), (X_test_org, Y_test) = mnist.load_data() Y_train=Y_t...
[ "tmu.tsetlin_machine.TMCoalescedClassifier", "keras.datasets.mnist.load_data", "numpy.empty", "time.time", "numpy.savez_compressed" ]
[((290, 307), 'keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()\n', (305, 307), False, 'from keras.datasets import mnist\n'), ((401, 509), 'numpy.empty', 'np.empty', (['(X_train_org.shape[0], X_train_org.shape[1], X_train_org.shape[2], resolution)'], {'dtype': 'np.uint8'}), '((X_train_org.shape[0], X_t...
import unittest import numpy as np import scipy.stats as st from ..analysis import LinearRegression from ..analysis.exc import MinimumSizeError, NoDataError from ..data import UnequalVectorLengthError, Vector class MyTestCase(unittest.TestCase): def test_350_LinRegress_corr(self): """Test the Linear Regr...
[ "unittest.main", "numpy.random.seed", "scipy.stats.norm.rvs" ]
[((8507, 8522), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8520, 8522), False, 'import unittest\n'), ((360, 385), 'numpy.random.seed', 'np.random.seed', (['(987654321)'], {}), '(987654321)\n', (374, 385), True, 'import numpy as np\n'), ((1115, 1140), 'numpy.random.seed', 'np.random.seed', (['(987654321)'], {}...
from keras.models import Sequential from keras.layers.core import Dense, Activation, Dropout from keras.layers.recurrent import LSTM, GRU from keras.utils.data_utils import get_file from keras.optimizers import RMSprop import numpy as np import sys import time import random import sys import os import re from io import...
[ "sys.stdout.write", "numpy.abs", "numpy.argmax", "numpy.random.multinomial", "sys.stdout.flush", "numpy.exp", "keras.layers.core.Activation", "keras.layers.core.Dropout", "re.sub", "io.StringIO", "keras.layers.recurrent.GRU", "keras.layers.core.Dense", "keras.optimizers.RMSprop", "numpy.co...
[((947, 961), 'io.StringIO', 'StringIO', (['text'], {}), '(text)\n', (955, 961), False, 'from io import StringIO\n'), ((1428, 1465), 'numpy.zeros', 'np.zeros', (['(batch_size, 1, char_count)'], {}), '((batch_size, 1, char_count))\n', (1436, 1465), True, 'import numpy as np\n'), ((1474, 1508), 'numpy.zeros', 'np.zeros',...
from Main.AlphaZero.DistributedSelfPlay import Constants as C from Main.AlphaZero.Oracle import GraphOptimizer, OracleCommands from Main import Hyperparameters, MachineSpecificSettings # from keras import backend as K # import tensorflow as tf import numpy as np ORACLE_PIPE = None K = None tf = None de...
[ "numpy.random.random", "numpy.array" ]
[((2710, 2788), 'numpy.array', 'np.array', (['([[1, 1, 1, 1, 1, 1, 1]] * Hyperparameters.AMOUNT_OF_GAMES_PER_WORKER)'], {}), '([[1, 1, 1, 1, 1, 1, 1]] * Hyperparameters.AMOUNT_OF_GAMES_PER_WORKER)\n', (2718, 2788), True, 'import numpy as np\n'), ((2607, 2625), 'numpy.random.random', 'np.random.random', ([], {}), '()\n'...
#!/usr/bin/env python # Original code (Python 2) from <NAME>; <NAME>; <NAME>; <NAME>; J.He; # "Sentinel-2 MultiSpectral Instrument (MSI) data processing for aquatic science applications: Demonstrations and validations" # suplementary data "Program for generating Sentinel-2's high-resolution angle coefficients" # at ht...
[ "xml.etree.ElementTree.parse", "numpy.matrix", "rasterio.open", "math.sqrt", "math.atan2", "math.radians", "math.tan", "os.path.dirname", "numpy.zeros", "numpy.transpose", "math.sin", "math.acos", "logging.info", "skimage.transform.resize", "math.cos", "numpy.array" ]
[((901, 917), 'math.sqrt', 'math.sqrt', (['(1 - E)'], {}), '(1 - E)\n', (910, 917), False, 'import math\n'), ((1720, 1742), 'math.radians', 'math.radians', (['latitude'], {}), '(latitude)\n', (1732, 1742), False, 'import math\n'), ((1757, 1774), 'math.sin', 'math.sin', (['lat_rad'], {}), '(lat_rad)\n', (1765, 1774), Fa...
import torch from typing import Optional, List from PIL import Image from torch import Tensor import torchvision as tv import cv2 import json import os import numpy as np MAX_DIM = 299 def read_json(file_name): with open(file_name) as handle: out = json.load(handle) return out def nested_tensor_fro...
[ "torch.ones", "PIL.Image.new", "json.load", "os.path.join", "numpy.copy", "numpy.zeros", "numpy.bincount", "torchvision.transforms.ToTensor", "numpy.array", "numpy.ravel_multi_index", "torch.zeros", "torchvision.transforms.Normalize", "cv2.inRange", "cv2.resize", "torchvision.transforms....
[((2927, 2969), 'PIL.Image.new', 'Image.new', (['"""RGB"""', 'expected_size', '(0, 0, 0)'], {}), "('RGB', expected_size, (0, 0, 0))\n", (2936, 2969), False, 'from PIL import Image\n'), ((3248, 3323), 'cv2.resize', 'cv2.resize', (['image', '(0, 0)'], {'fx': 'ratio', 'fy': 'ratio', 'interpolation': 'cv2.INTER_AREA'}), '(...
""" Created on Wed Jun 17 14:01:23 2020 Calculate graph properties @author: Jyotika.bahuguna """ import os import glob import numpy as np import pylab as pl import scipy.io as sio from copy import copy, deepcopy import pickle import matplotlib.cm as cm import pdb import h5py import pand...
[ "bct.centrality.module_degree_zscore", "numpy.copy", "numpy.median", "bct.modularity_louvain_und_sign", "bct.participation_coef_sign", "bct.centrality.participation_coef", "numpy.argsort", "numpy.where", "numpy.arange", "bct.local_assortativity_wu_sign", "collections.Counter", "bct.modularity....
[((686, 711), 'numpy.arange', 'np.arange', (['(0.0)', '(1.5)', '(0.17)'], {}), '(0.0, 1.5, 0.17)\n', (695, 711), True, 'import numpy as np\n'), ((784, 809), 'numpy.arange', 'np.arange', (['(0.0)', '(1.5)', '(0.17)'], {}), '(0.0, 1.5, 0.17)\n', (793, 809), True, 'import numpy as np\n'), ((1595, 1631), 'bct.local_assorta...
from abc import ABCMeta, abstractmethod import numpy as np from core.net_errors import NetIsNotInitialized, NetIsNotCalculated class Corrector: __metaclass__ = ABCMeta def __init__(self, nu): self.nu = nu @abstractmethod def initialize(self, net_object): if net_object.net[-1].get('...
[ "core.net_errors.NetIsNotInitialized", "numpy.zeros", "core.net_errors.NetIsNotCalculated" ]
[((583, 604), 'core.net_errors.NetIsNotInitialized', 'NetIsNotInitialized', ([], {}), '()\n', (602, 604), False, 'from core.net_errors import NetIsNotInitialized, NetIsNotCalculated\n'), ((664, 684), 'core.net_errors.NetIsNotCalculated', 'NetIsNotCalculated', ([], {}), '()\n', (682, 684), False, 'from core.net_errors i...
import numpy as np import pandas as pd from sklearn.preprocessing import MinMaxScaler from keras.models import Sequential from keras.layers import * from keras.models import load_model import matplotlib.pyplot as plt ################################################################# ### Generate Data ################...
[ "pandas.DataFrame", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "pandas.read_csv", "matplotlib.pyplot.legend", "numpy.savetxt", "sklearn.preprocessing.MinMaxScaler", "matplotlib.pyplot.figure", "numpy.sin", "numpy.vstack", "numpy.linspace", "keras.models.Sequential", "matplotlib.pypl...
[((448, 479), 'numpy.linspace', 'np.linspace', (['(0.0)', '(2 * np.pi)', '(20)'], {}), '(0.0, 2 * np.pi, 20)\n', (459, 479), True, 'import numpy as np\n'), ((480, 489), 'numpy.sin', 'np.sin', (['x'], {}), '(x)\n', (486, 489), True, 'import numpy as np\n'), ((545, 621), 'numpy.savetxt', 'np.savetxt', (['"""train_data.cs...
import torch import math import torch.nn as nn import torch.nn.functional as F import numpy as np import settings.hparam as hp from torch.autograd import Variable from collections import OrderedDict class SeqLinear(nn.Module): """ Linear layer for sequences """ def __init__(self, input_size, output_si...
[ "torch.nn.Dropout", "numpy.floor", "torch.nn.MaxPool1d", "torch.cat", "torch.nn.functional.sigmoid", "torch.ones", "torch.FloatTensor", "torch.Tensor", "torch.nn.Linear", "torch.zeros", "torch.nn.GRU", "math.sqrt", "torch.nn.ModuleList", "torch.nn.Tanh", "torch.nn.BatchNorm1d", "torch....
[((677, 711), 'torch.nn.Linear', 'nn.Linear', (['input_size', 'output_size'], {}), '(input_size, output_size)\n', (686, 711), True, 'import torch.nn as nn\n'), ((2938, 2953), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (2951, 2953), True, 'import torch.nn as nn\n'), ((3588, 3603), 'torch.nn.ModuleList', '...
import numpy as np import scipy.stats as sps def preprocess(X): return X def prob_model_data1_range(): return [-5,5] def prob_model_data2_range(): return [-5,5] def prob_model_poi_range(mode = 'eval'): if mode == 'eval': return [-3,3] elif mode == 'train': return [-5,5] def prob...
[ "numpy.linalg.inv", "numpy.array", "scipy.stats.multivariate_normal" ]
[((467, 503), 'numpy.array', 'np.array', (['[[1.0, CORR], [CORR, 1.0]]'], {}), '([[1.0, CORR], [CORR, 1.0]])\n', (475, 503), True, 'import numpy as np\n'), ((510, 528), 'numpy.linalg.inv', 'np.linalg.inv', (['COV'], {}), '(COV)\n', (523, 528), True, 'import numpy as np\n'), ((565, 608), 'scipy.stats.multivariate_normal...
import os import sys import typing import numpy as np import open3d as o3d import data.io as dio import skimage.io from settings import process_arguments, Parameters import image_processing from warp_field.graph import DeformationGraphNumpy from nnrt import compute_mesh_from_depth_and_flow as compute_mesh_from_dept...
[ "numpy.isin", "numpy.moveaxis", "data.io.save_float_image", "nnrt.compute_mesh_from_depth", "numpy.sum", "data.io.save_int_image", "numpy.ones", "nnrt.compute_clusters", "open3d.visualization.draw_geometries", "nnrt.sample_nodes", "nnrt.get_vertex_erosion_mask", "os.path.join", "nnrt.compute...
[((2599, 2703), 'image_processing.backproject_depth', 'image_processing.backproject_depth', (['depth_image', 'fx', 'fy', 'cx', 'cy'], {'depth_scale': 'depth_scale_reciprocal'}), '(depth_image, fx, fy, cx, cy, depth_scale\n =depth_scale_reciprocal)\n', (2633, 2703), False, 'import image_processing\n'), ((3680, 3756),...
# -*- coding: utf-8 -*- from typing import Tuple from domain import Domain3D from cloudforms import CylinderCloud import numpy as np import time from scipy.special import gamma class Plank(Domain3D): def __init__(self, kilometers: Tuple[float, float, float] = (50., 50., 10.), nodes: Tuple[int, in...
[ "numpy.random.uniform", "numpy.random.seed", "numpy.power", "numpy.zeros", "time.time", "numpy.isclose", "numpy.max", "numpy.arange", "cloudforms.CylinderCloud", "numpy.exp", "scipy.special.gamma" ]
[((1729, 1749), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1743, 1749), True, 'import numpy as np\n'), ((1861, 1886), 'numpy.arange', 'np.arange', (['Dm', '(0)', '(-Dm / r)'], {}), '(Dm, 0, -Dm / r)\n', (1870, 1886), True, 'import numpy as np\n'), ((4020, 4061), 'numpy.zeros', 'np.zeros', (['(s...
# -*- coding: utf-8 -*- # Copyright 2018 IBM. # # 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 agre...
[ "numpy.concatenate" ]
[((889, 911), 'numpy.concatenate', 'np.concatenate', (['arrays'], {}), '(arrays)\n', (903, 911), True, 'import numpy as np\n'), ((1021, 1043), 'numpy.concatenate', 'np.concatenate', (['labels'], {}), '(labels)\n', (1035, 1043), True, 'import numpy as np\n')]
#! /usr/bin/env python # -*- coding: utf-8 -*- """Python implementation of the Oslo Ricepile model. """ import numpy as np import pickle import os import binascii class Oslo: """ Docstring """ def __init__(self, L,mode = 'n'): if type(L) != int: raise ValueError("Grid size, L, must be in...
[ "pickle.dump", "numpy.save", "os.makedirs", "numpy.zeros", "numpy.shape", "numpy.random.randint", "numpy.arange", "numpy.random.random", "os.urandom", "numpy.in1d" ]
[((395, 419), 'numpy.zeros', 'np.zeros', (['L'], {'dtype': '"""int"""'}), "(L, dtype='int')\n", (403, 419), True, 'import numpy as np\n'), ((440, 466), 'numpy.random.randint', 'np.random.randint', (['(1)', '(3)', 'L'], {}), '(1, 3, L)\n', (457, 466), True, 'import numpy as np\n'), ((1371, 1390), 'os.makedirs', 'os.make...
""" Codes for gas, oil, and water PVT correlations @author: <NAME> @email: <EMAIL> """ """ GAS """ def gas_pseudoprops(temp, pressure, sg, x_h2s, x_co2): """ Calculate Gas Pseudo-critical and Pseudo-reduced Pressure and Temperature * Pseudo-critical properties For range: 0.57 < sg < 1.68 (Sutton, 1985) ...
[ "numpy.log", "scipy.optimize.fsolve", "numpy.exp" ]
[((2107, 2124), 'scipy.optimize.fsolve', 'fsolve', (['f', '[1, 1]'], {}), '(f, [1, 1])\n', (2113, 2124), False, 'from scipy.optimize import fsolve\n'), ((3563, 3590), 'numpy.exp', 'np.exp', (['(x * rhogas_lee ** y)'], {}), '(x * rhogas_lee ** y)\n', (3569, 3590), True, 'import numpy as np\n'), ((8948, 8963), 'numpy.exp...
import tensorflow as tf import os import numpy as np from scipy.ndimage import imread def sample_Z(m,n): return np.random.uniform(-1., 1., size=[m,n]) def get_y(x): return 10 + x*x; def sample_data(n=10000, scale=100): data = [] x = scale*(np.random.random_sample((n,))-0.5) for i in range(n): ...
[ "numpy.random.uniform", "numpy.size", "numpy.random.random_sample", "tensorflow.get_collection", "tensorflow.global_variables_initializer", "tensorflow.layers.dense", "tensorflow.Session", "tensorflow.variable_scope", "numpy.expand_dims", "tensorflow.train.RMSPropOptimizer", "tensorflow.ones_lik...
[((118, 159), 'numpy.random.uniform', 'np.random.uniform', (['(-1.0)', '(1.0)'], {'size': '[m, n]'}), '(-1.0, 1.0, size=[m, n])\n', (135, 159), True, 'import numpy as np\n'), ((386, 400), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (394, 400), True, 'import numpy as np\n'), ((1557, 1577), 'numpy.array', 'np....
#!/usr/bin/env python import scipy.spatial import numpy as np import sys import glob def get_sssa_components(coordinates): hull = scipy.spatial.ConvexHull(coordinates, qhull_options='QJ') return hull.volume, hull.area def coordinate_array(fn): lines = open(fn).readlines() numatoms = int(lines[0]) coords = ...
[ "numpy.array", "glob.glob" ]
[((639, 695), 'glob.glob', 'glob.glob', (['"""/mnt/c/Users/guido/data/qm9/coord/*/*/*.xyz"""'], {}), "('/mnt/c/Users/guido/data/qm9/coord/*/*/*.xyz')\n", (648, 695), False, 'import glob\n'), ((431, 447), 'numpy.array', 'np.array', (['coords'], {}), '(coords)\n', (439, 447), True, 'import numpy as np\n')]
import numpy as np from io import SEEK_CUR __all__ = ['imread', 'imwrite'] def imwrite(filename, image, write_order=None): """Write an image as a BMP. Depending on the dtype and shape of the image, the image will either be encoded with 1 bit per pixel (boolean 2D images), 8 bit per pixel (uint8 2D i...
[ "numpy.full_like", "numpy.right_shift", "numpy.fromfile", "numpy.empty", "numpy.asarray", "numpy.dtype", "numpy.packbits", "numpy.zeros", "numpy.all", "numpy.arange", "numpy.take", "numpy.linspace", "numpy.unpackbits", "numpy.array_equal", "numpy.bitwise_and", "numpy.copyto", "numpy....
[((21809, 21948), 'numpy.dtype', 'np.dtype', (["[('signature', '|S2'), ('filesize', '<u4'), ('reserved1', '<u2'), (\n 'reserved2', '<u2'), ('file_offset_to_pixelarray', '<u4')]"], {}), "([('signature', '|S2'), ('filesize', '<u4'), ('reserved1', '<u2'),\n ('reserved2', '<u2'), ('file_offset_to_pixelarray', '<u4')]...
import os import torch from torch import nn from torch.autograd import Variable import torchvision import torchvision.datasets as dsets import torchvision.transforms as transforms import utils from arch import define_Gen, define_Dis import numpy as np from sklearn.metrics import mean_absolute_error from skimage.metrics...
[ "arch.define_Gen", "torch.cat", "sklearn.metrics.mean_absolute_error", "utils.print_networks", "numpy.mean", "torch.device", "torchvision.transforms.Normalize", "torch.no_grad", "torch.utils.data.DataLoader", "utils.load_checkpoint", "utils.get_testdata_link", "numpy.var", "torchvision.datas...
[((682, 723), 'utils.get_testdata_link', 'utils.get_testdata_link', (['args.dataset_dir'], {}), '(args.dataset_dir)\n', (705, 723), False, 'import utils\n'), ((743, 804), 'torchvision.datasets.ImageFolder', 'dsets.ImageFolder', (["dataset_dirs['testA']"], {'transform': 'transform'}), "(dataset_dirs['testA'], transform=...
""" RAMP backend API Methods for interacting with the database """ from __future__ import print_function, absolute_import import os import numpy as np from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy.engine.url import URL from ..model import Model from .query import sele...
[ "numpy.load", "numpy.std", "sqlalchemy.orm.sessionmaker", "numpy.mean", "numpy.loadfromtxt", "sqlalchemy.create_engine", "sqlalchemy.engine.url.URL" ]
[((1656, 1669), 'sqlalchemy.engine.url.URL', 'URL', ([], {}), '(**config)\n', (1659, 1669), False, 'from sqlalchemy.engine.url import URL\n'), ((1679, 1700), 'sqlalchemy.create_engine', 'create_engine', (['db_url'], {}), '(db_url)\n', (1692, 1700), False, 'from sqlalchemy import create_engine\n'), ((1758, 1774), 'sqlal...
from power_planner.utils.utils import get_distance_surface, rescale, normalize import numpy as np import matplotlib.pyplot as plt import rasterio class CorridorUtils(): def __init__(self): pass @staticmethod def get_middle_line(start_inds, dest_inds, instance_corr, num_points=2): vec = (...
[ "numpy.absolute", "rasterio.open", "numpy.quantile", "numpy.sum", "matplotlib.pyplot.show", "numpy.log", "matplotlib.pyplot.imshow", "numpy.argsort", "numpy.sort", "matplotlib.pyplot.figure", "numpy.where", "power_planner.utils.utils.rescale", "numpy.array", "numpy.linalg.norm", "numpy.a...
[((510, 533), 'numpy.where', 'np.where', (['instance_corr'], {}), '(instance_corr)\n', (518, 533), True, 'import numpy as np\n'), ((2159, 2187), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(20, 10)'}), '(figsize=(20, 10))\n', (2169, 2187), True, 'import matplotlib.pyplot as plt\n'), ((2196, 2215), 'matp...
import numpy as np import pandas as pd from vnpy.app.cta_strategy.strategies.ma_trend.constant import DataSignalName, DataMethod from vnpy.app.cta_strategy.strategies.ma_trend.data_center import DataCreator from vnpy.trader.utility import ArrayManager class MaInfoCreator(DataCreator): parameters = ["ma_level", "...
[ "pandas.DataFrame", "pandas.to_datetime", "numpy.array", "numpy.var" ]
[((405, 419), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (417, 419), True, 'import pandas as pd\n'), ((1453, 1478), 'numpy.array', 'np.array', (['ma_lvl_tag[:-1]'], {}), '(ma_lvl_tag[:-1])\n', (1461, 1478), True, 'import numpy as np\n'), ((1910, 1930), 'numpy.array', 'np.array', (['ma_lvl_tag'], {}), '(ma_lv...
import numpy as np def relu(x): return np.maximum(0, x) def sigmoid(x): return 1 / (1 + np.exp(-np.clip(x, -10, 10))) def logexp(x): return np.where(x > 100, x, np.log(1 + np.exp(x))) def binary_cross_entropy(x, y): loss = y * logexp(-x) + (1 - y) * logexp(x) return loss
[ "numpy.maximum", "numpy.exp", "numpy.clip" ]
[((45, 61), 'numpy.maximum', 'np.maximum', (['(0)', 'x'], {}), '(0, x)\n', (55, 61), True, 'import numpy as np\n'), ((190, 199), 'numpy.exp', 'np.exp', (['x'], {}), '(x)\n', (196, 199), True, 'import numpy as np\n'), ((108, 127), 'numpy.clip', 'np.clip', (['x', '(-10)', '(10)'], {}), '(x, -10, 10)\n', (115, 127), True,...
# Copyright 2021 Huawei Technologies Co., Ltd # # 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...
[ "numpy.pad", "os.mkdir", "numpy.load", "argparse.ArgumentParser", "os.path.exists", "os.path.join", "os.listdir" ]
[((783, 828), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""MelGAN"""'}), "(description='MelGAN')\n", (806, 828), False, 'import argparse\n'), ((1507, 1527), 'os.listdir', 'os.listdir', (['path_all'], {}), '(path_all)\n', (1517, 1527), False, 'import os\n'), ((1303, 1336), 'os.path.exis...
from utils.utils_profiling import * # load before other local modules import argparse import os import sys import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import dgl import numpy as np import torch import wandb import time import datetime from torch import optim import torch.nn as nn...
[ "wandb.log", "pdb.post_mortem", "utils.utils_logging.write_info_file", "numpy.linalg.qr", "numpy.mean", "experiments.nbody.nbody_models.__dict__.get", "os.path.join", "torch.isnan", "torch.nn.MSELoss", "traceback.print_exc", "warnings.simplefilter", "torch.utils.data.DataLoader", "experiment...
[((126, 188), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), "(action='ignore', category=FutureWarning)\n", (147, 188), False, 'import warnings\n'), ((1014, 1026), 'numpy.mean', 'np.mean', (['_sq'], {}), '(_sq)\n', (1021, 1026), True, 'import numpy as np...
from keras import applications import keras import numpy as np from keras.preprocessing.image import load_img from keras.preprocessing.image import img_to_array import matplotlib.pyplot as plt from keras.applications.imagenet_utils import decode_predictions import os from keras.models import model_from_json from keras....
[ "keras.models.load_model", "keras.applications.imagenet_utils.decode_predictions", "numpy.expand_dims", "json.dumps", "keras.preprocessing.image.img_to_array" ]
[((1187, 1227), 'keras.applications.imagenet_utils.decode_predictions', 'decode_predictions', (['predictions_resnet50'], {}), '(predictions_resnet50)\n', (1205, 1227), False, 'from keras.applications.imagenet_utils import decode_predictions\n'), ((1353, 1370), 'json.dumps', 'json.dumps', (['preds'], {}), '(preds)\n', (...
""" numpy and scipy based backend. Transparently handles scipy.sparse matrices as input. """ from __future__ import division, absolute_import import numpy as np import scipy.sparse import scipy.sparse.linalg import scipy.linalg def inv(matrix): """ Calculate the inverse of a matrix. Uses the standard ``...
[ "numpy.diagonal" ]
[((1303, 1322), 'numpy.diagonal', 'np.diagonal', (['matrix'], {}), '(matrix)\n', (1314, 1322), True, 'import numpy as np\n')]
from PIL import Image import numpy as np from sklearn.metrics import average_precision_score from sklearn.metrics import precision_recall_curve import matplotlib.pyplot as plt from inspect import signature from scipy import ndimage from numpy import random,argsort,sqrt from sklearn.metrics import jaccard_score, recall...
[ "numpy.absolute", "numpy.sum", "scipy.ndimage.binary_erosion", "numpy.logical_not", "numpy.zeros", "skimage.morphology.disk", "sklearn.metrics.precision_recall_curve", "numpy.argsort", "numpy.logical_xor", "numpy.where", "sklearn.metrics.average_precision_score", "numpy.vstack" ]
[((785, 805), 'numpy.absolute', 'np.absolute', (['im_diff'], {}), '(im_diff)\n', (796, 805), True, 'import numpy as np\n'), ((819, 834), 'numpy.sum', 'np.sum', (['im_diff'], {}), '(im_diff)\n', (825, 834), True, 'import numpy as np\n'), ((1316, 1347), 'sklearn.metrics.average_precision_score', 'average_precision_score'...
import uuid import json import pandas as pd import numpy as np from gibbon.utility import Convert class Buildings: def __init__(self, sensor, path=None): self.sensor = sensor self.df = None self.selected = None if path: self.load_dataframe(path) def load_dataframe...
[ "pandas.DataFrame", "json.dump", "json.load", "gibbon.maps.MapSensor", "uuid.uuid4", "gibbon.utility.Convert.lnglat_to_mercator", "numpy.array" ]
[((2421, 2446), 'gibbon.maps.MapSensor', 'MapSensor', (['origin', 'radius'], {}), '(origin, radius)\n', (2430, 2446), False, 'from gibbon.maps import MapSensor\n'), ((918, 953), 'pandas.DataFrame', 'pd.DataFrame', (['buildings'], {'index': 'uids'}), '(buildings, index=uids)\n', (930, 953), True, 'import pandas as pd\n'...
# coding: utf8 import copy import os import pytest import numpy as np import numpy.testing as npt import openturns as ot import matplotlib.pyplot as plt from batman.space import (Space, Doe, dists_to_ot) from batman.functions import Ishigami from batman.surrogate import SurrogateModel from batman.space.refiner import R...
[ "batman.space.Space", "batman.space.refiner.Refiner", "numpy.empty", "batman.space.dists_to_ot", "os.path.join", "numpy.testing.assert_almost_equal", "pytest.raises", "batman.functions.Ishigami", "openturns.Uniform", "numpy.testing.assert_equal", "copy.deepcopy", "numpy.testing.assert_array_eq...
[((5774, 5844), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'raises': 'AssertionError', 'reason': '"""Global optimization"""'}), "(raises=AssertionError, reason='Global optimization')\n", (5791, 5844), False, 'import pytest\n'), ((7846, 7916), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'raises': 'AssertionErro...
from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize import Cython.Compiler.Options Cython.Compiler.Options.annotate = True from Cython.Distutils import build_ext import os import sys import shutil import numpy folder = "." if len(sys.argv) >3: f...
[ "os.remove", "Cython.Build.cythonize", "os.makedirs", "os.path.basename", "distutils.extension.Extension", "numpy.get_include", "os.path.splitext", "shutil.move", "shutil.copy", "shutil.movetree", "shutil.rmtree", "os.chdir", "os.scandir" ]
[((516, 532), 'os.chdir', 'os.chdir', (['folder'], {}), '(folder)\n', (524, 532), False, 'import os\n'), ((544, 574), 'os.makedirs', 'os.makedirs', (['"""backfiles"""', '(1877)'], {}), "('backfiles', 1877)\n", (555, 574), False, 'import os\n'), ((1348, 1369), 'os.chdir', 'os.chdir', (['"""backfiles"""'], {}), "('backfi...
from operator import itemgetter import Plane import Polygon import Receiver import numpy as np class Space(object): def __init__(self): self.polygons = [] self.__axes = np.zeros((3, 3)) def vertical_plane(self, origin, facing_angle): # compass direction, degrees angle = (90 - facing...
[ "Polygon.Polygon", "Receiver.Receiver", "numpy.asarray", "numpy.zeros", "numpy.cross", "numpy.sin", "numpy.linalg.norm", "numpy.cos", "Plane.Plane", "operator.itemgetter", "numpy.sqrt" ]
[((193, 209), 'numpy.zeros', 'np.zeros', (['(3, 3)'], {}), '((3, 3))\n', (201, 209), True, 'import numpy as np\n'), ((358, 371), 'numpy.sin', 'np.sin', (['angle'], {}), '(angle)\n', (364, 371), True, 'import numpy as np\n'), ((388, 401), 'numpy.cos', 'np.cos', (['angle'], {}), '(angle)\n', (394, 401), True, 'import num...
# -*- coding: utf-8 -*- def make_info_str(args): s = '' for k in vars(args): s += '# ' + str(k) + ': ' + str(getattr(args,k)) + '\n' return s def print_stats(steps,dm, meta=False): from time import strftime from time import time if isinstance(meta, str): meta = ' | {:s}'.format(meta) else: ...
[ "numpy.zeros", "numpy.ones", "time.strftime", "time.time", "numpy.random.random", "numpy.array", "numpy.arange" ]
[((780, 805), 'numpy.zeros', 'zeros', (['(nmax, 3)', '"""float"""'], {}), "((nmax, 3), 'float')\n", (785, 805), False, 'from numpy import zeros\n'), ((818, 841), 'numpy.zeros', 'zeros', (['(nmax, 3)', '"""int"""'], {}), "((nmax, 3), 'int')\n", (823, 841), False, 'from numpy import zeros\n'), ((853, 873), 'numpy.zeros',...
# Read a data file and apply min/max scaling to a # selected column, writing the min/max values to a proto. # Ultimately not used because too slow compared to C++, and # would need to implement unscaling and have the ability to # read from a pipe. import csv from absl import app from absl import flags from google.pro...
[ "pandas.read_csv", "Utilities.General.feature_scaling_pb2.FeatureScaling", "absl.flags.mark_flag_as_required", "absl.flags.DEFINE_string", "numpy.min", "numpy.max", "absl.flags.DEFINE_integer", "numpy.array", "numpy.mean", "absl.app.run", "google.protobuf.json_format.MessageToJson" ]
[((518, 582), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""input"""', 'None', '"""Input data file to process"""'], {}), "('input', None, 'Input data file to process')\n", (537, 582), False, 'from absl import flags\n'), ((583, 660), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""output"""', 'None',...
import cv2 import mxnet as mx import numpy as np import scipy as sc from utils.math import Distances from dataProcessor.tiffReader import GEOMAP from validation.osmClasses import OSMClasses from utils.labelProcessor import LabelProcessor from validation.clcClasses import CLCClasses from sklearn.neighbors import KNeigh...
[ "numpy.sum", "numpy.abs", "numpy.corrcoef", "lib.mapar.mapar.Mapar.score", "scipy.cluster.hierarchy.linkage", "sklearn.neighbors.DistanceMetric.get_metric", "numpy.expand_dims", "numpy.clip", "utils.labelProcessor.LabelProcessor", "numpy.min", "numpy.max", "sklearn.neighbors.KNeighborsClassifi...
[((1138, 1174), 'utils.labelProcessor.LabelProcessor', 'LabelProcessor', (['size', 'validation_map'], {}), '(size, validation_map)\n', (1152, 1174), False, 'from utils.labelProcessor import LabelProcessor\n'), ((3552, 3575), 'numpy.min', 'np.min', (['a_dists'], {'axis': '(0)'}), '(a_dists, axis=0)\n', (3558, 3575), Tru...