code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import vcs
import cdms2
import os
import MV2
f = cdms2.open(os.path.join(vcs.sample_data, "clt.nc"))
s = f("clt", time=slice(0, 1), squeeze=1)
s = MV2.masked_less(s, 65.)
x = vcs.init()
gm = x.createisofill()
gm.missing = 252
x.plot(s, gm)
x.png(gm.g_name)
x.interact()
| [
"os.path.join",
"vcs.init",
"MV2.masked_less"
] | [((148, 172), 'MV2.masked_less', 'MV2.masked_less', (['s', '(65.0)'], {}), '(s, 65.0)\n', (163, 172), False, 'import MV2\n'), ((176, 186), 'vcs.init', 'vcs.init', ([], {}), '()\n', (184, 186), False, 'import vcs\n'), ((61, 100), 'os.path.join', 'os.path.join', (['vcs.sample_data', '"""clt.nc"""'], {}), "(vcs.sample_dat... |
from __future__ import unicode_literals
from django.contrib.auth.models import User, Permission
from django.db import models
from django.test import TestCase
from rest_framework import generics, status, permissions, authentication, HTTP_HEADER_ENCODING
from rest_framework.tests.utils import RequestFactory
import base64... | [
"django.contrib.auth.models.Permission.objects.get",
"django.db.models.ForeignKey",
"json.dumps",
"rest_framework.tests.utils.RequestFactory",
"django.db.models.CharField",
"django.contrib.auth.models.User.objects.create_user"
] | [((344, 360), 'rest_framework.tests.utils.RequestFactory', 'RequestFactory', ([], {}), '()\n', (358, 360), False, 'from rest_framework.tests.utils import RequestFactory\n'), ((406, 438), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (422, 438), False, 'from djang... |
try:
import numpy as np
except ImportError:
raise RuntimeError('cannot import numpy, make sure numpy package is installed')
from carla.client import VehicleControl
from carla.agent import Agent
import matplotlib.pyplot as plt
import psutil
import gc
gc.enable()
import pickle
import time
import os
import ZG... | [
"numpy.sqrt",
"torch.max",
"psutil.virtual_memory",
"fcn.prepare_EncNet.get_encnet_resnet101_ade",
"fcn.prepare_psp.get_psp_resnet50_ade",
"sys.path.append",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.waitforbuttonpress",
"gc.enable",
"torchvision.transforms.ToTensor",
"numpy.random.choice",... | [((261, 272), 'gc.enable', 'gc.enable', ([], {}), '()\n', (270, 272), False, 'import gc\n'), ((2097, 2113), 'carla.client.VehicleControl', 'VehicleControl', ([], {}), '()\n', (2111, 2113), False, 'from carla.client import VehicleControl\n'), ((9683, 9695), 'gc.collect', 'gc.collect', ([], {}), '()\n', (9693, 9695), Fal... |
from os.path import join
from numpy import sqrt, pi, linspace, array, zeros
from numpy.testing import assert_almost_equal
from multiprocessing import cpu_count
import pytest
from SciDataTool.Functions.Plot.plot_2D import plot_2D
from pyleecan.Classes.OPdq import OPdq
from pyleecan.Classes.Simu1 import Simu1
from p... | [
"pytest.approx",
"numpy.sqrt",
"pyleecan.Classes.Simu1.Simu1",
"pyleecan.Classes.OPdq.OPdq",
"os.path.join",
"multiprocessing.cpu_count",
"pyleecan.Classes.Electrical.Electrical",
"pyleecan.Classes.MagFEMM.MagFEMM",
"numpy.array",
"numpy.linspace",
"numpy.zeros",
"numpy.testing.assert_almost_e... | [((1139, 1188), 'pyleecan.Classes.Simu1.Simu1', 'Simu1', ([], {'name': '"""test_EEC_PMSM"""', 'machine': 'Toyota_Prius'}), "(name='test_EEC_PMSM', machine=Toyota_Prius)\n", (1144, 1188), False, 'from pyleecan.Classes.Simu1 import Simu1\n'), ((1450, 1538), 'pyleecan.Classes.MagFEMM.MagFEMM', 'MagFEMM', ([], {'is_periodi... |
#!/usr/bin/env python3
import requests
class CheckAuth:
def __init__(self, http_link) -> None:
self.http_link = http_link
self.request = requests.get(self.http_link)
def json(self):
return self.request.json()
| [
"requests.get"
] | [((160, 188), 'requests.get', 'requests.get', (['self.http_link'], {}), '(self.http_link)\n', (172, 188), False, 'import requests\n')] |
'''
Configures logger
'''
import logging
import os
# Delete previous debug log
if os.path.exists("debug.log"):
os.remove("debug.log")
# Initialize logger
FORMAT = '[%(levelname)s] - %(asctime)s: %(message)s'
logging.basicConfig(handlers=[logging.FileHandler(filename='debug.log', encoding='utf-8', mode='a+')],
... | [
"os.path.exists",
"logging.info",
"logging.FileHandler",
"os.remove"
] | [((83, 110), 'os.path.exists', 'os.path.exists', (['"""debug.log"""'], {}), "('debug.log')\n", (97, 110), False, 'import os\n'), ((432, 486), 'logging.info', 'logging.info', (['"""----------------Start-----------------"""'], {}), "('----------------Start-----------------')\n", (444, 486), False, 'import logging\n'), ((... |
import tensorflow as tf
class Layer():
def __init__(self,scope,output_dim = -1,reuse = None):
self.scope = scope
self.reuse = reuse
self.output_dim = output_dim
self.call_cnt = 0
self.initializer = None
self.set_initializer()
self.set_extra_parameter... | [
"tensorflow.cast",
"tensorflow.shape",
"tensorflow.variable_scope",
"tensorflow.ones",
"tensorflow.reduce_sum",
"tensorflow.gather",
"tensorflow.expand_dims",
"tensorflow.log",
"tensorflow.sequence_mask",
"tensorflow.gather_nd",
"tensorflow.exp"
] | [((3365, 3386), 'tensorflow.log', 'tf.log', (['(probs + 1e-08)'], {}), '(probs + 1e-08)\n', (3371, 3386), True, 'import tensorflow as tf\n'), ((3411, 3436), 'tensorflow.log', 'tf.log', (['(1 - probs + 1e-08)'], {}), '(1 - probs + 1e-08)\n', (3417, 3436), True, 'import tensorflow as tf\n'), ((3591, 3626), 'tensorflow.ga... |
# read in bls_data_frame module
import bls_data_frame as b
# read in the match_indeed_to_skill module
import match_indeed_to_skill as mi
# read in the heinz_scraper module
import heinz_scraper as hs
# Get DF of BLS with Data
df_bls = b.get_df_bls()
# Get full list of BLS-tracked jobs
job_list = b.get_job_list(df_bls)... | [
"bls_data_frame.get_df_bls",
"bls_data_frame.get_job_list",
"match_indeed_to_skill.get_skill_list",
"match_indeed_to_skill.scrape_pages",
"heinz_scraper.get_skill_map",
"match_indeed_to_skill.return_job_count"
] | [((235, 249), 'bls_data_frame.get_df_bls', 'b.get_df_bls', ([], {}), '()\n', (247, 249), True, 'import bls_data_frame as b\n'), ((298, 320), 'bls_data_frame.get_job_list', 'b.get_job_list', (['df_bls'], {}), '(df_bls)\n', (312, 320), True, 'import bls_data_frame as b\n'), ((382, 401), 'match_indeed_to_skill.get_skill_l... |
import re
from datetime import datetime
from ..metadata import OAC11_CODE, RU11IND_CODES
from . import areas, places
from .controller import Controller
class Postcode(Controller):
es_index = "geo_postcode"
url_slug = "postcodes"
date_fields = ["dointr", "doterm"]
not_area_fields = ["osgrdind", "user... | [
"datetime.datetime.strptime",
"re.sub",
"re.match"
] | [((4581, 4618), 're.sub', 're.sub', (['"""[^0-9a-zA-Z]+"""', '""""""', 'postcode'], {}), "('[^0-9a-zA-Z]+', '', postcode)\n", (4587, 4618), False, 'import re\n'), ((1239, 1277), 're.match', 're.match', (['"""[A-Z][0-9]{8}"""', 'postcode[k]'], {}), "('[A-Z][0-9]{8}', postcode[k])\n", (1247, 1277), False, 'import re\n'),... |
import io
import requests
import csv
import time
from typing import Union, Callable
from os.path import join
import pandas as pd
from comotion import Auth
from comotion import comodash_api_client_lowlevel
from comodash_api_client_lowlevel.comodash_api import queries_api
from comodash_api_client_lowlevel.model.query_tex... | [
"comotion.comodash_api_client_lowlevel.ApiClient",
"pandas.read_csv",
"io.BytesIO",
"time.sleep",
"io.open",
"comodash_api_client_lowlevel.model.query_text.QueryText",
"comodash_api_client_lowlevel.comodash_api.queries_api.QueriesApi"
] | [((8688, 8700), 'io.BytesIO', 'io.BytesIO', ([], {}), '()\n', (8698, 8700), False, 'import io\n'), ((10732, 10789), 'pandas.read_csv', 'pd.read_csv', (['file'], {'chunksize': 'chunksize', 'encoding': 'encoding'}), '(file, chunksize=chunksize, encoding=encoding)\n', (10743, 10789), True, 'import pandas as pd\n'), ((2235... |
import numpy as np
class ClusterProcessor(object):
def __init__(self, dataset):
self.dataset = dataset
self.dtype = np.float32
def __len__(self):
return self.dataset.size
def build_adj(self, node, edge):
node = list(node)
abs2rel = {}
rel2abs = {}
... | [
"numpy.eye"
] | [((442, 454), 'numpy.eye', 'np.eye', (['size'], {}), '(size)\n', (448, 454), True, 'import numpy as np\n')] |
# coding: utf-8
"""
YNAB API Endpoints
Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.youneedabudge... | [
"six.iteritems"
] | [((10277, 10310), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (10290, 10310), False, 'import six\n')] |
"""
Trains and tests ECO-DQN on 20 spin BA graphs.
"""
import experiments.BA_20spin.test.test_eco as test
import experiments.BA_20spin.train.train_eco as train
save_loc="BA_20spin/eco"
train.run(save_loc)
test.run(save_loc, graph_save_loc="_graphs/validation/BA_20spin_m4_100graphs.pkl", batched=True, max_batch_size=... | [
"experiments.BA_20spin.test.test_eco.run",
"experiments.BA_20spin.train.train_eco.run"
] | [((187, 206), 'experiments.BA_20spin.train.train_eco.run', 'train.run', (['save_loc'], {}), '(save_loc)\n', (196, 206), True, 'import experiments.BA_20spin.train.train_eco as train\n'), ((208, 334), 'experiments.BA_20spin.test.test_eco.run', 'test.run', (['save_loc'], {'graph_save_loc': '"""_graphs/validation/BA_20spin... |
from pgmpy.models import MarkovModel
from pgmpy.factors.discrete import JointProbabilityDistribution, DiscreteFactor
from itertools import combinations
from flyingsquid.helpers import *
import numpy as np
import math
from tqdm import tqdm
import sys
import random
class Mixin:
'''
Functions to compute observabl... | [
"numpy.prod",
"pgmpy.factors.discrete.JointProbabilityDistribution"
] | [((688, 758), 'pgmpy.factors.discrete.JointProbabilityDistribution', 'JointProbabilityDistribution', (['Ys_ordered', 'cardinalities', 'class_balance'], {}), '(Ys_ordered, cardinalities, class_balance)\n', (716, 758), False, 'from pgmpy.factors.discrete import JointProbabilityDistribution, DiscreteFactor\n'), ((2783, 27... |
import numpy as np
from hand import Hand
iterations = 250000
starting_size = 8 #inclusive
mullto = 7 #inclusive
hand = Hand("decklists/affinity.txt")
hand_types = ["t1 2-drop", "t1 3-drop"]
hand_counts = np.zeros(((starting_size + 1) - mullto,len(hand_types)))
totals = np.zeros(((starting_size + 1) - mullto,1))
zero_... | [
"numpy.flip",
"numpy.zeros",
"hand.Hand"
] | [((120, 150), 'hand.Hand', 'Hand', (['"""decklists/affinity.txt"""'], {}), "('decklists/affinity.txt')\n", (124, 150), False, 'from hand import Hand\n'), ((271, 312), 'numpy.zeros', 'np.zeros', (['(starting_size + 1 - mullto, 1)'], {}), '((starting_size + 1 - mullto, 1))\n', (279, 312), True, 'import numpy as np\n'), (... |
from collections import Counter
from imblearn.datasets import make_imbalance
from imblearn.metrics import classification_report_imbalanced
from imblearn.pipeline import make_pipeline
from imblearn.under_sampling import ClusterCentroids
from imblearn.under_sampling import NearMiss
import matplotlib.pyplot as plt
from ... | [
"sklearn.datasets.load_iris",
"matplotlib.pyplot.contourf",
"numpy.unique",
"matplotlib.pyplot.show",
"sklearn.model_selection.train_test_split",
"sklearn.svm.LinearSVC",
"imblearn.datasets.make_imbalance",
"matplotlib.pyplot.figure",
"pandas.DataFrame",
"imblearn.under_sampling.NearMiss",
"matp... | [((1686, 1733), 'matplotlib.pyplot.contourf', 'plt.contourf', (['xx1', 'xx2', 'Z'], {'alpha': '(0.4)', 'cmap': 'cmap'}), '(xx1, xx2, Z, alpha=0.4, cmap=cmap)\n', (1698, 1733), True, 'import matplotlib.pyplot as plt\n'), ((2215, 2226), 'sklearn.datasets.load_iris', 'load_iris', ([], {}), '()\n', (2224, 2226), False, 'fr... |
# coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | [
"six.iteritems"
] | [((12090, 12119), 'six.iteritems', 'iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (12099, 12119), False, 'from six import iteritems\n')] |
# -*- coding: utf-8 -*-
# Copyright (c) <NAME>. All Rights Reserved.
# Distributed under the MIT License. See LICENSE file for more info.
import threading
import time
from asyncframes import Frame, Event, sleep
from asyncframes.pyqt5_eventloop import EventLoop
class Thread(threading.Thread):
def __init__(self, *a... | [
"asyncframes.Event",
"asyncframes.pyqt5_eventloop.EventLoop",
"time.sleep",
"asyncframes.sleep"
] | [((731, 742), 'asyncframes.pyqt5_eventloop.EventLoop', 'EventLoop', ([], {}), '()\n', (740, 742), False, 'from asyncframes.pyqt5_eventloop import EventLoop\n'), ((399, 420), 'asyncframes.Event', 'Event', (['"""Thread.event"""'], {}), "('Thread.event')\n", (404, 420), False, 'from asyncframes import Frame, Event, sleep\... |
# -*- coding: utf-8 -*-
# Copyright 2018, AVATech
#
# Author Harold.Duan
# This module is (windows\unix) print script.
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
# sys.path.append('../printer')
from printer import Printer
if __name__ == '__main__':
printer = Printer()
printer.run()
pass
| [
"printer.Printer",
"sys.setdefaultencoding"
] | [((144, 175), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (166, 175), False, 'import sys\n'), ((278, 287), 'printer.Printer', 'Printer', ([], {}), '()\n', (285, 287), False, 'from printer import Printer\n')] |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import math
import numpy as np
import states.area
import states.face
import states.fail
import states.success
from challenge import Challenge
class NoseState:
MAXIMUM_DURATION_IN_SECONDS = 10
AREA_BOX_T... | [
"numpy.histogram2d",
"numpy.linalg.norm",
"numpy.reshape",
"numpy.polyfit"
] | [((3767, 3829), 'numpy.polyfit', 'np.polyfit', (['nose_trajectory_x', 'nose_trajectory_y', '(2)'], {'full': '(True)'}), '(nose_trajectory_x, nose_trajectory_y, 2, full=True)\n', (3777, 3829), True, 'import numpy as np\n'), ((4311, 4405), 'numpy.histogram2d', 'np.histogram2d', (['original_landmarks_x', 'original_landmar... |
# This file was generated
import array
import ctypes
import datetime
import threading
import nitclk._attributes as _attributes
import nitclk._converters as _converters
import nitclk._library_singleton as _library_singleton
import nitclk._visatype as _visatype
import nitclk.errors as errors
# Used for __repr__ and __... | [
"nitclk._visatype.ViBoolean",
"ctypes.pointer",
"datetime.timedelta",
"nitclk._visatype.ViAttr",
"nitclk.errors.handle_error",
"threading.Lock",
"pprint.PrettyPrinter",
"nitclk._attributes.AttributeViReal64",
"nitclk._converters.convert_timedelta_to_seconds_real64",
"nitclk._visatype.ViSession",
... | [((345, 375), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {'indent': '(4)'}), '(indent=4)\n', (365, 375), False, 'import pprint\n'), ((427, 443), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (441, 443), False, 'import threading\n'), ((1612, 1644), 'nitclk._attributes.AttributeViString', '_attributes.A... |
from django.core.management.base import BaseCommand, CommandError
from cart.default_data import update_or_create_cats_and_prods
class Command(BaseCommand):
help = (
"Updates or creates the default set of Product and "
"Category objects.")
def handle(self, *args, **options):
update_... | [
"cart.default_data.update_or_create_cats_and_prods"
] | [((313, 346), 'cart.default_data.update_or_create_cats_and_prods', 'update_or_create_cats_and_prods', ([], {}), '()\n', (344, 346), False, 'from cart.default_data import update_or_create_cats_and_prods\n')] |
#!/usr/bin/env python3
##############################################################################
## This file is part of 'ATLAS ALTIROC DEV'.
## It is subject to the license terms in the LICENSE.txt file found in the
## top-level directory of this distribution and at:
## https://confluence.slac.stanford.edu/d... | [
"pyrogue.RemoteCommand",
"pyrogue.RemoteVariable"
] | [((998, 1126), 'pyrogue.RemoteVariable', 'pr.RemoteVariable', ([], {'name': '"""RSTB_RAM"""', 'description': '"""reset input active LOW"""', 'offset': '(0)', 'bitSize': '(1)', 'mode': '"""RW"""', 'units': '"""active LOW"""'}), "(name='RSTB_RAM', description='reset input active LOW',\n offset=0, bitSize=1, mode='RW',... |
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
# Copyright (c) 2016, Battelle Memorial Institute
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistri... | [
"gevent.sleep",
"pytest.mark.skip",
"volttron.platform.agent.base_market_agent.poly_line.PolyLine",
"datetime.datetime.now",
"volttron.platform.agent.base_market_agent.point.Point",
"pytest.fixture",
"pytest.skip"
] | [((7191, 7221), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (7205, 7221), False, 'import pytest\n'), ((7875, 7907), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (7889, 7907), False, 'import pytest\n'), ((8215, 8247), 'pytes... |
"""Unit tests for //deeplearning/clgen:sample_observers."""
import pathlib
import pytest
from deeplearning.clgen import preprocess
from labm8.py import app
from labm8.py import fs
from labm8.py import test
FLAGS = app.FLAGS
@test.Fixture(scope="function")
def contentfiles(tempdir: pathlib.Path) -> pathlib.Path:
... | [
"labm8.py.test.Fixture",
"deeplearning.clgen.preprocess.Preprocess",
"labm8.py.test.Main"
] | [((230, 260), 'labm8.py.test.Fixture', 'test.Fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (242, 260), False, 'from labm8.py import test\n'), ((538, 694), 'deeplearning.clgen.preprocess.Preprocess', 'preprocess.Preprocess', (['contentfiles', 'tempdir2', "['deeplearning.clgen.preprocessors.cxx:Com... |
from os import listdir, stat
from os.path import isfile, join, commonprefix, splitext
thePath = "\\\\etude\\Archiv\\Daten\\Partikel\\FARO\\"
theScript = "U:\\home\\reina\\src\\megamol-dev\\plugins\\pbs\\utils\\cpe2mmpld.lua"
allFiles = [f for f in listdir(thePath) if isfile(join(thePath, f))]
filteredFiles = []
for ... | [
"os.listdir",
"os.path.join",
"os.path.splitext",
"os.path.commonprefix",
"os.stat"
] | [((628, 645), 'os.stat', 'stat', (['(thePath + f)'], {}), '(thePath + f)\n', (632, 645), False, 'from os import listdir, stat\n'), ((250, 266), 'os.listdir', 'listdir', (['thePath'], {}), '(thePath)\n', (257, 266), False, 'from os import listdir, stat\n'), ((390, 411), 'os.path.commonprefix', 'commonprefix', (['[f, f2]... |
from random import random
import numpy as np
from math import e
def degrau(u):
if u>=0:
return 1
else:
return 0
def degrauBipolar(u):
if u>0:
return 1
elif u==0:
return 0
else:
return -1
def linear(u):
return u
def logistica(u,beta):
return 1/(1 + e*... | [
"numpy.array",
"random.random",
"numpy.prod"
] | [((4321, 4345), 'numpy.array', 'np.array', (['entrada_e_peso'], {}), '(entrada_e_peso)\n', (4329, 4345), True, 'import numpy as np\n'), ((3896, 3918), 'numpy.prod', 'np.prod', (['linha'], {'axis': '(1)'}), '(linha, axis=1)\n', (3903, 3918), True, 'import numpy as np\n'), ((4008, 4016), 'random.random', 'random', ([], {... |
from torchvision import datasets, transforms
from torch import optim
import torch
from torch import nn
import torch.nn.functional as F
def downloadData():
transform = transforms.Compose(
[transforms.ToTensor(),
transforms.Normalize((0.5,0.5,0.5),(0.5,0.5,0.5))
])
trainset = datasets.MNIST('MNIST_data/', downl... | [
"torch.nn.ReLU",
"torch.utils.data.DataLoader",
"torch.nn.NLLLoss",
"torch.nn.Linear",
"torch.nn.LogSoftmax",
"torchvision.datasets.MNIST",
"torchvision.transforms.Normalize",
"torchvision.transforms.ToTensor"
] | [((285, 362), 'torchvision.datasets.MNIST', 'datasets.MNIST', (['"""MNIST_data/"""'], {'download': '(True)', 'train': '(True)', 'transform': 'transform'}), "('MNIST_data/', download=True, train=True, transform=transform)\n", (299, 362), False, 'from torchvision import datasets, transforms\n'), ((378, 444), 'torch.utils... |
'''Group Anagrams.
Write a method to sort an array of strings so that all the anagrams are
next to each other.
'''
def group_anagrams1(words : list[str]) -> list[str]:
"""
O(N logN ) solution.
Args:
words (list[str]): words
Returns:
list[str]: sorted by anagrams
"""
def get_w... | [
"collections.defaultdict"
] | [((1205, 1222), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1216, 1222), False, 'from collections import defaultdict\n')] |
from BuyCoin.objects.errors import ParameterNotAllowed
from BuyCoin.utils import buycoin_params
class P2P:
"""
"""
operations = ["pmo", "plo"]
price_types = ["static", "dynamic"]
operation = None
cryptocurrency = None
coinAmount = None
staticPrice = None
priceType = None
dynam... | [
"BuyCoin.objects.errors.ParameterNotAllowed"
] | [((578, 847), 'BuyCoin.objects.errors.ParameterNotAllowed', 'ParameterNotAllowed', (['"""Please specify the operation to be done. \'pmo\' refers to \'Place Market Order\' (place order at market price). \'plo\' refers to \'Place Limit Order\' (requires a specific price type ... |
#!/usr/bin/env python
"""
main script used to execute the boardgame host from the command line.
"""
# pylint: disable=wrong-import-position
# pylint: disable=wrong-import-order
# pylint: disable=invalid-name
# pylint: disable=too-many-locals
from gevent import monkey
monkey.patch_all()
import sys
import time
import ar... | [
"argparse.ArgumentParser",
"gevent.monkey.patch_all",
"pkg_resources.iter_entry_points",
"time.perf_counter",
"sys.exit",
"threading.Thread"
] | [((268, 286), 'gevent.monkey.patch_all', 'monkey.patch_all', ([], {}), '()\n', (284, 286), False, 'from gevent import monkey\n'), ((1845, 1936), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Play a boardgame using a specified player type."""'}), "(description=\n 'Play a boardgame usi... |
#!/usr/bin/env python3
import sys
sys.path.insert(0, "../lib-ext")
sys.path.insert(0, "..")
import time
from datetime import datetime, timedelta, tzinfo
from omron_2jcie_bu01 import Omron2JCIE_BU01
CurrentTZ = type(time.tzname[0], (tzinfo,), {
"tzname": lambda self, dt: time.tzname[0],
"utcoffset": lambda sel... | [
"datetime.datetime.now",
"datetime.timedelta",
"sys.path.insert",
"omron_2jcie_bu01.Omron2JCIE_BU01.ble"
] | [((34, 66), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../lib-ext"""'], {}), "(0, '../lib-ext')\n", (49, 66), False, 'import sys\n'), ((67, 91), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (82, 91), False, 'import sys\n'), ((495, 516), 'omron_2jcie_bu01.Omron2JCIE_BU01.ble', ... |
import subprocess as sp
import sys
import threading
import webbrowser
from typing import List
from InquirerPy import inquirer
from anime_cli.anime import Anime
from anime_cli.proxy_server import proxyServer
from anime_cli.search import SearchApi
from anime_cli.search.gogoanime import GogoAnime
def run_server(search... | [
"anime_cli.search.gogoanime.GogoAnime",
"subprocess.Popen",
"InquirerPy.inquirer.text",
"webbrowser.open",
"InquirerPy.inquirer.select",
"sys.exit"
] | [((3246, 3268), 'anime_cli.search.gogoanime.GogoAnime', 'GogoAnime', ([], {'mirror': '"""pe"""'}), "(mirror='pe')\n", (3255, 3268), False, 'from anime_cli.search.gogoanime import GogoAnime\n'), ((3793, 3819), 'webbrowser.open', 'webbrowser.open', (['embed_url'], {}), '(embed_url)\n', (3808, 3819), False, 'import webbro... |
from django.db import models
from django.template.defaultfilters import title
from django.utils.datastructures import SortedDict
from calaccess_campaign_browser.templatetags.calaccesscampaignbrowser import (
jsonify
)
class BaseModel(models.Model):
class Meta:
abstract = True
def meta(self):
... | [
"calaccess_campaign_browser.templatetags.calaccesscampaignbrowser.jsonify",
"django.utils.datastructures.SortedDict",
"django.template.defaultfilters.title"
] | [((479, 493), 'django.utils.datastructures.SortedDict', 'SortedDict', (['{}'], {}), '({})\n', (489, 493), False, 'from django.utils.datastructures import SortedDict\n'), ((640, 653), 'calaccess_campaign_browser.templatetags.calaccesscampaignbrowser.jsonify', 'jsonify', (['self'], {}), '(self)\n', (647, 653), False, 'fr... |
### This package: Python implementation of the higher-order network (HON) construction algorithm.
### This version of code is adapted for the KDD 2018 tutorial "Beyond Graph Mining: Higher-Order Data Analytics for Temporal Network Data" https://ingoscholtes.github.io/kdd2018-tutorial/
### Paper: "Representing highe... | [
"itertools.groupby"
] | [((2718, 2745), 'itertools.groupby', 'itertools.groupby', (['movement'], {}), '(movement)\n', (2735, 2745), False, 'import itertools\n')] |
import logging
from asyncio.exceptions import CancelledError
from functools import wraps
from .command import get_context
log = logging.getLogger(__name__)
def result(items=None, value=None, **extra):
if items is None:
type = "success"
else:
type = "items"
return {"type": type, **extra, ... | [
"logging.getLogger",
"functools.wraps"
] | [((130, 157), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (147, 157), False, 'import logging\n'), ((602, 613), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (607, 613), False, 'from functools import wraps\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest2 as unittest
from fetchman.processor.test_processor import Tuliu_Processor
from fetchman.spider.spider_core import SpiderCore
from fetchman.pipeline.console_pipeline import ConsolePipeline
from fetchman.pipeline.test_pipeline import TestPipeline
class Test... | [
"fetchman.pipeline.console_pipeline.ConsolePipeline",
"fetchman.pipeline.test_pipeline.TestPipeline",
"fetchman.processor.test_processor.Tuliu_Processor"
] | [((408, 422), 'fetchman.pipeline.test_pipeline.TestPipeline', 'TestPipeline', ([], {}), '()\n', (420, 422), False, 'from fetchman.pipeline.test_pipeline import TestPipeline\n'), ((484, 501), 'fetchman.pipeline.console_pipeline.ConsolePipeline', 'ConsolePipeline', ([], {}), '()\n', (499, 501), False, 'from fetchman.pipe... |
# Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... | [
"numpy.ceil",
"qf_lib.containers.dataframe.qf_dataframe.QFDataFrame.from_dict",
"qf_lib.backtesting.contract.contract.Contract",
"qf_lib.common.utils.dateutils.timer.SettableTimer",
"pandas.read_csv",
"qf_lib.common.utils.logging.qf_parent_logger.qf_logger.getChild",
"qf_lib.documents_utils.document_exp... | [((2685, 2720), 'qf_lib.common.utils.error_handling.ErrorHandling.class_error_logging', 'ErrorHandling.class_error_logging', ([], {}), '()\n', (2718, 2720), False, 'from qf_lib.common.utils.error_handling import ErrorHandling\n'), ((5596, 5648), 'qf_lib.analysis.strategy_monitoring.pnl_calculator.PnLCalculator', 'PnLCa... |
# Generated by Django 2.2.5 on 2019-11-01 09:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('service', '0003_auto_20191028_1805'),
]
operations = [
migrations.AddField(
model_name='service',
name='phone_number... | [
"django.db.models.ImageField",
"django.db.models.CharField"
] | [((341, 429), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(30)', 'null': '(True)', 'verbose_name': '"""Phone number"""'}), "(blank=True, max_length=30, null=True, verbose_name=\n 'Phone number')\n", (357, 429), False, 'from django.db import migrations, models\n'), ((551,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import argparse
import numpy as np
from mindboggle.mio.colors import distinguishable_colors, label_adjacency_matrix
if __name__ == "__main__":
description = ('calculate colormap for labeled image;'
'calculated result is stored in outpu... | [
"os.makedirs",
"argparse.ArgumentParser",
"os.path.join",
"mindboggle.mio.colors.distinguishable_colors",
"os.path.isfile",
"os.path.isdir",
"mindboggle.mio.colors.label_adjacency_matrix",
"numpy.load",
"numpy.save"
] | [((356, 404), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description'}), '(description=description)\n', (379, 404), False, 'import argparse\n'), ((863, 910), 'os.path.join', 'os.path.join', (['args.output_dirname', '"""matrix.npy"""'], {}), "(args.output_dirname, 'matrix.npy')\n", (875,... |
#!/usr/bin/python
import feedparser
from subprocess import call
import re
import textwrap
d = feedparser.parse("https://www.archlinux.org/feeds/news/")
for f in range(0, 1):
print(d.entries[f].title)
xy = d.entries[f].title
| [
"feedparser.parse"
] | [((96, 153), 'feedparser.parse', 'feedparser.parse', (['"""https://www.archlinux.org/feeds/news/"""'], {}), "('https://www.archlinux.org/feeds/news/')\n", (112, 153), False, 'import feedparser\n')] |
import csv
import os
#data_base_path = "/home/jseltmann/data/results_with_sg_fixed_cap_binary"
data_base_path = "/home/jseltmann/data/results_coco_val_binary_addition"
all_models_dict = dict()
order = []
for model in ["bert", "visual-bert", "w2v"]:
line_dict = dict()
csv_path = os.path.join(data_base_path, ... | [
"csv.writer",
"os.path.join",
"csv.reader"
] | [((291, 335), 'os.path.join', 'os.path.join', (['data_base_path', "(model + '.csv')"], {}), "(data_base_path, model + '.csv')\n", (303, 335), False, 'import os\n'), ((1192, 1225), 'csv.writer', 'csv.writer', (['tablef'], {'delimiter': '"""|"""'}), "(tablef, delimiter='|')\n", (1202, 1225), False, 'import csv\n'), ((388... |
import re
from datetime import datetime
from tsutils.enums import Server
from .base_model import BaseModel
class ExchangeModel(BaseModel):
def __init__(self, **kwargs):
self.exchange_id = kwargs['exchange_id']
self.trade_id = kwargs['trade_id']
self.server = Server(('JP', 'NA', 'KR')[kwa... | [
"re.findall",
"datetime.datetime.fromtimestamp",
"tsutils.enums.Server"
] | [((291, 338), 'tsutils.enums.Server', 'Server', (["('JP', 'NA', 'KR')[kwargs['server_id']]"], {}), "(('JP', 'NA', 'KR')[kwargs['server_id']])\n", (297, 338), False, 'from tsutils.enums import Server\n'), ((591, 640), 'datetime.datetime.fromtimestamp', 'datetime.fromtimestamp', (["kwargs['start_timestamp']"], {}), "(kwa... |
import datetime
from django.shortcuts import render
from django.utils.dateformat import DateFormat
# Create your views here.
from django.shortcuts import render
from django.http import HttpResponse
from django.core.exceptions import ObjectDoesNotExist
from .models import Movie
def index(request):
movies = Mov... | [
"django.shortcuts.render",
"datetime.datetime.strptime",
"django.utils.dateformat.DateFormat"
] | [((393, 442), 'django.shortcuts.render', 'render', (['request', '"""netflixapp/index.html"""', 'context'], {}), "(request, 'netflixapp/index.html', context)\n", (399, 442), False, 'from django.shortcuts import render\n'), ((556, 607), 'django.shortcuts.render', 'render', (['request', '"""netflixapp/tabular.html"""', 'c... |
#!/usr/bin/env python
import sys
def create_database():
from models.tables import Base
from database import engine
Base.metadata.create_all(bind=engine)
if __name__ == '__main__':
args = sys.argv[1:]
decision_tree = {
'createdatabase': create_database
}
try:
argument =... | [
"models.tables.Base.metadata.create_all"
] | [((130, 167), 'models.tables.Base.metadata.create_all', 'Base.metadata.create_all', ([], {'bind': 'engine'}), '(bind=engine)\n', (154, 167), False, 'from models.tables import Base\n')] |
#!/usr/bin/env python
# Copyright 2020 Google LLC
#
# 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... | [
"google.cloud.dialogflowcx_v3beta1.services.agents.AgentsClient.parse_agent_path",
"google.cloud.dialogflowcx_v3beta1.types.session.QueryInput",
"argparse.ArgumentParser",
"uuid.uuid4",
"google.cloud.dialogflowcx_v3beta1.types.session.DetectIntentRequest",
"google.cloud.dialogflowcx_v3beta1.types.session.... | [((2521, 2557), 'google.cloud.dialogflowcx_v3beta1.services.agents.AgentsClient.parse_agent_path', 'AgentsClient.parse_agent_path', (['agent'], {}), '(agent)\n', (2550, 2557), False, 'from google.cloud.dialogflowcx_v3beta1.services.agents import AgentsClient\n'), ((2833, 2878), 'google.cloud.dialogflowcx_v3beta1.servic... |
import sys
import pathlib
def __get_datadir() -> pathlib.Path:
home = pathlib.Path.home()
if sys.platform == "win32":
return home / "AppData/Roaming"
elif sys.platform.startswith('linux'):
return home / ".local/share"
elif sys.platform == "darwin":
return home / "Library/Appli... | [
"pathlib.Path.home",
"sys.platform.startswith"
] | [((76, 95), 'pathlib.Path.home', 'pathlib.Path.home', ([], {}), '()\n', (93, 95), False, 'import pathlib\n'), ((178, 210), 'sys.platform.startswith', 'sys.platform.startswith', (['"""linux"""'], {}), "('linux')\n", (201, 210), False, 'import sys\n')] |
#!/usr/bin/env python
#
# Copyright 2017 the original author or authors.
#
# Code adapted from https://github.com/choppsv1/netconf
#
# 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... | [
"rpc_response.RpcResponse",
"io.BytesIO"
] | [((980, 1005), 'rpc_response.RpcResponse', 'RpcResponse', (['capabilities'], {}), '(capabilities)\n', (991, 1005), False, 'from rpc_response import RpcResponse\n'), ((1277, 1290), 'rpc_response.RpcResponse', 'RpcResponse', ([], {}), '()\n', (1288, 1290), False, 'from rpc_response import RpcResponse\n'), ((1473, 1492), ... |
from email.policy import default
from . import db
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin
from . import login_manager
from datetime import datetime
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class ItemPh... | [
"werkzeug.security.generate_password_hash",
"werkzeug.security.check_password_hash"
] | [((2647, 2679), 'werkzeug.security.generate_password_hash', 'generate_password_hash', (['password'], {}), '(password)\n', (2669, 2679), False, 'from werkzeug.security import generate_password_hash, check_password_hash\n'), ((2733, 2782), 'werkzeug.security.check_password_hash', 'check_password_hash', (['self.password_h... |
import unittest
import dsalgo.chinese_remainder_theorem
class Test(unittest.TestCase):
def test_2_coprime(self) -> None:
x = dsalgo.chinese_remainder_theorem.crt_2_coprime(15, 2, 17, 8)
self.assertEqual(x % 15, 2)
self.assertEqual(x % 17, 8)
self.assertGreaterEqual(x, 0)
s... | [
"unittest.main"
] | [((1903, 1918), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1916, 1918), False, 'import unittest\n')] |
import os
import pytest
from ozy import OzyError
from ozy.files import walk_up_dirs, get_ozy_dir
def test_ozy_dirs():
ozy_dir = get_ozy_dir()
assert ozy_dir is not None
home = os.environ['HOME']
del os.environ['HOME']
with pytest.raises(OzyError):
get_ozy_dir()
os.environ['HOME'] = h... | [
"ozy.files.walk_up_dirs",
"os.path.join",
"pytest.raises",
"ozy.files.get_ozy_dir"
] | [((136, 149), 'ozy.files.get_ozy_dir', 'get_ozy_dir', ([], {}), '()\n', (147, 149), False, 'from ozy.files import walk_up_dirs, get_ozy_dir\n'), ((367, 415), 'os.path.join', 'os.path.join', (['os.path.sep', '"""one"""', '"""two"""', '"""three"""'], {}), "(os.path.sep, 'one', 'two', 'three')\n", (379, 415), False, 'impo... |
from tika import parser
from collections import Counter
import csv
import os
def word_counts(book_pdf):
raw = parser.from_file(book_pdf)
text = raw["content"]
for char in "!\"*&(){}[],-'#~;:./?\n":
text = text.replace(char, "")
text = text.split(" ")
word_count = Counter()
for word in ... | [
"csv.DictWriter",
"os.listdir",
"collections.Counter",
"tika.parser.from_file",
"csv.reader"
] | [((116, 142), 'tika.parser.from_file', 'parser.from_file', (['book_pdf'], {}), '(book_pdf)\n', (132, 142), False, 'from tika import parser\n'), ((294, 303), 'collections.Counter', 'Counter', ([], {}), '()\n', (301, 303), False, 'from collections import Counter\n'), ((578, 625), 'csv.DictWriter', 'csv.DictWriter', (['cs... |
#!/usr/bin/env python3
"""This script exports the index to JSON files.
It is useful as backup, and to provide snapshots to users so they don't have to
profile everything to get a system going.
The exported folder can be loaded in using `import_all.py` (which will simply
load the JSON files) or `reprocess_all.py` (wh... | [
"logging.basicConfig",
"datamart_core.common.PrefixedElasticsearch",
"json.dump",
"datamart_core.common.encode_dataset_id"
] | [((814, 837), 'datamart_core.common.PrefixedElasticsearch', 'PrefixedElasticsearch', ([], {}), '()\n', (835, 837), False, 'from datamart_core.common import PrefixedElasticsearch, encode_dataset_id\n'), ((1881, 1920), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n'... |
import qnt.data.common as qndc
import qnt.data.id_translation as idt
idt.USE_ID_TRANSLATION = False
qndc.BASE_URL = 'http://127.0.0.1:7070/'
import qnt.data as qndata
import time
import datetime as dt
dbs = qndata.load_blsgov_db_list()
print(dbs)
db_meta = qndata.load_blsgov_db_meta('CX')
print(db_meta)
for s in q... | [
"qnt.data.load_blsgov_series_aspect",
"qnt.data.load_blsgov_db_list",
"qnt.data.load_blsgov_series_list",
"qnt.data.load_blsgov_series_data",
"qnt.data.load_blsgov_db_meta"
] | [((210, 238), 'qnt.data.load_blsgov_db_list', 'qndata.load_blsgov_db_list', ([], {}), '()\n', (236, 238), True, 'import qnt.data as qndata\n'), ((261, 293), 'qnt.data.load_blsgov_db_meta', 'qndata.load_blsgov_db_meta', (['"""CX"""'], {}), "('CX')\n", (287, 293), True, 'import qnt.data as qndata\n'), ((319, 355), 'qnt.d... |
from __future__ import unicode_literals, division, absolute_import
import logging
import os
import re
import sys
from flexget import plugin
from flexget.config_schema import one_or_more
from flexget.event import event
from flexget.entry import Entry
from flexget.utils.cached_input import cached
log = logging.getLogge... | [
"logging.getLogger",
"sys.getfilesystemencoding",
"flexget.entry.Entry",
"flexget.plugin.register",
"flexget.event.event",
"fnmatch.translate",
"re.compile",
"os.walk",
"os.path.join",
"flexget.config_schema.one_or_more",
"flexget.utils.cached_input.cached",
"os.path.expanduser"
] | [((304, 329), 'logging.getLogger', 'logging.getLogger', (['"""find"""'], {}), "('find')\n", (321, 329), False, 'import logging\n'), ((3549, 3573), 'flexget.event.event', 'event', (['"""plugin.register"""'], {}), "('plugin.register')\n", (3554, 3573), False, 'from flexget.event import event\n'), ((1754, 1768), 'flexget.... |
import sys
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from railrl.visualization import visualization_util as vu
from railrl.torch.vae.skew.common import prob_to_weight
def visualize_vae_samples(
epoch, training_data, vae,
report, d... | [
"railrl.visualization.visualization_util.plot_heatmap",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.plot",
"railrl.torch.vae.skew.common.prob_to_weight",
"numpy.array2string",
"numpy.swapaxes",
"matplotlib.pyplot.figu... | [((407, 419), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (417, 419), True, 'from matplotlib import pyplot as plt\n'), ((759, 779), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(2)', '(2)', '(1)'], {}), '(2, 2, 1)\n', (770, 779), True, 'from matplotlib import pyplot as plt\n'), ((784, 847), 'matplotli... |
from werkzeug.security import generate_password_hash, check_password_hash
from overrides import overrides
from flask_login import UserMixin
from uuid import uuid4 as uuid
from datetime import datetime
from mongoengine import *
import config
import dao.voeu
class Utilisateur(UserMixin, Document):
nom = StringField... | [
"datetime.datetime.now",
"uuid.uuid4",
"werkzeug.security.generate_password_hash",
"werkzeug.security.check_password_hash"
] | [((1077, 1091), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1089, 1091), False, 'from datetime import datetime\n'), ((1299, 1343), 'werkzeug.security.check_password_hash', 'check_password_hash', (['self.password', 'password'], {}), '(self.password, password)\n', (1318, 1343), False, 'from werkzeug.secur... |
"""Role"""
import math
from flask import request
from library.common import Common
from library.postgresql_queries import PostgreSQL
class Role(Common):
"""Class for Role"""
# INITIALIZE
def __init__(self):
"""The Constructor for Role class"""
self.postgres = PostgreSQL()
... | [
"library.postgresql_queries.PostgreSQL",
"flask.request.headers.get",
"flask.request.args.get"
] | [((303, 315), 'library.postgresql_queries.PostgreSQL', 'PostgreSQL', ([], {}), '()\n', (313, 315), False, 'from library.postgresql_queries import PostgreSQL\n'), ((1271, 1299), 'flask.request.headers.get', 'request.headers.get', (['"""token"""'], {}), "('token')\n", (1290, 1299), False, 'from flask import request\n'), ... |
import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
from torch.optim import lr_scheduler
from torchvision import datasets, transforms, models
import copy
import time
import argparse
from sys import argv
import os
import json
import numpy as np
def process_image(image):
''' Sca... | [
"torch.nn.ReLU",
"PIL.Image.open",
"torch.nn.Dropout",
"argparse.ArgumentParser",
"torchvision.models.vgg19",
"torch.load",
"torchvision.models.alexnet",
"torch.from_numpy",
"numpy.array",
"torch.cuda.is_available",
"torch.nn.Linear",
"torch.nn.LogSoftmax",
"json.load",
"torchvision.models... | [((455, 472), 'PIL.Image.open', 'Image.open', (['image'], {}), '(image)\n', (465, 472), False, 'from PIL import Image\n'), ((877, 908), 'numpy.array', 'np.array', (['[0.485, 0.456, 0.406]'], {}), '([0.485, 0.456, 0.406])\n', (885, 908), True, 'import numpy as np\n'), ((919, 950), 'numpy.array', 'np.array', (['[0.229, 0... |
from perm_banana.banana import banana
from perm_banana.Check import Check
from perm_banana.Permission import Permission
from discord import Member, TextChannel, StageChannel, VoiceChannel
@banana
class GuildPermissions(Permission):
create_instant_invite = Check(Permission(1 << 0))
kick_members = Check(Permiss... | [
"perm_banana.Permission.Permission"
] | [((268, 286), 'perm_banana.Permission.Permission', 'Permission', (['(1 << 0)'], {}), '(1 << 0)\n', (278, 286), False, 'from perm_banana.Permission import Permission\n'), ((313, 331), 'perm_banana.Permission.Permission', 'Permission', (['(1 << 1)'], {}), '(1 << 1)\n', (323, 331), False, 'from perm_banana.Permission impo... |
import numpy as np
import paddle
from math import sqrt
from sklearn.linear_model import LinearRegression
def cos_formula(a, b, c):
''' formula to calculate the angle between two edges
a and b are the edge lengths, c is the angle length.
'''
res = (a**2 + b**2 - c**2) / (2 * a * b)
# sanity chec... | [
"numpy.abs",
"paddle.ones_like",
"numpy.arccos",
"numpy.corrcoef",
"paddle.cumsum",
"paddle.zeros",
"sklearn.linear_model.LinearRegression"
] | [((403, 417), 'numpy.arccos', 'np.arccos', (['res'], {}), '(res)\n', (412, 417), True, 'import numpy as np\n'), ((1107, 1125), 'sklearn.linear_model.LinearRegression', 'LinearRegression', ([], {}), '()\n', (1123, 1125), False, 'from sklearn.linear_model import LinearRegression\n'), ((1344, 1386), 'paddle.zeros', 'paddl... |
#Importar pacotes
import sqlite3
from tkinter import ttk
from tkinter import *
from tkinter import messagebox
#Criar conexão e cursor
con = sqlite3.connect('banco.db')
cur = con.cursor()
#Criar tabela clientes
cur.execute("""CREATE TABLE IF NOT EXISTS clientes (
nome VARCHAR,
sobrenome VARCHA... | [
"tkinter.messagebox.showinfo",
"sqlite3.connect"
] | [((142, 169), 'sqlite3.connect', 'sqlite3.connect', (['"""banco.db"""'], {}), "('banco.db')\n", (157, 169), False, 'import sqlite3\n'), ((4298, 4362), 'tkinter.messagebox.showinfo', 'messagebox.showinfo', (['"""Usuario deletado"""', '"""Insira os novos dados"""'], {}), "('Usuario deletado', 'Insira os novos dados')\n",... |
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"logging.getLogger",
"tensorflow.tpu.experimental.initialize_tpu_system",
"tensorflow.shape",
"tensorflow.distribute.cluster_resolver.TPUClusterResolver",
"tensorflow.config.list_logical_devices",
"tensorflow.config.experimental_connect_to_cluster",
"tensorflow.nn.top_k",
"tensorflow.concat",
"utils... | [((1091, 1118), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1108, 1118), False, 'import logging\n'), ((2456, 2493), 'tensorflow.config.list_logical_devices', 'tf.config.list_logical_devices', (['"""TPU"""'], {}), "('TPU')\n", (2486, 2493), True, 'import tensorflow as tf\n'), ((6281, 6... |
import logging
from openpyxl import Workbook
from output.ReportBase import ReportBase
class RawMaturityAssessmentReport(ReportBase):
def createWorkbook(self, jobs, controllerData, jobFileName):
for reportType in ["apm", "brum", "mrum"]:
logging.info(f"Creating {reportType} Maturity Assessment... | [
"logging.debug",
"logging.info",
"openpyxl.Workbook"
] | [((264, 333), 'logging.info', 'logging.info', (['f"""Creating {reportType} Maturity Assessment Raw Report"""'], {}), "(f'Creating {reportType} Maturity Assessment Raw Report')\n", (276, 333), False, 'import logging\n'), ((422, 432), 'openpyxl.Workbook', 'Workbook', ([], {}), '()\n', (430, 432), False, 'from openpyxl im... |
# Generated by Django 2.2 on 2019-05-08 07:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('eventapp', '0015_auto_20190508_0556'),
]
operations = [
migrations.CreateModel(
name='Contact',
fields=[
... | [
"django.db.models.EmailField",
"django.db.models.TextField",
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((330, 423), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (346, 423), False, 'from django.db import migrations, models\... |
import gc
import ctypes
from . import list_methods
from inspect import getmembers, isfunction
def add_method(builtin_class, method_name, method_function):
patchable_builtin_class = gc.get_referents(builtin_class.__dict__)[0]
patchable_builtin_class[method_name] = method_function
ctypes.pythonapi.PyType_... | [
"ctypes.py_object",
"inspect.getmembers",
"gc.get_referents"
] | [((383, 419), 'inspect.getmembers', 'getmembers', (['list_methods', 'isfunction'], {}), '(list_methods, isfunction)\n', (393, 419), False, 'from inspect import getmembers, isfunction\n'), ((187, 227), 'gc.get_referents', 'gc.get_referents', (['builtin_class.__dict__'], {}), '(builtin_class.__dict__)\n', (203, 227), Fal... |
#!/usr/bin/env python
# coding: utf-8
import rospy
import geometry_msgs.msg
from sensor_msgs.msg import JointState
import numpy as np
class Arm_ik:
def __init__(self):
self._sub_pos = rospy.Subscriber("/arm_pos", geometry_msgs.msg.Point, self.pos_callback)
self.pub = rospy.Publisher("vv_kuwamai/ma... | [
"numpy.abs",
"rospy.Subscriber",
"rospy.is_shutdown",
"numpy.hstack",
"rospy.init_node",
"sensor_msgs.msg.JointState",
"numpy.array",
"rospy.Rate",
"rospy.spin",
"numpy.cos",
"numpy.linalg.norm",
"numpy.sin",
"rospy.Publisher",
"rospy.loginfo"
] | [((198, 270), 'rospy.Subscriber', 'rospy.Subscriber', (['"""/arm_pos"""', 'geometry_msgs.msg.Point', 'self.pos_callback'], {}), "('/arm_pos', geometry_msgs.msg.Point, self.pos_callback)\n", (214, 270), False, 'import rospy\n'), ((290, 365), 'rospy.Publisher', 'rospy.Publisher', (['"""vv_kuwamai/master_joint_state"""', ... |
#!/usr/bin/env python
"""
Simple test of the card deck and playing card classes
Copyright (C) <NAME> - All Rights Reserved
You may use, distribute and modify this code under the
terms of the MIT license. See LICENSE file in the project
root for full license information.
"""
import sys
import os
MAIN_DIR = (os.path.d... | [
"carddecks.CardDecks",
"os.path.join",
"os.path.abspath"
] | [((663, 675), 'carddecks.CardDecks', 'CardDecks', (['(2)'], {}), '(2)\n', (672, 675), False, 'from carddecks import CardDecks\n'), ((391, 425), 'os.path.join', 'os.path.join', (['MAIN_DIR', '"""includes"""'], {}), "(MAIN_DIR, 'includes')\n", (403, 425), False, 'import os\n'), ((343, 368), 'os.path.abspath', 'os.path.ab... |
"""This module provides a reference test example for
https://github.com/MarcSkovMadsen/awesome-streamlit/issues/2"""
import bf4.b4 as b4_new_name # Hot reload works in b4.py file
import bf.b # Hot reloading works in b.py file
import st_extensions # Hot reloading works in st_extensions.py file
import streamlit as st
... | [
"bf2.b2.write",
"bf3.b3.write",
"streamlit.write",
"st_extensions.write",
"bf4.b4.write"
] | [((609, 630), 'streamlit.write', 'st.write', (['"""this is a"""'], {}), "('this is a')\n", (617, 630), True, 'import streamlit as st\n'), ((645, 655), 'bf2.b2.write', 'b2.write', ([], {}), '()\n', (653, 655), False, 'from bf2 import b2\n'), ((656, 675), 'bf3.b3.write', 'b3_new_name.write', ([], {}), '()\n', (673, 675),... |
import torch
import torch.nn as nn
from typing import List, Dict, Tuple, Union
from rdkit import Chem
from seq_graph_retro.molgraph.vocab import Vocab
from seq_graph_retro.utils.torch import build_mlp
from seq_graph_retro.utils.metrics import get_accuracy_lg
from seq_graph_retro.layers import AtomAttention, GraphFeatE... | [
"seq_graph_retro.data.collate_fns.pack_graph_feats",
"torch.nn.CrossEntropyLoss",
"seq_graph_retro.layers.AtomAttention",
"torch.max",
"rdkit.Chem.MolFromSmiles",
"torch.nn.utils.rnn.pad_sequence",
"seq_graph_retro.layers.GraphFeatEncoder",
"seq_graph_retro.utils.metrics.get_accuracy_lg",
"torch.ten... | [((3705, 3761), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {'ignore_index': "self.lg_vocab['<pad>']"}), "(ignore_index=self.lg_vocab['<pad>'])\n", (3724, 3761), True, 'import torch.nn as nn\n'), ((4576, 4612), 'torch.tensor', 'torch.tensor', (['[]'], {'device': 'self.device'}), '([], device=self.device)\n... |
#!/usr/bin/env python3
import fcntl
import os
import re
import requests
import socket
import struct
import sys
import threading
import time
class Sensor():
def __init__(self):
self.sensor = os.environ.get('SENSOR')
if not self.sensor:
raise ValueError('$SENSOR is not set')
sel... | [
"socket.socket",
"threading.Lock",
"os.environ.get",
"re.match",
"struct.pack",
"os.path.join",
"struct.unpack",
"socket.ntohs",
"socket.inet_ntoa",
"time.time"
] | [((1814, 1841), 'os.environ.get', 'os.environ.get', (['"""INTERFACE"""'], {}), "('INTERFACE')\n", (1828, 1841), False, 'import os\n'), ((2034, 2055), 'os.environ.get', 'os.environ.get', (['"""VNI"""'], {}), "('VNI')\n", (2048, 2055), False, 'import os\n'), ((2640, 2688), 'socket.socket', 'socket.socket', (['socket.AF_I... |
from pathlib import Path
from django import template
from django.conf import settings
from home.models import SVGToPNGMap
register = template.Library()
@register.simple_tag
def svg_to_png_url(svg_path, fill_color=None, stroke_color=None,):
image = SVGToPNGMap.get_png_image(svg_path, fill_color=fill_color, strok... | [
"home.models.SVGToPNGMap.get_png_image",
"django.template.Library",
"pathlib.Path"
] | [((135, 153), 'django.template.Library', 'template.Library', ([], {}), '()\n', (151, 153), False, 'from django import template\n'), ((256, 346), 'home.models.SVGToPNGMap.get_png_image', 'SVGToPNGMap.get_png_image', (['svg_path'], {'fill_color': 'fill_color', 'stroke_color': 'stroke_color'}), '(svg_path, fill_color=fill... |
import pgzrun
import random
def draw():
global status_game, Object, Meter, Max_Meter, health, blood, text_space
screen.clear()
if status_game == "menu":
img_home.draw()
text_space.draw()
head_tuu.draw()
tank_home.draw()
elif status_game == "start" or status_game == "boom... | [
"random.randrange",
"pgzrun.go"
] | [((8894, 8905), 'pgzrun.go', 'pgzrun.go', ([], {}), '()\n', (8903, 8905), False, 'import pgzrun\n'), ((5818, 5837), 'random.randrange', 'random.randrange', (['(2)'], {}), '(2)\n', (5834, 5837), False, 'import random\n')] |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# Reference:
# https://github.com/timctho/VNect-tensorflow
# https://github.com/EJShim/vnect_estimator
import tensorflow as tf
import tensorflow.contrib as tc
import numpy as np
import pickle
# in tf.layers.conv2d: default_weight_name = kernel, default_bias_name = bia... | [
"tensorflow.contrib.layers.batch_norm",
"tensorflow.contrib.layers.conv2d",
"tensorflow.variable_scope",
"tensorflow.nn.relu",
"tensorflow.get_variable",
"tensorflow.placeholder",
"tensorflow.split",
"tensorflow.add",
"tensorflow.multiply",
"tensorflow.global_variables",
"tensorflow.concat",
"... | [((503, 562), 'tensorflow.placeholder', 'tf.placeholder', ([], {'dtype': 'tf.float32', 'shape': '(None, 368, 368, 3)'}), '(dtype=tf.float32, shape=(None, 368, 368, 3))\n', (517, 562), True, 'import tensorflow as tf\n'), ((660, 771), 'tensorflow.contrib.layers.conv2d', 'tc.layers.conv2d', (['self.input_holder'], {'kerne... |
# -*- coding: UTF-8 -*-
# Copyright 2012-2015 <NAME>
# License: BSD (see file COPYING for details)
"""Inserts the primary keys of Places and Countries used by CBSS.
Note that this fixture doesn't create itself any Places or Countries,
it just updates existing ones, which may come from
:mod:`lino_xl.lib.countries.fixtu... | [
"lino.utils.dblogger.info",
"lino.core.utils.resolve_model",
"lino.utils.dblogger.debug"
] | [((142412, 142446), 'lino.core.utils.resolve_model', 'resolve_model', (['"""countries.Country"""'], {}), "('countries.Country')\n", (142425, 142446), False, 'from lino.core.utils import resolve_model\n'), ((142459, 142491), 'lino.core.utils.resolve_model', 'resolve_model', (['"""countries.Place"""'], {}), "('countries.... |
import numpy as np
import torch as th
class EpidemicModel(th.nn.Module):
"""Score driven epidemic model."""
def __init__(self):
super(EpidemicModel, self).__init__()
self.alpha = th.nn.Parameter(th.tensor(0.0, requires_grad=True))
self.beta = th.nn.Parameter(th.tensor(0.0, requires_gr... | [
"torch.log",
"torch.mean",
"torch.stack",
"torch.exp",
"torch.full_like",
"numpy.exp",
"torch.tensor",
"numpy.array",
"torch.isnan",
"torch.arange"
] | [((1808, 1829), 'torch.arange', 'th.arange', (['(0)', 'horizon'], {}), '(0, horizon)\n', (1817, 1829), True, 'import torch as th\n'), ((3787, 3808), 'torch.arange', 'th.arange', (['(0)', 'horizon'], {}), '(0, horizon)\n', (3796, 3808), True, 'import torch as th\n'), ((4800, 4818), 'torch.mean', 'th.mean', (['objective'... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from base.log import logger
__author__ = 'cloudy'
urls = []
class HandleMetaClass(type):
'''
meta class for action handle
'''
def __new__(cls, name, base, attrs):
return type.__new__(cls, name, base, attrs)
def __init__(cls, name, base, att... | [
"base.log.logger.debug"
] | [((333, 377), 'base.log.logger.debug', 'logger.debug', (["('Add route: %s' % attrs['url'])"], {}), "('Add route: %s' % attrs['url'])\n", (345, 377), False, 'from base.log import logger\n')] |
import logging
from pyfcm import FCMNotification
from spacelaunchnow.config import keys
from spacelaunchnow import config
logger = logging.getLogger(__name__)
class EventNotificationHandler:
def __init__(self, debug=None):
if debug is None:
self.DEBUG = config.DEBUG
else:
... | [
"logging.getLogger",
"pyfcm.FCMNotification"
] | [((134, 161), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (151, 161), False, 'import logging\n'), ((3243, 3283), 'pyfcm.FCMNotification', 'FCMNotification', ([], {'api_key': "keys['FCM_KEY']"}), "(api_key=keys['FCM_KEY'])\n", (3258, 3283), False, 'from pyfcm import FCMNotification\n'),... |
import os
import sys
from advent2021.core import run
def part1(input_fp):
previous_measurement = None
increase_count = 0
for line in input_fp:
current_measurement = int(line)
# Has the current line increase (compared to the last measurement)?
# NOTE: We also check to see if previou... | [
"advent2021.core.run"
] | [((2063, 2093), 'advent2021.core.run', 'run', (['__package__', 'part1', 'part2'], {}), '(__package__, part1, part2)\n', (2066, 2093), False, 'from advent2021.core import run\n')] |
import scrapy
class QuotesSpider(scrapy.Spider):
name = "demo1"
def start_requests(self):
urls = [
'http://quotes.toscrape.com/page/1/',
'http://quotes.toscrape.com/page/2/',
]
for url in urls:
yield scrapy.Request(url=url, callback=self.parse)
... | [
"scrapy.Request"
] | [((271, 315), 'scrapy.Request', 'scrapy.Request', ([], {'url': 'url', 'callback': 'self.parse'}), '(url=url, callback=self.parse)\n', (285, 315), False, 'import scrapy\n')] |
import pytest
from litecoder.models import WOFLocality
from tests.utils import read_yaml
def yield_cases():
"""Generate cases from YAML file.
"""
cases = read_yaml(__file__, 'test_us_city_index.yml')
for group in cases:
queries = group['query']
xfail = group.get('xfail', False)
... | [
"litecoder.models.WOFLocality.population.desc",
"pytest.mark.parametrize",
"litecoder.models.WOFLocality.clean_us_cities",
"tests.utils.read_yaml",
"pytest.xfail"
] | [((859, 896), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""city"""', 'topn'], {}), "('city', topn)\n", (882, 896), False, 'import pytest\n'), ((172, 217), 'tests.utils.read_yaml', 'read_yaml', (['__file__', '"""test_us_city_index.yml"""'], {}), "(__file__, 'test_us_city_index.yml')\n", (181, 217), False,... |
import re
import inspect
from functools import lru_cache
from http import HTTPStatus
from json import dumps
from typing import Any, Union, Callable
from urllib.parse import parse_qs, urlparse
from wsgiref.headers import Headers as _Headers
class NotFound(Exception):
pass
class Headers(_Headers):
def items(s... | [
"urllib.parse.urlparse",
"re.compile",
"json.dumps",
"inspect.iscoroutinefunction",
"urllib.parse.parse_qs",
"http.HTTPStatus",
"functools.lru_cache"
] | [((1821, 1845), 're.compile', 're.compile', (['"""{([^{}]*)}"""'], {}), "('{([^{}]*)}')\n", (1831, 1845), False, 'import re\n'), ((5123, 5145), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(256)'}), '(maxsize=256)\n', (5132, 5145), False, 'from functools import lru_cache\n'), ((1313, 1332), 'urllib.parse.urlpa... |
import PyPDF2
with open('withCover.pdf', 'rb') as pdfWithCover:
pdfReader = PyPDF2.PdfFileReader(pdfWithCover)
pdfWriter = PyPDF2.PdfFileWriter()
for pageNum in range(1, pdfReader.numPages):
pageObj = pdfReader.getPage(pageNum)
pdfWriter.addPage(pageObj)
with open('withoutCover.pdf', 'wb') as pdfOutputFile:... | [
"PyPDF2.PdfFileWriter",
"PyPDF2.PdfFileReader"
] | [((79, 113), 'PyPDF2.PdfFileReader', 'PyPDF2.PdfFileReader', (['pdfWithCover'], {}), '(pdfWithCover)\n', (99, 113), False, 'import PyPDF2\n'), ((127, 149), 'PyPDF2.PdfFileWriter', 'PyPDF2.PdfFileWriter', ([], {}), '()\n', (147, 149), False, 'import PyPDF2\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Written by <NAME> and <NAME>.
JRC Biomass Project.
Unit D1 Bioeconomy.
This test suite can be run with pytest.
Or you can import it individually:
>>> from forest_puller.tests.conversion.test_root_ratio import test_root_intrpld
>>> print(test_root_intrpld())... | [
"pandas.testing.assert_series_equal"
] | [((1223, 1290), 'pandas.testing.assert_series_equal', 'assert_series_equal', (["expected['root_ratio']", "provided['root_ratio']"], {}), "(expected['root_ratio'], provided['root_ratio'])\n", (1242, 1290), False, 'from pandas.testing import assert_series_equal\n')] |
from settings import *
import json
import os
def path_to_dict(path):
# http://stackoverflow.com/questions/25226208/represent-directory-tree-as-json
d = {'name': os.path.basename(path)}
if os.path.isdir(path):
d['type'] = "directory"
d['children'] = [path_to_dict(os.path.join(path, x)) for ... | [
"os.listdir",
"os.path.join",
"os.getcwd",
"os.path.isdir",
"os.path.basename"
] | [((202, 221), 'os.path.isdir', 'os.path.isdir', (['path'], {}), '(path)\n', (215, 221), False, 'import os\n'), ((170, 192), 'os.path.basename', 'os.path.basename', (['path'], {}), '(path)\n', (186, 192), False, 'import os\n'), ((293, 314), 'os.path.join', 'os.path.join', (['path', 'x'], {}), '(path, x)\n', (305, 314), ... |
from data import *
from utilities import *
from networks import *
import matplotlib.pyplot as plt
import numpy as np
num_known_classes = 65 #25
num_all_classes = 65
def skip(data, label, is_train):
return False
batch_size = 32
def transform(data, label, is_train):
label = one_hot(num_all_classes,label)
d... | [
"numpy.savez_compressed",
"numpy.transpose",
"numpy.asarray",
"numpy.vstack"
] | [((2438, 2670), 'numpy.savez_compressed', 'np.savez_compressed', (['filename'], {'product_score': 'score_pr', 'product_label': 'label_pr', 'real_world_score': 'score_rw', 'real_world_label': 'label_rw', 'art_score': 'score_ar', 'art_label': 'label_ar', 'clipart_score': 'score_cl', 'clipart_label': 'label_cl'}), '(filen... |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path impo... | [
"_pykondo.ics_set_id",
"_pykondo.ics_set_current_limit",
"_pykondo.kondo_get_servo_pos",
"_pykondo.kondo_read_pio",
"imp.load_module",
"_pykondo.kondo_get_pio_direction",
"_pykondo.kondo_get_servo_id",
"_pykondo.kondo_init",
"_pykondo.kondo_get_servo_data",
"_pykondo.kondo_set_pio_direction",
"_... | [((7665, 7691), '_pykondo.kondo_init', '_pykondo.kondo_init', (['*args'], {}), '(*args)\n', (7684, 7691), False, 'import _pykondo\n'), ((7765, 7798), '_pykondo.kondo_init_custom', '_pykondo.kondo_init_custom', (['*args'], {}), '(*args)\n', (7791, 7798), False, 'import _pykondo\n'), ((7880, 7907), '_pykondo.kondo_close'... |
from flask import Flask, render_template
from src.const import index_url_key, index_title_key, index_id_key, index_tags_key, index_date_key, index_notags_key, \
index_highlight_key, index_fixed_key, index_top_key, index_path_key, index_bereferenced_key, articles_url_name, \
attachments_url_name, tags_url_name,... | [
"flask.render_template",
"flask.Flask"
] | [((534, 549), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (539, 549), False, 'from flask import Flask, render_template\n'), ((2562, 2633), 'flask.render_template', 'render_template', (['"""error.html"""'], {'title': "('%d %s' % (error.code, error.name))"}), "('error.html', title='%d %s' % (error.code, e... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 31 15:40:31 2021
@author: jessm
this is comparing the teporal cube slices to their impainted counterparts
"""
import os
import matplotlib.pyplot as plt
import numpy as np
from astropy.table import QTable, Table, Column
from astropy import units as u
... | [
"astropy.table.Table",
"numpy.hstack",
"matplotlib.pyplot.colorbar",
"numpy.array",
"numpy.load",
"matplotlib.pyplot.subplots",
"numpy.round",
"matplotlib.pyplot.show"
] | [((329, 354), 'numpy.load', 'np.load', (['"""np_align30.npy"""'], {}), "('np_align30.npy')\n", (336, 354), True, 'import numpy as np\n'), ((364, 389), 'numpy.load', 'np.load', (['"""thresh_a30.npy"""'], {}), "('thresh_a30.npy')\n", (371, 389), True, 'import numpy as np\n'), ((398, 422), 'numpy.load', 'np.load', (['"""t... |
from anthill.framework.core.exceptions import ImproperlyConfigured
from anthill.framework.handlers.edit import FormMixin, ProcessFormMixin
from anthill.platform.core.models import RemoteModel
class RemoteModelFormMixin(FormMixin):
"""Provide a way to show and handle a RemoteModelForm in a request."""
def get... | [
"anthill.framework.core.exceptions.ImproperlyConfigured"
] | [((1409, 1543), 'anthill.framework.core.exceptions.ImproperlyConfigured', 'ImproperlyConfigured', (['"""No URL to redirect to. Either provide an url or define a get_absolute_url method on the RemoteModel."""'], {}), "(\n 'No URL to redirect to. Either provide an url or define a get_absolute_url method on the RemoteM... |
import time
import os
class Cup:
def __init__(self, num):
self.num = num
self.right = None
def __str__(self):
return str(self.num)
def __repr__(self):
return str(self.num)
def create_cups(nums):
n = len(nums)
cups = { nums[i]: Cup(nums[i]) for i in range(n)}
for i in range(0,len(nums)):
cups[num... | [
"os.path.dirname",
"time.time"
] | [((1367, 1378), 'time.time', 'time.time', ([], {}), '()\n', (1376, 1378), False, 'import time\n'), ((1391, 1416), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1406, 1416), False, 'import os\n'), ((1592, 1603), 'time.time', 'time.time', ([], {}), '()\n', (1601, 1603), False, 'import time\n'... |
# Write a program that tells you how many paint buckets you need to paint a wall
import math
print("This program tells you how many pain buckts you need to paint a wall")
width = float(
input("\nFirst, I need to know the size of this wall.\nType the width (m): "))
height = float(input("\nNow, type the height (m)... | [
"math.ceil"
] | [((415, 444), 'math.ceil', 'math.ceil', (['(width * height / 2)'], {}), '(width * height / 2)\n', (424, 444), False, 'import math\n')] |
#!/usr/bin/python3
from flask import Flask
import flask_restful as fr
import core, mqtt
import threading
app = Flask(__name__)
api = fr.Api(app)
def flask_run():
app.run(debug=True,
host='0.0.0.0')
mqtt_thread = threading.Thread(target=mqtt.run, args = ())
if __name__ == '__main__':
core.api_set... | [
"threading.Thread",
"flask_restful.Api",
"core.api_setup",
"flask.Flask"
] | [((112, 127), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (117, 127), False, 'from flask import Flask\n'), ((134, 145), 'flask_restful.Api', 'fr.Api', (['app'], {}), '(app)\n', (140, 145), True, 'import flask_restful as fr\n'), ((231, 273), 'threading.Thread', 'threading.Thread', ([], {'target': 'mqtt.r... |
from flask import url_for, session
# from flask_simplelogin import is_logged_in
def test_get_login(client):
response = client.get(url_for('simplelogin.login'))
assert response.status_code == 200
assert '<form action="/login/' in str(response.data)
def test_post_requires_token(client):
response = cli... | [
"flask.session.clear",
"flask.url_for"
] | [((586, 601), 'flask.session.clear', 'session.clear', ([], {}), '()\n', (599, 601), False, 'from flask import url_for, session\n'), ((136, 164), 'flask.url_for', 'url_for', (['"""simplelogin.login"""'], {}), "('simplelogin.login')\n", (143, 164), False, 'from flask import url_for, session\n'), ((338, 366), 'flask.url_f... |
import copy
if __name__ == '__main__':
epss = np.logspace(-10, -1, 30)
baseline_objective = augmented_objective(x0)
xis = []
for eps in epss:
xi = copy.copy(x0)
xi[4] += eps
xis.append(xi)
objs = [augmented_objective(xi) for xi in xis]
# pool = mp.Pool(mp.cpu_count())
... | [
"copy.copy"
] | [((172, 185), 'copy.copy', 'copy.copy', (['x0'], {}), '(x0)\n', (181, 185), False, 'import copy\n')] |
import logging
from unicon.eal.dialogs import Dialog
logger = logging.getLogger(__name__)
class ClusterBootstrap:
def __init__(self, handle, chassis_id=None, ccl_network=None, cluster_key=None, cluster_name=None,
site_id=None):
"""
:param handle: SSH connection handle
""... | [
"logging.getLogger"
] | [((64, 91), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (81, 91), False, 'import logging\n')] |
'''
Created by auto_sdk on 2015.04.27
'''
from aliyun.api.base import RestApi
class Cdn20141111DescribeOneMinuteDataRequest(RestApi):
def __init__(self,domain='cdn.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.DataTime = None
self.DomainName = None
def getapiname(self):
return '... | [
"aliyun.api.base.RestApi.__init__"
] | [((197, 233), 'aliyun.api.base.RestApi.__init__', 'RestApi.__init__', (['self', 'domain', 'port'], {}), '(self, domain, port)\n', (213, 233), False, 'from aliyun.api.base import RestApi\n')] |
#!/usr/bin/env python
#
# This file is part of Magnum.
#
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
# <NAME> <<EMAIL>>
# Copyright © 2018 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associat... | [
"argparse.ArgumentParser",
"json.dumps",
"os.path.splitext",
"struct.pack",
"json.load"
] | [((1488, 1513), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1511, 1513), False, 'import argparse\n'), ((1794, 1806), 'json.load', 'json.load', (['f'], {}), '(f)\n', (1803, 1806), False, 'import json\n'), ((1676, 1700), 'os.path.splitext', 'os.path.splitext', (['fileIn'], {}), '(fileIn)\n', ... |
import os, logging
import subprocess
import shlex
#===============================================================================
#===============================================================================
def genImage(image, root, options):
if not options.mkubifs:
raise ValueError("Missing --mkubif... | [
"shlex.split",
"os.environ.get",
"logging.info",
"os.getcwd"
] | [((517, 548), 'os.environ.get', 'os.environ.get', (['"""MKUBIFS"""', 'None'], {}), "('MKUBIFS', None)\n", (531, 548), False, 'import os, logging\n'), ((563, 594), 'os.environ.get', 'os.environ.get', (['"""UBINIZE"""', 'None'], {}), "('UBINIZE', None)\n", (577, 594), False, 'import os, logging\n'), ((1213, 1264), 'loggi... |
from django.http import request
from django.shortcuts import redirect, render
from django.contrib.auth.forms import UserCreationForm
# Create your views here.
def home(request):
return render(request, 'home/welcome.html')
def register(request):
if request.user.is_authenticated:
return redirect('', u... | [
"django.shortcuts.render",
"django.shortcuts.redirect",
"django.contrib.auth.forms.UserCreationForm"
] | [((191, 227), 'django.shortcuts.render', 'render', (['request', '"""home/welcome.html"""'], {}), "(request, 'home/welcome.html')\n", (197, 227), False, 'from django.shortcuts import redirect, render\n'), ((638, 696), 'django.shortcuts.render', 'render', (['request', '"""registration/register.html"""', "{'form': f}"], {... |