code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
""" The base for all plugins to derive from. It also implements an auto registering pattern so that the plugins do not have to explicitly register. """ import abc from marshmallow_jsonschema import JSONSchema from Lego.Datatypes import InputParams from .decorators import check_chart_configuration from .decorators im...
[ "Lego.Datatypes.InputParams", "marshmallow_jsonschema.JSONSchema" ]
[((812, 825), 'Lego.Datatypes.InputParams', 'InputParams', ([], {}), '()\n', (823, 825), False, 'from Lego.Datatypes import InputParams\n'), ((2971, 2983), 'marshmallow_jsonschema.JSONSchema', 'JSONSchema', ([], {}), '()\n', (2981, 2983), False, 'from marshmallow_jsonschema import JSONSchema\n')]
#!/usr/bin/env python # # Copyright (c) 2021 <NAME> # URL: https://github.com/jamescherti/monitor-xfconf-changes/ # # Distributed under terms of the MIT license. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to de...
[ "lxml.etree.parse", "psutil.process_iter", "os.kill", "pathlib.Path" ]
[((3012, 3033), 'psutil.process_iter', 'psutil.process_iter', ([], {}), '()\n', (3031, 3033), False, 'import psutil\n'), ((3366, 3416), 'pathlib.Path', 'Path', (['"""~/.config/xfce4/xfconf/xfce-perchannel-xml"""'], {}), "('~/.config/xfce4/xfconf/xfce-perchannel-xml')\n", (3370, 3416), False, 'from pathlib import Path\n...
# ========================================================================================================================================================== #import the libraries # ====================================================================...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "tweepy.API", "matplotlib.pyplot.bar", "matplotlib.pyplot.ylabel", "tweepy.OAuthHandler", "matplotlib.pyplot.xticks", "re.sub" ]
[((1481, 1524), 'tweepy.OAuthHandler', 'OAuthHandler', (['consumer_key', 'consumer_secret'], {}), '(consumer_key, consumer_secret)\n', (1493, 1524), False, 'from tweepy import OAuthHandler\n'), ((1582, 1610), 'tweepy.API', 'tweepy.API', (['auth'], {'timeout': '(10)'}), '(auth, timeout=10)\n', (1592, 1610), False, 'impo...
import pygame, sys from pygame.locals import * from math import cos, sin, sqrt, tan, pi # Initialize pygame pygame.init() pygame.display.set_caption('Calculator') clock = pygame.time.Clock() SURF = pygame.display.set_mode((450, 550)) font = pygame.font.SysFont(None, 30) calc = pygame.font.SysFont('ocraextended', 25) ...
[ "pygame.quit", "pygame.font.SysFont", "pygame.event.get", "pygame.display.set_mode", "pygame.draw.rect", "pygame.Rect", "pygame.init", "pygame.key.get_mods", "pygame.key.name", "pygame.display.update", "pygame.display.set_caption", "pygame.time.Clock", "sys.exit" ]
[((110, 123), 'pygame.init', 'pygame.init', ([], {}), '()\n', (121, 123), False, 'import pygame, sys\n'), ((124, 164), 'pygame.display.set_caption', 'pygame.display.set_caption', (['"""Calculator"""'], {}), "('Calculator')\n", (150, 164), False, 'import pygame, sys\n'), ((173, 192), 'pygame.time.Clock', 'pygame.time.Cl...
from django import forms from django.forms import ModelForm from models import Venue, Location from django.forms.models import inlineformset_factory class VenueForm(ModelForm): def clean(self): super(VenueForm, self).clean() #I would always do this for forms. return self.cleaned_data full_add...
[ "django.forms.CharField" ]
[((327, 396), 'django.forms.CharField', 'forms.CharField', ([], {'label': '"""Full Address"""', 'help_text': '"""Type a new address"""'}), "(label='Full Address', help_text='Type a new address')\n", (342, 396), False, 'from django import forms\n'), ((421, 490), 'django.forms.CharField', 'forms.CharField', ([], {'label'...
#! /usr/bin/env python # -*- coding: utf-8 -*- from flask_script import Manager from flask_migrate import Migrate, MigrateCommand import sys from app import initialize manager = Manager(initialize.web_app) def register_migrate(manager): from app import models migrate = Migrate(initialize.web_app, models.db...
[ "flask_script.Manager", "flask_migrate.Migrate" ]
[((181, 208), 'flask_script.Manager', 'Manager', (['initialize.web_app'], {}), '(initialize.web_app)\n', (188, 208), False, 'from flask_script import Manager\n'), ((283, 321), 'flask_migrate.Migrate', 'Migrate', (['initialize.web_app', 'models.db'], {}), '(initialize.web_app, models.db)\n', (290, 321), False, 'from fla...
from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators from eth2spec.phase0 import spec as spec_phase0 from eth2spec.altair import spec as spec_altair from eth2spec.merge import spec as spec_merge from eth2spec.test.helpers.constants import PHASE0, ALTAIR, MERGE specs = (spec_phase0, spec_altai...
[ "eth2spec.gen_helpers.gen_from_tests.gen.run_state_test_generators" ]
[((717, 803), 'eth2spec.gen_helpers.gen_from_tests.gen.run_state_test_generators', 'run_state_test_generators', ([], {'runner_name': '"""finality"""', 'specs': 'specs', 'all_mods': 'all_mods'}), "(runner_name='finality', specs=specs, all_mods=\n all_mods)\n", (742, 803), False, 'from eth2spec.gen_helpers.gen_from_te...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'detect.ui' # # Created by: PyQt5 UI code generator 5.12 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow...
[ "PyQt5.QtWidgets.QLabel", "PyQt5.QtWidgets.QWidget", "PyQt5.QtCore.QRect", "PyQt5.QtWidgets.QStatusBar", "PyQt5.QtWidgets.QPushButton", "PyQt5.QtCore.QMetaObject.connectSlotsByName", "PyQt5.QtWidgets.QMenuBar" ]
[((414, 443), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['MainWindow'], {}), '(MainWindow)\n', (431, 443), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((527, 568), 'PyQt5.QtWidgets.QPushButton', 'QtWidgets.QPushButton', (['self.centralwidget'], {}), '(self.centralwidget)\n', (548, 568), False, 'from ...
import argparse import math_lib as ml parser = argparse.ArgumentParser(description='do math') parser.add_argument('first_number', type=int, help='First Number') parser.add_argument('second_number', type=int, help='Second Number') args = parser.parse_args() if __name__ == '__main__': print(ml.add(args.first_number...
[ "math_lib.add", "argparse.ArgumentParser", "math_lib.div" ]
[((48, 94), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""do math"""'}), "(description='do math')\n", (71, 94), False, 'import argparse\n'), ((296, 341), 'math_lib.add', 'ml.add', (['args.first_number', 'args.second_number'], {}), '(args.first_number, args.second_number)\n', (302, 341),...
import cv2 import numpy as np import utils def outlineRect(image, rect, color): """used to draw a rectangle""" if rect is None: return X, y, w, h = [int(i) for i in rect] cv2.rectangle(image, (X, y), (X + w, y + h), color) def copyRect(src, dst, srcRect, dstRect, mask=None, inte...
[ "utils.isGray", "cv2.resize", "cv2.rectangle" ]
[((197, 248), 'cv2.rectangle', 'cv2.rectangle', (['image', '(X, y)', '(X + w, y + h)', 'color'], {}), '(image, (X, y), (X + w, y + h), color)\n', (210, 248), False, 'import cv2\n'), ((671, 749), 'cv2.resize', 'cv2.resize', (['src[y0:y0 + h0, x0:x0 + w0]', '(w1, h1)'], {'interpolation': 'interpolation'}), '(src[y0:y0 + ...
import pytest from ssh2net.core.cisco_iosxr.driver import IOSXRDriver, PRIVS from tests.unit.drivers.base_driver_unit_tests import BaseDriverUnitTest class TestIOSXR(BaseDriverUnitTest): def setup_method(self): self.privs = PRIVS self.driver = IOSXRDriver() def test__determine_current_priv_e...
[ "ssh2net.core.cisco_iosxr.driver.IOSXRDriver", "pytest.skip" ]
[((267, 280), 'ssh2net.core.cisco_iosxr.driver.IOSXRDriver', 'IOSXRDriver', ([], {}), '()\n', (278, 280), False, 'from ssh2net.core.cisco_iosxr.driver import IOSXRDriver, PRIVS\n'), ((339, 380), 'pytest.skip', 'pytest.skip', (['"""no privilege exec on iosxr"""'], {}), "('no privilege exec on iosxr')\n", (350, 380), Fal...
import json,sys,io,os from argparse import ArgumentParser from elasticsearch import Elasticsearch from argparse import ArgumentParser def main(): parser = ArgumentParser() parser.add_argument("-d", "--data", dest="data", help="path to dataset", metavar="DATA") parser.add_argument("-i", "--index", dest="index", help...
[ "elasticsearch.Elasticsearch", "json.load", "argparse.ArgumentParser", "os.path.normpath", "io.open", "os.scandir" ]
[((157, 173), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (171, 173), False, 'from argparse import ArgumentParser\n'), ((466, 505), 'elasticsearch.Elasticsearch', 'Elasticsearch', (["['localhost']"], {'port': '(9200)'}), "(['localhost'], port=9200)\n", (479, 505), False, 'from elasticsearch import El...
""" SC101 - Assignment3 Adapted from <NAME>'s Ghost assignment by <NAME>. ----------------------------------------------- This code helps users combine the photos to get a best photo. """ import os import sys from simpleimage import SimpleImage def get_pixel_dist(pixel, red, green, blue): """ Returns the sq...
[ "simpleimage.SimpleImage", "os.path.join", "os.listdir", "simpleimage.SimpleImage.blank" ]
[((3154, 3186), 'simpleimage.SimpleImage.blank', 'SimpleImage.blank', (['width', 'height'], {}), '(width, height)\n', (3171, 3186), False, 'from simpleimage import SimpleImage\n'), ((4288, 4303), 'os.listdir', 'os.listdir', (['dir'], {}), '(dir)\n', (4298, 4303), False, 'import os\n'), ((4887, 4908), 'simpleimage.Simpl...
from clean_architecture_basic_classes.basic_domain.basic_value import \ BasicValue from marshmallow import Schema, fields from uuid import uuid4 def missing_id(): return str(uuid4()) class BasicEntity(BasicValue): def __init__(self, entity_id=None): self.entity_id = entity_id or str(uuid4()) ...
[ "uuid.uuid4", "marshmallow.fields.String" ]
[((184, 191), 'uuid.uuid4', 'uuid4', ([], {}), '()\n', (189, 191), False, 'from uuid import uuid4\n'), ((853, 919), 'marshmallow.fields.String', 'fields.String', ([], {'required': '(False)', 'allow_none': '(True)', 'missing': 'missing_id'}), '(required=False, allow_none=True, missing=missing_id)\n', (866, 919), False, ...
# Generated by Django 3.2.7 on 2021-10-21 21:51 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ('file_manager', '0038_auto_20211021_1513'), ] operations ...
[ "django.db.models.ForeignKey", "django.db.models.PositiveIntegerField", "django.db.models.ManyToManyField" ]
[((438, 559), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.PROTECT', 'to': '"""contenttypes.contenttype"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.PROTECT, to='contenttypes.contenttype')\n", (455, 55...
from __future__ import annotations import time from datetime import datetime, timezone from lazy.models.timez import TimeCls from .config import TimeZoneConfigz from .base_imports import * def _require_pytz(): pytz = Lib.import_lib('pytz') Lib.reload_module(pytz) def _require_dateparser(): dateparser = ...
[ "datetime.datetime.fromisoformat", "time.time", "pytz.timezone", "dateparser.parse", "datetime.datetime.now" ]
[((439, 477), 'pytz.timezone', 'pytz.timezone', (['TimeZoneConfigz.desired'], {}), '(TimeZoneConfigz.desired)\n', (452, 477), False, 'import pytz\n'), ((497, 517), 'pytz.timezone', 'pytz.timezone', (['"""UTC"""'], {}), "('UTC')\n", (510, 517), False, 'import pytz\n'), ((747, 761), 'datetime.datetime.now', 'datetime.now...
#!/usr/bin/env python3 # coding=utf-8 from rdflib import Graph, Namespace, URIRef, BNode, Literal, RDF from rdflib.namespace import SKOS, XSD, OWL, DC from rdflib.namespace import DCTERMS as DCT from SPARQLWrapper import SPARQLWrapper, SPARQLExceptions import socket import time from pymarc import Record, Field, XMLWri...
[ "pickle.dump", "argparse.ArgumentParser", "pymarc.Field", "logging.Formatter", "os.path.isfile", "pickle.load", "urllib.parse.urlparse", "unicodedata.normalize", "logging.error", "logging.warning", "os.path.exists", "urllib.request.urlopen", "lxml.etree.XMLParser", "datetime.timedelta", ...
[((1435, 1475), 'rdflib.Namespace', 'Namespace', (['"""http://www.yso.fi/onto/yso/"""'], {}), "('http://www.yso.fi/onto/yso/')\n", (1444, 1475), False, 'from rdflib import Graph, Namespace, URIRef, BNode, Literal, RDF\n'), ((1484, 1529), 'rdflib.Namespace', 'Namespace', (['"""http://www.yso.fi/onto/yso-meta/"""'], {}),...
from django.conf.urls import url from common import views urlpatterns = [ url(r'^$', views.index, name='home'), url(r'^disciplines/?$', views.disciplines_index, name='disciplines.index'), url(r'^disciplines/new$', views.DisciplineCreateView.as_view(), name='disciplines.new'), url(r'^disciplin...
[ "common.views.PerformanceDetailView.as_view", "common.views.DisciplineCreateView.as_view", "common.views.PerformanceUpdateView.as_view", "common.views.PerformanceDeleteView.as_view", "common.views.DisciplineUpdateView.as_view", "django.conf.urls.url", "common.views.PerformanceCreateView.as_view", "com...
[((80, 115), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.index'], {'name': '"""home"""'}), "('^$', views.index, name='home')\n", (83, 115), False, 'from django.conf.urls import url\n'), ((123, 196), 'django.conf.urls.url', 'url', (['"""^disciplines/?$"""', 'views.disciplines_index'], {'name': '"""disciplines.in...
""" pylint-server ---- A small Flask application to keep keep track of pylint reports and ratings on a per-repository basis. """ from setuptools import setup setup( name='pylint-server', version='0.1', url='https://github.com/drivet/pylint-server/', license='MIT', author='<NAME>', author_emai...
[ "setuptools.setup" ]
[((161, 947), 'setuptools.setup', 'setup', ([], {'name': '"""pylint-server"""', 'version': '"""0.1"""', 'url': '"""https://github.com/drivet/pylint-server/"""', 'license': '"""MIT"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'description': '"""A Flask application to keep keep track of pylint informat...
""":mod:`sqlalchemy_imageattach.store` --- Image storage backend interface ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module declares a common interface for physically agnostic storage backends. Whatever a way to implement a storage, it needs only common operations of the interfac...
[ "io.BytesIO", "shutil.copyfileobj" ]
[((10120, 10132), 'io.BytesIO', 'io.BytesIO', ([], {}), '()\n', (10130, 10132), False, 'import io\n'), ((10149, 10174), 'shutil.copyfileobj', 'shutil.copyfileobj', (['f', 'f2'], {}), '(f, f2)\n', (10167, 10174), False, 'import shutil\n')]
import tensorflow as tf import numpy as np import os SCRIPT_PATH = os.path.abspath(__file__) SCRIPT_DIR = os.path.dirname(SCRIPT_PATH) MODEL_PATH = os.path.join(SCRIPT_DIR, "model/model.h5") MODEL = None INPUT_SIZE = 7 * 12 OUTPUT_SIZE = 1 def _load_model(): """ Load the TensorFlow model if it is not loaded...
[ "os.path.abspath", "tensorflow.keras.models.load_model", "numpy.log", "os.path.dirname", "numpy.array", "numpy.exp", "os.path.join" ]
[((68, 93), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (83, 93), False, 'import os\n'), ((107, 135), 'os.path.dirname', 'os.path.dirname', (['SCRIPT_PATH'], {}), '(SCRIPT_PATH)\n', (122, 135), False, 'import os\n'), ((149, 191), 'os.path.join', 'os.path.join', (['SCRIPT_DIR', '"""model/mo...
#!/usr/bin/python3 import json import os import shutil import sys import time def main(config_file="/etc/ogkeeper/config.json"): with open(config_file, 'r') as f: content = ''.join(f.readlines()) config = json.loads(content) time.sleep(int(config["countdownInMinutesNotFloatingpoint"])*60) fo...
[ "shutil.copyfileobj", "json.loads" ]
[((223, 242), 'json.loads', 'json.loads', (['content'], {}), '(content)\n', (233, 242), False, 'import json\n'), ((463, 493), 'shutil.copyfileobj', 'shutil.copyfileobj', (['fsrc', 'fdst'], {}), '(fsrc, fdst)\n', (481, 493), False, 'import shutil\n')]
import os import cv2 import numpy as np from tensorflow.keras.layers import * import tensorflow as tf from tensorflow.keras.layers import add from tensorflow.keras.models import Model import tensorflow.keras.backend as K from tensorflow.keras.preprocessing.image import load_img,img_to_array from tensorflow.keras.optimi...
[ "tensorflow.depth_to_space" ]
[((1576, 1623), 'tensorflow.depth_to_space', 'tf.depth_to_space', (['imag', 'block_size'], {'name': 'names'}), '(imag, block_size, name=names)\n', (1593, 1623), True, 'import tensorflow as tf\n')]
# Generated by command write_metadata_files version 1 from metadata.models import Xrt from .base_metadata import BaseMetadataResource __all__ = ['XrtResource'] class XrtResource(BaseMetadataResource): '''RESTful resource for model Xrt''' class Meta(BaseMetadataResource.Meta): abstract = False queryset = Xrt....
[ "metadata.models.Xrt.objects.all" ]
[((316, 333), 'metadata.models.Xrt.objects.all', 'Xrt.objects.all', ([], {}), '()\n', (331, 333), False, 'from metadata.models import Xrt\n')]
"""webOS Smart TV trigger dispatcher.""" from __future__ import annotations from typing import cast from homeassistant.components.automation import ( AutomationActionType, AutomationTriggerInfo, ) from homeassistant.const import CONF_PLATFORM from homeassistant.core import CALLBACK_TYPE, HomeAssistant from ho...
[ "typing.cast" ]
[((831, 888), 'typing.cast', 'cast', (['TriggersPlatformModule', 'TRIGGERS[platform_split[1]]'], {}), '(TriggersPlatformModule, TRIGGERS[platform_split[1]])\n', (835, 888), False, 'from typing import cast\n')]
""" ModelFit.py Author: <NAME> Affiliation: University of Colorado at Boulder Created on: Mon May 12 14:01:29 MDT 2014 Description: """ import signal import numpy as np from ..util.PrintInfo import print_fit from ..util.Pickling import write_pickle_file from ..physics.Constants import nu_0_mhz import gc, os, sys,...
[ "numpy.zeros_like", "numpy.log", "numpy.isnan", "numpy.array", "numpy.interp", "re.search" ]
[((1966, 1982), 'numpy.array', 'np.array', (['(nu + T)'], {}), '(nu + T)\n', (1974, 1982), True, 'import numpy as np\n'), ((2066, 2126), 'numpy.interp', 'np.interp', (['self.xdata', "sim.history['nu']", "sim.history['dTb']"], {}), "(self.xdata, sim.history['nu'], sim.history['dTb'])\n", (2075, 2126), True, 'import nump...
"""Functions to manage Abaqus objects and actions internally. Intended to be used by the Abaqus CAE Python interpreter. Developed by <NAME>. https://github.com/rodrigo1392 """ from abaqus import * from abaqusConstants import * from driverUtils import * import odbAccess # Flexibilize for Abaqus viewer try: from c...
[ "tools_submodule.filesystem_tools.list_files_with_extension", "abaqusMacros.close_all_odbs", "os.path.basename", "os.rename", "odbAccess.isUpgradeRequiredForOdb", "os.path.join" ]
[((5329, 5441), 'tools_submodule.filesystem_tools.list_files_with_extension', 'ft.list_files_with_extension', ([], {'root_path': 'odbs_folder', 'extension': '""".odb"""', 'full_path': '(True)', 'recursively': 'recursive'}), "(root_path=odbs_folder, extension='.odb',\n full_path=True, recursively=recursive)\n", (5357...
from util import Singleton import datetime as dt import logging import pyglet from ascension.settings import AscensionConf LOG = logging.getLogger(__name__) SLOW_FRAME_MESSAGE = ( "Last execution of '{profiler_label}' lasted {time_passed}, which is over the target " "{target_time} by {time_over}!" ) REPORT_...
[ "datetime.datetime.now", "logging.getLogger", "pyglet.clock.schedule_interval" ]
[((131, 158), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (148, 158), False, 'import logging\n'), ((1098, 1115), 'datetime.datetime.now', 'dt.datetime.now', ([], {}), '()\n', (1113, 1115), True, 'import datetime as dt\n'), ((1264, 1326), 'pyglet.clock.schedule_interval', 'pyglet.clock....
import math as m def is_power_of_2(num): return num != 0 and ((num & (num - 1)) == 0) def code(num, mod): unary = num // mod reminder = num % mod code = '1' * unary + '0' print(code) if is_power_of_2(mod): bits_needed = int(m.log(mod, 2)) add_bits = bin(reminder)[2:] add_b...
[ "math.log" ]
[((255, 268), 'math.log', 'm.log', (['mod', '(2)'], {}), '(mod, 2)\n', (260, 268), True, 'import math as m\n'), ((416, 429), 'math.log', 'm.log', (['mod', '(2)'], {}), '(mod, 2)\n', (421, 429), True, 'import math as m\n'), ((1000, 1013), 'math.log', 'm.log', (['mod', '(2)'], {}), '(mod, 2)\n', (1005, 1013), True, 'impo...
""" Tools for extracting snapshots and structures from core22 FAH trajectories. Limitations: * The reference structure (`natoms_reference`) must share the same atom ordering as the first `natoms_reference` atoms of the trajectory. For now, this means that the SpruceTK prepared structure (`Mpro-x10789_0_bound-protein...
[ "functools.partial", "tempfile.TemporaryDirectory", "mdtraj.load", "openeye.oechem.oemolistream", "logging.info", "pydantic.Field", "openeye.oechem.OEWriteMolecule", "multiprocessing.Pool", "os.path.join", "joblib.Memory" ]
[((819, 915), 'pydantic.Field', 'Field', ([], {'description': '"""Path to project directory (e.g. \'/home/server/server2/projects/13422\')"""'}), '(description=\n "Path to project directory (e.g. \'/home/server/server2/projects/13422\')")\n', (824, 915), False, 'from pydantic import BaseModel, Field\n'), ((962, 1081...
"""Implements a fully blocking kernel client. Useful for test suites and blocking terminal interfaces. """ #----------------------------------------------------------------------------- # Copyright (C) 2013 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # th...
[ "IPython.utils.traitlets.Type" ]
[((1139, 1165), 'IPython.utils.traitlets.Type', 'Type', (['BlockingShellChannel'], {}), '(BlockingShellChannel)\n', (1143, 1165), False, 'from IPython.utils.traitlets import Type\n'), ((1192, 1218), 'IPython.utils.traitlets.Type', 'Type', (['BlockingIOPubChannel'], {}), '(BlockingIOPubChannel)\n', (1196, 1218), False, ...
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np #! [auto_compilation] import openvino.runtime as ov compiled_model = ov.compile_model("model.xml") #! [auto_compilation] #! [properties_example] core = ov.Core() input_a = ov.opset8.parameter([8]) res = ov.opset8.a...
[ "openvino.runtime.opset8.parameter", "openvino.runtime.Core", "numpy.array_equal", "openvino.runtime.opset8.absolute", "openvino.runtime.Model", "openvino.runtime.opset8.add", "numpy.ones", "numpy.expand_dims", "openvino.runtime.AsyncInferQueue", "openvino.runtime.compile_model", "cv2.imread", ...
[((173, 202), 'openvino.runtime.compile_model', 'ov.compile_model', (['"""model.xml"""'], {}), "('model.xml')\n", (189, 202), True, 'import openvino.runtime as ov\n'), ((257, 266), 'openvino.runtime.Core', 'ov.Core', ([], {}), '()\n', (264, 266), True, 'import openvino.runtime as ov\n'), ((278, 302), 'openvino.runtime....
from fly_tello import FlyTello my_tellos = list() ''' // scenario specifique amphi MPG // position initiale : 1 2 3 4 (tous les drones à 12h) // Séparés de 1 m // TO DO : à terminer ''' # # MAIN FLIGHT CONTROL LOGIC # # Define the Tello's we're using, in the order we want them numbered my_tellos.append('0TQDG2KEDB4...
[ "fly_tello.FlyTello" ]
[((663, 699), 'fly_tello.FlyTello', 'FlyTello', (['my_tellos'], {'get_status': '(True)'}), '(my_tellos, get_status=True)\n', (671, 699), False, 'from fly_tello import FlyTello\n')]
from importlib import import_module, invalidate_caches from inspect import getmembers, isfunction from aiogram import Dispatcher, Bot from os.path import abspath from ujson import loads from os import environ import logging logging.basicConfig(level=logging.INFO, filename=".log", filemode="w+") _langs = loads(open('so...
[ "importlib.invalidate_caches", "importlib.import_module", "logging.basicConfig", "aiogram.Dispatcher", "aiogram.Bot", "inspect.getmembers" ]
[((225, 296), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'filename': '""".log"""', 'filemode': '"""w+"""'}), "(level=logging.INFO, filename='.log', filemode='w+')\n", (244, 296), False, 'import logging\n'), ((372, 413), 'aiogram.Bot', 'Bot', (["conf['API_TOKEN']"], {'parse_mode': '"""H...
from GamesKeeper.db import BaseModel from peewee import (BigIntegerField, IntegerField, TextField, BooleanField, DoesNotExist) from playhouse.postgres_ext import BinaryJSONField, ArrayField @BaseModel.register class Guild(BaseModel): guild_id = BigIntegerField(primary_key=True) owner_id = ...
[ "peewee.IntegerField", "playhouse.postgres_ext.ArrayField", "peewee.TextField", "peewee.BooleanField", "peewee.BigIntegerField" ]
[((271, 304), 'peewee.BigIntegerField', 'BigIntegerField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (286, 304), False, 'from peewee import BigIntegerField, IntegerField, TextField, BooleanField, DoesNotExist\n'), ((320, 347), 'peewee.BigIntegerField', 'BigIntegerField', ([], {'null': '(False)'}), '(null...
# -*- coding: utf-8 -*- # # Copyright (C) 2019-2021 CERN. # Copyright (C) 2019-2021 Northwestern University. # Copyright (C) 2021 <NAME>. # # Invenio App RDM is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Routes for record-rel...
[ "invenio_rdm_records.services.schemas.utils.dump_empty", "flask.current_app.config.get", "invenio_rdm_records.resources.serializers.UIJSONSerializer", "invenio_rdm_records.vocabularies.Vocabularies.dump", "invenio_rdm_records.proxies.current_rdm_records.draft_files_service.list_files" ]
[((1438, 1465), 'invenio_rdm_records.services.schemas.utils.dump_empty', 'dump_empty', (['RDMRecordSchema'], {}), '(RDMRecordSchema)\n', (1448, 1465), False, 'from invenio_rdm_records.services.schemas.utils import dump_empty\n'), ((2422, 2568), 'invenio_rdm_records.proxies.current_rdm_records.draft_files_service.list_f...
# <NAME> 2014-2020 # mlxtend Machine Learning Library Extensions # # Nonparametric Permutation Test # Author: <NAME> <<EMAIL>> # # License: BSD 3 clause import numpy as np from itertools import combinations from math import factorial try: from nose.tools import nottest except ImportError: # Use a no-op decorat...
[ "numpy.mean", "math.factorial", "numpy.random.RandomState", "numpy.hstack" ]
[((3160, 3187), 'numpy.random.RandomState', 'np.random.RandomState', (['seed'], {}), '(seed)\n', (3181, 3187), True, 'import numpy as np\n'), ((3230, 3247), 'numpy.hstack', 'np.hstack', (['(x, y)'], {}), '((x, y))\n', (3239, 3247), True, 'import numpy as np\n'), ((4453, 4469), 'math.factorial', 'factorial', (['(m + n)'...
#!/usr/bin/env python """ Simple application that logs on to the APIC and displays all EPGs. """ import socket import yaml import sys from acitoolkit import Credentials, Session, Tenant, AppProfile, EPG, Endpoint def main(): """ Main show EPGs routine :return: None """ # Login to APIC descrip...
[ "acitoolkit.Session", "acitoolkit.Tenant.get_deep", "yaml.safe_dump", "acitoolkit.Credentials", "socket.gethostbyaddr" ]
[((439, 471), 'acitoolkit.Credentials', 'Credentials', (['"""apic"""', 'description'], {}), "('apic', description)\n", (450, 471), False, 'from acitoolkit import Credentials, Session, Tenant, AppProfile, EPG, Endpoint\n'), ((509, 553), 'acitoolkit.Session', 'Session', (['args.url', 'args.login', 'args.password'], {}), ...
# OLD USAGE # python align_faces.py --shape-predictor shape_predictor_68_face_landmarks.dat --image images/example_01.jpg # import the necessary packages from imutils.face_utils import FaceAligner from PIL import Image import numpy as np # import argparse import imutils import dlib import cv2 # construct the argument...
[ "cv2.cvtColor", "PIL.Image.open", "PIL.Image.fromarray", "numpy.array", "dlib.get_frontal_face_detector", "imutils.resize", "dlib.shape_predictor", "imutils.face_utils.FaceAligner" ]
[((836, 868), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (866, 868), False, 'import dlib\n'), ((881, 942), 'dlib.shape_predictor', 'dlib.shape_predictor', (['"""shape_predictor_68_face_landmarks.dat"""'], {}), "('shape_predictor_68_face_landmarks.dat')\n", (901, 942), False, '...
from tkinter import * from tkinter.font import Font from tkinter.ttk import * from tkinter.messagebox import * #import tkinter.filedialog as tkFileDialog #import tkinter.simpledialog as tkSimpleDialog #askstring() from node.ui.access import access from node.ui.trade import trade from node.ui.post import po...
[ "node.ui.watch.watch", "node.ui.trade.trade", "node.ui.post.post", "node.ui.access.access", "node.ui.charge.charge", "node.ui.show.show" ]
[((971, 981), 'node.ui.show.show', 'show', (['self'], {}), '(self)\n', (975, 981), False, 'from node.ui.show import show\n'), ((1312, 1324), 'node.ui.access.access', 'access', (['self'], {}), '(self)\n', (1318, 1324), False, 'from node.ui.access import access\n'), ((1482, 1492), 'node.ui.post.post', 'post', (['self'], ...
#! /usr/bin/env python # encoding: utf-8 """ This script is intended to be used to automate the process of clearing configurations and reloading, via a console connection, for devices that support Cisco's IOx platform. The outcome is a device that has no startup configuration, and which has been booted from rommon-2...
[ "time.sleep" ]
[((5029, 5043), 'time.sleep', 'time.sleep', (['(60)'], {}), '(60)\n', (5039, 5043), False, 'import time\n'), ((2695, 2708), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (2705, 2708), False, 'import time\n'), ((5360, 5373), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (5370, 5373), False, 'import time\n'),...
from styx_msgs.msg import TrafficLight import cv2 import numpy as np class TLClassifier(object): def __init__(self): pass def get_classification(self, image): """Determines the color of the traffic light in the image Args: image (cv::Mat): image containing the traffic ligh...
[ "cv2.cvtColor", "cv2.countNonZero", "numpy.array", "cv2.medianBlur" ]
[((453, 477), 'cv2.medianBlur', 'cv2.medianBlur', (['image', '(3)'], {}), '(image, 3)\n', (467, 477), False, 'import cv2\n'), ((495, 536), 'cv2.cvtColor', 'cv2.cvtColor', (['img_blur', 'cv2.COLOR_BGR2HSV'], {}), '(img_blur, cv2.COLOR_BGR2HSV)\n', (507, 536), False, 'import cv2\n'), ((586, 619), 'numpy.array', 'np.array...
import pytest from botx import ( ChatCreatedEvent, InternalBotNotificationEvent, InternalBotNotificationPayload, Message, MessageBuilder, UserKinds, ) from botx.models.events import UserInChatCreated @pytest.fixture() def incoming_message(host, bot_id): builder = MessageBuilder() buil...
[ "botx.models.events.UserInChatCreated", "botx.MessageBuilder", "pytest.fixture", "botx.InternalBotNotificationPayload" ]
[((228, 244), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (242, 244), False, 'import pytest\n'), ((399, 415), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (413, 415), False, 'import pytest\n'), ((514, 530), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (528, 530), False, 'import pytest\n'), (...
# -*- coding: utf-8 -*- # Copyright 2016 Yelp Inc. # # 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 ag...
[ "kafka.SimpleConsumer", "data_pipeline.message.create_from_offset_and_message", "data_pipeline.config.get_config" ]
[((929, 941), 'data_pipeline.config.get_config', 'get_config', ([], {}), '()\n', (939, 941), False, 'from data_pipeline.config import get_config\n'), ((2596, 2662), 'kafka.SimpleConsumer', 'SimpleConsumer', (['kafka', 'group', 'topic'], {'max_buffer_size': '_ONE_MEGABYTE'}), '(kafka, group, topic, max_buffer_size=_ONE_...
import jpype jpype.addClassPath('./lib/NeqSim.jar') if not(jpype.isJVMStarted()): jpype.startJVM(convertStrings =True) neqsim = jpype.JPackage('neqsim')
[ "jpype.startJVM", "jpype.isJVMStarted", "jpype.addClassPath", "jpype.JPackage" ]
[((13, 51), 'jpype.addClassPath', 'jpype.addClassPath', (['"""./lib/NeqSim.jar"""'], {}), "('./lib/NeqSim.jar')\n", (31, 51), False, 'import jpype\n'), ((133, 157), 'jpype.JPackage', 'jpype.JPackage', (['"""neqsim"""'], {}), "('neqsim')\n", (147, 157), False, 'import jpype\n'), ((59, 79), 'jpype.isJVMStarted', 'jpype.i...
# Generated by Django 4.0.1 on 2022-05-09 17:09 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
[ "django.db.models.FileField", "django.db.models.TextField", "django.db.migrations.swappable_dependency", "django.db.models.ForeignKey", "django.db.models.BigAutoField", "django.db.models.CharField", "django.db.models.BooleanField", "django.db.models.ImageField", "django.db.models.DecimalField", "d...
[((247, 304), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (278, 304), False, 'from django.db import migrations, models\n'), ((3512, 3613), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', '...
from django.db import models from django.utils import timezone from django.contrib.auth.models import User from yahoo_finance import Share class Customer(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=200) cust_number = models.IntegerField(blank=False, null=Fals...
[ "django.db.models.CharField", "django.db.models.ForeignKey", "django.utils.timezone.now", "django.db.models.EmailField", "django.db.models.IntegerField", "django.db.models.DecimalField", "yahoo_finance.Share", "django.db.models.DateField", "django.db.models.DateTimeField" ]
[((181, 212), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50)\n', (197, 212), False, 'from django.db import models\n'), ((227, 259), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (243, 259), False, 'from django.db ...
#------------------------------------------------------------------------------- # Author: <NAME> <<EMAIL>> # Date: 22.01.2018 # # Licensed under the 3-Clause BSD License, see the LICENSE file for details. #------------------------------------------------------------------------------- import requests import urllib3...
[ "requests.auth.HTTPDigestAuth", "requests.get", "requests.post", "scrapy_do.client.ClientException", "urllib3.disable_warnings" ]
[((1329, 1396), 'urllib3.disable_warnings', 'urllib3.disable_warnings', (['urllib3.exceptions.InsecureRequestWarning'], {}), '(urllib3.exceptions.InsecureRequestWarning)\n', (1353, 1396), False, 'import urllib3\n'), ((1438, 1459), 'requests.auth.HTTPDigestAuth', 'HTTPDigestAuth', (['*auth'], {}), '(*auth)\n', (1452, 14...
""" Script to compute dci score of learned representation. """ import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import numpy as np from absl import flags, app from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from disentanglement_lib.eva...
[ "numpy.load", "sklearn.preprocessing.StandardScaler", "numpy.sum", "numpy.invert", "sklearn.model_selection.train_test_split", "numpy.ones", "numpy.arange", "absl.flags.DEFINE_list", "os.path.join", "warnings.simplefilter", "disentanglement_lib.visualize.visualize_scores.heat_square", "absl.fl...
[((79, 141), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), "(action='ignore', category=FutureWarning)\n", (100, 141), False, 'import warnings\n'), ((438, 509), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""c_path"""', '""""""', '"""File path ...
import json import os import requests def test_server_loaded_notebooks(notebook_server): name = "/example-jupyter-notebooks.git/01-MPI-monte-carlo-pi.ipynb" resp = requests.get( "{}/templates/names".format(notebook_server), ) assert resp.status_code == 200, resp.content assert resp.json(...
[ "os.path.dirname", "json.loads" ]
[((668, 695), 'json.loads', 'json.loads', (["data['content']"], {}), "(data['content'])\n", (678, 695), False, 'import json\n'), ((751, 776), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (766, 776), False, 'import os\n')]
# coding: utf-8 """ SCORM Cloud Rest API REST API used for SCORM Cloud integrations. OpenAPI spec version: 2.0 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class XapiActivityDefinition(obje...
[ "six.iteritems" ]
[((9146, 9175), 'six.iteritems', 'iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (9155, 9175), False, 'from six import iteritems\n')]
import io from os.path import abspath, dirname, join from setuptools import setup, find_packages from dcspy.dcs_g13 import __version__ here = abspath(dirname(__file__)) with io.open(join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() with io.open(join(here, 'requirements.txt'), encodin...
[ "os.path.dirname", "os.path.join", "setuptools.find_packages" ]
[((153, 170), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (160, 170), False, 'from os.path import abspath, dirname, join\n'), ((186, 209), 'os.path.join', 'join', (['here', '"""README.md"""'], {}), "(here, 'README.md')\n", (190, 209), False, 'from os.path import abspath, dirname, join\n'), ((281, ...
import os import save_figures as fig from data_reader import DataReader def merge_results(path): sorted_files = sorted(os.listdir(path + 'left')) rebuilt_img = [] dr = DataReader() for file_name in sorted_files: print('') l_img = dr.load_pandas(path + 'left/' + file_name) c_img = dr.lo...
[ "data_reader.DataReader", "os.listdir" ]
[((182, 194), 'data_reader.DataReader', 'DataReader', ([], {}), '()\n', (192, 194), False, 'from data_reader import DataReader\n'), ((127, 152), 'os.listdir', 'os.listdir', (["(path + 'left')"], {}), "(path + 'left')\n", (137, 152), False, 'import os\n')]
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Li...
[ "json.dumps" ]
[((1229, 1301), 'json.dumps', 'json.dumps', (['self'], {'default': '(lambda x: x.__dict__)', 'sort_keys': '(True)', 'indent': '(4)'}), '(self, default=lambda x: x.__dict__, sort_keys=True, indent=4)\n', (1239, 1301), False, 'import json\n'), ((1511, 1583), 'json.dumps', 'json.dumps', (['self'], {'default': '(lambda x: ...
import numpy as np import math as math import cv2 def get_ideal_low_pass_filter( shape, cutoff,width): [h, w] = shape mask_image = np.zeros((h, w)) for i in range(h): for j in range(w): distance = math.sqrt((i - (h / 2)) * (i - (h / 2)) + (j - (w / 2)) * (j - (w / 2))) if...
[ "numpy.fft.ifftshift", "numpy.absolute", "math.exp", "math.sqrt", "numpy.zeros", "numpy.shape", "numpy.min", "numpy.max", "numpy.fft.fftshift", "numpy.fft.fft2", "numpy.fft.ifft2" ]
[((143, 159), 'numpy.zeros', 'np.zeros', (['(h, w)'], {}), '((h, w))\n', (151, 159), True, 'import numpy as np\n'), ((747, 763), 'numpy.zeros', 'np.zeros', (['(h, w)'], {}), '((h, w))\n', (755, 763), True, 'import numpy as np\n'), ((1395, 1411), 'numpy.zeros', 'np.zeros', (['(h, w)'], {}), '((h, w))\n', (1403, 1411), T...
from algoliasearch_django import AlgoliaIndex from algoliasearch_django.decorators import register from .models import Product @register(Product) class ProductIndex(AlgoliaIndex): fields = ('product_name', 'model_no', 'product_category', 'product_details', 'slug', 'main_product_image')
[ "algoliasearch_django.decorators.register" ]
[((135, 152), 'algoliasearch_django.decorators.register', 'register', (['Product'], {}), '(Product)\n', (143, 152), False, 'from algoliasearch_django.decorators import register\n')]
from setuptools import setup setup(name='pyffe', version='0.1', description='Tools and utils for PyCaffe', # url='http://github.com/fabiocarrara/pyffe', author='<NAME>', author_email='<EMAIL>', license='MIT', packages=['pyffe', 'pyffe.models'], zip_safe=False, requ...
[ "setuptools.setup" ]
[((30, 289), 'setuptools.setup', 'setup', ([], {'name': '"""pyffe"""', 'version': '"""0.1"""', 'description': '"""Tools and utils for PyCaffe"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""MIT"""', 'packages': "['pyffe', 'pyffe.models']", 'zip_safe': '(False)', 'requires': "['functools32...
""" dronekit-sitl copter --home=-38.7460967,-72.6154299,0,180 mavproxy.py --master tcp:127.0.0.1:5760 --out udp:127.0.0.1:14550 --out udp:127.0.0.1:14551 mission planner en puerto udp:14550 dronekit en puerto udp:14551 https://github.com/ArduPilot/MAVProxy/issues/543 """ # from pymavlink import mavutil """ -------...
[ "vuelo.aterrizarVehiculo", "argparse.ArgumentParser", "vuelo.despegarVehiculo", "time.sleep", "dronekit.connect", "vuelo.goto" ]
[((613, 638), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (636, 638), False, 'import argparse\n'), ((798, 848), 'dronekit.connect', 'connect', (['args.connect'], {'baud': '(57600)', 'wait_ready': '(True)'}), '(args.connect, baud=57600, wait_ready=True)\n', (805, 848), False, 'from dronekit i...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created by <NAME> at 2019-09-02 """Step_simulate.py :description : script :param : :returns: :rtype: """ import os import cobra import matplotlib.pyplot as plt import numpy as np os.chdir('../../ComplementaryData/Step_03_Compare_Refine/') print('----- loading model...
[ "matplotlib.pyplot.show", "numpy.arange", "brewer2mpl.get_map", "cobra.io.load_json_model", "matplotlib.pyplot.subplots", "os.chdir" ]
[((234, 293), 'os.chdir', 'os.chdir', (['"""../../ComplementaryData/Step_03_Compare_Refine/"""'], {}), "('../../ComplementaryData/Step_03_Compare_Refine/')\n", (242, 293), False, 'import os\n'), ((338, 394), 'cobra.io.load_json_model', 'cobra.io.load_json_model', (['"""../../ModelFiles/iHL622.json"""'], {}), "('../../M...
import select import socketserver import threading from queue import Queue class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer): pass class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler): """A threaded tcp request handler """ def handle(self): """ The ha...
[ "threading.Thread", "select.select", "queue.Queue" ]
[((1532, 1582), 'threading.Thread', 'threading.Thread', ([], {'target': 'self.server.serve_forever'}), '(target=self.server.serve_forever)\n', (1548, 1582), False, 'import threading\n'), ((1811, 1827), 'queue.Queue', 'Queue', ([], {'maxsize': '(1)'}), '(maxsize=1)\n', (1816, 1827), False, 'from queue import Queue\n'), ...
import threading import errors import vs import logging import gc from blinker import signal from utils import performance from output.output import Output # We need to be able to load (not run) vs_server on windows to generate the documentation. # So we're skipping non-windows imports try: import psutil except...
[ "psutil.Process", "threading.Timer", "errors.InternalError", "blinker.signal", "vs.videoWriterSharedPtr", "gc.collect", "logging.info", "utils.performance.getCudaInfo" ]
[((659, 675), 'psutil.Process', 'psutil.Process', ([], {}), '()\n', (673, 675), False, 'import psutil\n'), ((1579, 1622), 'vs.videoWriterSharedPtr', 'vs.videoWriterSharedPtr', (['self.shared_writer'], {}), '(self.shared_writer)\n', (1602, 1622), False, 'import vs\n'), ((2191, 2228), 'logging.info', 'logging.info', (["(...
import miniml import numpy as np # Adapted from: # https://lucidar.me/en/neural-networks/curve-fitting-nonlinear-regression/ # init data np.random.seed(3) X = np.linspace(-10, 10, num=1000) Y = 0.1*X*np.cos(X) + 0.1*np.random.normal(size=1000) X = X.reshape((len(X), 1)) Y = Y.reshape((len(Y), 1)) # create model mod...
[ "miniml.Model", "numpy.random.seed", "miniml.plot_costs", "miniml.plot_regression", "numpy.linspace", "numpy.cos", "numpy.random.normal", "miniml.Adam" ]
[((139, 156), 'numpy.random.seed', 'np.random.seed', (['(3)'], {}), '(3)\n', (153, 156), True, 'import numpy as np\n'), ((161, 191), 'numpy.linspace', 'np.linspace', (['(-10)', '(10)'], {'num': '(1000)'}), '(-10, 10, num=1000)\n', (172, 191), True, 'import numpy as np\n'), ((325, 339), 'miniml.Model', 'miniml.Model', (...
# Library imports from bs4 import BeautifulSoup import requests # Generic web parser providing basic functionality to load a webpage # Use this as a base class for more specific webpage parsers class WebpageParser: # WebpageParser version version = '0.1' # Used to request web page headers = {'Use...
[ "bs4.BeautifulSoup", "requests.get" ]
[((2025, 2077), 'requests.get', 'requests.get', (['self.current_url'], {'headers': 'self.headers'}), '(self.current_url, headers=self.headers)\n', (2037, 2077), False, 'import requests\n'), ((2113, 2147), 'bs4.BeautifulSoup', 'BeautifulSoup', (['req.content', '"""lxml"""'], {}), "(req.content, 'lxml')\n", (2126, 2147),...
#!/usr/bin/env python import pathlib, sys file_path = pathlib.Path(__file__).parent.absolute() from argparse import ArgumentParser import numpy as np import time import pressiodemoapps as pda def schemeStringToSchemeEnum(s): if s=="FirstOrder": return pda.InviscidFluxReconstruction.FirstOrder elif s=="Weno3"...
[ "pressiodemoapps.load_cellcentered_uniform_mesh", "argparse.ArgumentParser", "time.time", "pathlib.Path", "pressiodemoapps.create_problem" ]
[((536, 552), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (550, 552), False, 'from argparse import ArgumentParser\n'), ((774, 785), 'time.time', 'time.time', ([], {}), '()\n', (783, 785), False, 'import time\n'), ((830, 874), 'pressiodemoapps.load_cellcentered_uniform_mesh', 'pda.load_cellcentered_un...
import panaetius def test_set_config(header, shared_datadir): # arrange config_path = str(shared_datadir / "without_logging") # act config = panaetius.Config(header, config_path) panaetius.set_config(config, "some_top_string") # assert assert getattr(config, "some_top_string") == "some_t...
[ "panaetius.set_config", "panaetius.Config" ]
[((160, 197), 'panaetius.Config', 'panaetius.Config', (['header', 'config_path'], {}), '(header, config_path)\n', (176, 197), False, 'import panaetius\n'), ((202, 249), 'panaetius.set_config', 'panaetius.set_config', (['config', '"""some_top_string"""'], {}), "(config, 'some_top_string')\n", (222, 249), False, 'import ...
from copy import deepcopy from .helpers import set_n_jobs, replace_with_in_params from sklearn.ensemble import (StackingRegressor, StackingClassifier, VotingClassifier, VotingRegressor) from joblib import Parallel, delayed from sklearn.base import clone, is_classifier from sklearn.utils...
[ "numpy.abs", "numpy.shape", "numpy.mean", "sklearn.base.clone", "pandas.DataFrame", "sklearn.utils.Bunch", "numpy.random.RandomState", "sklearn.preprocessing.LabelEncoder", "sklearn.base.is_classifier", "sklearn.utils.metaestimators.available_if", "numpy.bincount", "copy.deepcopy", "numpy.av...
[((1400, 1407), 'sklearn.utils.Bunch', 'Bunch', ([], {}), '()\n', (1405, 1407), False, 'from sklearn.utils import Bunch\n'), ((5663, 5694), 'sklearn.utils.multiclass.check_classification_targets', 'check_classification_targets', (['y'], {}), '(y)\n', (5691, 5694), False, 'from sklearn.utils.multiclass import check_clas...
import requests #导入requests包 import json import records import configparser import time from lxml import etree import xml.sax import time # sz000001 db = records.Database("mysql://root:123456@localhost:3306/gupiao?charset=utf8") # data = [ # {'name': 'Jiji', 'age': 23}, # {'name': 'Mini'...
[ "json.loads", "records.Database", "requests.get", "lxml.etree.HTML", "time.localtime" ]
[((173, 247), 'records.Database', 'records.Database', (['"""mysql://root:123456@localhost:3306/gupiao?charset=utf8"""'], {}), "('mysql://root:123456@localhost:3306/gupiao?charset=utf8')\n", (189, 247), False, 'import records\n'), ((1837, 1854), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (1849, 1854), Fal...
# @l2g 326 python3 # [326] Power of Three # Difficulty: Easy # https://leetcode.com/problems/power-of-three # # Given an integer n, return true if it is a power of three. Otherwise, return false. # An integer n is a power of three, if there exists an integer x such that n == 3x. # # Example 1: # Input: n = 27 # Output:...
[ "os.path.join" ]
[((925, 961), 'os.path.join', 'os.path.join', (['"""tests"""', '"""test_326.py"""'], {}), "('tests', 'test_326.py')\n", (937, 961), False, 'import os\n')]
import sys from collections import deque n, k = list(map(int,sys.stdin.readline().strip("\n").split(" "))) circle = deque(list(range(1, n+1))) order = [] for i in range(n): for j in range(k): if(k-1 !=j): circle.append(circle.popleft()) else: order.append(circle.popleft()) ...
[ "sys.stdin.readline" ]
[((62, 82), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (80, 82), False, 'import sys\n')]
import pytest from case_style_changer.case_style import CamelCase from case_style_changer.case_style import CapitalCase from case_style_changer.case_style import Case from case_style_changer.case_style import ConstantCase from case_style_changer.case_style import KebabCase from case_style_changer.case_style import Pas...
[ "pytest.mark.parametrize", "pytest.raises", "case_style_changer.case_style.Case.from_string", "case_style_changer.case_style.Case.available_list" ]
[((438, 669), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""string, expected"""', "[('camel', CamelCase), ('pascal', PascalCase), ('snake', SnakeCase), (\n 'constant', ConstantCase), ('kebab', KebabCase), ('sentence',\n SentenceCase), ('capital', CapitalCase)]"], {}), "('string, expected', [('camel'...
import unittest class Issue8TestCase(unittest.TestCase): def test_none_as_string_instance(self): from pyjsg.jsglib import JSGString, JSGPattern class S(JSGString): pattern = JSGPattern(r'[a-zA-Z]+') self.assertTrue(isinstance('abc', S)) self.assertFalse(isinstance('...
[ "unittest.main", "pyjsg.jsglib.JSGPattern" ]
[((454, 469), 'unittest.main', 'unittest.main', ([], {}), '()\n', (467, 469), False, 'import unittest\n'), ((211, 234), 'pyjsg.jsglib.JSGPattern', 'JSGPattern', (['"""[a-zA-Z]+"""'], {}), "('[a-zA-Z]+')\n", (221, 234), False, 'from pyjsg.jsglib import JSGString, JSGPattern\n')]
from django import forms class TopicSearchForm(forms.Form): topic = forms.CharField(max_length=50, required=False, label='') class ProjectOrderForm(forms.Form): ORDER_CHOICES = ( ('relevance-desc', 'Relevance'), ('publish_datetime-desc', 'Latest'), ('publish_datetime-asc', 'Oldest'), ...
[ "django.forms.MultipleChoiceField", "django.forms.CharField", "django.forms.ChoiceField" ]
[((73, 129), 'django.forms.CharField', 'forms.CharField', ([], {'max_length': '(50)', 'required': '(False)', 'label': '""""""'}), "(max_length=50, required=False, label='')\n", (88, 129), False, 'from django import forms\n'), ((523, 573), 'django.forms.ChoiceField', 'forms.ChoiceField', ([], {'choices': 'ORDER_CHOICES'...
''' This script plots spectrograms for pre-ictal periods. Then, it uses NMF to find subgraphs and expressions for pre-ictal periods. Finally, it calculates states as the subgraph with maximal expression at each time point and calculates the dissimilarity between states. Inputs: target-electrodes-{mode}.mat bandpower-...
[ "sys.path.append", "kneed.KneeLocator", "numpy.size", "json.load", "sklearn.decomposition.NMF", "os.makedirs", "warnings.filterwarnings", "os.path.exists", "time.time", "numpy.insert", "numpy.min", "pull_sz_starts.pull_sz_starts", "numpy.where", "numpy.timedelta64", "numpy.squeeze", "o...
[((699, 723), 'sys.path.append', 'sys.path.append', (['"""tools"""'], {}), "('tools')\n", (714, 723), False, 'import sys\n'), ((1227, 1296), 'warnings.filterwarnings', 'warnings.filterwarnings', ([], {'action': '"""ignore"""', 'category': 'ConvergenceWarning'}), "(action='ignore', category=ConvergenceWarning)\n", (1250...
import point import math class MonteCarloArea(object): def __init__(self, problem, num_sample_points): self.num_sample_points = num_sample_points self.problem = problem self.total_efficiency = 0.0 self.number_of_updates = 0 self.moving_average = 0.0 self.learning_...
[ "point.get_random_point", "math.radians", "math.cos", "math.sin" ]
[((484, 547), 'point.get_random_point', 'point.get_random_point', (['self.problem.width', 'self.problem.height'], {}), '(self.problem.width, self.problem.height)\n', (506, 547), False, 'import point\n'), ((714, 737), 'math.radians', 'math.radians', (['quad.beta'], {}), '(quad.beta)\n', (726, 737), False, 'import math\n...
""" https://rosettacode.org/wiki/Bitcoin/address_validation#Python """ # Libraries from hashlib import sha256 # Constants DIGITS_58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' def decode_base58(addr, length): n = 0 for char in addr: n = n * 58 + DIGITS_58.index(char) return n.t...
[ "hashlib.sha256" ]
[((559, 582), 'hashlib.sha256', 'sha256', (['addr_bytes[:-4]'], {}), '(addr_bytes[:-4])\n', (565, 582), False, 'from hashlib import sha256\n')]
from obvody import obvod_ctverce, obvod_trojuhelnika, obvod_obdelnika, obvod_kruhu import obsahy as o # čtverec, obdélník, rovnostranný trojúhelník, kruh typ = input("Zadej typ útvaru: ") strana = int(input("Zadej délku strany / poloměr: ")) if typ == "ctverec": obvod = obvod_ctverce(strana) obsah = o.obsah_c...
[ "obvody.obvod_kruhu", "obsahy.obsah_trojuhelnika", "obvody.obvod_trojuhelnika", "obsahy.obsah_ctverce", "obsahy.obsah_kruhu", "obvody.obvod_obdelnika", "obvody.obvod_ctverce", "obsahy.obsah_obdelnika" ]
[((277, 298), 'obvody.obvod_ctverce', 'obvod_ctverce', (['strana'], {}), '(strana)\n', (290, 298), False, 'from obvody import obvod_ctverce, obvod_trojuhelnika, obvod_obdelnika, obvod_kruhu\n'), ((311, 334), 'obsahy.obsah_ctverce', 'o.obsah_ctverce', (['strana'], {}), '(strana)\n', (326, 334), True, 'import obsahy as o...
# This script compares reading from an array in a loop using the # tables.Array.read method. In the first case, read is used without supplying # an 'out' argument, which causes a new output buffer to be pre-allocated # with each call. In the second case, the buffer is created once, and then # reused. from __future_...
[ "numpy.empty", "numpy.ones", "time.time", "tables.open_file", "numpy.all" ]
[((506, 537), 'numpy.ones', 'np.ones', (['array_size'], {'dtype': '"""i8"""'}), "(array_size, dtype='i8')\n", (513, 537), True, 'import numpy as np\n'), ((547, 579), 'tables.open_file', 'tables.open_file', (['"""test.h5"""', '"""w"""'], {}), "('test.h5', 'w')\n", (563, 579), False, 'import tables\n'), ((773, 805), 'tab...
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_convert.ipynb (unless otherwise specified). __all__ = ['code_cell', 'write_module_cell', 'init_nb', 'write_cell', 'write_nb', 'convert_lib'] # Cell import json from fastcore.basics import Path from fastcore.xtras import is_listy from fastcore.foundation import Config fr...
[ "nbdev.export._re_class_func_def.match", "nbdev.export.nbglob", "fastcore.xtras.is_listy", "fastcore.basics.Path", "fastprogress.fastprogress.progress_bar", "json.dumps", "fastcore.foundation.Config", "nbdev.export._re_obj_def.match", "nbdev.export.export_names", "nbdev.sync._split" ]
[((859, 873), 'fastcore.xtras.is_listy', 'is_listy', (['code'], {}), '(code)\n', (867, 873), False, 'from fastcore.xtras import is_listy\n'), ((4401, 4463), 'nbdev.export.nbglob', 'nbglob', ([], {'extension': '""".py"""', 'config_key': '"""lib_path"""', 'recursive': '(True)'}), "(extension='.py', config_key='lib_path',...
import torch import config import engine import dataset_prep import torch.nn as nn import model import metrics import matplotlib.pyplot as plt if __name__ == '__main__': # DataLoaders train_loader, val_loader = dataset_prep.tr_dataset(batch_size = config.BATCH_SIZE) classes = val_loader.dataset.dataset.c...
[ "engine.training_func", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "torch.nn.CrossEntropyLoss", "model.resnet_model_101", "dataset_prep.tr_dataset" ]
[((221, 274), 'dataset_prep.tr_dataset', 'dataset_prep.tr_dataset', ([], {'batch_size': 'config.BATCH_SIZE'}), '(batch_size=config.BATCH_SIZE)\n', (244, 274), False, 'import dataset_prep\n'), ((429, 453), 'model.resnet_model_101', 'model.resnet_model_101', ([], {}), '()\n', (451, 453), False, 'import model\n'), ((583, ...
# ----------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ----------------------------------------------------------------------------- ""...
[ "azure.storage.blob.BlockBlobService", "azure.storage.blob.ContentSettings", "os.path.basename", "urllib.parse.urlunparse", "urllib.parse.urlparse", "mimetypes.guess_type" ]
[((622, 639), 'urllib.parse.urlparse', 'urlparse', (['sas_url'], {}), '(sas_url)\n', (630, 639), False, 'from urllib.parse import urlparse, urlunparse\n'), ((880, 940), 'azure.storage.blob.BlockBlobService', 'BlockBlobService', ([], {'account_name': 'account_name', 'sas_token': 'query'}), '(account_name=account_name, s...
#! /usr/bin/env python """ Build an index that can be used to retrieve individual reads or contigs by cDBG node ID; produce a SQLite database for fast retrieval. Briefly, this script creates a sqlite database with a single table, 'sequences', where a query like this: SELECT DISTINCT sequences.offset FROM sequences...
[ "argparse.ArgumentParser", "os.unlink", "os.path.basename", "spacegraphcats.search.search_utils.BgzfReader", "os.path.exists", "collections.defaultdict", "khmer.Nodegraph", "sqlite3.connect", "spacegraphcats.search.search_utils.iterate_bgzf", "os.path.join", "screed.open" ]
[((1087, 1112), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1110, 1112), False, 'import argparse\n'), ((1469, 1495), 'os.path.exists', 'os.path.exists', (['dbfilename'], {}), '(dbfilename)\n', (1483, 1495), False, 'import os\n'), ((1597, 1624), 'sqlite3.connect', 'sqlite3.connect', (['dbfil...
# Generated by Django 2.0.3 on 2020-02-18 03:28 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app1', '0005_flight_printed'), ] operations = [ migrations.AddField( model_name='flight', name='squack', ...
[ "django.db.models.CharField" ]
[((327, 369), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(20)', 'null': '(True)'}), '(max_length=20, null=True)\n', (343, 369), False, 'from django.db import migrations, models\n')]
from rest_flex_fields import FlexFieldsModelSerializer from rest_framework import serializers # from rest_framework_utils.key_related_field import key_related_field from staff_management_models.staff_group_payments.class_models.staff_worker_payment import StaffWorkerPayment, \ StaffWorkerPaymentGroup from staff_man...
[ "rest_framework.serializers.PrimaryKeyRelatedField" ]
[((627, 688), 'rest_framework.serializers.PrimaryKeyRelatedField', 'serializers.PrimaryKeyRelatedField', ([], {'read_only': '(True)', 'many': '(True)'}), '(read_only=True, many=True)\n', (661, 688), False, 'from rest_framework import serializers\n')]
"""1337. The K Weakest Rows in a Matrix https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix/ """ import collections from typing import List class Solution: def kWeakestRows(self, mat: List[List[int]], k: int) -> List[int]: def count(nums: List[int]) -> int: cnt = 0 for num...
[ "collections.defaultdict" ]
[((495, 524), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (518, 524), False, 'import collections\n')]
# Generated by Django 2.2.13 on 2020-08-30 23:18 from django.db import migrations, models import django.db.models.deletion import mptt.fields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Category', ...
[ "django.db.models.TextField", "django.db.models.CharField", "django.db.models.PositiveIntegerField", "django.db.models.SlugField", "django.db.models.AutoField" ]
[((357, 450), '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", (373, 450), False, 'from django.db import migrations, models\...
# -*- coding: UTF-8 -*- __author__ = 'hunter' from flask import Blueprint from app.util.response_util import code_handle from app.util.login_util import login api = Blueprint('api', __name__) api.after_app_request(code_handle) api.before_app_request(login) from . import views, errors
[ "flask.Blueprint" ]
[((167, 193), 'flask.Blueprint', 'Blueprint', (['"""api"""', '__name__'], {}), "('api', __name__)\n", (176, 193), False, 'from flask import Blueprint\n')]
from game_files.character import Character from game_files.menu import Menu from game_files.game import Game menu = Menu() button = menu.main() if (button == "play"): game = Game() game.maps_draw() elif (button == "saves"): menu.saves() elif (button == "options"): menu.options()
[ "game_files.menu.Menu", "game_files.game.Game" ]
[((117, 123), 'game_files.menu.Menu', 'Menu', ([], {}), '()\n', (121, 123), False, 'from game_files.menu import Menu\n'), ((180, 186), 'game_files.game.Game', 'Game', ([], {}), '()\n', (184, 186), False, 'from game_files.game import Game\n')]
# Django from django.db import models # Local Django from exam import constants class NewExam(models.Model): exam_description = models.CharField(max_length=constants.DESC_TUSS_MAX_LENGTH)
[ "django.db.models.CharField" ]
[((135, 194), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': 'constants.DESC_TUSS_MAX_LENGTH'}), '(max_length=constants.DESC_TUSS_MAX_LENGTH)\n', (151, 194), False, 'from django.db import models\n')]
import sys, os sys.path.append(os.getcwd()+'/d3m_ta2s_eval/ta3ta2api') import pipeline_pb2 as pipeline__pb2 import primitive_pb2 as primitive__pb2 import problem_pb2 as problem__pb2 import value_pb2 as value__pb2
[ "os.getcwd" ]
[((31, 42), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (40, 42), False, 'import sys, os\n')]
import numpy as np def distance_from_region(label_mask, distance_mask=None, scale=1, ord=2): """Find the distance at every point in an image from a set of labeled points. Parameters ========== label_mask : ndarray A mask designating the points to find the distance from. A True value ind...
[ "numpy.ma.getdata", "numpy.ma.getmaskarray", "numpy.zeros", "numpy.ones", "numpy.logical_not", "numpy.indices", "pylab.subplots", "numpy.array", "numpy.linalg.norm", "numpy.linspace" ]
[((1046, 1061), 'numpy.array', 'np.array', (['scale'], {}), '(scale)\n', (1054, 1061), True, 'import numpy as np\n'), ((1075, 1101), 'numpy.zeros', 'np.zeros', (['label_mask.shape'], {}), '(label_mask.shape)\n', (1083, 1101), True, 'import numpy as np\n'), ((1115, 1143), 'numpy.indices', 'np.indices', (['label_mask.sha...
#!/usr/bin/env python # # Copyright 2012 Viewfinder Inc. All Rights Reserved. """Account authorization tests for Facebook and Google accounts. """ __authors__ = ['<EMAIL> (<NAME>)', '<EMAIL> (<NAME>)'] import json import mock import os import time import unittest import urllib from copy import deepco...
[ "unittest.skipIf", "copy.deepcopy", "mock.patch.object", "tornado.ioloop.IOLoop.current", "json.loads", "viewfinder.backend.base.util.SetIfNotNone", "json.dumps", "time.time", "viewfinder.backend.db.contact.Contact.CreateSortKey", "viewfinder.backend.www.auth.AuthHandler._AUTH_ATTRIBUTE_MAP.get", ...
[((1004, 1061), 'unittest.skipIf', 'unittest.skipIf', (["('NO_NETWORK' in os.environ)", '"""no network"""'], {}), "('NO_NETWORK' in os.environ, 'no network')\n", (1019, 1061), False, 'import unittest\n'), ((24276, 24330), 'viewfinder.backend.base.util.SetIfNotNone', 'util.SetIfNotNone', (['request_dict', '"""device"""'...
from nose.plugins.attrib import attr from numpy.testing.utils import assert_equal, assert_allclose, assert_raises import numpy as np from brian2.spatialneuron import * from brian2.units import um, second @attr('codegen-independent') def test_basicshapes(): morpho = Soma(diameter=30*um) morpho.L = Cylinder(len...
[ "numpy.testing.utils.assert_equal", "numpy.testing.utils.assert_allclose", "numpy.testing.utils.assert_raises", "nose.plugins.attrib.attr" ]
[((207, 234), 'nose.plugins.attrib.attr', 'attr', (['"""codegen-independent"""'], {}), "('codegen-independent')\n", (211, 234), False, 'from nose.plugins.attrib import attr\n'), ((767, 794), 'nose.plugins.attrib.attr', 'attr', (['"""codegen-independent"""'], {}), "('codegen-independent')\n", (771, 794), False, 'from no...
# Utilizando a função os.walk, crie uma página HTML com o nome e tamanho de cada arquivo de um diretório passado e de # seus subdiretórios # Programa 9.10 do livro, página 219 # Programa 9.10 - Árvore de diretórios sendo percorrida # # import os # import sys # # for raiz, diretorios, arquivos in os.walk(sys.argv[1]): ...
[ "os.path.getsize", "os.walk", "os.path.join", "sys.exit" ]
[((670, 688), 'os.walk', 'os.walk', (['directory'], {}), '(directory)\n', (677, 688), False, 'import os\n'), ((1087, 1098), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (1095, 1098), False, 'import sys\n'), ((741, 765), 'os.path.join', 'os.path.join', (['root', 'file'], {}), '(root, file)\n', (753, 765), False, 'imp...
# .env/bin/python # coding: utf-8 from collections import namedtuple from datetime import datetime def pad_reading(_reading): """ Return a full binary representation of the individual bytes :param _reading: :return: binary """ prefix = 0 for i in range(len(_reading) - 1): prefix ...
[ "datetime.datetime.now", "collections.namedtuple" ]
[((866, 1034), 'collections.namedtuple', 'namedtuple', (['"""DecodedHeader"""', '"""product_type, hardware_rev, firmware_rev, contact_reason, alarm_status, imei gsm_rssi, battery_status, message_type, payload_len"""'], {}), "('DecodedHeader',\n 'product_type, hardware_rev, firmware_rev, contact_reason, alarm_status,...
# app.py # python file to create database from flask import Flask, render_template, request from models import * # our file defined above to define the classes/tables app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = 'postgresql://postgres:pk8742@localhost:5432/airline2' app.config["SQLALCHEMY_TRACK_MODIF...
[ "flask.Flask" ]
[((175, 190), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (180, 190), False, 'from flask import Flask, render_template, request\n')]
# # Copyright 2020- IBM Inc. All rights reserved # SPDX-License-Identifier: Apache2.0 # import copy from CanonicalIntervalSet import CanonicalIntervalSet class MethodSet(CanonicalIntervalSet): """ A class for holding a set of HTTP methods """ all_methods_list = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE'...
[ "copy.copy", "CanonicalIntervalSet.CanonicalIntervalSet.get_interval_set" ]
[((1101, 1168), 'CanonicalIntervalSet.CanonicalIntervalSet.get_interval_set', 'CanonicalIntervalSet.get_interval_set', (['interval.start', 'interval.end'], {}), '(interval.start, interval.end)\n', (1138, 1168), False, 'from CanonicalIntervalSet import CanonicalIntervalSet\n'), ((3077, 3092), 'copy.copy', 'copy.copy', (...
import math def num_string(x, n=3): return ('{}'.format(x + 10**n))[1:] class ChannelConfig(object): def __init__(self, nchans, chans=None, addref=True, istart=0): self.addref = addref self.istart = istart if chans is None: nchars = math.ceil(math.log10(nchans+is...
[ "math.log10" ]
[((300, 327), 'math.log10', 'math.log10', (['(nchans + istart)'], {}), '(nchans + istart)\n', (310, 327), False, 'import math\n')]
from common.numpy_fast import clip def rate_limit(new_value, last_value, dw_step, up_step): return clip(new_value, last_value + dw_step, last_value + up_step) def learn_angle_offset(lateral_control, v_ego, angle_offset, d_poly, y_des, steer_override): # simple integral controller that learns how much steering off...
[ "common.numpy_fast.clip" ]
[((102, 161), 'common.numpy_fast.clip', 'clip', (['new_value', '(last_value + dw_step)', '(last_value + up_step)'], {}), '(new_value, last_value + dw_step, last_value + up_step)\n', (106, 161), False, 'from common.numpy_fast import clip\n'), ((827, 869), 'common.numpy_fast.clip', 'clip', (['angle_offset', 'min_offset',...
import warnings from pathlib import Path import astropy.units as u import matplotlib.pyplot as plt import pandas as pd from astropy.coordinates import SkyCoord from sunpy.map import Map, MapSequence from sunpy.net import Fido from sunpy.net import attrs as a from sunpy.net import hek from sunpy.util import SunpyUserWa...
[ "matplotlib.pyplot.show", "sunpy.map.Map", "matplotlib.pyplot.plot", "pandas.read_csv", "sunpy.net.hek.HEKClient", "matplotlib.pyplot.legend", "sunpy.map.MapSequence", "sunpy.net.Fido.fetch", "sunpy.net.attrs.Time", "sunpy.net.hek.attrs.Time", "matplotlib.pyplot.figure", "sunpy.net.hek.attrs.E...
[((18413, 18454), 'sunpy.net.Fido.fetch', 'Fido.fetch', (['search_results'], {'path': 'filepath'}), '(search_results, path=filepath)\n', (18423, 18454), False, 'from sunpy.net import Fido\n'), ((20521, 20562), 'sunpy.net.Fido.fetch', 'Fido.fetch', (['search_results'], {'path': 'filepath'}), '(search_results, path=filep...
""" """ import turtle class Pluma(): def __init__(self, color, grosor): self.color = color self.grosor = grosor self.posicion = [0, 0] self.previa = self.posicion def mueve(self, x, y): self.previa = self.posicion self.posicion = [x, y] turtle.goto(*se...
[ "turtle.goto" ]
[((305, 332), 'turtle.goto', 'turtle.goto', (['*self.posicion'], {}), '(*self.posicion)\n', (316, 332), False, 'import turtle\n'), ((429, 456), 'turtle.goto', 'turtle.goto', (['*self.posicion'], {}), '(*self.posicion)\n', (440, 456), False, 'import turtle\n')]