code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import functools
import itertools
import numpy as np
import pandas as pd
import pytest
from sid.events import calculate_infections_by_events
def event_infect_n(states, params, seed, i): # noqa: U100
s = pd.Series(index=states.index, data=False)
s.iloc[i] = True
return s
@pytest.mark.integration
def t... | [
"functools.partial",
"numpy.ones",
"pandas.Series",
"itertools.count"
] | [((211, 252), 'pandas.Series', 'pd.Series', ([], {'index': 'states.index', 'data': '(False)'}), '(index=states.index, data=False)\n', (220, 252), True, 'import pandas as pd\n'), ((1240, 1300), 'pandas.Series', 'pd.Series', ([], {'data': '(-1)', 'index': 'initial_states.index', 'dtype': '"""int8"""'}), "(data=-1, index=... |
from IMLearn.learners.regressors import PolynomialFitting
from IMLearn.utils import split_train_test
import numpy as np
import pandas as pd
import plotly.express as px
import plotly.io as pio
pio.templates.default = "simple_white"
def load_data(filename: str) -> pd.DataFrame:
"""
Load city daily temperature... | [
"numpy.random.seed",
"pandas.read_csv",
"plotly.express.line",
"IMLearn.learners.regressors.PolynomialFitting",
"plotly.express.bar",
"IMLearn.utils.split_train_test",
"pandas.to_datetime",
"plotly.express.scatter"
] | [((950, 967), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (964, 967), True, 'import numpy as np\n'), ((1385, 1492), 'plotly.express.scatter', 'px.scatter', (['israel_data'], {'x': '"""DayOfYear"""', 'y': '"""Temp"""', 'color': '"""Year"""', 'title': '"""Temperature By The Day of Year"""'}), "(israel_... |
import numpy as np
def crd2grid(y, x):
ux, indX0, indX = np.unique(x, return_index=True, return_inverse=True)
uy, indY0, indY = np.unique(y, return_index=True, return_inverse=True)
minDx = np.min(ux[1:] - ux[0:-1])
minDy = np.min(uy[1:] - uy[0:-1])
maxDx = np.max(ux[1:] - ux[0:-1])
maxDy = np... | [
"numpy.full",
"numpy.min",
"numpy.max",
"numpy.unique"
] | [((63, 115), 'numpy.unique', 'np.unique', (['x'], {'return_index': '(True)', 'return_inverse': '(True)'}), '(x, return_index=True, return_inverse=True)\n', (72, 115), True, 'import numpy as np\n'), ((138, 190), 'numpy.unique', 'np.unique', (['y'], {'return_index': '(True)', 'return_inverse': '(True)'}), '(y, return_ind... |
'''
Created on 29.09.2017
@author: lemmerfn
'''
from collections import namedtuple
from functools import total_ordering
import numpy as np
import scipy.stats
import pysubgroup as ps
from pysubgroup.subgroup_description import EqualitySelector
@total_ordering
class BinaryTarget:
statistic_types = ('size_sg', '... | [
"numpy.divide",
"numpy.count_nonzero",
"numpy.sum",
"pysubgroup.subgroup_description.EqualitySelector",
"pysubgroup.effective_sample_size",
"collections.namedtuple"
] | [((3914, 3982), 'collections.namedtuple', 'namedtuple', (['"""PositivesQF_parameters"""', "('size_sg', 'positives_count')"], {}), "('PositivesQF_parameters', ('size_sg', 'positives_count'))\n", (3924, 3982), False, 'from collections import namedtuple\n'), ((2004, 2021), 'numpy.sum', 'np.sum', (['positives'], {}), '(pos... |
import numpy as np
import os
import argparse
from collections import Counter
from datetime import datetime
import tensorflow as tf
import json
from get_available_gpu import mask_unused_gpus
from scipy.stats import entropy
import random
from mha import MultiHeadedAttention
from models import HierarchicalLSTM
import csv
... | [
"get_available_gpu.mask_unused_gpus",
"numpy.set_printoptions",
"numpy.zeros_like",
"argparse.ArgumentParser",
"csv.reader",
"tensorflow.global_variables_initializer",
"scipy.stats.entropy",
"tensorflow.Session",
"tensorflow.set_random_seed",
"numpy.mean",
"numpy.array",
"models.HierarchicalLS... | [((322, 354), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(3)'}), '(precision=3)\n', (341, 354), True, 'import numpy as np\n'), ((355, 376), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(0)'], {}), '(0)\n', (373, 376), True, 'import tensorflow as tf\n'), ((1522, 1544), 'numpy.zeros_li... |
""" Base class for drawing the soccer/ football pitch."""
import warnings
from abc import ABC, abstractmethod
from collections import namedtuple
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import rcParams
from mplsoccer import dimensions
from mplsoccer.cm import grass_cmap
from mplsoccer.utils... | [
"mplsoccer.cm.grass_cmap",
"numpy.arctan",
"numpy.abs",
"mplsoccer.utils.set_visible",
"mplsoccer.utils.Standardizer",
"mplsoccer.dimensions.create_pitch_dims",
"numpy.insert",
"matplotlib.pyplot.figure",
"numpy.array",
"collections.namedtuple",
"numpy.tile",
"numpy.random.normal",
"warnings... | [((380, 466), 'collections.namedtuple', 'namedtuple', (['"""BinnedStatisticResult"""', "('statistic', 'x_grid', 'y_grid', 'cx', 'cy')"], {}), "('BinnedStatisticResult', ('statistic', 'x_grid', 'y_grid', 'cx',\n 'cy'))\n", (390, 466), False, 'from collections import namedtuple\n'), ((8611, 8718), 'mplsoccer.utils.Sta... |
import io
import json
import os
import struct
import large_image_source_tiff
import numpy
import pytest
import tifftools
from large_image import constants
from . import utilities
from .datastore import datastore
def nestedUpdate(value, nvalue):
if not isinstance(value, dict) or not isinstance(nvalue, dict):
... | [
"io.BytesIO",
"os.path.join",
"os.unlink",
"os.path.realpath",
"struct.unpack",
"large_image_source_tiff.canRead",
"json.dumps",
"numpy.any",
"pytest.raises",
"tifftools.read_tiff",
"pytest.mark.parametrize",
"pytest.approx",
"large_image_source_tiff.open",
"numpy.all"
] | [((14445, 15374), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""badParams,errMessage"""', "[({'encoding': 'invalid', 'width': 10}, 'Invalid encoding'), ({'output': {\n 'maxWidth': 'invalid'}}, 'ValueError'), ({'output': {'maxWidth': -5}},\n 'Invalid output width or height'), ({'output': {'maxWidth':... |
# -*- coding: utf-8 -*-
from __future__ import annotations
from abc import ABCMeta, abstractmethod
from typing import NoReturn, List, Dict, Any, Tuple, Union
from functools import reduce
from collections.abc import Iterable
from sqlalchemy import create_engine, select
from sqlalchemy.orm import Session
from sqlalchemy... | [
"sqlalchemy.sql.functions.max",
"sqlalchemy.select",
"numpy.asarray",
"sqlalchemy.orm.Session",
"sqlalchemy.create_engine"
] | [((1503, 1542), 'sqlalchemy.create_engine', 'create_engine', (['(self._BASE_URL % db_path)'], {}), '(self._BASE_URL % db_path)\n', (1516, 1542), False, 'from sqlalchemy import create_engine, select\n'), ((1823, 1857), 'sqlalchemy.orm.Session', 'Session', (['self._engine'], {'future': '(True)'}), '(self._engine, future=... |
import numpy as np
from matplotlib import pyplot as plt
import cv2
import copy
import keras
import tensorflow as tf
import os
from random import shuffle
from tqdm import tqdm
from keras.models import load_model
import shutil
#IF WINDOWS OS THEN USE tkinter
from tkinter import filedialog
from tkinter import *
#Impo... | [
"keras.models.load_model",
"os.mkdir",
"numpy.argmax",
"os.path.exists",
"tkinter.filedialog.askdirectory",
"cv2.imread",
"numpy.array",
"os.path.join",
"os.listdir",
"cv2.resize"
] | [((337, 379), 'keras.models.load_model', 'load_model', (['"""./keras model/septinmodel.h5"""'], {}), "('./keras model/septinmodel.h5')\n", (347, 379), False, 'from keras.models import load_model\n'), ((410, 435), 'tkinter.filedialog.askdirectory', 'filedialog.askdirectory', ([], {}), '()\n', (433, 435), False, 'from tk... |
#!/usr/bin/env python
#python imports
import rospy
import numpy as np
import math
#action lib
import actionlib
from actionlib_msgs.msg import GoalStatus
# ros imports
from geometry_msgs.msg import Pose, Point, Quaternion, PoseStamped, Wrench
from nav_msgs.msg import OccupancyGrid, Odometry, Path
from nav_msgs.srv im... | [
"geometry_msgs.msg.Wrench",
"rospy.Subscriber",
"numpy.arctan2",
"los_controller.los_controller.LOSControllerPID",
"rospy.Publisher",
"rospy.spin",
"PID.PIDregulator.PIDRegulator",
"tf.transformations.euler_from_quaternion",
"rospy.get_time",
"numpy.sin",
"numpy.array",
"geometry_msgs.msg.Poin... | [((802, 842), 'rospy.init_node', 'rospy.init_node', (['"""inspect_unknown_point"""'], {}), "('inspect_unknown_point')\n", (817, 842), False, 'import rospy\n'), ((1060, 1067), 'geometry_msgs.msg.Point', 'Point', ([], {}), '()\n', (1065, 1067), False, 'from geometry_msgs.msg import Pose, Point, Quaternion, PoseStamped, W... |
'''
Create a model of the grey level around each landmark. The goal is to produce a
measure in the search for new model points.
In the training stage, a gray level profile vector of length 2k+1 is made for
each landmark. Instead of using actual grey levels, normalised derivatives are
used. The Mahalanobis distance is u... | [
"glm.profile.Profiler",
"numpy.zeros",
"numpy.split",
"numpy.linalg.inv",
"numpy.cov"
] | [((998, 1011), 'glm.profile.Profiler', 'Profiler', ([], {'k': 'k'}), '(k=k)\n', (1006, 1011), False, 'from glm.profile import Profiler\n'), ((1262, 1300), 'numpy.zeros', 'np.zeros', (['(landmark_count, 2 * self.k)'], {}), '((landmark_count, 2 * self.k))\n', (1270, 1300), True, 'import numpy as np\n'), ((1325, 1375), 'n... |
import copy
import math
from typing import Any, Dict, Iterable
import numpy as numpy
from gym.envs.box2d.lunar_lander import (
FPS,
LunarLander as GymLunarLander,
SCALE,
MAIN_ENGINE_POWER,
LEG_DOWN,
SIDE_ENGINE_POWER,
SIDE_ENGINE_AWAY,
SIDE_ENGINE_HEIGHT,
VIEWPORT_H,
VIEWPORT_W,... | [
"Box2D.b2.edgeShape",
"plangym.box_2d.serialization.set_env_state",
"Box2D.b2.polygonShape",
"numpy.abs",
"Box2D.b2.revoluteJointDef",
"copy.copy",
"numpy.ones",
"Box2D.b2.contactListener.__init__",
"math.sin",
"numpy.sign",
"numpy.clip",
"numpy.array",
"math.cos",
"plangym.box_2d.serializ... | [((2445, 2475), 'Box2D.b2.contactListener.__init__', 'contactListener.__init__', (['self'], {}), '(self)\n', (2469, 2475), False, 'from Box2D.b2 import edgeShape, circleShape, fixtureDef, polygonShape, revoluteJointDef, contactListener\n'), ((13162, 13202), 'numpy.array', 'numpy.array', (['(state, None)'], {'dtype': 'o... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
'''
Miscellaneous algorithms for 2D contours and 3D triangularized meshes handling
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.... | [
"scipy.spatial.distance.euclidean",
"numpy.sin",
"tvtk.api.tvtk.PolyDataReader",
"numpy.array",
"numpy.arccos"
] | [((2183, 2206), 'numpy.arccos', 'np.arccos', (['(prod / ABxAC)'], {}), '(prod / ABxAC)\n', (2192, 2206), True, 'import numpy as np\n'), ((2361, 2412), 'tvtk.api.tvtk.PolyDataReader', 'tvtk.PolyDataReader', ([], {'file_name': 'self.inputs.surface1'}), '(file_name=self.inputs.surface1)\n', (2380, 2412), False, 'from tvtk... |
import matplotlib.pyplot as plt
from matplotlib.legend import Legend
import seaborn as sns
import numpy as np
import json
import geopandas as gpd
import rasterio as rio
from rasterio.mask import mask
import numpy as np
from rasterio.plot import adjust_band
from rasterio.plot import reshape_as_raster, reshape_as_image
f... | [
"matplotlib.pyplot.title",
"numpy.zeros_like",
"matplotlib.pyplot.show",
"seaborn.heatmap",
"warnings.simplefilter",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.style.use",
"numpy.mean",
"warnings.catch_warnings",
"numpy.triu_indices_from",
"matplotlib.pyplot.tight_layout"
] | [((722, 751), 'numpy.mean', 'np.mean', (['train_scores'], {'axis': '(1)'}), '(train_scores, axis=1)\n', (729, 751), True, 'import numpy as np\n'), ((837, 865), 'numpy.mean', 'np.mean', (['test_scores'], {'axis': '(1)'}), '(test_scores, axis=1)\n', (844, 865), True, 'import numpy as np\n'), ((1181, 1199), 'matplotlib.py... |
import sys
import numpy as np
import sys
from keras.layers.convolutional import *
from keras import initializers
import random
import tensorflow as tf
from keras import regularizers
from keras.callbacks import EarlyStopping
from keras.callbacks import ModelCheckpoint
import pickle
from keras import backend
from keras... | [
"keras.regularizers.l2",
"numpy.load",
"keras.layers.Activation",
"keras.layers.Dropout",
"keras.optimizers.Adam",
"keras.models.Input",
"keras.models.Model",
"keras.layers.Dense",
"numpy.array",
"keras.layers.normalization.BatchNormalization"
] | [((1005, 1038), 'keras.models.Input', 'Input', ([], {'shape': '(None, num_features)'}), '(shape=(None, num_features))\n', (1010, 1038), False, 'from keras.models import Model, Input\n'), ((8064, 8091), 'numpy.load', 'np.load', (['"""min_data.txt.npy"""'], {}), "('min_data.txt.npy')\n", (8071, 8091), True, 'import numpy... |
import numpy as np
import pickle as pkl
import networkx as nx
import scipy.sparse as sp
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.colors import colorConverter as cc
from scipy.sparse.linalg.eigen.arpack import eigsh
import sys
import torch
def count_params(model):
return... | [
"numpy.argmax",
"numpy.ones",
"pickle.load",
"matplotlib.pyplot.fill_between",
"scipy.sparse.eye",
"matplotlib.patches.Rectangle",
"numpy.power",
"scipy.sparse.diags",
"numpy.isinf",
"numpy.sort",
"scipy.sparse.csr_matrix",
"torch.Size",
"numpy.vstack",
"torch.from_numpy",
"networkx.from... | [((998, 1059), 'scipy.sparse.csr_matrix', 'sp.csr_matrix', (['idx_features_labels[:, 1:-1]'], {'dtype': 'np.float32'}), '(idx_features_labels[:, 1:-1], dtype=np.float32)\n', (1011, 1059), True, 'import scipy.sparse as sp\n'), ((1144, 1195), 'numpy.array', 'np.array', (['idx_features_labels[:, 0]'], {'dtype': 'np.int32'... |
# -*- coding: utf-8 -*-
# Copyright 2020 The PsiZ Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | [
"numpy.testing.assert_array_equal",
"psiz.trials.similarity.similarity_trials.SimilarityTrials._split_groups_columns",
"numpy.zeros",
"numpy.ones"
] | [((902, 924), 'numpy.zeros', 'np.zeros', (['[n_trial, 1]'], {}), '([n_trial, 1])\n', (910, 924), True, 'import numpy as np\n'), ((940, 986), 'psiz.trials.similarity.similarity_trials.SimilarityTrials._split_groups_columns', 'SimilarityTrials._split_groups_columns', (['groups'], {}), '(groups)\n', (978, 986), False, 'fr... |
import unittest
import matplotlib.pyplot as plt
import numpy as np
from ssmtoybox.ssmod import UNGMTransition, UNGMMeasurement, UNGMNATransition, UNGMNAMeasurement, \
ConstantTurnRateSpeed, Radar2DMeasurement, ReentryVehicle2DTransition
from ssmtoybox.utils import GaussRV
def default_bq_hypers(dyn, obs):
hy... | [
"ssmtoybox.ssmod.ConstantTurnRateSpeed",
"ssmtoybox.utils.GaussRV",
"matplotlib.pyplot.show",
"numpy.eye",
"matplotlib.pyplot.plot",
"numpy.random.randn",
"ssmtoybox.ssmod.UNGMNATransition",
"ssmtoybox.ssmod.ReentryVehicle2DTransition",
"numpy.ones",
"matplotlib.pyplot.figure",
"ssmtoybox.ssmod.... | [((729, 741), 'ssmtoybox.utils.GaussRV', 'GaussRV', (['dim'], {}), '(dim)\n', (736, 741), False, 'from ssmtoybox.utils import GaussRV\n'), ((820, 857), 'ssmtoybox.ssmod.UNGMTransition', 'UNGMTransition', (['init_dist', 'noise_dist'], {}), '(init_dist, noise_dist)\n', (834, 857), False, 'from ssmtoybox.ssmod import UNGM... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 25 14:17:02 2021
@author: ariasvts
"""
import numpy as np
from scipy import signal
def get_formants(sig,fs,meth='AC',nform=3,lpcEnv=False,pre_emph=True,alpha=0.97):
"""
Compute formants by solving for the roots of A(z)=0, where
A(z) is the predi... | [
"numpy.roots",
"numpy.abs",
"numpy.asarray",
"numpy.zeros",
"numpy.float",
"numpy.hstack",
"numpy.argsort",
"numpy.append",
"numpy.insert",
"numpy.imag",
"numpy.squeeze",
"numpy.dot",
"scipy.signal.freqz",
"numpy.linalg.solve"
] | [((1769, 1788), 'numpy.roots', 'np.roots', (['lpc_coeff'], {}), '(lpc_coeff)\n', (1777, 1788), True, 'import numpy as np\n'), ((2028, 2044), 'numpy.argsort', 'np.argsort', (['frqs'], {}), '(frqs)\n', (2038, 2044), True, 'import numpy as np\n'), ((2114, 2129), 'numpy.asarray', 'np.asarray', (['rts'], {}), '(rts)\n', (21... |
import matplotlib.pyplot as plt
import numpy as np
from math import factorial
fig, axs = plt.subplots(2, 2, sharey=True)
axs = axs.flatten()
colors = ['r', 'b', 'g', 'k']
for j, problem_size in enumerate([6, 7, 8, 9]):
nb_solutions_file = open(f'./nb_solutions_for_size_{problem_size}.csv', 'r')
measures_file ... | [
"numpy.zeros_like",
"numpy.ptp",
"numpy.std",
"math.factorial",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.subplots"
] | [((90, 121), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)', '(2)'], {'sharey': '(True)'}), '(2, 2, sharey=True)\n', (102, 121), True, 'import matplotlib.pyplot as plt\n'), ((1155, 1243), 'matplotlib.pyplot.tick_params', 'plt.tick_params', ([], {'labelcolor': '"""none"""', 'top': '(False)', 'bottom': '(False)', ... |
from pyjamas_core import Supermodel
from pyjamas_core.util import Input, Output, Property
import numpy as np
import json
# define the model class and inherit from class "Supermodel"
class Model(Supermodel):
# model constructor
def __init__(self, id, name: str):
# instantiate supermodel
super(Mo... | [
"json.loads",
"pyjamas_core.util.Property",
"pyjamas_core.util.Output",
"json.dumps",
"pyjamas_core.util.Input",
"numpy.repeat"
] | [((2211, 2231), 'json.dumps', 'json.dumps', (['distnets'], {}), '(distnets)\n', (2221, 2231), False, 'import json\n'), ((2369, 2392), 'json.dumps', 'json.dumps', (['costs_const'], {}), '(costs_const)\n', (2379, 2392), False, 'import json\n'), ((409, 484), 'pyjamas_core.util.Input', 'Input', ([], {'name': '"""distributi... |
import numpy as np
import pandas as pd
from lib.helper import colnames
train = np.load('data/train.npy',allow_pickle=True).item()
test = np.load('data/test.npy',allow_pickle=True).item()
sample_submission = np.load('data/sample_submission.npy',allow_pickle=True).item()
def make_df(raw_data, add_annotations = True):
... | [
"pandas.DataFrame",
"numpy.load"
] | [((982, 1016), 'pandas.DataFrame', 'pd.DataFrame', (['df'], {'columns': 'colnames'}), '(df, columns=colnames)\n', (994, 1016), True, 'import pandas as pd\n'), ((80, 124), 'numpy.load', 'np.load', (['"""data/train.npy"""'], {'allow_pickle': '(True)'}), "('data/train.npy', allow_pickle=True)\n", (87, 124), True, 'import ... |
import numpy as np
import scipy.special as ss
def cartToSph(x,y,z):
'''
[r, theta, phi] = cartToSph(x, y, z) converts the cartesian
coordinate system to the spherical coordinate system according to
the following definition:
r distance from the origin to the point in th... | [
"numpy.arctan2",
"numpy.sin",
"scipy.special.lpmn",
"numpy.cos",
"numpy.sqrt"
] | [((633, 666), 'numpy.sqrt', 'np.sqrt', (['(x ** 2 + y ** 2 + z ** 2)'], {}), '(x ** 2 + y ** 2 + z ** 2)\n', (640, 666), True, 'import numpy as np\n'), ((721, 737), 'numpy.arctan2', 'np.arctan2', (['y', 'x'], {}), '(y, x)\n', (731, 737), True, 'import numpy as np\n'), ((2166, 2199), 'numpy.sqrt', 'np.sqrt', (['(x ** 2 ... |
import numpy as np
from sklearn.cluster import MeanShift, estimate_bandwidth, AgglomerativeClustering
from sklearn.preprocessing import MultiLabelBinarizer
from sklearn.metrics import adjusted_rand_score
class Clustering(object):
def __init__(self, vectors, ground_truth=None, num_classes=5):
self.nodes =... | [
"numpy.sum",
"numpy.ix_",
"sklearn.preprocessing.MultiLabelBinarizer",
"sklearn.cluster.AgglomerativeClustering",
"numpy.matmul",
"sklearn.metrics.adjusted_rand_score",
"numpy.unique"
] | [((2632, 2671), 'sklearn.preprocessing.MultiLabelBinarizer', 'MultiLabelBinarizer', ([], {'sparse_output': '(True)'}), '(sparse_output=True)\n', (2651, 2671), False, 'from sklearn.preprocessing import MultiLabelBinarizer\n'), ((1300, 1352), 'sklearn.cluster.AgglomerativeClustering', 'AgglomerativeClustering', ([], {'n_... |
# -*- coding: utf-8 -*-
"""
:mod:`ganground.data.toysets` -- 2D synthetic toy datasets
=============================================================
.. module:: toysets
:platform: Unix
:synopsis: Synthetic datasets for interpretable experimentation
Collection of 2D datasets used primarily for benchmarking of
ge... | [
"numpy.random.uniform",
"numpy.random.shuffle",
"numpy.ones_like",
"numpy.random.randn",
"numpy.sin",
"numpy.array",
"numpy.cos",
"numpy.random.choice",
"numpy.sqrt",
"numpy.concatenate",
"torch.from_numpy"
] | [((772, 801), 'numpy.random.shuffle', 'numpy.random.shuffle', (['dataset'], {}), '(dataset)\n', (792, 801), False, 'import numpy\n'), ((1306, 1326), 'numpy.array', 'numpy.array', (['dataset'], {}), '(dataset)\n', (1317, 1326), False, 'import numpy\n'), ((2149, 2169), 'numpy.array', 'numpy.array', (['dataset'], {}), '(d... |
from scipy.interpolate import RegularGridInterpolator
import numpy as np
from sidmpy.Solver.solution_interp.tchannel_solution_1 import *
from sidmpy.Solver.solution_interp.tchannel_solution_2 import *
cross_section_normalization_tchannel = np.arange(1, 51, 1)
redshifts_tchannel = [0, 0.2, 0.4, 0.6, 0.8, 1., 1.2, 1.4, ... | [
"numpy.stack",
"numpy.log10",
"numpy.arange",
"scipy.interpolate.RegularGridInterpolator"
] | [((241, 260), 'numpy.arange', 'np.arange', (['(1)', '(51)', '(1)'], {}), '(1, 51, 1)\n', (250, 260), True, 'import numpy as np\n'), ((473, 498), 'numpy.arange', 'np.arange', (['(6)', '(10.25)', '(0.25)'], {}), '(6, 10.25, 0.25)\n', (482, 498), True, 'import numpy as np\n'), ((646, 961), 'numpy.stack', 'np.stack', (['(l... |
'''
Created on May 21, 2015
This module contains different basis function implementations.
@author: <NAME> (<EMAIL>)
'''
import numpy as np
def polynomialBasisFunctionSingleVariable( degree ):
'''
@deprecated: Use get1DPolynomialBasisFunction.
Construct a single variable polynomial basis function.
... | [
"numpy.random.uniform",
"numpy.outer",
"numpy.power",
"numpy.floor",
"numpy.zeros",
"numpy.min",
"numpy.max",
"numpy.array",
"numpy.where",
"numpy.all"
] | [((5645, 5659), 'numpy.min', 'np.min', (['domain'], {}), '(domain)\n', (5651, 5659), True, 'import numpy as np\n'), ((5673, 5687), 'numpy.max', 'np.max', (['domain'], {}), '(domain)\n', (5679, 5687), True, 'import numpy as np\n'), ((11356, 11374), 'numpy.array', 'np.array', (['tileSize'], {}), '(tileSize)\n', (11364, 1... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"numpy.abs",
"numpy.sin",
"numpy.arange"
] | [((2635, 2663), 'numpy.sin', 'np.sin', (['(2 * np.pi * 1000 * t)'], {}), '(2 * np.pi * 1000 * t)\n', (2641, 2663), True, 'import numpy as np\n'), ((2593, 2618), 'numpy.arange', 'np.arange', (['(16000.0 * 0.03)'], {}), '(16000.0 * 0.03)\n', (2602, 2618), True, 'import numpy as np\n'), ((1027, 1036), 'numpy.abs', 'np.abs... |
import math
import os
import librosa
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import mlab
from analyser.common import signal as ms
from analyser.common.signal import Signal
class HandlerTestCase(object):
def resam(self):
measurementPath = os.path.join(os.path.dirname(__file__),... | [
"numpy.abs",
"numpy.iinfo",
"librosa.resample",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"librosa.core.cqt",
"os.path.dirname",
"numpy.max",
"librosa.amplitude_to_db",
"matplotlib.pyplot.semilogy",
"scipy.signal.butter",
"matplotlib.pyplot.show",
"matplotlib.pyplot.get_c... | [((372, 409), 'analyser.common.signal.loadSignalFromWav', 'ms.loadSignalFromWav', (['measurementPath'], {}), '(measurementPath)\n', (392, 409), True, 'from analyser.common import signal as ms\n'), ((427, 515), 'librosa.resample', 'librosa.resample', (['measurement.samples', 'measurement.fs', '(1000)'], {'res_type': '""... |
import numpy as np;
import os;
import matplotlib.pyplot as plt;
import matplotlib.colors as mcolors;
from astropy.stats import sigma_clipped_stats;
from astropy.io import fits as pyfits;
from astropy.modeling import models, fitting;
from skimage.feature import register_translation;
from scipy import fftpack;
from s... | [
"numpy.sum",
"numpy.empty",
"astropy.io.fits.PrimaryHDU",
"numpy.mean",
"numpy.arange",
"astropy.io.fits.HDUList",
"astropy.io.fits.ImageHDU",
"matplotlib.pyplot.close",
"astropy.io.fits.getdata",
"numpy.isfinite",
"scipy.signal.medfilt",
"numpy.append",
"matplotlib.pyplot.subplots",
"nump... | [((1381, 1404), 'numpy.arange', 'np.arange', (['(6)', '(b0 - 6)', '(3)'], {}), '(6, b0 - 6, 3)\n', (1390, 1404), True, 'import numpy as np\n'), ((1548, 1566), 'numpy.array', 'np.array', (['tri_list'], {}), '(tri_list)\n', (1556, 1566), True, 'import numpy as np\n'), ((8232, 8244), 'numpy.array', 'np.array', (['C0'], {}... |
import scipy.stats as stats
import pandas as pd
import numpy as np
import itertools as it
import networkx as nx
import math
import pygame
class GenerateDiffPartitiedTrees():
def __init__(self, gridLengthX, gridLengthY):
self.gridLength = {'x': gridLengthX, 'y': gridLengthY}
def __call__(self, tree):
... | [
"numpy.abs",
"pandas.read_csv",
"networkx.write_gpickle",
"numpy.arange",
"numpy.exp",
"numpy.diag",
"scipy.stats.multivariate_normal.logpdf",
"pandas.DataFrame",
"numpy.power",
"itertools.product",
"itertools.chain",
"pandas.concat",
"numpy.random.shuffle",
"pygame.time.wait",
"numpy.mi... | [((7577, 7608), 'numpy.power', 'np.power', (['featureStdVarinces', '(2)'], {}), '(featureStdVarinces, 2)\n', (7585, 7608), True, 'import numpy as np\n'), ((7619, 7653), 'numpy.diag', 'np.diag', (['featureVarinces.values[0]'], {}), '(featureVarinces.values[0])\n', (7626, 7653), True, 'import numpy as np\n'), ((7665, 773... |
#Importando bibliotecas
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import yfinance as yf
import datetime as dt
#np.set_printoptions(threshold=13)
plt.style.use('ggplot')
#Importando dados das empresas
tickers = 'PETR3.SA MGLU3.SA ITSA4.SA RDOR3.SA LCAM3.SA BTCR11.SA CSAN3.SA SMFT3.SA ARZ... | [
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"numpy.sum",
"yfinance.download",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yticks",
"datetime.datetime",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.f... | [((176, 199), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (189, 199), True, 'import matplotlib.pyplot as plt\n'), ((371, 394), 'datetime.datetime', 'dt.datetime', (['(2019)', '(1)', '(1)'], {}), '(2019, 1, 1)\n', (382, 394), True, 'import datetime as dt\n'), ((401, 426), 'dat... |
import torch
import torchvision.transforms as transforms
import numpy as np
import cv2
import logging
from .inception_resnet_v1 import InceptionResnetV1
class FaceExtractor(object):
def __init__(self, use_cuda=True):
self.net = InceptionResnetV1(pretrained="vggface2").eval()
self.device = "cuda" i... | [
"numpy.asarray",
"cv2.imread",
"numpy.linalg.norm",
"torch.cuda.is_available",
"numpy.dot",
"torchvision.transforms.Normalize",
"torch.no_grad",
"torchvision.transforms.ToTensor"
] | [((1477, 1520), 'cv2.imread', 'cv2.imread', (['"""./pictures/margo2_cropped.jpg"""'], {}), "('./pictures/margo2_cropped.jpg')\n", (1487, 1520), False, 'import cv2\n'), ((1545, 1588), 'cv2.imread', 'cv2.imread', (['"""./pictures/margo1_cropped.jpg"""'], {}), "('./pictures/margo1_cropped.jpg')\n", (1555, 1588), False, 'i... |
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 18 15:19:31 2015
@author: Ben
"""
import clearplot.plot_functions as pf
import numpy as np
x = np.array([33.0, 4.0, 1.0, 1.0/7.0, 1.0/10.0, 1.0/25.0, 1.0/60.0, \
1.0/120.0, 1.0/439.0, 1.0/645.0])
y = 4.0 * x**0.5
pf.plot('log_log_plot.png', x, y, \
x_label = ['... | [
"numpy.array",
"clearplot.plot_functions.plot"
] | [((144, 261), 'numpy.array', 'np.array', (['[33.0, 4.0, 1.0, 1.0 / 7.0, 1.0 / 10.0, 1.0 / 25.0, 1.0 / 60.0, 1.0 / 120.0,\n 1.0 / 439.0, 1.0 / 645.0]'], {}), '([33.0, 4.0, 1.0, 1.0 / 7.0, 1.0 / 10.0, 1.0 / 25.0, 1.0 / 60.0, \n 1.0 / 120.0, 1.0 / 439.0, 1.0 / 645.0])\n', (152, 261), True, 'import numpy as np\n'), (... |
import numpy as np
from numpy import load
import tensorflow as tf
from numpy.random import randint
from numpy import zeros, ones
from scipy.signal import savgol_filter
from scipy.signal import butter, filtfilt
from scipy.ndimage import gaussian_filter1d
# generate points in latent space as input for the generator
de... | [
"numpy.random.randint",
"numpy.zeros",
"numpy.ones"
] | [((837, 858), 'numpy.zeros', 'zeros', (['(n_samples, 1)'], {}), '((n_samples, 1))\n', (842, 858), False, 'from numpy import zeros, ones\n'), ((981, 1019), 'numpy.random.randint', 'randint', (['(0)', 'images.shape[0]', 'n_samples'], {}), '(0, images.shape[0], n_samples)\n', (988, 1019), False, 'from numpy.random import ... |
from copy import deepcopy
from typing import List, Tuple
import numpy as np
def truncate_outliers(data: np.ndarray, *,
bounds: List[Tuple[float, float]] = None,
sd=0,
replacement='mean',
inplace=False): # pragma: no cover
""... | [
"numpy.median",
"copy.deepcopy",
"numpy.mean"
] | [((1911, 1925), 'copy.deepcopy', 'deepcopy', (['data'], {}), '(data)\n', (1919, 1925), False, 'from copy import deepcopy\n'), ((2824, 2834), 'numpy.mean', 'np.mean', (['b'], {}), '(b)\n', (2831, 2834), True, 'import numpy as np\n'), ((3011, 3034), 'numpy.median', 'np.median', (['data[..., n]'], {}), '(data[..., n])\n',... |
import tensorflow as tf
import gated_shape_cnn.training.dataset as dataset
import numpy as np
import random
import tempfile
import uuid
import imageio
import os
from pathlib import Path
from test.utils import *
np.random.seed(1)
tf.random.set_seed(1)
tf.config.set_visible_devices([], 'GPU')
class TestDataset(tf.te... | [
"tensorflow.random.set_seed",
"os.remove",
"uuid.uuid4",
"numpy.random.seed",
"random.randint",
"tensorflow.config.set_visible_devices",
"tempfile.gettempdir",
"numpy.random.randint",
"gated_shape_cnn.training.dataset.Dataset",
"imageio.imsave"
] | [((214, 231), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (228, 231), True, 'import numpy as np\n'), ((232, 253), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(1)'], {}), '(1)\n', (250, 253), True, 'import tensorflow as tf\n'), ((254, 294), 'tensorflow.config.set_visible_devices', 'tf.confi... |
## Inversion 101/201, as part of Geodynamics 101
# by <NAME>, 2018
# The most useful Python packages ever made!
import matplotlib.mlab as mlab
import numpy as np
import matplotlib.pyplot as plt
# Our linear 1D forward model for bread
def flourToBreadRelationship(flour):
bread = (800.0 / 500.0) * flour
return... | [
"matplotlib.pyplot.xlim",
"numpy.meshgrid",
"matplotlib.pyplot.show",
"numpy.abs",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.legend",
"matplotlib.mlab.normpdf",
"matplotlib.pyplot.colorbar",
"numpy.max",
"numpy.min",
"numpy.arange",
... | [((1395, 1418), 'numpy.arange', 'np.arange', (['(0)', '(700)', '(0.01)'], {}), '(0, 700, 0.01)\n', (1404, 1418), True, 'import numpy as np\n'), ((1610, 1646), 'matplotlib.pyplot.plot', 'plt.plot', (['[0, 700]', '[500, 500]', '"""--"""'], {}), "([0, 700], [500, 500], '--')\n", (1618, 1646), True, 'import matplotlib.pypl... |
from .longitudinalParameters import LongitudinalParameters
from .steeringConstraints import steeringConstraints
from .accelerationConstraints import accelerationConstraints
import numpy as np
from . import vehicleParameters
# from .vehicleParameters import VehicleParameters, vehicle_params_type
# import numba as nb
# ... | [
"numpy.tan",
"numpy.sin",
"numpy.cos"
] | [((2012, 2024), 'numpy.cos', 'np.cos', (['x[4]'], {}), '(x[4])\n', (2018, 2024), True, 'import numpy as np\n'), ((2043, 2055), 'numpy.sin', 'np.sin', (['x[4]'], {}), '(x[4])\n', (2049, 2055), True, 'import numpy as np\n'), ((2108, 2120), 'numpy.tan', 'np.tan', (['x[2]'], {}), '(x[2])\n', (2114, 2120), True, 'import num... |
"""
Unit test for param - basically just test arg verification
"""
import numpy as np
import pytest
from fourbody import param
def test_differnt_particle_numbers():
"""
Test we get an exception when our arrays contain different particle numbers
"""
x = np.array([[1, 2], [3, 4], [5, 6], [7, 8]])
... | [
"pytest.raises",
"numpy.array",
"fourbody.param._verify_args"
] | [((275, 317), 'numpy.array', 'np.array', (['[[1, 2], [3, 4], [5, 6], [7, 8]]'], {}), '([[1, 2], [3, 4], [5, 6], [7, 8]])\n', (283, 317), True, 'import numpy as np\n'), ((326, 380), 'numpy.array', 'np.array', (['[[2, 2, 3], [3, 4, 4], [5, 6, 5], [7, 8, 6]]'], {}), '([[2, 2, 3], [3, 4, 4], [5, 6, 5], [7, 8, 6]])\n', (334... |
# -*- coding: utf-8 -*-
# Copyright 2019 The Blueoil Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | [
"numpy.copy",
"numpy.argmax",
"numpy.expand_dims",
"numpy.max",
"numpy.squeeze"
] | [((3000, 3023), 'numpy.copy', 'np.copy', (['post_processed'], {}), '(post_processed)\n', (3007, 3023), True, 'import numpy as np\n'), ((5502, 5528), 'numpy.argmax', 'np.argmax', (['results'], {'axis': '(3)'}), '(results, axis=3)\n', (5511, 5528), True, 'import numpy as np\n'), ((5631, 5658), 'numpy.squeeze', 'np.squeez... |
"""Read from and write to S3 buckets."""
import numpy as np
import numpy.ma as ma
import os
import rasterio
import six
import warnings
import boto3
from mapchete.config import validate_values
from mapchete.formats import base
from mapchete.formats.default import gtiff
from mapchete.io.raster import RasterWindowMemory... | [
"numpy.full",
"mapchete.tile.BufferedTile",
"mapchete.log.driver_logger",
"numpy.ma.expand_dims",
"boto3.resource",
"mapchete.config.validate_values",
"warnings.warn"
] | [((429, 457), 'mapchete.log.driver_logger', 'driver_logger', (['"""mapchete_s3"""'], {}), "('mapchete_s3')\n", (442, 457), False, 'from mapchete.log import driver_logger\n'), ((2940, 2976), 'mapchete.tile.BufferedTile', 'BufferedTile', (['tile', 'self.pixelbuffer'], {}), '(tile, self.pixelbuffer)\n', (2952, 2976), Fals... |
import sys
import numpy as np
n = int(sys.stdin.readline().rstrip())
A = []
x = []
y = []
for i in range(n):
a = int(sys.stdin.readline().rstrip())
A.append(a)
if a == 0:
x.append(None)
y.append(None)
continue
xi, yi = np.array([sys.stdin.readline().split() for _... | [
"numpy.count_nonzero",
"sys.stdin.readline"
] | [((44, 64), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (62, 64), False, 'import sys\n'), ((651, 692), 'numpy.count_nonzero', 'np.count_nonzero', (['(comb >> x[i] & 1 ^ y[i])'], {}), '(comb >> x[i] & 1 ^ y[i])\n', (667, 692), True, 'import numpy as np\n'), ((132, 152), 'sys.stdin.readline', 'sys.stdin... |
from neuronmi.mesh.shapes.utils import *
import numpy as np
import unittest
class TestMeshUtils(unittest.TestCase):
def test_find_first(self):
my = find_first(4, range(19))
truth = list(range(19)).index(4)
self.assertTrue(my == truth)
def test_circle_points(self):
n = np.arr... | [
"numpy.dot",
"numpy.linalg.norm",
"numpy.array"
] | [((314, 333), 'numpy.array', 'np.array', (['[1, 1, 1]'], {}), '([1, 1, 1])\n', (322, 333), True, 'import numpy as np\n'), ((378, 397), 'numpy.array', 'np.array', (['[0, 0, 0]'], {}), '([0, 0, 0])\n', (386, 397), True, 'import numpy as np\n'), ((348, 365), 'numpy.linalg.norm', 'np.linalg.norm', (['n'], {}), '(n)\n', (36... |
import json
import sys
sys.dont_write_bytecode = True
import numpy as np
import datetime
import random
import math
import core
def run(debug):
base = "BTC"
base = "ETH"
#base = "LTC"
quote = "USDT"
historymins = 60*24*30*2 #60*24*30*4
interval = 60
dtend = datetime.datetime.strptime('201... | [
"datetime.datetime.strftime",
"core.getPredictions_v1",
"numpy.std",
"core.getPriceExchange_v1",
"random.uniform",
"json.dumps",
"core.createNewScatterTrace",
"core.portfolioBuy",
"datetime.datetime.strptime",
"core.portfolioSell",
"datetime.timedelta",
"core.processPortfolio",
"core.portfol... | [((289, 353), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['"""2018-05-02 15:00"""', '"""%Y-%m-%d %H:%M"""'], {}), "('2018-05-02 15:00', '%Y-%m-%d %H:%M')\n", (315, 353), False, 'import datetime\n'), ((522, 586), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['"""2018-07-26 10:00"""', '"... |
"""
This script takes a pre-trained Spatial Transformer and applies it to an unaligned dataset to create an aligned and
filtered dataset in an unsupervised fashion. By default, this script will only use the similarity transformation
portion of the Spatial Transformer (rotation + crop) to avoid introducing warping artif... | [
"utils.distributed.all_gatherv",
"torch.cat",
"utils.distributed.synchronize",
"torch.no_grad",
"datasets.MultiResolutionDataset",
"os.path.dirname",
"prepare_data.create_dataset",
"utils.distributed.get_world_size",
"applications.determine_flips",
"torch.det",
"applications.base_eval_argparse",... | [((371, 399), 'os.path.dirname', 'os.path.dirname', (['sys.path[0]'], {}), '(sys.path[0])\n', (386, 399), False, 'import os\n'), ((1425, 1486), 'torch.tensor', 'torch.tensor', (['[[[0, 0, 1]]]'], {'dtype': 'torch.float', 'device': 'device'}), '([[[0, 0, 1]]], dtype=torch.float, device=device)\n', (1437, 1486), False, '... |
# From the course: Bayesin Machine Learning in Python: A/B Testing
# https://deeplearningcourses.com/c/bayesian-machine-learning-in-python-ab-testing
# https://www.udemy.com/bayesian-machine-learning-in-python-ab-testing
from __future__ import print_function, division
from builtins import range
# Note: you may need to ... | [
"numpy.random.beta",
"flask.jsonify",
"flask.Flask"
] | [((494, 509), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (499, 509), False, 'from flask import Flask, jsonify, request\n'), ((1302, 1335), 'flask.jsonify', 'jsonify', (["{'advertisement_id': ad}"], {}), "({'advertisement_id': ad})\n", (1309, 1335), False, 'from flask import Flask, jsonify, request\n'),... |
import pathlib as plib
import time
import click
import matplotlib.pyplot as plt
import numpy as np
from util import comparison_plot, plotting_setup, backend_to_label
from pyffs import ffsn_sample, ffsn, _ffsn, next_fast_len
from pyffs.func import dirichlet_2D
from pyffs.backend import AVAILABLE_MOD, get_module_name
@... | [
"matplotlib.pyplot.show",
"pyffs.func.dirichlet_2D",
"util.plotting_setup",
"pyffs.ffsn_sample",
"pyffs.backend.get_module_name",
"numpy.std",
"click.option",
"click.command",
"time.time",
"pathlib.Path",
"numpy.mean",
"numpy.array",
"util.comparison_plot",
"pyffs.next_fast_len",
"matplo... | [((320, 335), 'click.command', 'click.command', ([], {}), '()\n', (333, 335), False, 'import click\n'), ((337, 385), 'click.option', 'click.option', (['"""--n_trials"""'], {'type': 'int', 'default': '(10)'}), "('--n_trials', type=int, default=10)\n", (349, 385), False, 'import click\n'), ((495, 536), 'util.plotting_set... |
from dpm.models import (
LinearRegression, L1Regression,
RidgeRegression, LassoRegression,
LogisticRegression, BayesianLogisticRegression,
SoftmaxRegression, PMF,
GaussianMixtureModel,
GaussianNaiveBayes, BernoulliNaiveBayes, MultinomialNaiveBayes,
LinearDiscriminantAnalysis, QuadraticDiscri... | [
"sklearn.datasets.load_iris",
"torch.randn",
"numpy.random.normal",
"pytest.mark.parametrize",
"dpm.models.SoftmaxRegression",
"dpm.models.LinearDiscriminantAnalysis",
"torch.ones",
"numpy.random.randn",
"dpm.models.GaussianMixtureModel",
"numpy.transpose",
"dpm.models.QuadraticDiscriminantAnaly... | [((896, 947), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""model"""', 'regression_models'], {}), "('model', regression_models)\n", (919, 947), False, 'import pytest\n'), ((1315, 1364), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""model"""', 'logistic_models'], {}), "('model', logistic_mode... |
import PIL.Image
from PIL import ImageTk as itk
import cv2
from tkinter import *
from tkinter import ttk
import os
from keras.preprocessing import image
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import pickle
HEIGHT = 700
WIDTH = 800
categories = ['dyingcell', 'healthycell']
nucleus_a... | [
"data_collection.generate_training_data",
"numpy.amin",
"matplotlib.pyplot.clf",
"keras.preprocessing.image.img_to_array",
"pickle.load",
"os.path.join",
"matplotlib.pyplot.imshow",
"keras.preprocessing.image.load_img",
"matplotlib.pyplot.show",
"numpy.percentile",
"matplotlib.pyplot.ylabel",
... | [((836, 856), 'tkinter.ttk.Notebook', 'ttk.Notebook', (['master'], {}), '(master)\n', (848, 856), False, 'from tkinter import ttk\n'), ((4725, 4738), 'training.run_program', 'run_program', ([], {}), '()\n', (4736, 4738), False, 'from training import run_program\n'), ((5108, 5175), 'data_collection.generate_training_dat... |
import numpy as np
from common.Ellipsoid import Ellipsoid
# TODO extends Ellipsoid
class Sphere:
@staticmethod
def createUnitSphere():
return Sphere([0] * 3, 1)
center: list[float]
radius: float
def __init__(self, center: list[float], radius: float):
self.center = center
... | [
"numpy.add",
"numpy.multiply"
] | [((437, 469), 'numpy.add', 'np.add', (['self.center', 'translation'], {}), '(self.center, translation)\n', (443, 469), True, 'import numpy as np\n'), ((613, 650), 'numpy.multiply', 'np.multiply', (['([self.radius] * 3)', 'scale'], {}), '([self.radius] * 3, scale)\n', (624, 650), True, 'import numpy as np\n')] |
#tf-idf is used for marching best answer from dataset to match for answer relevancy
#tf(t,d) = count of t in d / number of words in d
#df(t) = occurrence of t in documents
#idf(t) = log(N/(df + 1))
#tf-idf(t, d) = tf(t, d) * log(N/(df + 1))
#https://towardsdatascience.com/tf-idf-for-document-ranking-from-scratch-in-py... | [
"nltk.stem.PorterStemmer",
"numpy.log",
"collections.Counter",
"numpy.zeros",
"numpy.char.replace",
"numpy.linalg.norm",
"numpy.array",
"nltk.corpus.stopwords.words",
"numpy.dot",
"nltk.download",
"math.log",
"numpy.char.lower",
"numpy.unique"
] | [((813, 839), 'nltk.download', 'nltk.download', (['"""stopwords"""'], {}), "('stopwords')\n", (826, 839), False, 'import nltk\n'), ((921, 940), 'numpy.char.lower', 'np.char.lower', (['data'], {}), '(data)\n', (934, 940), True, 'import numpy as np\n'), ((988, 1014), 'nltk.corpus.stopwords.words', 'stopwords.words', (['"... |
import pickle
import numpy as np
import pytest
from src.poretitioner.fast5s import BulkFile
from src.poretitioner.signals import (
BaseSignal,
Capture,
Channel,
ChannelCalibration,
CurrentSignal,
FractionalizedSignal,
PicoampereSignal,
RawSignal,
VoltageSignal,
compute_fraction... | [
"numpy.isclose",
"numpy.mean",
"src.poretitioner.signals.VoltageSignal",
"numpy.multiply",
"src.poretitioner.signals.ChannelCalibration",
"numpy.max",
"pytest.raises",
"src.poretitioner.signals.digitize_current",
"src.poretitioner.fast5s.BulkFile",
"pickle.dumps",
"pickle.loads",
"numpy.median... | [((444, 471), 'src.poretitioner.signals.ChannelCalibration', 'ChannelCalibration', (['(0)', '(2)', '(1)'], {}), '(0, 2, 1)\n', (462, 471), False, 'from src.poretitioner.signals import BaseSignal, Capture, Channel, ChannelCalibration, CurrentSignal, FractionalizedSignal, PicoampereSignal, RawSignal, VoltageSignal, compu... |
#
# Copyright (C) 2001 <NAME>
#
""" unit testing code for SLT Risk functions
"""
from __future__ import print_function
import unittest
from rdkit.ML.SLT import Risk
import math
import numpy
class TestCase(unittest.TestCase):
def setUp(self):
print('\n%s: ' % self.shortDescription(), end='')
self.dList =... | [
"unittest.main",
"rdkit.ML.SLT.Risk.CherkasskyRiskBound",
"math.sqrt",
"rdkit.ML.SLT.Risk.BurgesRiskBound",
"numpy.array"
] | [((1340, 1355), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1353, 1355), False, 'import unittest\n'), ((799, 868), 'numpy.array', 'numpy.array', (['[0.7445, 0.8157, 0.6698, 0.7649, 0.7506, 0.7658, 0.7896]'], {}), '([0.7445, 0.8157, 0.6698, 0.7649, 0.7506, 0.7658, 0.7896])\n', (810, 868), False, 'import numpy\n... |
import numpy as np
import torch
from common.dataset.pre_process.hm36 import load_data, prepare_dataset, load_2d_data, prepare_2d_data, normalization
from common.arguments.basic_args import parse_args
from common.plot_pose3d import plot17j
import os
args = parse_args()
cal_mean = False
cal_distance = True
dataset_root... | [
"matplotlib.pyplot.title",
"numpy.load",
"numpy.argsort",
"matplotlib.pyplot.figure",
"numpy.linalg.svd",
"numpy.mean",
"common.dataset.pre_process.hm36.load_data",
"numpy.savez_compressed",
"numpy.linalg.norm",
"numpy.diag",
"numpy.set_printoptions",
"common.dataset.pre_process.hm36.prepare_2... | [((257, 269), 'common.arguments.basic_args.parse_args', 'parse_args', ([], {}), '()\n', (267, 269), False, 'from common.arguments.basic_args import parse_args\n'), ((384, 437), 'common.dataset.pre_process.hm36.load_data', 'load_data', (['dataset_root', 'args.dataset', 'args.keypoints'], {}), '(dataset_root, args.datase... |
#
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD.
# See https://nomad-lab.eu for further info.
#
# 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/lic... | [
"nomad.datamodel.metainfo.simulation.calculation.EnergyEntry",
"os.path.abspath",
"nomad.datamodel.metainfo.simulation.method.BasisSet",
"yaml.load",
"nomad.datamodel.metainfo.simulation.method.Functional",
"yaml.safe_load",
"numpy.diag",
"logging.getLogger"
] | [((11222, 11247), 'os.path.abspath', 'os.path.abspath', (['filepath'], {}), '(filepath)\n', (11237, 11247), False, 'import os\n'), ((6346, 6378), 'nomad.datamodel.metainfo.simulation.method.BasisSet', 'BasisSet', ([], {'type': '"""real-space grid"""'}), "(type='real-space grid')\n", (6354, 6378), False, 'from nomad.dat... |
import numpy as np
from scipy.special import eval_legendre
from scipy.integrate import trapz, quad
from scipy.interpolate import interp1d
def RSD(Pk, kbins, mu_bins, beta, poles=None, fog=True, sigma=None,
qperp=None, qpar=None):
'''
Calculate power spectrum in redshift space from the real space
ga... | [
"numpy.stack",
"scipy.special.eval_legendre",
"numpy.meshgrid",
"numpy.outer",
"numpy.exp",
"numpy.linspace",
"scipy.integrate.trapz",
"scipy.interpolate.interp1d"
] | [((1235, 1277), 'numpy.meshgrid', 'np.meshgrid', (['kbins', 'mu_bins'], {'indexing': '"""ij"""'}), "(kbins, mu_bins, indexing='ij')\n", (1246, 1277), True, 'import numpy as np\n'), ((2728, 2742), 'numpy.stack', 'np.stack', (['Pell'], {}), '(Pell)\n', (2736, 2742), True, 'import numpy as np\n'), ((4364, 4406), 'numpy.me... |
import numpy as np
import math
def sign_mismatches(predicts, gold):
count = 0
sum = 0.0
merge = np.sign(predicts) + np.sign(gold)
for i in range(len(merge)):
if merge[i] == 0:
count += 1
sum += np.abs(predicts[i])
return (count, sum)
def kullback_leibler(ground_prob_dist, target_prob_dist):
sum = 0.0
... | [
"numpy.abs",
"numpy.zeros",
"numpy.transpose",
"numpy.linalg.norm",
"numpy.array",
"numpy.sign",
"numpy.dot",
"math.log"
] | [((748, 791), 'numpy.zeros', 'np.zeros', (['(first.shape[1], second.shape[1])'], {}), '((first.shape[1], second.shape[1]))\n', (756, 791), True, 'import numpy as np\n'), ((101, 118), 'numpy.sign', 'np.sign', (['predicts'], {}), '(predicts)\n', (108, 118), True, 'import numpy as np\n'), ((121, 134), 'numpy.sign', 'np.si... |
import numpy as np
import pandas as pd
from enum import Enum
import matplotlib as mt
import matplotlib.pyplot as plt
import tti
from tti.indicators import StochasticMomentumIndex as smi
from tti.indicators import _moving_average_convergence_divergence as macd
from tti.indicators import RelativeStrengthIndex as ... | [
"pandas.DataFrame",
"math.isnan",
"matplotlib.pyplot.show",
"statistics.median",
"tti.indicators.RelativeStrengthIndex",
"scipy.signal.argrelextrema",
"matplotlib.pyplot.scatter",
"statistics.stdev",
"tti.indicators.StochasticMomentumIndex",
"matplotlib.pyplot.plot_date",
"numpy.isnan",
"data.... | [((1374, 1384), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1382, 1384), True, 'import matplotlib.pyplot as plt\n'), ((1436, 1458), 'data.precios.get', 'dt.precios.get', (['symbol'], {}), '(symbol)\n', (1450, 1458), True, 'import data as dt\n'), ((1531, 1546), 'numpy.isnan', 'np.isnan', (['price'], {}), '(... |
import os
import time
import numpy as np
import tensorflow as tf
from glob import glob
from dcgan import DCGAN
from utils import *
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string('log_dir', 'checkpoints', """Path to write logs and checkpoints""")
tf.app.flags.DEFINE_string('complete_src', 'compl... | [
"numpy.ones",
"numpy.clip",
"tensorflow.app.flags.DEFINE_boolean",
"tensorflow.app.flags.DEFINE_integer",
"os.path.join",
"numpy.multiply",
"numpy.copy",
"os.path.exists",
"tensorflow.summary.FileWriter",
"tensorflow.app.run",
"tensorflow.train.Saver",
"tensorflow.global_variables_initializer"... | [((159, 253), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""log_dir"""', '"""checkpoints"""', '"""Path to write logs and checkpoints"""'], {}), "('log_dir', 'checkpoints',\n 'Path to write logs and checkpoints')\n", (185, 253), True, 'import tensorflow as tf\n'), ((270, 365), 'tensorflow.... |
import os
import argparse
from cvae.CVAE import run_cvae
import numpy as np
import time
from smartredis import Client, Dataset
from smartredis.util import Dtypes
import tensorflow as tf
from tensorflow.python.framework.convert_to_constants import (
convert_variables_to_constants_v2,
)
parser = argparse.Argu... | [
"tensorflow.python.framework.convert_to_constants.convert_variables_to_constants_v2",
"argparse.ArgumentParser",
"time.sleep",
"numpy.array",
"cvae.CVAE.run_cvae",
"tensorflow.TensorSpec",
"os.getenv",
"numpy.concatenate",
"smartredis.Dataset"
] | [((307, 332), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (330, 332), False, 'import argparse\n'), ((1042, 1087), 'tensorflow.python.framework.convert_to_constants.convert_variables_to_constants_v2', 'convert_variables_to_constants_v2', (['full_model'], {}), '(full_model)\n', (1075, 1087), F... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## 27.11.2017
## TM@SmartSquare
## 1/6 scripts (1/3 colortizer)
##
## w/o main-method
## functions to publish a grid-array (u,v,value) for a single camera
##
# from os import environ
import cv2
import numpy as np
# from imagestuff import * # :D
from time import time
# imp... | [
"numpy.ones",
"numpy.argsort",
"cv2.rectangle",
"cv2.imshow",
"cv2.line",
"cv2.contourArea",
"numpy.set_printoptions",
"cv2.cvtColor",
"cv2.namedWindow",
"cv2.drawContours",
"cv2.destroyAllWindows",
"cv2.circle",
"numpy.vectorize",
"cv2.waitKey",
"cv2.morphologyEx",
"numpy.hstack",
"... | [((619, 625), 'time.time', 'time', ([], {}), '()\n', (623, 625), False, 'from time import time\n'), ((839, 876), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'np.nan'}), '(threshold=np.nan)\n', (858, 876), True, 'import numpy as np\n'), ((1698, 1738), 'cv2.imread', 'cv2.imread', (['image_path', '... |
import numpy as np
from hitbtc_data import DataGathererHITBTC
from perceptron import Perceptron, SOPerceptron
import time
import sys
if __name__ == '__main__':
wealth = 0
try:
dg = DataGathererHITBTC(sys.argv[1])
except:
print(f'symbol {sys.argv[1]} not found')
prev_ask = dg.prev_ask... | [
"hitbtc_data.DataGathererHITBTC",
"numpy.zeros",
"time.sleep",
"numpy.array",
"numpy.sign",
"perceptron.SOPerceptron"
] | [((362, 377), 'perceptron.SOPerceptron', 'SOPerceptron', (['(3)'], {}), '(3)\n', (374, 377), False, 'from perceptron import Perceptron, SOPerceptron\n'), ((391, 406), 'perceptron.SOPerceptron', 'SOPerceptron', (['(3)'], {}), '(3)\n', (403, 406), False, 'from perceptron import Perceptron, SOPerceptron\n'), ((436, 448), ... |
# %%
import numpy as np
# %%
with open('input.txt', 'r') as f:
data = f.read()
data = data.split('\n')
# %%
with open('test_input.txt', 'r') as f:
test_data = f.read()
test_data = test_data.split('\n')
# %%
def create_coords_and_folds(data):
coords = []
folds = []
for line in data:
if line.... | [
"numpy.zeros"
] | [((1793, 1825), 'numpy.zeros', 'np.zeros', (['(max_x + 1, max_y + 1)'], {}), '((max_x + 1, max_y + 1))\n', (1801, 1825), True, 'import numpy as np\n')] |
import logging
import os
import pprint
from typing import Union
import numpy as np
from omegaconf import OmegaConf
from vidio import VideoReader
from tqdm import tqdm
from deepethogram import file_io, projects
log = logging.getLogger(__name__)
def print_models(model_path: Union[str, os.PathLike]) -> None:
"""P... | [
"os.remove",
"pprint.pformat",
"numpy.sum",
"os.path.isfile",
"os.path.join",
"logging.FileHandler",
"os.path.dirname",
"omegaconf.OmegaConf.merge",
"vidio.VideoReader",
"deepethogram.file_io.read_labels",
"deepethogram.projects.convert_config_paths_to_absolute",
"omegaconf.OmegaConf.to_yaml",... | [((219, 246), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (236, 246), False, 'import logging\n'), ((504, 552), 'deepethogram.projects.get_weights_from_model_path', 'projects.get_weights_from_model_path', (['model_path'], {}), '(model_path)\n', (540, 552), False, 'from deepethogram impo... |
"""Utility functions and classes"""
import numpy as np
import pandas as pd
from pandas.api.types import (
is_numeric_dtype,
is_string_dtype,
is_categorical_dtype,
)
import matplotlib as mpl
from ._palettes import (
default_20,
default_28,
default_102
)
def get_colors(arr,
vmin... | [
"matplotlib.cm.get_cmap",
"matplotlib.colors.Normalize",
"pandas.api.types.is_categorical_dtype",
"numpy.where",
"matplotlib.colors.rgb2hex",
"pandas.api.types.is_string_dtype",
"pandas.api.types.is_numeric_dtype",
"numpy.linspace",
"numpy.unique"
] | [((582, 603), 'pandas.api.types.is_numeric_dtype', 'is_numeric_dtype', (['arr'], {}), '(arr)\n', (598, 603), False, 'from pandas.api.types import is_numeric_dtype, is_string_dtype, is_categorical_dtype\n'), ((666, 698), 'matplotlib.cm.get_cmap', 'mpl.cm.get_cmap', (['image_cmap', '(512)'], {}), '(image_cmap, 512)\n', (... |
import pandas as pd
import numpy as np
from cascade_at.inputs.base_input import BaseInput
def test_convert_to_age_lower_upper(ihme):
df = pd.DataFrame({
'age_group_id': [10, 12, 14]
})
c_df = BaseInput(gbd_round_id=6).convert_to_age_lower_upper(df=df)
assert len(c_df) == 3
assert np.isfin... | [
"pandas.DataFrame",
"cascade_at.inputs.base_input.BaseInput.get_out_of_demographic_notation",
"numpy.isfinite",
"cascade_at.inputs.base_input.BaseInput"
] | [((145, 189), 'pandas.DataFrame', 'pd.DataFrame', (["{'age_group_id': [10, 12, 14]}"], {}), "({'age_group_id': [10, 12, 14]})\n", (157, 189), True, 'import pandas as pd\n'), ((449, 548), 'pandas.DataFrame', 'pd.DataFrame', (["{'year_lower': [2000, 2000, 2001, 2001], 'year_upper': [2000, 2001, 2001, 2002]\n }"], {}),... |
#!/usr/bin/env python
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
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 applicabl... | [
"numpy.minimum",
"numpy.maximum",
"argparse.ArgumentParser",
"cv2.waitKey",
"keras.backend.floatx",
"tensorflow.Session",
"numpy.expand_dims",
"keras_retinanet.models.ResNet50RetinaNet",
"keras_retinanet.preprocessing.image.resize_image",
"tensorflow.ConfigProto",
"cv2.imread",
"numpy.where",
... | [((897, 913), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (911, 913), True, 'import tensorflow as tf\n'), ((968, 993), 'tensorflow.Session', 'tf.Session', ([], {'config': 'config'}), '(config=config)\n', (978, 993), True, 'import tensorflow as tf\n'), ((1046, 1081), 'keras.layers.Input', 'keras.layers... |
import numpy as np
import numpy.random as rd
from scipy.stats import invgamma
from scipy.stats import norm
import matplotlib.pyplot as plt
n = 100
data = rd.normal(10, 2, size=n)
mean = 0
std = 10
params = [(mean, std)]
# 平均の事前分布は正規分布で、
# 分散の事前分布は逆ガンマ分布となるとする
# ハイパーパラメータの設定
mu0 = 0
m0 = 1
alpha0 = 0.02
beta0 = 0.02... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"numpy.std",
"scipy.stats.invgamma.rvs",
"numpy.mean",
"numpy.arange",
"numpy.random.normal",
"numpy.sqrt"
] | [((155, 179), 'numpy.random.normal', 'rd.normal', (['(10)', '(2)'], {'size': 'n'}), '(10, 2, size=n)\n', (164, 179), True, 'import numpy.random as rd\n'), ((1251, 1267), 'matplotlib.pyplot.hist', 'plt.hist', (['result'], {}), '(result)\n', (1259, 1267), True, 'import matplotlib.pyplot as plt\n'), ((1281, 1297), 'numpy.... |
import torch
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from torch import nn, optim
from torch.utils.data import Dataset, DataLoader
from torch.nn import functional as F
from torch.utils.tensorboard import SummaryWriter
from earlystoping import Earlystopping
from sklearn... | [
"torch.nn.Dropout",
"torch.nn.functional.binary_cross_entropy",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.accuracy_score",
"torch.cat",
"torch.cuda.device_count",
"sklearn.metrics.f1_score",
"torch.no_grad",
"pandas.DataFrame",
"earlystoping.Earlystopping",
... | [((639, 669), 'torch.manual_seed', 'torch.manual_seed', (['random_seed'], {}), '(random_seed)\n', (656, 669), False, 'import torch\n'), ((674, 713), 'torch.cuda.manual_seed_all', 'torch.cuda.manual_seed_all', (['random_seed'], {}), '(random_seed)\n', (700, 713), False, 'import torch\n'), ((972, 1044), 'numpy.loadtxt', ... |
from .recordingextractor import RecordingExtractor
from .extraction_tools import check_get_traces_args
import numpy as np
# Concatenates the given recordings by channel
class MultiRecordingChannelExtractor(RecordingExtractor):
def __init__(self, recordings, groups=None):
self._recordings = recordings
... | [
"numpy.concatenate"
] | [((2971, 3001), 'numpy.concatenate', 'np.concatenate', (['traces'], {'axis': '(0)'}), '(traces, axis=0)\n', (2985, 3001), True, 'import numpy as np\n')] |
import logging
import os
import re
from glob import glob
from torch import nn
import numpy as np
from torchtext.vocab import Vectors, Vocab
def feature_string(key):
# # is used for bin index representation
# = is used for compound representation
# : is used as a seperator
# , unnecessary
# parant... | [
"logging.error",
"torchtext.vocab.Vectors",
"logging.info",
"torchtext.vocab.Vocab",
"glob.glob",
"collections.Counter",
"numpy.digitize",
"re.sub"
] | [((348, 382), 're.sub', 're.sub', (['"""[-\\\\s,\\\\(\\\\)]+"""', '""" """', 'key'], {}), "('[-\\\\s,\\\\(\\\\)]+', ' ', key)\n", (354, 382), False, 'import re\n'), ((1676, 1857), 'torchtext.vocab.Vocab', 'Vocab', (['counter'], {'specials_first': '(True)', 'vectors': 'pretrained_embeddings', 'min_freq': 'min_word_count... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import logging
import torch
import numpy as np
from .shape_dependency import ChannelDependency, GroupDependency, CatPaddingDependency
# logging.basicConfig(level = logging.DEBUG)
_logger = logging.getLogger('FixMaskConflict')
def fix_ma... | [
"torch.ones",
"torch.onnx.set_training",
"torch.jit.trace",
"torch.load",
"os.path.exists",
"numpy.prod",
"torch.save",
"logging.getLogger"
] | [((272, 308), 'logging.getLogger', 'logging.getLogger', (['"""FixMaskConflict"""'], {}), "('FixMaskConflict')\n", (289, 308), False, 'import logging\n'), ((1058, 1079), 'os.path.exists', 'os.path.exists', (['masks'], {}), '(masks)\n', (1072, 1079), False, 'import os\n'), ((1096, 1113), 'torch.load', 'torch.load', (['ma... |
#! /usr/bin/python2.7
import numpy as np
import cv2
def main():
face_cascade = cv2.CascadeClassifier('./classifiers/haarcascade_frontalface_default.xml')
smile_cascade = cv2.CascadeClassifier('/home/teddy/Documents/software_dev/Computer_Vision/classifiers/haarcascade_smile.xml')
cap = cv2.VideoCapture(0)
font =... | [
"cv2.putText",
"cv2.cvtColor",
"numpy.median",
"cv2.waitKey",
"cv2.imshow",
"cv2.VideoCapture",
"cv2.rectangle",
"cv2.CascadeClassifier",
"cv2.destroyAllWindows"
] | [((83, 157), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""./classifiers/haarcascade_frontalface_default.xml"""'], {}), "('./classifiers/haarcascade_frontalface_default.xml')\n", (104, 157), False, 'import cv2\n'), ((175, 294), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""/home/teddy/Documents/soft... |
import matplotlib.pyplot as plt
import numpy as np
from show import show
def plotData(X, y):
"""plots the data points with + for the positive examples
and o for the negative examples. X is assumed to be a Mx2 matrix.
Note: This was slightly modified such that it expects y = 1 or y = 0
"""
plt.fig... | [
"matplotlib.pyplot.figure",
"numpy.where",
"matplotlib.pyplot.plot"
] | [((313, 325), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (323, 325), True, 'import matplotlib.pyplot as plt\n'), ((505, 568), 'matplotlib.pyplot.plot', 'plt.plot', (['X[pos, 0]', 'X[pos, 1]', '"""k+"""'], {'linewidth': '(1)', 'markersize': '(7)'}), "(X[pos, 0], X[pos, 1], 'k+', linewidth=1, markersize=... |
from __future__ import print_function
import os
import unittest
import numpy as np
from scipy.linalg import expm
import h5py
from pyglib.math.matrix_util import yield_derivative_f_matrix
class KnowValues(unittest.TestCase):
def test_derivative_exp_ix(self):
# random Hermitian matrix of dimention 5.
... | [
"unittest.main",
"numpy.conj",
"scipy.linalg.expm",
"pyglib.math.matrix_util.yield_derivative_f_matrix",
"numpy.sum",
"numpy.abs",
"numpy.max",
"numpy.exp",
"numpy.random.rand",
"numpy.dot",
"numpy.sqrt"
] | [((2355, 2370), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2368, 2370), False, 'import unittest\n'), ((402, 414), 'numpy.conj', 'np.conj', (['x.T'], {}), '(x.T)\n', (409, 414), True, 'import numpy as np\n'), ((791, 806), 'scipy.linalg.expm', 'expm', (['(-1.0j * x)'], {}), '(-1.0j * x)\n', (795, 806), False, '... |
import argparse
import numpy as np
import time
from collections import OrderedDict
parser = argparse.ArgumentParser()
parser.add_argument('path', type=str, help='path to CIFAR dataset')
parser.add_argument('--bs', type=int, default=64)
parser.add_argument('--n_iters', type=int, default=100000)
parser.add_argument('--g... | [
"argparse.ArgumentParser",
"neuralnet.HeNormal",
"numpy.isnan",
"numpy.mean",
"neuralnet.set_training_status",
"numpy.random.normal",
"neuralnet.read_data.load_dataset",
"theano.tensor.tensor4",
"neuralnet.Normal",
"theano.tensor.nnet.softplus",
"neuralnet.utils.spectral_normalize",
"neuralnet... | [((93, 118), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (116, 118), False, 'import argparse\n'), ((8845, 8874), 'theano.tensor.tensor4', 'T.tensor4', (['"""image"""', '"""float32"""'], {}), "('image', 'float32')\n", (8854, 8874), True, 'from theano import tensor as T\n'), ((8981, 9009), 'ne... |
from dataloader.paths import PathsDataset
from dataloader.indoor_scenes import IndoorScenesWithAllInfo
from utils.misc import visualize_entropy, visualize_spx_dataset
from dataloader import indoor_scenes, dataset_base
import constants
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
import num... | [
"tqdm.tqdm",
"torch.log2",
"torch.cuda.FloatTensor",
"numpy.any",
"torch.cuda.empty_cache",
"dataloader.paths.PathsDataset",
"torch.nn.Softmax2d",
"torch.no_grad"
] | [((925, 978), 'dataloader.paths.PathsDataset', 'PathsDataset', (['self.lmdb_handle', 'self.base_size', 'paths'], {}), '(self.lmdb_handle, self.base_size, paths)\n', (937, 978), False, 'from dataloader.paths import PathsDataset\n'), ((1098, 1113), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1111, 1113), False, ... |
import numpy as np
from rlkit.core import logger
from rlkit.samplers.data_collector.path_collector \
import GoalConditionedPathCollector
from rlkit.torch.her.her import HERTrainer
from rlkit.torch.sac.policies import MakeDeterministic
from rlkit.torch.sac.sac import SACTrainer
def get_envs(variant, eval_env=Fals... | [
"rlkit.torch.sac.sac.SACTrainer",
"numpy.arctanh",
"rlkit.torch.torch_rl_algorithm.TorchBatchRLAlgorithm",
"multiworld.register_all_envs",
"gym.make",
"rlkit.torch.sac.policies.MakeDeterministic",
"rlkit.torch.pytorch_util.WeightInitializer",
"rlkit.torch.her.her.HERTrainer",
"rlkit.samplers.data_co... | [((5506, 5700), 'rlkit.data_management.shared_obs_dict_replay_buffer.SharedObsDictRelabelingBuffer', 'SharedObsDictRelabelingBuffer', ([], {'env': 'train_env', 'observation_key': 'observation_key', 'desired_goal_key': 'desired_goal_key', 'achieved_goal_key': 'achieved_goal_key'}), "(env=train_env, observation_key=\n ... |
import matplotlib.pyplot as plt
from pymc import *
import numpy as np
import theano
# import pydevd
# pydevd.set_pm_excepthook()
np.seterr(invalid='raise')
data = np.random.normal(size=(2, 20))
model = Model()
with model:
x = Normal('x', mu=.5, tau=2. ** -2, shape=(2, 1))
z = Beta('z', alpha=10, beta=5.5)... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.plot",
"numpy.seterr",
"numpy.random.normal"
] | [((130, 156), 'numpy.seterr', 'np.seterr', ([], {'invalid': '"""raise"""'}), "(invalid='raise')\n", (139, 156), True, 'import numpy as np\n'), ((165, 195), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(2, 20)'}), '(size=(2, 20))\n', (181, 195), True, 'import numpy as np\n'), ((507, 527), 'matplotlib.pyplot... |
# ___________________________________________________________________________
#
# EGRET: Electrical Grid Research and Engineering Tools
# Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain r... | [
"egret.model_library.transmission.tx_calc.calculate_phi_loss_constant",
"numpy.abs",
"math.radians",
"egret.model_library.transmission.tx_calc.calculate_susceptance",
"egret.model_library.transmission.tx_calc.calculate_phi_constant",
"egret.model_library.transmission.tx_calc.calculate_ptdf_ldf",
"numpy.... | [((3583, 3669), 'numpy.array', 'np.array', (["[branches[branch]['rating_long_term'] for branch in self.branches_keys]"], {}), "([branches[branch]['rating_long_term'] for branch in self.\n branches_keys])\n", (3591, 3669), True, 'import numpy as np\n'), ((4220, 4351), 'egret.model_library.transmission.tx_calc.calcula... |
import os
import csv
import shutil
import numpy as np
import pandas as pd
from tqdm import tqdm
from absl import app
from absl import flags
from pysc2 import run_configs
from pysc2.lib import features
from pysc2.lib import point
from s2clientprotocol import sc2api_pb2 as sc_pb
FLAGS = flags.FLAGS
... | [
"pandas.DataFrame",
"tqdm.tqdm",
"pysc2.run_configs.get",
"absl.flags.DEFINE_bool",
"pysc2.lib.point.Point",
"s2clientprotocol.sc2api_pb2.RequestStartReplay",
"numpy.zeros",
"absl.flags.DEFINE_string",
"os.environ.get",
"absl.app.run",
"absl.flags.DEFINE_integer",
"absl.flags.DEFINE_float",
... | [((321, 388), 'absl.flags.DEFINE_bool', 'flags.DEFINE_bool', (['"""render"""', '(True)', '"""Whether to render with pygame."""'], {}), "('render', True, 'Whether to render with pygame.')\n", (338, 388), False, 'from absl import flags\n'), ((390, 462), 'absl.flags.DEFINE_bool', 'flags.DEFINE_bool', (['"""realtime"""', '... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 1 10:13:54 2019
@author: <NAME>
"""
# TODO: feature selection
# initial values
cond_init = []
act_init = 0
pred_init = 50.0
prederr_init = 0.0
fit_init = 10.0
# Agent class
class Agent(object):
def __init__(self, num_actions=2, pressure="HIGH", maxreward=100.0, pr... | [
"numpy.sum",
"random.shuffle",
"random.random",
"os.path.isfile",
"numpy.max",
"numpy.array",
"random.randrange"
] | [((32456, 32484), 'numpy.array', 'np.array', (['x'], {'dtype': '"""float64"""'}), "(x, dtype='float64')\n", (32464, 32484), True, 'import numpy as np\n'), ((26123, 26139), 'os.path.isfile', 'path.isfile', (['env'], {}), '(env)\n', (26134, 26139), False, 'from os import path\n'), ((7026, 7044), 'os.path.isfile', 'path.i... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 19:40:15 2020
@author: ikyathvarmadantuluri
"""
import numpy as np
import pickle
from flask import Flask, request, jsonify, render_template
app = Flask(__name__)
model = pickle.load(open('model.pkl','rb'))
@app.route('/')
def home():
ret... | [
"flask.request.form.values",
"flask.Flask",
"numpy.array",
"flask.render_template"
] | [((224, 239), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (229, 239), False, 'from flask import Flask, request, jsonify, render_template\n'), ((324, 353), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (339, 353), False, 'from flask import Flask, request, jso... |
"""
@author: <NAME>, <EMAIL>
Utilities
"""
# some functions such as resize_image(), resize_masks(), masks_boxes(),
# Dataset(), compute_ap() and compute_mAP() are very strongly influenced by
# https://github.com/matterport/Mask_RCNN/blob/master/mrcnn/model.py
import time
import cv2
import scipy.ndimage
... | [
"tensorflow.random.set_seed",
"numpy.maximum",
"numpy.sum",
"numpy.empty",
"numpy.ones",
"numpy.argsort",
"numpy.random.randint",
"numpy.arange",
"numpy.tile",
"cv2.rectangle",
"tensorflow_addons.image.rotate",
"tensorflow.split",
"numpy.pad",
"random.randint",
"tensorflow.image.random_c... | [((2858, 2908), 'numpy.repeat', 'np.repeat', (['boxes1'], {'repeats': 'boxes2.shape[0]', 'axis': '(0)'}), '(boxes1, repeats=boxes2.shape[0], axis=0)\n', (2867, 2908), True, 'import numpy as np\n'), ((2919, 2961), 'numpy.tile', 'np.tile', (['boxes2'], {'reps': '(boxes1.shape[0], 1)'}), '(boxes2, reps=(boxes1.shape[0], 1... |
#coding=utf-8
import cv2
import numpy as np
import motion_planning_toolbox as mpt
import math
class MotionRoadmap(object):
def __init__(self, map_img):
## 初始化实例,需要输入一张 bmp 格式的地图
self.map = map_img
# 读取图像尺寸
size = self.map.shape
# 运动规划的起点
self.point_strat = np.mat([0,... | [
"math.atan2",
"numpy.argmin",
"numpy.around",
"motion_planning_toolbox.straight_distance",
"numpy.random.randint",
"numpy.mat",
"motion_planning_toolbox.tree_plot",
"cv2.cvtColor",
"motion_planning_toolbox.check_point",
"math.cos",
"cv2.resize",
"math.sin",
"numpy.hstack",
"motion_planning... | [((10625, 10647), 'cv2.imread', 'cv2.imread', (['image_path'], {}), '(image_path)\n', (10635, 10647), False, 'import cv2\n'), ((10680, 10707), 'cv2.resize', 'cv2.resize', (['img', '(500, 500)'], {}), '(img, (500, 500))\n', (10690, 10707), False, 'import cv2\n'), ((310, 324), 'numpy.mat', 'np.mat', (['[0, 0]'], {}), '([... |
import gzip
import numpy as np
import torch
import pickle
import pdb
NO_EMBEDDING_ERR = "Embedding {} not in EMBEDDING_REGISTRY! Available embeddings are {}"
EMBEDDING_REGISTRY = {}
def RegisterEmbedding(name):
"""Registers a dataset."""
def decorator(f):
EMBEDDING_REGISTRY[name] = f
retur... | [
"gzip.open",
"numpy.array",
"torch.LongTensor"
] | [((1379, 1423), 'numpy.array', 'np.array', (['embedding_tensor'], {'dtype': 'np.float32'}), '(embedding_tensor, dtype=np.float32)\n', (1387, 1423), True, 'import numpy as np\n'), ((2108, 2152), 'numpy.array', 'np.array', (['embedding_tensor'], {'dtype': 'np.float32'}), '(embedding_tensor, dtype=np.float32)\n', (2116, 2... |
import freud
import unittest
import numpy.testing as npt
import numpy as np
from util import sort_rounded_xyz_array
class TestData(unittest.TestCase):
def test_square(self):
"""Test that the square lattice is correctly generated."""
box, points = freud.data.UnitCell.square().generate_system()
... | [
"unittest.main",
"freud.data.UnitCell.sc",
"numpy.random.seed",
"freud.data.UnitCell.bcc",
"freud.box.Box.square",
"freud.data.UnitCell.fcc",
"numpy.testing.assert_array_equal",
"freud.box.Box.cube",
"numpy.allclose",
"freud.data.UnitCell.square",
"numpy.random.randint",
"numpy.array",
"nump... | [((5198, 5213), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5211, 5213), False, 'import unittest\n'), ((379, 428), 'numpy.testing.assert_array_equal', 'npt.assert_array_equal', (['points', '[[-0.5, -0.5, 0]]'], {}), '(points, [[-0.5, -0.5, 0]])\n', (401, 428), True, 'import numpy.testing as npt\n'), ((642, 694... |
from __future__ import absolute_import, division, print_function
import marshal
import os
import warnings
from collections import OrderedDict
from contextlib import contextmanager
from typing import Iterable, List, Optional, Text, Tuple, Union
import numpy as np
from six import string_types
__all__ = [
'get_tota... | [
"os.path.abspath",
"os.remove",
"numpy.ceil",
"os.stat",
"marshal.loads",
"numpy.dtype",
"os.path.exists",
"marshal.dumps",
"os.path.isfile",
"collections.OrderedDict"
] | [((448, 461), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (459, 461), False, 'from collections import OrderedDict\n'), ((1882, 1914), 'numpy.ceil', 'np.ceil', (['(header_size / type_size)'], {}), '(header_size / type_size)\n', (1889, 1914), True, 'import numpy as np\n'), ((1851, 1866), 'numpy.dtype', 'n... |
import logging
import os
import time
from typing import List, Optional
import cv2
import numpy as np
from skimage.metrics import structural_similarity
from utils import run_ffmpeg, setup_logger
from .config import Config
from .utils import crop_to_regions
class IntroTrimmer:
def __init__(self, cfg_path: str, **... | [
"cv2.resize",
"numpy.average",
"os.getpid",
"cv2.cvtColor",
"os.path.exists",
"time.perf_counter",
"utils.run_ffmpeg",
"cv2.VideoCapture",
"skimage.metrics.structural_similarity",
"utils.setup_logger",
"logging.getLogger"
] | [((842, 872), 'logging.getLogger', 'logging.getLogger', (['logger_name'], {}), '(logger_name)\n', (859, 872), False, 'import logging\n'), ((3037, 3056), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (3054, 3056), False, 'import time\n'), ((4988, 5007), 'time.perf_counter', 'time.perf_counter', ([], {}), '... |
import math
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pyjamalib
import scipy.signal,scipy.stats
class DataAnalysis:
"""Integrates all functions to perform data
processing to calculate the joint angle.
See Also
--------
Developed by <NAME> in 25/03/2021
... | [
"pandas.DataFrame",
"pyjamalib.DataHandler.calibration_imu",
"pyjamalib.DataProcessing.rom_mean",
"numpy.asarray",
"pyjamalib.DataProcessing.get_euler",
"numpy.zeros",
"pyjamalib.DataProcessing.patternCI",
"pyjamalib.DataHandler.get_imu_data",
"pyjamalib.DataProcessing.low_pass_filter",
"pyjamalib... | [((840, 862), 'numpy.asarray', 'np.asarray', (['Quaternion'], {}), '(Quaternion)\n', (850, 862), True, 'import numpy as np\n'), ((886, 897), 'numpy.zeros', 'np.zeros', (['(4)'], {}), '(4)\n', (894, 897), True, 'import numpy as np\n'), ((949, 960), 'numpy.zeros', 'np.zeros', (['(4)'], {}), '(4)\n', (957, 960), True, 'im... |
import os
import sys
sys.path.insert(0, './')
import pickle
import argparse
import numpy as np
import torch
import torch.nn as nn
from util.models import MLP
from util.dataset import load_pkl, load_mnist, load_fmnist, load_svhn
from util.device_parser import config_visible_gpu
from util.param_parser import DictParse... | [
"argparse.ArgumentParser",
"torch.cat",
"torch.device",
"util.dataset.load_pkl",
"torch.ones",
"os.path.dirname",
"torch.load",
"os.path.exists",
"util.models.MLP",
"torch.zeros",
"util.dataset.load_fmnist",
"torch.norm",
"torch.clamp",
"torch.cuda.is_available",
"util.device_parser.conf... | [((21, 45), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""./"""'], {}), "(0, './')\n", (36, 45), False, 'import sys\n'), ((1637, 1671), 'torch.clamp', 'torch.clamp', (['grad_norm'], {'max': 'length'}), '(grad_norm, max=length)\n', (1648, 1671), False, 'import torch\n'), ((1765, 1790), 'argparse.ArgumentParser', 'a... |
import numpy as np
import pandas as pd
from lxml import etree
from pyecharts import options as opts
from pyecharts.globals import ThemeType
from redis.connection import ConnectionError as RedisConnectionError
from pyecharts.charts import Bar, Line, Pie, WordCloud, Scatter, Funnel, Map
from django.shortcuts import rend... | [
"position.models.position.position.Position.objects.filter",
"position.models.company.industry.CompanyIndustries.objects.all",
"pyecharts.charts.Funnel",
"position.models.position.experience.PositionExperience.objects.values_list",
"pyecharts.charts.Scatter",
"lxml.etree.HTML",
"pyecharts.options.series... | [((1314, 1382), 'pyecharts.options.InitOpts', 'opts.InitOpts', ([], {'width': '"""100%"""', 'height': '"""100%"""', 'theme': 'ThemeType.MACARONS'}), "(width='100%', height='100%', theme=ThemeType.MACARONS)\n", (1327, 1382), True, 'from pyecharts import options as opts\n'), ((1409, 1455), 'pyecharts.options.MarkPointIte... |
#import matplotlib.pyplot as plt
import os
import numpy as np
#import clawtools.gaugedata as cg
#import geotools.topotools as gt
import clawtools.fortconvert as cf
xdam = (5.526e5,5.18325e6)
xconf = (5.7385e5,5.1945e6)
xpn = (5.76345e5,5.1958e6)
xps = (5.76388e5,5.1924e6)
xort = (5.602e5,5.215e6)
xash = (5.733e5,5.177... | [
"os.path.join",
"numpy.savetxt",
"numpy.hstack",
"numpy.loadtxt",
"clawtools.fortconvert.fort2list",
"clawtools.fortconvert.forttheaderread",
"clawtools.fortconvert.pointfromfort",
"numpy.vstack"
] | [((656, 678), 'numpy.loadtxt', 'np.loadtxt', (['infiles[0]'], {}), '(infiles[0])\n', (666, 678), True, 'import numpy as np\n'), ((685, 707), 'numpy.loadtxt', 'np.loadtxt', (['infiles[1]'], {}), '(infiles[1])\n', (695, 707), True, 'import numpy as np\n'), ((716, 738), 'numpy.loadtxt', 'np.loadtxt', (['infiles[2]'], {}),... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
from torch.utils.data.dataloader import default_collate
from fairseq.data.fairseq_dataset import FairseqDataset
class Re... | [
"numpy.argsort",
"torch.utils.data.dataloader.default_collate",
"numpy.concatenate"
] | [((932, 970), 'torch.utils.data.dataloader.default_collate', 'default_collate', (['samples'], {}), '(samples, **extra_args)\n', (947, 970), False, 'from torch.utils.data.dataloader import default_collate\n'), ((1676, 1706), 'numpy.concatenate', 'np.concatenate', (['_dataset_sizes'], {}), '(_dataset_sizes)\n', (1690, 17... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
from .layer import Layer
class EmbeddingLayer(Layer):
"""EmbeddingLayer"""
def __init__(self, vocab_size, emb_size, trainable=True, name="embedding",
initializer=None, **kwargs):
Layer.__init__... | [
"tensorflow.not_equal",
"tensorflow.nn.embedding_lookup",
"tensorflow.constant_initializer",
"numpy.zeros",
"tensorflow.constant",
"tensorflow.contrib.layers.variance_scaling_initializer"
] | [((1340, 1372), 'numpy.zeros', 'np.zeros', (['[vocab_size, emb_size]'], {}), '([vocab_size, emb_size])\n', (1348, 1372), True, 'import numpy as np\n'), ((431, 479), 'tensorflow.contrib.layers.variance_scaling_initializer', 'tf.contrib.layers.variance_scaling_initializer', ([], {}), '()\n', (477, 479), True, 'import ten... |
import numpy as np
import torch
from torch.distributions.kl import kl_divergence
from torch.distributions import Bernoulli
import rlkit.torch.pytorch_util as ptu
from rlkit.envs.images import InsertImagesEnv, Renderer
from rlkit.envs.images.plot_renderer import (
ScrollingPlotRenderer,
)
from rlkit.torch.disentang... | [
"torch.distributions.Bernoulli",
"rlkit.torch.pytorch_util.get_numpy",
"numpy.zeros",
"rlkit.torch.pytorch_util.from_numpy",
"numpy.exp",
"numpy.repeat"
] | [((687, 717), 'rlkit.torch.pytorch_util.from_numpy', 'ptu.from_numpy', (['states_to_eval'], {}), '(states_to_eval)\n', (701, 717), True, 'import rlkit.torch.pytorch_util as ptu\n'), ((1328, 1373), 'numpy.repeat', 'np.repeat', (['value_image[None, :, :]', '(3)'], {'axis': '(0)'}), '(value_image[None, :, :], 3, axis=0)\n... |
# -*- coding: utf-8 -*-
# Copyright (c) 2013 <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 the rights
# to use, copy, modify, merg... | [
"unittest.main",
"nearpy.hashes.RandomDiscretizedProjections",
"nearpy.filters.NearestFilter",
"numpy.random.randn",
"nearpy.experiments.RecallPrecisionExperiment",
"nearpy.Engine",
"nearpy.hashes.UniBucket",
"nearpy.hashes.RandomBinaryProjections"
] | [((7652, 7667), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7665, 7667), False, 'import unittest\n'), ((1638, 1675), 'numpy.random.randn', 'numpy.random.randn', (['dim', 'vector_count'], {}), '(dim, vector_count)\n', (1656, 1675), False, 'import numpy\n'), ((1696, 1717), 'nearpy.hashes.UniBucket', 'UniBucket',... |
## Working implementation of 1D FPKE example using neurodiffeq
# %%
import numpy as np
import matplotlib.pyplot as plt
from neurodiffeq.neurodiffeq import safe_diff as diff
from neurodiffeq.networks import FCNN
from neurodiffeq.solvers import Solver1D
# from neurodiffeq.monitors import Monitor1D
from neurodiffeq.gener... | [
"neurodiffeq.solvers.Solver1D",
"neurodiffeq.generators.Generator1D",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"neurodiffeq.neurodiffeq.safe_diff",
"matplotlib.pyplot.figure",
"numpy.exp",
"numpy.linspace",
"matplotlib.pyplot.tight_layout",
"neurodiffeq.net... | [((1100, 1144), 'neurodiffeq.generators.Generator1D', 'Generator1D', ([], {'size': '(441)', 't_min': '(-2.2)', 't_max': '(2.2)'}), '(size=441, t_min=-2.2, t_max=2.2)\n', (1111, 1144), False, 'from neurodiffeq.generators import Generator1D\n'), ((1404, 1534), 'neurodiffeq.solvers.Solver1D', 'Solver1D', ([], {'ode_system... |
from collections import defaultdict
import matplotlib.pyplot as plt
import numpy as np
import scipy
import scipy.spatial
import yafs.utils
import math
from matplotlib.collections import PatchCollection,PolyCollection
from yafs.utils import haversine_distance
from functools import partial
import pyproj
from shapely.op... | [
"yafs.utils.haversine_distance",
"shapely.geometry.Point",
"numpy.sum",
"numpy.arctan2",
"math.sqrt",
"math.pow",
"matplotlib.collections.PolyCollection",
"numpy.asarray",
"shapely.ops.transform",
"scipy.spatial.Voronoi",
"numpy.argmin",
"matplotlib.patches.Circle",
"numpy.argsort",
"pypro... | [((2752, 2830), 'matplotlib.collections.PatchCollection', 'PatchCollection', (['self.regions_to_map'], {'facecolors': 'self.colors_cells', 'alpha': '(0.25)'}), '(self.regions_to_map, facecolors=self.colors_cells, alpha=0.25)\n', (2767, 2830), False, 'from matplotlib.collections import PatchCollection, PolyCollection\n'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.