code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.distributions as dist
from torch.utils.data import DataLoader, TensorDataset
from torchvision.utils import save_image, make_grid
from torchvision import datasets, transforms
import numpy as np
import math
from numpy import prod, sqrt
from ... | [
"numpy.prod",
"torch.nn.Sequential",
"torch.tensor",
"torch.nn.Linear",
"torchvision.datasets.MNIST",
"torch.no_grad",
"torchvision.transforms.ToTensor",
"torch.Size",
"torch.zeros",
"torch.cat"
] | [((382, 405), 'torch.Size', 'torch.Size', (['[1, 28, 28]'], {}), '([1, 28, 28])\n', (392, 405), False, 'import torch\n'), ((421, 436), 'numpy.prod', 'prod', (['data_size'], {}), '(data_size)\n', (425, 436), False, 'from numpy import prod, sqrt\n'), ((510, 543), 'torch.nn.Linear', 'nn.Linear', (['hidden_dim', 'hidden_di... |
from pytest import mark
from .test_opt import _check_opt
from myia.opt import lib
from myia.prim.py_implementations import \
head, tail, setitem, add, mul, J, Jinv
#######################
# Tuple optimizations #
#######################
def test_getitem_tuple_elem0():
def before1(x):
tup = (x + 1,... | [
"pytest.mark.xfail",
"myia.prim.py_implementations.setitem",
"myia.prim.py_implementations.head",
"myia.prim.py_implementations.J",
"myia.prim.py_implementations.tail",
"myia.prim.py_implementations.Jinv"
] | [((7273, 7345), 'pytest.mark.xfail', 'mark.xfail', ([], {'reason': '"""inline_trivial does not look into closures properly"""'}), "(reason='inline_trivial does not look into closures properly')\n", (7283, 7345), False, 'from pytest import mark\n'), ((443, 452), 'myia.prim.py_implementations.head', 'head', (['tup'], {})... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def cement(path):
"""Heat Evolved by Setting Cements
Experiment on the... | [
"observations.util.maybe_download_and_extract",
"os.path.join",
"os.path.expanduser"
] | [((1000, 1024), 'os.path.expanduser', 'os.path.expanduser', (['path'], {}), '(path)\n', (1018, 1024), False, 'import os\n'), ((1167, 1252), 'observations.util.maybe_download_and_extract', 'maybe_download_and_extract', (['path', 'url'], {'save_file_name': '"""cement.csv"""', 'resume': '(False)'}), "(path, url, save_file... |
import sys
import time
from math import *
from random import *
global valm1
global stratDict
sys.setrecursionlimit(2**31-1)
stratDict=dict()
partitions=dict()
stratDict[""]=0
stratDict["1"]=1
partitions[1]=[[1]]
partitions[0]=[]
q = { 1: [[1]] }
g={ 1: [[1]] }
valm1=dict()
amountsasdf=[]
placing=dict()
try:
open("... | [
"sys.setrecursionlimit",
"time.sleep"
] | [((93, 127), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(2 ** 31 - 1)'], {}), '(2 ** 31 - 1)\n', (114, 127), False, 'import sys\n'), ((7991, 8008), 'time.sleep', 'time.sleep', (['(0.001)'], {}), '(0.001)\n', (8001, 8008), False, 'import time\n')] |
import unittest
import pytest
from infogain.artefact import Entity
class Test_Entity(unittest.TestCase):
def test_Entity(self):
entity = Entity("A", "a")
self.assertEqual(entity.classType, "A")
self.assertEqual(entity.surfaceForm, "a")
self.assertEqual(entity.confidence, 1.)
... | [
"infogain.artefact.Entity",
"pytest.raises"
] | [((153, 169), 'infogain.artefact.Entity', 'Entity', (['"""A"""', '"""a"""'], {}), "('A', 'a')\n", (159, 169), False, 'from infogain.artefact import Entity\n'), ((373, 389), 'infogain.artefact.Entity', 'Entity', (['"""A"""', '"""a"""'], {}), "('A', 'a')\n", (379, 389), False, 'from infogain.artefact import Entity\n'), (... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-14 14:51
from __future__ import unicode_literals
from django.db import migrations, models
import filebrowser.fields
class Migration(migrations.Migration):
dependencies = [
('vvphotos', '0002_auto_20170414_1207'),
]
operations = [
... | [
"django.db.models.CharField"
] | [((426, 492), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(255)', 'verbose_name': '"""Title"""'}), "(blank=True, max_length=255, verbose_name='Title')\n", (442, 492), False, 'from django.db import migrations, models\n')] |
# firm panel analysis
import sqlite3
# constants
fname_db = 'store/patents_new.db'
min_year = 1985
max_year = 2005
year_bins = [1985, 1990, 1995, 2000]
id_cols = ['firm_num', 'year']
sql_cols = ['assets', 'capx', 'cash', 'cogs', 'deprec', 'intan', 'debt', 'employ', 'income', 'revenue', 'sales', 'rnd', 'fcost', 'mkt... | [
"sqlite3.connect"
] | [((1129, 1154), 'sqlite3.connect', 'sqlite3.connect', (['fname_db'], {}), '(fname_db)\n', (1144, 1154), False, 'import sqlite3\n')] |
import numpy as np
"""
output a list of points consumable by openscad polygon function
"""
def wave(degs, scale=10):
pts = []
for i in xrange(degs):
rad = i*np.pi/180.0
x = float(i/180.0*scale)
y=np.sin(rad) * scale
pts.append([x, y])
return pts
def pwave(degs, scale=20):
... | [
"numpy.sin"
] | [((229, 240), 'numpy.sin', 'np.sin', (['rad'], {}), '(rad)\n', (235, 240), True, 'import numpy as np\n')] |
import requests
import json
import pandas as pd
import numpy as np
import sqlite3
import sqlalchemy
import time
from joblib import Parallel, delayed
from tqdm import tqdm
_DEFAULT_RETRY = (
requests.exceptions.ConnectionError,
requests.exceptions.ProxyError,
requests.exceptions.ReadTimeout
)
engine = sq... | [
"sqlalchemy.create_engine",
"requests.request",
"joblib.Parallel",
"pandas.DataFrame",
"joblib.delayed"
] | [((318, 384), 'sqlalchemy.create_engine', 'sqlalchemy.create_engine', (['"""sqlite:///my_lite_store.db"""'], {'echo': '(False)'}), "('sqlite:///my_lite_store.db', echo=False)\n", (342, 384), False, 'import sqlalchemy\n'), ((482, 517), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'asset_headers'}), '(columns=ass... |
from pylovepdf.tools.imagetopdf import ImageToPdf
t = ImageToPdf('public_key', verify_ssl=True)
t.add_file('pdf_file')
t.debug = False
t.orientation = 'portrait'
t.margin = 0
t.pagesize = 'fit'
t.set_output_folder('output_directory')
t.execute()
t.download()
t.delete_current_task()
| [
"pylovepdf.tools.imagetopdf.ImageToPdf"
] | [((55, 96), 'pylovepdf.tools.imagetopdf.ImageToPdf', 'ImageToPdf', (['"""public_key"""'], {'verify_ssl': '(True)'}), "('public_key', verify_ssl=True)\n", (65, 96), False, 'from pylovepdf.tools.imagetopdf import ImageToPdf\n')] |
#!/usr/bin/python3
"""
For export as a remote service, this impl requires the py4j distribution
provider (in pelix.rsa.providers.distribution.py4j) package.
The implementation below exports the org.eclipse.ecf.examples.hello.IHello
service interface:
https://github.com/ECF/AsyncRemoteServiceExamples/blob/master/hello/o... | [
"pelix.ipopo.decorators.Instantiate",
"pelix.ipopo.decorators.Provides",
"pelix.ipopo.decorators.ComponentFactory"
] | [((1224, 1266), 'pelix.ipopo.decorators.ComponentFactory', 'ComponentFactory', (['"""helloimpl-py4j-factory"""'], {}), "('helloimpl-py4j-factory')\n", (1240, 1266), False, 'from pelix.ipopo.decorators import Instantiate, ComponentFactory, Provides\n'), ((1328, 1377), 'pelix.ipopo.decorators.Provides', 'Provides', (['""... |
import argparse
import sys
import os
from sklearn.model_selection import ParameterGrid
from concurrent.futures import ThreadPoolExecutor
import subprocess
from datetime import datetime
import time
from experiments import all_experiments
root_dir = "{}/..".format(os.path.dirname(os.path.abspath(__file__)))
parser = a... | [
"sklearn.model_selection.ParameterGrid",
"argparse.ArgumentParser",
"concurrent.futures.ThreadPoolExecutor",
"subprocess.Popen",
"os.environ.copy",
"datetime.datetime.now",
"os.path.abspath"
] | [((319, 377), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Experiment Launcher"""'}), "(description='Experiment Launcher')\n", (342, 377), False, 'import argparse\n'), ((1352, 1369), 'os.environ.copy', 'os.environ.copy', ([], {}), '()\n', (1367, 1369), False, 'import os\n'), ((1649, 17... |
import json
from django.urls import reverse
import pytest
import vcr
from core.models import Purchase, User
@pytest.mark.django_db(transaction=True)
def test_create_reseller(client, reseller_payload_request):
response = client.post('/resellers/', reseller_payload_request)
assert response.status_code == 201
... | [
"vcr.use_cassette",
"pytest.mark.django_db",
"core.models.User.objects.filter"
] | [((113, 152), 'pytest.mark.django_db', 'pytest.mark.django_db', ([], {'transaction': '(True)'}), '(transaction=True)\n', (134, 152), False, 'import pytest\n'), ((404, 443), 'pytest.mark.django_db', 'pytest.mark.django_db', ([], {'transaction': '(True)'}), '(transaction=True)\n', (425, 443), False, 'import pytest\n'), (... |
import time
import logging
from enum import Enum, unique
from copy import deepcopy
from collections import defaultdict
from termcolor import cprint, colored
from pybullet_planning import set_random_seed, set_numpy_seed, elapsed_time, get_random_seed
from pybullet_planning import wait_if_gui, wait_for_user, WorldSaver
... | [
"logging.getLogger",
"termcolor.colored",
"integral_timber_joints.planning.stream.compute_free_movement",
"pybullet_planning.WorldSaver",
"compas_fab_pychoreo.utils.compare_configurations",
"integral_timber_joints.planning.visualization.visualize_movement_trajectory",
"integral_timber_joints.planning.ro... | [((1484, 1513), 'logging.getLogger', 'logging.getLogger', (['"""solve.py"""'], {}), "('solve.py')\n", (1501, 1513), False, 'import logging\n'), ((4452, 4497), 'integral_timber_joints.planning.robot_setup.get_gantry_robot_custom_limits', 'get_gantry_robot_custom_limits', (['MAIN_ROBOT_ID'], {}), '(MAIN_ROBOT_ID)\n', (44... |
# Copyright 2020-present <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | [
"matorage.optimizer.config.OptimizerConfig",
"torch.nn.CrossEntropyLoss",
"torch.utils.data.DataLoader",
"unittest.makeSuite",
"tqdm.tqdm",
"torch.optim.lr_scheduler.StepLR",
"matorage.optimizer.config.OptimizerConfig.from_json_file",
"matorage.optimizer.torch.manager.OptimizerManager",
"torch.cuda.... | [((1688, 1763), 'torchvision.datasets.MNIST', 'datasets.MNIST', (['"""/tmp/data"""'], {'train': '(True)', 'download': '(True)', 'transform': 'transform'}), "('/tmp/data', train=True, download=True, transform=transform)\n", (1702, 1763), False, 'from torchvision import datasets, transforms\n'), ((7154, 7188), 'unittest.... |
from query_lang.parsing import ANTLRGrammar
from pathlib import Path
print(ANTLRGrammar(Path('/home/nikita/prog/formal-languages/query_lang/tests/test_data/test5/input.txt')).check()) | [
"pathlib.Path"
] | [((89, 184), 'pathlib.Path', 'Path', (['"""/home/nikita/prog/formal-languages/query_lang/tests/test_data/test5/input.txt"""'], {}), "(\n '/home/nikita/prog/formal-languages/query_lang/tests/test_data/test5/input.txt'\n )\n", (93, 184), False, 'from pathlib import Path\n')] |
import numpy as np
import torch
import gtimer as gt
import lifelong_rl.torch.pytorch_util as ptu
from lifelong_rl.trainers.lisp.mb_skill import MBSkillTrainer
import lifelong_rl.util.pythonplusplus as ppp
from lifelong_rl.util.eval_util import create_stats_ordered_dict
class LiSPTrainer(MBSkillTrainer):
"""
... | [
"lifelong_rl.torch.pytorch_util.get_numpy",
"lifelong_rl.torch.pytorch_util.from_numpy",
"lifelong_rl.util.pythonplusplus.sample_batch",
"lifelong_rl.torch.pytorch_util.np_to_pytorch_batch",
"lifelong_rl.util.eval_util.create_stats_ordered_dict",
"numpy.expand_dims",
"numpy.random.uniform",
"numpy.con... | [((1808, 1830), 'lifelong_rl.torch.pytorch_util.get_numpy', 'ptu.get_numpy', (['latents'], {}), '(latents)\n', (1821, 1830), True, 'import lifelong_rl.torch.pytorch_util as ptu\n'), ((4561, 4602), 'gtimer.stamp', 'gt.stamp', (['"""policy training"""'], {'unique': '(False)'}), "('policy training', unique=False)\n", (456... |
from typing import Tuple
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import connected_components
from dft_dummy.crystal_utils import calc_reciprocal, project_points
from dft_dummy.symmetry import (
calc_overlap_matrix,
check_symmetry,
possible_unitary_rotations,
)
de... | [
"dft_dummy.symmetry.calc_overlap_matrix",
"scipy.sparse.csgraph.connected_components",
"dft_dummy.symmetry.check_symmetry",
"dft_dummy.crystal_utils.calc_reciprocal",
"numpy.floor",
"dft_dummy.crystal_utils.project_points",
"numpy.linalg.norm",
"scipy.sparse.csr_matrix",
"dft_dummy.symmetry.possible... | [((766, 790), 'dft_dummy.symmetry.calc_overlap_matrix', 'calc_overlap_matrix', (['vec'], {}), '(vec)\n', (785, 790), False, 'from dft_dummy.symmetry import calc_overlap_matrix, check_symmetry, possible_unitary_rotations\n'), ((810, 838), 'dft_dummy.symmetry.possible_unitary_rotations', 'possible_unitary_rotations', ([]... |
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# 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
# us... | [
"numpy.testing.assert_array_equal",
"numpy.around",
"pandas.DataFrame",
"preprocess.DataProcessor.merge_two_dicts",
"preprocess.DataProcessor"
] | [((1565, 1743), 'pandas.DataFrame', 'pd.DataFrame', (["[['M', 5, 0.3, 1, 0.3, 2, 1, 0, 10], ['F', 3, 0.2, 2, 0.2, 1, 3, 0, 7], [\n 'I', 2, 0.5, 3, 0.1, 1, 2, 0, 5]]"], {'columns': '(feature_columns_names + [label_column])'}), "([['M', 5, 0.3, 1, 0.3, 2, 1, 0, 10], ['F', 3, 0.2, 2, 0.2, 1, \n 3, 0, 7], ['I', 2, 0.... |
# -*- coding: utf-8 -*-
"""
.. Authors
<NAME> <<EMAIL>>
<NAME> <<EMAIL>>
<NAME> <<EMAIL>>
Contains the XicsrtPlasmaGeneric class.
"""
import logging
import numpy as np
from xicsrt.util import profiler
from xicsrt.tools import xicsrt_spread
from xicsrt.tools.xicsrt_doc import dochelper
from xicsrt.objects... | [
"numpy.mean",
"numpy.median",
"numpy.ones",
"xicsrt.tools.xicsrt_spread.solid_angle",
"xicsrt.sources._XicsrtSourceFocused.XicsrtSourceFocused",
"numpy.linalg.norm",
"numpy.min",
"numpy.max",
"numpy.sum",
"numpy.zeros",
"xicsrt.util.profiler.stop",
"numpy.random.uniform",
"xicsrt.util.profil... | [((7034, 7093), 'numpy.zeros', 'np.zeros', (["[self.param['bundle_count'], 3]"], {'dtype': 'np.float64'}), "([self.param['bundle_count'], 3], dtype=np.float64)\n", (7042, 7093), True, 'import numpy as np\n'), ((7135, 7190), 'numpy.ones', 'np.ones', (["[self.param['bundle_count']]"], {'dtype': 'np.float64'}), "([self.pa... |
import multiprocessing
import pickle
import random
import sys
from collections import defaultdict
from math import ceil, sqrt
import numpy as np
from scipy.stats import norm, skewnorm
from tqdm import tqdm
sys.path.append('..')
import features
INCOME_SECURITY = {
'employee_wage': 0.8,
'state_wage': 0.9,
... | [
"random.choice",
"math.ceil",
"pickle.dump",
"features.feature_dict_to_array",
"math.sqrt",
"features.CUM_FEATURES.items",
"numpy.array",
"scipy.stats.skewnorm",
"collections.defaultdict",
"features.NUM_FEATURES.items",
"multiprocessing.Pool",
"features.CAT_FEATURES.items",
"random.random",
... | [((208, 229), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (223, 229), False, 'import sys\n'), ((3895, 3924), 'features.NUM_FEATURES.items', 'features.NUM_FEATURES.items', ([], {}), '()\n', (3922, 3924), False, 'import features\n'), ((4002, 4031), 'features.CAT_FEATURES.items', 'features.CAT_FE... |
########################################################################################
#
# Forge
# Copyright (C) 2018 <NAME>, Oxford Robotics Institute and
# Department of Statistics, University of Oxford
#
# email: <EMAIL>
# webpage: http://akosiorek.github.io/
# github: https://github.com/akosiorek/forge/
#... | [
"numpy.random.choice",
"tensorflow.py_func",
"numpy.arange",
"builtins.range"
] | [((2605, 2636), 'tensorflow.py_func', 'tf.py_func', (['data_fun', '[]', 'types'], {}), '(data_fun, [], types)\n', (2615, 2636), True, 'import tensorflow as tf\n'), ((1963, 2017), 'numpy.random.choice', 'np.random.choice', (['n_entries', 'batch_size'], {'replace': '(False)'}), '(n_entries, batch_size, replace=False)\n',... |
import os
import datetime
import torch
import logging
import argparse
from exp import srlfetexp, expdata
from utils.loggingutils import init_universal_logging
import config
def __eval1():
dataset = 'figer'
# dataset = 'bbn'
datafiles = config.FIGER_FILES if dataset == 'figer' else config.BBN_FILES
wor... | [
"argparse.ArgumentParser",
"exp.expdata.ResData",
"os.path.join",
"utils.loggingutils.init_universal_logging",
"torch.cuda.device_count",
"exp.srlfetexp.eval_trained",
"datetime.date.today",
"torch.device"
] | [((1562, 1618), 'exp.expdata.ResData', 'expdata.ResData', (["datafiles['type-vocab']", 'word_vecs_file'], {}), "(datafiles['type-vocab'], word_vecs_file)\n", (1577, 1618), False, 'from exp import srlfetexp, expdata\n'), ((1623, 1766), 'exp.srlfetexp.eval_trained', 'srlfetexp.eval_trained', (['device', 'gres', 'model_fi... |
from flask import Blueprint, request, jsonify, make_response
from models import User, Codebook
from models import db
import json
import pandas as pd
codebook = Blueprint('codebook', __name__)
@codebook.route('/uploadCodebook', methods=['GET', 'POST'])
def uploadCodebook():
if request.method == 'POST':
df... | [
"json.loads",
"models.User.query.filter_by",
"models.db.session.commit",
"flask.request.files.get",
"flask.Blueprint",
"models.Codebook.query.filter_by",
"flask.jsonify"
] | [((161, 192), 'flask.Blueprint', 'Blueprint', (['"""codebook"""', '__name__'], {}), "('codebook', __name__)\n", (170, 192), False, 'from flask import Blueprint, request, jsonify, make_response\n'), ((509, 533), 'json.loads', 'json.loads', (['request.data'], {}), '(request.data)\n', (519, 533), False, 'import json\n'), ... |
from string import Template
import argparse
PATH = '/home/jj/ktm'
parser = argparse.ArgumentParser(description='Make bash scripts')
parser.add_argument('--datasets', type=str, nargs='+')
parser.add_argument('--dimensions', type=int, nargs='+')
options = parser.parse_args()
for dataset in options.datasets:
for... | [
"argparse.ArgumentParser"
] | [((79, 135), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Make bash scripts"""'}), "(description='Make bash scripts')\n", (102, 135), False, 'import argparse\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # s_co... | [
"numpy.sqrt",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"arpym.estimation.cointegration_fp",
"numpy.log",
"numpy.array",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.axis",
"numpy.tile... | [((1263, 1292), 'numpy.array', 'np.array', (['[1, 2, 3, 5, 7, 10]'], {}), '([1, 2, 3, 5, 7, 10])\n', (1271, 1292), True, 'import numpy as np\n'), ((1365, 1419), 'pandas.read_csv', 'pd.read_csv', (["(path + '/data.csv')"], {'header': '(0)', 'index_col': '(0)'}), "(path + '/data.csv', header=0, index_col=0)\n", (1376, 14... |
from django.urls import path,include
from .views import *
urlpatterns = [
#index/Home Page
path('',index,name="home"),
path('help',helpArticle,name="help"),
path('dashboard/',dashBoard,name='dashBoard'),
path('save/<int:id>/',save,name='save'),
path('<int:id>/',openFile,name='open'),
path('d... | [
"django.urls.path"
] | [((99, 127), 'django.urls.path', 'path', (['""""""', 'index'], {'name': '"""home"""'}), "('', index, name='home')\n", (103, 127), False, 'from django.urls import path, include\n'), ((131, 169), 'django.urls.path', 'path', (['"""help"""', 'helpArticle'], {'name': '"""help"""'}), "('help', helpArticle, name='help')\n", (... |
# PLEASE READ DISCLAIMER
#
# This is a sample script for demo and reference purpose only.
# It is subject to change for content updates without warning.
#
# REQUIREMENTS
# - Python modules: requests
#
# DESCRIPTION
# A sample utility script to:
# - Read a saved JSON config file into an JSON object..... | [
"sys.path.insert",
"IxNetRestApiProtocol.Protocol",
"IxNetRestApiTraffic.Traffic",
"IxNetRestApiFileMgmt.FileMgmt",
"sys.exit",
"json.load",
"IxNetRestApiPortMgmt.PortMgmt",
"IxNetRestApiStatistics.Statistics"
] | [((553, 588), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../../Modules"""'], {}), "(0, '../../Modules')\n", (568, 588), False, 'import json, sys\n'), ((2146, 2163), 'json.load', 'json.load', (['inFile'], {}), '(inFile)\n', (2155, 2163), False, 'import json, sys\n'), ((4303, 4320), 'IxNetRestApiFileMgmt.FileMgmt... |
import utils
# Container 1A (mm and kg)
CONTAINER_WIDTH = 2330
CONTAINER_HEIGHT = 2200
CONTAINER_DEPTH = 12000
CONTAINER_LOAD = 26480
# Pallet EUR 1 (mm and kg)
PALLET_WIDTH = 1200
PALLET_DEPTH = 800
PALLET_HEIGHT = CONTAINER_HEIGHT - 145 # 145 is the height of the pallet itself
PALLET_LOAD = 2490
PALLET_DIMS = util... | [
"utils.Dimension"
] | [((316, 387), 'utils.Dimension', 'utils.Dimension', (['PALLET_WIDTH', 'PALLET_DEPTH', 'PALLET_HEIGHT', 'PALLET_LOAD'], {}), '(PALLET_WIDTH, PALLET_DEPTH, PALLET_HEIGHT, PALLET_LOAD)\n', (331, 387), False, 'import utils\n')] |
"""
Functions to read talks data.
"""
import tempfile
import json
from ..server_utils import epcon_fetch_file
def _call_for_talks(out_filepath, status="accepted", conference="ep2017", host="europython.io", with_votes=False):
""" Create json file with talks data. `status` choices: ['accepted', 'proposed']
""... | [
"json.load",
"tempfile.NamedTemporaryFile"
] | [((1247, 1259), 'json.load', 'json.load', (['f'], {}), '(f)\n', (1256, 1259), False, 'import json\n'), ((1022, 1065), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {'suffix': '""".json"""'}), "(suffix='.json')\n", (1049, 1065), False, 'import tempfile\n')] |
# Standard
import base64
import os
import shutil
import subprocess
import sys
# Dependencies
import mutagen.flac as mflac
import mutagen.id3 as mid3
import mutagen.oggvorbis as mogg
def remove_space(a_string, replace_character):
""" Remove all spaces from a string and return a 'spaceless' version of
the orig... | [
"mutagen.flac.FLAC",
"sys.exit",
"mutagen.flac.Picture",
"mutagen.id3.ID3",
"shutil.copy2",
"mutagen.id3.APIC",
"os.path.isfile",
"mutagen.oggvorbis.OggVorbis"
] | [((1676, 1700), 'os.path.isfile', 'os.path.isfile', (['art_path'], {}), '(art_path)\n', (1690, 1700), False, 'import os\n'), ((2290, 2314), 'os.path.isfile', 'os.path.isfile', (['art_file'], {}), '(art_file)\n', (2304, 2314), False, 'import os\n'), ((2514, 2535), 'mutagen.flac.FLAC', 'mflac.FLAC', (['flac_file'], {}), ... |
#!/usr/bn/env python3
import requests,json
import traceback
def loginCCNU(username="",passwd="",suffix=""):
errmessage = None
try:
url = "http://10.220.250.50/0.htm"
payload = {"DDDDD":"%s"%username,
"upass":"%s"%passwd,
"suffix":"%s"%suffix,
"0MKK... | [
"traceback.format_exc",
"requests.post",
"requests.get"
] | [((569, 618), 'requests.post', 'requests.post', (['url'], {'data': 'payload', 'headers': 'headers'}), '(url, data=payload, headers=headers)\n', (582, 618), False, 'import requests, json\n'), ((1270, 1304), 'requests.get', 'requests.get', (['url'], {'headers': 'headers'}), '(url, headers=headers)\n', (1282, 1304), False... |
# Wiring:
# Pico - AMIS-30543
# SPIO-RX - DO (4.7K pullup)
# SPIO-TX - DI
# SPIO-CSK - CLK
# 5 - CS
# 15 - NXT
# Ground - GND
#
# Also connect the motor power and the stepper driver.
from machine import Pin
import time
from AMIS30543 import AMIS30543
stepPin = 1... | [
"time.sleep_ms",
"AMIS30543.AMIS30543"
] | [((346, 371), 'AMIS30543.AMIS30543', 'AMIS30543', (['csPin', 'stepPin'], {}), '(csPin, stepPin)\n', (355, 371), False, 'from AMIS30543 import AMIS30543\n'), ((1115, 1133), 'time.sleep_ms', 'time.sleep_ms', (['(200)'], {}), '(200)\n', (1128, 1133), False, 'import time\n')] |
#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
# Copyright (C) 2004-2008 <NAME> and <NAME>
# Copyright (C) 2012-2014 <NAME>
# Copyright (C) 2015-2020 <NAME>
'''update languages.py from pycountry'''
import os
import codecs
from dosagelib.scraper import scrapers
def main():
"""Update language information in... | [
"os.path.dirname",
"codecs.open",
"os.path.join",
"dosagelib.scraper.scrapers.get"
] | [((415, 466), 'os.path.join', 'os.path.join', (['basepath', '"""dosagelib"""', '"""languages.py"""'], {}), "(basepath, 'dosagelib', 'languages.py')\n", (427, 466), False, 'import os\n'), ((839, 853), 'dosagelib.scraper.scrapers.get', 'scrapers.get', ([], {}), '()\n', (851, 853), False, 'from dosagelib.scraper import sc... |
import pandas as pd
import numpy as np
from sklearn import datasets, linear_model
from __future__ import division
class LRPI:
def __init__(self, normalize=False, n_jobs=1, t_value = 2.13144955):
self.normalize = normalize
self.n_jobs = n_jobs
self.LR = linear_model.LinearRegression(normaliz... | [
"numpy.multiply",
"numpy.dot",
"pandas.DataFrame",
"numpy.transpose",
"sklearn.linear_model.LinearRegression"
] | [((282, 357), 'sklearn.linear_model.LinearRegression', 'linear_model.LinearRegression', ([], {'normalize': 'self.normalize', 'n_jobs': 'self.n_jobs'}), '(normalize=self.normalize, n_jobs=self.n_jobs)\n', (311, 357), False, 'from sklearn import datasets, linear_model\n'), ((459, 487), 'pandas.DataFrame', 'pd.DataFrame',... |
from time import time;
from math import floor;
# Supporting class to collect timing information.
class Timer:
# A constant for state management indicating that the timer is stopped.
STOPPED = 0;
# A constant for state management indicating that the timer is running.
RUNNING = 1;
# Initializes the timer to ... | [
"time.time",
"math.floor"
] | [((2318, 2343), 'math.floor', 'floor', (['(tmp_delta_t / 3600)'], {}), '(tmp_delta_t / 3600)\n', (2323, 2343), False, 'from math import floor\n'), ((708, 714), 'time.time', 'time', ([], {}), '()\n', (712, 714), False, 'from time import time\n'), ((2356, 2379), 'math.floor', 'floor', (['(tmp_delta_t / 60)'], {}), '(tmp_... |
import torch
from PIL import Image
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import argparse
from models import *
def main():
#take in arguments
parser = argparse.ArgumentParser(description='Hyperparameters for training GAN')
# parameters ... | [
"PIL.Image.open",
"matplotlib.pyplot.savefig",
"argparse.ArgumentParser",
"torch.load",
"torch.cuda.is_available",
"torchvision.transforms.Normalize",
"torchvision.transforms.Resize",
"matplotlib.pyplot.axis",
"torchvision.transforms.ToTensor",
"matplotlib.pyplot.subplots"
] | [((228, 299), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Hyperparameters for training GAN"""'}), "(description='Hyperparameters for training GAN')\n", (251, 299), False, 'import argparse\n'), ((1758, 1780), 'PIL.Image.open', 'Image.open', (['image_file'], {}), '(image_file)\n', (1768... |
"""Actor handler example -- actor module
Define actor and config message for the consumer
"""
import logging
from msgvan.actors import SubscriptionActor
from thespian.actors import requireCapability
log = logging.getLogger(__name__)
class WriterSettingMessage:
"""A simple message to configure actors with an... | [
"logging.getLogger",
"thespian.actors.requireCapability"
] | [((211, 238), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (228, 238), False, 'import logging\n'), ((404, 431), 'thespian.actors.requireCapability', 'requireCapability', (['"""writer"""'], {}), "('writer')\n", (421, 431), False, 'from thespian.actors import requireCapability\n')] |
import requests
class Record(object):
def __init__(self, domain_id, id="", client_id="", api_key=""):
self.domain_id = domain_id
self.id = id
self.client_id = client_id
self.api_key = api_key
self.record_type = None
self.name = None
self.data = None
... | [
"requests.get"
] | [((570, 696), 'requests.get', 'requests.get', (["('https://api.digitalocean.com/v1/domains/%s/records/%s%s' % (self.\n domain_id, self.id, path))"], {'params': 'payload'}), "('https://api.digitalocean.com/v1/domains/%s/records/%s%s' % (\n self.domain_id, self.id, path), params=payload)\n", (582, 696), False, 'imp... |
import hashlib
import bcrypt
def hashpwd(password: str) -> str:
return bcrypt.hashpw(str.encode(password), bcrypt.gensalt()).decode()
def checkpwd(password, bcrypt_hash) -> bool:
return bcrypt.checkpw(str.encode(password), str.encode(bcrypt_hash))
def blake2b(data: str, size=32, key=""):
"""Hash wrapper ... | [
"bcrypt.gensalt"
] | [((112, 128), 'bcrypt.gensalt', 'bcrypt.gensalt', ([], {}), '()\n', (126, 128), False, 'import bcrypt\n')] |
# cache-extractor.py
#
import os
import time
import hashlib
import binascii
import zlib
import json
from urllib.parse import urlparse
from datetime import datetime
from bs4 import BeautifulSoup as bs
md5 = hashlib.md5()
# set cache_dir from which to extract files
# cache_dir = "./data/squid3"
cache_dir = "/var/spool... | [
"urllib.parse.urlparse",
"hashlib.md5",
"datetime.datetime.strptime",
"binascii.b2a_hex",
"bs4.BeautifulSoup",
"zlib.decompress",
"os.walk"
] | [((208, 221), 'hashlib.md5', 'hashlib.md5', ([], {}), '()\n', (219, 221), False, 'import hashlib\n'), ((11570, 11588), 'os.walk', 'os.walk', (['cache_dir'], {}), '(cache_dir)\n', (11577, 11588), False, 'import os\n'), ((5618, 5651), 'binascii.b2a_hex', 'binascii.b2a_hex', (['squid_meta[81:]'], {}), '(squid_meta[81:])\n... |
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pandas.tseries.offsets import BDay
import stock.utils.symbol_util
from stock.marketdata.storefactory import get_store
from stock.globalvar import *
from config import store_type
import tushare as ts
def get_last_trading_date(today):... | [
"numpy.absolute",
"pandas.set_option",
"pandas.datetime.today",
"pandas.datetime.strptime",
"pandas.tseries.offsets.BDay",
"numpy.round"
] | [((1601, 1641), 'numpy.round', 'np.round', (["(df_yest['yest_close'] * 1.1)", '(2)'], {}), "(df_yest['yest_close'] * 1.1, 2)\n", (1609, 1641), True, 'import numpy as np\n'), ((1909, 1985), 'numpy.absolute', 'np.absolute', (["((df_today['open'] - df_today['close']) / df_today['yest_close'])"], {}), "((df_today['open'] -... |
import socket
from scapy.all import *
def ping(HOST):
TIMEOUT = 2
conf.verb = 0
packet = IP(dst=HOST, ttl=20)/ICMP()
reply = sr1(packet, timeout=TIMEOUT)
if not (reply is None):
return 0
else:
return 1
def lookup(HOST):
try:
HOST_IP = socket.gethostbyname(HOST)
... | [
"socket.gethostbyname"
] | [((291, 317), 'socket.gethostbyname', 'socket.gethostbyname', (['HOST'], {}), '(HOST)\n', (311, 317), False, 'import socket\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import optparse
from src.fs import FS
from src.architector import Architector
from src.arc_patterns import ArcPatterns
class CommandArgs(object):
''' Class For Set Default Command Line Arguments '''
def __init__(self, commandfile):
''' Constructor ''... | [
"src.arc_patterns.ArcPatterns",
"src.fs.FS",
"optparse.OptionParser",
"os.path.basename",
"src.architector.Architector"
] | [((2741, 2760), 'src.fs.FS', 'FS', (['options.verbose'], {}), '(options.verbose)\n', (2743, 2760), False, 'from src.fs import FS\n'), ((2947, 2979), 'src.arc_patterns.ArcPatterns', 'ArcPatterns', (['fs', 'options.verbose'], {}), '(fs, options.verbose)\n', (2958, 2979), False, 'from src.arc_patterns import ArcPatterns\n... |
import pytest
from fastapi import HTTPException
from mockito import when
from acapy_ledger_facade import get_taa, accept_taa, get_did_endpoint
# need this to handle the async with the mock
async def get(response):
return response
@pytest.mark.asyncio
async def test_error_on_get_taa(mock_agent_controller):
... | [
"acapy_ledger_facade.accept_taa",
"mockito.when",
"pytest.raises",
"acapy_ledger_facade.get_did_endpoint",
"acapy_ledger_facade.get_taa"
] | [((395, 423), 'pytest.raises', 'pytest.raises', (['HTTPException'], {}), '(HTTPException)\n', (408, 423), False, 'import pytest\n'), ((822, 850), 'pytest.raises', 'pytest.raises', (['HTTPException'], {}), '(HTTPException)\n', (835, 850), False, 'import pytest\n'), ((1263, 1291), 'pytest.raises', 'pytest.raises', (['HTT... |
# Generated by Django 3.2.5 on 2021-07-14 16:45
from django.db import migrations, models
import django.db.models.deletion
import sqlite3
import os
dbpath = './generator/data/city_version-4.sqlite'
def City_init(apps, schema_editor): # import ../generator/data/city_version-4.sqlite into model city and province
if... | [
"os.path.exists",
"django.db.migrations.RunPython",
"sqlite3.connect"
] | [((444, 467), 'sqlite3.connect', 'sqlite3.connect', (['dbpath'], {}), '(dbpath)\n', (459, 467), False, 'import sqlite3\n'), ((325, 347), 'os.path.exists', 'os.path.exists', (['dbpath'], {}), '(dbpath)\n', (339, 347), False, 'import os\n'), ((1336, 1367), 'django.db.migrations.RunPython', 'migrations.RunPython', (['City... |
from time import sleep
from behave import given, when, then
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.select import Select
@given(u'The user is on home.html page')
def step_impl(context):
driver = context.driver
driver.get("http://3172.16.17.32:5000/")
... | [
"behave.given",
"time.sleep",
"behave.when",
"selenium.webdriver.common.action_chains.ActionChains",
"behave.then"
] | [((183, 222), 'behave.given', 'given', (['u"""The user is on home.html page"""'], {}), "(u'The user is on home.html page')\n", (188, 222), False, 'from behave import given, when, then\n'), ((421, 462), 'behave.when', 'when', (['u"""The user clicks the login button"""'], {}), "(u'The user clicks the login button')\n", (... |
from oidcmsg import oauth2
from oidcmsg.oauth2 import ResponseMessage
from oidcmsg.time_util import time_sans_frac
from oidcservice.service import Service
class CCRefreshAccessToken(Service):
msg_type = oauth2.RefreshAccessTokenRequest
response_cls = oauth2.AccessTokenResponse
error_msg = ResponseMessage... | [
"oidcservice.service.Service.__init__",
"oidcmsg.time_util.time_sans_frac"
] | [((599, 707), 'oidcservice.service.Service.__init__', 'Service.__init__', (['self', 'service_context', 'state_db'], {'client_authn_factory': 'client_authn_factory', 'conf': 'conf'}), '(self, service_context, state_db, client_authn_factory=\n client_authn_factory, conf=conf)\n', (615, 707), False, 'from oidcservice.s... |
import unittest
import os
import numpy as np
import pandas as pd
from pyinterpolate.semivariance.semivariogram_fit.fit_semivariance import TheoreticalSemivariogram
from pyinterpolate.semivariance.semivariogram_estimation.calculate_semivariance import calculate_semivariance
from pyinterpolate.semivariance.semivariogram... | [
"pandas.read_csv",
"pyinterpolate.semivariance.semivariogram_estimation.calculate_semivariance.calculate_weighted_semivariance",
"os.path.join",
"os.path.dirname",
"numpy.zeros",
"pyinterpolate.semivariance.semivariogram_fit.fit_semivariance.TheoreticalSemivariogram",
"unittest.main",
"numpy.load",
... | [((4465, 4480), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4478, 4480), False, 'import unittest\n'), ((569, 594), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (584, 594), False, 'import os\n'), ((610, 667), 'os.path.join', 'os.path.join', (['my_dir', '"""../sample_data/armstrong_d... |
from networkx import from_numpy_matrix, set_node_attributes, relabel_nodes, DiGraph
from numpy import matrix
from data import DISTANCES, DEMANDS_DROP
import sys
sys.path.append("../../")
from vrpy import VehicleRoutingProblem
# Transform distance matrix to DiGraph
A = matrix(DISTANCES, dtype=[("cost", int)])
G = from... | [
"networkx.relabel_nodes",
"networkx.DiGraph",
"networkx.set_node_attributes",
"vrpy.VehicleRoutingProblem",
"numpy.matrix",
"sys.path.append"
] | [((162, 187), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (177, 187), False, 'import sys\n'), ((271, 311), 'numpy.matrix', 'matrix', (['DISTANCES'], {'dtype': "[('cost', int)]"}), "(DISTANCES, dtype=[('cost', int)])\n", (277, 311), False, 'from numpy import matrix\n'), ((376, 434), 'ne... |
from django import forms
INTERVAL_CHOICES = [(k, k) for k in ('minutes', 'hours', 'days', 'weeks',
'months', 'years')]
class StatsFilterForm(forms.Form):
"""Form for filtering the statistics shown in the admin interface ."""
start = forms.DateTimeField()
end = forms.... | [
"django.forms.ChoiceField",
"django.forms.DateTimeField"
] | [((282, 303), 'django.forms.DateTimeField', 'forms.DateTimeField', ([], {}), '()\n', (301, 303), False, 'from django import forms\n'), ((314, 335), 'django.forms.DateTimeField', 'forms.DateTimeField', ([], {}), '()\n', (333, 335), False, 'from django import forms\n'), ((351, 394), 'django.forms.ChoiceField', 'forms.Cho... |
#!/usr/bin/env python3
"""
Add fragments to a GFA2 file using alignments from a SAM file
"""
import sys
import os
import argparse
import re
import gfapy
op = argparse.ArgumentParser(description=__doc__)
op.add_argument("filenamesam")
op.add_argument("filenamegfa")
op.add_argument('--version', action='version', versio... | [
"gfapy.Gfa.from_file",
"re.finditer",
"argparse.ArgumentParser"
] | [((160, 204), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (183, 204), False, 'import argparse\n'), ((2476, 2513), 'gfapy.Gfa.from_file', 'gfapy.Gfa.from_file', (['opts.filenamegfa'], {}), '(opts.filenamegfa)\n', (2495, 2513), False, 'import gfapy\n'... |
# coding=utf-8
# Author: <NAME>
# Date: Aug 06, 2019
#
# Description: Plots results of screened DM genes
#
# Instructions:
#
import numpy as np
import pandas as pd
pd.set_option('display.max_rows', 100)
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
import matplotlib as mpl
from matplotl... | [
"pandas.read_csv",
"numpy.arange",
"pandas.Categorical",
"pandas.set_option",
"matplotlib.pyplot.figure",
"matplotlib.gridspec.GridSpec",
"numpy.linspace",
"matplotlib.colors.Normalize",
"matplotlib.colors.rgb2hex",
"numpy.log2",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.subplots_adjust"... | [((164, 202), 'pandas.set_option', 'pd.set_option', (['"""display.max_rows"""', '(100)'], {}), "('display.max_rows', 100)\n", (177, 202), True, 'import pandas as pd\n'), ((203, 244), 'pandas.set_option', 'pd.set_option', (['"""display.max_columns"""', '(500)'], {}), "('display.max_columns', 500)\n", (216, 244), True, '... |
from collections import defaultdict
class graph(object):
def __init__(self, arcList=[]):
self.arcs = defaultdict(list)
for arc in arcList:
self.arcs[arc[0]].append(arc[1])
if not self.check_vertex(arc[1]):
self.add_vertex(arc[1])
def check_vertex(self... | [
"collections.defaultdict"
] | [((116, 133), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (127, 133), False, 'from collections import defaultdict\n')] |
import torch
import unittest
from source.utilities.maths import normalize_tensor
class NormalizationTest(unittest.TestCase):
def test_nan(self):
t = torch.tensor([1.])
r = normalize_tensor(t)
self.assertTrue(torch.isnan(r))
def test_two_values(self):
t = torch.tensor([0., 1.]... | [
"unittest.main",
"torch.tensor",
"torch.isnan",
"source.utilities.maths.normalize_tensor"
] | [((565, 580), 'unittest.main', 'unittest.main', ([], {}), '()\n', (578, 580), False, 'import unittest\n'), ((164, 183), 'torch.tensor', 'torch.tensor', (['[1.0]'], {}), '([1.0])\n', (176, 183), False, 'import torch\n'), ((195, 214), 'source.utilities.maths.normalize_tensor', 'normalize_tensor', (['t'], {}), '(t)\n', (2... |
# @l2g 56 python3
# [56] Merge Intervals
# Difficulty: Medium
# https://leetcode.com/problems/merge-intervals
#
# Given an array of intervals where intervals[i] = [starti,endi],merge all overlapping intervals,
# and return an array of the non-overlapping intervals that cover all the intervals in the input.
#
# Example ... | [
"os.path.join"
] | [((1150, 1185), 'os.path.join', 'os.path.join', (['"""tests"""', '"""test_56.py"""'], {}), "('tests', 'test_56.py')\n", (1162, 1185), False, 'import os\n')] |
# -*- coding: utf-8 -*-
""" Generic vault related helpers """
import os
import pathlib
from typing import Any
import chameleon
from rumps import MenuItem
from shellescape import quote
def generate_launchagent(profile_name: str) -> str:
"""
Generate the launchctl launchagent xml
"""
path = os.path.di... | [
"os.path.exists",
"os.path.join",
"os.path.dirname",
"shellescape.quote",
"os.system",
"os.remove"
] | [((310, 335), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (325, 335), False, 'import os\n'), ((420, 454), 'os.path.join', 'os.path.join', (['path', '"""../templates"""'], {}), "(path, '../templates')\n", (432, 454), False, 'import os\n'), ((1500, 1548), 'os.system', 'os.system', (['f"""lau... |
#------------------------------------------
#press f5
#arows to move
#get hearts avoid green thing
#if you die try again
#good luck
#_______----------------------------
#import
import pygame
import random
import time
#init
pygame.init()
#surface size
display_width=1000
display_height=600
#color def
black= (0,0,... | [
"pygame.display.set_caption",
"pygame.init",
"pygame.quit",
"pygame.event.get",
"pygame.display.set_mode",
"time.sleep",
"pygame.font.SysFont",
"pygame.time.Clock",
"pygame.image.load",
"pygame.display.update",
"random.randint"
] | [((231, 244), 'pygame.init', 'pygame.init', ([], {}), '()\n', (242, 244), False, 'import pygame\n'), ((408, 464), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(display_width, display_height)'], {}), '((display_width, display_height))\n', (431, 464), False, 'import pygame\n'), ((464, 498), 'pygame.display.se... |
# -*- coding: utf-8 -*-
import json
from collections import OrderedDict
from operator import itemgetter
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.contrib.postgres.fields import ArrayField
from django.db import models
from django.utils.tra... | [
"collections.OrderedDict",
"django.utils.translation.ugettext_lazy",
"json.loads",
"chemtrails.neoutils.query.get_node_permissions",
"chemtrails.contrib.permissions.forms.JSONField",
"chemtrails.neoutils.query.get_relationship_types",
"chemtrails.neoutils.query.get_node_relationship_types",
"operator.... | [((1630, 1646), 'django.utils.translation.ugettext_lazy', '_', (['"""description"""'], {}), "('description')\n", (1631, 1646), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((749, 762), 'operator.itemgetter', 'itemgetter', (['(0)'], {}), '(0)\n', (759, 762), False, 'from operator import itemgetter... |
import pyspark
from packaging import version
from pyspark import sql
_3_0_0_VERSION = version.Version("3.0.0")
_spark_version = version.parse(pyspark.__version__)
def configure_session(sess: sql.SparkSession, arrow=True):
if arrow:
if _spark_version >= _3_0_0_VERSION:
sess.conf.set("spark.sql... | [
"packaging.version.parse",
"packaging.version.Version"
] | [((87, 111), 'packaging.version.Version', 'version.Version', (['"""3.0.0"""'], {}), "('3.0.0')\n", (102, 111), False, 'from packaging import version\n'), ((129, 163), 'packaging.version.parse', 'version.parse', (['pyspark.__version__'], {}), '(pyspark.__version__)\n', (142, 163), False, 'from packaging import version\n... |
from django.http import HttpResponse,JsonResponse,StreamingHttpResponse
from rest_framework.authtoken.models import Token
from django.views.decorators.http import require_POST,require_GET
from django.contrib.auth.models import User
from django.contrib import auth
import datetime
from .settings import BASE_DIR,DATABASES... | [
"django.contrib.auth.authenticate",
"django.http.StreamingHttpResponse",
"rest_framework.authtoken.models.Token.objects.get",
"zipstream.ZipFile",
"django.http.JsonResponse",
"django.http.HttpResponse",
"rest_framework.authtoken.models.Token.objects.filter",
"rest_framework.authtoken.models.Token.obje... | [((534, 589), 'django.contrib.auth.authenticate', 'auth.authenticate', ([], {'username': 'username', 'password': 'password'}), '(username=username, password=password)\n', (551, 589), False, 'from django.contrib import auth\n'), ((941, 979), 'rest_framework.authtoken.models.Token.objects.get_or_create', 'Token.objects.g... |
from utilities import utils
from text_processing import text_normalizer
import pickle
import re
import os
import pickle
from time import time
from text_processing import abbreviations_resolver
class SearchEngineInsensitiveToSpelling:
def __init__(self, abbreviation_folder = "../model/abbreviations_dicts", loa... | [
"os.path.exists",
"utilities.utils.normalized_levenshtein_score",
"os.makedirs",
"text_processing.text_normalizer.replaced_with_z_s_symbols_words",
"text_processing.text_normalizer.get_stemmed_words_inverted_index",
"text_processing.text_normalizer.normalize_key_words_for_search",
"os.path.join",
"re.... | [((709, 757), 'text_processing.abbreviations_resolver.AbbreviationsResolver', 'abbreviations_resolver.AbbreviationsResolver', (['[]'], {}), '([])\n', (753, 757), False, 'from text_processing import abbreviations_resolver\n'), ((9203, 9233), 're.sub', 're.sub', (['"""[\\\\*]+"""', '"""*"""', 'pattern'], {}), "('[\\\\*]+... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 <NAME> <<EMAIL>>
# Copyright 2012 Google Inc. 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
#
# htt... | [
"os.path.join",
"os.path.normpath",
"os.path.dirname",
"functools.partial",
"os.walk"
] | [((1674, 1742), 'functools.partial', 'functools.partial', (['os.walk'], {'topdown': 'topdown', 'followlinks': 'followlinks'}), '(os.walk, topdown=topdown, followlinks=followlinks)\n', (1691, 1742), False, 'import functools\n'), ((5362, 5384), 'os.path.normpath', 'os.path.normpath', (['path'], {}), '(path)\n', (5378, 53... |
# -*- coding: utf8 -*-
import unittest
import basic_operations as bo
class TestBasicOperations(unittest.TestCase):
def test_str_to_int(self):
self.assertEqual(10, bo.str_to_int("10"))
self.assertEqual(15, bo.str_to_int("15"))
self.assertEqual(40, bo.str_to_int("40"))
self.assertE... | [
"basic_operations.number_to_str",
"basic_operations.str_to_int",
"basic_operations.add_string_string",
"basic_operations.associative_law_mutiple",
"basic_operations.exponent",
"basic_operations.str_to_float",
"basic_operations.associative_law_add",
"basic_operations.add_string_number",
"basic_operat... | [((179, 198), 'basic_operations.str_to_int', 'bo.str_to_int', (['"""10"""'], {}), "('10')\n", (192, 198), True, 'import basic_operations as bo\n'), ((229, 248), 'basic_operations.str_to_int', 'bo.str_to_int', (['"""15"""'], {}), "('15')\n", (242, 248), True, 'import basic_operations as bo\n'), ((279, 298), 'basic_opera... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from configparser import ConfigParser
from .snaut import app_factory
conf = ConfigParser()
conf.read(['config.ini', 'config_local.ini'])
app = app_factory(conf)
| [
"configparser.ConfigParser"
] | [((125, 139), 'configparser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (137, 139), False, 'from configparser import ConfigParser\n')] |
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 <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, co... | [
"threading.Lock",
"os.path.basename"
] | [((2107, 2123), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (2121, 2123), False, 'import threading\n'), ((2156, 2172), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (2170, 2172), False, 'import threading\n'), ((4824, 4859), 'os.path.basename', 'os.path.basename', (['self.storage.path'], {}), '(self.st... |
from sqlalchemy import Column, String, ForeignKey
from fr.tagc.rainet.core.util.sql.Base import Base
from fr.tagc.rainet.core.util.sql.SQLManager import SQLManager
from fr.tagc.rainet.core.util.exception.NotRequiredInstantiationException import NotRequiredInstantiationException
from fr.tagc.rainet.core.util.exception... | [
"fr.tagc.rainet.core.util.exception.RainetException.RainetException",
"fr.tagc.rainet.core.util.exception.NotRequiredInstantiationException.NotRequiredInstantiationException",
"sqlalchemy.ForeignKey",
"fr.tagc.rainet.core.util.sql.SQLManager.SQLManager.get_instance"
] | [((812, 890), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""BioplexCluster.bioplexID"""'], {'onupdate': '"""CASCADE"""', 'ondelete': '"""CASCADE"""'}), "('BioplexCluster.bioplexID', onupdate='CASCADE', ondelete='CASCADE')\n", (822, 890), False, 'from sqlalchemy import Column, String, ForeignKey\n'), ((972, 1043), 'sqlal... |
# !/usr/bin/python
"""
Copyright ©️: 2020 Seniatical / _-*™#7519
License: Apache 2.0
A permissive license whose main conditions require preservation of copyright and license notices.
Contributors provide an express grant of patent rights.
Licensed works, modifications, and larger works may be distributed under diffe... | [
"Utils.__logging__.BOOT",
"Utils.sensitive.env_reader",
"Utils.setup.setup",
"Utils.__logging__.SWARM_BRANCH",
"os.getcwd",
"Utils.__logging__.log",
"Utils.__logging__.monitor",
"Utils.__logging__.dumps",
"Utils.__logging__.clog",
"os.getpid",
"threading.Thread",
"bot.Mecha_Karen"
] | [((1171, 1182), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1180, 1182), False, 'import os\n'), ((1288, 1307), 'Utils.sensitive.env_reader', 'env_reader', ([], {'get': '"""*"""'}), "(get='*')\n", (1298, 1307), False, 'from Utils.sensitive import env_reader\n'), ((1321, 1583), 'Utils.__logging__.BOOT', '__logging__.BOO... |
import io
import sys
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Descriptors
print("path=",sys.path)
from decorators import memoize
def get_formula(mol):
return Chem.rdMolDescriptors.CalcMolFormula(mol)
def get_mult(mol):
return Descriptors.NumRadicalElectrons(mol) % 2 + 1
... | [
"rdkit.Chem.rdmolops.GetFormalCharge",
"rdkit.Chem.AddHs",
"rdkit.Chem.AllChem.MMFFOptimizeMolecule",
"rdkit.Chem.MolFromSmiles",
"rdkit.Chem.rdMolDescriptors.CalcMolFormula",
"rdkit.Chem.Descriptors.NumRadicalElectrons",
"rdkit.Chem.AllChem.EmbedMolecule",
"io.StringIO"
] | [((201, 242), 'rdkit.Chem.rdMolDescriptors.CalcMolFormula', 'Chem.rdMolDescriptors.CalcMolFormula', (['mol'], {}), '(mol)\n', (237, 242), False, 'from rdkit import Chem\n'), ((352, 386), 'rdkit.Chem.rdmolops.GetFormalCharge', 'Chem.rdmolops.GetFormalCharge', (['mol'], {}), '(mol)\n', (381, 386), False, 'from rdkit impo... |
from netCDF4._netCDF4 import Variable
import numpy
def decode_time(variable: Variable, unit: str = None) -> numpy.array:
if unit is None:
unit = variable.units
unit, direction, base_date = unit.split(' ', 2)
intervals = {
'years': 'Y',
'months': 'M',
'days': 'D',
'h... | [
"numpy.array",
"numpy.datetime64"
] | [((437, 464), 'numpy.datetime64', 'numpy.datetime64', (['base_date'], {}), '(base_date)\n', (453, 464), False, 'import numpy\n'), ((467, 488), 'numpy.array', 'numpy.array', (['variable'], {}), '(variable)\n', (478, 488), False, 'import numpy\n')] |
import numpy as np
import cv2
import os
import sys
sys.path.insert(0, os.getcwd())
import os.path as osp
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle, Circle
from tools.auto_anno_movie import AnnoationBase, AnnoationSub, get_landmark_annotation, get_face_annotation, LANDMARKS
from easydict i... | [
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.text",
"matplotlib.patches.Rectangle",
"argparse.ArgumentParser",
"matplotlib.pyplot.gca",
"json.dumps",
"os.path.join",
"os.getcwd",
"os.remove",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"json.loa... | [((70, 81), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (79, 81), False, 'import os\n'), ((8562, 8587), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (8585, 8587), False, 'import argparse\n'), ((833, 842), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (840, 842), True, 'import matplotl... |
import click
import sys
@click.group()
@click.option('--debug/--no-debug', default=False)
def cli(debug):
click.echo('Debug mode is %s' % ('on' if debug else 'off'))
@cli.command()
def cmake():
click.echo('cmake')
sys.exit(1)
@cli.command()
def test():
click.echo('testing')
sys.exit(0)
if __... | [
"click.group",
"click.echo",
"click.option",
"sys.exit"
] | [((27, 40), 'click.group', 'click.group', ([], {}), '()\n', (38, 40), False, 'import click\n'), ((42, 91), 'click.option', 'click.option', (['"""--debug/--no-debug"""'], {'default': '(False)'}), "('--debug/--no-debug', default=False)\n", (54, 91), False, 'import click\n'), ((112, 171), 'click.echo', 'click.echo', (["('... |
from __future__ import annotations
from dataclasses import dataclass
from .utils.args import arg, option
from .scheduler import execute, Env
from .protocols import protocols_dict
from . import utils
import time
@dataclass(frozen=True)
class Args:
num_plates: int = arg(help='number of plates to work on the... | [
"dataclasses.dataclass"
] | [((216, 238), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (225, 238), False, 'from dataclasses import dataclass\n')] |
import json
import os
import click
import uuid
from .main import main
from helper import name_to_filepath
from typing import List
from database import read_database, DatabaseStation, StationDatabase, DatabaseRadioStream
@main.command()
@click.option("--source", "-s", default="data/", help='The Directory which contain... | [
"click.prompt",
"click.option",
"database.DatabaseRadioStream",
"uuid.uuid4",
"helper.name_to_filepath",
"database.read_database"
] | [((239, 355), 'click.option', 'click.option', (['"""--source"""', '"""-s"""'], {'default': '"""data/"""', 'help': '"""The Directory which contains the stations as JSON files"""'}), "('--source', '-s', default='data/', help=\n 'The Directory which contains the stations as JSON files')\n", (251, 355), False, 'import c... |
import tkinter as tk
from tkinter import ttk
import json
import subprocess
from PIL import ImageTk, Image
import zipfile
import io
import os
import sys
PER_LINE = int(sys.argv[1])
LINES = int(sys.argv[2])
TMPFILE = sys.argv[5]
SHOWID = str(10214655)
class VerticalScrolledFrame(tk.Frame):
"""A pure Tkinter scrolla... | [
"tkinter.Frame.__init__",
"os.listdir",
"tkinter.ttk.Style",
"tkinter.ttk.Entry",
"zipfile.ZipFile",
"PIL.Image.new",
"tkinter.ttk.Label",
"os.path.isfile",
"tkinter.Canvas",
"tkinter.StringVar",
"tkinter.Scrollbar",
"tkinter.Tk.__init__",
"sys.stderr.write",
"tkinter.Label",
"tkinter.Fr... | [((758, 802), 'tkinter.Frame.__init__', 'tk.Frame.__init__', (['self', 'parent', '*args'], {}), '(self, parent, *args, **kw)\n', (775, 802), True, 'import tkinter as tk\n'), ((900, 938), 'tkinter.Scrollbar', 'tk.Scrollbar', (['self'], {'orient': 'tk.VERTICAL'}), '(self, orient=tk.VERTICAL)\n', (912, 938), True, 'import... |
from __future__ import print_function, division
import torch
from torchvision import transforms
import os, glob, cv2
from PIL import Image
from parameter import *
from model import *
## test on CPU
net_test = Net()
PATH = 'checkpoint/checkpoint_50.pth'
net_test.load_state_dict(torch.load(PATH))
## test... | [
"cv2.imwrite",
"PIL.Image.open",
"torch.unsqueeze",
"torch.load",
"os.path.split",
"cv2.cvtColor",
"torch.squeeze",
"torchvision.transforms.ToTensor",
"glob.glob"
] | [((348, 380), 'glob.glob', 'glob.glob', (['"""./test_images/*.png"""'], {}), "('./test_images/*.png')\n", (357, 380), False, 'import os, glob, cv2\n'), ((292, 308), 'torch.load', 'torch.load', (['PATH'], {}), '(PATH)\n', (302, 308), False, 'import torch\n'), ((454, 470), 'PIL.Image.open', 'Image.open', (['name'], {}), ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('socialaccount', '0003_auto_20150131_1902'),
]
operations = [
migrations.AlterField(
model_name='socialaccount',
... | [
"django.db.models.CharField"
] | [((367, 423), 'django.db.models.CharField', 'models.CharField', ([], {'verbose_name': '"""provider"""', 'max_length': '(30)'}), "(verbose_name='provider', max_length=30)\n", (383, 423), False, 'from django.db import models, migrations\n'), ((585, 641), 'django.db.models.CharField', 'models.CharField', ([], {'verbose_na... |
import asyncio
import concurrent
import itertools
import logging
from cloudvisor.cloud_vm import VM
from botocore.exceptions import ClientError
INSTANCE_TYPES_BY_GPU_COUNT = {'1': ['g3.4xlarge', 'g4dn.2xlarge', 'g4dn.4xlarge'],
'2': ['g3.8xlarge'],
'4': ['... | [
"concurrent.futures.ThreadPoolExecutor",
"itertools.cycle",
"cloudvisor.cloud_vm.VM.from_aws_instance"
] | [((586, 639), 'concurrent.futures.ThreadPoolExecutor', 'concurrent.futures.ThreadPoolExecutor', ([], {'max_workers': '(50)'}), '(max_workers=50)\n', (623, 639), False, 'import concurrent\n'), ((666, 693), 'itertools.cycle', 'itertools.cycle', (['subnet_ids'], {}), '(subnet_ids)\n', (681, 693), False, 'import itertools\... |
'''This class will log 1d array in Nd matrix from device and qualisys object'''
import numpy as np
from datetime import datetime as datetime
from time import time
from utils_mpc import quaternionToRPY
class LoggerControl():
def __init__(self, dt, N0_gait, joystick=None, estimator=None, loop=None, gait=None, state... | [
"matplotlib.pyplot.ylabel",
"numpy.array",
"numpy.sin",
"matplotlib.widgets.Slider",
"numpy.savez",
"utils_mpc.EulerToQuaternion",
"matplotlib.pyplot.plot",
"IPython.embed",
"matplotlib.pyplot.xlabel",
"numpy.max",
"numpy.min",
"matplotlib.pyplot.ylim",
"numpy.round",
"glob.glob",
"utils... | [((44262, 44303), 'LoggerSensors.LoggerSensors', 'LoggerSensors.LoggerSensors', ([], {'logSize': '(5997)'}), '(logSize=5997)\n', (44289, 44303), False, 'import LoggerSensors\n'), ((491, 506), 'numpy.int', 'np.int', (['logSize'], {}), '(logSize)\n', (497, 506), True, 'import numpy as np\n'), ((653, 675), 'numpy.zeros', ... |
from dataclasses import dataclass
from random import random, choice
@dataclass(frozen=True)
class Bot:
__slots__ = 'parent', 'id'
parent: int
id: int
@property
def is_master(self):
return not self.id
def generate():
free_ids = sorted(range(1, 100000), key=lambda _: random())
id... | [
"random.random",
"random.choice",
"dataclasses.dataclass"
] | [((71, 93), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (80, 93), False, 'from dataclasses import dataclass\n'), ((711, 723), 'random.choice', 'choice', (['bots'], {}), '(bots)\n', (717, 723), False, 'from random import random, choice\n'), ((464, 480), 'random.choice', 'choice',... |
# -*- coding: utf-8 -*-
# pylint: disable=no-member
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
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/L... | [
"rnacentral_pipeline.databases.ensembl.metadata.assemblies.load_known",
"rnacentral_pipeline.databases.ensembl.metadata.assemblies.fetch",
"json.load",
"pytest.mark.parametrize",
"rnacentral_pipeline.databases.ensembl.metadata.assemblies.AssemblyExample",
"attr.asdict",
"pytest.fixture"
] | [((806, 836), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (820, 836), False, 'import pytest\n'), ((3127, 3263), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""taxid,count"""', '[(4932, 0), (5127, 0), (546991, 1), (559292, 1), (6239, 1), (6669, 1), (\n 7227,... |
"""
Base class for python file
"""
from pathlib import Path
import os
from pathlib_tree.exceptions import FilesystemError
EMPTY_FILE = '''"""
Automatically generated file
"""
'''
class PythonFile:
"""
Python code file
"""
def __init__(self, path, module=None, create_missing=False):
self.mo... | [
"pathlib_tree.exceptions.FilesystemError",
"pathlib.Path"
] | [((354, 364), 'pathlib.Path', 'Path', (['path'], {}), '(path)\n', (358, 364), False, 'from pathlib import Path\n'), ((2380, 2426), 'pathlib_tree.exceptions.FilesystemError', 'FilesystemError', (['"""File not linked to a module"""'], {}), "('File not linked to a module')\n", (2395, 2426), False, 'from pathlib_tree.excep... |
# -*- coding: utf-8 -*-
"""Client module to communicate with server module."""
import sys
import socket
from server import BUFFER_LENGTH
ADDRINFO = ('127.0.0.1', 5000, 2, 1, 6)
def client(msg):
"""Start a client looking for a connection at listening server."""
infos = socket.getaddrinfo(*ADDRINFO)
stream... | [
"socket.getaddrinfo",
"socket.socket"
] | [((280, 309), 'socket.getaddrinfo', 'socket.getaddrinfo', (['*ADDRINFO'], {}), '(*ADDRINFO)\n', (298, 309), False, 'import socket\n'), ((395, 426), 'socket.socket', 'socket.socket', (['*stream_info[:3]'], {}), '(*stream_info[:3])\n', (408, 426), False, 'import socket\n')] |
from __future__ import absolute_import, print_function
import os
from unittest import skipIf, TestCase
from click.testing import CliRunner
from kms_vault.scripts.kms_vault import cli
from .utils import not_live
class TestKMSCommands(TestCase):
def setUp(self):
self.runner = CliRunner()
@skipIf(not_... | [
"click.testing.CliRunner",
"os.remove"
] | [((291, 302), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (300, 302), False, 'from click.testing import CliRunner\n'), ((900, 945), 'os.remove', 'os.remove', (['"""./tests/fixtures/secrets.yml.enc"""'], {}), "('./tests/fixtures/secrets.yml.enc')\n", (909, 945), False, 'import os\n')] |
from pyticketswitch.country import Country
from pyticketswitch.mixins import JSONMixin
class SendMethod(JSONMixin, object):
"""Describes a method of sending tickets to a customer.
Attributes:
code (str): identifier for the send method.
cost (float): additional cost to the customer for this se... | [
"pyticketswitch.country.Country.from_api_data"
] | [((2485, 2515), 'pyticketswitch.country.Country.from_api_data', 'Country.from_api_data', (['country'], {}), '(country)\n', (2506, 2515), False, 'from pyticketswitch.country import Country\n')] |
from typing import Any, Tuple, Callable, Iterator
from os import path
import csv
import random
import numpy as np
from PIL import Image
import torch
from torchvision.transforms.functional import to_tensor
def make_reproducible(seed: int = 0) -> None:
random.seed(seed)
np.random.seed(seed)
torch.manual_see... | [
"torch.manual_seed",
"csv.DictReader",
"PIL.Image.open",
"os.path.join",
"random.seed",
"os.path.dirname",
"numpy.random.seed"
] | [((257, 274), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (268, 274), False, 'import random\n'), ((279, 299), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (293, 299), True, 'import numpy as np\n'), ((304, 327), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (32... |
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-4, 4, num=20)
y1 = x
y2 = -y1
y3 = y1**2
fig = plt.figure(figsize=(8, 5))
ax = fig.add_subplot()
ax.scatter(x=x, y=y1, marker="v", s=1000)
ax.scatter(x=x, y=y2, marker="X", s=100)
ax.scatter(x=x, y=y3, marker="s", s=10)
plt.tight_layout()
plt.s... | [
"matplotlib.pyplot.savefig",
"numpy.linspace",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show"
] | [((57, 83), 'numpy.linspace', 'np.linspace', (['(-4)', '(4)'], {'num': '(20)'}), '(-4, 4, num=20)\n', (68, 83), True, 'import numpy as np\n'), ((119, 145), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 5)'}), '(figsize=(8, 5))\n', (129, 145), True, 'import matplotlib.pyplot as plt\n'), ((296, 314), 'm... |
import time
import traceback
import networkx as nx
import pandas as pd
import numpy as np
import os
import random
from neo4j.types.graph import Node, Relationship
from node2vec import Node2Vec
import stellargraph as sg
from stellargraph import StellarGraph
from stellargraph.data import EdgeSplitter
from... | [
"stellargraph.layer.link_classification",
"networkx.MultiDiGraph",
"tensorflow.keras.Model",
"traceback.print_exception",
"time.perf_counter",
"stellargraph.mapper.GraphSAGELinkGenerator",
"tensorflow.keras.optimizers.Adam",
"stellargraph.StellarGraph.from_networkx",
"stellargraph.mapper.GraphSAGENo... | [((1731, 1750), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (1748, 1750), False, 'import time\n'), ((1811, 1830), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (1828, 1830), False, 'import time\n'), ((1901, 1920), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (1918, 1920), Fa... |
#Write by <NAME>, contact: <EMAIL>
# -*- coding: utf-8 -*-
## use GPU
import os
import tensorflow as tf
os.environ['CUDA_VISIBLE_DEVICES']='0'
config=tf.ConfigProto()
config.gpu_options.allow_growth= True
sess=tf.Session(config=config)
import numpy as np
import matplotlib.pyplot as plt
import scipy.io as sio
from ker... | [
"numpy.prod",
"keras.models.load_model",
"scipy.io.savemat",
"Utils.zeroPadding.zeroPadding_3D",
"tensorflow.Session",
"scipy.io.loadmat",
"matplotlib.pyplot.Axes",
"h5py.File",
"numpy.max",
"Utils.ssrn_SS_Houston_3FF_F1.ResnetBuilder.build_resnet_2_2",
"matplotlib.pyplot.figure",
"numpy.zeros... | [((151, 167), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (165, 167), True, 'import tensorflow as tf\n'), ((211, 236), 'tensorflow.Session', 'tf.Session', ([], {'config': 'config'}), '(config=config)\n', (221, 236), True, 'import tensorflow as tf\n'), ((3432, 3519), 'scipy.io.loadmat', 'sio.loadmat', ... |
#!/usr/bin/env python
from __future__ import print_function, division, absolute_import
import pytest
from garleek.mm.tinker import _parse_tinker_testgrad, _parse_tinker_analyze, _parse_tinker_testhess
def test_prepare_tinker_xyz():
pass
def test_prepare_tinker_inpkey():
pass
@pytest.mark.parametrize("pat... | [
"garleek.mm.tinker._parse_tinker_testhess",
"pytest.mark.parametrize"
] | [((292, 407), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""path, energy, dipole"""', "[['moredata/parsers/tinker_analyze.out', -2.6773, [0, 0, 0]]]"], {}), "('path, energy, dipole', [[\n 'moredata/parsers/tinker_analyze.out', -2.6773, [0, 0, 0]]])\n", (315, 407), False, 'import pytest\n'), ((649, 750)... |
"""
This file to define Estimate various parameters
"""
import numpy as np
import pandas as pd
from scipy.spatial import distance
import matplotlib.pyplot as plt
import networkx as nx
from pyproj import Proj
from pyproj import Proj, transform
# trasforming latlong into mercetor coordinates
def tran(data):
ut... | [
"pandas.Series",
"numpy.abs",
"pyproj.transform",
"numpy.array",
"pyproj.Proj",
"scipy.spatial.distance.euclidean"
] | [((639, 651), 'numpy.array', 'np.array', (['rx'], {}), '(rx)\n', (647, 651), True, 'import numpy as np\n'), ((659, 671), 'numpy.array', 'np.array', (['ry'], {}), '(ry)\n', (667, 671), True, 'import numpy as np\n'), ((1112, 1126), 'numpy.array', 'np.array', (['dist'], {}), '(dist)\n', (1120, 1126), True, 'import numpy a... |
import os
from flask import render_template, redirect, session, url_for, request, send_from_directory, jsonify
from app import app
from werkzeug import secure_filename
from style_grader_main import style_grader_driver
app.config['UPLOAD_FOLDER'] = 'uploads/'
app.config['ALLOWED_EXTENSIONS'] = set(['cpp', 'h'])
# @app... | [
"flask.render_template",
"flask.send_from_directory",
"flask.request.files.getlist",
"style_grader_main.style_grader_driver",
"os.path.join",
"werkzeug.secure_filename",
"app.app.route",
"flask.jsonify"
] | [((526, 557), 'app.app.route', 'app.route', (['"""/"""'], {'methods': "['GET']"}), "('/', methods=['GET'])\n", (535, 557), False, 'from app import app\n'), ((562, 606), 'app.app.route', 'app.route', (['"""/index"""'], {'methods': "['GET', 'POST']"}), "('/index', methods=['GET', 'POST'])\n", (571, 606), False, 'from app... |
import requests
from cloud_info_provider import exceptions
from cloud_info_provider import providers
from cloud_info_provider import utils
class MesosProvider(providers.BaseProvider):
service_type = "compute"
goc_service_type = None
def __init__(self, opts):
super(MesosProvider, self).__init__(o... | [
"cloud_info_provider.providers.static.StaticProvider",
"requests.packages.urllib3.disable_warnings",
"requests.get",
"cloud_info_provider.utils.env",
"cloud_info_provider.exceptions.MesosProviderException",
"cloud_info_provider.utils.get_defined_values"
] | [((1386, 1423), 'cloud_info_provider.providers.static.StaticProvider', 'providers.static.StaticProvider', (['opts'], {}), '(opts)\n', (1417, 1423), False, 'from cloud_info_provider import providers\n'), ((588, 626), 'cloud_info_provider.exceptions.MesosProviderException', 'exceptions.MesosProviderException', (['msg'], ... |
import click
import pandas as pd
from os.path import basename
from .api import (
entropy_reduce_postion_matrices,
entropy_reduce_position_matrix,
fast_entropy_reduce_postion_matrices,
filter_concat_matrices,
)
@click.group('stat-strains')
def stat_strains():
pass
@stat_strains('concat')
@clic... | [
"click.argument",
"pandas.read_csv",
"click.group",
"click.option",
"click.File",
"click.echo",
"os.path.basename"
] | [((232, 259), 'click.group', 'click.group', (['"""stat-strains"""'], {}), "('stat-strains')\n", (243, 259), False, 'import click\n'), ((384, 417), 'click.argument', 'click.argument', (['"""files"""'], {'nargs': '(-1)'}), "('files', nargs=-1)\n", (398, 417), False, 'import click\n'), ((558, 606), 'click.option', 'click.... |
# Hacky script to just dump the contents of every table to json files
import os
import psycopg2.errors
from pathlib import Path
from sqlalchemy.dialects.postgresql import psycopg2
from steampipe_alchemy import SteamPipe, models
import steampipe_alchemy
from steampipe_alchemy.models import AwsWellarchitectedWorkload, ... | [
"steampipe_alchemy.SteamPipe",
"steampipe_alchemy.all_models.remove",
"os.mkdir",
"pathlib.Path"
] | [((421, 432), 'steampipe_alchemy.SteamPipe', 'SteamPipe', ([], {}), '()\n', (430, 432), False, 'from steampipe_alchemy import SteamPipe, models\n'), ((1093, 1111), 'os.mkdir', 'os.mkdir', (['"""output"""'], {}), "('output')\n", (1101, 1111), False, 'import os\n'), ((1116, 1167), 'steampipe_alchemy.all_models.remove', '... |
import unittest
from meerk40t.kernel import Kernel
state = 0
class TestLifeCycle(unittest.TestCase):
def test_kernel_lifecycle(self):
def lifecycle_test(obj=None, lifecycle=None):
global state
if lifecycle == "preregister":
self.assertEquals(state, 0)
... | [
"meerk40t.kernel.Kernel"
] | [((2124, 2171), 'meerk40t.kernel.Kernel', 'Kernel', (['"""MeerK40t"""', '"""0.0.0-testing"""', '"""MeerK40t"""'], {}), "('MeerK40t', '0.0.0-testing', 'MeerK40t')\n", (2130, 2171), False, 'from meerk40t.kernel import Kernel\n')] |
# Copyright Notice:
# Copyright 2016-2019 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-library/blob/master/LICENSE.md
# -*- coding: utf-8 -*-
""" Shared types used in this module """
#---------Imports---------
import logging
impo... | [
"logging.getLogger"
] | [((458, 485), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (475, 485), False, 'import logging\n')] |
#import newspaper
#from keras.models import Sequential
#import keras
import re
import os
import nltk
from gensim.models import word2vec
import json
import numpy as np
import pandas as pd
from collections import Counter
from scipy.spatial.distance import cosine, euclidean, jaccard
from nltk.classify import NaiveBayesCla... | [
"gensim.models.word2vec.Word2Vec",
"nltk.corpus.stopwords.words",
"nltk.WordPunctTokenizer",
"json.load",
"re.sub",
"re.findall"
] | [((2425, 2450), 'nltk.WordPunctTokenizer', 'nltk.WordPunctTokenizer', ([], {}), '()\n', (2448, 2450), False, 'import nltk\n'), ((2464, 2502), 'nltk.corpus.stopwords.words', 'nltk.corpus.stopwords.words', (['"""english"""'], {}), "('english')\n", (2491, 2502), False, 'import nltk\n'), ((3105, 3130), 'nltk.WordPunctToken... |
# -*- coding: utf-8 -*-
# cython: language_level=3
# BSD 3-Clause License
#
# Copyright (c) 2020-2022, Faster Speeding
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of sour... | [
"copy.copy",
"typing.TypeVar"
] | [((2079, 2127), 'typing.TypeVar', 'typing.TypeVar', (['"""_ContextT"""'], {'bound': '"""abc.Context"""'}), "('_ContextT', bound='abc.Context')\n", (2093, 2127), False, 'import typing\n'), ((1922, 1970), 'typing.TypeVar', 'typing.TypeVar', (['"""_CheckSigT"""'], {'bound': 'abc.CheckSig'}), "('_CheckSigT', bound=abc.Chec... |
import unittest
from Bankers_Algorithm_ASU19.main import handleDeadlock
class testHandleDeadlocks(unittest.TestCase):
def test_normalCase1(self):
reply = handleDeadlock(
5,
3,
[0, 0, 0],
[[0, 1, 0], [4, 0, 2], [3, 0, 3], [3, 1, 1], [0, 0, 4]],
[[5... | [
"Bankers_Algorithm_ASU19.main.handleDeadlock"
] | [((167, 318), 'Bankers_Algorithm_ASU19.main.handleDeadlock', 'handleDeadlock', (['(5)', '(3)', '[0, 0, 0]', '[[0, 1, 0], [4, 0, 2], [3, 0, 3], [3, 1, 1], [0, 0, 4]]', '[[500, 1, 0], [2, 0, 0], [3, 0, 3], [2, 1, 1], [0, 0, 2]]'], {}), '(5, 3, [0, 0, 0], [[0, 1, 0], [4, 0, 2], [3, 0, 3], [3, 1, 1],\n [0, 0, 4]], [[500... |