code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from scripts.data_processing.preprocessing import common_preprocessing
from scripts.model import Model
# from keras.models import model_from_json
import numpy as np
import os
import pandas as pd
# def load_model(architecture_path, weights_path):
# json_file = open(architecture_path, 'r')
# model_json = json_fi... | [
"pandas.read_csv",
"scripts.model.Model",
"scripts.data_processing.preprocessing.common_preprocessing"
] | [((1892, 1925), 'scripts.model.Model', 'Model', ([], {'param_yaml': 'param_yaml_path'}), '(param_yaml=param_yaml_path)\n', (1897, 1925), False, 'from scripts.model import Model\n'), ((1940, 1962), 'pandas.read_csv', 'pd.read_csv', (['test_path'], {}), '(test_path)\n', (1951, 1962), True, 'import pandas as pd\n'), ((197... |
import bottle
bottle.TEMPLATE_PATH = ['template']
from bottle import Bottle, run, template
app = Bottle()
@app.route('/')
@app.route('/<name:re:[a-z]+>')
def index(name='world'):
return template('script-01', name=name)
run(app, host='localhost', port=8080) | [
"bottle.run",
"bottle.template",
"bottle.Bottle"
] | [((99, 107), 'bottle.Bottle', 'Bottle', ([], {}), '()\n', (105, 107), False, 'from bottle import Bottle, run, template\n'), ((227, 264), 'bottle.run', 'run', (['app'], {'host': '"""localhost"""', 'port': '(8080)'}), "(app, host='localhost', port=8080)\n", (230, 264), False, 'from bottle import Bottle, run, template\n')... |
from django.contrib.auth import views as auth_views
from . import views
from django.conf.urls import url, include
from rest_framework import routers
app_name = 'dustbin'
router = routers.DefaultRouter()
router.register(r'dustbins', views.DustBinViewSet)
urlpatterns = [
url(r'^api/', include(router.urls)),
url(r"^... | [
"django.conf.urls.include",
"rest_framework.routers.DefaultRouter"
] | [((182, 205), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (203, 205), False, 'from rest_framework import routers\n'), ((289, 309), 'django.conf.urls.include', 'include', (['router.urls'], {}), '(router.urls)\n', (296, 309), False, 'from django.conf.urls import url, include\n'), ((... |
import hc2002.plugin as plugin
import os.path
import email.mime.base
import email.mime.multipart
import email.mime.text
plugin.register_for_resource(__name__, 'hc2002.resource.instance')
_magic_to_mime = {
'#!': ('text', 'x-shellscript'),
'#cloud-boothook': ('text', 'cloud-boothook'),
'#clo... | [
"hc2002.plugin.register_for_resource"
] | [((121, 187), 'hc2002.plugin.register_for_resource', 'plugin.register_for_resource', (['__name__', '"""hc2002.resource.instance"""'], {}), "(__name__, 'hc2002.resource.instance')\n", (149, 187), True, 'import hc2002.plugin as plugin\n')] |
#!/usr/bin/env python3
import sys
import serial
import time
import libStrix
# Open connection to SMU
com = serial.Serial( sys.argv[1], 460800, timeout = 25.0 )
smu = libStrix.Strix( com, 1 )
## Settings
smu.write( libStrix.PARAM_AVERAGES, 10 )
smu.write( libStrix.PARAM_4WIRE_MODE, libStrix.ENABLE_4WIRE_MODE )
#... | [
"serial.Serial",
"libStrix.Strix",
"time.sleep"
] | [((111, 159), 'serial.Serial', 'serial.Serial', (['sys.argv[1]', '(460800)'], {'timeout': '(25.0)'}), '(sys.argv[1], 460800, timeout=25.0)\n', (124, 159), False, 'import serial\n'), ((170, 192), 'libStrix.Strix', 'libStrix.Strix', (['com', '(1)'], {}), '(com, 1)\n', (184, 192), False, 'import libStrix\n'), ((617, 633),... |
from distutils.core import setup
from Cython.Build import cythonize
setup(
ext_modules = cythonize("src/optimized.pyx", compiler_directives={'language_level' : "3"})
)
| [
"Cython.Build.cythonize"
] | [((94, 169), 'Cython.Build.cythonize', 'cythonize', (['"""src/optimized.pyx"""'], {'compiler_directives': "{'language_level': '3'}"}), "('src/optimized.pyx', compiler_directives={'language_level': '3'})\n", (103, 169), False, 'from Cython.Build import cythonize\n')] |
# -*- coding: utf-8 -*-
import json
import re
import scrapy
from tangspiderframe.items import TangspiderframeItem
class TextEnglishCambridgeLocalSpider(scrapy.Spider):
name = 'text_english_cambridge_local'
allowed_domains = ['dictionary.cambridge.org']
start_urls = ['http://dictionary.cambridge.org/']
... | [
"tangspiderframe.items.TangspiderframeItem"
] | [((1226, 1247), 'tangspiderframe.items.TangspiderframeItem', 'TangspiderframeItem', ([], {}), '()\n', (1245, 1247), False, 'from tangspiderframe.items import TangspiderframeItem\n')] |
from requests import get
def formatResponse(_res: dict, functions: dict) -> str:
message = '';
values = {
"country": "Pais", "countryCode": "Código do Pais",
"region": "Região", "regionName": "Nome da Região",
"city": "Cidade", "query": "Ip"
};
for key in _res:
if key... | [
"requests.get"
] | [((860, 911), 'requests.get', 'get', (['f"""http://ip-api.com/json/{_num}?fields=258047"""'], {}), "(f'http://ip-api.com/json/{_num}?fields=258047')\n", (863, 911), False, 'from requests import get\n')] |
"""app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based ... | [
"django.conf.urls.url",
"content.views.ContentViewSet.as_view",
"rest_framework.routers.DefaultRouter",
"django.conf.urls.include"
] | [((922, 945), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (943, 945), False, 'from rest_framework import routers\n'), ((1230, 1269), 'content.views.ContentViewSet.as_view', 'ContentViewSet.as_view', (["{'get': 'list'}"], {}), "({'get': 'list'})\n", (1252, 1269), False, 'from conte... |
import os
from pathlib import Path
import re
import getpass
user = getpass.getuser()
def write_mime_types(file_obj):
global mime_type
mime_type = list(filter(None, mime_type[len('MimeType='):].split(';')))
for i in mime_type:
file_obj.write(i+'=LibreOffice.desktop;\n')
def read_mime_types(file_obj... | [
"getpass.getuser",
"re.match",
"pathlib.Path",
"os.listdir",
"re.compile"
] | [((67, 84), 'getpass.getuser', 'getpass.getuser', ([], {}), '()\n', (82, 84), False, 'import getpass\n'), ((1106, 1134), 're.compile', 're.compile', (['"""^MimeType=.*;$"""'], {}), "('^MimeType=.*;$')\n", (1116, 1134), False, 'import re\n'), ((1281, 1324), 'pathlib.Path', 'Path', (['f"""/home/{user}/.config/mimeapps.li... |
import json
import sys
import time
from collections import OrderedDict
from flask import Flask, Response, abort, url_for
from flask_cors import CORS
from flask_restx import Api, Resource, fields
from refill.tasks import TASK_MAPPING, fixWikipage
from werkzeug.middleware.proxy_fix import ProxyFix
app = Flask(__name__)... | [
"flask_cors.CORS",
"flask_restx.fields.Raw",
"flask.Flask",
"flask_restx.Api",
"flask_restx.fields.Boolean",
"flask.abort",
"refill.tasks.fixWikipage.delay",
"time.sleep",
"json.dumps",
"flask.url_for",
"flask_restx.fields.String",
"werkzeug.middleware.proxy_fix.ProxyFix",
"flask.Response",
... | [((305, 320), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (310, 320), False, 'from flask import Flask, Response, abort, url_for\n'), ((421, 443), 'werkzeug.middleware.proxy_fix.ProxyFix', 'ProxyFix', (['app.wsgi_app'], {}), '(app.wsgi_app)\n', (429, 443), False, 'from werkzeug.middleware.proxy_fix impor... |
import os
import argparse
import numpy as np
import trimesh
import pyrender
import matplotlib.pyplot as plt
import pddlgym
from loader import load_scenegraph
from pddlgym_planners.fd import FD
from pddlgym_planners.planner import (PlanningFailure, PlanningTimeout)
def plot_plan(domain_name, model):
"""Plot the ... | [
"pyrender.camera.PerspectiveCamera",
"trimesh.load",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"os.path.basename",
"pyrender.DirectionalLight",
"matplotlib.pyplot.imshow",
"pyrender.Viewer",
"pddlgym_planners.fd.FD",
"matplotlib.pyplot.axis",
"pyrender.Mesh.from_trimesh",
"matplotli... | [((882, 917), 'pddlgym_planners.fd.FD', 'FD', ([], {'alias_flag': '"""--alias lama-first"""'}), "(alias_flag='--alias lama-first')\n", (884, 917), False, 'from pddlgym_planners.fd import FD\n'), ((2821, 2846), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2844, 2846), False, 'import argparse\... |
"""Exceptions for Dorest
The Dorest project
:copyright: (c) 2020 Ichise Laboratory at NII & AIST
:author: <NAME>
"""
from typing import List
from django.utils.translation import gettext_lazy as _
from rest_framework import status
from rest_framework.exceptions import APIException
class ObjectNotFound(APIException... | [
"django.utils.translation.gettext_lazy"
] | [((388, 409), 'django.utils.translation.gettext_lazy', '_', (['"""Object not found"""'], {}), "('Object not found')\n", (389, 409), True, 'from django.utils.translation import gettext_lazy as _\n')] |
# Statistics Class
#
# Class served to generate, save, and print statistics
# of object comparison # match findings.
#
#
import os
from string import Template
import pandas as pd
import logging
this_dir = os.path.dirname(__file__)
class MatchStats:
def __init__(self, template_file):
# Open statistics te... | [
"os.path.dirname",
"string.Template"
] | [((207, 232), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (222, 232), False, 'import os\n'), ((2118, 2129), 'string.Template', 'Template', (['s'], {}), '(s)\n', (2126, 2129), False, 'from string import Template\n')] |
import numpy as np
def maze_7x5(a=-1.0, b=-5.0, goal=15.0):
nx, ny = 7, 5
S = np.zeros([nx, ny]) + a
# blocks
S[1,3] = b
S[2,1:3] = b
S[4,4:] = b
S[4,:2] = b
#
S[1,4] = b
S[6,3] = b
#
S[6,1] = goal
return S
def maze_13x13(a=-1.0, b=-5.0, goal=15.0):
nx... | [
"numpy.zeros"
] | [((90, 108), 'numpy.zeros', 'np.zeros', (['[nx, ny]'], {}), '([nx, ny])\n', (98, 108), True, 'import numpy as np\n'), ((343, 361), 'numpy.zeros', 'np.zeros', (['[nx, ny]'], {}), '([nx, ny])\n', (351, 361), True, 'import numpy as np\n')] |
#!/usr/bin/env python
from setuptools import setup, find_packages
install_requires = [
'PyYAML<=5.2;python_version<"3.5"',
'PyYAML>=3.11;python_version>="3.5"',
'ansicolor>=0.2.4',
'chardet>=2.3.0',
'setuptools>=36.2.2', # for enhanced marker support (used below).
'enum34>=1.0.4;python_versio... | [
"setuptools.find_packages"
] | [((1133, 1177), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['dev_tool', 'test*']"}), "(exclude=['dev_tool', 'test*'])\n", (1146, 1177), False, 'from setuptools import setup, find_packages\n')] |
from sys import setrecursionlimit
from functools import lru_cache
@lru_cache(maxsize=None)
def f(n):
if n == 0:
return 0
if n == 1:
return D
t = []
if n % 2 == 0:
t.append(f(n // 2) + A)
else:
t.append(f((n - 1) // 2) + D + A)
t.append(f((n + 1) // 2) + D + ... | [
"functools.lru_cache",
"sys.setrecursionlimit"
] | [((69, 92), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (78, 92), False, 'from functools import lru_cache\n'), ((734, 760), 'sys.setrecursionlimit', 'setrecursionlimit', (['(10 ** 6)'], {}), '(10 ** 6)\n', (751, 760), False, 'from sys import setrecursionlimit\n')] |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from webkitpy.layout_tests.models import testharness_results
class TestHarnessResultCheckerTest(unittest.TestCase):
def test_is_testh... | [
"webkitpy.layout_tests.models.testharness_results.is_testharness_output_passing",
"webkitpy.layout_tests.models.testharness_results.is_testharness_output",
"webkitpy.layout_tests.models.testharness_results.is_testharness_output_with_console_errors_or_warnings"
] | [((1372, 1430), 'webkitpy.layout_tests.models.testharness_results.is_testharness_output', 'testharness_results.is_testharness_output', (["data['content']"], {}), "(data['content'])\n", (1413, 1430), False, 'from webkitpy.layout_tests.models import testharness_results\n'), ((3767, 3833), 'webkitpy.layout_tests.models.te... |
from os.path import exists, isdir
from tempfile import gettempdir
from unittest import TestCase
from no_drama.context import temp_directory
class TestTempDirectory(TestCase):
def test_temp_directory(self):
with temp_directory() as tempdir:
self.assertTrue(exists(tempdir))
self.ass... | [
"os.path.isdir",
"tempfile.gettempdir",
"no_drama.context.temp_directory",
"os.path.exists"
] | [((226, 242), 'no_drama.context.temp_directory', 'temp_directory', ([], {}), '()\n', (240, 242), False, 'from no_drama.context import temp_directory\n'), ((283, 298), 'os.path.exists', 'exists', (['tempdir'], {}), '(tempdir)\n', (289, 298), False, 'from os.path import exists, isdir\n'), ((328, 342), 'os.path.isdir', 'i... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import ast
import logging
from sys import version_info
from .errors import ScriptSyntaxError
supported_nodes = ('arg', 'assert', 'assign', 'attribute', 'augassign',
'binop', 'boolop', 'break... | [
"ast.parse",
"logging.getLogger"
] | [((801, 828), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (818, 828), False, 'import logging\n'), ((1116, 1149), 'ast.parse', 'ast.parse', (['script', 'filename', 'mode'], {}), '(script, filename, mode)\n', (1125, 1149), False, 'import ast\n')] |
"""
Tests for Subscription Application
"""
# Django
from tastypie.test import ResourceTestCase
from django.test import TestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from control.test_utils import AdminCsvDownloadBase
fro... | [
"django.core.urlresolvers.reverse",
"django.contrib.auth.models.User.objects.create_user",
"logging.getLogger",
"subscription.models.Message.objects.filter",
"subscription.models.MessageSet.objects.get",
"subscription.tasks.fire_metrics_active_subscriptions.delay",
"StringIO.StringIO",
"subscription.m... | [((9971, 10084), 'django.test.utils.override_settings', 'override_settings', ([], {'CELERY_EAGER_PROPAGATES_EXCEPTIONS': '(True)', 'CELERY_ALWAYS_EAGER': '(True)', 'BROKER_BACKEND': '"""memory"""'}), "(CELERY_EAGER_PROPAGATES_EXCEPTIONS=True,\n CELERY_ALWAYS_EAGER=True, BROKER_BACKEND='memory')\n", (9988, 10084), Fa... |
#!/home/xwu/bin/python
#-*- coding:utf-8 -*-
from sklearn.linear_model import LogisticRegression
from sklearn.externals import joblib
from sklearn.model_selection import train_test_split
import numpy as np
import os
class Model():
def __init__(self,filename,suffix,assessment,filteration=None,coefs_file='coefs.txt',)... | [
"sklearn.externals.joblib.dump",
"numpy.savetxt",
"os.path.exists",
"numpy.hstack",
"sklearn.linear_model.LogisticRegression",
"numpy.array",
"numpy.loadtxt",
"sklearn.externals.joblib.load",
"numpy.vstack"
] | [((598, 674), 'sklearn.linear_model.LogisticRegression', 'LogisticRegression', ([], {'C': '(100000.0)', 'penalty': '"""l2"""', 'tol': '(0.0001)', 'solver': '"""liblinear"""'}), "(C=100000.0, penalty='l2', tol=0.0001, solver='liblinear')\n", (616, 674), False, 'from sklearn.linear_model import LogisticRegression\n'), ((... |
import riksdagen
class Vote:
def __init__(self, data):
self.data = data
self.namn = riksdagen.API.extract(data, 'namn')
#self.ja = API.extract(data, 'Ja')
#self.nej = API.extract(data, 'Nej')
#self.franfarande = API.extract(data, 'Frånvarande')
#self.avstar = API.ex... | [
"riksdagen.API.extract"
] | [((106, 141), 'riksdagen.API.extract', 'riksdagen.API.extract', (['data', '"""namn"""'], {}), "(data, 'namn')\n", (127, 141), False, 'import riksdagen\n')] |
#!/usr/bin/python
# pywiki: a simple (private) wiki implemented in web.py
# copyright 2010 by <NAME> (<EMAIL>)
# see https://github.com/pepaslabs/pywiki
import sys
import os
import hashlib
import fcntl
import string
import time
import cgi
import commands
import gzip
import subprocess
import binascii
import getpass
im... | [
"getpass.getuser",
"web.template.render",
"os.unlink",
"time.strftime",
"web.header",
"os.path.isfile",
"os.path.islink",
"creoleparser.dialects.creole10_base",
"os.chdir",
"web.notfound",
"mimetypes.guess_type",
"sys.path.append",
"mimetypes.init",
"os.path.exists",
"creoleparser.core.P... | [((380, 396), 'mimetypes.init', 'mimetypes.init', ([], {}), '()\n', (394, 396), False, 'import mimetypes\n'), ((13108, 13135), 'sys.path.append', 'sys.path.append', (['script_dir'], {}), '(script_dir)\n', (13123, 13135), False, 'import sys\n'), ((13136, 13156), 'os.chdir', 'os.chdir', (['script_dir'], {}), '(script_dir... |
import requests
import sys
import time
USER_ID = 00000000000000000
TOKEN = "<PASSWORD>"
print("通信中...")
def delete_afk():
response = requests.delete("https://api.sevenbot.jp/afk", headers={"Authorization": f"{USER_ID} {TOKEN}"})
if response.status_code == 401:
sys.stderr.write("認証に失敗しました。\n")
... | [
"sys.stderr.write",
"requests.delete",
"sys.exit",
"time.sleep"
] | [((141, 240), 'requests.delete', 'requests.delete', (['"""https://api.sevenbot.jp/afk"""'], {'headers': "{'Authorization': f'{USER_ID} {TOKEN}'}"}), "('https://api.sevenbot.jp/afk', headers={'Authorization':\n f'{USER_ID} {TOKEN}'})\n", (156, 240), False, 'import requests\n'), ((281, 313), 'sys.stderr.write', 'sys.s... |
# -*- coding: utf-8 -*-
import sys
from PySide2 import QtWidgets
from PySide2.QtTest import QTest
from numpy import pi
from Tests.GUI import gui_option # Set unit as [m]
from pyleecan.Classes.LamSlotMag import LamSlotMag
from pyleecan.Classes.SlotM17 import SlotM17
from pyleecan.GUI.Dialog.DMachineSetup.SMSlot.PMSlo... | [
"PySide2.QtTest.QTest.keyClicks",
"PySide2.QtWidgets.QApplication",
"PySide2.QtWidgets.QApplication.instance",
"pyleecan.GUI.Dialog.DMachineSetup.SMSlot.PMSlot17.PMSlot17.PMSlot17",
"pyleecan.Classes.SlotM17.SlotM17",
"pyleecan.Classes.LamSlotMag.LamSlotMag"
] | [((510, 540), 'pyleecan.Classes.LamSlotMag.LamSlotMag', 'LamSlotMag', ([], {'Rint': '(0.1)', 'Rext': '(0.2)'}), '(Rint=0.1, Rext=0.2)\n', (520, 540), False, 'from pyleecan.Classes.LamSlotMag import LamSlotMag\n'), ((570, 583), 'pyleecan.Classes.SlotM17.SlotM17', 'SlotM17', ([], {'Zs': '(2)'}), '(Zs=2)\n', (577, 583), F... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | [
"aiida.backends.sqlalchemy.get_scoped_session",
"aiida.backends.sqlalchemy.models.log.DbLog",
"aiida.backends.sqlalchemy.models.log.DbLog.query.all"
] | [((3117, 3137), 'aiida.backends.sqlalchemy.get_scoped_session', 'get_scoped_session', ([], {}), '()\n', (3135, 3137), False, 'from aiida.backends.sqlalchemy import get_scoped_session\n'), ((1410, 1538), 'aiida.backends.sqlalchemy.models.log.DbLog', 'models.DbLog', ([], {'time': 'time', 'loggername': 'loggername', 'leve... |
#!/usr/bin/env -S python3 -u
import sys
def audit(name, args):
if name not in ["exec", "compile", "builtins.input", "builtins.input/result"]:
print("you did a bad thing")
print("stay in jail forever")
exit(0)
sys.addaudithook(audit)
while True:
try:
code = input(">>> ")
... | [
"sys.addaudithook"
] | [((240, 263), 'sys.addaudithook', 'sys.addaudithook', (['audit'], {}), '(audit)\n', (256, 263), False, 'import sys\n')] |
# crack.py
# A very inefficient password cracker
#
# <NAME>
# CSC 483
# Winter 2018
from enum import Enum
from hashlib import pbkdf2_hmac
from hmac import compare_digest
from binascii import hexlify, unhexlify
import sys
import time
import itertools
class Mode(Enum):
BRUTE_FORCE = 1
DICTIONARY_ATTACK = 2
... | [
"binascii.hexlify",
"itertools.product",
"time.time",
"hmac.compare_digest"
] | [((651, 682), 'hmac.compare_digest', 'compare_digest', (['hash', 'word_hash'], {}), '(hash, word_hash)\n', (665, 682), False, 'from hmac import compare_digest\n'), ((917, 928), 'time.time', 'time.time', ([], {}), '()\n', (926, 928), False, 'import time\n'), ((486, 499), 'binascii.hexlify', 'hexlify', (['hash'], {}), '(... |
import graphene
from bank.models import Conta
from core.models import Socio
from django.utils import timezone
from django.utils.translation import gettext as _
from graphene_django import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from graphql import GraphQLError
from graphql_relay ... | [
"bank.models.Conta.objects.get_or_create",
"graphene.List",
"graphene.String",
"graphene.ID",
"graphql_relay.from_global_id",
"django.utils.translation.gettext",
"django.utils.timezone.now",
"graphene.relay.Node.Field",
"graphene.Boolean",
"graphene_django.filter.DjangoFilterConnectionField",
"c... | [((987, 1036), 'graphene.String', 'graphene.String', ([], {'source': '"""get_stripe_checkout_url"""'}), "(source='get_stripe_checkout_url')\n", (1002, 1036), False, 'import graphene\n'), ((1213, 1251), 'graphene.Boolean', 'graphene.Boolean', ([], {'source': '"""is_gratuito"""'}), "(source='is_gratuito')\n", (1229, 1251... |
import json
import logging
logger = logging.getLogger(__name__)
class CleanBackupConfig():
def __init__(self, backup_config):
self.config = backup_config
self.name = self.config['Name']
self.hc_url = self.config['HealthCheckUrl']
self.compression = self.config['TarCompression']
... | [
"logging.getLogger"
] | [((37, 64), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (54, 64), False, 'import logging\n')] |
#!/bin/sh /cvmfs/icecube.opensciencegrid.org/py2-v1/icetray-start
#METAPROJECT /data/user/jbourbeau/metaprojects/icerec/V05-00-00/build
import numpy as np
import pandas as pd
import time
import glob
import argparse
import os
from collections import defaultdict
from icecube.weighting.weighting import from_simprod
from... | [
"composition.checkdir",
"argparse.ArgumentParser",
"pandas.DataFrame.from_dict",
"pandas.HDFStore",
"numpy.asarray",
"time.time",
"collections.defaultdict",
"composition.Paths",
"composition.simfunctions.sim2comp",
"os.path.splitext",
"glob.glob",
"numpy.sqrt"
] | [((477, 489), 'composition.Paths', 'comp.Paths', ([], {}), '()\n', (487, 489), True, 'import composition as comp\n'), ((494, 530), 'composition.checkdir', 'comp.checkdir', (['mypaths.comp_data_dir'], {}), '(mypaths.comp_data_dir)\n', (507, 530), True, 'import composition as comp\n'), ((540, 619), 'argparse.ArgumentPars... |
import unittest
import numpy as np
import math
import rotate3d
class TestRotate3dMisc(unittest.TestCase):
"""A basic test suite for rotate3d helper functions"""
def test_normalize_x(self):
(x,y,z) = rotate3d.normalize(5,0,0)
np.testing.assert_almost_equal(x, 1)
np.testing.assert_almost_equal(y, 0)
np.testi... | [
"unittest.main",
"math.sqrt",
"math.radians",
"numpy.testing.assert_almost_equal",
"numpy.testing.assert_array_equal",
"numpy.array",
"numpy.testing.assert_array_almost_equal",
"rotate3d.normalize"
] | [((6202, 6217), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6215, 6217), False, 'import unittest\n'), ((206, 233), 'rotate3d.normalize', 'rotate3d.normalize', (['(5)', '(0)', '(0)'], {}), '(5, 0, 0)\n', (224, 233), False, 'import rotate3d\n'), ((234, 270), 'numpy.testing.assert_almost_equal', 'np.testing.asser... |
# Copyright 2018 VMware, 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 required by a... | [
"vmware_nsx.shell.admin.plugins.nsxv3.resources.utils.get_connected_nsxlib",
"oslo_log.log.getLogger",
"neutron_lib.callbacks.registry.subscribe"
] | [((958, 985), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (975, 985), True, 'from oslo_log import log as logging\n'), ((1355, 1453), 'neutron_lib.callbacks.registry.subscribe', 'registry.subscribe', (['find_cluster_managers_ips', 'constants.CLUSTER', 'shell.Operations.SHOW.value']... |
import uuid
from django.utils import timezone
from datetime import datetime
from django.db import models
class Meeting(models.Model):
"""会議モデル"""
class Meta:
# テーブル名を定義
db_table = 'meeting'
ordering = ['created_at']
verbose_name = verbose_name_plural = "会議"
# テーブルのカラムに対応する... | [
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.IntegerField",
"django.db.models.DateTimeField"
] | [((346, 401), 'django.db.models.AutoField', 'models.AutoField', ([], {'verbose_name': '"""会議ID"""', 'primary_key': '(True)'}), "(verbose_name='会議ID', primary_key=True)\n", (362, 401), False, 'from django.db import models\n'), ((416, 468), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'verbose_name': '""... |
from . import params
from . import defineCnst as C
import numpy as np
import torch as tr
def placeCars(envCars, traffic_density):
# do this for all the cars
# index starts from 1 as ego car is car_0
if len(envCars) > 15:
MAX_DIST = params.SIM_MAX_DISTANCE*2
else:
MAX_DIST = params.SIM_... | [
"numpy.zeros",
"numpy.around",
"numpy.random.randint",
"numpy.array",
"numpy.arange",
"numpy.exp",
"numpy.random.random",
"torch.zeros"
] | [((6964, 6995), 'numpy.zeros', 'np.zeros', (['params.CAR_NUM_STATES'], {}), '(params.CAR_NUM_STATES)\n', (6972, 6995), True, 'import numpy as np\n'), ((7010, 7025), 'numpy.arange', 'np.arange', (['(1)', '(7)'], {}), '(1, 7)\n', (7019, 7025), True, 'import numpy as np\n'), ((7526, 7553), 'numpy.around', 'np.around', (['... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-30 20:30
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0005_userlog_virtualmachines'),
]
operations = [
migrations.AddField... | [
"django.db.models.IntegerField"
] | [((412, 442), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(2)'}), '(default=2)\n', (431, 442), False, 'from django.db import migrations, models\n'), ((574, 604), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(2)'}), '(default=2)\n', (593, 604), False, 'from djan... |
import dash_core_components as dcc
def history_text():
return dcc.Markdown(children='''
**About history of orchestration**
==================================
---
Before approximately the year 1600, music was not written for specific
instruments. The only specification was either "vocal" or
"instrumental".[^1] Whe... | [
"dash_core_components.Markdown"
] | [((67, 3983), 'dash_core_components.Markdown', 'dcc.Markdown', ([], {'children': '"""\n**About history of orchestration**\n==================================\n---\n\nBefore approximately the year 1600, music was not written for specific\ninstruments. The only specification was either "vocal" or\n"instrumental".[^1] Whe... |
from django.core.management.base import BaseCommand
from oscar_accounts.setup import create_default_accounts
class Command(BaseCommand):
help = "Initialize oscar accounts default structure"
def handle(self, *args, **options):
create_default_accounts()
| [
"oscar_accounts.setup.create_default_accounts"
] | [((246, 271), 'oscar_accounts.setup.create_default_accounts', 'create_default_accounts', ([], {}), '()\n', (269, 271), False, 'from oscar_accounts.setup import create_default_accounts\n')] |
from astropy.io import fits, ascii
from astropy.table import Table
import numpy as NP
project_MWA = False
project_HERA = False
project_beams = False
project_drift_scan = True
project_global_EoR = False
if project_MWA: project_dir = 'project_MWA'
if project_HERA: project_dir = 'project_HERA'
if project_beams: project_... | [
"astropy.table.Table",
"numpy.sum",
"numpy.abs",
"numpy.angle",
"astropy.io.ascii.write",
"numpy.arange",
"astropy.io.fits.open",
"numpy.swapaxes",
"numpy.sqrt"
] | [((7202, 7229), 'astropy.io.fits.open', 'fits.open', (["(infile + '.fits')"], {}), "(infile + '.fits')\n", (7211, 7229), False, 'from astropy.io import fits, ascii\n'), ((7665, 7686), 'numpy.arange', 'NP.arange', (['chans.size'], {}), '(chans.size)\n', (7674, 7686), True, 'import numpy as NP\n'), ((8990, 9041), 'numpy.... |
import pandas as pd
from pyqmc.mc import vmc, initial_guess
from pyscf import gto, scf, mcscf
from pyqmc.slater import PySCFSlater
from pyqmc.jastrowspin import JastrowSpin
from pyqmc.accumulators import EnergyAccumulator
from pyqmc.multiplywf import MultiplyWF
from pyqmc.multislater import MultiSlater
import numpy as ... | [
"pyqmc.mc.initial_guess",
"time.time",
"numpy.around",
"pyscf.gto.M",
"pyscf.scf.RHF",
"pyqmc.jastrowspin.JastrowSpin",
"pyqmc.slater.PySCFSlater",
"pyqmc.accumulators.EnergyAccumulator",
"pyqmc.multislater.MultiSlater",
"pyscf.mcscf.CASCI"
] | [((363, 438), 'pyscf.gto.M', 'gto.M', ([], {'atom': '"""C 0 0 0 \n C 1 0 0 \n """', 'ecp': '"""bfd"""', 'basis': '"""bfd_vtz"""'}), '(atom="""C 0 0 0 \n C 1 0 0 \n """, ecp=\'bfd\', basis=\'bfd_vtz\')\n', (368, 438), False, 'from pyscf import gto, scf, mcscf\n'), ((528, 553), 'pyqmc.mc.initial_guess',... |
from flask import Flask, session, render_template, redirect, url_for, request
from jade_ims.models import db
from werkzeug.utils import import_string
bps = ['jade_ims.views.dashboard:dashboard',
'jade_ims.views.install:install',
'jade_ims.views.login:login',
'jade_ims.views.sale:sale',
'jad... | [
"jade_ims.models.db.init_app",
"flask.Flask",
"werkzeug.utils.import_string",
"flask.url_for"
] | [((661, 676), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (666, 676), False, 'from flask import Flask, session, render_template, redirect, url_for, request\n'), ((967, 983), 'jade_ims.models.db.init_app', 'db.init_app', (['app'], {}), '(app)\n', (978, 983), False, 'from jade_ims.models import db\n'), ((... |
"""face_detect_mtcnn is used for aligning faces based on mtcnn algorithm.
<NAME> and <NAME> and <NAME> and <NAME>, Face Detection and Alignment Using Multitask Cascaded Convolutional
Networks, IEEE Signal Processing Letters
"""
### The dataset should have the two level structure:
### Such as Casia-Webface, YoutubeFace:... | [
"numpy.maximum",
"argparse.ArgumentParser",
"numpy.argmax",
"random.shuffle",
"tensorflow.ConfigProto",
"numpy.random.randint",
"scipy.misc.imsave",
"detect_face.detect_face",
"tensorflow.GPUOptions",
"os.path.join",
"facenet.to_rgb",
"numpy.power",
"os.path.exists",
"detect_face.create_mt... | [((723, 766), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../../lib/facenet/src"""'], {}), "(0, '../../lib/facenet/src')\n", (738, 766), False, 'import sys\n'), ((862, 897), 'os.path.expanduser', 'os.path.expanduser', (['args.output_dir'], {}), '(args.output_dir)\n', (880, 897), False, 'import os\n'), ((1187, 12... |
# Importing section
import datetime
import json
import argparse
import logging
import random
import requests
import time
import utilities as u
from classes.time_utils import TimeUtils
# Main
if __name__ == "__main__":
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('-c', help='config file')
... | [
"argparse.ArgumentParser",
"logging.basicConfig",
"json.loads",
"utilities.send_post",
"time.sleep",
"datetime.timedelta",
"random.seed",
"requests.get",
"classes.time_utils.TimeUtils.get_start_end",
"logging.getLogger"
] | [((236, 261), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (259, 261), False, 'import argparse\n'), ((677, 696), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (694, 696), False, 'import logging\n'), ((824, 843), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (841, 8... |
import numpy as np
import bminference
from tqdm import tqdm
def generate(model : bminference.models.CPM2, sentence):
with tqdm() as progress_bar:
progress_bar.write(sentence)
while True:
value = model.generate(sentence + "<span>",
temperature=1.1,
top_p... | [
"bminference.models.CPM2",
"tqdm.tqdm"
] | [((716, 741), 'bminference.models.CPM2', 'bminference.models.CPM2', ([], {}), '()\n', (739, 741), False, 'import bminference\n'), ((127, 133), 'tqdm.tqdm', 'tqdm', ([], {}), '()\n', (131, 133), False, 'from tqdm import tqdm\n')] |
import os
import discord
import copy
from discord.ext import commands
from .utils.dataIO import dataIO
import random
class SmartReact:
"""Create automatic reactions when trigger words are typed in chat"""
def __init__(self, bot):
self.bot = bot
self.settings_path = "data/smortreacts/settings.... | [
"copy.deepcopy",
"discord.ext.commands.command",
"os.makedirs",
"os.path.exists",
"random.random"
] | [((506, 570), 'discord.ext.commands.command', 'commands.command', ([], {'name': '"""addreact"""', 'no_pm': '(True)', 'pass_context': '(True)'}), "(name='addreact', no_pm=True, pass_context=True)\n", (522, 570), False, 'from discord.ext import commands\n'), ((971, 1035), 'discord.ext.commands.command', 'commands.command... |
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
from basic_email.views import FakeEmailSend, ListEmailTemplatesView, PreviewEmailView, ListEmailVariablesView, \
SendEmailPreviewView
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns('',
... | [
"basic_email.views.FakeEmailSend.as_view",
"basic_email.views.ListEmailTemplatesView.as_view",
"basic_email.views.SendEmailPreviewView.as_view",
"basic_email.views.PreviewEmailView.as_view",
"basic_email.views.ListEmailVariablesView.as_view"
] | [((366, 389), 'basic_email.views.FakeEmailSend.as_view', 'FakeEmailSend.as_view', ([], {}), '()\n', (387, 389), False, 'from basic_email.views import FakeEmailSend, ListEmailTemplatesView, PreviewEmailView, ListEmailVariablesView, SendEmailPreviewView\n'), ((458, 490), 'basic_email.views.ListEmailTemplatesView.as_view'... |
import numpy as np
import xml.dom.minidom
from shapely.ops import cascaded_union
from shapely.geometry import Polygon
from itertools import combinations
class EnvOpenx():
"""根据OpenScenario文件进行测试,目前仅根据轨迹数据进行回放测试
"""
def __init__(self):
self.car_length = 4.924
self.car_width = 1.872
... | [
"shapely.geometry.Polygon",
"numpy.clip",
"itertools.combinations",
"numpy.sin",
"numpy.tan",
"numpy.cos",
"numpy.arctan",
"numpy.sqrt"
] | [((3125, 3174), 'numpy.clip', 'np.clip', (['self.vehicle_array[:, 0, 2]', '(0)', '(100000.0)'], {}), '(self.vehicle_array[:, 0, 2], 0, 100000.0)\n', (3132, 3174), True, 'import numpy as np\n'), ((5114, 5146), 'numpy.arctan', 'np.arctan', (['(ego[:, 5] / ego[:, 4])'], {}), '(ego[:, 5] / ego[:, 4])\n', (5123, 5146), True... |
import os, sys, inspect
# use this if you want to include modules from a subfolder
def include_module_path(path):
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],path)))
if cmd_subfolder not in sys.path:
sys.path.insert(0, cmd_s... | [
"sirbro_app.app.app.test_client",
"sys.path.insert",
"nose.tools.assert_equal",
"inspect.currentframe",
"nose.tools.assert_not_equal"
] | [((296, 329), 'sys.path.insert', 'sys.path.insert', (['(0)', 'cmd_subfolder'], {}), '(0, cmd_subfolder)\n', (311, 329), False, 'import os, sys, inspect\n'), ((943, 960), 'sirbro_app.app.app.test_client', 'app.test_client', ([], {}), '()\n', (958, 960), False, 'from sirbro_app.app import app, appconfig, run_app\n'), ((1... |
import json
import pathlib
from typing import Any, Optional, Union
from large_image.exceptions import TileSourceError
from large_image.tilesource import FileTileSource
from rest_framework.exceptions import APIException, ValidationError
from rest_framework.request import Request
from django_large_image import tilesour... | [
"django_large_image.tilesource.get_tilesource_from_path",
"rest_framework.exceptions.ValidationError",
"django_large_image.utilities.param_nully",
"json.dumps"
] | [((3008, 3074), 'django_large_image.tilesource.get_tilesource_from_path', 'tilesource.get_tilesource_from_path', (['path'], {'source': 'source'}), '(path, source=source, **kwargs)\n', (3043, 3074), False, 'from django_large_image import tilesource, utilities\n'), ((1286, 1393), 'rest_framework.exceptions.ValidationErro... |
import csv
import random
random.seed(2021)
INPUT = "./season.csv"
GOOD = "./forecast_good.csv"
G_RATE = 10
MODERATE = "./forecast_moderate.csv"
M_RATE = 30
BAD = "./forecast_bad.csv"
B_RATE = 70
def forecast(n, rate):
r = (random.randint(-1*rate, rate) / 100.0) + 1
v = round(n * r)
return v
with ... | [
"csv.reader",
"random.randint",
"random.seed",
"csv.writer"
] | [((27, 44), 'random.seed', 'random.seed', (['(2021)'], {}), '(2021)\n', (38, 44), False, 'import random\n'), ((360, 373), 'csv.reader', 'csv.reader', (['f'], {}), '(f)\n', (370, 373), False, 'import csv\n'), ((582, 595), 'csv.writer', 'csv.writer', (['f'], {}), '(f)\n', (592, 595), False, 'import csv\n'), ((901, 914), ... |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2017, 2018 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA Workflow Engine CWL configuration."""
import os
SHARED_VOLUME_PATH = os.geten... | [
"os.getenv"
] | [((312, 357), 'os.getenv', 'os.getenv', (['"""SHARED_VOLUME_PATH"""', '"""/var/reana"""'], {}), "('SHARED_VOLUME_PATH', '/var/reana')\n", (321, 357), False, 'import os\n'), ((420, 459), 'os.getenv', 'os.getenv', (['"""REANA_MOUNT_CVMFS"""', '"""false"""'], {}), "('REANA_MOUNT_CVMFS', 'false')\n", (429, 459), False, 'im... |
# Read in the RGI file
rgi_file = get_demo_file('rgi_oetztal.shp')
rgidf = gpd.read_file(rgi_file)
# Use multiprocessing to apply the OGGM tasks and the new task to all glaciers
from oggm import workflow
cfg.PARAMS['use_multiprocessing'] = True
gdirs = workflow.init_glacier_regions(rgidf)
workflow.execute_entity_task(... | [
"oggm.workflow.execute_entity_task",
"oggm.workflow.init_glacier_regions"
] | [((254, 290), 'oggm.workflow.init_glacier_regions', 'workflow.init_glacier_regions', (['rgidf'], {}), '(rgidf)\n', (283, 290), False, 'from oggm import workflow\n'), ((291, 347), 'oggm.workflow.execute_entity_task', 'workflow.execute_entity_task', (['tasks.glacier_masks', 'gdirs'], {}), '(tasks.glacier_masks, gdirs)\n'... |
from tqdm import tqdm
import torch
from experimaestro import param, option, config, pathoption
from onir import util, trainers
from onir.interfaces import apex
from onir.rankers import Ranker
from onir.vocab import Vocab
from onir.log import Logger
@param('batch_size', default=16)
@param('batches_per_epoch', default=3... | [
"experimaestro.param",
"tqdm.tqdm",
"experimaestro.pathoption",
"torch.load",
"onir.interfaces.apex.FusedAdam",
"experimaestro.config",
"torch.optim.Adam",
"onir.log.Logger",
"experimaestro.option"
] | [((251, 282), 'experimaestro.param', 'param', (['"""batch_size"""'], {'default': '(16)'}), "('batch_size', default=16)\n", (256, 282), False, 'from experimaestro import param, option, config, pathoption\n'), ((284, 322), 'experimaestro.param', 'param', (['"""batches_per_epoch"""'], {'default': '(32)'}), "('batches_per_... |
import time
from workflower.adapters.sqlalchemy.backup import dump_sqlite
from workflower.config import Config
from workflower.application.modules.module import BaseModule
class Module(BaseModule):
def __init__(self, plugins=None) -> None:
self._plugins = plugins
def run(self, *args, **kwargs):
... | [
"workflower.adapters.sqlalchemy.backup.dump_sqlite",
"time.time"
] | [((337, 348), 'time.time', 'time.time', ([], {}), '()\n', (346, 348), False, 'import time\n'), ((357, 427), 'workflower.adapters.sqlalchemy.backup.dump_sqlite', 'dump_sqlite', (['Config.APP_DATABASE_URL', 'Config.SQLITE_DATABASE_DUMP_PATH'], {}), '(Config.APP_DATABASE_URL, Config.SQLITE_DATABASE_DUMP_PATH)\n', (368, 42... |
#!/usr/bin/env python3
from battle.main import start_backend
start_backend()
| [
"battle.main.start_backend"
] | [((62, 77), 'battle.main.start_backend', 'start_backend', ([], {}), '()\n', (75, 77), False, 'from battle.main import start_backend\n')] |
import numpy as np
import sys
import os
import string
import struct
def converter_np2r(d, name, data_save):
save_name='data'+name + ".bin"
# create a binary file
binfile = file(os.path.join(data_save,save_name), 'wb') ... | [
"numpy.load",
"os.path.join",
"struct.pack",
"os.path.basename"
] | [((424, 465), 'struct.pack', 'struct.pack', (['"""2I"""', 'd.shape[0]', 'd.shape[1]'], {}), "('2I', d.shape[0], d.shape[1])\n", (435, 465), False, 'import struct\n'), ((825, 843), 'numpy.load', 'np.load', (['data_path'], {}), '(data_path)\n', (832, 843), True, 'import numpy as np\n'), ((261, 295), 'os.path.join', 'os.p... |
from argparse import ArgumentParser
from numpy import arange, array, atleast_2d, diag, hstack, ones, where
from os import mkdir
from os.path import isdir,isfile
from pickle import load, dump
from pandas import read_csv
from scipy.integrate import solve_ivp
from time import time
from multiprocessing import Pool
from mod... | [
"os.mkdir",
"pickle.dump",
"argparse.ArgumentParser",
"pandas.read_csv",
"os.path.isfile",
"pickle.load",
"numpy.arange",
"examples.temp_bubbles.common.build_mixed_compositions_pairwise",
"model.preprocessing.make_initial_condition_by_eigenvector",
"model.preprocessing.HouseholdPopulation",
"sci... | [((971, 1000), 'os.path.isdir', 'isdir', (['"""outputs/temp_bubbles"""'], {}), "('outputs/temp_bubbles')\n", (976, 1000), False, 'from os.path import isdir, isfile\n'), ((1015, 1044), 'os.mkdir', 'mkdir', (['"""outputs/temp_bubbles"""'], {}), "('outputs/temp_bubbles')\n", (1020, 1044), False, 'from os import mkdir\n'),... |
# -*- coding: utf-8 -*-
"""
Read MODIS and VIIRS NPP SST data during the SPURS-1 deployment cruise.
Created on Mon Jul 13 23:21:16 2020
Initially followed Intro_06_Xarray-basics.py tutorial obtained from <NAME>
@author: jtomf
"""
# import sys
# sys.path.append('C:/Users/jtomf/Documents/Python/Tom_tools/')
import nu... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"pandas.read_csv",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"xarray.open_dataset",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.colorbar",
"Tom_tools_v1.matlab2datetime",
"matplotlib.pyplot.figure",
"numpy.where",
"Tom_tools_v1... | [((530, 546), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (539, 546), True, 'import matplotlib.pyplot as plt\n'), ((1382, 1402), 'xarray.open_dataset', 'xr.open_dataset', (['url'], {}), '(url)\n', (1397, 1402), True, 'import xarray as xr\n'), ((1810, 1836), 'matplotlib.pyplot.figure', 'plt... |
import sys
import heapq
si = sys.stdin.readline
INF = 1e9
# 그래프 만들기
# 노드의 개수와 간선의 정보 입력
n, m = map(int, si().split())
graph = [[] for _ in range(n + 1)]
distance = [INF] * (n + 1)
visited = [False] * (n + 1)
start = int(si())
for _ in range(m):
# 현재노드, 이어진 노드, 비용
a, b, c = map(int, si().split())
graph... | [
"heapq.heappush",
"heapq.heappop"
] | [((405, 434), 'heapq.heappush', 'heapq.heappush', (['q', '(0, start)'], {}), '(q, (0, start))\n', (419, 434), False, 'import heapq\n'), ((468, 484), 'heapq.heappop', 'heapq.heappop', (['q'], {}), '(q)\n', (481, 484), False, 'import heapq\n'), ((700, 731), 'heapq.heappush', 'heapq.heappush', (['q', '(cost, i[0])'], {}),... |
# Echo State Network layer
# Basis cell for ESN.
import torch
from corai import Savable_net
######################## wip
######################## WORK IN PROGRESS
########################################################
class Leaky_echo_cell(Savable_net):
"""
Echo State Network layer
Basi... | [
"torch.zeros"
] | [((2291, 2363), 'torch.zeros', 'torch.zeros', (['batch_size', 'time_length', 'self._hidden_dim'], {'dtype': 'self.dtype'}), '(batch_size, time_length, self._hidden_dim, dtype=self.dtype)\n', (2302, 2363), False, 'import torch\n')] |
import pickle
import pandas as pd
from config import Config
from sklearn.linear_model import ElasticNet
# Creating a path to save the models
Config.models_path.mkdir(parents=True,exist_ok=True)
# Arranging the data
x_train = pd.read_csv(str(Config.features_path / 'train_features.csv'))
y_train = pd.read_csv(str(Con... | [
"sklearn.linear_model.ElasticNet",
"config.Config.models_path.mkdir"
] | [((143, 196), 'config.Config.models_path.mkdir', 'Config.models_path.mkdir', ([], {'parents': '(True)', 'exist_ok': '(True)'}), '(parents=True, exist_ok=True)\n', (167, 196), False, 'from config import Config\n'), ((426, 438), 'sklearn.linear_model.ElasticNet', 'ElasticNet', ([], {}), '()\n', (436, 438), False, 'from s... |
import random
print(random.random())
# 0.4496839011176701
random.seed(0)
print(random.random())
# 0.8444218515250481
print(random.random())
# 0.7579544029403025
random.seed(0)
print(random.random())
# 0.8444218515250481
print(random.random())
# 0.7579544029403025
| [
"random.random",
"random.seed"
] | [((60, 74), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (71, 74), False, 'import random\n'), ((165, 179), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (176, 179), False, 'import random\n'), ((21, 36), 'random.random', 'random.random', ([], {}), '()\n', (34, 36), False, 'import random\n'), ((81, 96), ... |
import requests
import io
from datetime import datetime
from rest_framework.exceptions import ValidationError
from .models import Lesson
from docxtpl import DocxTemplate
def get_lessons(user):
group_id = user.group_id
if not group_id:
raise ValidationError({"group_id": ["Invalid group_id"]})
res ... | [
"io.BytesIO",
"docxtpl.DocxTemplate",
"requests.get",
"rest_framework.exceptions.ValidationError",
"datetime.datetime.now"
] | [((322, 394), 'requests.get', 'requests.get', (['f"""https://api.rozklad.org.ua/v2/groups/{group_id}/lessons"""'], {}), "(f'https://api.rozklad.org.ua/v2/groups/{group_id}/lessons')\n", (334, 394), False, 'import requests\n'), ((823, 857), 'docxtpl.DocxTemplate', 'DocxTemplate', (['"""templates/lab.docx"""'], {}), "('t... |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 27 10:36:19 2021
@author: LeonardoDiasdaRosa
"""
from pyspark.sql import SparkSession
from pyspark.sql import functions as func
from pyspark.sql.types import StructType, StructField, StringType, IntegerType, FloatType
## Data
DATA_PATH = '../data/'
FILE = "1800.csv"
da... | [
"pyspark.sql.types.StringType",
"pyspark.sql.types.FloatType",
"pyspark.sql.SparkSession.builder.appName",
"pyspark.sql.functions.min",
"pyspark.sql.types.IntegerType"
] | [((375, 425), 'pyspark.sql.SparkSession.builder.appName', 'SparkSession.builder.appName', (['"""MinimumTemperature"""'], {}), "('MinimumTemperature')\n", (403, 425), False, 'from pyspark.sql import SparkSession\n'), ((531, 543), 'pyspark.sql.types.StringType', 'StringType', ([], {}), '()\n', (541, 543), False, 'from py... |
# -*- coding: utf-8 -*-
# Copyright© 1986-2020 Altair Engineering Inc.
"""pkr functions for creating the context"""
import os
from builtins import object
from compose.cli.command import get_project_name
from pathlib2 import Path
from .cli.log import write
from .utils import ensure_dir_absent, get_pkr_path
class C... | [
"pathlib2.Path",
"os.path.splitext"
] | [((930, 956), 'pathlib2.Path', 'Path', (['self.path', '*elements'], {}), '(self.path, *elements)\n', (934, 956), False, 'from pathlib2 import Path\n'), ((575, 590), 'pathlib2.Path', 'Path', (['kard.path'], {}), '(kard.path)\n', (579, 590), False, 'from pathlib2 import Path\n'), ((2036, 2064), 'os.path.splitext', 'os.pa... |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from logging import Filter
class UserFilter(Filter):
""" Add user information to each log entry. """
def filter(self, record):
from userservice.user import UserService
user_service = UserService()
... | [
"userservice.user.UserService"
] | [((298, 311), 'userservice.user.UserService', 'UserService', ([], {}), '()\n', (309, 311), False, 'from userservice.user import UserService\n')] |
from graphnas.trainer import Trainer
from graphnas_variants.simple_graphnas.simple_model_manager import SimpleCitationManager
class SimpleTrainer(Trainer):
def build_model(self):
if self.args.search_mode == "simple":
self.submodel_manager = SimpleCitationManager(self.args)
from ... | [
"graphnas_variants.simple_graphnas.simple_model_manager.SimpleCitationManager",
"graphnas.graphnas_controller.SimpleNASController",
"graphnas_variants.simple_graphnas.simple_search_space.SimpleSearchSpace"
] | [((269, 301), 'graphnas_variants.simple_graphnas.simple_model_manager.SimpleCitationManager', 'SimpleCitationManager', (['self.args'], {}), '(self.args)\n', (290, 301), False, 'from graphnas_variants.simple_graphnas.simple_model_manager import SimpleCitationManager\n'), ((430, 449), 'graphnas_variants.simple_graphnas.s... |
# -*- coding: utf-8 -*-
"""
:author: 秋荏苒
:copyright: © 2019 by 秋荏苒 <<EMAIL>>.
:license: MIT, see LICENSE for more details.
"""
from threading import Thread
from flask import url_for, current_app, render_template
from flask_mail import Message
from app.libs.extensions import mail
def _send_async_mail(app... | [
"threading.Thread",
"flask_mail.Message",
"flask.current_app._get_current_object",
"flask.render_template",
"app.libs.extensions.mail.send"
] | [((447, 480), 'flask.current_app._get_current_object', 'current_app._get_current_object', ([], {}), '()\n', (478, 480), False, 'from flask import url_for, current_app, render_template\n'), ((495, 528), 'flask_mail.Message', 'Message', (['subject'], {'recipients': '[to]'}), '(subject, recipients=[to])\n', (502, 528), Fa... |
import sys, os, socket
os.environ["CUDA_VISIBLE_DEVICES"]="0"
hostname = socket.gethostname()
if hostname=='tianx-pc':
homeDir = '/analyse/cdhome/'
proj0257Dir = '/analyse/Project0257/'
elif hostname[0:7]=='deepnet':
homeDir = '/home/chrisd/'
proj0257Dir = '/analyse/Project0257/'
import numpy as np
im... | [
"keras.preprocessing.image.ImageDataGenerator",
"os.path.abspath",
"h5py.File",
"os.makedirs",
"keras.backend.learning_phase",
"pandas.read_csv",
"os.path.exists",
"socket.gethostname",
"vae_models.classifierOnVAE"
] | [((73, 93), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (91, 93), False, 'import sys, os, socket\n'), ((805, 842), 'keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {'rescale': '(1.0 / 255)'}), '(rescale=1.0 / 255)\n', (823, 842), False, 'from keras.preprocessing.image import ... |
import itertools as itt
from typing import Sequence
import gym
import more_itertools as mitt
import torch
import torch.nn as nn
from asym_rlpo.modules import make_module
from asym_rlpo.utils.debugging import checkraise
from .base import Representation
class MLPRepresentation(Representation):
def __init__(self,... | [
"torch.nn.ReLU",
"asym_rlpo.modules.make_module",
"torch.nn.Sequential",
"more_itertools.pairwise",
"itertools.chain"
] | [((1001, 1024), 'torch.nn.Sequential', 'nn.Sequential', (['*modules'], {}), '(*modules)\n', (1014, 1024), True, 'import torch.nn as nn\n'), ((775, 803), 'itertools.chain', 'itt.chain', (['[input_dim]', 'dims'], {}), '([input_dim], dims)\n', (784, 803), True, 'import itertools as itt\n'), ((851, 897), 'asym_rlpo.modules... |
import json
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.markers import MarkerStyle
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
def plot_embeddings(reduced_data, phoneme_list, title):
consonants = ['w', 'b', 'ɡ', 'n', 'ʒ', 'ʃ', 'd', 'l', 'θ', 'ŋ', 'f', 'ɾ', ... | [
"matplotlib.pyplot.title",
"json.load",
"matplotlib.pyplot.show",
"sklearn.manifold.TSNE",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.text",
"numpy.array",
"sklearn.decomposition.PCA",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.tight_layout",
"matplotlib... | [((527, 536), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (534, 536), True, 'from matplotlib import pyplot as plt\n'), ((643, 661), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (659, 661), True, 'from matplotlib import pyplot as plt\n'), ((666, 681), 'matplotlib.pyplot.axis', 'plt.a... |
"""
Example
50000.234 => ...
271.02 => ...
0.222 => ...
0.000234 => ...
we need to know more than 1 or less than 1
"""
import math
def round_down(num,digits):
factor = 10.0 ** digits
return math.floor(num * factor) / factor
def calForPosition(price,tp,sl,side,amount_usdt):
"""
side : LONG or SHORT
... | [
"math.floor"
] | [((199, 223), 'math.floor', 'math.floor', (['(num * factor)'], {}), '(num * factor)\n', (209, 223), False, 'import math\n')] |
"""Tests the email worker."""
import datetime
import dnstwister
import patches
import worker_email
import worker_deltas
def test_subscription_email_timing(capsys, monkeypatch):
"""Test that email subscriptions and delta reporting are in sync.
A bug was found where, because signing up registers f... | [
"patches.SimpleKVDatabase",
"worker_deltas.process_domain",
"datetime.timedelta",
"patches.NoEmailer",
"worker_email.process_sub",
"datetime.datetime.now"
] | [((804, 823), 'patches.NoEmailer', 'patches.NoEmailer', ([], {}), '()\n', (821, 823), False, 'import patches\n'), ((1435, 1477), 'worker_email.process_sub', 'worker_email.process_sub', (['sub_id', 'sub_data'], {}), '(sub_id, sub_data)\n', (1459, 1477), False, 'import worker_email\n'), ((1713, 1749), 'worker_deltas.proc... |
#!/usr/bin/env python3
"""
This code is inspired by Angora's angora-clang
which is a modification of AFL's LLVM mode
We do not use any of the AFL internal macros/instrumentation
This is a compiler wrapper around gllvm, but wllvm will also work
The workflow is to build a project using the build setting,... | [
"os.getenv",
"argparse.ArgumentParser",
"os.path.basename",
"os.path.isdir",
"os.getcwd",
"os.path.realpath",
"os.path.exists",
"os.system",
"collections.defaultdict",
"subprocess.call",
"sys.stderr.write",
"os.path.join",
"os.listdir",
"sys.exit"
] | [((1239, 1265), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (1255, 1265), False, 'import os\n'), ((1304, 1334), 'os.path.join', 'os.path.join', (['SCRIPT_DIR', '""".."""'], {}), "(SCRIPT_DIR, '..')\n", (1316, 1334), False, 'import os\n'), ((1345, 1372), 'os.path.isdir', 'os.path.isdir', ... |
# -*- coding: utf-8 -*-
import abc
import multiprocessing
import logging
import random
import threading
import time
from tinyq.exceptions import JobFailedError
from tinyq.job import Job
logger = logging.getLogger(__name__)
class BaseWorker(metaclass=abc.ABCMeta):
@abc.abstractmethod
def run_once(self):
... | [
"threading.Thread",
"random.SystemRandom",
"tinyq.job.Job.loads",
"threading.Event",
"multiprocessing.Event",
"multiprocessing.Process",
"logging.getLogger"
] | [((197, 224), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (214, 224), False, 'import logging\n'), ((1143, 1158), 'tinyq.job.Job.loads', 'Job.loads', (['data'], {}), '(data)\n', (1152, 1158), False, 'from tinyq.job import Job\n'), ((2094, 2109), 'tinyq.job.Job.loads', 'Job.loads', (['da... |
from torchvision import models
from data import norm
# load models from torchvision.models, you also can load your own models
def load_models(source_model_names, device):
source_models = []
for model_name in source_model_names:
print("Loading model: {}".format(model_name))
source_mode... | [
"data.norm"
] | [((761, 772), 'data.norm', 'norm', (['X_adv'], {}), '(X_adv)\n', (765, 772), False, 'from data import norm\n')] |
import logging
logger = logging.getLogger("project")
def Device_datagram_reception_handler(sender, **kwargs):
timestamp=kwargs['timestamp']
deviceName=kwargs['DeviceName']
datagramID=kwargs['DatagramId']
values=kwargs['values']
print("SIGNALS: The device "+ deviceName+" responded OK to the ... | [
"logging.getLogger"
] | [((25, 53), 'logging.getLogger', 'logging.getLogger', (['"""project"""'], {}), "('project')\n", (42, 53), False, 'import logging\n')] |
import pytest
from coverage_comment import badge
@pytest.mark.parametrize(
"line_rate, badge_json",
[
(
0.2,
"""{"schemaVersion": 1, "label": "Coverage", "message": "20%", "color": "red"}""",
),
(
0.8,
"""{"schemaVersion": 1, "label": "C... | [
"coverage_comment.badge.parse_badge",
"pytest.mark.parametrize",
"coverage_comment.badge.get_badge_shield_url",
"coverage_comment.badge.compute_badge"
] | [((53, 400), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""line_rate, badge_json"""', '[(0.2,\n \'{"schemaVersion": 1, "label": "Coverage", "message": "20%", "color": "red"}\'\n ), (0.8,\n \'{"schemaVersion": 1, "label": "Coverage", "message": "80%", "color": "orange"}\'\n ), (1.0,\n \'{"sc... |
try:
import cv2
import numpy as np
except ImportError as e:
packages = ["opencv-python", "numpy"]
from pip._internal import main as install
for package in packages:
install(["install", package])
finally:
pass
img = cv2.imread("avatar.jpg")
top_head, bottom_head = (107, 42),(197 ,127)
... | [
"cv2.waitKey",
"cv2.imread",
"pip._internal.main",
"cv2.setMouseCallback",
"cv2.imshow"
] | [((249, 273), 'cv2.imread', 'cv2.imread', (['"""avatar.jpg"""'], {}), "('avatar.jpg')\n", (259, 273), False, 'import cv2\n'), ((592, 620), 'cv2.imshow', 'cv2.imshow', (['"""Image RIO"""', 'img'], {}), "('Image RIO', img)\n", (602, 620), False, 'import cv2\n'), ((625, 671), 'cv2.setMouseCallback', 'cv2.setMouseCallback'... |
"""Script to create PCA plot to compare similarity of binned CpG methylation."""
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from scipy.special import logit
from functools import reduce
KIT = {
'FtubeA... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"pandas.DataFrame",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"pandas.read_csv",
"matplotlib.pyplot.close",
"pandas.merge",
"matplotlib.pyplot.subplots",
"scipy.special.logit",
"sklearn.decom... | [((2844, 2852), 'scipy.special.logit', 'logit', (['s'], {}), '(s)\n', (2849, 2852), False, 'from scipy.special import logit\n'), ((2865, 2879), 'pandas.Series', 'pd.Series', (['out'], {}), '(out)\n', (2874, 2879), True, 'import pandas as pd\n'), ((3454, 3482), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsiz... |
#!/usr/bin/env python3
from setuptools import setup
setup(
name="efficientpose",
description="Human pose estimation",
python_requires=">=3.6",
install_requires=[
"numpy",
"tensorflow", # ==2.5.1
"pymediainfo==5.0.3",
"scikit-image==0.17.2",
"sk-video==1.1.10",
... | [
"setuptools.setup"
] | [((54, 575), 'setuptools.setup', 'setup', ([], {'name': '"""efficientpose"""', 'description': '"""Human pose estimation"""', 'python_requires': '""">=3.6"""', 'install_requires': "['numpy', 'tensorflow', 'pymediainfo==5.0.3', 'scikit-image==0.17.2',\n 'sk-video==1.1.10', 'opencv-python']", 'extras_require': "{'torch... |
'''
Created by auto_sdk on 2017.06.08
'''
from top.api.base import RestApi
class AlibabaAliqinFcIotRechargeCardRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.bill_real = None
self.bill_source = None
self.eff_code = None
self.eff_tim... | [
"top.api.base.RestApi.__init__"
] | [((193, 229), 'top.api.base.RestApi.__init__', 'RestApi.__init__', (['self', 'domain', 'port'], {}), '(self, domain, port)\n', (209, 229), False, 'from top.api.base import RestApi\n')] |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Author: <NAME>
# Copyright © 2020 <NAME>
# License: MIT
# -----------------------------------------------------------------------------
"""
Profile experiment
======================
The code is completely determin... | [
"pandas.DataFrame",
"numpy.random.seed",
"os.makedirs",
"pandas.read_csv",
"os.path.exists",
"logging.info",
"sklearn.neighbors.KNeighborsClassifier",
"numpy.arange",
"os.path.join"
] | [((804, 821), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (818, 821), True, 'import numpy as np\n'), ((2663, 2725), 'os.path.join', 'os.path.join', (['data_dir', 'genre', 'subset', 'f"""{split}-features.csv"""'], {}), "(data_dir, genre, subset, f'{split}-features.csv')\n", (2675, 2725), False, 'impor... |
# Copyright 2021 Fabrica Software, LLC
import os
import iograft
import iobasictypes
class JoinPath(iograft.Node):
"""
Join two paths. Wrapper around os.path.join() for two paths.
"""
dirname = iograft.InputDefinition("dirname", iobasictypes.String())
basename = iograft.InputDefinition("basename"... | [
"iograft.GetInput",
"iobasictypes.String",
"iograft.NodeDefinition",
"os.path.join",
"iograft.SetOutput"
] | [((248, 269), 'iobasictypes.String', 'iobasictypes.String', ([], {}), '()\n', (267, 269), False, 'import iobasictypes\n'), ((322, 343), 'iobasictypes.String', 'iobasictypes.String', ([], {}), '()\n', (341, 343), False, 'import iobasictypes\n'), ((389, 410), 'iobasictypes.String', 'iobasictypes.String', ([], {}), '()\n'... |
import os
import logging
import zipfile
from flask import request, Response, current_app as app
from flask_restful import reqparse, abort, Resource
from .services import PmanService, ServiceException
from .mount_dir import MountDir
logger = logging.getLogger(__name__)
parser = reqparse.RequestParser(bundle_errors... | [
"os.mkdir",
"flask.current_app.config.get",
"os.makedirs",
"os.path.isdir",
"flask.Response",
"flask_restful.reqparse.RequestParser",
"flask_restful.abort",
"os.path.exists",
"os.path.join",
"logging.getLogger"
] | [((246, 273), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (263, 273), False, 'import logging\n'), ((284, 326), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {'bundle_errors': '(True)'}), '(bundle_errors=True)\n', (306, 326), False, 'from flask_restful import re... |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""A script for backing up your Goodreads library."""
import argparse
import itertools
import json
from datetime import timezone, datetime
from xml.etree import ElementTree
from bs4 import BeautifulSoup
import re
import keyring
import requests
import csv
import os
... | [
"argparse.ArgumentParser",
"os.path.join",
"csv.writer",
"os.getcwd",
"xml.etree.ElementTree.fromstring",
"itertools.count",
"json.dumps",
"datetime.datetime.strptime",
"keyring.get_password",
"bs4.BeautifulSoup",
"re.search"
] | [((807, 851), 'keyring.get_password', 'keyring.get_password', (['"""goodreads"""', '"""user_id"""'], {}), "('goodreads', 'user_id')\n", (827, 851), False, 'import keyring\n'), ((866, 910), 'keyring.get_password', 'keyring.get_password', (['"""goodreads"""', '"""api_key"""'], {}), "('goodreads', 'api_key')\n", (886, 910... |
import os
import sys
from importlib import import_module
def add_parser(subparser, formatter_class):
parser = subparser.add_parser(
"extract", help="Extracts GeoJSON features from OpenStreetMap .pbf", formatter_class=formatter_class
)
inp = parser.add_argument_group("Inputs")
inp.add_argumen... | [
"os.path.expanduser"
] | [((846, 879), 'os.path.expanduser', 'os.path.expanduser', (['args.ext_path'], {}), '(args.ext_path)\n', (864, 879), False, 'import os\n')] |
"""
Configurations example. Create and tweak your own config.py
(see TODO). Your config.py will not be Git-tracked.
File describes spreadsheet architecture, including
columns style, data validation, tracked repositories, etc.
"""
import copy
import fill_funcs
# {<label name>: <project name>}
PROJECTS_LABELS = {
... | [
"copy.deepcopy"
] | [((2926, 2948), 'copy.deepcopy', 'copy.deepcopy', (['COLUMNS'], {}), '(COLUMNS)\n', (2939, 2948), False, 'import copy\n'), ((3032, 3054), 'copy.deepcopy', 'copy.deepcopy', (['COLUMNS'], {}), '(COLUMNS)\n', (3045, 3054), False, 'import copy\n'), ((3191, 3213), 'copy.deepcopy', 'copy.deepcopy', (['COLUMNS'], {}), '(COLUM... |
#!/usr/bin/env python
# *****************************************************************
# Copyright 2013 MIT Lincoln Laboratory
# Project: SPAR
# Authors: mjr
# Description: This reads through a pcap file and extracts
# metadata regarding packets of interest an... | [
"sys.path.append",
"scapy.utils.rdpcap",
"argparse.ArgumentParser",
"os.path.realpath",
"spar_python.perf_monitoring.network_log_parser.NetworkLogEntry",
"spar_python.perf_monitoring.network_log_parser.NetworkLogReader",
"os.path.join",
"csv.DictWriter"
] | [((935, 969), 'os.path.join', 'os.path.join', (['this_dir', '""".."""', '""".."""'], {}), "(this_dir, '..', '..')\n", (947, 969), False, 'import os\n'), ((970, 995), 'sys.path.append', 'sys.path.append', (['base_dir'], {}), '(base_dir)\n', (985, 995), False, 'import sys\n'), ((896, 922), 'os.path.realpath', 'os.path.re... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------
# Filename: nlloc.py
# Purpose: plugin for reading and writing GridData object into various format
# Author: uquake development team
# Email: <EMAIL>
#
# Copyright (C) 2016 uquake development team
# ---------------------... | [
"pickle.dump",
"uuid.uuid4",
"vtk.vtkXMLImageDataWriter",
"numpy.fromfile",
"pathlib.Path",
"numpy.product",
"vtk.vtkImageData"
] | [((4231, 4249), 'vtk.vtkImageData', 'vtk.vtkImageData', ([], {}), '()\n', (4247, 4249), False, 'import vtk\n'), ((4977, 5004), 'vtk.vtkXMLImageDataWriter', 'vtk.vtkXMLImageDataWriter', ([], {}), '()\n', (5002, 5004), False, 'import vtk\n'), ((5493, 5516), 'pathlib.Path', 'Path', (['f"""{filename}.hdr"""'], {}), "(f'{fi... |
import os
from docutils import nodes
from docutils.parsers.rst import directives
from sphinxcontrib.test_reports.directives import TestCommonDirective
class TestReport(nodes.General, nodes.Element):
pass
class TestReportDirective(TestCommonDirective):
"""
Directive for showing test suites.
"""
... | [
"os.path.dirname"
] | [((1009, 1034), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1024, 1034), False, 'import os\n')] |
# -*- coding: utf-8 -*-
import datetime
from flask import current_app
from purchasing.extensions import db
from purchasing.notifications import Notification
from purchasing.jobs.job_base import JobBase, EmailJobBase
from purchasing.opportunities.models import Opportunity, Vendor, Category
from purchasing.public.mode... | [
"datetime.date",
"datetime.date.today",
"purchasing.public.models.AppStatus.query.first",
"datetime.datetime.utcnow",
"purchasing.extensions.db.func.DATE",
"purchasing.opportunities.models.Vendor.newsletter_subscribers",
"purchasing.opportunities.models.Category.id.in_"
] | [((4599, 4622), 'purchasing.public.models.AppStatus.query.first', 'AppStatus.query.first', ([], {}), '()\n', (4620, 4622), False, 'from purchasing.public.models import AppStatus\n'), ((2978, 3001), 'purchasing.public.models.AppStatus.query.first', 'AppStatus.query.first', ([], {}), '()\n', (2999, 3001), False, 'from pu... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-31 08:44
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('contribauthproxy', '0001_initial'),
... | [
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.IntegerField",
"django.db.models.DateTimeField"
] | [((455, 509), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'primary_key': '(True)', 'serialize': '(False)'}), '(primary_key=True, serialize=False)\n', (474, 509), False, 'from django.db import migrations, models\n'), ((541, 573), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(1... |
# Example from http://pandas.pydata.org/pandas-docs/stable/visualization.html#visualization
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from numpy.random import randn
from pandas import Series, date_range, DataFrame
ts = Series(randn(1000), index=date_range('1/1/2000', periods=1000))
ts =... | [
"matplotlib.use",
"pandas.date_range",
"matplotlib.pyplot.savefig",
"numpy.random.randn"
] | [((111, 132), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (125, 132), False, 'import matplotlib\n'), ((343, 366), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""test.png"""'], {}), "('test.png')\n", (354, 366), True, 'import matplotlib.pyplot as plt\n'), ((464, 487), 'matplotlib.pyplot.save... |
"""Support for Genius Hub climate devices."""
from datetime import timedelta
from typing import List, Optional
import voluptuous as vol
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
CURRENT_HVAC_OFF,
... | [
"voluptuous.Range",
"voluptuous.Optional",
"voluptuous.Required",
"datetime.timedelta",
"homeassistant.helpers.entity_platform.current_platform.get",
"voluptuous.In",
"voluptuous.Coerce"
] | [((2277, 2315), 'homeassistant.helpers.entity_platform.current_platform.get', 'entity_platform.current_platform.get', ([], {}), '()\n', (2313, 2315), False, 'from homeassistant.helpers import config_validation as cv, entity_platform\n'), ((1272, 1300), 'voluptuous.Required', 'vol.Required', (['ATTR_ENTITY_ID'], {}), '(... |
from eds.event import Event
def test_eds_built_property():
e = Event(True, False, 'url', 'project_name', 'project_version')
assert e.eds_built
e = Event(False, True, 'url', 'project_name', 'project_version')
assert not e.eds_built
def test_eds_plugins_built_property():
e = Event(False, True, 'ur... | [
"eds.event.Event"
] | [((69, 129), 'eds.event.Event', 'Event', (['(True)', '(False)', '"""url"""', '"""project_name"""', '"""project_version"""'], {}), "(True, False, 'url', 'project_name', 'project_version')\n", (74, 129), False, 'from eds.event import Event\n'), ((161, 221), 'eds.event.Event', 'Event', (['(False)', '(True)', '"""url"""', ... |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Backward compatibility for old results API.
This module helps convert the old PageMeasurementResults API into the new
style one. This exists as a bridging... | [
"telemetry.value.scalar.ScalarValue",
"telemetry.value.list_of_scalar_values.ListOfScalarValues",
"telemetry.value.histogram.HistogramValue",
"telemetry.value.ValueNameFromTraceAndChartName"
] | [((794, 861), 'telemetry.value.ValueNameFromTraceAndChartName', 'value_module.ValueNameFromTraceAndChartName', (['trace_name', 'chart_name'], {}), '(trace_name, chart_name)\n', (837, 861), True, 'from telemetry import value as value_module\n'), ((943, 1035), 'telemetry.value.list_of_scalar_values.ListOfScalarValues', '... |
"""GCE Eco-Devices integration."""
import asyncio
from datetime import timedelta
import logging
from pyecodevices import (
EcoDevices,
EcoDevicesCannotConnectError,
EcoDevicesInvalidAuthError,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_HOST,
CONF_... | [
"homeassistant.helpers.device_registry.async_get_registry",
"homeassistant.helpers.update_coordinator.UpdateFailed",
"datetime.timedelta",
"logging.getLogger",
"homeassistant.helpers.aiohttp_client.async_get_clientsession"
] | [((843, 870), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (860, 870), False, 'import logging\n'), ((1191, 1227), 'homeassistant.helpers.aiohttp_client.async_get_clientsession', 'async_get_clientsession', (['hass', '(False)'], {}), '(hass, False)\n', (1214, 1227), False, 'from homeassis... |
# Generated by Django 3.2.9 on 2021-11-08 17:59
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('notes', '0004_auto_20211108_1714'),
]
operations = [
migrations.AlterField(
model_name='note',
... | [
"django.db.models.DateTimeField"
] | [((365, 464), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'blank': '(True)', 'default': 'django.utils.timezone.now', 'verbose_name': '"""update time"""'}), "(blank=True, default=django.utils.timezone.now,\n verbose_name='update time')\n", (385, 464), False, 'from django.db import migrations, mode... |