code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
# Real time object detection dnn
import numpy as np
import imutils
import cv2
import time
prototxt = './MobileNetSSD_deploy.prototxt.txt'
model = 'MobileNetSSD_deploy.caffemodel'
confThresh = 0.2
CLASSES = ['background','aeroplane','bicycle','bird','boat',
'bottle','bus','car','cat','chair','cow','diningtable',
... | [
"cv2.putText",
"cv2.waitKey",
"cv2.dnn.blobFromImage",
"cv2.imshow",
"time.sleep",
"cv2.VideoCapture",
"cv2.rectangle",
"numpy.arange",
"numpy.array",
"cv2.dnn.readNetFromCaffe",
"imutils.resize",
"cv2.destroyAllWindows",
"cv2.resize"
] | [((505, 546), 'cv2.dnn.readNetFromCaffe', 'cv2.dnn.readNetFromCaffe', (['prototxt', 'model'], {}), '(prototxt, model)\n', (529, 546), False, 'import cv2\n'), ((607, 626), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (623, 626), False, 'import cv2\n'), ((627, 642), 'time.sleep', 'time.sleep', (['(2.0)... |
"""
This Python script generates strokes from the line type ESRI shapefiles, mainly roads.
Author: <NAME>
Date: 29 February 2020
Version: 0.2
The script is a supplementary material to the full length article:
Title:
An open-source tool to extract natural continuity and hierarchy of urban street networks
Journal:
En... | [
"math.atan",
"math.floor",
"time.strftime",
"time.time",
"shapefile.Writer",
"numpy.array",
"os.path.splitext",
"glob.glob",
"sys.setrecursionlimit",
"os.chdir",
"shapefile.Reader",
"multiprocessing.cpu_count"
] | [((1464, 1492), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(10000)'], {}), '(10000)\n', (1485, 1492), False, 'import os, sys, math, time, multiprocessing\n'), ((18322, 18337), 'os.chdir', 'os.chdir', (['myDir'], {}), '(myDir)\n', (18330, 18337), False, 'import os, sys, math, time, multiprocessing\n'), ((18472... |
# -*- coding: utf-8 -*-
"""A collection of analyses possible on gene lists (of HGNC identifiers)."""
from typing import Dict, Iterable, List, Optional, Set, Tuple
import numpy as np
import pandas as pd
from scipy.stats import fisher_exact
from statsmodels.stats.multitest import multipletests
from indra_cogex.client... | [
"pandas.DataFrame",
"indra_cogex.client.neo4j_client.autoclient",
"indra_cogex.client.enrichment.utils.get_entity_to_targets",
"statsmodels.stats.multitest.multipletests",
"indra_cogex.client.neo4j_client.Neo4jClient",
"scipy.stats.fisher_exact",
"indra_cogex.client.enrichment.utils.get_entity_to_regula... | [((2252, 2274), 'indra_cogex.client.neo4j_client.autoclient', 'autoclient', ([], {'cache': '(True)'}), '(cache=True)\n', (2262, 2274), False, 'from indra_cogex.client.neo4j_client import Neo4jClient, autoclient\n'), ((6325, 6338), 'indra_cogex.client.neo4j_client.Neo4jClient', 'Neo4jClient', ([], {}), '()\n', (6336, 63... |
from gym_fem.fem_wrapper import AbaqusWrapper, SimulationError
from gym_fem.helpers import CSVLogger
import gym
from gym.utils import seeding
from gym.core import Wrapper
import numpy as np
from collections.abc import Iterable
from abc import ABC
from pathlib import Path
import configparser
import inspect
import imag... | [
"logging.debug",
"logging.warning",
"gym_fem.helpers.CSVLogger",
"imageio.imread",
"numpy.zeros",
"time.time",
"time.sleep",
"logging.info",
"pathlib.Path",
"shutil.rmtree",
"configparser.ConfigParser",
"gym.envs.classic_control.rendering.SimpleImageViewer",
"gym.utils.seeding.np_random"
] | [((1225, 1264), 'numpy.zeros', 'np.zeros', (['(731, 914, 3)'], {'dtype': 'np.uint8'}), '((731, 914, 3), dtype=np.uint8)\n', (1233, 1264), True, 'import numpy as np\n'), ((2208, 2235), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (2233, 2235), False, 'import configparser\n'), ((5769, 5797)... |
# coding=utf-8
# Copyright 2018 The Dopamine 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... | [
"dopamine.discrete_domains.atari_lib.RainbowNetworkType",
"dopamine.discrete_domains.atari_lib.ImplicitQuantileNetworkType",
"numpy.sqrt",
"flax.linen.softmax",
"jax.random.uniform",
"jax.numpy.tile",
"jax.numpy.squeeze",
"jax.random.normal",
"jax.numpy.where",
"dopamine.discrete_domains.atari_lib... | [((840, 908), 'gin.constant', 'gin.constant', (['"""jax_networks.CARTPOLE_OBSERVATION_DTYPE"""', 'jnp.float64'], {}), "('jax_networks.CARTPOLE_OBSERVATION_DTYPE', jnp.float64)\n", (852, 908), False, 'import gin\n'), ((909, 1004), 'gin.constant', 'gin.constant', (['"""jax_networks.CARTPOLE_MIN_VALS"""', '(-2.4, -5.0, -o... |
# Begin: Python 2/3 compatibility header small
# Get Python 3 functionality:
from __future__ import\
absolute_import, print_function, division, unicode_literals
from future.utils import raise_with_traceback, raise_from
# catch exception with: except Exception as e
from builtins import range, map, zip, filter
from i... | [
"numpy.ones_like",
"numpy.arange",
"numpy.random.normal",
"builtins.zip",
"keras.backend.int_shape",
"keras.backend.variable",
"numpy.repeat"
] | [((5286, 5326), 'numpy.repeat', 'np.repeat', (['x', 'self._augment_by_n'], {'axis': '(0)'}), '(x, self._augment_by_n, axis=0)\n', (5295, 5326), True, 'import numpy as np\n'), ((5794, 5808), 'keras.backend.int_shape', 'K.int_shape', (['x'], {}), '(x)\n', (5805, 5808), True, 'import keras.backend as K\n'), ((10139, 10152... |
"""Tests for processors utilities."""
import numpy as np
import rimseval.data_io.crd_utils as cu
def test_shot_to_tof_mapper():
"""Map ions per shot to all_tofs array."""
ions_per_shot = np.array([0, 0, 3, 5, 0, 7])
mapper_exp = np.array([[0, 0], [0, 0], [0, 3], [3, 8], [8, 8], [8, 15]])
mapper_rec ... | [
"rimseval.data_io.crd_utils.shot_to_tof_mapper",
"numpy.array",
"numpy.testing.assert_equal"
] | [((199, 227), 'numpy.array', 'np.array', (['[0, 0, 3, 5, 0, 7]'], {}), '([0, 0, 3, 5, 0, 7])\n', (207, 227), True, 'import numpy as np\n'), ((245, 304), 'numpy.array', 'np.array', (['[[0, 0], [0, 0], [0, 3], [3, 8], [8, 8], [8, 15]]'], {}), '([[0, 0], [0, 0], [0, 3], [3, 8], [8, 8], [8, 15]])\n', (253, 304), True, 'imp... |
from d3m import container
from d3m.container.numpy import ndarray
from d3m.primitive_interfaces import base
from d3m.metadata import base as metadata_base, hyperparams, params
from d3m.primitive_interfaces.base import ProbabilisticCompositionalityMixin
from d3m.primitive_interfaces.base import SamplingCompositionalityM... | [
"sklearn.impute.SimpleImputer",
"numpy.random.binomial",
"importlib.import_module",
"sklearn.preprocessing.OneHotEncoder",
"numpy.einsum",
"d3m.metadata.base.PrimitiveMetadata",
"d3m.container.DataFrame",
"d3m.primitive_interfaces.base.CallResult",
"numpy.array",
"numpy.squeeze",
"numpy.eye",
... | [((3975, 4638), 'd3m.metadata.base.PrimitiveMetadata', 'metadata_base.PrimitiveMetadata', (["{'id': '8a992784-3b41-4915-bb47-3ff00e51e60f', 'version': config.VERSION,\n 'name': 'Bayesian Logistic Regression', 'description':\n 'A bayesian approach to Logistic Regression', 'python_path':\n 'd3m.primitives.classi... |
import time
from rectgle import Rectgle
from terrain import Terrain
from queue import PriorityQueue
import numpy as np
import mayavi.mlab as ma
import matplotlib.pyplot as plt
from math import tan, sqrt
from calculateur import Astar, Calculateur, Dijkstra
RACINEDEDEUX = sqrt(2)
class Traces():
def ... | [
"mayavi.mlab.text3d",
"mayavi.mlab.figure",
"math.sqrt",
"mayavi.mlab.show",
"time.perf_counter",
"rectgle.Rectgle",
"mayavi.mlab.plot3d",
"numpy.concatenate"
] | [((282, 289), 'math.sqrt', 'sqrt', (['(2)'], {}), '(2)\n', (286, 289), False, 'from math import tan, sqrt\n'), ((3390, 3409), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (3407, 3409), False, 'import time\n'), ((4113, 4132), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (4130, 4132), False,... |
import gzip
import pickle as pkl
import numpy as np
from keras.models import Model
from keras.layers import Dense, Input
from keras.layers import Dropout, GaussianNoise
from keras.layers import Embedding, concatenate
from keras.layers import Convolution1D, GlobalMaxPooling1D #, MaxPooling1D
from sklearn.model_selection... | [
"gzip.open",
"keras.layers.Convolution1D",
"numpy.argmax",
"numpy.std",
"keras.layers.Dropout",
"keras.models.Model",
"sklearn.metrics.classification_report",
"numpy.max",
"pickle.load",
"sklearn.model_selection.StratifiedKFold",
"keras.layers.Embedding",
"keras.layers.Dense",
"numpy.mean",
... | [((1112, 1182), 'keras.layers.Input', 'Input', ([], {'shape': '(max_sequence_length,)', 'dtype': '"""int32"""', 'name': '"""words_input"""'}), "(shape=(max_sequence_length,), dtype='int32', name='words_input')\n", (1117, 1182), False, 'from keras.layers import Dense, Input\n'), ((1362, 1436), 'keras.layers.Input', 'Inp... |
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.lines import Line2D
import matplotlib.ticker as ticker
from common import *
from math import log,pow
#Not sure why, I decided to make another file for this test...
from study import *
traces = ["kth", "kthmorningquad", "kthmorningsingle", "caida18"]
... | [
"matplotlib.pyplot.clf",
"numpy.median",
"numpy.std",
"numpy.asarray",
"numpy.genfromtxt",
"numpy.percentile",
"matplotlib.ticker.FuncFormatter",
"numpy.array",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.grid"
] | [((3337, 3346), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (3344, 3346), True, 'import matplotlib.pyplot as plt\n'), ((1230, 1239), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (1237, 1239), True, 'import matplotlib.pyplot as plt\n'), ((1359, 1373), 'matplotlib.pyplot.subplots', 'plt.subplots', ([],... |
"""
// Copyright (c) 2008, <NAME> (casey dot duncan at gmail dot com)
// see LICENSE.txt for details
// $Id$
"""
import random
from math import floor
from typing import Optional, Sequence
import numpy as np
from ._tables import GRAD3, GRAD4, M_1_PI, PERM, SIMPLEX
"Native-code simplex noise functions"
# 2D simplex s... | [
"random.Random",
"numpy.floor",
"numpy.zeros",
"math.floor",
"numpy.sin",
"numpy.cos"
] | [((514, 526), 'math.floor', 'floor', (['(x + s)'], {}), '(x + s)\n', (519, 526), False, 'from math import floor\n'), ((535, 547), 'math.floor', 'floor', (['(y + s)'], {}), '(y + s)\n', (540, 547), False, 'from math import floor\n'), ((1804, 1819), 'numpy.floor', 'np.floor', (['(x + s)'], {}), '(x + s)\n', (1812, 1819),... |
# Display robot in 3D
import numpy as np
def run(robot):
# define path
# Interpret the input as a matrix. Unlike np.matrix(), np.asmatrix ()
# does not make a copy if the input is already a matrix or an ndarray
pose = np.asmatrix([0, 90, 0, 90, 0, 90], dtype=np.float32)
# just not to throw an e... | [
"numpy.asmatrix",
"numpy.concatenate"
] | [((238, 290), 'numpy.asmatrix', 'np.asmatrix', (['[0, 90, 0, 90, 0, 90]'], {'dtype': 'np.float32'}), '([0, 90, 0, 90, 0, 90], dtype=np.float32)\n', (249, 290), True, 'import numpy as np\n'), ((336, 372), 'numpy.concatenate', 'np.concatenate', (['(pose, pose)'], {'axis': '(0)'}), '((pose, pose), axis=0)\n', (350, 372), ... |
from mesa.space import SingleGrid
from mesa import Model, Agent
from mesa.time import RandomActivation
from mesa.datacollection import DataCollector
import numpy as np
class SchellingAgent(Agent):
# adding a pos instance variable so that each agent can remember
# where they are. Note that the pos can take... | [
"mesa.time.RandomActivation",
"numpy.random.choice",
"mesa.space.SingleGrid",
"mesa.datacollection.DataCollector"
] | [((1074, 1096), 'mesa.time.RandomActivation', 'RandomActivation', (['self'], {}), '(self)\n', (1090, 1096), False, 'from mesa.time import RandomActivation\n'), ((1152, 1189), 'mesa.space.SingleGrid', 'SingleGrid', (['width', 'height'], {'torus': '(True)'}), '(width, height, torus=True)\n', (1162, 1189), False, 'from me... |
import numpy as np
from comparator import comparator
import unittest
class TestBootstrap(unittest.TestCase):
def test_same_distro(self):
np.random.seed(0)
a = np.random.normal(2,3,5000)
b = np.random.normal(2,3,1000)
aa = comparator(A=a,B=b,normaltest=True)
self.assertFalse(aa.compar... | [
"unittest.main",
"numpy.random.seed",
"numpy.random.normal",
"numpy.random.rand",
"comparator.comparator"
] | [((864, 879), 'unittest.main', 'unittest.main', ([], {}), '()\n', (877, 879), False, 'import unittest\n'), ((149, 166), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (163, 166), True, 'import numpy as np\n'), ((177, 205), 'numpy.random.normal', 'np.random.normal', (['(2)', '(3)', '(5000)'], {}), '(2, 3... |
# So what about those magic parameters? How did I determine them?
# Well, I used a hyperparameter optimizer!
#
# This example introduces the optimizer I used and we will talk about how it works in some detail.
import dlib
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib im... | [
"numpy.meshgrid",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.arange",
"numpy.cos",
"dlib.find_max_global",
"numpy.sqrt"
] | [((653, 720), 'dlib.find_max_global', 'dlib.find_max_global', (['messy_holder_table', '[-15, -15]', '[15, 15]', '(100)'], {}), '(messy_holder_table, [-15, -15], [15, 15], 100)\n', (673, 720), False, 'import dlib\n'), ((1217, 1240), 'numpy.arange', 'np.arange', (['(-15)', '(15)', '(0.1)'], {}), '(-15, 15, 0.1)\n', (1226... |
# Problem: https://www.hackerrank.com/challenges/np-linear-algebra/problem
# Score: 20.0
import numpy as np
n = int(input())
a = np.array([input().strip().split() for _ in range(n)], float)
print(round(np.linalg.det(a), 2))
| [
"numpy.linalg.det"
] | [((205, 221), 'numpy.linalg.det', 'np.linalg.det', (['a'], {}), '(a)\n', (218, 221), True, 'import numpy as np\n')] |
import numpy as np
import pandas as pd
from scipy.stats.mstats import gmean
import scipy.optimize as sp
def degreetorad(deg):
'''
This Procedure will convert Degree into Radian
'''
return deg* (np.pi / 180)
def calculate_longitude(zodiac_indexes,degree,minute,second):
'''
This Procedure will ... | [
"scipy.optimize.minimize",
"scipy.stats.mstats.gmean",
"numpy.log",
"pandas.read_csv",
"numpy.square",
"numpy.mean",
"numpy.sqrt"
] | [((1149, 1169), 'numpy.mean', 'np.mean', (['radius_list'], {}), '(radius_list)\n', (1156, 1169), True, 'import numpy as np\n'), ((1191, 1209), 'scipy.stats.mstats.gmean', 'gmean', (['radius_list'], {}), '(radius_list)\n', (1196, 1209), False, 'from scipy.stats.mstats import gmean\n'), ((2074, 2192), 'scipy.optimize.min... |
import numpy as np
import csv
def read_csv(path):
width = 34
height = 26
dims = 1
with open(path,'r') as f:
#read the scv file with the dictionary format
reader = csv.DictReader(f)
rows = list(reader)
#imgs is a numpy array with all the images
#tgs is a numpy array with the tags of the images... | [
"numpy.random.permutation",
"csv.DictReader",
"numpy.array",
"numpy.expand_dims"
] | [((890, 926), 'numpy.random.permutation', 'np.random.permutation', (['imgs.shape[0]'], {}), '(imgs.shape[0])\n', (911, 926), True, 'import numpy as np\n'), ((181, 198), 'csv.DictReader', 'csv.DictReader', (['f'], {}), '(f)\n', (195, 198), False, 'import csv\n'), ((601, 630), 'numpy.array', 'np.array', (['img'], {'dtype... |
#! python3
# -*- encoding: utf-8 -*-
'''
@File : equalize_hist.py
@Time : 2020/11/22 19:22:32
@Author : <NAME>
@Contact : <EMAIL>
'''
import os
import cv2
import numpy as np
import math
def equalize_gray(img):
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
dst = cv2.equalizeHist(gr... | [
"cv2.equalizeHist",
"cv2.cvtColor",
"numpy.empty",
"os.walk",
"cv2.blur",
"math.log",
"cv2.imread",
"cv2.split",
"numpy.array",
"cv2.hconcat",
"numpy.arange",
"cv2.merge",
"os.path.join"
] | [((252, 289), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2GRAY'], {}), '(img, cv2.COLOR_BGR2GRAY)\n', (264, 289), False, 'import cv2\n'), ((301, 323), 'cv2.equalizeHist', 'cv2.equalizeHist', (['gray'], {}), '(gray)\n', (317, 323), False, 'import cv2\n'), ((383, 397), 'cv2.split', 'cv2.split', (['img'], {}),... |
'''
Maximum predictability evaluation module described in
<NAME>, et al. "Predicting taxi demand at high spatial resolution:
Approaching the limit of predictability." Big Data (Big Data),
2016 IEEE International Conference on. IEEE, 2016.
Given the number of unique values N in the time series... | [
"numpy.log2",
"numpy.log"
] | [((1220, 1233), 'numpy.log', 'np.log', (['(N - 1)'], {}), '(N - 1)\n', (1226, 1233), True, 'import numpy as np\n'), ((2445, 2455), 'numpy.log2', 'np.log2', (['N'], {}), '(N)\n', (2452, 2455), True, 'import numpy as np\n'), ((861, 870), 'numpy.log', 'np.log', (['(2)'], {}), '(2)\n', (867, 870), True, 'import numpy as np... |
# pylint: disable=line-too-long
import copy
import re
from numpy import dtype, array, invert, take
__all__ = ('generate_xdmf',)
xdmffile = """<?xml version="1.0" encoding="utf-8"?>
<Xdmf xmlns:xi="http://www.w3.org/2001/XInclude" Version="2.1">
<Domain>
<Grid Name="Structured Grid" GridType="Collection" Collect... | [
"h5py.File",
"numpy.invert",
"numpy.dtype",
"copy.copy",
"re.findall",
"numpy.take"
] | [((3976, 4002), 'h5py.File', 'h5py.File', (['h5filename', '"""a"""'], {}), "(h5filename, 'a')\n", (3985, 4002), False, 'import h5py\n'), ((5061, 5080), 'copy.copy', 'copy.copy', (['periodic'], {}), '(periodic)\n', (5070, 5080), False, 'import copy\n'), ((5773, 5788), 'copy.copy', 'copy.copy', (['coor'], {}), '(coor)\n'... |
import os, sys
import tensorflow as tf
from tensorflow.keras.layers import MultiHeadAttention as MHA
import numpy as np
import pandas as pd
from DB.augmentation import augment
def Atomic(input_data, k_features=20):
""" builds AE k_features """
input_dim = len(input_data[0])
# Normalize
normalizer = tf.... | [
"numpy.random.uniform",
"tensorflow.keras.losses.binary_crossentropy",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"tensorflow.reshape",
"tensorflow.keras.losses.CosineSimilarity",
"tensorflow.keras.Model",
"tensorflow.keras.utils.plot_model... | [((317, 375), 'tensorflow.keras.layers.experimental.preprocessing.Normalization', 'tf.keras.layers.experimental.preprocessing.Normalization', ([], {}), '()\n', (373, 375), True, 'import tensorflow as tf\n'), ((441, 503), 'tensorflow.keras.layers.Input', 'tf.keras.layers.Input', ([], {'shape': '(input_dim,)', 'name': '"... |
import unittest
import os
import numpy.testing as nptest
from pprint import PrettyPrinter
pp = PrettyPrinter(indent=4)
import numpy as np
from gmid2.basics.uai_files import read_mmap, read_vo, read_sum, read_mpe
from gmid2.basics.undirected_network import PrimalGraph
from gmid2.basics.graphical_model import GraphicalMo... | [
"gmid2.basics.graphical_model.GraphicalModel",
"gmid2.inference.bucket.bucket_tree_decomposition",
"gmid2.basics.uai_files.read_vo",
"os.getcwd",
"numpy.testing.assert_almost_equal",
"gmid2.inference.pgm_bte.PgmBTE",
"pprint.PrettyPrinter",
"gmid2.inference.bucket.mini_bucket_tree_decomposition",
"g... | [((95, 118), 'pprint.PrettyPrinter', 'PrettyPrinter', ([], {'indent': '(4)'}), '(indent=4)\n', (108, 118), False, 'from pprint import PrettyPrinter\n'), ((1005, 1043), 'gmid2.basics.uai_files.read_mmap', 'read_mmap', (['file_name'], {'skip_table': '(False)'}), '(file_name, skip_table=False)\n', (1014, 1043), False, 'fr... |
import numpy as np
import cv2
import glob
import itertools
def getImageArr(path, width, height, imgNorm="sub_mean", odering='channels_first'):
try:
img = cv2.imread(path, 1)
if imgNorm == "sub_and_divide":
img = np.float32(cv2.resize(img, (width, height))) / 127.5 - 1
elif i... | [
"numpy.rollaxis",
"numpy.zeros",
"cv2.imread",
"numpy.array",
"numpy.reshape",
"glob.glob",
"cv2.resize"
] | [((1066, 1101), 'numpy.zeros', 'np.zeros', (['(height, width, nClasses)'], {}), '((height, width, nClasses))\n', (1074, 1101), True, 'import numpy as np\n'), ((1375, 1425), 'numpy.reshape', 'np.reshape', (['seg_labels', '(width * height, nClasses)'], {}), '(seg_labels, (width * height, nClasses))\n', (1385, 1425), True... |
"""
This is yeoms attribute inference attack model and is not used!
"""
import numpy as np
from tensorflow.keras.models import load_model
from ..MIA.experiments.train_wb import get_scores
def get_test_indices(path):
"""
Retrieve the test indices
"""
indices = np.load(path, allow_pickle=True).item()
... | [
"numpy.load",
"tensorflow.keras.models.load_model",
"numpy.copy",
"numpy.array_equal",
"numpy.concatenate"
] | [((761, 793), 'numpy.load', 'np.load', (['data'], {'allow_pickle': '(True)'}), '(data, allow_pickle=True)\n', (768, 793), True, 'import numpy as np\n'), ((889, 908), 'numpy.copy', 'np.copy', (['X_original'], {}), '(X_original)\n', (896, 908), True, 'import numpy as np\n'), ((922, 941), 'numpy.copy', 'np.copy', (['Y_ori... |
import numpy as np
from collections import deque
from functools import partials
class WollMonteCarlo:
""" Wolff Monte Carlo simulator for the Ising model """
def __init__(self, L, T, method = None):
self._L = L
self._T = T
self._K = 2. / T
self._method = method
# set u... | [
"numpy.random.rand",
"numpy.random.randint",
"numpy.exp",
"collections.deque"
] | [((362, 398), 'numpy.random.randint', 'np.random.randint', (['(0)', '(2)'], {'size': '[L, L]'}), '(0, 2, size=[L, L])\n', (379, 398), True, 'import numpy as np\n'), ((1553, 1560), 'collections.deque', 'deque', ([], {}), '()\n', (1558, 1560), False, 'from collections import deque\n'), ((825, 844), 'numpy.exp', 'np.exp',... |
import numpy as np
import random
def sample(softmax, temperature):
EPSILON = 1e-15
probs = (np.array(softmax) + EPSILON).astype('float64')
probs = np.log(probs) / temperature
probs = np.exp(probs)
probs = probs / np.sum(probs)
return np.random.choice(range(len(probs)), p=probs)
#TODO: saving/loading
#TODO... | [
"numpy.sum",
"numpy.log",
"numpy.argmax",
"numpy.zeros",
"random.choice",
"numpy.random.random",
"numpy.array",
"numpy.exp"
] | [((192, 205), 'numpy.exp', 'np.exp', (['probs'], {}), '(probs)\n', (198, 205), True, 'import numpy as np\n'), ((154, 167), 'numpy.log', 'np.log', (['probs'], {}), '(probs)\n', (160, 167), True, 'import numpy as np\n'), ((224, 237), 'numpy.sum', 'np.sum', (['probs'], {}), '(probs)\n', (230, 237), True, 'import numpy as ... |
# coding: utf-8
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Test matmul replacement.
"""
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import numpy as np
import pytest
from ..core.multiarray import matmul, GE1P10
def test_import... | [
"numpy.zeros",
"numpy.ones",
"numpy.identity",
"pytest.raises",
"numpy.arange",
"numpy.array"
] | [((1000, 1014), 'numpy.identity', 'np.identity', (['(3)'], {}), '(3)\n', (1011, 1014), True, 'import numpy as np\n'), ((1261, 1282), 'numpy.ones', 'np.ones', (['(4, 1, 3, 2)'], {}), '((4, 1, 3, 2))\n', (1268, 1282), True, 'import numpy as np\n'), ((1293, 1315), 'numpy.zeros', 'np.zeros', (['(4, 2, 3, 2)'], {}), '((4, 2... |
import sys
from . import scigridnetwork
from . import armafitloader
from . import globals
import numpy as np
import logging
from tqdm import tqdm
import json
from pathlib import Path
pypsapath = "C:/dev/py/PyPSA/"
if sys.path[0] != pypsapath:
sys.path.insert(0, pypsapath)
import pypsa
pretty = True
highres = Tru... | [
"numpy.save",
"numpy.savetxt",
"sys.path.insert",
"json.dumps",
"logging.info",
"logging.getLogger"
] | [((248, 277), 'sys.path.insert', 'sys.path.insert', (['(0)', 'pypsapath'], {}), '(0, pypsapath)\n', (263, 277), False, 'import sys\n'), ((397, 436), 'logging.info', 'logging.info', (['"""Loading SciGRID network"""'], {}), "('Loading SciGRID network')\n", (409, 436), False, 'import logging\n'), ((485, 560), 'logging.inf... |
"""This module contains the Explorer class, which is an abstraction
for batched, Bayesian optimization."""
from collections import deque
import csv
import heapq
import json
from operator import itemgetter
from pathlib import Path
import pickle
import tempfile
from typing import Dict, List, Optional, Tuple, TypeVar, Uni... | [
"pickle.dump",
"numpy.save",
"csv.reader",
"molpal.featurizer.Featurizer",
"csv.writer",
"molpal.pools.pool",
"heapq.heappush",
"heapq.heappushpop",
"tempfile.gettempdir",
"molpal.objectives.objective",
"pathlib.Path",
"numpy.array",
"numpy.column_stack",
"typing.TypeVar",
"operator.item... | [((416, 428), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (423, 428), False, 'from typing import Dict, List, Optional, Tuple, TypeVar, Union\n'), ((5483, 5504), 'tempfile.gettempdir', 'tempfile.gettempdir', ([], {}), '()\n', (5502, 5504), False, 'import tempfile\n'), ((5721, 5832), 'molpal.featurizer.Fea... |
# Copyright 2021 The Kubric 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | [
"pickle.dump",
"kubric.DirectionalLight",
"numpy.ones",
"numpy.sin",
"kubric.Cube",
"numpy.savetxt",
"kubric.AssetSource",
"numpy.random.RandomState",
"random.seed",
"kubric.PrincipledBSDFMaterial",
"numpy.arccos",
"kubric.PerspectiveCamera",
"kubric.file_io.write_flow_batch",
"numpy.ones_... | [((945, 978), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': '"""INFO"""'}), "(level='INFO')\n", (964, 978), False, 'import logging\n'), ((1208, 1222), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (1219, 1222), False, 'import random\n'), ((1287, 1318), 'kubric.Scene', 'kb.Scene', ([], {'resolutio... |
import RPi.GPIO as GPIO
from time import sleep
import numpy as np
import Encoder
import threading
import signal
import sys
import pybullet as p
import argparse
import time
# import keyboard
# For pybullet loading urdf to calculate inverse dynamics / Motor Params
def SetUp():
global ee_mass, bodyId
client = p.c... | [
"threading.Timer",
"argparse.ArgumentParser",
"pybullet.setJointMotorControl2",
"pybullet.connect",
"RPi.GPIO.output",
"Encoder.Encoder",
"pybullet.calculateInverseDynamics",
"RPi.GPIO.cleanup",
"RPi.GPIO.setup",
"pybullet.setGravity",
"RPi.GPIO.setmode",
"pybullet.changeDynamics",
"numpy.as... | [((3827, 3871), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'signal_handler'], {}), '(signal.SIGINT, signal_handler)\n', (3840, 3871), False, 'import signal\n'), ((5130, 5152), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (5142, 5152), True, 'import RPi.GPIO as GPIO\n'), ((5153, 5176... |
import random
import numpy as np
import copy
from algs.evocnn.genetic.population import Individual
from algs.evocnn.utils import Utils
from algs.evocnn.genetic.statusupdatetool import StatusUpdateTool
class CrossoverAndMutation(object):
def __init__(self, prob_crossover, prob_mutation, _log, individuals, gen_no, ... | [
"numpy.sum",
"numpy.random.randint",
"algs.evocnn.genetic.population.Individual.init_a_conv",
"algs.evocnn.genetic.population.Individual.calculate_complexity",
"numpy.power",
"algs.evocnn.genetic.statusupdatetool.StatusUpdateTool.get_hidden_neurons_limit",
"algs.evocnn.genetic.statusupdatetool.StatusUpd... | [((2160, 2188), 'numpy.random.randint', 'np.random.randint', (['(0)', 'count_'], {}), '(0, count_)\n', (2177, 2188), True, 'import numpy as np\n'), ((2204, 2232), 'numpy.random.randint', 'np.random.randint', (['(0)', 'count_'], {}), '(0, count_)\n', (2221, 2232), True, 'import numpy as np\n'), ((12940, 12958), 'numpy.r... |
import numpy as np
a = np.random.randn(3, 3)
b = np.random.randn(3, 1)
c = a*b
print(c.shape) | [
"numpy.random.randn"
] | [((26, 47), 'numpy.random.randn', 'np.random.randn', (['(3)', '(3)'], {}), '(3, 3)\n', (41, 47), True, 'import numpy as np\n'), ((53, 74), 'numpy.random.randn', 'np.random.randn', (['(3)', '(1)'], {}), '(3, 1)\n', (68, 74), True, 'import numpy as np\n')] |
import numpy as np
from nurbsvisualizer.nurbsgeometry import NurbsCurve
from nurbsvisualizer.visualizer import CurveVisualizer
#################
# 2D NURBS CIRCLE
#################
# Define knot vector
knot_vector = [0, 0, 0, np.pi/2, np.pi/2, np.pi, np.pi, 3 * np.pi / 2, 3 * np.pi / 2, 2 * np.pi, 2 * np.pi, 2 * np.... | [
"numpy.sqrt",
"nurbsvisualizer.nurbsgeometry.NurbsCurve",
"nurbsvisualizer.visualizer.CurveVisualizer"
] | [((596, 644), 'nurbsvisualizer.nurbsgeometry.NurbsCurve', 'NurbsCurve', (['control_points', 'weights', 'knot_vector'], {}), '(control_points, weights, knot_vector)\n', (606, 644), False, 'from nurbsvisualizer.nurbsgeometry import NurbsCurve\n'), ((678, 707), 'nurbsvisualizer.visualizer.CurveVisualizer', 'CurveVisualize... |
# -*- coding: utf-8 -*-
'''
@author: <NAME>
@contact: <EMAIL>
@description: centrality-related method tests.
'''
# DEPENDENCIES =================================================================
import numpy as np
import pandas as pd
from gpseqc import centrality as c
# PARAMS ======================================... | [
"pandas.DataFrame",
"gpseqc.centrality.rank",
"gpseqc.centrality.calc_var",
"gpseqc.centrality.est_2p",
"gpseqc.centrality.calc_ff",
"numpy.power",
"gpseqc.centrality.calc_pr",
"gpseqc.centrality.est_f",
"gpseqc.centrality.calc_pc",
"gpseqc.centrality.calc_p",
"gpseqc.centrality.calc_cv",
"gps... | [((361, 928), 'pandas.DataFrame', 'pd.DataFrame', (["[['chr1', 0, 249221236, 75860, 4.3781381658683, 46.5264380581169, 17327, \n 876501, 1], ['chr1', 0, 249221236, 102923, 5.97694541231127, \n 165.119679583602, 17220, 1045062, 2], ['chr1', 0, 249221236, 580975, \n 29.1551663572038, 414.534732953575, 19927, 662... |
# Copyright 2019-2020 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS"... | [
"pandas.DataFrame",
"causalnex.evaluation.roc_auc",
"causalnex.structure.notears.from_pandas",
"numpy.random.seed",
"numpy.sum",
"numpy.abs",
"causalnex.inference.InferenceEngine",
"numpy.all",
"causalnex.utils.network_utils.get_markov_blanket",
"pytest.raises",
"causalnex.evaluation.classificat... | [((29766, 29901), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""test_input,n_components"""', '[([(0, 1), (1, 2), (3, 4), (4, 6)], 2), ([(0, 1), (1, 2), (3, 4), (5, 6)], 3)]'], {}), "('test_input,n_components', [([(0, 1), (1, 2), (3, 4\n ), (4, 6)], 2), ([(0, 1), (1, 2), (3, 4), (5, 6)], 3)])\n", (29789... |
from gurobipy import *
import math
import numpy as np
import xlrd #excel
import sys
#quatratic
import datetime
from random import sample
from sympy import *
from sklearn.cluster import KMeans
from sklearn.externals import joblib
from sklearn import cluster
import time
import matplotlib.pyplot as plt
import warnings
... | [
"matplotlib.pyplot.show",
"warnings.filterwarnings",
"matplotlib.pyplot.scatter",
"xlrd.open_workbook",
"matplotlib.pyplot.legend",
"numpy.square",
"matplotlib.pyplot.figure",
"numpy.mat",
"math.log",
"datetime.datetime.now"
] | [((353, 386), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (376, 386), False, 'import warnings\n'), ((464, 493), 'xlrd.open_workbook', 'xlrd.open_workbook', (['readfile1'], {}), '(readfile1)\n', (482, 493), False, 'import xlrd\n'), ((539, 568), 'xlrd.open_workbook', 'xlr... |
from os import path
import MDAnalysis
import numpy as np
from enmspring.graphs import Stack
from enmspring.miscell import check_dir_exist_and_make
enmspring_folder = '/home/yizaochen/codes/dna_rna/enmspring'
all_folder = '/home/yizaochen/codes/dna_rna/all_systems'
class BaseStackImportanceAgent:
type_na = 'bdna+bd... | [
"enmspring.graphs.Stack",
"numpy.zeros",
"MDAnalysis.Universe",
"os.path.join",
"enmspring.miscell.check_dir_exist_and_make"
] | [((471, 512), 'os.path.join', 'path.join', (['enmspring_folder', '"""tclscripts"""'], {}), "(enmspring_folder, 'tclscripts')\n", (480, 512), False, 'from os import path\n'), ((589, 636), 'os.path.join', 'path.join', (['self.pic_out_folder', '"""mol_structure"""'], {}), "(self.pic_out_folder, 'mol_structure')\n", (598, ... |
import seaborn as sns
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
num_iterations = 3
raws_reward = np.zeros((1000, num_iterations))
pretrained_rewards = np.zeros_like(raws_reward)
for array_index, array in enumerate([raws_reward, pretrained_rewards]):
... | [
"matplotlib.pyplot.title",
"scipy.signal.savgol_filter",
"numpy.zeros_like",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.legend",
"numpy.zeros",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.grid"
] | [((166, 198), 'numpy.zeros', 'np.zeros', (['(1000, num_iterations)'], {}), '((1000, num_iterations))\n', (174, 198), True, 'import numpy as np\n'), ((220, 246), 'numpy.zeros_like', 'np.zeros_like', (['raws_reward'], {}), '(raws_reward)\n', (233, 246), True, 'import numpy as np\n'), ((734, 772), 'matplotlib.pyplot.legen... |
"""
A simple Psi 4 input script to compute CISD energy from a SCF reference
Requirements:
SciPy 0.13.0+, NumPy 1.7.2+
References:
Equations from [Szabo:1996]
"""
__authors__ = "<NAME>"
__credits__ = ["<NAME>", "<NAME>", "<NAME>"]
__copyright__ = "(c) 2014-2017, The Psi4NumPy Developers"
__license__ = "BSD-3-... | [
"numpy.set_printoptions",
"psi4.set_options",
"helper_CI.HamiltonianGenerator",
"scipy.special.comb",
"numpy.einsum",
"psi4.energy",
"time.time",
"helper_CI.Determinant",
"numpy.linalg.eigh",
"numpy.arange",
"psi4.core.set_output_file",
"psi4.geometry",
"numpy.repeat"
] | [((389, 451), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(5)', 'linewidth': '(200)', 'suppress': '(True)'}), '(precision=5, linewidth=200, suppress=True)\n', (408, 451), True, 'import numpy as np\n'), ((579, 625), 'psi4.core.set_output_file', 'psi4.core.set_output_file', (['"""output.dat"""', ... |
# Copyright (c) 2020 Huawei Technologies Co., Ltd.
# Licensed under CC BY-NC-SA 4.0 (Attribution-NonCommercial-ShareAlike 4.0 International) (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://creativecommons.org/licenses/by-nc-sa... | [
"argparse.ArgumentParser",
"pandas.read_csv",
"models.create_model",
"torch.cuda.device_count",
"os.path.isfile",
"glob.glob",
"models.SRFlow_model.SRFlowModel",
"torch.no_grad",
"os.path.join",
"numpy.pad",
"pandas.DataFrame",
"torch.utils.data.DataLoader",
"cv2.imwrite",
"utils.util.opt_... | [((1366, 1405), 'options.options.parse', 'option.parse', (['conf_path'], {'is_train': '(False)'}), '(conf_path, is_train=False)\n', (1378, 1405), True, 'import options.options as option\n'), ((1442, 1470), 'options.options.dict_to_nonedict', 'option.dict_to_nonedict', (['opt'], {}), '(opt)\n', (1465, 1470), True, 'impo... |
import functools
from pathlib import Path
from typing import List, Optional, Sequence, Tuple
import dask
import numpy
import scipy
from arbol.arbol import aprint, asection
from dask.distributed import Client
from dask_cuda import LocalCUDACluster
from dexp.datasets import BaseDataset
from dexp.optics.psf.standard_psf... | [
"numpy.load",
"dask_cuda.LocalCUDACluster",
"pathlib.Path",
"dexp.datasets.ZDataset",
"dexp.utils.backends.Backend.to_backend",
"napari.Viewer",
"dexp.processing.deconvolution.admm_deconvolution",
"dask.distributed.Client",
"traceback.print_exc",
"scipy.ndimage.zoom",
"dexp.processing.utils.scat... | [((1666, 1714), 'dexp.datasets.ZDataset', 'ZDataset', (['dest_path', 'mode', 'store'], {'parent': 'dataset'}), '(dest_path, mode, store, parent=dataset)\n', (1674, 1714), False, 'from dexp.datasets import ZDataset\n'), ((1921, 1984), 'arbol.arbol.aprint', 'aprint', (['f"""Input images will be scaled by: (sz,sy,sx)={sca... |
import os
import xarray as xr
server = "ftp.star.nesdis.noaa.gov"
base_dir = "/pub/smcd/jhuang/npp.viirs.aerosol.data/edraot550/"
def open_dataset(date, resolution="high", datapath="."):
current = change_dir(datapath) # noqa: F841
# check resolution; by default 0.1 degree data is assumed
if resolution ... | [
"subprocess.run",
"numpy.meshgrid",
"pandas.Timestamp",
"numpy.fromfile",
"os.getcwd",
"xarray.concat",
"pandas.to_datetime",
"numpy.linspace",
"ftplib.FTP",
"os.chdir"
] | [((984, 1010), 'xarray.concat', 'xr.concat', (['das'], {'dim': '"""time"""'}), "(das, dim='time')\n", (993, 1010), True, 'import xarray as xr\n'), ((1154, 1184), 'numpy.fromfile', 'fromfile', (['fname'], {'dtype': 'float32'}), '(fname, dtype=float32)\n', (1162, 1184), False, 'from numpy import float32, fromfile, nan\n'... |
"""
A test suite to check whether lbann.onnx can convert typical LBANN networks to ONNX networks correctly.
For each test case, this script
1. converts a given LBANN network into an ONNX network, and
2. adds dummy (zero) parameters to the converted network (if ADD_DUMMY_PARAMS is set),
3. saves the network to DUMP_DIR... | [
"unittest.main",
"lbann.onnx.util.getLbannRoot",
"onnx.helper.make_model",
"numpy.zeros",
"unittest.skip",
"lbann.onnx.tests.util.isModelDumpEnabled",
"lbann.onnx.util.parseBoolEnvVar",
"lbann.onnx.tests.util.createAndGetDumpedModelsDir",
"re.compile"
] | [((866, 886), 'lbann.onnx.tests.util.isModelDumpEnabled', 'isModelDumpEnabled', ([], {}), '()\n', (884, 886), False, 'from lbann.onnx.tests.util import isModelDumpEnabled, createAndGetDumpedModelsDir\n'), ((898, 927), 'lbann.onnx.tests.util.createAndGetDumpedModelsDir', 'createAndGetDumpedModelsDir', ([], {}), '()\n', ... |
import numpy as np
import tensorflow as tf
from trainer import Trainer
from config import get_config
from data_loader import get_loader
from utils import prepare_dirs_and_logger, save_config
def main(config):
prepare_dirs_and_logger(config)
rng = np.random.RandomState(config.random_seed)
tf.set_random_se... | [
"utils.prepare_dirs_and_logger",
"numpy.random.RandomState",
"tensorflow.set_random_seed",
"utils.save_config",
"config.get_config",
"data_loader.get_loader",
"trainer.Trainer"
] | [((215, 246), 'utils.prepare_dirs_and_logger', 'prepare_dirs_and_logger', (['config'], {}), '(config)\n', (238, 246), False, 'from utils import prepare_dirs_and_logger, save_config\n'), ((258, 299), 'numpy.random.RandomState', 'np.random.RandomState', (['config.random_seed'], {}), '(config.random_seed)\n', (279, 299), ... |
import os, sys, inspect, time, json, yaml
import redis
import numpy as np
import tensorflow as tf
from keras.applications import imagenet_utils
# sys.path.insert(1, os.path.join(sys.path[0], '../..')) # insert mlpipe root to path
mlpipe_root = os.path.abspath("../..")
sys.path.insert(0, mlpipe_root)
from config.clist... | [
"os.path.abspath",
"yaml.load",
"json.loads",
"sys.path.insert",
"json.dumps",
"time.sleep",
"keras.models.model_from_json",
"servers.helpers.helperfunctions.base64_decoding",
"redis.StrictRedis",
"tensorflow.get_default_graph",
"numpy.vstack"
] | [((245, 269), 'os.path.abspath', 'os.path.abspath', (['"""../.."""'], {}), "('../..')\n", (260, 269), False, 'import os, sys, inspect, time, json, yaml\n'), ((270, 301), 'sys.path.insert', 'sys.path.insert', (['(0)', 'mlpipe_root'], {}), '(0, mlpipe_root)\n', (285, 301), False, 'import os, sys, inspect, time, json, yam... |
import argparse
import numpy as np
import scipy.sparse as sp
import torch
import random
import networkx as nx
import dgl
from dgl import DGLGraph
from dgl.data import *
def preprocess_data(dataset, train_ratio):
if dataset in ['cora', 'citeseer', 'pubmed']:
edge = np.loadtxt('../low_freq/{}.edge'.format... | [
"dgl.graph",
"scipy.sparse.diags",
"torch.sum",
"torch.LongTensor",
"random.shuffle",
"numpy.power",
"dgl.to_bidirected",
"torch.FloatTensor",
"numpy.isinf",
"dgl.DGLGraph",
"numpy.zeros",
"torch.max",
"numpy.array",
"networkx.DiGraph",
"dgl.to_simple",
"dgl.remove_self_loop"
] | [((10310, 10325), 'scipy.sparse.diags', 'sp.diags', (['r_inv'], {}), '(r_inv)\n', (10318, 10325), True, 'import scipy.sparse as sp\n'), ((10416, 10440), 'torch.max', 'torch.max', (['logits'], {'dim': '(1)'}), '(logits, dim=1)\n', (10425, 10440), False, 'import torch\n'), ((10455, 10483), 'torch.sum', 'torch.sum', (['(i... |
import os
import numpy as np
import pandas as pd
import keras.backend as K
from sklearn.metrics import balanced_accuracy_score
from multilingual_title_classifier.src.path_helpers import get_path, get_resources_path
def predict_with_uncertainty(model, x, y, num_classes, beta=0.4, n_iter=100) -> None:
"""
Predi... | [
"numpy.sum",
"keras.backend.learning_phase",
"numpy.argmax",
"pandas.merge",
"sklearn.metrics.balanced_accuracy_score",
"numpy.zeros",
"multilingual_title_classifier.src.path_helpers.get_resources_path",
"multilingual_title_classifier.src.path_helpers.get_path",
"numpy.array_split"
] | [((629, 664), 'numpy.zeros', 'np.zeros', (['(x.shape[0], num_classes)'], {}), '((x.shape[0], num_classes))\n', (637, 664), True, 'import numpy as np\n'), ((3778, 3885), 'pandas.merge', 'pd.merge', (['merged_df[merged_df.category_base != merged_df.category_curr]', 'test_set'], {'on': '"""id"""', 'how': '"""inner"""'}), ... |
import sys
import os
sys.path.append('../')
from models.mobilenet import mbv2
from models.resnet import rf_lw_model
from models.mobilenet import rf_lw_mbv2_model
from utils.helpers import prepare_img
import cv2
import numpy as np
import torch
from PIL import Image
cmap = np.load('../utils/cmap.npy')
cmap = cmap[:21... | [
"sys.path.append",
"numpy.load",
"cv2.imwrite",
"models.mobilenet.rf_lw_mbv2_model",
"os.path.exists",
"PIL.Image.open",
"utils.helpers.prepare_img",
"torch.cuda.is_available",
"torch.nn.DataParallel",
"torch.no_grad",
"os.path.join",
"cv2.resize"
] | [((21, 43), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (36, 43), False, 'import sys\n'), ((276, 304), 'numpy.load', 'np.load', (['"""../utils/cmap.npy"""'], {}), "('../utils/cmap.npy')\n", (283, 304), True, 'import numpy as np\n'), ((335, 360), 'torch.cuda.is_available', 'torch.cuda.is_avai... |
import tensorflow as tf
import numpy as np
import tf_utils
# hyper parameters
ALPHA=1.
STEP_SIZE=1e-4
LAYER1_SIZE = 400
LAYER2_SIZE = 300
class SVPG:
def __init__(self,sess,actor_nets,actor_pg_list,state_dim,action_dim,independent_flag=0):
self.alpha=ALPHA;
self.step_size=STEP_SIZE;
self.n_particles=len... | [
"tf_utils.pdist",
"tensorflow.reduce_sum",
"tf_utils.median",
"tensorflow.reshape",
"numpy.zeros",
"tensorflow.stack",
"tensorflow.matmul",
"tensorflow.exp",
"numpy.reshape",
"tensorflow.log",
"tensorflow.slice",
"tensorflow.train.AdamOptimizer",
"tensorflow.unstack",
"tensorflow.expand_di... | [((1420, 1479), 'numpy.zeros', 'np.zeros', (['(self.n_particles, self.params_num)'], {'dtype': 'object'}), '((self.n_particles, self.params_num), dtype=object)\n', (1428, 1479), True, 'import numpy as np\n'), ((2894, 2923), 'tensorflow.stack', 'tf.stack', (['p_flat_list'], {'axis': '(0)'}), '(p_flat_list, axis=0)\n', (... |
"""Tests for NomialArray class"""
import unittest
import warnings as pywarnings
import numpy as np
from gpkit import Variable, Posynomial, NomialArray, VectorVariable, Monomial
from gpkit.constraints.set import ConstraintSet
from gpkit.exceptions import DimensionalityError
import gpkit
class TestNomialArray(unittest.... | [
"gpkit.NomialArray",
"numpy.outer",
"gpkit.VectorVariable",
"warnings.simplefilter",
"gpkit.constraints.set.ConstraintSet",
"gpkit.tests.helpers.run_tests",
"gpkit.Monomial",
"warnings.catch_warnings",
"gpkit.Variable",
"numpy.prod"
] | [((6052, 6068), 'gpkit.tests.helpers.run_tests', 'run_tests', (['TESTS'], {}), '(TESTS)\n', (6061, 6068), False, 'from gpkit.tests.helpers import run_tests\n'), ((495, 522), 'gpkit.VectorVariable', 'VectorVariable', (['(2, 3)', '"""x"""'], {}), "((2, 3), 'x')\n", (509, 522), False, 'from gpkit import Variable, Posynomi... |
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright 2018-2021 New York University <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 restriction, including without limitation t... | [
"sklearn.pipeline.FeatureUnion",
"pandas.read_csv",
"sklearn.metrics.accuracy_score",
"collections.defaultdict",
"pathlib.Path",
"sklearn.metrics.f1_score",
"numpy.exp",
"kenlm.Config",
"collections.deque",
"sklearn.preprocessing.LabelEncoder",
"dill.load",
"sklearn.metrics.recall_score",
"s... | [((5012, 5041), 'pathlib.Path', 'Path', (['_DATA_DIR', '"""lm"""', '"""char"""'], {}), "(_DATA_DIR, 'lm', 'char')\n", (5016, 5041), False, 'from pathlib import Path\n'), ((5057, 5086), 'pathlib.Path', 'Path', (['_DATA_DIR', '"""lm"""', '"""word"""'], {}), "(_DATA_DIR, 'lm', 'word')\n", (5061, 5086), False, 'from pathli... |
from time import sleep
import numpy as np
import os
import allogger
import logging
def main():
allogger.basic_configure(logdir='/tmp/allogger/singleprocess', default_outputs=['tensorboard'], hdf_writer_params=dict(
min_time_diff_btw_disc_writes=10, precision=2,
), debug=True, default_path_exists='ask... | [
"allogger.close",
"allogger.get_logger",
"allogger.utils.report_env",
"numpy.load",
"os.path.exists",
"numpy.random.rand"
] | [((327, 368), 'allogger.utils.report_env', 'allogger.utils.report_env', ([], {'to_stdout': '(True)'}), '(to_stdout=True)\n', (352, 368), False, 'import allogger\n'), ((382, 415), 'allogger.get_logger', 'allogger.get_logger', ([], {'scope': '"""main"""'}), "(scope='main')\n", (401, 415), False, 'import allogger\n'), ((4... |
# -*- coding: ISO-8859-1 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2014, HFTools Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#---------------------... | [
"numpy.angle",
"numpy.empty",
"numpy.einsum",
"hftools.dataset.arrayobj.make_same_dims",
"numpy.mean",
"numpy.exp",
"numpy.multiply.reduce",
"numpy.linalg.solve",
"numpy.empty_like",
"scipy.polyval",
"hftools.dataset.hfarray",
"scipy.polyfit",
"numpy.ndenumerate",
"numpy.lib.stride_tricks.... | [((1200, 1216), 'numpy.angle', 'np.angle', (['Z', 'deg'], {}), '(Z, deg)\n', (1208, 1216), True, 'import numpy as np\n'), ((1387, 1420), 'hftools.dataset.make_same_dims_list', 'make_same_dims_list', (['[a, b, c, d]'], {}), '([a, b, c, d])\n', (1406, 1420), False, 'from hftools.dataset import make_same_dims_list, hfarra... |
import PIL
from PIL.Image import Image
import numpy as np
import torch
import matplotlib.pyplot as plt
import cv2
from imutils import face_utils
def detect_faces(image,model):
face_coordinates, prob = model.detect(image)
return face_coordinates, prob
def rect_to_bb(rect):
# take a bounding predicted by dlib ... | [
"cv2.circle",
"cv2.waitKey",
"numpy.zeros",
"imutils.face_utils.shape_to_np",
"imutils.face_utils.rect_to_bb",
"cv2.rectangle",
"cv2.imshow",
"matplotlib.pyplot.subplots"
] | [((630, 660), 'numpy.zeros', 'np.zeros', (['(68, 2)'], {'dtype': 'dtype'}), '((68, 2), dtype=dtype)\n', (638, 660), True, 'import numpy as np\n'), ((1176, 1206), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(16, 12)'}), '(figsize=(16, 12))\n', (1188, 1206), True, 'import matplotlib.pyplot as plt\n'),... |
# import modules
import numpy as np
import scipy.fftpack as fft
def mkwhite(t, fs=48000):
tap = int(t*fs)
white = np.random.randn(tap)
white /= np.max(np.abs(white))
return white
def mkpink(t, fs=48000):
tap = int(t*fs)
white = mkwhite(t, fs)
WHITE = fft.fft(white)
pink_filter = n... | [
"numpy.abs",
"numpy.random.randn",
"scipy.fftpack.fft",
"scipy.fftpack.ifft",
"numpy.array",
"numpy.arange"
] | [((125, 145), 'numpy.random.randn', 'np.random.randn', (['tap'], {}), '(tap)\n', (140, 145), True, 'import numpy as np\n'), ((285, 299), 'scipy.fftpack.fft', 'fft.fft', (['white'], {}), '(white)\n', (292, 299), True, 'import scipy.fftpack as fft\n'), ((166, 179), 'numpy.abs', 'np.abs', (['white'], {}), '(white)\n', (17... |
"""Note: Keep in sync with changes to VTracePolicyGraph."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import gym
import copy
import ray
from ray.rllib.utils.error import UnsupportedSpaceException
from ray.rl... | [
"tensorflow.reduce_sum",
"numpy.sum",
"tensorflow.print",
"tensorflow.reshape",
"tensorflow.get_variable_scope",
"numpy.clip",
"numpy.tile",
"tensorflow.clip_by_global_norm",
"tensorflow.nn.softmax",
"numpy.multiply",
"ray.rllib.utils.explained_variance.explained_variance",
"ray.rllib.utils.an... | [((987, 1016), 'numpy.asarray', 'np.asarray', (['p'], {'dtype': 'np.float'}), '(p, dtype=np.float)\n', (997, 1016), True, 'import numpy as np\n'), ((1025, 1054), 'numpy.asarray', 'np.asarray', (['q'], {'dtype': 'np.float'}), '(q, dtype=np.float)\n', (1035, 1054), True, 'import numpy as np\n'), ((1066, 1082), 'numpy.whe... |
import unittest
import numpy as np
from src.models import Frame, FrameBatch, Prediction
NUM_FRAMES = 10
class PredictionTest(unittest.TestCase):
def test_should_check_if_batch_frames_equivalent_to_number_of_predictions(
self):
batch = FrameBatch(frames=[Frame(1, np.ones((1, 1)), None)], in... | [
"src.models.Prediction.predictions_from_batch_and_lists",
"src.models.Prediction",
"numpy.ones"
] | [((1843, 1914), 'src.models.Prediction.predictions_from_batch_and_lists', 'Prediction.predictions_from_batch_and_lists', (['batch', 'predictions', 'scores'], {}), '(batch, predictions, scores)\n', (1886, 1914), False, 'from src.models import Frame, FrameBatch, Prediction\n'), ((1770, 1824), 'src.models.Prediction', 'Pr... |
import numpy as np
import scipy.fft
def levy_stable(alpha: float, beta: float, size: int, mu: float = 0.0, sigma: float = 1.0) -> np.ndarray:
"""
Generate random values sampled from an alpha-stable distribution.
Notice that this method is "exact", in the sense that is derived
directly from the definit... | [
"numpy.absolute",
"numpy.abs",
"numpy.log",
"numpy.zeros",
"numpy.tan",
"numpy.random.random",
"numpy.random.standard_normal",
"numpy.linspace",
"numpy.cos",
"numpy.sin",
"numpy.concatenate",
"numpy.sqrt"
] | [((1052, 1074), 'numpy.random.random', 'np.random.random', (['size'], {}), '(size)\n', (1068, 1074), True, 'import numpy as np\n'), ((1084, 1106), 'numpy.random.random', 'np.random.random', (['size'], {}), '(size)\n', (1100, 1106), True, 'import numpy as np\n'), ((1316, 1336), 'numpy.tan', 'np.tan', (['(pi * b / 2.0)']... |
import cv2
import pyautogui
from PIL import ImageGrab, Image
import numpy as np
import platform
import psutil
import os
import time
PLATFORM = platform.system()
if PLATFORM:
import win32gui
from winguiauto import findTopWindow
def windowEnumerationHandler(hwnd, top_windows):
top_windows.append((h... | [
"win32gui.SetForegroundWindow",
"cv2.minMaxLoc",
"os.path.join",
"cv2.matchTemplate",
"win32gui.ShowWindow",
"psutil.process_iter",
"win32gui.GetWindowText",
"winguiauto.findTopWindow",
"win32gui.EnumWindows",
"pyautogui.position",
"PIL.ImageGrab.grab",
"time.sleep",
"pyautogui.click",
"pl... | [((144, 161), 'platform.system', 'platform.system', ([], {}), '()\n', (159, 161), False, 'import platform\n'), ((1652, 1704), 'cv2.matchTemplate', 'cv2.matchTemplate', (['lushi', 'icon', 'cv2.TM_CCOEFF_NORMED'], {}), '(lushi, icon, cv2.TM_CCOEFF_NORMED)\n', (1669, 1704), False, 'import cv2\n'), ((1744, 1765), 'cv2.minM... |
# future
from __future__ import annotations
# stdlib
from collections.abc import Sequence
import os
from pathlib import Path
from typing import Any
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
# third party
import capnp
from nacl.signing import VerifyKey
import... | [
"numpy.stack",
"os.path.dirname",
"numpy.array",
"pathlib.Path"
] | [((5085, 5105), 'numpy.stack', 'np.stack', (['child_list'], {}), '(child_list)\n', (5093, 5105), True, 'import numpy as np\n'), ((11034, 11059), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (11049, 11059), False, 'import os\n'), ((16159, 16191), 'numpy.array', 'np.array', (['ndept_msg.oneHo... |
import math
import cv2
import numpy as np
from SolarPaperRecord import SolarPaperRecord
class SolarMediumPaperRecord(SolarPaperRecord):
paper_record = None
def __init__(self, image = None, file_name = None, name = None):
super(SolarMediumPaperRecord, self).__init__(image, file_name, name)
self.image_... | [
"numpy.linalg.inv",
"numpy.array",
"math.sqrt"
] | [((589, 661), 'math.sqrt', 'math.sqrt', (['(self.min_v[0] * self.min_v[0] + self.min_v[1] * self.min_v[1])'], {}), '(self.min_v[0] * self.min_v[0] + self.min_v[1] * self.min_v[1])\n', (598, 661), False, 'import math\n'), ((989, 1208), 'numpy.array', 'np.array', (['[[self.r_v[0], self.r_v[1], -(self.image_x0 * self.r_v[... |
import numpy as np
import soccer3d
from soccer3d.tracking import Detection, find_tracks, smooth_trajectory, convert_to_MOT
from os.path import join
import utils.camera as cam_utils
import utils.misc as misc_utils
import json
import argparse
from tqdm import tqdm
import glog
import matplotlib.pyplot as plt
parser = ar... | [
"json.dump",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"soccer3d.tracking.find_tracks",
"glog.info",
"soccer3d.tracking.smooth_trajectory",
"soccer3d.tracking.convert_to_MOT",
"matplotlib.pyplot.figure",
"numpy.array",
"utils.misc.lift_keypoints_in_3d",
"soccer3d.YoutubeVideo",
"soc... | [((318, 381), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Calibrate a soccer video"""'}), "(description='Calibrate a soccer video')\n", (341, 381), False, 'import argparse\n'), ((654, 693), 'soccer3d.YoutubeVideo', 'soccer3d.YoutubeVideo', (['opt.path_to_data'], {}), '(opt.path_to_dat... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import neighbors
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import classification_report, accuracy_score, confusion_matrix
from sklearn.model_selection i... | [
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.show",
"sklearn.preprocessing.StandardScaler",
"pandas.read_csv",
"timeit.default_timer",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.accuracy_score",
"pandas.DataFrame.hist",
"time.clock",
"sklearn.model_selection.cross_val_p... | [((433, 455), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (453, 455), False, 'import timeit\n'), ((461, 473), 'time.clock', 'time.clock', ([], {}), '()\n', (471, 473), False, 'import time\n'), ((490, 517), 'pandas.read_csv', 'pd.read_csv', (['"""diabetes.csv"""'], {}), "('diabetes.csv')\n", (501, ... |
import sys
import timeit
import numpy as np
from global_vars import *
from MLP.global_vars import *
from MLP.MLP import MLP
from MLP.count_success import count_success
def process(model, file_name, test_set, label_set):
try:
file = open(log_full_path + "_detail/" + file_name, "w")
inferenc... | [
"timeit.default_timer",
"numpy.array",
"sys.exc_info"
] | [((329, 351), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (349, 351), False, 'import timeit\n'), ((479, 501), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (499, 501), False, 'import timeit\n'), ((420, 442), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (440... |
'''
A number of functions related to computing catchments from a field of flow directions.
The function 'main' is intended to be the function called externally
Created on Feb 9, 2016
@author: thomasriddick
'''
import numpy as np
import warnings
import os.path as path
from Dynamic_HD_Scripts.interface.fortran_interfa... | [
"os.path.join",
"numpy.empty",
"numpy.asarray",
"numpy.asfortranarray",
"Dynamic_HD_Scripts.base.iodriver.advanced_field_loader",
"Dynamic_HD_Scripts.base.iodriver.advanced_field_writer",
"numpy.amax",
"numpy.sort",
"Dynamic_HD_Scripts.base.iodriver.get_file_extension",
"numpy.swapaxes",
"os.pat... | [((1413, 1456), 'numpy.empty', 'np.empty', ([], {'shape': 'field.shape', 'dtype': 'np.int32'}), '(shape=field.shape, dtype=np.int32)\n', (1421, 1456), True, 'import numpy as np\n'), ((6157, 6196), 'numpy.asfortranarray', 'np.asfortranarray', (['catchments', 'np.int32'], {}), '(catchments, np.int32)\n', (6174, 6196), Tr... |
import os
import numpy as np
import logging
import cv2
import shutil
import json
import copy
import sys
import re
from matplotlib import pyplot as plt
import imageio
from collections import Counter
# ファイル出力ログ用
file_logger = logging.getLogger("message").getChild(__name__)
logger = logging.getLogger("__main__").getChild... | [
"matplotlib.pyplot.savefig",
"numpy.abs",
"matplotlib.pyplot.clf",
"os.path.basename",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.close",
"os.path.dirname",
"imageio.imread",
"numpy.asarray",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.colorbar",
"numpy.argsort",
"matplotlib.pyplot.c... | [((964, 998), 'os.path.join', 'os.path.join', (['json_path', 'file_name'], {}), '(json_path, file_name)\n', (976, 998), False, 'import os\n'), ((49125, 49149), 'numpy.argsort', 'np.argsort', (['avg_conf_ary'], {}), '(avg_conf_ary)\n', (49135, 49149), True, 'import numpy as np\n'), ((225, 253), 'logging.getLogger', 'log... |
# Copyright <NAME> 2013.
"""Decoding (inference) algorithms."""
import numpy as np
import pyximport
pyximport.install(setup_args={'include_dirs': np.get_include()})
from .bestfirst import bestfirst
from .viterbi import viterbi
DECODERS = {"bestfirst": bestfirst,
"viterbi": viterbi}
| [
"numpy.get_include"
] | [((148, 164), 'numpy.get_include', 'np.get_include', ([], {}), '()\n', (162, 164), True, 'import numpy as np\n')] |
#!/usr/bin/env python
from __future__ import print_function, absolute_import
import itertools
from decimal import Decimal
from copy import copy
import numpy as np
from .TreeNode import TreeNode
from .TreeStyle import TreeStyle, COLORS2
from .StyleChecker import StyleChecker
from .Coords import Coords
from .TreeParse... | [
"numpy.array",
"itertools.chain",
"copy.copy"
] | [((8505, 8520), 'numpy.array', 'np.array', (['elist'], {}), '(elist)\n', (8513, 8520), True, 'import numpy as np\n'), ((15108, 15122), 'numpy.array', 'np.array', (['vals'], {}), '(vals)\n', (15116, 15122), True, 'import numpy as np\n'), ((44978, 44988), 'copy.copy', 'copy', (['self'], {}), '(self)\n', (44982, 44988), F... |
import argparse
import numpy as np
from PIL.JpegImagePlugin import JpegImageFile
from torch.utils.data import Dataset
from datasets import AVAILABLE_MODALITIES, AVAILABLE_MODALITIES_DIM, AVAILABLE_DATASETS
from datasets import UtdMhadDataset, MmactDataset
def calculate_means_stds(dataset: Dataset, dim=None):
""... | [
"datasets.AVAILABLE_MODALITIES.index",
"numpy.array",
"argparse.ArgumentParser"
] | [((1288, 1324), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""PROG"""'}), "(prog='PROG')\n", (1311, 1324), False, 'import argparse\n'), ((1622, 1663), 'datasets.AVAILABLE_MODALITIES.index', 'AVAILABLE_MODALITIES.index', (['args.modality'], {}), '(args.modality)\n', (1648, 1663), False, 'from d... |
import numpy as np
import nltk
import string
from nltk.tokenize import sent_tokenize
import time
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem import PorterStemme... | [
"sklearn.metrics.pairwise.cosine_similarity",
"nltk.stem.PorterStemmer",
"json.loads",
"sklearn.feature_extraction.text.TfidfVectorizer",
"numpy.amax",
"nltk.tokenize.sent_tokenize",
"nltk.tokenize.word_tokenize"
] | [((432, 447), 'nltk.stem.PorterStemmer', 'PorterStemmer', ([], {}), '()\n', (445, 447), False, 'from nltk.stem import PorterStemmer\n'), ((1070, 1087), 'sklearn.feature_extraction.text.TfidfVectorizer', 'TfidfVectorizer', ([], {}), '()\n', (1085, 1087), False, 'from sklearn.feature_extraction.text import TfidfVectorize... |
import pandas as pd
import numpy as np
from xloil import *
import typing
@converter(pd.DataFrame, register=True)
class PDFrame:
"""
Converter which takes tables with horizontal records to pandas dataframes.
**PDFrame(element, headings, index)**
Examples
--------
::
@xlo.func
... | [
"numpy.full",
"pandas.DataFrame",
"numpy.block",
"pandas.Timestamp",
"numpy.atleast_2d"
] | [((3427, 3444), 'pandas.Timestamp', 'pd.Timestamp', (['val'], {}), '(val)\n', (3439, 3444), True, 'import pandas as pd\n'), ((2884, 2923), 'numpy.full', 'np.full', (['filler_size', '""" """'], {'dtype': 'object'}), "(filler_size, ' ', dtype=object)\n", (2891, 2923), True, 'import numpy as np\n'), ((3060, 3118), 'numpy.... |
from PIL import Image
import numpy as np
from time import time
import os
# recolor a folder of images by (r,g,b) * (shift_kern) element-wise.
# copy recolored images to out_root.
def build_shift(in_root, out_root, shift_kern):
working = None
if not os.path.exists(out_root): os.mkdir(out_root)
r, g, b = ... | [
"os.mkdir",
"os.path.basename",
"os.walk",
"os.path.exists",
"time.time",
"numpy.where",
"numpy.array",
"os.path.join",
"numpy.concatenate"
] | [((367, 383), 'os.walk', 'os.walk', (['in_root'], {}), '(in_root)\n', (374, 383), False, 'import os\n'), ((260, 284), 'os.path.exists', 'os.path.exists', (['out_root'], {}), '(out_root)\n', (274, 284), False, 'import os\n'), ((286, 304), 'os.mkdir', 'os.mkdir', (['out_root'], {}), '(out_root)\n', (294, 304), False, 'im... |
import os
import gc
import time
import sys
import math
import torch
import numpy as np
from tqdm import tqdm
from KGDataset import get_dataset
from sampler import ConstructGraph, EvalDataset
from utils import CommonArgParser, thread_wrapped_func
import torch.multiprocessing as mp
class ArgParser(CommonArgParser):
... | [
"sampler.EvalDataset",
"os.mkdir",
"tqdm.tqdm",
"numpy.save",
"sampler.ConstructGraph",
"os.path.exists",
"torch.cat",
"torch.set_num_threads",
"torch.multiprocessing.Process",
"os.path.join",
"KGDataset.get_dataset"
] | [((1951, 1980), 'torch.cat', 'torch.cat', (['candidates'], {'axis': '(0)'}), '(candidates, axis=0)\n', (1960, 1980), False, 'import torch\n'), ((1992, 2015), 'torch.cat', 'torch.cat', (['spos'], {'axis': '(0)'}), '(spos, axis=0)\n', (2001, 2015), False, 'import torch\n'), ((2083, 2110), 'numpy.save', 'np.save', (['save... |
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy
x_min = 40.0
x_step = 20.0
x_max = 300.0
# pop per year at start
starting_pop_per_year = numpy.linspace(x_min, x_max, 1001)
xticks = numpy.arange(0.0, x_max + x_step * 0.5, x_step)
starting_pop_per_month = starting_pop_per_year / 12.... | [
"matplotlib.pyplot.xlim",
"numpy.zeros_like",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.yticks",
"numpy.max",
"numpy.arange",
"matplotlib.pyplot.xticks",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotl... | [((170, 204), 'numpy.linspace', 'numpy.linspace', (['x_min', 'x_max', '(1001)'], {}), '(x_min, x_max, 1001)\n', (184, 204), False, 'import numpy\n'), ((215, 262), 'numpy.arange', 'numpy.arange', (['(0.0)', '(x_max + x_step * 0.5)', 'x_step'], {}), '(0.0, x_max + x_step * 0.5, x_step)\n', (227, 262), False, 'import nump... |
import sys
sys.path.append("../")
import tensorflow as tf
from tensorflow.python.platform import flags
import numpy as np
from sklearn.tree import DecisionTreeClassifier
if sys.version_info.major==2:
from Queue import PriorityQueue
else:
from queue import PriorityQueue
from z3 import *
import os
import copy
fr... | [
"tensorflow.python.platform.flags.DEFINE_string",
"sklearn.tree.DecisionTreeClassifier",
"tensorflow.ConfigProto",
"sys.path.append",
"os.path.exists",
"tensorflow.set_random_seed",
"tensorflow.placeholder",
"queue.PriorityQueue",
"tensorflow.app.run",
"copy.deepcopy",
"tensorflow.train.Saver",
... | [((11, 33), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (26, 33), False, 'import sys\n'), ((1014, 1043), 'adf_tutorial.utils.cluster', 'cluster', (['dataset', 'cluster_num'], {}), '(dataset, cluster_num)\n', (1021, 1043), False, 'from adf_tutorial.utils import cluster\n'), ((1458, 1472), 'nu... |
#------------------------------------------------------------------------------------------------------------------
# train_test_plot_def
#
# MIT License
# Dr <NAME> (<EMAIL>)
#------------------------------------------------------------------------------------------------------------------
import pandas as pd
import... | [
"matplotlib.pyplot.title",
"sklearn.preprocessing.StandardScaler",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.accuracy_score",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.svm.SVC",
"matplotlib.pyplot.tick_params",
"sklearn.metrics.precision_recall_fscore_support",
"numpy.unique... | [((1095, 1128), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (1118, 1128), False, 'import warnings\n'), ((1174, 1208), 'sklearn.linear_model.LogisticRegression', 'LogisticRegression', ([], {'max_iter': '(10000)'}), '(max_iter=10000)\n', (1192, 1208), False, 'from sklearn... |
"""
StateIO
Container to store state object.
Several useful functions are implemented in this class:
1. Saving intermediate results to files.
2. Recover workspace at any iteration (label set and unlabel set).
3. Recover workspace from the intermediate result file in case the program exits unexpectedly.
4. Gathering and... | [
"copy.deepcopy",
"pickle.dump",
"os.path.abspath",
"os.path.isdir",
"numpy.std",
"copy.copy",
"pickle.load",
"sys.stdout.flush",
"prettytable.PrettyTable",
"numpy.mean",
"os.path.split",
"os.path.join"
] | [((3241, 3261), 'copy.copy', 'copy.copy', (['train_idx'], {}), '(train_idx)\n', (3250, 3261), False, 'import copy\n'), ((3286, 3305), 'copy.copy', 'copy.copy', (['test_idx'], {}), '(test_idx)\n', (3295, 3305), False, 'import copy\n'), ((5280, 5294), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (5291, 5294), Fals... |
"""
Missile Defence Game
Cannon drawing and simulation module.
Copyright (C) 2011-2012 <NAME>.
See LICENSE (GNU GPL version 3 or later).
"""
from numpy import array
import pygame
from maths import normalize
import math
import projectiles
class CounterMissile(projectiles.Missile):
def __init__... | [
"projectiles.Missile",
"pygame.draw.line",
"numpy.array"
] | [((1353, 1371), 'numpy.array', 'array', (['[100, -100]'], {}), '([100, -100])\n', (1358, 1371), False, 'from numpy import array\n'), ((1394, 1407), 'numpy.array', 'array', (['centre'], {}), '(centre)\n', (1399, 1407), False, 'from numpy import array\n'), ((2318, 2467), 'pygame.draw.line', 'pygame.draw.line', (['surface... |
import os
import torch
import torchvision
import torch.nn as nn
from PIL import Image
from scipy import stats
import random
import numpy as np
import time
import scipy.io
from torch.optim import lr_scheduler
import torch.nn.functional as F
def pil_loader(path):
# open path as file to avoid ResourceWarning (https:/... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"torch.optim.lr_scheduler.StepLR",
"random.shuffle",
"accimage.Image",
"numpy.mean",
"torch.nn.init.constant_",
"numpy.arange",
"torchvision.get_image_backend",
"Kadid10kFolder_DistortionNet_Finetune.Kadid10kFolder_DistortionNet_Finetune",
"torchvi... | [((16769, 16830), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Train DB-CNN for BIQA."""'}), "(description='Train DB-CNN for BIQA.')\n", (16792, 16830), False, 'import argparse\n'), ((18743, 18771), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (18760,... |
# %% [markdown]
# # Noise-free optimization with Expected Improvement
# %%
import numpy as np
import tensorflow as tf
np.random.seed(1793)
tf.random.set_seed(1793)
# %% [markdown]
# ## Describe the problem
# In this example, we look to find the minimum value of the two-dimensional Branin function over the hypercube ... | [
"tensorflow.random.set_seed",
"util.plotting.plot_function_2d",
"trieste.acquisition.BatchMonteCarloExpectedImprovement",
"numpy.random.seed",
"trieste.utils.objectives.mk_observer",
"gpflow.optimizers.Scipy",
"util.plotting.plot_regret",
"tensorflow.argmin",
"util.plotting_plotly.plot_function_plot... | [((120, 140), 'numpy.random.seed', 'np.random.seed', (['(1793)'], {}), '(1793)\n', (134, 140), True, 'import numpy as np\n'), ((141, 165), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(1793)'], {}), '(1793)\n', (159, 165), True, 'import tensorflow as tf\n'), ((565, 598), 'trieste.space.Box', 'trieste.space.Bo... |
# <NAME> - 130401064
# -*- coding: utf-8 -*-
import numpy as np
def RMSE(pred, target):
err = np.subtract(target, pred)
return (np.mean(err**2))**0.5
# veri dosyasi acilir
f = open("veriler.txt")
# veriler okunur, varsa bos satirlar silinir
data = f.readlines()
if "\n" in data: data.remove("... | [
"numpy.subtract",
"numpy.polyfit",
"numpy.argmin",
"numpy.mean",
"numpy.array"
] | [((402, 427), 'numpy.array', 'np.array', (['data'], {'dtype': 'int'}), '(data, dtype=int)\n', (410, 427), True, 'import numpy as np\n'), ((104, 129), 'numpy.subtract', 'np.subtract', (['target', 'pred'], {}), '(target, pred)\n', (115, 129), True, 'import numpy as np\n'), ((1120, 1140), 'numpy.argmin', 'np.argmin', (['R... |
#
# Author: <NAME>
# Copyright 2015-present, NASA-JPL/Caltech
#
import os
import logging
import datetime
import numpy as np
import isceobj
from isceobj.Constants import SPEED_OF_LIGHT
from isceobj.Alos2Proc.Alos2ProcPublic import overlapFrequency
from contrib.alos2proc.alos2proc import rg_filter
from contrib.alos2pro... | [
"contrib.alos2proc.alos2proc.rg_filter",
"os.remove",
"numpy.polyfit",
"isceobj.Alos2Proc.Alos2ProcPublic.overlapFrequency",
"os.path.isfile",
"numpy.arange",
"contrib.alos2proc.alos2proc.resamp",
"os.chdir",
"numpy.polyval",
"datetime.timedelta",
"os.rename",
"isceobj.Catalog.createCatalog",
... | [((400, 450), 'logging.getLogger', 'logging.getLogger', (['"""isce.alos2insar.runPrepareSlc"""'], {}), "('isce.alos2insar.runPrepareSlc')\n", (417, 450), False, 'import logging\n'), ((522, 577), 'isceobj.Catalog.createCatalog', 'isceobj.Catalog.createCatalog', (['self._insar.procDoc.name'], {}), '(self._insar.procDoc.n... |
import numpy as np
from LinConGauss import LinearConstraints
from LinConGauss.multilevel_splitting import SubsetSimulation
# define some linear constraints
n_lc = 5
n_dim = 3
np.random.seed(0) # because sometimes it is hard to find an initial point in the randomly drawn domain.
lincon = LinearConstraints(2 * np.rando... | [
"numpy.random.seed",
"numpy.all",
"LinConGauss.multilevel_splitting.SubsetSimulation",
"numpy.random.randn"
] | [((177, 194), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (191, 194), True, 'import numpy as np\n'), ((388, 421), 'LinConGauss.multilevel_splitting.SubsetSimulation', 'SubsetSimulation', (['lincon', '(16)', '(0.5)'], {}), '(lincon, 16, 0.5)\n', (404, 421), False, 'from LinConGauss.multilevel_splittin... |
#!/usr/bin/env python3 -u
import chainer
import chainer.functions as F
import numpy as np
import scipy.linalg
from scipy.optimize import fmin_ncg
import os
import time
import sys
from tqdm import tqdm
is_print = True
def _print(*args, **kwargs):
if is_print:
print(*args, **kwargs, file=sys.stderr)
cas... | [
"numpy.load",
"numpy.abs",
"numpy.linalg.norm",
"chainer.iterators.SerialIterator",
"os.path.join",
"chainer.functions.flatten",
"os.path.exists",
"numpy.identity",
"chainer.cuda.to_cpu",
"chainer.dataset.to_device",
"tqdm.tqdm",
"numpy.save",
"numpy.average",
"chainer.functions.sum",
"n... | [((845, 947), 'chainer.iterators.SerialIterator', 'chainer.iterators.SerialIterator', (['self.train_data'], {'batch_size': 'self.bathsize_for_hvp', 'repeat': '(False)'}), '(self.train_data, batch_size=self.\n bathsize_for_hvp, repeat=False)\n', (877, 947), False, 'import chainer\n'), ((960, 1001), 'chainer.dataset.t... |
# Copyright 2021 Xanadu Quantum Technologies Inc.
# 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.arange",
"numpy.eye",
"numpy.zeros",
"numpy.delete"
] | [((1157, 1191), 'numpy.delete', 'np.delete', (['m', 'id_to_delete'], {'axis': '(1)'}), '(m, id_to_delete, axis=1)\n', (1166, 1191), True, 'import numpy as np\n'), ((1200, 1234), 'numpy.delete', 'np.delete', (['A', 'id_to_delete'], {'axis': '(2)'}), '(A, id_to_delete, axis=2)\n', (1209, 1234), True, 'import numpy as np\... |
import numpy
from srxraylib.metrology.dabam import dabam
from srxraylib.plot.gol import plot
dm = dabam()
def load_dabam_profile(entry_number,
mirror_length = 2 * 0.07,
mirror_points = 100,
mirror_rms = 25e-9,
do_plot = True
... | [
"numpy.abs",
"srxraylib.metrology.dabam.dabam",
"srxraylib.plot.gol.plot",
"numpy.linspace",
"numpy.interp"
] | [((100, 107), 'srxraylib.metrology.dabam.dabam', 'dabam', ([], {}), '()\n', (105, 107), False, 'from srxraylib.metrology.dabam import dabam\n'), ((827, 899), 'numpy.linspace', 'numpy.linspace', (['(-0.5 * mirror_length)', '(0.5 * mirror_length)', 'mirror_points'], {}), '(-0.5 * mirror_length, 0.5 * mirror_length, mirro... |
import pandas as pd
import matplotlib.pyplot as plt
import math as mt
import numpy as np
from pandas.tools.plotting import scatter_matrix
dict = {'low' : 1,
'medium' : 2,
'high': 3}
def open_file(fileName):
data = pd.read_json(fileName)
return data
def show_data_info(data):
print("Number ... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.bar",
"pandas.read_json",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((236, 258), 'pandas.read_json', 'pd.read_json', (['fileName'], {}), '(fileName)\n', (248, 258), True, 'import pandas as pd\n'), ((1574, 1633), 'matplotlib.pyplot.bar', 'plt.bar', (['numbPhotosKeys', 'interestArray', 'width'], {'color': '"""blue"""'}), "(numbPhotosKeys, interestArray, width, color='blue')\n", (1581, 1... |
from abc import ABC, abstractmethod
from pathlib import Path
from typing import List, Optional, Union
import numpy as np
import pandas as pd
from pydantic import validator
from tqdm import tqdm
from src.core import RESHAPE
from src.core.base_model import BaseModel
from src.core.bio_process.calcification import Calcif... | [
"src.core.common.environment.Environment",
"src.core.RESHAPE",
"src.core.bio_process.flow.Flow",
"src.core.common.space_time.time_series_year",
"src.core.common.constants.Constants",
"src.core.bio_process.calcification.Calcification",
"src.core.bio_process.population_states.PopulationStates",
"src.cor... | [((1458, 1468), 'pathlib.Path.cwd', 'Path.cwd', ([], {}), '()\n', (1466, 1468), False, 'from pathlib import Path\n'), ((1709, 1722), 'src.core.common.environment.Environment', 'Environment', ([], {}), '()\n', (1720, 1722), False, 'from src.core.common.environment import Environment\n'), ((1750, 1761), 'src.core.common.... |
import time
import pickle
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from pystorm.PyDriver import bddriver as bd
from pystorm.hal import HAL
from pystorm.hal.neuromorph import graph # to describe HAL/neuromorph network
HAL = HAL()
def create_decode_encode_network(width,... | [
"pickle.dump",
"numpy.sum",
"numpy.abs",
"pystorm.hal.HAL",
"numpy.floor",
"numpy.ones",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.zeros_like",
"numpy.linspace",
"pystorm.hal.HAL.get_overflow_counts",
"pystorm.hal.HAL.get_outputs",
"pystorm.hal.HAL.enable_output_recording",
... | [((70, 84), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (77, 84), True, 'import matplotlib as mpl\n'), ((274, 279), 'pystorm.hal.HAL', 'HAL', ([], {}), '()\n', (277, 279), False, 'from pystorm.hal import HAL\n'), ((4945, 4983), 'numpy.linspace', 'np.linspace', (['(1)', '(1000)', '(11)'], {'dtype': 'n... |
"""
This program computes the logistic map equation.
The logistic map equation is a second degree polynomial equation often used as an
example in the discussions of chaos
More information:
wiki: https://en.wikipedia.org/wiki/Logistic_map#Finding_cycles_of_any_length_when_r_=_4
Author: <NAME>
github: https:... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.scatter",
"time.perf_counter",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure",
"numpy.arange"
] | [((1341, 1360), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (1358, 1360), False, 'import time\n'), ((1404, 1423), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (1421, 1423), False, 'import time\n'), ((1495, 1523), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(16, 12)'}), '(f... |
import os
from typing import Optional, Dict, List
import matplotlib.pyplot as plt
from matplotlib.cm import get_cmap
import numpy as np
import seaborn as sns
from tqdm import tqdm
from models.polyfit_model import PolyfitModel
from models.ridge_polyfit_model import RidgePolyfitModel
import evaluate_model
from models.m... | [
"data_generator.generate_data",
"numpy.sum",
"matplotlib.cm.get_cmap",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"os.path.join",
"matplotlib.pyplot.close",
"numpy.geomspace",
"models.polyfit_model.PolyfitModel",
... | [((384, 393), 'seaborn.set', 'sns.set', ([], {}), '()\n', (391, 393), True, 'import seaborn as sns\n'), ((445, 484), 'os.path.join', 'os.path.join', (['"""images"""', '"""raw"""', '"""intro2"""'], {}), "('images', 'raw', 'intro2')\n", (457, 484), False, 'import os\n'), ((489, 524), 'os.makedirs', 'os.makedirs', (['save... |
import csv
import random
import numpy as np
import math
from collections import Counter
class DataGenerator:
def __init__(self, question=-1, iterations=1):
self.question = question
self.iterations = iterations
def data_Generator(self, m):
data = []
if m == 0:
retur... | [
"numpy.random.standard_normal",
"csv.writer",
"math.sqrt"
] | [((442, 471), 'numpy.random.standard_normal', 'np.random.standard_normal', (['(15)'], {}), '(15)\n', (467, 471), True, 'import numpy as np\n'), ((1501, 1577), 'csv.writer', 'csv.writer', (['csvfile'], {'delimiter': '""","""', 'quotechar': '"""|"""', 'quoting': 'csv.QUOTE_MINIMAL'}), "(csvfile, delimiter=',', quotechar=... |
# Plot Nunerical Ray-FEM Solution Error
import numpy as np
import math
omega = np.array([31.4159265358979,
62.8318530717959,
94.2477796076938,
125.663706143592,
188.495559215388,
251.327412287183,
376.991118430775,
502.654824574367])
NRayFEM_solu_err1 = np.array([ 0.000263551282082452,
0.000254140256937518,
0.0001... | [
"matplotlib.pyplot.loglog",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.array",
"matplotlib.pyplot.autoscale",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"mat... | [((83, 246), 'numpy.array', 'np.array', (['[31.4159265358979, 62.8318530717959, 94.2477796076938, 125.663706143592, \n 188.495559215388, 251.327412287183, 376.991118430775, 502.654824574367]'], {}), '([31.4159265358979, 62.8318530717959, 94.2477796076938, \n 125.663706143592, 188.495559215388, 251.327412287183, 3... |
# set directory
import os
directory = "C:/Users/" # complete directory
os.chdir(directory)
# load libraries
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import backend
from tensorflow.keras.models import Model, Sequential
from tensorflow.keras.layers import Dense, Reshape, Input... | [
"numpy.random.seed",
"tensorflow.keras.layers.multiply",
"tensorflow.keras.layers.Dense",
"pandas.read_csv",
"numpy.ones",
"matplotlib.pyplot.style.use",
"numpy.random.randint",
"numpy.mean",
"tensorflow.keras.optimizers.RMSprop",
"os.chdir",
"pandas.DataFrame.to_numpy",
"tensorflow.keras.laye... | [((74, 93), 'os.chdir', 'os.chdir', (['directory'], {}), '(directory)\n', (82, 93), False, 'import os\n'), ((1385, 1411), 'numpy.random.seed', 'np.random.seed', (['seed_value'], {}), '(seed_value)\n', (1399, 1411), True, 'import numpy as np\n'), ((1548, 1571), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplo... |
import os
import sys
import numpy as np
from PIL import Image
height_trim = 16
width_trim = 20
def trim(image):
arr = np.asarray(image).tolist()
arr = arr[height_trim:-height_trim]
if len(arr[0]) == 215:
arr = [row[(width_trim-1):-width_trim] for row in arr]
else:
arr = [row[width_trim... | [
"numpy.asarray",
"os.listdir",
"PIL.Image.open"
] | [((360, 375), 'numpy.asarray', 'np.asarray', (['arr'], {}), '(arr)\n', (370, 375), True, 'import numpy as np\n'), ((526, 553), 'os.listdir', 'os.listdir', (["('./' + dir_name)"], {}), "('./' + dir_name)\n", (536, 553), False, 'import os\n'), ((641, 657), 'PIL.Image.open', 'Image.open', (['path'], {}), '(path)\n', (651,... |
#! /usr/bin/env python
"""
Module with utility functions to the nested sampling for parameter estimation.
"""
__author__ = '<NAME>'
__all__ = ['un_burning']
import numpy as np
def un_burning(res, logger=None):
"""
Automatic burning of UltraNest chain based on cumulated sum of weights
(as implemented in... | [
"numpy.cumsum",
"numpy.array"
] | [((851, 894), 'numpy.array', 'np.array', (["res['weighted_samples']['points']"], {}), "(res['weighted_samples']['points'])\n", (859, 894), True, 'import numpy as np\n'), ((909, 953), 'numpy.array', 'np.array', (["res['weighted_samples']['weights']"], {}), "(res['weighted_samples']['weights'])\n", (917, 953), True, 'imp... |
import numpy as np
import matplotlib.pyplot as plt
la = np.linalg
words = ['I', 'like', 'enjoy', 'deep', 'learning', 'NLP', 'flying', '.']
X = np.array([[0,2,1,0,0,0,0,0],
[2,0,0,1,0,1,0,0],
[1,0,0,0,0,0,1,0],
[0,1,0,0,1,0,0,0],
[0,0,0,1,0,0,0,1],
[... | [
"matplotlib.pyplot.text",
"numpy.array",
"matplotlib.pyplot.show"
] | [((144, 371), 'numpy.array', 'np.array', (['[[0, 2, 1, 0, 0, 0, 0, 0], [2, 0, 0, 1, 0, 1, 0, 0], [1, 0, 0, 0, 0, 0, 1, \n 0], [0, 1, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 1], [0, 1, 0, 0, 0,\n 0, 0, 1], [0, 0, 1, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 1, 1, 0]]'], {}), '([[0, 2, 1, 0, 0, 0, 0, 0], [2, 0, 0, 1, 0, 1, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.