code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import json
import numpy as np
import os
import tensorflow as tf
from keras.models import Sequential
from keras.layers import Dense, Dropout, Embedding, Flatten, Activation, BatchNormalization
from sklearn.model_selection import train_test_split
class SuggestionModeler(object):
"""
A collection of functions ... | [
"os.path.exists",
"random.shuffle",
"sklearn.model_selection.train_test_split",
"tensorflow.Session",
"keras.models.Sequential",
"os.chdir",
"numpy.zeros",
"keras.layers.Dense",
"keras.layers.Dropout",
"tensorflow.get_default_graph"
] | [((5754, 5768), 'os.chdir', 'os.chdir', (['""".."""'], {}), "('..')\n", (5762, 5768), False, 'import os\n'), ((490, 502), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (500, 502), True, 'import tensorflow as tf\n'), ((524, 546), 'tensorflow.get_default_graph', 'tf.get_default_graph', ([], {}), '()\n', (544, 546... |
import math
import numpy as np
import torch
from mock import patch
from core.train_utils import compute_angular_error, compute_angular_error_xyz_arr, spherical2cartesial
def test_spherical2cartesial():
spherical = torch.Tensor([
[0, 0],
[math.pi / 2, 0],
[-math.pi / 2, 0],
[0, ma... | [
"core.train_utils.compute_angular_error",
"mock.patch",
"torch.mean",
"core.train_utils.compute_angular_error_xyz_arr",
"torch.Tensor",
"math.sqrt",
"numpy.array",
"core.train_utils.spherical2cartesial"
] | [((740, 776), 'mock.patch', 'patch', (['"""core.train_utils.epsilon"""', '(0)'], {}), "('core.train_utils.epsilon', 0)\n", (745, 776), False, 'from mock import patch\n'), ((1504, 1540), 'mock.patch', 'patch', (['"""core.train_utils.epsilon"""', '(0)'], {}), "('core.train_utils.epsilon', 0)\n", (1509, 1540), False, 'fro... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
import glob,os,csv,re,math
import shutil, time
from astropy.io import ascii
import matplotlib.pyplot as plt
# Load all data files:
psdir ='/Users/maryumsayeed/Desktop/HuberNess/mlearning/powerspectrum/'
hrdir ='/Users/maryu... | [
"pandas.read_csv",
"numpy.where",
"math.isnan",
"numpy.array",
"numpy.concatenate",
"numpy.loadtxt",
"astropy.io.ascii.read",
"glob.glob",
"re.search"
] | [((790, 821), 'glob.glob', 'glob.glob', (["(pande_dir + '*.fits')"], {}), "(pande_dir + '*.fits')\n", (799, 821), False, 'import glob, os, csv, re, math\n'), ((835, 864), 'glob.glob', 'glob.glob', (["(ast_dir + '*.fits')"], {}), "(ast_dir + '*.fits')\n", (844, 864), False, 'import glob, os, csv, re, math\n'), ((1184, 1... |
import numpy as np
from tabulate import tabulate
import matplotlib.pyplot as plt
import Page_Rank_Utils as pru
def detectedConverged(y,x,epsilon):
C = set()
N = set()
for i in range(len(y)):
if abs(y[i] - x[i])/abs(x[i]) < epsilon:
C.add(i)
else:
N.add(i)
return... | [
"Page_Rank_Utils.stochastic_transition_matrix",
"numpy.zeros"
] | [((591, 640), 'Page_Rank_Utils.stochastic_transition_matrix', 'pru.stochastic_transition_matrix', (['G', 'weight', '(True)'], {}), '(G, weight, True)\n', (623, 640), True, 'import Page_Rank_Utils as pru\n'), ((733, 744), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (741, 744), True, 'import numpy as np\n')] |
#tiersweekly.py
from fantasyfootball import tiers
from fantasyfootball import fantasypros as fp
from fantasyfootball import config
from fantasyfootball import ffcalculator
from fantasyfootball.config import FIGURE_DIR
from sklearn.cluster import KMeans
from sklearn.mixture import GaussianMixture
from matplotlib import... | [
"matplotlib.pyplot.ylabel",
"fantasyfootball.tiers.make_clustering_viz",
"numpy.array_split",
"matplotlib.pyplot.annotate",
"matplotlib.style.use",
"matplotlib.lines.Line2D",
"collections.OrderedDict.fromkeys",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.scatter",
"sklearn.mixture.GaussianMixtu... | [((2721, 2758), 'fantasyfootball.fantasypros.create_fantasy_pros_ecr_df', 'fp.create_fantasy_pros_ecr_df', (['league'], {}), '(league)\n', (2750, 2758), True, 'from fantasyfootball import fantasypros as fp\n'), ((3148, 3160), 'datetime.date.today', 'date.today', ([], {}), '()\n', (3158, 3160), False, 'from datetime imp... |
import itertools
import os
import shutil
import numpy as np
import gym
from gym import spaces
import robosuite
from robosuite.controllers import load_controller_config
import robosuite.utils.macros as macros
import imageio, tqdm
from her import HERReplayBuffer
from tianshou.data import Batch
macros.SIMULATION_TIMES... | [
"robosuite.controllers.load_controller_config",
"numpy.full_like",
"os.makedirs",
"imageio.imwrite",
"gym.spaces.Box",
"numpy.array",
"numpy.random.seed",
"numpy.concatenate",
"shutil.rmtree",
"numpy.set_printoptions"
] | [((331, 365), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'suppress': '(True)'}), '(suppress=True)\n', (350, 365), True, 'import numpy as np\n'), ((4148, 4171), 'shutil.rmtree', 'shutil.rmtree', (['"""render"""'], {}), "('render')\n", (4161, 4171), False, 'import shutil\n'), ((4176, 4197), 'os.makedirs', 'os... |
from __future__ import annotations
import math
from collections import deque
from typing import Optional, Callable
import numpy as np
import pygame
from chess.const import PieceType, PieceColour, Piece, CastlingType, Move, \
PIECE_INDICES, init_zobrist, MoveFlags, GameState
from chess.utils import load_image, lo... | [
"chess.utils.load_image",
"collections.deque",
"numpy.where",
"pygame.sprite.Group",
"chess.const.Move",
"chess.const.Piece.empty",
"math.copysign",
"chess.const.MoveFlags",
"pygame.draw.rect",
"pygame.Color",
"chess.utils.load_font",
"chess.const.Piece",
"chess.const.init_zobrist"
] | [((1993, 2007), 'chess.const.init_zobrist', 'init_zobrist', ([], {}), '()\n', (2005, 2007), False, 'from chess.const import PieceType, PieceColour, Piece, CastlingType, Move, PIECE_INDICES, init_zobrist, MoveFlags, GameState\n'), ((2064, 2090), 'pygame.Color', 'pygame.Color', (['light_colour'], {}), '(light_colour)\n',... |
import os
os.environ['PREFECT__LOGGING__LEVEL'] = 'DEBUG'
os.environ['DJANGO_ALLOW_ASYNC_UNSAFE'] = 'true'
from prefect import flow, task
import numpy as np
import pandas as pd
from django_pandas.io import read_frame
import helpers
@task
def insert_session(session_id):
from django_connect import connect
con... | [
"helpers.spike_count",
"db.models.TrialSpikeCounts",
"db.models.StimulusPresentation.objects.filter",
"prefect.flow",
"db.models.StimulusPresentation",
"db.models.UnitSpikeTimes.objects.filter",
"django_pandas.io.read_frame",
"django_connect.connect",
"helpers.get_session",
"db.models.Unit.objects... | [((3224, 3243), 'prefect.flow', 'flow', ([], {'name': '"""spikes"""'}), "(name='spikes')\n", (3228, 3243), False, 'from prefect import flow, task\n'), ((317, 326), 'django_connect.connect', 'connect', ([], {}), '()\n', (324, 326), False, 'from django_connect import connect\n'), ((368, 399), 'helpers.get_session', 'help... |
# -*- coding: utf-8 -*-
"""
Created on Thu May 3 08:04:22 2018
@author: af5u13
"""
import numpy as np
import os
from .geometry_functions import deg2rad, sph2cart
from loudspeakerconfig import createArrayConfigFile
def createArrayConfigFromSofa( sofaFile, xmlFile = None, lspLabels = None, twoDSetup = False, virtua... | [
"os.path.exists",
"numpy.asarray",
"h5py.File",
"loudspeakerconfig.createArrayConfigFile",
"os.path.basename"
] | [((1586, 1605), 'h5py.File', 'h5py.File', (['sofaFile'], {}), '(sofaFile)\n', (1595, 1605), False, 'import h5py\n'), ((2157, 2324), 'loudspeakerconfig.createArrayConfigFile', 'createArrayConfigFile', (['xmlFile', 'posCart.T'], {'loudspeakerLabels': 'lspLabels', 'twoDconfig': 'twoDSetup', 'sphericalPositions': '(True)',... |
import os
import zipfile
from typing import List, Tuple, Dict
import numpy as np
import pandas as pd
import requests
import structlog
import matplotlib.pyplot as plt
from sklearn.ensemble import RandomForestClassifier
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.model_selection import train... | [
"zipfile.ZipFile",
"pandas.read_csv",
"sklearn.neighbors.KNeighborsClassifier",
"numpy.array",
"tensorflow.keras.layers.Dense",
"pandas.read_excel",
"tensorflow.keras.losses.CategoricalCrossentropy",
"os.path.exists",
"sklearn.model_selection.train_test_split",
"tensorflow.keras.layers.ReLU",
"s... | [((548, 601), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'figure.figsize': (16.0, 12.0)}"], {}), "({'figure.figsize': (16.0, 12.0)})\n", (567, 601), True, 'import matplotlib.pyplot as plt\n'), ((612, 642), 'structlog.get_logger', 'structlog.get_logger', (['__file__'], {}), '(__file__)\n', (632, 642... |
#!/usr/bin/env python
import os,sys
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import argparse
from multiagent.environment import MultiAgentEnv
import multiagent.scenarios as scenarios
import numpy as np
import keras.backend.tensorflow_backend as backend
from keras.models import Sequential
from keras.layers i... | [
"keras.layers.Conv2D",
"numpy.array",
"keras.layers.Activation",
"keras.layers.Dense",
"tensorflow.set_random_seed",
"multiagent.environment.MultiAgentEnv",
"collections.deque",
"argparse.ArgumentParser",
"numpy.random.random",
"numpy.max",
"os.path.isdir",
"numpy.random.seed",
"keras.optimi... | [((55, 86), 'os.path.join', 'os.path.join', (['sys.path[0]', '""".."""'], {}), "(sys.path[0], '..')\n", (67, 86), False, 'import os, sys\n'), ((647, 688), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'None'}), '(description=None)\n', (670, 688), False, 'import argparse\n'), ((1017, 1144), ... |
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
import numpy as np
import torch.nn.functional as F
from attention import AdditiveAttention
class Encoder(nn.Module):
"""Encoder bi-GRU"""
def __init__(self, input_dim, char_embed_dim,
e... | [
"torch.nn.functional.softmax",
"torch.nn.Dropout",
"torch.ones",
"numpy.random.random",
"torch.stack",
"attention.AdditiveAttention",
"torch.argmax",
"torch.cat",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.Linear",
"torch.nn.Embedding.from_pretrained",
"torch.nn.utils.rnn.pad_packed_... | [((822, 891), 'torch.nn.Embedding', 'nn.Embedding', (['input_dim', 'char_embed_dim'], {'padding_idx': 'char_padding_idx'}), '(input_dim, char_embed_dim, padding_idx=char_padding_idx)\n', (834, 891), True, 'import torch.nn as nn\n'), ((1507, 1738), 'torch.nn.GRU', 'nn.GRU', ([], {'input_size': '(char_embed_dim + morph_e... |
# -*- coding: UTF-8 -*-
"""
split_by_area
===========
Script : split_by_area.py
Author : <EMAIL>
Modified: 2018-08-27
Purpose : tools for working with numpy arrays
Notes:
-----
The xs and ys form pairs with the first and last points being identical
The pairs are constructed using n-1 to ensur... | [
"arcpy.CopyFeatures_management",
"numpy.repeat",
"arcpytools_plt.fc_info",
"numpy.set_printoptions",
"arcpytools_plt.cal_area",
"arcpy.Point",
"arcpytools_plt.get_polys",
"numpy.array",
"arcpytools_plt.tweet",
"arcpy.Exists",
"arcpytools_plt._poly_ext",
"arcpy.da.ExtendTable",
"arcpy.Delete_... | [((1572, 1618), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""', 'FutureWarning'], {}), "('ignore', FutureWarning)\n", (1593, 1618), False, 'import warnings\n'), ((1713, 1820), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'edgeitems': '(5)', 'linewidth': '(80)', 'precision': '(2)', 'suppres... |
from scipy import linalg
from sklearn.decomposition import PCA
from scipy.optimize import linear_sum_assignment as linear_assignment
import numpy as np
"""
A function that takes a list of clusters, and a list of centroids for each cluster, and outputs the N max closest images in each cluster to its centroids
"""
def cl... | [
"sklearn.decomposition.PCA",
"numpy.zeros",
"scipy.linalg.norm"
] | [((1792, 1824), 'numpy.zeros', 'np.zeros', (['(D, D)'], {'dtype': 'np.int64'}), '((D, D), dtype=np.int64)\n', (1800, 1824), True, 'import numpy as np\n'), ((809, 840), 'sklearn.decomposition.PCA', 'PCA', ([], {'n_components': 'nb_components'}), '(n_components=nb_components)\n', (812, 840), False, 'from sklearn.decompos... |
import numpy as np
from rampwf.utils import BaseGenerativeRegressor
class GenerativeRegressor(BaseGenerativeRegressor):
def __init__(self, max_dists, target_dim):
self.decomposition = 'autoregressive'
def fit(self, X_array, y_array):
pass
def predict(self, X_array):
# constant p... | [
"numpy.full",
"numpy.zeros",
"numpy.ones",
"numpy.concatenate"
] | [((431, 475), 'numpy.full', 'np.full', ([], {'shape': '(n_samples, 1)', 'fill_value': '(10)'}), '(shape=(n_samples, 1), fill_value=10)\n', (438, 475), True, 'import numpy as np\n'), ((493, 517), 'numpy.zeros', 'np.zeros', (['(n_samples, 1)'], {}), '((n_samples, 1))\n', (501, 517), True, 'import numpy as np\n'), ((536, ... |
import numpy as np
import tensorflow as tf
def deconv_layer(output_shape, filter_shape, activation, strides, name):
scale = 1.0 / np.prod(filter_shape[:3])
seed = int(np.random.randint(0, 1000)) # 123
with tf.name_scope('conv_mnist/conv'):
W = tf.Variable(tf.random_uniform(filter_shape,
... | [
"tensorflow.nn.conv2d",
"numpy.prod",
"numpy.sqrt",
"tensorflow.nn.relu",
"tensorflow.split",
"tensorflow.random_uniform",
"numpy.random.randint",
"tensorflow.nn.sigmoid",
"tensorflow.name_scope",
"tensorflow.matmul",
"tensorflow.nn.conv2d_transpose",
"tensorflow.trainable_variables",
"tenso... | [((1354, 1376), 'numpy.arange', 'np.arange', (['(0)', 'N_layers'], {}), '(0, N_layers)\n', (1363, 1376), True, 'import numpy as np\n'), ((1604, 1626), 'numpy.arange', 'np.arange', (['(0)', 'N_layers'], {}), '(0, N_layers)\n', (1613, 1626), True, 'import numpy as np\n'), ((3784, 3820), 'tensorflow.trainable_variables', ... |
import typing
from collections import Counter
import numpy as np
from pytest import approx
from zero_play.connect4.game import Connect4State
from zero_play.game_state import GameState
from zero_play.heuristic import Heuristic
from zero_play.mcts_player import SearchNode, MctsPlayer, SearchManager
from zero_play.playo... | [
"pytest.approx",
"zero_play.playout.Playout",
"zero_play.tictactoe.state.TicTacToeState",
"zero_play.mcts_player.MctsPlayer",
"zero_play.connect4.game.Connect4State",
"collections.Counter",
"numpy.stack",
"zero_play.mcts_player.SearchNode",
"numpy.array",
"numpy.random.seed",
"numpy.nonzero",
... | [((1770, 1796), 'zero_play.tictactoe.state.TicTacToeState', 'TicTacToeState', (['board_text'], {}), '(board_text)\n', (1784, 1796), False, 'from zero_play.tictactoe.state import TicTacToeState\n'), ((1908, 1925), 'zero_play.mcts_player.SearchNode', 'SearchNode', (['board'], {}), '(board)\n', (1918, 1925), False, 'from ... |
from dudes.Ranks import Ranks
import numpy as np
import sys
def printDebug(DEBUG, l):
if DEBUG: sys.stderr.write(str(l) + "\n")
def group_max(groups, data, pre_order=None):
if pre_order is None:
order = np.lexsort((data, groups))
else:
order = pre_order
groups = groups[order] #this is only needed if grou... | [
"numpy.lexsort",
"dudes.Ranks.Ranks.ranks.index"
] | [((870, 893), 'dudes.Ranks.Ranks.ranks.index', 'Ranks.ranks.index', (['rank'], {}), '(rank)\n', (887, 893), False, 'from dudes.Ranks import Ranks\n'), ((213, 239), 'numpy.lexsort', 'np.lexsort', (['(data, groups)'], {}), '((data, groups))\n', (223, 239), True, 'import numpy as np\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 3 10:27:25 2019
@author: alishbaimran
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from imutils import paths
from sklearn.metrics import classification_report
from sklearn.metrics import accuracy_score
f... | [
"matplotlib.pyplot.ylabel",
"keras.preprocessing.image.ImageDataGenerator",
"keras.optimizers.SGD",
"imutils.paths.list_images",
"keras.layers.Dense",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.style.use",
"keras.models.Model",
"keras.callbacks.EarlyStopping",
"keras.applicat... | [((1032, 1090), 'keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {'rescale': '(1.0 / 255)', 'fill_mode': '"""nearest"""'}), "(rescale=1.0 / 255, fill_mode='nearest')\n", (1050, 1090), False, 'from keras.preprocessing.image import ImageDataGenerator\n'), ((1125, 1183), 'keras.preprocessing.imag... |
### DEPRECATE THESE? OLD VERSIONS OF CLEANING FUNCTIONS FOR JUST EBIKES
### NO LONGER WORKING WITH THESE
import pandas as pd
import numpy as np
from shapely.geometry import Point
import geopandas as gpd
from cabi.utils import which_anc, station_anc_dict
from cabi.get_data import anc_gdf
gdf = anc_gdf()
anc_dict = st... | [
"pandas.read_pickle",
"numpy.select",
"cabi.utils.station_anc_dict",
"cabi.get_data.anc_gdf",
"pandas.DataFrame"
] | [((297, 306), 'cabi.get_data.anc_gdf', 'anc_gdf', ([], {}), '()\n', (304, 306), False, 'from cabi.get_data import anc_gdf\n'), ((318, 336), 'cabi.utils.station_anc_dict', 'station_anc_dict', ([], {}), '()\n', (334, 336), False, 'from cabi.utils import which_anc, station_anc_dict\n'), ((533, 579), 'pandas.read_pickle', ... |
"""
Copyright (C) 2022 <NAME>
Released under MIT License. See the file LICENSE for details.
This module describes 2D/3D tracks. GUTS's output is a list of instances
of these classes.
"""
import numpy as np
from filter import filter2D, filter3D
from options import Options, Filter2DParams, Filter3DPa... | [
"numpy.mean",
"numpy.abs",
"util.dict_merge",
"util.to_aabb",
"filter.filter2D",
"util.weighted_angle",
"filter.filter3D",
"numpy.array",
"util.dict_copy",
"numpy.isnan",
"numpy.arctan2",
"activecorners.activecorners",
"position.Position",
"util.vector_dist"
] | [((3262, 3439), 'filter.filter2D', 'filter2D', (['[x, y]', '[x2 - x1, y2 - y1]'], {'P_factor': 'p.P_factor', 'Q_c': 'p.Q_c', 'Q_s': 'p.Q_s', 'Q_v': 'p.Q_v', 'Q_ds': 'p.Q_ds', 'Q_a': 'p.Q_a', 'Q_cov': 'p.Q_cov', 'Q_scov': 'p.Q_scov', 'R_c': 'p.R_c', 'R_s': 'p.R_s'}), '([x, y], [x2 - x1, y2 - y1], P_factor=p.P_factor, Q_... |
import numpy.random as rand
import numpy as np
import pandas as pd
import random
import math
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.animation import FuncAnimation
from Particle import Particle
#Initialization of the plots
fig = plt.figure(figsize=(20,10))
axes = [None... | [
"random.uniform",
"numpy.random.random_sample",
"pandas.read_csv",
"Particle.Particle",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.figure",
"numpy.zeros",
"matplotlib.pyplot.show"
] | [((280, 308), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(20, 10)'}), '(figsize=(20, 10))\n', (290, 308), True, 'import matplotlib.pyplot as plt\n'), ((926, 950), 'numpy.zeros', 'np.zeros', (['total_n_values'], {}), '(total_n_values)\n', (934, 950), True, 'import numpy as np\n'), ((962, 1014), 'Particl... |
from railrl.data_management.simple_replay_pool import SimpleReplayPool
from railrl.predictors.dynamics_model import FullyConnectedEncoder, InverseModel, ForwardModel
import tensorflow as tf
import time
import numpy as np
from sandbox.rocky.tf.optimizers.penalty_lbfgs_optimizer import PenaltyLbfgsOptimizer
from railrl.m... | [
"numpy.clip",
"tensorflow.shape",
"numpy.random.rand",
"tensorflow.get_variable",
"tensorflow.get_default_session",
"tensorflow.gradients",
"numpy.argsort",
"tensorflow.contrib.opt.ScipyOptimizerInterface",
"numpy.moveaxis",
"numpy.linalg.norm",
"numpy.cov",
"railrl.misc.pyhelper_fns.vis_utils... | [((886, 937), 'tensorflow.op_scope', 'tf.op_scope', (['[params, indices]', 'name', '"""gather_cols"""'], {}), "([params, indices], name, 'gather_cols')\n", (897, 937), True, 'import tensorflow as tf\n'), ((987, 1030), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['params'], {'name': '"""params"""'}), "(para... |
import os
import json
import math
from neuralparticles.tensorflow.tools.hyper_parameter import HyperParameter, ValueType, SearchType
from neuralparticles.tensorflow.tools.hyper_search import HyperSearch
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import keras
from neuralparticles.tensor... | [
"neuralparticles.tools.data_helpers.extract_particles",
"numpy.count_nonzero",
"neuralparticles.tensorflow.tools.eval_helpers.EvalCallback",
"numpy.arange",
"os.path.exists",
"keras.utils.plot_model",
"neuralparticles.tensorflow.models.PUNet.PUNet",
"neuralparticles.tools.data_helpers.load_patches_fro... | [((224, 245), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (238, 245), False, 'import matplotlib\n'), ((1881, 1905), 'os.mkdir', 'os.mkdir', (['tmp_model_path'], {}), '(tmp_model_path)\n', (1889, 1905), False, 'import os\n'), ((1943, 1966), 'os.mkdir', 'os.mkdir', (['tmp_eval_path'], {}), '(tmp... |
# see https://www.spinningbytes.com/resources/germansentiment/ and https://github.com/aritter/twitter_download for obtaining the data.
import os
from pathlib import Path
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from conversion import convert_examples_to_features, conv... | [
"numpy.savez",
"pathlib.Path",
"sklearn.model_selection.train_test_split",
"conversion.convert_text_to_examples",
"numpy.logical_not",
"os.path.join",
"numpy.array",
"conversion.convert_examples_to_features",
"numpy.load"
] | [((990, 1049), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': 'test_size', 'random_state': '(0)'}), '(X, y, test_size=test_size, random_state=0)\n', (1006, 1049), False, 'from sklearn.model_selection import train_test_split\n'), ((421, 461), 'os.path.join', 'os.path.join', ([... |
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"tensorflow.compat.v1.placeholder",
"lpot.Benchmark",
"lpot.adaptor.tf_utils.util.get_slim_graph",
"argparse.ArgumentParser",
"tensorflow.compat.v1.logging.set_verbosity",
"tensorflow.compat.v1.app.run",
"tensorflow.compat.v1.disable_eager_execution",
"lpot.Quantization",
"numpy.array",
"copy.deep... | [((805, 867), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.compat.v1.logging.set_verbosity', (['tf.compat.v1.logging.ERROR'], {}), '(tf.compat.v1.logging.ERROR)\n', (839, 867), True, 'import tensorflow as tf\n'), ((868, 906), 'tensorflow.compat.v1.disable_eager_execution', 'tf.compat.v1.disable_eager_execution', (... |
import numpy as np
from models import *
from datasets import *
from util import parse_funct_arguments
import pickle
import itertools
def mse(y_true, y_mdl):
return np.mean((y_true - y_mdl)**2)
def train(mdl, dset):
# Get train
u_train, y_train = dset.get_train()
# Fit
X_train, z_train = construc... | [
"numpy.mean",
"pickle.dump",
"argparse.ArgumentParser",
"tqdm.tqdm.write",
"tqdm.tqdm",
"os.path.isdir",
"util.parse_funct_arguments",
"numpy.concatenate",
"numpy.random.seed",
"pandas.DataFrame",
"os.mkdir",
"numpy.logspace"
] | [((170, 200), 'numpy.mean', 'np.mean', (['((y_true - y_mdl) ** 2)'], {}), '((y_true - y_mdl) ** 2)\n', (177, 200), True, 'import numpy as np\n'), ((1948, 2054), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Estimate NARX model for different n features / n samples rate."""'}), "(descript... |
""" Plot data split by compartments
Classes:
* :py:class:`CompartmentPlot`: compartment plotting tool
"""
# Standard lib
from typing import Tuple, Optional, Dict
# 3rd party imports
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
# Our own imports
from .styling impo... | [
"numpy.nanstd",
"numpy.nanpercentile",
"numpy.logical_and",
"numpy.max",
"numpy.argsort",
"numpy.nanmean",
"numpy.stack",
"numpy.linspace",
"numpy.isnan",
"numpy.isfinite",
"numpy.min",
"pandas.DataFrame",
"matplotlib.pyplot.subplots"
] | [((2280, 2298), 'numpy.argsort', 'np.argsort', (['values'], {}), '(values)\n', (2290, 2298), True, 'import numpy as np\n'), ((3264, 3293), 'numpy.nanmean', 'np.nanmean', (['bin_value'], {'axis': '(1)'}), '(bin_value, axis=1)\n', (3274, 3293), True, 'import numpy as np\n'), ((3312, 3340), 'numpy.nanstd', 'np.nanstd', ([... |
import tensorflow as tf
from tensorflow.keras.layers import Layer, Dense, Reshape, Embedding, Concatenate, Conv2D
from tensorflow.keras.models import Model
import numpy as np
class SelfAttention(Model):
def __init__(self, d_model, spatial_dims, positional_encoding=True, name="self_attention"):
'''
... | [
"numpy.prod",
"tensorflow.shape",
"tensorflow.math.sqrt",
"tensorflow.keras.layers.Embedding",
"tensorflow.range",
"tensorflow.keras.layers.Dense",
"tensorflow.matmul",
"tensorflow.nn.softmax",
"tensorflow.reshape",
"tensorflow.identity"
] | [((3406, 3439), 'tensorflow.matmul', 'tf.matmul', (['q', 'k'], {'transpose_b': '(True)'}), '(q, k, transpose_b=True)\n', (3415, 3439), True, 'import tensorflow as tf\n'), ((3719, 3766), 'tensorflow.nn.softmax', 'tf.nn.softmax', (['scaled_attention_logits'], {'axis': '(-1)'}), '(scaled_attention_logits, axis=-1)\n', (37... |
'''
Collect results in Quantum ESPRESSO
'''
import sys
import numpy as np
from pymatgen.core import Structure
from . import structure as qe_structure
from ... import utility
from ...IO import pkl_data
from ...IO import read_input as rin
def collect_qe(current_id, work_path):
# ---------- check optimization in ... | [
"pymatgen.core.Structure",
"numpy.array",
"numpy.isnan"
] | [((2478, 2494), 'numpy.isnan', 'np.isnan', (['energy'], {}), '(energy)\n', (2486, 2494), True, 'import numpy as np\n'), ((3957, 3993), 'numpy.array', 'np.array', (['energy_step'], {'dtype': '"""float"""'}), "(energy_step, dtype='float')\n", (3965, 3993), True, 'import numpy as np\n'), ((6166, 6198), 'numpy.array', 'np.... |
import numpy as np
def projective(coords):
""" Convert 2D cartesian coordinates to homogeneus/projective. """
num = np.shape(coords)[0]
w = np.array([[1], ]*num)
return np.append(coords, w, axis=1)
def cartesian(coords):
""" Convert 2D homogeneus/projective coordinates to cartesian. """
ret... | [
"numpy.append",
"numpy.array",
"numpy.cos",
"numpy.sin",
"numpy.shape"
] | [((154, 175), 'numpy.array', 'np.array', (['([[1]] * num)'], {}), '([[1]] * num)\n', (162, 175), True, 'import numpy as np\n'), ((188, 216), 'numpy.append', 'np.append', (['coords', 'w'], {'axis': '(1)'}), '(coords, w, axis=1)\n', (197, 216), True, 'import numpy as np\n'), ((411, 454), 'numpy.array', 'np.array', (['[[1... |
import argparse
import os
import math
# import time
import numpy as np
import cv2
import matplotlib.pyplot as plt
import tensorflow as tf
import progressbar
from waymo_open_dataset.utils import range_image_utils
from waymo_open_dataset.utils import transform_utils
from waymo_open_dataset.utils import test_utils
from ... | [
"matplotlib.pyplot.grid",
"tensorflow.enable_eager_execution",
"numpy.column_stack",
"numpy.array",
"progressbar.Percentage",
"tensorflow.ones_like",
"os.walk",
"matplotlib.pyplot.imshow",
"os.path.exists",
"os.listdir",
"argparse.ArgumentParser",
"os.mkdir",
"numpy.concatenate",
"matplotl... | [((27285, 27360), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Save Waymo dataset into Kitti format"""'}), "(description='Save Waymo dataset into Kitti format')\n", (27308, 27360), False, 'import argparse\n'), ((2400, 2427), 'tensorflow.enable_eager_execution', 'tf.enable_eager_executi... |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 10 13:52:52 2022
@author: sarangbhagwat
"""
from biorefineries.TAL.system_TAL_adsorption_glucose import *
from matplotlib import pyplot as plt
import numpy as np
column = AC401
#%% Across regeneration fluid velocity and cycle time
def MPSP_at_adsorption_design(v, t):
... | [
"numpy.where",
"matplotlib.pyplot.plot",
"numpy.linspace",
"numpy.min",
"matplotlib.pyplot.subplots"
] | [((448, 474), 'numpy.linspace', 'np.linspace', (['(3.0)', '(20.0)', '(40)'], {}), '(3.0, 20.0, 40)\n', (459, 474), True, 'import numpy as np\n'), ((487, 512), 'numpy.linspace', 'np.linspace', (['(1.0)', '(4.0)', '(40)'], {}), '(1.0, 4.0, 40)\n', (498, 512), True, 'import numpy as np\n'), ((977, 997), 'numpy.min', 'np.m... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import shutil
import argparse
import subprocess
import numpy as np
import contextlib
import onnx
from cvi_toolkit.utils.mlir_shell import *
from cvi_toolkit.utils.intermediate_file import IntermediateFile
@contextlib.contextmanager
def pushd(new_dir):
previous... | [
"os.path.exists",
"numpy.savez",
"os.makedirs",
"argparse.ArgumentParser",
"subprocess.run",
"os.path.join",
"os.getcwd",
"os.chdir",
"os.path.split",
"numpy.max",
"numpy.random.randint",
"numpy.isnan",
"onnx.load",
"shutil.rmtree",
"cvi_toolkit.utils.intermediate_file.IntermediateFile",... | [((327, 338), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (336, 338), False, 'import os\n'), ((343, 360), 'os.chdir', 'os.chdir', (['new_dir'], {}), '(new_dir)\n', (351, 360), False, 'import os\n'), ((5242, 5267), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (5265, 5267), False, 'import argpa... |
import numpy as np
def validate_1d_array(x, size=None):
'''Validate type and dimensions of an object x.'''
assert isinstance(x, np.ndarray), 'Expecting a numpy array.'
assert x.ndim == 1, 'Expecting a one-dimensional array.'
if size is not None:
assert x.size == size, 'Array size is differen... | [
"numpy.round"
] | [((885, 896), 'numpy.round', 'np.round', (['x'], {}), '(x)\n', (893, 896), True, 'import numpy as np\n')] |
#!/usr/bin/env python
#
# Copyright 2019 DFKI GmbH.
#
# 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... | [
"numpy.array",
"heapq.heappush",
"heapq.heappop",
"numpy.linalg.norm"
] | [((4192, 4224), 'numpy.linalg.norm', 'np.linalg.norm', (['(s.center - point)'], {}), '(s.center - point)\n', (4206, 4224), True, 'import numpy as np\n'), ((4819, 4868), 'numpy.linalg.norm', 'np.linalg.norm', (['(self.segments[idx].center - point)'], {}), '(self.segments[idx].center - point)\n', (4833, 4868), True, 'imp... |
from sklearn.metrics import mean_squared_error, log_loss
from keras.models import Model
from keras.models import load_model
from keras.layers import Input, Dense
from keras.layers.recurrent import SimpleRNN
from keras.layers.merge import multiply, concatenate, add
from keras import backend as K
from keras import initia... | [
"numpy.random.rand",
"keras.backend.sum",
"keras.initializers.Identity",
"keras.backend.cast_to_floatx",
"numpy.log",
"numpy.array",
"sys.exit",
"keras.layers.Dense",
"numpy.mean",
"keras.layers.merge.multiply",
"numpy.reshape",
"keras.layers.merge.concatenate",
"keras.initializers.Ones",
... | [((583, 601), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (597, 601), True, 'import numpy as np\n'), ((27585, 27605), 'numpy.random.rand', 'np.random.rand', (['(3)', '(2)'], {}), '(3, 2)\n', (27599, 27605), True, 'import numpy as np\n'), ((27627, 27661), 'numpy.array', 'np.array', (['[[1, 0], [0, 1... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.animation as animation
class animacija2D:
def __init__(self, f, xInterval, yInterval, fN=20):
""" Priprava grafa in skiciranje funkcije. """
self.f = f
self.xlim = xInterval
self.ylim = y... | [
"numpy.amin",
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.zeros",
"numpy.meshgrid",
"numpy.amax",
"matplotlib.pyplot.show"
] | [((386, 429), 'numpy.linspace', 'np.linspace', (['self.xlim[0]', 'self.xlim[1]', '(30)'], {}), '(self.xlim[0], self.xlim[1], 30)\n', (397, 429), True, 'import numpy as np\n'), ((442, 485), 'numpy.linspace', 'np.linspace', (['self.ylim[0]', 'self.ylim[1]', '(30)'], {}), '(self.ylim[0], self.ylim[1], 30)\n', (453, 485), ... |
'''
本模块用于数据预处理
This module is used for data preproccessing
'''
import numpy as np
from maysics.utils import e_distances
from matplotlib import pyplot as plt
plt.rcParams['font.sans-serif'] = ['FangSong']
plt.rcParams['axes.unicode_minus'] = False
from io import BytesIO
from lxml import etree
import base64
import math
... | [
"numpy.random.get_state",
"numpy.random.set_state",
"numpy.hstack",
"base64.b64encode",
"io.BytesIO",
"numpy.ascontiguousarray",
"maysics.utils.e_distances",
"numpy.array",
"numpy.argsort",
"lxml.etree.HTML",
"numpy.cov",
"lxml.etree.ElementTree",
"IPython.core.display.HTML",
"matplotlib.p... | [((350, 361), 'numpy.cov', 'np.cov', (['arg'], {}), '(arg)\n', (356, 361), True, 'import numpy as np\n'), ((647, 674), 'numpy.array', 'np.array', (['data'], {'dtype': 'float'}), '(data, dtype=float)\n', (655, 674), True, 'import numpy as np\n'), ((1968, 1996), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['data.... |
#!/usr/bin/env python
"""
setup.py file for SWIG Interface of Ext
"""
import os
import platform
import re
import subprocess
import sys
from distutils.version import LooseVersion
from os import walk
import numpy
import wget
from setuptools import Extension
from setuptools import setup, find_packages
from setuptools.co... | [
"numpy.get_numpy_include",
"wget.download",
"os.path.exists",
"re.compile",
"setuptools.setup",
"setuptools.Extension",
"platform.system",
"numpy.get_include",
"os.path.abspath"
] | [((2713, 2939), 'setuptools.Extension', 'Extension', (['"""EggNetExtension._EggNetExtension"""'], {'sources': 'source_files', 'include_dirs': 'include_dirs', 'swig_opts': "['-py3']", 'extra_compile_args': 'extra_args', 'extra_link_args': 'extra_link_args', 'depends': "['numpy']", 'optional': '(False)'}), "('EggNetExten... |
##
## Software PI-Net: Pose Interacting Network for Multi-Person Monocular 3D Pose Estimation
## Copyright Inria and UPC
## Year 2021
## Contact : <EMAIL>
##
## The software PI-Net is provided under MIT License.
##
#used in train for skeleton input
import os
import os.path as osp
import numpy as np
import math
from ut... | [
"numpy.ones",
"utils.pose_utils.warp_coord_to_original",
"json.dump",
"os.path.join",
"pycocotools.coco.COCO",
"math.sqrt",
"numpy.max",
"numpy.array",
"numpy.concatenate",
"utils.pose_utils.pixel2cam"
] | [((1105, 1143), 'os.path.join', 'osp.join', (['cfg.data_dir', '"""MuCo"""', '"""data"""'], {}), "(cfg.data_dir, 'MuCo', 'data')\n", (1113, 1143), True, 'import os.path as osp\n'), ((2129, 2156), 'pycocotools.coco.COCO', 'COCO', (['self.train_annot_path'], {}), '(self.train_annot_path)\n', (2133, 2156), False, 'from pyc... |
from __future__ import absolute_import
from sklearn.exceptions import NotFittedError
from sklearn.neighbors import KernelDensity
from sklearn.linear_model import LinearRegression, LogisticRegression
import pickle
import os
import matplotlib.pylab as plt
from sklearn.externals import joblib
import numpy as np
from sklea... | [
"logging.getLogger",
"sklearn.exceptions.NotFittedError",
"numpy.log",
"matplotlib.pylab.show",
"os.path.exists",
"numpy.multiply",
"seaborn.distplot",
"sklearn.neighbors.KernelDensity",
"numpy.max",
"numpy.linspace",
"matplotlib.pylab.plot",
"matplotlib.pylab.xlabel",
"sklearn.linear_model.... | [((486, 591), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""logfile.log"""', 'level': 'logging.DEBUG', 'format': 'logger_format', 'filemode': '"""w"""'}), "(filename='logfile.log', level=logging.DEBUG, format=\n logger_format, filemode='w')\n", (505, 591), False, 'import logging\n'), ((667, 694... |
"""
=========================================
Robust line model estimation using RANSAC
=========================================
In this example we see how to robustly fit a line model to faulty data using
the RANSAC (random sample consensus) algorithm.
Firstly the data are generated by adding a gaussian noise to a ... | [
"numpy.random.normal",
"numpy.sqrt",
"numpy.column_stack",
"skimage.measure.LineModelND",
"numpy.array",
"skimage.measure.ransac",
"matplotlib.pyplot.figure",
"numpy.random.seed",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((1667, 1689), 'numpy.random.seed', 'np.random.seed', ([], {'seed': '(1)'}), '(seed=1)\n', (1681, 1689), True, 'import numpy as np\n'), ((1726, 1746), 'numpy.arange', 'np.arange', (['(-200)', '(200)'], {}), '(-200, 200)\n', (1735, 1746), True, 'import numpy as np\n'), ((1771, 1794), 'numpy.column_stack', 'np.column_st... |
import os, pickle
import os.path as osp
import numpy as np
import cv2
import scipy.ndimage as nd
import init_path
from lib.dataset.get_dataset import get_dataset
from lib.network.sgan import SGAN
import torch
from torch.utils.data import DataLoader
import argparse
from ipdb import set_trace
import matplotlib.pyplot as... | [
"torch.from_numpy",
"numpy.argsort",
"numpy.array",
"scipy.ndimage.zoom",
"os.path.exists",
"argparse.ArgumentParser",
"numpy.where",
"numpy.max",
"os.mkdir",
"lib.network.sgan.SGAN",
"numpy.ones",
"numpy.argmax",
"torch.device",
"os.makedirs",
"os.path.join",
"numpy.sum",
"numpy.zer... | [((922, 959), 'numpy.array', 'np.array', (['[104.008, 116.669, 122.675]'], {}), '([104.008, 116.669, 122.675])\n', (930, 959), True, 'import numpy as np\n'), ((686, 711), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (709, 711), False, 'import argparse\n'), ((816, 852), 'lib.utils.pyutils.read... |
import unittest
import numpy as np
import tensorflow as tf
from megnet.losses import mean_squared_error_with_scale
class TestLosses(unittest.TestCase):
def test_mse(self):
x = np.array([0.1, 0.2, 0.3])
y = np.array([0.05, 0.15, 0.25])
loss = mean_squared_error_with_scale(x, y, scale=100)... | [
"unittest.main",
"numpy.array",
"numpy.mean",
"megnet.losses.mean_squared_error_with_scale"
] | [((428, 443), 'unittest.main', 'unittest.main', ([], {}), '()\n', (441, 443), False, 'import unittest\n'), ((192, 217), 'numpy.array', 'np.array', (['[0.1, 0.2, 0.3]'], {}), '([0.1, 0.2, 0.3])\n', (200, 217), True, 'import numpy as np\n'), ((230, 258), 'numpy.array', 'np.array', (['[0.05, 0.15, 0.25]'], {}), '([0.05, 0... |
import matplotlib.pyplot as plt
import numpy as np
def count_harmonic_numbers(n: int):
count = 0
for i in range(1, n+1): # 1 ~ N まで
for _ in range(i, n+1, i): # N以下の i の倍数
count += 1
return count
x = np.linspace(1, 10**5, 100, dtype='int')
y = list(map(lambda x: count_harmonic_numb... | [
"numpy.log",
"matplotlib.pyplot.plot",
"numpy.linspace",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((238, 279), 'numpy.linspace', 'np.linspace', (['(1)', '(10 ** 5)', '(100)'], {'dtype': '"""int"""'}), "(1, 10 ** 5, 100, dtype='int')\n", (249, 279), True, 'import numpy as np\n'), ((370, 399), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y'], {'label': '"""count"""'}), "(x, y, label='count')\n", (378, 399), True, '... |
import pathlib
import numpy as np
def create_submission(path: pathlib.Path, predictions):
pred_with_id = np.stack([np.arange(len(predictions)), predictions], axis=1)
np.savetxt(
fname=path,
X=pred_with_id,
fmt="%d",
delimiter=",",
header="id,label",
comments=""... | [
"numpy.savetxt"
] | [((177, 277), 'numpy.savetxt', 'np.savetxt', ([], {'fname': 'path', 'X': 'pred_with_id', 'fmt': '"""%d"""', 'delimiter': '""","""', 'header': '"""id,label"""', 'comments': '""""""'}), "(fname=path, X=pred_with_id, fmt='%d', delimiter=',', header=\n 'id,label', comments='')\n", (187, 277), True, 'import numpy as np\n... |
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 20 17:12:53 2014
author: <NAME>
"""
import numpy as np
from statsmodels.regression.linear_model import OLS, WLS
from statsmodels.sandbox.regression.predstd import wls_prediction_std
def test_predict_se():
# this test doesn't use reference values
# checks conis... | [
"numpy.random.normal",
"statsmodels.sandbox.regression.predstd.wls_prediction_std",
"numpy.sqrt",
"numpy.ones",
"numpy.testing.assert_equal",
"statsmodels.regression.linear_model.WLS",
"numpy.testing.assert_allclose",
"numpy.testing.assert_raises",
"numpy.testing.assert_almost_equal",
"numpy.dot",... | [((427, 454), 'numpy.linspace', 'np.linspace', (['(0)', '(20)', 'nsample'], {}), '(0, 20, nsample)\n', (438, 454), True, 'import numpy as np\n'), ((508, 525), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (522, 525), True, 'import numpy as np\n'), ((587, 602), 'numpy.dot', 'np.dot', (['x', 'beta'], {})... |
from __future__ import division
import numpy as np
def SoftmaxLoss2(w, X, y, k):
# w(feature*class,1) - weights for last class assumed to be 0
# X(instance,feature)
# y(instance,1)
#
# version of SoftmaxLoss where weights for last class are fixed at 0
# to avoid overparameterization
n, ... | [
"numpy.ravel",
"numpy.zeros",
"numpy.log"
] | [((509, 529), 'numpy.zeros', 'np.zeros', (['(p, k - 1)'], {}), '((p, k - 1))\n', (517, 529), True, 'import numpy as np\n'), ((684, 695), 'numpy.ravel', 'np.ravel', (['g'], {}), '(g)\n', (692, 695), True, 'import numpy as np\n'), ((384, 400), 'numpy.zeros', 'np.zeros', (['(p, 1)'], {}), '((p, 1))\n', (392, 400), True, '... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 09 february, 2021
Testing suite for BNetwork class
@author: <NAME>
@email: <EMAIL>
@date: 09 february, 2021
"""
import unittest
import os
import numpy as np
from topopy import Flow, Basin, Network, BNetwork, DEM
from topopy.network import NetworkError
infol... | [
"topopy.BNetwork",
"os.remove",
"numpy.array",
"numpy.random.randint",
"numpy.array_equal",
"unittest.main",
"topopy.Basin"
] | [((6743, 6758), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6756, 6758), False, 'import unittest\n'), ((3650, 3684), 'topopy.BNetwork', 'BNetwork', (['net', 'cuencas', 'heads', 'bid'], {}), '(net, cuencas, heads, bid)\n', (3658, 3684), False, 'from topopy import Flow, Basin, Network, BNetwork, DEM\n'), ((4599,... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from six.moves import xrange
from util import log
from pprint import pprint
from input_ops import create_input_ops
from model import Model
import os
import time
import tensorflow as tf
import tensorflow.contr... | [
"model.Model",
"datasets.synthia.create_default_splits",
"tensorflow.contrib.framework.get_or_create_global_step",
"six.moves.xrange",
"input_ops.create_input_ops",
"tensorflow.GPUOptions",
"pprint.pprint",
"util.log.warning",
"os.path.exists",
"argparse.ArgumentParser",
"numpy.asarray",
"tens... | [((10788, 10813), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (10811, 10813), False, 'import argparse\n'), ((16457, 16504), 'datasets.synthia.create_default_splits', 'dataset.create_default_splits', (['config.num_input'], {}), '(config.num_input)\n', (16486, 16504), True, 'import datasets.sy... |
import numpy as np
import scipy.linalg as la
from scipy.stats import multinomial
def random_multivar_normal(n, d, k, sigma=.1):
'''
Generate random samples from a random multivariate normal distribution
with covariance A A^T + sigma^2 I.
Input:
n: int, number of samples
d: int, dimensio... | [
"scipy.linalg.eigh",
"numpy.eye",
"numpy.random.rand",
"numpy.diag_indices",
"scipy.stats.multinomial.cov",
"numpy.random.multinomial",
"numpy.random.dirichlet",
"numpy.zeros",
"numpy.outer"
] | [((2998, 3015), 'numpy.random.rand', 'np.random.rand', (['d'], {}), '(d)\n', (3012, 3015), True, 'import numpy as np\n'), ((3408, 3420), 'scipy.linalg.eigh', 'la.eigh', (['cov'], {}), '(cov)\n', (3415, 3420), True, 'import scipy.linalg as la\n'), ((4563, 4580), 'numpy.random.rand', 'np.random.rand', (['d'], {}), '(d)\n... |
#!/usr/bin/python
import numpy as np
import os
import pymaster as nmt
import pytest
import tjpcov.main as cv
from tjpcov.parser import parse
import yaml
import sacc
root = "./tests/benchmarks/32_DES_tjpcov_bm/"
input_yml = os.path.join(root, "tjpcov_conf_minimal.yaml")
input_yml_no_nmtc = os.path.join(root, "tjpcov_c... | [
"pymaster.NmtWorkspace",
"numpy.abs",
"pymaster.NmtCovarianceWorkspace",
"numpy.delete",
"os.path.join",
"tjpcov.parser.parse",
"numpy.diag",
"pytest.mark.parametrize",
"numpy.array",
"yaml.safe_load",
"numpy.zeros",
"pytest.raises",
"numpy.linalg.inv",
"os.system",
"numpy.all",
"numpy... | [((225, 271), 'os.path.join', 'os.path.join', (['root', '"""tjpcov_conf_minimal.yaml"""'], {}), "(root, 'tjpcov_conf_minimal.yaml')\n", (237, 271), False, 'import os\n'), ((292, 349), 'os.path.join', 'os.path.join', (['root', '"""tjpcov_conf_minimal_no_nmtconf.yaml"""'], {}), "(root, 'tjpcov_conf_minimal_no_nmtconf.yam... |
"""
Driver program for training and evaluation.
"""
import argparse
import logging
import numpy as np
import random
import torch
import torch.optim as O
from datasets import get_dataset, get_dataset_configurations
from models import get_model
from runners import Runner
if __name__ == '__main__':
parser = argpar... | [
"logging.getLogger",
"torch.manual_seed",
"numpy.prod",
"logging.StreamHandler",
"argparse.ArgumentParser",
"runners.Runner",
"logging.Formatter",
"models.get_model",
"random.seed",
"torch.cuda.manual_seed",
"numpy.random.seed",
"datasets.get_dataset_configurations",
"datasets.get_dataset"
] | [((314, 379), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Sentence similarity models"""'}), "(description='Sentence similarity models')\n", (337, 379), False, 'import argparse\n'), ((1789, 1811), 'random.seed', 'random.seed', (['args.seed'], {}), '(args.seed)\n', (1800, 1811), False, ... |
from PIL import Image
from matplotlib import pyplot as plt
import numpy as np
names = locals()
img0 = Image.open("./assets/pyCharm.png")
# print image info:
print(img0.size, img0.format, img0.mode, np.array(img0))
# save other format
# img0.save('./assets/pyCharm.tiff')
# img0.convert('RGB').save('./assets/pyCharm.jp... | [
"PIL.Image.fromarray",
"PIL.Image.open",
"numpy.array",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot",
"PIL.Image.merge",
"matplotlib.pyplot.show"
] | [((104, 138), 'PIL.Image.open', 'Image.open', (['"""./assets/pyCharm.png"""'], {}), "('./assets/pyCharm.png')\n", (114, 138), False, 'from PIL import Image\n'), ((389, 424), 'PIL.Image.open', 'Image.open', (['"""./assets/pyCharm.tiff"""'], {}), "('./assets/pyCharm.tiff')\n", (399, 424), False, 'from PIL import Image\n'... |
import numpy as np
import pandas as pd
import pytest
from sklearn.feature_selection import SelectKBest, chi2 as sk_chi2
from inz.utils import chi2, select_k_best, split, train_test_split
def test_split_list_int():
ints = list(range(7))
want = [[0, 1, 2], [3, 4, 5], [6]]
get = list(split(ints, 3))
ass... | [
"inz.utils.train_test_split",
"inz.utils.split",
"numpy.testing.assert_equal",
"pandas.read_csv",
"inz.utils.select_k_best",
"pytest.main",
"sklearn.feature_selection.SelectKBest",
"numpy.array",
"inz.utils.chi2",
"numpy.array_equal",
"sklearn.feature_selection.chi2",
"numpy.arange"
] | [((2899, 2933), 'pandas.read_csv', 'pd.read_csv', (['"""../../data/data.csv"""'], {}), "('../../data/data.csv')\n", (2910, 2933), True, 'import pandas as pd\n'), ((3044, 3057), 'sklearn.feature_selection.chi2', 'sk_chi2', (['X', 'y'], {}), '(X, y)\n', (3051, 3057), True, 'from sklearn.feature_selection import SelectKBe... |
#!/usr/bin/env python3
import pvml
import numpy as np
import matplotlib.pyplot as plt
import argparse
from itertools import zip_longest
_NORMALIZATION = {
"none": lambda *X: (X[0] if len(X) == 1 else X),
"meanvar": pvml.meanvar_normalization,
"minmax": pvml.minmax_normalization,
"maxabs": pvml.maxabs... | [
"pvml.logreg_l1_train",
"pvml.kmeans_train",
"pvml.svm_inference",
"pvml.ksvm_train",
"numpy.argsort",
"pvml.ClassificationTree",
"pvml.binary_cross_entropy",
"pvml.ogda_inference",
"pvml.svm_train",
"pvml.perceptron_inference",
"pvml.hgda_train",
"numpy.arange",
"matplotlib.pyplot.imshow",
... | [((490, 536), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Classification demo"""'], {}), "('Classification demo')\n", (513, 536), False, 'import argparse\n'), ((21042, 21076), 'numpy.concatenate', 'np.concatenate', (['(X, Y[:, None])', '(1)'], {}), '((X, Y[:, None]), 1)\n', (21056, 21076), True, 'import... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 11 13:46:58 2019
@author: bdgecyt
"""
import cv2
import math
from time import time
import numpy as np
import wrapper
from operator import itemgetter
boxes = []
xCount = 0
yCount = 0
iter = 0
img = 0
def on_mouse(event, x, y, flags, params):
global iter
t... | [
"numpy.arccos",
"math.sqrt",
"wrapper.dealAImage",
"operator.itemgetter",
"cv2.imshow",
"numpy.argsort",
"numpy.array",
"numpy.dot",
"cv2.waitKey",
"cv2.destroyAllWindows",
"numpy.linalg.norm",
"numpy.argmin",
"numpy.degrees",
"time.time",
"cv2.imread"
] | [((323, 329), 'time.time', 'time', ([], {}), '()\n', (327, 329), False, 'from time import time\n'), ((1635, 1675), 'math.sqrt', 'math.sqrt', (['(xdiff * xdiff + ydiff * ydiff)'], {}), '(xdiff * xdiff + ydiff * ydiff)\n', (1644, 1675), False, 'import math\n'), ((2078, 2095), 'numpy.array', 'np.array', (['line[0]'], {}),... |
from flask import Flask,request,render_template
import numpy as np
from Reccomending_functions import item_item_cf,user_user_cf,rank_matrix_factorize
from Database_connector import fetch_from_database
import random
#ML Packages
asd = []
app = Flask(__name__)
@app.route('/')
def index():
global asd
randindex = [... | [
"flask.render_template",
"Reccomending_functions.item_item_cf",
"random.shuffle",
"flask.Flask",
"Database_connector.fetch_from_database",
"Reccomending_functions.user_user_cf",
"numpy.zeros",
"Reccomending_functions.rank_matrix_factorize"
] | [((243, 258), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (248, 258), False, 'from flask import Flask, request, render_template\n'), ((349, 374), 'random.shuffle', 'random.shuffle', (['randindex'], {}), '(randindex)\n', (363, 374), False, 'import random\n'), ((450, 482), 'Database_connector.fetch_from_d... |
import sqlalchemy as sa
import numpy as np
import datetime as dt
from faker import Faker
from jinja2 import Environment, PackageLoader
from database.models.core import (
Base,
Products,
Customers,
TransactionDetails,
Transactions,
)
import logging
logging.basicConfig()
logger = logging.getLogger(... | [
"logging.basicConfig",
"logging.getLogger",
"sqlalchemy.orm.sessionmaker",
"database.models.core.Base.metadata.drop_all",
"database.models.core.Base.metadata.create_all",
"database.models.core.TransactionDetails",
"sqlalchemy.schema.CreateSchema",
"sqlalchemy.create_engine",
"database.models.core.Pr... | [((271, 292), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (290, 292), False, 'import logging\n'), ((302, 329), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (319, 329), False, 'import logging\n'), ((1815, 1852), 'sqlalchemy.create_engine', 'sa.create_engine', (['conn_... |
import numpy as np
import torch
import argparse
from pina.pinn import PINN
from pina.ppinn import ParametricPINN as pPINN
from pina.label_tensor import LabelTensor
from torch.nn import ReLU, Tanh, Softplus
from pina.adaptive_functions.adaptive_softplus import AdaptiveSoftplus
from problems.parametric_elliptic_optimal_c... | [
"argparse.ArgumentParser",
"matplotlib.use",
"matplotlib.pyplot.plot",
"problems.parametric_elliptic_optimal_control_alpha_variable.ParametricEllipticOptimalControl",
"torch.tensor",
"numpy.linspace",
"pina.label_tensor.LabelTensor.hstack",
"pina.ppinn.ParametricPINN",
"matplotlib.pyplot.legend",
... | [((1735, 1774), 'problems.parametric_elliptic_optimal_control_alpha_variable.ParametricEllipticOptimalControl', 'ParametricEllipticOptimalControl', (['alpha'], {}), '(alpha)\n', (1767, 1774), False, 'from problems.parametric_elliptic_optimal_control_alpha_variable import ParametricEllipticOptimalControl\n'), ((1817, 18... |
import os
import uuid
import numpy as np
from tqdm import tqdm
import pickle
from utils.config import opt
from .voc_eval import voc_eval
devkit_path = opt.voc_data_dir[:-8]
year = opt.year
def do_python_eval(classes, image_set, output_dir='output'):
annopath = os.path.join(
devkit_path,
'VOC' + ... | [
"os.path.exists",
"numpy.mean",
"pickle.dump",
"os.makedirs",
"os.path.join",
"uuid.uuid4",
"os.path.isdir",
"os.mkdir"
] | [((269, 333), 'os.path.join', 'os.path.join', (['devkit_path', "('VOC' + year)", '"""Annotations"""', '"""{}.xml"""'], {}), "(devkit_path, 'VOC' + year, 'Annotations', '{}.xml')\n", (281, 333), False, 'import os\n'), ((386, 471), 'os.path.join', 'os.path.join', (['devkit_path', "('VOC' + year)", '"""ImageSets"""', '"""... |
#!/usr/bin/env python3
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import numpy as np
import torch as th
import torchvision
from tqdm import tqdm
def main(args):
trainloader, testloader = get_loaders(args.batch_size, args.fashion)... | [
"numpy.clip",
"numpy.copy",
"numpy.sqrt",
"argparse.ArgumentParser",
"tqdm.tqdm",
"numpy.argmax",
"numpy.square",
"numpy.zeros",
"numpy.random.uniform",
"torchvision.transforms.ToTensor",
"numpy.arange"
] | [((398, 424), 'numpy.sqrt', 'np.sqrt', (['(2.0 / (784 + 500))'], {}), '(2.0 / (784 + 500))\n', (405, 424), True, 'import numpy as np\n'), ((434, 470), 'numpy.random.uniform', 'np.random.uniform', (['(-a)', 'a', '(784, 500)'], {}), '(-a, a, (784, 500))\n', (451, 470), True, 'import numpy as np\n'), ((480, 509), 'numpy.r... |
"""
File: examples/util/rectangular_binner.py
Author: <NAME>
Date: 22 Sep 2018
Description: Example script showing the use of the RectangularBinner class.
"""
from __future__ import division
import numpy as np
import matplotlib.pyplot as pl
from pylinex import RectangularBinner
fontsize = 24
num_old_x_values = 1000
... | [
"numpy.ones_like",
"numpy.sinh",
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.sin",
"pylinex.RectangularBinner",
"matplotlib.pyplot.show"
] | [((431, 457), 'numpy.ones_like', 'np.ones_like', (['old_x_values'], {}), '(old_x_values)\n', (443, 457), True, 'import numpy as np\n'), ((566, 606), 'numpy.linspace', 'np.linspace', (['(-1)', '(1)', '(num_new_x_values + 1)'], {}), '(-1, 1, num_new_x_values + 1)\n', (577, 606), True, 'import numpy as np\n'), ((617, 643)... |
import math
import numpy as np
from scipy.special import expit, logit
import matplotlib.pyplot as plt
from mmur.viz import _set_plot_style
COLORS = _set_plot_style()
def plot_logstic_dgp(N=500, figsize=None):
"""Plot example of DGP as used in mmur.generators.LogisticGenerator.
Parameters
----------
... | [
"numpy.random.normal",
"numpy.ones",
"math.floor",
"numpy.sort",
"scipy.special.expit",
"numpy.array",
"numpy.argsort",
"scipy.special.logit",
"mmur.viz._set_plot_style",
"numpy.random.uniform",
"matplotlib.pyplot.subplots",
"numpy.random.binomial"
] | [((150, 167), 'mmur.viz._set_plot_style', '_set_plot_style', ([], {}), '()\n', (165, 167), False, 'from mmur.viz import _set_plot_style\n'), ((599, 619), 'numpy.array', 'np.array', (['(0.5, 1.2)'], {}), '((0.5, 1.2))\n', (607, 619), True, 'import numpy as np\n'), ((628, 643), 'numpy.ones', 'np.ones', (['(N, 2)'], {}), ... |
from __future__ import print_function
import sys
import os
import re
import numpy as np
import subprocess
from matplotlib import pyplot as plt
inputpath = os.path.join(os.path.realpath('..'),'INPUT/')
print("Initialising")
fig, ax = plt.subplots()
n=0
for filenum in ['INPUT/0.txt','INPUT/1.txt','INPUT/2.txt']:
os.ren... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"os.rename",
"matplotlib.pyplot.xlabel",
"numpy.max",
"os.path.realpath",
"matplotlib.pyplot.figure",
"numpy.zeros",
"subprocess.call",
"numpy.min",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((234, 248), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (246, 248), True, 'from matplotlib import pyplot as plt\n'), ((1454, 1464), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1462, 1464), True, 'from matplotlib import pyplot as plt\n'), ((169, 191), 'os.path.realpath', 'os.path.realp... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 21 20:00:50 2020
@author: takada
"""
import logging
import numpy as np
import functools
import operator
from typing import List, Dict, Callable
import time
import nidaqmx
from nidaqmx.stream_writers import (
DigitalSingleChannelWriter, AnalogMultiChannelWriter)
from... | [
"logging.getLogger",
"qcodes.dataset.sqlite.queries.get_last_run",
"functools.reduce",
"nidaqmx.Task",
"qcodes.dataset.sqlite.database.connect",
"qcodes.validators.Numbers",
"numpy.zeros",
"numpy.linspace",
"qcodes.validators.Ints",
"numpy.empty",
"qcodes.dataset.data_set.load_by_id",
"nidaqmx... | [((664, 691), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (681, 691), False, 'import logging\n'), ((29407, 29418), 'time.time', 'time.time', ([], {}), '()\n', (29416, 29418), False, 'import time\n'), ((7386, 7400), 'nidaqmx.Task', 'nidaqmx.Task', ([], {}), '()\n', (7398, 7400), False, ... |
#!/usr/bin/env python
###########################################################################
# Active Inference algorithm
#
# Execute the AI algorithm using the data from the
# /filter/y_coloured_noise topic and publish the results to the
# /filter/ai/output topic.
# Note that only the filtering part of the AI ... | [
"numpy.eye",
"numpy.sqrt",
"rospy.Subscriber",
"rospy.init_node",
"numpy.kron",
"numpy.zeros",
"numpy.linalg.inv",
"rospy.spin",
"scipy.linalg.block_diag",
"jackal_active_inference_versus_kalman_filter.msg.filt_output",
"numpy.matrix",
"rospy.Publisher",
"numpy.amax",
"numpy.cumprod"
] | [((3139, 3190), 'numpy.matrix', 'np.matrix', (['"""16.921645797507500 -16.921645797507500"""'], {}), "('16.921645797507500 -16.921645797507500')\n", (3148, 3190), True, 'import numpy as np\n'), ((3520, 3545), 'numpy.kron', 'np.kron', (['temp', 'self.x_ref'], {}), '(temp, self.x_ref)\n', (3527, 3545), True, 'import nump... |
from utils import load, save, path_list, DEAD_PMTS
import nets
import torch
import numpy as np
import pandas as pd
from scipy import interpolate
import matplotlib.pyplot as plt
from matplotlib.ticker import PercentFormatter
from itertools import repeat
from multiprocessing import Pool
def neural_residual(root_dir):... | [
"matplotlib.ticker.PercentFormatter",
"utils.load",
"numpy.array",
"numpy.linalg.norm",
"scipy.interpolate.interp2d",
"nets.Net",
"itertools.repeat",
"numpy.histogram",
"matplotlib.pyplot.close",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"nets.CNN1c",
"nets.Net2c",
"numpy.argmax",
... | [((2208, 2242), 'utils.load', 'load', (['"""src/pmtcoordinates_ID.json"""'], {}), "('src/pmtcoordinates_ID.json')\n", (2212, 2242), False, 'from utils import load, save, path_list, DEAD_PMTS\n'), ((2259, 2293), 'utils.load', 'load', (["(root_dir + '/testpaths.list')"], {}), "(root_dir + '/testpaths.list')\n", (2263, 22... |
# Copyright (c) 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Runs a power flow.
"""
from sys import stdout, stderr
from os.path import dirname, join
from time import time
from numpy import r_, c_, ix_, zeros, pi, ones... | [
"numpy.angle",
"numpy.exp",
"pypower.newtonpf_fast.newtonpf_fast",
"time.time",
"pypower.makeSbus.makeSbus"
] | [((3722, 3728), 'time.time', 'time', ([], {}), '()\n', (3726, 3728), False, 'from time import time\n'), ((4014, 4041), 'pypower.makeSbus.makeSbus', 'makeSbus', (['baseMVA', 'bus', 'gen'], {}), '(baseMVA, bus, gen)\n', (4022, 4041), False, 'from pypower.makeSbus import makeSbus\n'), ((4090, 4139), 'pypower.newtonpf_fast... |
# This program imports the federal reserve economic data consumer price index
# values from 1990 and uses those values to get the real values or infaltion adjusted
# values of the sepcific commodities/markets.
# Then when a commdoity hits a specific low infaltion based price, the algo
# enters into a long psoiton and ... | [
"numpy.zeros",
"csv.reader",
"quantiacsToolbox.runts"
] | [((516, 532), 'numpy.zeros', 'numpy.zeros', (['(328)'], {}), '(328)\n', (527, 532), False, 'import numpy\n'), ((1860, 1881), 'numpy.zeros', 'numpy.zeros', (['nMarkets'], {}), '(nMarkets)\n', (1871, 1881), False, 'import numpy\n'), ((5505, 5537), 'quantiacsToolbox.runts', 'quantiacsToolbox.runts', (['__file__'], {}), '(... |
import numpy as np
gama = 0.5
alfa = 0.75
data = np.array([[1, 1, 1], [1, 2, -1], [2, 1, 1]]) #(s, s', R)
Q = np.zeros((data.shape[0]+1, 2)) #(iterations, |S|)
k = 1
for d in range(data.shape[0]):
R = data[d, 2] #inmediate reward
idx_s = data[d, 0] - 1 # index of state s in Q
idx_sp = data[d, 1] - 1 #ind... | [
"numpy.array",
"numpy.zeros"
] | [((50, 94), 'numpy.array', 'np.array', (['[[1, 1, 1], [1, 2, -1], [2, 1, 1]]'], {}), '([[1, 1, 1], [1, 2, -1], [2, 1, 1]])\n', (58, 94), True, 'import numpy as np\n'), ((111, 143), 'numpy.zeros', 'np.zeros', (['(data.shape[0] + 1, 2)'], {}), '((data.shape[0] + 1, 2))\n', (119, 143), True, 'import numpy as np\n')] |
import os
import numpy as np
import warnings
warnings.filterwarnings('ignore')
import torch
import torch.nn as nn
from torchvision.utils import save_image
from utils import get_lr_scheduler, sample_images, inference
# Reproducibility #
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
... | [
"numpy.average",
"utils.inference",
"torch.nn.L1Loss",
"utils.get_lr_scheduler",
"torch.cuda.is_available",
"utils.sample_images",
"warnings.filterwarnings"
] | [((45, 78), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (68, 78), False, 'import warnings\n'), ((365, 390), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (388, 390), False, 'import torch\n'), ((508, 519), 'torch.nn.L1Loss', 'nn.L1Loss', ([], {}... |
##############################
## MFP_K1000.py ##
## <NAME> ##
## Version 2020.03.25 ##
##############################
import os
import os.path as osp
import time
import subprocess as spc
import numpy as np
import scipy as sp
import astropy.io.fits as fits
import h... | [
"HEALPixFunctions.increaseResolution",
"HEALPixFunctions.loadFitsFullMap",
"HEALPixFunctions.saveFitsFullMap",
"astropy.io.fits.getdata",
"numpy.zeros",
"HEALPixFunctions.RADECToPatch",
"numpy.fmin"
] | [((2281, 2302), 'astropy.io.fits.getdata', 'fits.getdata', (['name', '(1)'], {}), '(name, 1)\n', (2293, 2302), True, 'import astropy.io.fits as fits\n'), ((2653, 2679), 'numpy.zeros', 'np.zeros', (['nbPix'], {'dtype': 'int'}), '(nbPix, dtype=int)\n', (2661, 2679), True, 'import numpy as np\n'), ((3065, 3110), 'HEALPixF... |
"""
Abinit workflows
"""
from __future__ import division, print_function
import sys
import os
import os.path
import shutil
import abc
import collections
import functools
import numpy as np
from pprint import pprint
from pymatgen.core.lattice import Lattice
from pymatgen.core.structure import Structure
from pymatgen.... | [
"pymatgen.core.physical_constants.Ha2meV",
"pymatgen.util.num_utils.chunks",
"pymatgen.core.structure.Structure",
"pymatgen.util.num_utils.iterator_from_slice",
"numpy.arange",
"os.path.exists",
"shutil.move",
"pymatgen.serializers.json_coders.json_pretty_dump",
"functools.wraps",
"numpy.max",
"... | [((1455, 1478), 'functools.wraps', 'functools.wraps', (['method'], {}), '(method)\n', (1470, 1478), False, 'import functools\n'), ((24139, 24151), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (24149, 24151), True, 'import matplotlib.pyplot as plt\n'), ((9780, 9820), 'pymatgen.serializers.json_coders.json... |
import numpy as np
import cv2
import glob
import itertools
import os
from tqdm import tqdm
from ..models.config import IMAGE_ORDERING
from .augmentation import augment_seg
import random
random.seed(0)
class_colors = [ ( random.randint(0,255),random.randint(0,255),random.randint(0,255) ) for _ in range(5000) ]
... | [
"itertools.cycle",
"numpy.reshape",
"random.shuffle",
"tqdm.tqdm",
"os.path.join",
"numpy.rollaxis",
"random.seed",
"numpy.max",
"numpy.array",
"numpy.zeros",
"os.path.basename",
"cv2.resize",
"cv2.imread",
"random.randint"
] | [((189, 203), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (200, 203), False, 'import random\n'), ((1887, 1922), 'numpy.zeros', 'np.zeros', (['(height, width, nClasses)'], {}), '((height, width, nClasses))\n', (1895, 1922), True, 'import numpy as np\n'), ((2020, 2085), 'cv2.resize', 'cv2.resize', (['img', '(wi... |
# coding: utf-8
#! /usr/bin/env python
# FrequencyJumpLibrary
import numpy as np
from scipy import stats
import math as math
def KM (y, delta_t=1, Moments = [1,2,4,6,8], bandwidth = 1.5, Lowerbound = False, Upperbound = False, Kernel = 'Epanechnikov'): #Kernel-based Regression
Moments = [0] + Moments
length... | [
"math.factorial",
"numpy.zeros",
"numpy.linspace",
"numpy.unique"
] | [((437, 463), 'numpy.zeros', 'np.zeros', (['[n + Mn, length]'], {}), '([n + Mn, length])\n', (445, 463), True, 'import numpy as np\n'), ((943, 972), 'numpy.linspace', 'np.linspace', (['Min', 'Max', '(n + Mn)'], {}), '(Min, Max, n + Mn)\n', (954, 972), True, 'import numpy as np\n'), ((1049, 1081), 'numpy.unique', 'np.un... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 12 10:58:27 2020
Experiments where one marginal is fixed
"""
import os
import numpy as np
from joblib import Parallel, delayed
import torch
import ot
from unbalancedgw.batch_stable_ugw_solver import log_batch_ugw_sinkhorn
from unbalancedgw._batch_... | [
"unbalancedgw._batch_utils.compute_batch_flb_plan",
"unbalancedgw.batch_stable_ugw_solver.log_batch_ugw_sinkhorn",
"torch.cuda.device_count",
"torch.cuda.is_available",
"numpy.save",
"utils.draw_p_u_dataset_scar",
"torch.set_default_tensor_type",
"partial_gw.compute_cost_matrices",
"os.path.isdir",
... | [((461, 472), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (470, 472), False, 'import os\n'), ((497, 516), 'os.path.isdir', 'os.path.isdir', (['path'], {}), '(path)\n', (510, 516), False, 'import os\n'), ((522, 536), 'os.mkdir', 'os.mkdir', (['path'], {}), '(path)\n', (530, 536), False, 'import os\n'), ((571, 590), 'os.... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 1 18:44:04 2018
@author: JavaWizards
"""
import numpy as np
file = "/Users/nuno_chicoria/Downloads/b_should_be_easy.in"
handle = open(file)
R, C, F, N, B, T = handle.readline().split()
rides = []
index = []
for i in range(int(N)):
index.a... | [
"numpy.delete",
"numpy.asarray",
"numpy.column_stack"
] | [((397, 414), 'numpy.asarray', 'np.asarray', (['rides'], {}), '(rides)\n', (407, 414), True, 'import numpy as np\n'), ((426, 460), 'numpy.column_stack', 'np.column_stack', (['[rides_np, index]'], {}), '([rides_np, index])\n', (441, 460), True, 'import numpy as np\n'), ((1455, 1485), 'numpy.delete', 'np.delete', (['ride... |
# -*- coding: utf-8 -*-
"""A rate network for neutral hydrogen following
Katz, Weinberg & Hernquist 1996, eq. 28-32."""
import os.path
import math
import numpy as np
import scipy.interpolate as interp
import scipy.optimize
class RateNetwork(object):
"""A rate network for neutral hydrogen following
Katz, Weinbe... | [
"numpy.ones_like",
"numpy.shape",
"numpy.log10",
"numpy.sqrt",
"numpy.power",
"numpy.log",
"numpy.logical_not",
"numpy.exp",
"scipy.interpolate.InterpolatedUnivariateSpline",
"numpy.loadtxt"
] | [((3983, 4033), 'scipy.interpolate.InterpolatedUnivariateSpline', 'interp.InterpolatedUnivariateSpline', (['zz', 'gray_opac'], {}), '(zz, gray_opac)\n', (4018, 4033), True, 'import scipy.interpolate as interp\n'), ((15357, 15378), 'numpy.sqrt', 'np.sqrt', (['(temp / temp0)'], {}), '(temp / temp0)\n', (15364, 15378), Tr... |
"""Test functions for pem.fluid.ecl module
"""
import pytest
from pytest import approx
import numpy as np
import digirock.fluids.ecl as fluid_ecl
from inspect import getmembers, isfunction
@pytest.fixture
def tol():
return {
"rel": 0.05, # relative testing tolerance in percent
"abs... | [
"pytest.approx",
"digirock.fluids.ecl.oil_fvf_table",
"pytest.mark.parametrize",
"digirock.fluids.ecl.e100_oil_density",
"pytest.raises",
"numpy.loadtxt"
] | [((375, 580), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""pres, extrap, ans"""', "[(325, 'const', 1.4615), (325, 'pchip', 1.4615), (np.r_[325, 375], 'const',\n np.r_[1.4615, 1.4505]), (np.r_[325, 375], 'pchip', np.r_[1.4615, 1.4505])]"], {}), "('pres, extrap, ans', [(325, 'const', 1.4615), (325,\n ... |
'''
Created on: see version log.
@author: rigonz
coding: utf-8
IMPORTANT: requires py3.6 (rasterio)
Script that:
1) reads a series of raster files,
2) runs some checks,
3) makes charts showing the results.
The input data corresponds to a region of the world (ESP) and represents
the population density (pop/km2).
Each... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.hist",
"numpy.log10",
"matplotlib.pyplot.ylabel",
"numpy.array",
"numpy.delete",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylim",
"numpy.ceil",
"numpy.corrcoef",
"rasterio.open",
"matplotlib.pyplot.title",
"matp... | [((1327, 1352), 'rasterio.open', 'rasterio.open', (['FileNameI1'], {}), '(FileNameI1)\n', (1340, 1352), False, 'import rasterio\n'), ((1359, 1384), 'rasterio.open', 'rasterio.open', (['FileNameI2'], {}), '(FileNameI2)\n', (1372, 1384), False, 'import rasterio\n'), ((1391, 1416), 'rasterio.open', 'rasterio.open', (['Fil... |
import utils
from utils import format
import os
import tempfile
import urllib.request
import shutil
import zipfile
spire_dir = r"D:\Games\Slay the Spire Modded"
mod_dir = os.path.join("cache", "mod")
def build():
# STEP: clone FruityMod
if not os.path.exists(mod_dir):
print("Downloading {}".format("Fr... | [
"zipfile.ZipFile",
"utils.cd",
"spire.name_id",
"os.remove",
"os.path.exists",
"numpy.repeat",
"utils.format",
"tempfile.NamedTemporaryFile",
"utils.open_data",
"io.StringIO",
"numpy.round",
"numpy.ceil",
"shutil.copyfileobj",
"skimage.transform.resize",
"engi_mod.keywords.items",
"os.... | [((172, 200), 'os.path.join', 'os.path.join', (['"""cache"""', '"""mod"""'], {}), "('cache', 'mod')\n", (184, 200), False, 'import os\n'), ((800, 842), 'os.path.join', 'os.path.join', (['spire_dir', '"""ModTheSpire.jar"""'], {}), "(spire_dir, 'ModTheSpire.jar')\n", (812, 842), False, 'import os\n'), ((1375, 1421), 'os.... |
# this resizes __1.jpt to x it's original size & it turns it grayscale
import cv
import numpy
import bSpline
if __name__ == "__main__": # this is not a module
scale = 10
# load image
#cv_img = cv.LoadImage("__1.jpg", cv.CV_LOAD_IMAGE_GRAYSCALE) # CV_LOAD_IMAGE_GRAYSCALE
cv_img = cv.LoadImage("__1.jpg", cv.C... | [
"cv.GetSize",
"bSpline.cubic_setBeta",
"cv.SaveImage",
"numpy.zeros",
"bSpline.cubic_getBeta",
"cv.LoadImage"
] | [((292, 343), 'cv.LoadImage', 'cv.LoadImage', (['"""__1.jpg"""', 'cv.CV_LOAD_IMAGE_UNCHANGED'], {}), "('__1.jpg', cv.CV_LOAD_IMAGE_UNCHANGED)\n", (304, 343), False, 'import cv\n'), ((480, 541), 'numpy.zeros', 'numpy.zeros', (['(cv_img_height * scale, cv_img_width * scale, 2)'], {}), '((cv_img_height * scale, cv_img_wid... |
import lamp.modules
import torch
import numpy as np
from lamp.utils import get_activation_function
class FeedforwardNeuralNetwork(lamp.modules.BaseModule):
def __init__(self, dim_in, dim_out, architecture, dropout, outf=None, dtype = None, device = None):
super(FeedforwardNeuralNetwork, self).__init__()... | [
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.Sequential",
"lamp.utils.get_activation_function",
"numpy.linspace",
"torch.nn.Linear"
] | [((404, 425), 'torch.nn.Sequential', 'torch.nn.Sequential', ([], {}), '()\n', (423, 425), False, 'import torch\n'), ((528, 581), 'torch.nn.Linear', 'torch.nn.Linear', (['architecture[n]', 'architecture[n + 1]'], {}), '(architecture[n], architecture[n + 1])\n', (543, 581), False, 'import torch\n'), ((682, 705), 'torch.n... |
import numpy as np
import math
from scipy.sparse import csr_matrix, diags
from scipy import linalg
import time
try:
from numba import jit, njit
numbaOn = True
except ModuleNotFoundError:
numbaOn = False
if numbaOn:
@njit(["void(float64[:], f8, float64[:], float64[:], f8, f8)"])
def velocityImplNumba(u, t, ... | [
"math.pow",
"numba.njit",
"numpy.square",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"scipy.sparse.diags",
"numpy.zeros_like"
] | [((227, 289), 'numba.njit', 'njit', (["['void(float64[:], f8, float64[:], float64[:], f8, f8)']"], {}), "(['void(float64[:], f8, float64[:], float64[:], f8, f8)'])\n", (231, 289), False, 'from numba import jit, njit\n'), ((798, 852), 'numba.njit', 'njit', (["['void(float64[:], float64[:], float64[:], f8)']"], {}), "(['... |
import time
import argparse
from datetime import datetime
import logging
import numpy as np
import os
import torch
import torch.nn.functional as F
import torch.multiprocessing as mp
from models import NavCnnModel, NavCnnRnnModel, NavCnnRnnMultModel, NavPlannerControllerModel
from data import EqaDataLoader
from metrics ... | [
"metrics.NavMetric",
"models.NavCnnModel",
"torch.nn.CrossEntropyLoss",
"torch.LongTensor",
"models.get_state",
"numpy.array",
"models.MaskedNLLCriterion",
"logging.info",
"torch.nn.functional.softmax",
"os.path.exists",
"argparse.ArgumentParser",
"models.NavPlannerControllerModel",
"data.Eq... | [((3106, 3141), 'data.EqaDataLoader', 'EqaDataLoader', ([], {}), '(**eval_loader_kwargs)\n', (3119, 3141), False, 'from data import EqaDataLoader\n'), ((34031, 34067), 'data.EqaDataLoader', 'EqaDataLoader', ([], {}), '(**train_loader_kwargs)\n', (34044, 34067), False, 'from data import EqaDataLoader\n'), ((47924, 47949... |
from BinaryModel import *
from numpy.random import rand
class MajorityModel(BinaryModel):
def __init__(self, filename=None):
self.mdlPrm = {
'addNoise' : False,
}
self.wkrIds = {}
self.imgIds = {}
if filename:
self.load_data(filename)
else:
... | [
"numpy.random.rand"
] | [((2670, 2676), 'numpy.random.rand', 'rand', ([], {}), '()\n', (2674, 2676), False, 'from numpy.random import rand\n')] |
import matplotlib.pyplot as plt
import numpy
import errandpy
"""
logファイルのFitting Parameter: a,b,c,dを返します
normalized_paramの時正規化したパラメーターを返します
"""
def real_a(a, delta, min):
return (a + 1) * delta + min
def real_b(b, delta):
return b * delta
def get_z0FromLogFile(path, isLega... | [
"numpy.mean",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.axhline",
"numpy.dot",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.axvline"
] | [((2581, 2594), 'numpy.mean', 'numpy.mean', (['y'], {}), '(y)\n', (2591, 2594), False, 'import numpy\n'), ((2609, 2640), 'numpy.dot', 'numpy.dot', (['(y - ymean)', '(y - ymean)'], {}), '(y - ymean, y - ymean)\n', (2618, 2640), False, 'import numpy\n'), ((3009, 3018), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n'... |
import qiskit
import qtm.progress_bar
import qtm.constant
import qtm.qfim
import qtm.noise
import qtm.optimizer
import qtm.fubini_study
import numpy as np
import types, typing
def measure(qc: qiskit.QuantumCircuit, qubits, cbits=[]):
"""Measuring the quantu circuit which fully measurement gates
Args:
... | [
"qiskit.execute",
"numpy.array",
"numpy.zeros",
"qiskit.quantum_info.Statevector.from_instruction",
"numpy.expand_dims",
"qiskit.QuantumCircuit"
] | [((3447, 3492), 'qiskit.QuantumCircuit', 'qiskit.QuantumCircuit', (['num_qubits', 'num_qubits'], {}), '(num_qubits, num_qubits)\n', (3468, 3492), False, 'import qiskit\n'), ((3653, 3705), 'qiskit.quantum_info.Statevector.from_instruction', 'qiskit.quantum_info.Statevector.from_instruction', (['qc'], {}), '(qc)\n', (370... |
# -*- coding: utf-8 -*-
import numpy as np
import random
import sys
from collections import Counter
import json
from argparse import ArgumentParser
from rand_utils import rand_partition
def build_tree(num_leaves = 10, rootdate = 1000):
"""
Starting from a three-node tree, split a randomly chosen branch to in... | [
"numpy.copy",
"rand_utils.rand_partition",
"sys.exit",
"numpy.sqrt",
"argparse.ArgumentParser",
"numpy.random.multivariate_normal",
"json.dumps",
"numpy.random.exponential",
"collections.Counter",
"numpy.array",
"numpy.zeros",
"sys.stderr.write",
"numpy.random.gamma",
"numpy.random.seed",
... | [((6320, 6335), 'numpy.arange', 'np.arange', (['fnum'], {}), '(fnum)\n', (6329, 6335), True, 'import numpy as np\n'), ((13855, 13871), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (13869, 13871), False, 'from argparse import ArgumentParser\n'), ((1867, 1898), 'numpy.random.uniform', 'np.random.uniform... |
import pandas as pd
import numpy as np
import os
import sys
def load_data(assets, start_date, end_date):
df_open = load_data_from_file('etf_data_open.csv', assets, start_date, end_date)
df_close = load_data_from_file('etf_data_close.csv', assets, start_date, end_date)
df_high = load_data_from_file('etf_da... | [
"os.path.isfile",
"numpy.isnan",
"pandas.read_csv"
] | [((927, 944), 'pandas.read_csv', 'pd.read_csv', (['file'], {}), '(file)\n', (938, 944), True, 'import pandas as pd\n'), ((1757, 1774), 'pandas.read_csv', 'pd.read_csv', (['file'], {}), '(file)\n', (1768, 1774), True, 'import pandas as pd\n'), ((2559, 2576), 'pandas.read_csv', 'pd.read_csv', (['file'], {}), '(file)\n', ... |
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import os
from datetime import datetime, date, timedelta
from sklearn.linear_model import LinearRegression
import scipy
import math
import sys
import locator
file_path = os.path.dirname(os.path.realpath(__file__))
proj_path = os.path.abspath(... | [
"pandas.read_csv",
"numpy.log",
"math.log",
"pandas.Index",
"datetime.date.fromtimestamp",
"locator.FirstOfMonthLocator",
"datetime.timedelta",
"pandas.notnull",
"os.path.exists",
"matplotlib.pyplot.close",
"numpy.exp",
"datetime.date",
"pandas.DataFrame",
"matplotlib.pyplot.yscale",
"ma... | [((366, 401), 'os.path.join', 'os.path.join', (['proj_path', '"""datagouv"""'], {}), "(proj_path, 'datagouv')\n", (378, 401), False, 'import os\n'), ((412, 468), 'os.path.join', 'os.path.join', (['proj_path', '"""../../gatsby/trends/generated"""'], {}), "(proj_path, '../../gatsby/trends/generated')\n", (424, 468), Fals... |
import unittest
import numpy as np
from dolo.numeric.ncpsolve import ncpsolve, smooth
def josephy(x):
# Computes the function value F(x) of the NCP-example by Josephy.
n=len(x)
Fx=np.zeros(n)
Fx[0]=3*x[0]**2+2*x[0]*x[1]+2*x[1]**2+x[2]+3*x[3]-6
Fx[1]=2*x[0]**2+x[0]+x[1]**2+3*x[2]+2*x[3]-2
F... | [
"numpy.column_stack",
"numpy.array",
"numpy.zeros",
"numpy.testing.assert_almost_equal",
"dolo.numeric.ncpsolve.ncpsolve",
"unittest.main",
"dolo.numeric.solver.solver"
] | [((198, 209), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (206, 209), True, 'import numpy as np\n'), ((633, 649), 'numpy.zeros', 'np.zeros', (['(n, n)'], {}), '((n, n))\n', (641, 649), True, 'import numpy as np\n'), ((5046, 5061), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5059, 5061), False, 'import uni... |
from unittest.mock import MagicMock
import google.protobuf.text_format as text_format
import numpy as np
from banditpylib.bandits import CvarReward
from banditpylib.data_pb2 import Actions, Context
from .ts import ThompsonSampling
class TestThompsonSampling:
"""Test thompson sampling policy"""
def test_simple_... | [
"banditpylib.bandits.CvarReward",
"unittest.mock.MagicMock",
"numpy.array",
"banditpylib.data_pb2.Context",
"banditpylib.data_pb2.Actions"
] | [((346, 379), 'numpy.array', 'np.array', (['[0, 0.7, 0.8, 0.9, 1.0]'], {}), '([0, 0.7, 0.8, 0.9, 1.0])\n', (354, 379), True, 'import numpy as np\n'), ((411, 426), 'banditpylib.bandits.CvarReward', 'CvarReward', (['(0.7)'], {}), '(0.7)\n', (421, 426), False, 'from banditpylib.bandits import CvarReward\n'), ((972, 1001),... |
import numpy
from xoppy_dabax_util import bragg_calc2
from run_diff_pat import run_diff_pat
from srxraylib.plot.gol import plot
if __name__ == "__main__":
descriptor = 'YB66'
SCANFROM = 0 # in microradiants
SCANTO = 100 # in microradiants
MILLER_INDEX_H = 4
MILLER_INDEX_K = 0
MILLER_INDEX_L = ... | [
"xoppy_dabax_util.bragg_calc2",
"numpy.loadtxt",
"run_diff_pat.run_diff_pat",
"srxraylib.plot.gol.plot"
] | [((457, 679), 'xoppy_dabax_util.bragg_calc2', 'bragg_calc2', ([], {'descriptor': 'descriptor', 'hh': 'MILLER_INDEX_H', 'kk': 'MILLER_INDEX_K', 'll': 'MILLER_INDEX_L', 'temper': 'TEMPER', 'emin': '(ENERGY - 100.0)', 'emax': '(ENERGY + 100.0)', 'estep': '((SCANTO - SCANFROM) / SCANPOINTS)', 'fileout': '"""xcrystal.bra"""... |
import os
import datetime
import math
import traceback
from typing import List
import requests
from loguru import logger
from lxml import etree
from siphon.catalog import TDSCatalog
from dask.utils import memory_repr
import numpy as np
from dateutil import parser
from ooi_harvester.settings import harvest_settings
... | [
"datetime.datetime",
"os.path.exists",
"dask.utils.memory_repr",
"dateutil.parser.parse",
"math.floor",
"datetime.datetime.utcnow",
"loguru.logger.warning",
"os.path.join",
"requests.get",
"numpy.sum",
"os.path.dirname",
"os.mkdir",
"lxml.etree.fromstring",
"ooi_harvester.settings.harvest_... | [((1942, 1962), 'loguru.logger.warning', 'logger.warning', (['resp'], {}), '(resp)\n', (1956, 1962), False, 'from loguru import logger\n'), ((5007, 5040), 'requests.get', 'requests.get', (['catalog.catalog_url'], {}), '(catalog.catalog_url)\n', (5019, 5040), False, 'import requests\n'), ((5060, 5089), 'lxml.etree.froms... |
import numpy as np
import pandas as pd
import torch
from physics.protein_os import Protein
import options
from utils import write_pdb, write_pdb_sample, transform_profile, load_protein
from physics.anneal import AnnealCoords, AnnealFrag
# from physics.move import SampleICNext
from physics.grad_minimizer import *
from p... | [
"pandas.read_csv",
"mdtraj.Trajectory",
"os.path.exists",
"physics.anneal.AnnealCoords",
"os.mkdir",
"pandas.DataFrame",
"mdtraj.rmsd",
"utils.write_pdb_sample",
"physics.protein_os.Protein",
"utils.load_protein",
"options.parse_args_and_arch",
"h5py.File",
"utils.test_setup",
"torch.stack... | [((477, 502), 'options.get_fold_parser', 'options.get_fold_parser', ([], {}), '()\n', (500, 502), False, 'import options\n'), ((510, 545), 'options.parse_args_and_arch', 'options.parse_args_and_arch', (['parser'], {}), '(parser)\n', (537, 545), False, 'import options\n'), ((587, 603), 'utils.test_setup', 'test_setup', ... |
import numpy as np
from .common import *
from . import rotation
def to_homogeneous(x):
x = np.asarray(x)
o = np.ones_like(x[..., :1])
return np.concatenate([x, o], axis=-1)
def from_homogeneous(x):
return x[..., :-1] / x[..., -1:]
def compose(r, t, rtype, out=None):
if out is None:
shape ... | [
"numpy.ones_like",
"numpy.eye",
"numpy.asarray",
"numpy.ndim",
"numpy.zeros",
"numpy.einsum",
"numpy.cos",
"numpy.concatenate",
"numpy.sin",
"numpy.shape",
"numpy.zeros_like"
] | [((96, 109), 'numpy.asarray', 'np.asarray', (['x'], {}), '(x)\n', (106, 109), True, 'import numpy as np\n'), ((118, 142), 'numpy.ones_like', 'np.ones_like', (['x[..., :1]'], {}), '(x[..., :1])\n', (130, 142), True, 'import numpy as np\n'), ((154, 185), 'numpy.concatenate', 'np.concatenate', (['[x, o]'], {'axis': '(-1)'... |
# coding: utf-8
# In[1]:
get_ipython().run_cell_magic('javascript', '', '<!-- Ignore this block -->\nIPython.OutputArea.prototype._should_scroll = function(lines) {\n return false;\n}')
# # Data preprocessing
# 1. convert any non-numeric values to numeric values.
# 2. If required drop out the rows with missi... | [
"matplotlib.pyplot.grid",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"numpy.dot",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.random.random_sample",
"numpy.square",
"matplotlib.pyplot.title",
"warnings.f... | [((734, 767), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (757, 767), False, 'import warnings\n'), ((8116, 8184), 'pandas.read_csv', 'pd.read_csv', (["(directoryPath + '/airq402.dat')"], {'sep': '"""\\\\s+"""', 'header': 'None'}), "(directoryPath + '/airq402.dat', sep='... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.