code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from random import choice, randint
from re import sub, split, findall
from string import ascii_letters
from subprocess import PIPE, Popen
from sys import argv, executable, stderr
from .responses import pronouns, reactions, remarks
def owoify(text):
if type(text) == bytes:
text = str(text)[2:-1].replace("... | [
"re.split",
"random.choice",
"subprocess.Popen",
"re.sub",
"re.findall",
"random.randint"
] | [((344, 367), 're.sub', 'sub', (['"""[rlv]"""', '"""w"""', 'text'], {}), "('[rlv]', 'w', text)\n", (347, 367), False, 'from re import sub, split, findall\n'), ((379, 402), 're.sub', 'sub', (['"""[RLV]"""', '"""W"""', 'text'], {}), "('[RLV]', 'W', text)\n", (382, 402), False, 'from re import sub, split, findall\n'), ((4... |
from app import App
import requests
import json
import polling2
from behave import step
from openshift import Openshift
from util import substitute_scenario_id
from string import Template
class GenericTestApp(App):
deployment_name_pattern = "{name}"
def __init__(self, name, namespace, app_image="ghcr.io/mul... | [
"json.loads",
"behave.step",
"util.substitute_scenario_id",
"requests.get",
"openshift.Openshift",
"app.App.__init__"
] | [((1776, 1841), 'behave.step', 'step', (['u"""Generic test application "{application_name}" is running"""'], {}), '(u\'Generic test application "{application_name}" is running\')\n', (1780, 1841), False, 'from behave import step\n'), ((1843, 1955), 'behave.step', 'step', (['u"""Generic test application "{application_na... |
import email
import logging
import re
from imapclient import IMAPClient
class IMAPError(IOError):
pass
class ImapWrapper:
"""A wrapper around imaplib, since that's a bit
lower-level than I'd prefer to work with."""
#This regex is:
# list of flags in parens
# quoted delimiter
# possible-q... | [
"logging.getLogger",
"imapclient.IMAPClient",
"re.compile"
] | [((357, 418), 're.compile', 're.compile', (['"""^\\\\(([^()]*)\\\\) "([^"]*)" (([^" ]+)|"([^"]*)")$"""'], {}), '(\'^\\\\(([^()]*)\\\\) "([^"]*)" (([^" ]+)|"([^"]*)")$\')\n', (367, 418), False, 'import re\n'), ((537, 563), 'imapclient.IMAPClient', 'IMAPClient', (['host'], {}), '(host, **kwargs)\n', (547, 563), False, 'f... |
import sys
from . import app
sys.path.append(str(app.config['LIB_PATH']))
from musicautobot.music_transformer import *
from musicautobot.config import *
from flask import Response, send_from_directory, send_file, request, jsonify
from .save import to_s3
import torch
import traceback
torch.set_num_threads(4)
data = ... | [
"flask.send_from_directory",
"torch.set_num_threads",
"flask.request.form.to_dict",
"torch.cuda.is_available",
"traceback.print_exc",
"flask.jsonify"
] | [((287, 311), 'torch.set_num_threads', 'torch.set_num_threads', (['(4)'], {}), '(4)\n', (308, 311), False, 'import torch\n'), ((486, 511), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (509, 511), False, 'import torch\n'), ((721, 743), 'flask.request.form.to_dict', 'request.form.to_dict', ([],... |
from __future__ import absolute_import, division, print_function
from tests.core import mock
from trakt import Trakt
from httmock import HTTMock
import pytest
def test_likes():
with HTTMock(mock.fixtures, mock.unknown):
with Trakt.configuration.auth('mock', 'mock'):
likes = Trakt['users'].li... | [
"trakt.Trakt.configuration.auth",
"httmock.HTTMock",
"pytest.raises"
] | [((190, 226), 'httmock.HTTMock', 'HTTMock', (['mock.fixtures', 'mock.unknown'], {}), '(mock.fixtures, mock.unknown)\n', (197, 226), False, 'from httmock import HTTMock\n'), ((741, 777), 'httmock.HTTMock', 'HTTMock', (['mock.fixtures', 'mock.unknown'], {}), '(mock.fixtures, mock.unknown)\n', (748, 777), False, 'from htt... |
import sys
import PyQt5.QtWidgets as qtw
import PyQt5.QtCore as qtc
from Image import Image
from main_layout import Ui_MainWindow
import logging
import os
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
formatter = logging.Formatter('%(levelname)s:%(name)s:%(asctime)s - %(message)s')
file_handler ... | [
"logging.getLogger",
"logging.Formatter",
"logging.FileHandler",
"main_layout.Ui_MainWindow",
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtWidgets.QMessageBox.warning",
"Image.Image",
"os.remove"
] | [((165, 192), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (182, 192), False, 'import logging\n'), ((236, 305), 'logging.Formatter', 'logging.Formatter', (['"""%(levelname)s:%(name)s:%(asctime)s - %(message)s"""'], {}), "('%(levelname)s:%(name)s:%(asctime)s - %(message)s')\n", (253, 305... |
from django import forms
# Form for create sales
class FormSales(forms.Form):
# Atributes for form
# NOTE: date_creation and total fields, it will be created dynamically
name = forms.CharField(label="Nombre",
max_length=50,
required=True,
... | [
"django.forms.CheckboxInput",
"django.forms.CharField",
"django.forms.Textarea",
"django.forms.IntegerField",
"django.forms.DecimalField"
] | [((191, 288), 'django.forms.CharField', 'forms.CharField', ([], {'label': '"""Nombre"""', 'max_length': '(50)', 'required': '(True)', 'help_text': '"""Ingrese su nombre"""'}), "(label='Nombre', max_length=50, required=True, help_text=\n 'Ingrese su nombre')\n", (206, 288), False, 'from django import forms\n'), ((629... |
from models import shoe_box
def createHBjsons() -> None:
for i in range(4):
# increment on shoebox dimensions
_width = 4.0 + i*0.5
_height = 3.5 + i*0.1
_depth = 4.0 + i*0.5
# init shoe_box
sb = shoe_box.Shoebox(width=_width , height=_height , depth=_... | [
"models.shoe_box.Shoebox"
] | [((264, 324), 'models.shoe_box.Shoebox', 'shoe_box.Shoebox', ([], {'width': '_width', 'height': '_height', 'depth': '_depth'}), '(width=_width, height=_height, depth=_depth)\n', (280, 324), False, 'from models import shoe_box\n')] |
from sqlalchemy import engine_from_config
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy.schema import MetaData
import zope.sqlalchemy
from .node import Node
NAMING_CONVENTION = {
"ix": 'ix_%(column_0_label)s',
"uq": "uq_%(table_name)s_%(column_0... | [
"sqlalchemy.engine_from_config",
"sqlalchemy.orm.sessionmaker",
"sqlalchemy.schema.MetaData",
"sqlalchemy.ext.declarative.declarative_base"
] | [((498, 543), 'sqlalchemy.schema.MetaData', 'MetaData', ([], {'naming_convention': 'NAMING_CONVENTION'}), '(naming_convention=NAMING_CONVENTION)\n', (506, 543), False, 'from sqlalchemy.schema import MetaData\n'), ((551, 586), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {'metadata': 'metadata... |
import typing
from typing import (
Any,
Callable,
Dict,
Iterable,
List,
Literal,
Optional,
Set,
Tuple,
Union,
)
from ncadquery import Workplane
from OCP.Quantity import Quantity_NameOfColor
from OCP.TCollection import TCollection_ExtendedString
from OCP.TDataStd import TDataStd_... | [
"OCP.TDF.TDF_Label",
"OCP.TPrsStd.TPrsStd_AISPresentation.Set_s",
"OCP.TNaming.TNaming_Builder",
"OCP.TCollection.TCollection_ExtendedString",
"nales.utils.TypeChecker",
"OCP.TopoDS.TopoDS_Shape",
"OCP.TDF.TDF_TagSource.NewChild_s",
"typing.get_args",
"OCP.TNaming.TNaming_NamedShape.GetID_s",
"typ... | [((1523, 1560), 'OCP.TDF.TDF_TagSource.NewChild_s', 'TDF_TagSource.NewChild_s', (['self._label'], {}), '(self._label)\n', (1547, 1560), False, 'from OCP.TDF import TDF_Label, TDF_TagSource\n'), ((3612, 3626), 'OCP.TopoDS.TopoDS_Shape', 'TopoDS_Shape', ([], {}), '()\n', (3624, 3626), False, 'from OCP.TopoDS import TopoD... |
import sys
import pygame as pg
import numpy as np
import random
import time
pic = np.zeros(shape=(128,64))
width = 128
height = 64
refresh_rate = 60
interval = 1 / refresh_rate
bootrom_file = "bootrom0"
rom_file = "rom"
# rom_file = "hello_world"
debug = False
pg.display.init()
display = pg.display.set_mode((width*4... | [
"pygame.display.init",
"pygame.Surface",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.display.flip",
"pygame.Rect",
"numpy.zeros",
"sys.stdin.buffer.read",
"sys.stdout.flush",
"time.time",
"random.randint",
"pygame.transform.scale"
] | [((83, 108), 'numpy.zeros', 'np.zeros', ([], {'shape': '(128, 64)'}), '(shape=(128, 64))\n', (91, 108), True, 'import numpy as np\n'), ((264, 281), 'pygame.display.init', 'pg.display.init', ([], {}), '()\n', (279, 281), True, 'import pygame as pg\n'), ((292, 354), 'pygame.display.set_mode', 'pg.display.set_mode', (['(w... |
# -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTests.test_write -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTests.test_write} to test that
ITransport.write() works for process tr... | [
"twisted.internet.reactor.stop",
"twisted.python.reflect.namedAny",
"twisted.internet.reactor.run"
] | [((837, 850), 'twisted.internet.reactor.run', 'reactor.run', ([], {}), '()\n', (848, 850), False, 'from twisted.internet import reactor\n'), ((669, 683), 'twisted.internet.reactor.stop', 'reactor.stop', ([], {}), '()\n', (681, 683), False, 'from twisted.internet import reactor\n'), ((717, 746), 'twisted.python.reflect.... |
# calculate the load on each org
import threading
# cannot use from wpad_dispatch here, have to import whole module,
# because of circular dependency
import wpad_dispatch
from wpad_utils import *
from wlcg_wpad import getiporg
orgcleanminutes = 5
orgcleantime = 0
# Minute records keep track of the number of requ... | [
"threading.Lock",
"wlcg_wpad.getiporg"
] | [((1142, 1158), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (1156, 1158), False, 'import threading\n'), ((1369, 1387), 'wlcg_wpad.getiporg', 'getiporg', (['remoteip'], {}), '(remoteip)\n', (1377, 1387), False, 'from wlcg_wpad import getiporg\n'), ((751, 767), 'threading.Lock', 'threading.Lock', ([], {}), '()\... |
import os
import sys
sys.path.append(os.path.abspath(''))
# Raises linting error because not at top of file
# Not sure how to resolve this with the pathing
from src import uploadJson # noqa: E402
import src.config as config # noqa: E402
# Taking out of commission until new geojson format requested developed
# def te... | [
"os.path.abspath",
"pkg_resources.parse_requirements",
"pkg_resources.require",
"src.uploadJson.auth_firebase"
] | [((37, 56), 'os.path.abspath', 'os.path.abspath', (['""""""'], {}), "('')\n", (52, 56), False, 'import os\n'), ((956, 982), 'src.uploadJson.auth_firebase', 'uploadJson.auth_firebase', ([], {}), '()\n', (980, 982), False, 'from src import uploadJson\n'), ((774, 809), 'pkg_resources.parse_requirements', 'pkg_resources.pa... |
import pandas as pd
import numpy as np
from sklearn.datasets import load_iris
from sklearn.naive_bayes import GaussianNB
import pickle
def train_iris_nb():
"""Train a GaussianNB model on iris dataset."""
X, y_train = load_iris(return_X_y=True, as_frame=True)
colnames = X.columns
X_train = X.values
... | [
"sklearn.datasets.load_iris",
"sklearn.naive_bayes.GaussianNB",
"pickle.load",
"pickle.dump"
] | [((226, 267), 'sklearn.datasets.load_iris', 'load_iris', ([], {'return_X_y': '(True)', 'as_frame': '(True)'}), '(return_X_y=True, as_frame=True)\n', (235, 267), False, 'from sklearn.datasets import load_iris\n'), ((328, 340), 'sklearn.naive_bayes.GaussianNB', 'GaussianNB', ([], {}), '()\n', (338, 340), False, 'from skl... |
#Import modules
import os
import pandas as pd
import numpy as np
from pandas import DatetimeIndex
import dask
import scipy
import time
import glob
import torch
import torch.nn as nn
from live_plotter import live_plotter
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
from functools impo... | [
"pytorchModel.Functional_encoder",
"numpy.reshape",
"numpy.ones",
"torch.tensor",
"pytorchModel.Code",
"numpy.expand_dims",
"torch.isnan",
"torch.cat"
] | [((1146, 1197), 'pytorchModel.Functional_encoder', 'pytorchModel.Functional_encoder', (['(self.nbFactors + 1)'], {}), '(self.nbFactors + 1)\n', (1177, 1197), False, 'import pytorchModel\n'), ((2399, 2428), 'torch.tensor', 'torch.tensor', (['batch[0].values'], {}), '(batch[0].values)\n', (2411, 2428), False, 'import tor... |
import numpy as np
import tensorflow as tf
from tensorflow import keras
import warnings
warnings.filterwarnings('ignore')
mnist = tf.keras.datasets.mnist
(X_train, y_train), (X_test, y_test) = mnist.load_data()
X_train, X_test = X_train / 255.0, X_test / 255.0
X_train.shape = (60000, 28, 28)
model = tf.keras.Sequen... | [
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Softmax",
"tensorflow.keras.layers.Flatten",
"warnings.filterwarnings"
] | [((89, 122), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (112, 122), False, 'import warnings\n'), ((625, 685), 'tensorflow.keras.losses.SparseCategoricalCrossentropy', 'keras.losses.SparseCategoricalCrossentropy', ([], {'from_logits': '(True)'}), '(from_logits=True)\n',... |
import unittest
from rdflib import Graph
def buildQueryArgs(q):
return dict(select="", where="", optional="")
class SPARQLParserTest(unittest.TestCase):
known_issue = True
def setUp(self):
self.graph = Graph()
pass
def tearDown(self):
pass
tests = [
("basic",
"""\
... | [
"rdflib.Graph"
] | [((225, 232), 'rdflib.Graph', 'Graph', ([], {}), '()\n', (230, 232), False, 'from rdflib import Graph\n')] |
from panda3d.core import *
# Leave these imports in, they may be used by ptf files.
from panda3d.physics import *
from . import Particles
from . import ForceGroup
from direct.directnotify import DirectNotifyGlobal
class ParticleEffect(NodePath):
notify = DirectNotifyGlobal.directNotify.newCategory('ParticleEff... | [
"direct.directnotify.DirectNotifyGlobal.directNotify.newCategory"
] | [((264, 325), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCategory', 'DirectNotifyGlobal.directNotify.newCategory', (['"""ParticleEffect"""'], {}), "('ParticleEffect')\n", (307, 325), False, 'from direct.directnotify import DirectNotifyGlobal\n')] |
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from jsonfield import JSONField
from orchestra.models.fields import PrivateFileField
from orchestra.models.queryset import group_by... | [
"django.db.models.Sum",
"django.utils.translation.ugettext_lazy",
"django.db.models.CharField"
] | [((4428, 4494), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(10)', 'default': 'settings.PAYMENT_CURRENCY'}), '(max_length=10, default=settings.PAYMENT_CURRENCY)\n', (4444, 4494), False, 'from django.db import models\n'), ((692, 703), 'django.utils.translation.ugettext_lazy', '_', (['"""method... |
import optparse
import sys
from sys import getsizeof
import logging
from signal import signal, SIGINT
import time
import requests
# MIT License
#
# Copyright (c) 2022 SaicharanKandukuri
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation file... | [
"logging.getLogger",
"signal.signal",
"requests.post",
"sys.getsizeof",
"optparse.OptionParser",
"requests.get",
"time.sleep",
"sys.exit",
"rich.logging.RichHandler",
"logging.disable"
] | [((1420, 1444), 'logging.disable', 'logging.disable', (['"""DEBUG"""'], {}), "('DEBUG')\n", (1435, 1444), False, 'import logging\n'), ((1452, 1477), 'logging.getLogger', 'logging.getLogger', (['"""rich"""'], {}), "('rich')\n", (1469, 1477), False, 'import logging\n'), ((7125, 7136), 'sys.exit', 'sys.exit', (['(0)'], {}... |
"""
sphinx-simulink.application
~~~~~~~~~~~~~~~~~~~~~~~
Embed Simulink diagrams on your documentation.
:copyright:
Copyright 2016 by <NAME> <<EMAIL>>.
:license:
MIT, see LICENSE for details.
"""
import matlab.engine
import os
from sphinx.errors import SphinxError
from sphinx.util.osuti... | [
"os.path.dirname",
"os.path.exists"
] | [((623, 642), 'os.path.exists', 'os.path.exists', (['uri'], {}), '(uri)\n', (637, 642), False, 'import os\n'), ((675, 695), 'os.path.dirname', 'os.path.dirname', (['uri'], {}), '(uri)\n', (690, 695), False, 'import os\n')] |
"""
Author: <NAME>
Date: 04/02/2020
All rights reserved.
Feel free to use and modify and if you like it give it a star.
Import the Robot's Step Files and Color/Scale/Assemble them using the instructions in /RoboDK/KUKA/KUKA LWR IV+ Description
(for Original=kuka_lwr_model_description.json, for custom=custom_kuka_lwr_m... | [
"json.load",
"os.path.realpath"
] | [((2952, 2974), 'json.load', 'json.load', (['config_file'], {}), '(config_file)\n', (2961, 2974), False, 'import json\n'), ((5745, 5767), 'json.load', 'json.load', (['config_file'], {}), '(config_file)\n', (5754, 5767), False, 'import json\n'), ((8421, 8443), 'json.load', 'json.load', (['config_file'], {}), '(config_fi... |
import unittest
from context import parser
class TVShowFileParserTests(unittest.TestCase):
def setUp(self):
self.filename = parser.Parser("test.2018.S01E01E02.mkv")
def tearDown(self):
self.filename = None
def testisSubtitleFileSRT(self):
self.assertFalse(self.filename.isSubs)
... | [
"unittest.main",
"context.parser.Parser"
] | [((352, 367), 'unittest.main', 'unittest.main', ([], {}), '()\n', (365, 367), False, 'import unittest\n'), ((139, 179), 'context.parser.Parser', 'parser.Parser', (['"""test.2018.S01E01E02.mkv"""'], {}), "('test.2018.S01E01E02.mkv')\n", (152, 179), False, 'from context import parser\n')] |
from urllib.parse import quote
from django import template
register = template.Library()
@register.filter
def urlify(value):
return quote(value) | [
"urllib.parse.quote",
"django.template.Library"
] | [((71, 89), 'django.template.Library', 'template.Library', ([], {}), '()\n', (87, 89), False, 'from django import template\n'), ((138, 150), 'urllib.parse.quote', 'quote', (['value'], {}), '(value)\n', (143, 150), False, 'from urllib.parse import quote\n')] |
# Generated by Django 2.0.6 on 2018-06-11 23:50
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('producto', '0003_auto_20180611_2248'),
]
operations = [
migrations.RenameModel(
old_name='Venta',
new_name='Ventas',
... | [
"django.db.migrations.RenameModel"
] | [((228, 287), 'django.db.migrations.RenameModel', 'migrations.RenameModel', ([], {'old_name': '"""Venta"""', 'new_name': '"""Ventas"""'}), "(old_name='Venta', new_name='Ventas')\n", (250, 287), False, 'from django.db import migrations\n')] |
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/test/testcases/testPSUReadSbeMem.py $
#
# OpenPOWER sbe Project
#
# Contributors Listed Below - COPYRIGHT 2017,2019
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you... | [
"testUtil.getMachineName",
"testPSUUtil.registry",
"testUtil.collectFFDC",
"testMemUtil.getmem",
"testUtil.runCycles",
"sys.path.append"
] | [((865, 909), 'sys.path.append', 'sys.path.append', (['"""targets/p9_nimbus/sbeTest"""'], {}), "('targets/p9_nimbus/sbeTest')\n", (880, 909), False, 'import sys\n'), ((911, 954), 'sys.path.append', 'sys.path.append', (['"""targets/p9_axone/sbeTest"""'], {}), "('targets/p9_axone/sbeTest')\n", (926, 954), False, 'import ... |
#!/usr/bin/env python3
"""Module containing the ClusteringPredict class and the command line interface."""
import argparse
import pandas as pd
import joblib
from biobb_common.generic.biobb_object import BiobbObject
from sklearn.preprocessing import StandardScaler
from biobb_common.configuration import settings
from b... | [
"biobb_common.tools.file_utils.log",
"pandas.read_csv",
"argparse.RawTextHelpFormatter",
"joblib.load",
"pandas.DataFrame",
"biobb_common.configuration.settings.ConfReader"
] | [((5128, 5235), 'biobb_common.tools.file_utils.log', 'fu.log', (["('Getting model from %s' % self.io_dict['in']['input_model_path'])", 'self.out_log', 'self.global_log'], {}), "('Getting model from %s' % self.io_dict['in']['input_model_path'],\n self.out_log, self.global_log)\n", (5134, 5235), True, 'from biobb_comm... |
import pytest
import os
import memcnn.experiment.factory
from memcnn.config import Config
def test_get_attr_from_module():
a = memcnn.experiment.factory.get_attr_from_module('memcnn.experiment.factory.get_attr_from_module')
assert a is memcnn.experiment.factory.get_attr_from_module
def test_load_experiment_... | [
"pytest.mark.skip",
"pytest.raises",
"memcnn.config.Config.get_dir"
] | [((490, 580), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""Covered more efficiently by test_train.test_run_experiment"""'}), "(reason=\n 'Covered more efficiently by test_train.test_run_experiment')\n", (506, 580), False, 'import pytest\n'), ((359, 375), 'memcnn.config.Config.get_dir', 'Config.get_dir... |
"""
@file: test_search_serial_port.py
@author: <NAME>
@brief: search_serial_port.pyのをテストするプログラム
"""
from search_serial_port import search_com_ports, search_enabled_com_port
def test_search_com_ports():
search_com_ports()
def test_search_enabled_com_port():
search_enabled_com_port()
| [
"search_serial_port.search_com_ports",
"search_serial_port.search_enabled_com_port"
] | [((209, 227), 'search_serial_port.search_com_ports', 'search_com_ports', ([], {}), '()\n', (225, 227), False, 'from search_serial_port import search_com_ports, search_enabled_com_port\n'), ((270, 295), 'search_serial_port.search_enabled_com_port', 'search_enabled_com_port', ([], {}), '()\n', (293, 295), False, 'from se... |
import requests
import json
def getguild(guild_id):
guild_id = str(guild_id)
http_response = requests.get(f'https://discord.com/api/guilds/{guild_id}/widget.json')
response_data = http_response.json()
data = json.dumps(response_data)
return data | [
"json.dumps",
"requests.get"
] | [((102, 172), 'requests.get', 'requests.get', (['f"""https://discord.com/api/guilds/{guild_id}/widget.json"""'], {}), "(f'https://discord.com/api/guilds/{guild_id}/widget.json')\n", (114, 172), False, 'import requests\n'), ((225, 250), 'json.dumps', 'json.dumps', (['response_data'], {}), '(response_data)\n', (235, 250)... |
"""p2 core tasks"""
from p2.core.celery import CELERY_APP
from p2.lib.reflection import path_to_class
@CELERY_APP.task(bind=True)
def signal_marshall(self, signal, args=None, kwargs=None):
"""Run signal in task worker"""
if not args:
args = []
if not kwargs:
kwargs = {}
# Lookup PK to ... | [
"p2.core.celery.CELERY_APP.task",
"p2.lib.reflection.path_to_class"
] | [((105, 131), 'p2.core.celery.CELERY_APP.task', 'CELERY_APP.task', ([], {'bind': '(True)'}), '(bind=True)\n', (120, 131), False, 'from p2.core.celery import CELERY_APP\n'), ((611, 632), 'p2.lib.reflection.path_to_class', 'path_to_class', (['signal'], {}), '(signal)\n', (624, 632), False, 'from p2.lib.reflection import ... |
import pytest
import numpy as np
import itertools
from numpy.testing import assert_allclose
from keras_contrib.utils.test_utils import layer_test, keras_test
from keras.utils.conv_utils import conv_input_length
from keras import backend as K
from keras_contrib import backend as KC
from keras_contrib.layers import conv... | [
"keras.backend.image_data_format",
"numpy.random.random",
"numpy.asarray",
"keras_contrib.utils.test_utils.layer_test",
"keras.backend.floatx",
"pytest.main",
"keras.models.Sequential",
"keras_contrib.layers.convolutional.CosineConvolution2D",
"keras_contrib.backend.depth_to_space",
"keras.backend... | [((427, 438), 'keras.backend.backend', 'K.backend', ([], {}), '()\n', (436, 438), True, 'from keras import backend as K\n'), ((2581, 2593), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (2591, 2593), False, 'from keras.models import Sequential\n'), ((2917, 2934), 'numpy.asarray', 'np.asarray', (['[1.0]'], ... |
# Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"jax.lax.scan",
"jax.lax.while_loop",
"jax.jit",
"jax.lax.cond"
] | [((1809, 1864), 'jax.lax.while_loop', 'jax.lax.while_loop', (['_cond_fun', '_body_fun', '(0, init_val)'], {}), '(_cond_fun, _body_fun, (0, init_val))\n', (1827, 1864), False, 'import jax\n'), ((2422, 2460), 'jax.jit', 'jax.jit', (['fun'], {'static_argnums': '(0, 1, 3)'}), '(fun, static_argnums=(0, 1, 3))\n', (2429, 246... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.Graph",
"collections.namedtuple",
"tensorflow.contrib.compiler.xla.estimator_model_fn",
"official.recommendation.data_preprocessing.get_epoch_info",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.gfile.DeleteRecursively",
"tensorflow.global_variables_initializer",
"official.... | [((2243, 2309), 'collections.namedtuple', 'namedtuple', (['"""_TrainModelProperties"""', '_SHARED_MODEL_PROPERTY_FIELDS'], {}), "('_TrainModelProperties', _SHARED_MODEL_PROPERTY_FIELDS)\n", (2253, 2309), False, 'from collections import namedtuple\n'), ((2404, 2510), 'collections.namedtuple', 'namedtuple', (['"""_EvalMo... |
import numpy as np
import matplotlib.pyplot as plt
import cv2
import time
def getTransformMatrix(origin, destination):
x = np.zeros(origin.shape[0] + 1) # insert [0]-element for better indexing -> x[1] = first element
x[1:] = origin[:,0]
y = np.copy(x)
y[1:] = origin[:,1]
x_ = np.copy(x)
x_[1... | [
"numpy.copy",
"matplotlib.pyplot.imread",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((129, 158), 'numpy.zeros', 'np.zeros', (['(origin.shape[0] + 1)'], {}), '(origin.shape[0] + 1)\n', (137, 158), True, 'import numpy as np\n'), ((256, 266), 'numpy.copy', 'np.copy', (['x'], {}), '(x)\n', (263, 266), True, 'import numpy as np\n'), ((301, 311), 'numpy.copy', 'np.copy', (['x'], {}), '(x)\n', (308, 311), T... |
import argparse
import os
import torch
import torch.nn.functional as F
from torch import nn
from torch.optim.adamax import Adamax
from multiobject.pytorch import MultiObjectDataLoader, MultiObjectDataset
epochs = 100
batch_size = 64
lr = 3e-4
dataset_filename = os.path.join(
'dsprites',
'multi_dsprites_color... | [
"torch.nn.BatchNorm2d",
"argparse.ArgumentParser",
"torch.nn.LeakyReLU",
"torch.nn.Dropout2d",
"os.path.join",
"torch.nn.Conv2d",
"multiobject.pytorch.MultiObjectDataset",
"torch.cuda.is_available",
"torch.nn.functional.cross_entropy",
"torch.nn.Linear",
"multiobject.pytorch.MultiObjectDataLoade... | [((265, 321), 'os.path.join', 'os.path.join', (['"""dsprites"""', '"""multi_dsprites_color_012.npz"""'], {}), "('dsprites', 'multi_dsprites_color_012.npz')\n", (277, 321), False, 'import os\n'), ((1688, 1732), 'os.path.join', 'os.path.join', (['"""generated"""', 'args.dataset_path'], {}), "('generated', args.dataset_pa... |
import bpy
import random
import math
## 固定値設定 #############################################################
# 実行ファイルパス一覧
FILE_ROOT_PATH = 'D:/blender_battleVR_py/'
setrendr_file_name = FILE_ROOT_PATH + "setting_render.py"
magicobj_file_name = FILE_ROOT_PATH + "magic_model.py"
fieldins_file_name = FILE_ROOT_PATH + "fie... | [
"bpy.ops.object.delete",
"bpy.ops.object.select_all",
"bpy.context.scene.sequence_editor_clear",
"bpy.context.scene.sequence_editor_create"
] | [((1104, 1146), 'bpy.ops.object.select_all', 'bpy.ops.object.select_all', ([], {'action': '"""SELECT"""'}), "(action='SELECT')\n", (1129, 1146), False, 'import bpy\n'), ((1159, 1186), 'bpy.ops.object.delete', 'bpy.ops.object.delete', (['(True)'], {}), '(True)\n', (1180, 1186), False, 'import bpy\n'), ((1287, 1329), 'bp... |
from typing import Union
import kfp
from kfp.components import InputPath, OutputPath
from skit_pipelines import constants as pipeline_constants
def extract_tgz_archive(
tgz_path: InputPath(str),
output_path: OutputPath(str),
):
import tarfile
from loguru import logger
logger.debug(f"Extracting... | [
"tarfile.open",
"loguru.logger.debug",
"kfp.components.create_component_from_func",
"kfp.components.InputPath",
"kfp.components.OutputPath"
] | [((498, 607), 'kfp.components.create_component_from_func', 'kfp.components.create_component_from_func', (['extract_tgz_archive'], {'base_image': 'pipeline_constants.BASE_IMAGE'}), '(extract_tgz_archive, base_image=\n pipeline_constants.BASE_IMAGE)\n', (539, 607), False, 'import kfp\n'), ((295, 347), 'loguru.logger.d... |
import pytest
from dagster import (
DagsterInvalidDefinitionError,
InputDefinition,
Nothing,
Optional,
composite_solid,
execute_pipeline,
execute_solid,
lambda_solid,
pipeline,
)
def test_none():
@lambda_solid(input_defs=[InputDefinition("x", Optional[int], default_value=None)... | [
"dagster.execute_solid",
"dagster.execute_pipeline",
"pytest.raises",
"dagster.InputDefinition"
] | [((373, 394), 'dagster.execute_solid', 'execute_solid', (['none_x'], {}), '(none_x)\n', (386, 394), False, 'from dagster import DagsterInvalidDefinitionError, InputDefinition, Nothing, Optional, composite_solid, execute_pipeline, execute_solid, lambda_solid, pipeline\n'), ((534, 555), 'dagster.execute_solid', 'execute_... |
from config.updateConfig import UpdateConfig
sampleCONF = {
"task": {
"name": "sample",
},
"instructions": {
"text": "Give instructions",
"startPrompt": "Press any key to continue. Press q to quit.",
"alarm": "horn.wav",
"questionnaireReminder": "answerQuestionnaire.... | [
"config.updateConfig.UpdateConfig"
] | [((514, 528), 'config.updateConfig.UpdateConfig', 'UpdateConfig', ([], {}), '()\n', (526, 528), False, 'from config.updateConfig import UpdateConfig\n')] |
"""
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | [
"tempfile.TemporaryDirectory",
"collections.OrderedDict",
"numpy.allclose",
"onnxruntime.SessionOptions",
"oneflow.FunctionConfig",
"numpy.abs",
"os.path.join",
"onnxruntime.InferenceSession",
"oneflow.random_uniform_initializer",
"oneflow.train.CheckPoint",
"numpy.random.uniform",
"oneflow.on... | [((927, 950), 'oneflow.train.CheckPoint', 'flow.train.CheckPoint', ([], {}), '()\n', (948, 950), True, 'import oneflow as flow\n'), ((1396, 1425), 'tempfile.TemporaryDirectory', 'tempfile.TemporaryDirectory', ([], {}), '()\n', (1423, 1425), False, 'import tempfile\n'), ((1629, 1658), 'tempfile.TemporaryDirectory', 'tem... |
import asyncio
import os
import signal
import tomodachi
from typing import Any, Dict, Tuple, Callable, Union # noqa
from aiohttp import web
from tomodachi.transport.http import http, http_error, http_static, websocket, Response, RequestHandler
from tomodachi.discovery.dummy_registry import DummyRegistry
async def mi... | [
"tomodachi.transport.http.Response",
"aiohttp.web.Response",
"tomodachi.transport.http.http_error",
"os.getpid",
"asyncio.sleep",
"tomodachi.transport.http.RequestHandler.get_request_ip",
"tomodachi.transport.http.http_static",
"tomodachi.transport.http.http",
"tomodachi.transport.http.websocket",
... | [((1055, 1071), 'asyncio.Future', 'asyncio.Future', ([], {}), '()\n', (1069, 1071), False, 'import asyncio\n'), ((1288, 1310), 'tomodachi.transport.http.http', 'http', (['"""GET"""', '"""/test/?"""'], {}), "('GET', '/test/?')\n", (1292, 1310), False, 'from tomodachi.transport.http import http, http_error, http_static, ... |
# -*- coding: utf-8 -*-
# Copyright © 2018 PyHelp Project Contributors
# https://github.com/jnsebgosselin/pyhelp
#
# This file is part of PyHelp.
# Licensed under the terms of the GNU General Public License.
# ---- Standard Library Imports
import os
import os.path as osp
# ---- Third Party imports
import numpy as ... | [
"pyhelp.weather_reader.save_airtemp_to_HELP",
"pandas.read_csv",
"numpy.hstack",
"numpy.array",
"pyhelp.processing.run_help_allcells",
"numpy.save",
"numpy.arange",
"os.path.exists",
"os.listdir",
"numpy.where",
"netCDF4.Dataset",
"pyhelp.weather_reader.read_cweeds_file",
"numpy.max",
"num... | [((18515, 18539), 'pandas.read_csv', 'pd.read_csv', (['path_togrid'], {}), '(path_togrid)\n', (18526, 18539), True, 'import pandas as pd\n'), ((18571, 18596), 'os.path.basename', 'osp.basename', (['path_togrid'], {}), '(path_togrid)\n', (18583, 18596), True, 'import os.path as osp\n'), ((1587, 1629), 'os.path.join', 'o... |
from decimal import Decimal
import pytest
from bson import Decimal128
from momapper import MappedClass, Field
from momapper.mongodb.collection import MappedCollection
from momapper.types import (
DecimalType,
ValidationError,
IntType,
FloatType,
StringType,
ByteType,
BoolType,
ListType... | [
"momapper.mongodb.collection.MappedCollection",
"pytest.raises",
"decimal.Decimal",
"momapper.Field"
] | [((1907, 1986), 'momapper.mongodb.collection.MappedCollection', 'MappedCollection', (['mongo_client.db', 'mongo_client.collection'], {'impl': 'DocWithDecimal'}), '(mongo_client.db, mongo_client.collection, impl=DocWithDecimal)\n', (1923, 1986), False, 'from momapper.mongodb.collection import MappedCollection\n'), ((263... |
import ctypes as ct
import time
import copy
import numpy as np
import sharpy.aero.utils.mapping as mapping
import sharpy.utils.cout_utils as cout
import sharpy.utils.solver_interface as solver_interface
import sharpy.utils.controller_interface as controller_interface
from sharpy.utils.solver_interface import solver, ... | [
"sharpy.utils.algebra.unit_vector",
"sharpy.utils.cout_utils.TablePrinter",
"sharpy.utils.cout_utils.cout_wrap",
"numpy.log10",
"sharpy.utils.exceptions.NotConvergedSolver",
"sharpy.utils.controller_interface.initialise_controller",
"sharpy.utils.settings.SettingsTable",
"time.perf_counter",
"numpy.... | [((6294, 6318), 'sharpy.utils.settings.SettingsTable', 'settings.SettingsTable', ([], {}), '()\n', (6316, 6318), True, 'import sharpy.utils.settings as settings\n'), ((26759, 26795), 'sharpy.utils.algebra.unit_vector', 'algebra.unit_vector', (['tstep.dqdt[-4:]'], {}), '(tstep.dqdt[-4:])\n', (26778, 26795), True, 'impor... |
from __future__ import absolute_import, print_function, division
import unittest
from pony.orm.core import *
from pony.orm.core import local
from pony.orm.tests.testutils import *
from pony.orm.tests import setup_database, teardown_database
class TestGeneratorDbSession(unittest.TestCase):
def setUp(self):
... | [
"unittest.main",
"pony.orm.tests.teardown_database",
"pony.orm.tests.setup_database"
] | [((4718, 4733), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4731, 4733), False, 'import unittest\n'), ((449, 467), 'pony.orm.tests.setup_database', 'setup_database', (['db'], {}), '(db)\n', (463, 467), False, 'from pony.orm.tests import setup_database, teardown_database\n'), ((712, 738), 'pony.orm.tests.teardo... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2018-01-05 01:20
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('private_sharing', '0007_auto_20171220_2038'),
]
operations = [
migrations.CreateMod... | [
"django.db.models.AutoField",
"django.db.models.TextField",
"django.db.models.ForeignKey"
] | [((404, 497), '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", (420, 497), False, 'from django.db import migrations, models\... |
# coding: utf-8
"""
Test Pyleecan optimization module using Zitzler–Deb–Thiele's function N. 3
"""
import pytest
from ....definitions import PACKAGE_NAME
from ....Tests.Validation.Machine.SCIM_001 import SCIM_001
from ....Classes.InputCurrent import InputCurrent
from ....Classes.MagFEMM import MagFEMM
from ....Classes... | [
"numpy.sqrt",
"numpy.unique",
"numpy.ones",
"numpy.where",
"matplotlib.image.imread",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.random.uniform",
"numpy.sin",
"matplotlib.pyplot.subplots"
] | [((3954, 3977), 'numpy.array', 'np.array', (['self.is_valid'], {}), '(self.is_valid)\n', (3962, 3977), True, 'import numpy as np\n'), ((3996, 4018), 'numpy.array', 'np.array', (['self.fitness'], {}), '(self.fitness)\n', (4004, 4018), True, 'import numpy as np\n'), ((4034, 4053), 'numpy.array', 'np.array', (['self.ngen'... |
from typing import Union, List
import pika
import pika.exceptions
import time
import logging
def CreateDurableQueue(channel: pika.adapters.blocking_connection.BlockingChannel, queue: str,
settings: dict = None):
if settings is None:
settings = {}
channel.queue_declare(queue,
... | [
"logging.getLogger",
"time.sleep"
] | [((1907, 1934), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1924, 1934), False, 'import logging\n'), ((2301, 2314), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (2311, 2314), False, 'import time\n')] |
# Copyright 2013 by <NAME>.
# Revisions copyright 2015 by <NAME>.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
import unittest
import warnings
from os import path
from Bio import BiopythonParserW... | [
"warnings.catch_warnings",
"os.path.join",
"warnings.simplefilter",
"Bio.SeqIO.read",
"unittest.main",
"Bio.GenBank.read",
"unittest.TextTestRunner"
] | [((7472, 7508), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (7495, 7508), False, 'import unittest\n'), ((7513, 7545), 'unittest.main', 'unittest.main', ([], {'testRunner': 'runner'}), '(testRunner=runner)\n', (7526, 7545), False, 'import unittest\n'), ((4089, 412... |
import turtle
import math
from time import sleep
def calculate_points(pos, r1, r2, angles):
points = []
for a in angles:
x = pos[0] + (r1 * math.cos(math.radians(a)))
y = pos[1] + (r2 * math.sin(math.radians(a)))
points.append((x, y))
return points
def draw_pyramid(tur, draw=False)... | [
"turtle.Screen",
"turtle.Turtle",
"time.sleep",
"math.radians"
] | [((825, 840), 'turtle.Screen', 'turtle.Screen', ([], {}), '()\n', (838, 840), False, 'import turtle\n'), ((846, 861), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (859, 861), False, 'import turtle\n'), ((1545, 1556), 'time.sleep', 'sleep', (['(0.01)'], {}), '(0.01)\n', (1550, 1556), False, 'from time import slee... |
# vim:set ts=4 sw=4 et:
'''
Config
======
'''
import re
from .action_mapper import Action
from .checks_list import Checks
from .exceptions import ConfigurationException
class Config(object):
"""The :class:`Config` class is responsible for storing application groups
and policies read from the datastore.
... | [
"re.match"
] | [((3322, 3347), 're.match', 're.match', (['regex', 'hostname'], {}), '(regex, hostname)\n', (3330, 3347), False, 'import re\n'), ((3460, 3485), 're.match', 're.match', (['regex', 'hostname'], {}), '(regex, hostname)\n', (3468, 3485), False, 'import re\n')] |
# Generated by Django 2.0.2 on 2018-02-17 12:17
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('printapp', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='historybayar',
name=... | [
"django.db.models.DecimalField",
"django.db.models.DateField",
"django.db.models.IntegerField"
] | [((351, 444), 'django.db.models.DecimalField', 'models.DecimalField', ([], {'decimal_places': '(2)', 'max_digits': '(14)', 'verbose_name': '"""pembayaran sekarang"""'}), "(decimal_places=2, max_digits=14, verbose_name=\n 'pembayaran sekarang')\n", (370, 444), False, 'from django.db import migrations, models\n'), ((5... |
# ---------------------------------------------------------------------
# crm.supplierprofile application
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
#... | [
"noc.core.translation.ugettext"
] | [((615, 636), 'noc.core.translation.ugettext', '_', (['"""Supplier Profile"""'], {}), "('Supplier Profile')\n", (616, 636), True, 'from noc.core.translation import ugettext as _\n'), ((649, 659), 'noc.core.translation.ugettext', '_', (['"""Setup"""'], {}), "('Setup')\n", (650, 659), True, 'from noc.core.translation imp... |
from random import shuffle
NUM_DIGIT = 3
MAX_GUESSES = 10
def main(): # main game
print(
f"""
Bagels, a detective logic game.
By <NAME>
I am thinking of a number {NUM_DIGIT} number with no repeted digits.
Try to guess what it is. Here re some clues:
When i say: ... | [
"random.shuffle"
] | [((1816, 1832), 'random.shuffle', 'shuffle', (['numbers'], {}), '(numbers)\n', (1823, 1832), False, 'from random import shuffle\n')] |
#!/usr/bin/env python
import os
import argparse
import sqlite3
from glob import glob
import pandas as pd
parser = argparse.ArgumentParser()
parser.add_argument('--gtex-models-dir', type=str, required=True)
parser.add_argument('--variants-file-with-gtex-id', type=str, required=True)
parser.add_argument('--output-file... | [
"sqlite3.connect",
"argparse.ArgumentParser",
"pandas.read_csv",
"os.path.join",
"pandas.read_sql"
] | [((117, 142), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (140, 142), False, 'import argparse\n'), ((394, 436), 'os.path.join', 'os.path.join', (['args.gtex_models_dir', '"""*.db"""'], {}), "(args.gtex_models_dir, '*.db')\n", (406, 436), False, 'import os\n'), ((571, 589), 'sqlite3.connect',... |
import os
import tensorflow as tf
from util import masked_softmax
class PolicyNetwork(object):
""" Policy Function approximator. """
def __init__(self, input_size, output_size, learning_rate=0.001, summaries_dir=None, scope="policy_estimator"):
with tf.variable_scope(scope):
# Writes Tens... | [
"tensorflow.one_hot",
"os.path.exists",
"tensorflow.variable_scope",
"os.makedirs",
"tensorflow.squared_difference",
"tensorflow.placeholder",
"tensorflow.contrib.layers.fully_connected",
"tensorflow.get_default_session",
"tensorflow.log",
"tensorflow.global_variables",
"util.masked_softmax",
... | [((269, 293), 'tensorflow.variable_scope', 'tf.variable_scope', (['scope'], {}), '(scope)\n', (286, 293), True, 'import tensorflow as tf\n'), ((699, 768), 'tensorflow.placeholder', 'tf.placeholder', ([], {'dtype': 'tf.float64', 'shape': '[1, input_size]', 'name': '"""state"""'}), "(dtype=tf.float64, shape=[1, input_siz... |
from setuptools import setup, find_packages
setup(name='getDB',
version='0.0.4',
description="This module can be used to download HMDB and KEGG database.",
license='MIT',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/jaspershen/getDB',
long_description_conte... | [
"setuptools.find_packages"
] | [((360, 375), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (373, 375), False, 'from setuptools import setup, find_packages\n')] |
import tarfile
import click
import requests
from odc.io.tar import tar_mode, add_txt_file
from multiprocessing.dummy import Pool as ThreadPool
from functools import partial
from urllib.parse import urlparse
from thredds_crawler.crawl import Crawl
def download(url):
parsed_uri = urlparse(url)
target_filename ... | [
"odc.io.tar.tar_mode",
"tarfile.open",
"odc.io.tar.add_txt_file",
"urllib.parse.urlparse",
"click.option",
"requests.get",
"functools.partial",
"click.command",
"thredds_crawler.crawl.Crawl",
"multiprocessing.dummy.Pool"
] | [((417, 448), 'click.command', 'click.command', (['"""thredds-to-tar"""'], {}), "('thredds-to-tar')\n", (430, 448), False, 'import click\n'), ((450, 560), 'click.option', 'click.option', (['"""--thredds_catalogue"""', '"""-c"""'], {'type': 'str', 'required': '(True)', 'help': '"""The THREDDS catalogue endpoint"""'}), "... |
from sklearn.linear_model import Ridge
class MachineLearning():
def __init__(self):
self.model = None
def train_model(self, X,y):
lr = Ridge(alpha=0.5)
lr.fit(X,y)
print(lr)
self.model = lr
def predict(self, X):
preds = self.model.predict(X)
return... | [
"sklearn.linear_model.Ridge"
] | [((162, 178), 'sklearn.linear_model.Ridge', 'Ridge', ([], {'alpha': '(0.5)'}), '(alpha=0.5)\n', (167, 178), False, 'from sklearn.linear_model import Ridge\n')] |
# -*- coding: utf-8 -*-
"""
@author: <NAME> (<EMAIL>) 11/03/2020
@description: PyDash Project
The ConnectionHandler is a Singleton class implementation
The class responsible to retrieve segments in the web server.
Also it implements a traffic shaping approach.
"""
from base.simple_module import SimpleModule
from ba... | [
"base.configuration_parser.ConfigurationParser.get_instance",
"time.perf_counter",
"time.sleep",
"base.simple_module.SimpleModule.__init__",
"base.timer.Timer.get_instance",
"base.message.Message",
"scipy.stats.expon.rvs"
] | [((678, 709), 'base.simple_module.SimpleModule.__init__', 'SimpleModule.__init__', (['self', 'id'], {}), '(self, id)\n', (699, 709), False, 'from base.simple_module import SimpleModule\n'), ((816, 850), 'base.configuration_parser.ConfigurationParser.get_instance', 'ConfigurationParser.get_instance', ([], {}), '()\n', (... |
import re
import yaml
import logging
logger = logging.getLogger(__name__)
from pylatexenc.macrospec import MacroSpec, ParsedMacroArgs, MacroStandardArgsParser
from pylatexenc import latexwalker
from latexpp.macro_subst_helper import MacroSubstHelper
from latexpp.fix import BaseFix
# parse entropy macros etc.
_q... | [
"logging.getLogger",
"re.compile",
"pylatexenc.latexwalker.LatexWalkerParseError",
"re.match",
"yaml.safe_load",
"re.finditer",
"latexpp.macro_subst_helper.MacroSubstHelper"
] | [((47, 74), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (64, 74), False, 'import logging\n'), ((332, 927), 'yaml.safe_load', 'yaml.safe_load', (['"""\nstdset:\n HH:\n type: Hbase\n Hzero:\n type: Hbase\n sub: \'\\\\mathrm{max},0\'\n Hmin:\n type: Hbase\n sub: \'\\\\ma... |
from builder.laikago_task_bullet import LaikagoTaskBullet
from builder.laikago_task import InitPose
import math
import numpy as np
ABDUCTION_P_GAIN = 220.0
ABDUCTION_D_GAIN = 0.3
HIP_P_GAIN = 220.0
HIP_D_GAIN = 2.0
KNEE_P_GAIN = 220.0
KNEE_D_GAIN = 2.0
class LaikagoStandImitationBulletBase(LaikagoTaskBullet):
de... | [
"numpy.array",
"numpy.zeros",
"numpy.abs",
"numpy.ones"
] | [((2373, 2385), 'numpy.zeros', 'np.zeros', (['(12)'], {}), '(12)\n', (2381, 2385), True, 'import numpy as np\n'), ((1383, 1394), 'numpy.ones', 'np.ones', (['(12)'], {}), '(12)\n', (1390, 1394), True, 'import numpy as np\n'), ((707, 771), 'numpy.array', 'np.array', (['[-10, 30, -75, 10, 30, -75, -10, 50, -75, 10, 50, -7... |
from logging import Logger
from logging import getLogger
from pytrek.settings.BaseSubSetting import BaseSubSetting
from pytrek.settings.SettingsCommon import SettingsCommon
from pytrek.settings.SettingsCommon import SettingsNameValues
class LimitsSettings(BaseSubSetting):
LIMITS_SECTION: str = 'Limits'
MA... | [
"logging.getLogger",
"pytrek.settings.SettingsCommon.SettingsNameValues",
"pytrek.settings.SettingsCommon.SettingsCommon",
"pytrek.settings.BaseSubSetting.BaseSubSetting.init"
] | [((617, 768), 'pytrek.settings.SettingsCommon.SettingsNameValues', 'SettingsNameValues', (["{MAXIMUM_STARS: '4', MINIMUM_STAR_BASES: '2', MAXIMUM_STAR_BASES: '5',\n MAXIMUM_PLANETS: '10', DEFAULT_FULL_SHIELDS: '2500'}"], {}), "({MAXIMUM_STARS: '4', MINIMUM_STAR_BASES: '2',\n MAXIMUM_STAR_BASES: '5', MAXIMUM_PLANE... |
import unittest
from datetime import date
from irLib.marketConvention.dayCount import ACT_ACT
from irLib.marketConvention.compounding import annually_k_Spot
from irLib.helpers.yieldCurve import yieldCurve, discountCurve, forwardCurve
import numpy as np
alias_disC = 'disC'
alias_forC = 'forC'
referenceDate = date(2020... | [
"numpy.ones",
"numpy.arange",
"numpy.round",
"irLib.helpers.yieldCurve.yieldCurve.dF2Forward",
"irLib.marketConvention.dayCount.ACT_ACT",
"irLib.helpers.yieldCurve.discountCurve",
"irLib.helpers.yieldCurve.forwardCurve",
"datetime.date",
"irLib.helpers.yieldCurve.yieldCurve.spot2Df",
"irLib.helper... | [((311, 328), 'datetime.date', 'date', (['(2020)', '(6)', '(26)'], {}), '(2020, 6, 26)\n', (315, 328), False, 'from datetime import date\n'), ((340, 349), 'irLib.marketConvention.dayCount.ACT_ACT', 'ACT_ACT', ([], {}), '()\n', (347, 349), False, 'from irLib.marketConvention.dayCount import ACT_ACT\n'), ((364, 381), 'ir... |
# Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
# This work is licensed under the NVIDIA Source Code License - Non-commercial. Full
# text can be found in LICENSE.md
from setuptools import setup, dist
import wheel
import os
# required to geneerate a platlib folder required by audittools
from setuptools.c... | [
"setuptools_scm.get_version",
"os.environ.get",
"setuptools.command.install.install.finalize_options",
"setuptools.setup"
] | [((984, 1059), 'setuptools_scm.get_version', 'get_version', ([], {'root': '""".."""', 'relative_to': '__file__', 'fallback_version': '"""0.0.0-dev0"""'}), "(root='..', relative_to=__file__, fallback_version='0.0.0-dev0')\n", (995, 1059), False, 'from setuptools_scm import get_version\n'), ((1096, 1133), 'os.environ.get... |
from marshmallow import fields, Schema
from .provision import ProvisionActionSchema
class InstanceSchema(Schema):
type = fields.String(required=True)
image_id = fields.String(required=True)
availability_zone = fields.String(required=True)
ebs_optimized = fields.Boolean()
iam_fleet_role = fields.String(required=... | [
"marshmallow.fields.Boolean",
"marshmallow.fields.Nested",
"marshmallow.fields.String"
] | [((125, 153), 'marshmallow.fields.String', 'fields.String', ([], {'required': '(True)'}), '(required=True)\n', (138, 153), False, 'from marshmallow import fields, Schema\n'), ((166, 194), 'marshmallow.fields.String', 'fields.String', ([], {'required': '(True)'}), '(required=True)\n', (179, 194), False, 'from marshmallo... |
__all__ = [
"Dataset",
"forgiving_true",
"load_config",
"log",
"make_tdtax_taxonomy",
"plot_gaia_density",
"plot_gaia_hr",
"plot_light_curve_data",
"plot_periods",
]
from astropy.io import fits
import datetime
import json
import healpy as hp
import matplotlib.pyplot as plt
import nu... | [
"numpy.log10",
"pandas.read_csv",
"healpy.mollview",
"yaml.load",
"numpy.argsort",
"numpy.array",
"astropy.io.fits.open",
"numpy.linalg.norm",
"numpy.arange",
"numpy.mean",
"numpy.histogram",
"healpy.projplot",
"tensorflow.data.Dataset.from_tensor_slices",
"numpy.max",
"matplotlib.pyplot... | [((2182, 2198), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (2191, 2198), True, 'import matplotlib.pyplot as plt\n'), ((4337, 4364), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (4343, 4364), True, 'import matplotlib.pyplot as plt\n')... |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 29 18:00:53 2019
@author: Administrator
"""
import pdblp
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
con = pdblp.BCon(debug=False, port=8194, timeout=5000)
con.start()
index_tickers = ['NYA Index', 'SPX I... | [
"pandas.Grouper",
"pdblp.BCon",
"datetime.date.today"
] | [((219, 267), 'pdblp.BCon', 'pdblp.BCon', ([], {'debug': '(False)', 'port': '(8194)', 'timeout': '(5000)'}), '(debug=False, port=8194, timeout=5000)\n', (229, 267), False, 'import pdblp\n'), ((673, 685), 'datetime.date.today', 'date.today', ([], {}), '()\n', (683, 685), False, 'from datetime import date\n'), ((870, 890... |
#!/usr/bin/env python
import logging
import re
import subprocess
import sys
from typing import Dict
logger = logging.getLogger("py2ts.generate_service_registry")
logging.basicConfig(level=logging.INFO)
class RipgrepError(Exception):
pass
def camel_to_snake(name: str) -> str:
name = re.sub("(.)([A-Z][a-z]+)... | [
"logging.getLogger",
"logging.basicConfig",
"subprocess.run",
"sys.exit",
"re.sub"
] | [((110, 162), 'logging.getLogger', 'logging.getLogger', (['"""py2ts.generate_service_registry"""'], {}), "('py2ts.generate_service_registry')\n", (127, 162), False, 'import logging\n'), ((163, 202), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (182, 202), Fals... |
import locale
import pytest
from covid.utils import fmt
class TestUtilityFunctions:
def test_format_functions_en_US(self):
try:
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
except locale.Error:
return pytest.skip()
assert fmt(0.10) == "0.1"
assert fmt(0... | [
"pytest.skip",
"covid.utils.fmt",
"locale.setlocale"
] | [((156, 202), 'locale.setlocale', 'locale.setlocale', (['locale.LC_ALL', '"""en_US.UTF-8"""'], {}), "(locale.LC_ALL, 'en_US.UTF-8')\n", (172, 202), False, 'import locale\n'), ((281, 289), 'covid.utils.fmt', 'fmt', (['(0.1)'], {}), '(0.1)\n', (284, 289), False, 'from covid.utils import fmt\n'), ((315, 324), 'covid.utils... |
#!/usr/bin/env python
from anti_instagram.AntiInstagram import AntiInstagram
from cv_bridge import CvBridge, CvBridgeError
from duckietown_msgs.msg import (AntiInstagramTransform, BoolStamped, Segment,
SegmentList, Vector2D, FSMState)
from duckietown_utils.instantiate_utils import instantiate
from duckietown_utils.... | [
"duckietown_utils.jpg.image_cv_from_jpg",
"cv2.convertScaleAbs",
"line_detector.line_detector_plot.drawLines",
"numpy.hstack",
"rospy.init_node",
"duckietown_msgs.msg.Segment",
"numpy.array",
"line_detector.timekeeper.TimeKeeper",
"duckietown_msgs.msg.SegmentList",
"anti_instagram.AntiInstagram.An... | [((10551, 10600), 'rospy.init_node', 'rospy.init_node', (['"""line_detector"""'], {'anonymous': '(False)'}), "('line_detector', anonymous=False)\n", (10566, 10600), False, 'import rospy\n'), ((10648, 10696), 'rospy.on_shutdown', 'rospy.on_shutdown', (['line_detector_node.onShutdown'], {}), '(line_detector_node.onShutdo... |
from django.urls import re_path
from xr_embeds.views import geojson_view, embed_html_view
app_name = "embeds"
urlpatterns = [
re_path(r"^(\d+)/html/$", embed_html_view, name="embed_html"),
re_path(
r"^geojson/(?P<model_slug>\w+)/(?P<query_slug>\w+)/$",
geojson_view,
name="geojson_view... | [
"django.urls.re_path"
] | [((133, 194), 'django.urls.re_path', 're_path', (['"""^(\\\\d+)/html/$"""', 'embed_html_view'], {'name': '"""embed_html"""'}), "('^(\\\\d+)/html/$', embed_html_view, name='embed_html')\n", (140, 194), False, 'from django.urls import re_path\n'), ((200, 302), 'django.urls.re_path', 're_path', (['"""^geojson/(?P<model_sl... |
from django.db import models
from django.core import signing
class PasswordMixin(object):
password_encrypted = models.CharField(max_length=128, null=False, blank=False)
@property
def password(self):
return signing.loads(self.password_encrypted)
@password.setter
def password(self, value)... | [
"django.core.signing.loads",
"django.db.models.CharField",
"django.core.signing.dumps"
] | [((118, 175), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(128)', 'null': '(False)', 'blank': '(False)'}), '(max_length=128, null=False, blank=False)\n', (134, 175), False, 'from django.db import models\n'), ((230, 268), 'django.core.signing.loads', 'signing.loads', (['self.password_encrypted... |
# -*- Mode: python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
from publications import list_import_formats, get_publications_importer
__license__ = 'MIT License <http://www.opensource.org/licenses/mit-license.php>'
__author__ = '<NAME> <<EMAIL>>'
__docformat__ = 'epytext'
from django.contrib import a... | [
"publications.models.Person.objects.filter",
"django.forms.FloatField",
"django.contrib.admin.site.register",
"django.template.RequestContext",
"publications.list_import_formats",
"django.contrib.messages.info",
"django.core.urlresolvers.reverse",
"publications.fields.PeopleField",
"publications.get... | [((7640, 7690), 'django.contrib.admin.site.register', 'admin.site.register', (['Publication', 'PublicationAdmin'], {}), '(Publication, PublicationAdmin)\n', (7659, 7690), False, 'from django.contrib import admin\n'), ((7691, 7729), 'django.contrib.admin.site.register', 'admin.site.register', (['Group', 'GroupAdmin'], {... |
import logging
from tests.common.helpers.assertions import pytest_assert
from tests.common.utilities import get_host_visible_vars
from tests.common.utilities import wait_until
CONTAINER_CHECK_INTERVAL_SECS = 1
CONTAINER_RESTART_THRESHOLD_SECS = 180
logger = logging.getLogger(__name__)
def is_supervisor_node(inv_file... | [
"logging.getLogger",
"tests.common.utilities.get_host_visible_vars",
"tests.common.utilities.wait_until",
"tests.common.helpers.assertions.pytest_assert"
] | [((260, 287), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (277, 287), False, 'import logging\n'), ((947, 989), 'tests.common.utilities.get_host_visible_vars', 'get_host_visible_vars', (['inv_files', 'hostname'], {}), '(inv_files, hostname)\n', (968, 989), False, 'from tests.common.util... |
from rest_framework import serializers
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth import get_user_model
from profiles.serializers import UserRowSerializer
from .models import Comment
User = get_user_model()
# content, user
def create_comment_serializer(model_type='outfit', i... | [
"profiles.serializers.UserRowSerializer",
"django.contrib.auth.get_user_model",
"django.contrib.contenttypes.models.ContentType.objects.filter",
"rest_framework.serializers.SerializerMethodField",
"rest_framework.serializers.ValidationError"
] | [((234, 250), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (248, 250), False, 'from django.contrib.auth import get_user_model\n'), ((2470, 2505), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', ([], {}), '()\n', (2503, 2505), False, 'from rest_framew... |
"""Copy number detection with CNVkit with specific support for targeted sequencing.
http://cnvkit.readthedocs.org
"""
import copy
import math
import operator
import os
import sys
import tempfile
import subprocess
import pybedtools
import numpy as np
import toolz as tz
from bcbio import utils
from bcbio.bam import re... | [
"toolz.groupby",
"bcbio.structural.annotate.add_genes",
"bcbio.variation.bedutils.sort_merge",
"numpy.array",
"pybedtools.BedTool",
"bcbio.pipeline.datadict.get_cores",
"copy.deepcopy",
"bcbio.variation.vcfutils.get_paired_bams",
"bcbio.pipeline.datadict.get_align_bam",
"bcbio.pipeline.datadict.ge... | [((2981, 3045), 'bcbio.variation.vcfutils.get_paired_bams', 'vcfutils.get_paired_bams', (["[x['align_bam'] for x in items]", 'items'], {}), "([x['align_bam'] for x in items], items)\n", (3005, 3045), False, 'from bcbio.variation import bedutils, effects, ploidy, population, vcfutils\n'), ((5903, 5935), 'os.path.join', ... |
"""
(c) 2013 LinkedIn Corp. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");?you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... | [
"logging.getLogger",
"lxml.etree.QName",
"copy.deepcopy",
"warnings.warn",
"lxml.etree.tostring"
] | [((1118, 1149), 'logging.getLogger', 'logging.getLogger', (['"""pyexchange"""'], {}), "('pyexchange')\n", (1135, 1149), False, 'import logging\n'), ((12203, 12358), 'warnings.warn', 'warnings.warn', (['"""The argument send_only_to_changed_attendees is deprecated. Use calendar_item_update_operation_type instead."""', '... |
import tensorflow as tf
from keras.preprocessing import image
from keras.applications.inception_v3 import InceptionV3, preprocess_input, decode_predictions
import numpy as np
import h5py
model = InceptionV3(include_top=True, weights='imagenet', input_tensor=None, input_shape=None)
graph = tf.get_default_graph()
def ... | [
"keras.applications.inception_v3.preprocess_input",
"keras.applications.inception_v3.decode_predictions",
"numpy.expand_dims",
"keras.applications.inception_v3.InceptionV3",
"tensorflow.get_default_graph"
] | [((197, 287), 'keras.applications.inception_v3.InceptionV3', 'InceptionV3', ([], {'include_top': '(True)', 'weights': '"""imagenet"""', 'input_tensor': 'None', 'input_shape': 'None'}), "(include_top=True, weights='imagenet', input_tensor=None,\n input_shape=None)\n", (208, 287), False, 'from keras.applications.incep... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# @Time : 2020-04-13 21:19
# @Author : <NAME>
# @EMail : <EMAIL>
import nltk
import os
import json
def sentence_split(line):
sents = nltk.tokenize.sent_tokenize(line)
rnt = [sent.split() for sent in sents]
return rnt
| [
"nltk.tokenize.sent_tokenize"
] | [((205, 238), 'nltk.tokenize.sent_tokenize', 'nltk.tokenize.sent_tokenize', (['line'], {}), '(line)\n', (232, 238), False, 'import nltk\n')] |
import numpy as np
from typing import Any, Iterable, Tuple
from .ext import EnvSpec
from .parallel import ParallelEnv
from ..prelude import Action, Array, State
from ..utils.rms import RunningMeanStd
class ParallelEnvWrapper(ParallelEnv[Action, State]):
def __init__(self, penv: ParallelEnv) -> None:
self.... | [
"numpy.zeros",
"numpy.roll"
] | [((1453, 1504), 'numpy.zeros', 'np.zeros', (['(self.num_envs, *self.shape)'], {'dtype': 'dtype'}), '((self.num_envs, *self.shape), dtype=dtype)\n', (1461, 1504), True, 'import numpy as np\n'), ((1717, 1752), 'numpy.roll', 'np.roll', (['self.obs'], {'shift': '(-1)', 'axis': '(1)'}), '(self.obs, shift=-1, axis=1)\n', (17... |
'''
This file contains method for generating calibration related plots, eg. reliability plots.
References:
[1] <NAME>, <NAME>, <NAME>, and <NAME>. On calibration of modern neural networks.
arXiv preprint arXiv:1706.04599, 2017.
'''
import math
import matplotlib.pyplot as plt
import numpy as np
import os
import ma... | [
"matplotlib.pyplot.ylabel",
"torch.sqrt",
"math.log",
"torch.log2",
"torch.sum",
"torch.nn.functional.softmax",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.yticks",
"torch.matmul",
"matplotlib.pyplot.ylim",
... | [((422, 460), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.size': 20}"], {}), "({'font.size': 20})\n", (441, 460), True, 'import matplotlib.pyplot as plt\n'), ((2301, 2328), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 8)'}), '(figsize=(10, 8))\n', (2311, 2328), True, 'impor... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | [
"pulumi.get",
"pulumi.getter",
"pulumi.set",
"pulumi.InvokeOptions",
"pulumi.runtime.invoke"
] | [((3780, 3815), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""compartmentId"""'}), "(name='compartmentId')\n", (3793, 3815), False, 'import pulumi\n'), ((4085, 4118), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""definedTags"""'}), "(name='definedTags')\n", (4098, 4118), False, 'import pulumi\n'), ((4617, 4... |
import imutils
import cv2
import numpy as np
import math
from math import sqrt
def find_robot_orientation(image):
robot = {}
robot['angle'] = []
robot['direction'] = []
robotLower = (139, 227, 196)
robotUpper = (255, 255, 255)
distances = []
# img = cv2.imread('all_color_terrain_with_robot.... | [
"cv2.drawContours",
"cv2.inRange",
"cv2.erode",
"cv2.line",
"math.degrees",
"numpy.argmax",
"imutils.is_cv2",
"cv2.imshow",
"math.sqrt",
"cv2.circle",
"math.atan2",
"cv2.cvtColor",
"cv2.moments",
"cv2.dilate",
"cv2.waitKey",
"numpy.float32"
] | [((336, 374), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2HSV'], {}), '(image, cv2.COLOR_BGR2HSV)\n', (348, 374), False, 'import cv2\n'), ((386, 426), 'cv2.inRange', 'cv2.inRange', (['hsv', 'robotLower', 'robotUpper'], {}), '(hsv, robotLower, robotUpper)\n', (397, 426), False, 'import cv2\n'), ((438, 473)... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
... | [
"ansible.module_utils.basic.AnsibleModule",
"pyVmomi.vim.host.NtpConfig",
"pyVmomi.vim.host.DateTimeConfig",
"ansible.module_utils.vmware.vmware_argument_spec",
"ansible.module_utils._text.to_native"
] | [((6750, 6772), 'ansible.module_utils.vmware.vmware_argument_spec', 'vmware_argument_spec', ([], {}), '()\n', (6770, 6772), False, 'from ansible.module_utils.vmware import vmware_argument_spec, PyVmomi\n'), ((7066, 7165), 'ansible.module_utils.basic.AnsibleModule', 'AnsibleModule', ([], {'argument_spec': 'argument_spec... |
import numpy as np
def load_mnist():
# the data, shuffled and split between train and test sets
from keras.datasets import mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x = np.concatenate((x_train, x_test))
y = np.concatenate((y_train, y_test))
x = x.reshape(-1, 28, 28, 1).as... | [
"os.path.exists",
"keras.datasets.mnist.load_data",
"numpy.array",
"numpy.concatenate",
"os.system"
] | [((182, 199), 'keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()\n', (197, 199), False, 'from keras.datasets import mnist\n'), ((209, 242), 'numpy.concatenate', 'np.concatenate', (['(x_train, x_test)'], {}), '((x_train, x_test))\n', (223, 242), True, 'import numpy as np\n'), ((251, 284), 'numpy.concaten... |
"""
This module defines a class called "balto_gui" that can be used to
create a graphical user interface (GUI) for downloading data from
OpenDAP servers from and into a Jupyter notebook. If used with Binder,
this GUI runs in a browser window and does not require the user to
install anything on their computer. However... | [
"IPython.display.display",
"ipywidgets.VBox",
"ipywidgets.Dropdown",
"ipyleaflet.FullScreenControl",
"ipywidgets.BoundedIntText",
"datetime.timedelta",
"copy.copy",
"numpy.arange",
"ipywidgets.HBox",
"datetime.datetime",
"ipywidgets.Button",
"balto_plot.show_grid_as_image",
"ipywidgets.Outpu... | [((7936, 7952), 'ipywidgets.Output', 'widgets.Output', ([], {}), '()\n', (7950, 7952), True, 'import ipywidgets as widgets\n'), ((7961, 7990), 'IPython.display.display', 'display', (['self.gui', 'gui_output'], {}), '(self.gui, gui_output)\n', (7968, 7990), False, 'from IPython.display import display, HTML\n'), ((9529, ... |
import multiprocessing as mp
import os
import shutil
from functools import partial
from tqdm import tqdm
import data
from chemhelp import mndo
# def calculate(binary, filename, scr=None):
# """
# Collect sets of lines for each molecule as they become available
# and then call a parser to extract the dict... | [
"os.path.exists",
"os.path.join",
"functools.partial",
"chemhelp.mndo.calculate_file",
"os.getpid",
"shutil.rmtree",
"multiprocessing.Pool",
"os.mkdir",
"data.set_params"
] | [((982, 1014), 'functools.partial', 'partial', (['worker'], {}), '(worker, **worker_kwargs)\n', (989, 1014), False, 'from functools import partial\n'), ((1720, 1731), 'os.getpid', 'os.getpid', ([], {}), '()\n', (1729, 1731), False, 'import os\n'), ((2022, 2097), 'data.set_params', 'data.set_params', (['param_list', 'pa... |
# -*- coding: utf-8 -*- #
# Copyright 2016 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | [
"googlecloudsdk.calliope.exceptions.InvalidArgumentException",
"apitools.base.py.list_pager.YieldFromList",
"googlecloudsdk.api_lib.logging.util.GetClient",
"googlecloudsdk.core.properties.VALUES.core.project.Get"
] | [((2509, 2525), 'googlecloudsdk.api_lib.logging.util.GetClient', 'util.GetClient', ([], {}), '()\n', (2523, 2525), False, 'from googlecloudsdk.api_lib.logging import util\n'), ((2767, 2906), 'apitools.base.py.list_pager.YieldFromList', 'list_pager.YieldFromList', (['client.entries', 'request'], {'field': '"""entries"""... |
__author__ = 'stephen'
import numpy as np
import scipy.io
import scipy.sparse
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import matplotlib.pylab as pylab
from .utils import get_subindices
import matplotlib.ticker as mtick
from collections import Counter
from s... | [
"numpy.log10",
"matplotlib.pyplot.ylabel",
"numpy.log",
"numpy.argsort",
"numpy.array",
"numpy.arange",
"matplotlib.pyplot.imshow",
"scipy.stats.gaussian_kde",
"numpy.where",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.max",
"matplotlib.pyplot.close",
"matplotlib.pyplot.co... | [((96, 117), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (110, 117), False, 'import matplotlib\n'), ((818, 835), 'numpy.unique', 'np.unique', (['labels'], {}), '(labels)\n', (827, 835), True, 'import numpy as np\n'), ((840, 863), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {'size': '(10... |
import cv2
import numpy as np
def drawPoint(canvas,x,y):
canvas[y,x] = 0
def drawLine(canvas,x1,y1,x2,y2):
dx, dy = abs(x2 - x1), abs(y2 - y1)
xi, yi = x1, y1
sx, sy = 1 if (x2 - x1) > 0 else -1, 1 if (y2 - y1) > 0 else -1
pi = 2*dy - dx
while xi != x2 + 1:
if pi < 0:
pi +... | [
"cv2.imwrite",
"numpy.ones"
] | [((2335, 2366), 'cv2.imwrite', 'cv2.imwrite', (['"""line.png"""', 'canvas'], {}), "('line.png', canvas)\n", (2346, 2366), False, 'import cv2\n'), ((2460, 2493), 'cv2.imwrite', 'cv2.imwrite', (['"""circle.png"""', 'canvas'], {}), "('circle.png', canvas)\n", (2471, 2493), False, 'import cv2\n'), ((2592, 2626), 'cv2.imwri... |
from __future__ import absolute_import, unicode_literals
import unittest
from fluent.runtime import FluentBundle
from fluent.runtime.errors import FluentCyclicReferenceError, FluentReferenceError
from ..utils import dedent_ftl
class TestPlaceables(unittest.TestCase):
def setUp(self):
self.ctx = FluentB... | [
"fluent.runtime.FluentBundle",
"fluent.runtime.errors.FluentCyclicReferenceError",
"fluent.runtime.errors.FluentReferenceError"
] | [((313, 357), 'fluent.runtime.FluentBundle', 'FluentBundle', (["['en-US']"], {'use_isolating': '(False)'}), "(['en-US'], use_isolating=False)\n", (325, 357), False, 'from fluent.runtime import FluentBundle\n'), ((4043, 4086), 'fluent.runtime.FluentBundle', 'FluentBundle', (["['en-US']"], {'use_isolating': '(True)'}), "... |
import pytest
from brownie import Wei
@pytest.fixture(scope="function", autouse=True)
def shared_setup(fn_isolation):
pass
@pytest.fixture(scope='module')
def nocoiner(accounts, lido):
assert lido.balanceOf(accounts[9]) == 0
return accounts[9]
@pytest.fixture(scope='module')
def ape(accounts):
ret... | [
"pytest.fixture",
"brownie.Wei"
] | [((41, 87), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""', 'autouse': '(True)'}), "(scope='function', autouse=True)\n", (55, 87), False, 'import pytest\n'), ((132, 162), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (146, 162), False, 'import pytest\n')... |
from codecs import open as codecs_open
from setuptools import setup, find_packages
# Get the long description from the relevant file
with codecs_open('README.rst', encoding='utf-8') as f:
long_description = f.read()
setup(name='fio_taxa',
version='1.0.0',
description=u"Classification of GeoJSON feat... | [
"codecs.open",
"setuptools.find_packages"
] | [((140, 183), 'codecs.open', 'codecs_open', (['"""README.rst"""'], {'encoding': '"""utf-8"""'}), "('README.rst', encoding='utf-8')\n", (151, 183), True, 'from codecs import open as codecs_open\n'), ((549, 605), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['ez_setup', 'examples', 'tests']"}), "(exclud... |
import requests
import json
class test(object):
def __init__(self):
self._debug = False
self._http_debug = False
self._https = True
self._session = requests.session() # use single session for all requests
def update_csrf(self):
# Retrieve server csrf and update session's he... | [
"requests.session"
] | [((177, 195), 'requests.session', 'requests.session', ([], {}), '()\n', (193, 195), False, 'import requests\n')] |
import numpy as np
import numpy.matlib
# soma das matrizes
A = np.array([[1,0],[0,2]])
B = np.array([[0,1],[1,0]])
C = A + B
print(C)
# soma das linhas
A = np.array([[1,0],[0,2]])
B = np.array([[0,1],[1,0]])
s_linha = sum(A)
print(s_linha)
# soma dos elementos
A = np.array([[1,0],[0,2]])
B = np.array([[0,1],[1,0]]... | [
"numpy.array",
"numpy.linalg.matrix_power",
"numpy.matmul",
"numpy.linalg.det"
] | [((66, 92), 'numpy.array', 'np.array', (['[[1, 0], [0, 2]]'], {}), '([[1, 0], [0, 2]])\n', (74, 92), True, 'import numpy as np\n'), ((94, 120), 'numpy.array', 'np.array', (['[[0, 1], [1, 0]]'], {}), '([[0, 1], [1, 0]])\n', (102, 120), True, 'import numpy as np\n'), ((161, 187), 'numpy.array', 'np.array', (['[[1, 0], [0... |
import sys, requests, json, time
METRIC_NAME = "builtin:billing.ddu.metrics.byEntity"
PAGE_SIZE = 500
sys.tracebacklimit = 0
# python .\dduConsumptionPerMZ.py 2020-08-01T12:00:00+02:00 2020-08-10T12:00:00+02:00 https://mySampleEnv.live.dynatrace.com/api/ abcdefghijklmnop 60
# python .\dduConsumptionPerMZ.py 2020-08-0... | [
"json.dumps",
"json.loads",
"time.sleep",
"requests.get"
] | [((1509, 1619), 'requests.get', 'requests.get', (["(BASE_URL + 'config/v1/managementZones')"], {'headers': "{'Authorization': 'Api-Token ' + API_TOKEN}"}), "(BASE_URL + 'config/v1/managementZones', headers={\n 'Authorization': 'Api-Token ' + API_TOKEN})\n", (1521, 1619), False, 'import sys, requests, json, time\n'),... |
import numpy as np
import scipy
import matplotlib.pyplot as plt
import sys
def compute_r_squared(data, predictions):
'''
In exercise 5, we calculated the R^2 value for you. But why don't you try and
and calculate the R^2 value yourself.
Given a list of original data points, and also a li... | [
"numpy.sum"
] | [((804, 837), 'numpy.sum', 'np.sum', (['((data - predictions) ** 2)'], {}), '((data - predictions) ** 2)\n', (810, 837), True, 'import numpy as np\n'), ((849, 875), 'numpy.sum', 'np.sum', (['((data - mean) ** 2)'], {}), '((data - mean) ** 2)\n', (855, 875), True, 'import numpy as np\n')] |