code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import random, os, string, subprocess, shutil, requests
from discord import Webhook, RequestsWebhookAdapter, Embed
from dotenv import dotenv_values
import argparse, colorama
from colorama import Fore
class Settings():
def __init__(self):
for k, v in dotenv_values(".settings").items():
setattr(... | [
"os.listdir",
"discord.RequestsWebhookAdapter",
"argparse.ArgumentParser",
"shutil.move",
"os.path.isfile",
"random.choices",
"os.path.isdir",
"os.mkdir",
"dotenv.dotenv_values",
"discord.Embed",
"colorama.init"
] | [((4178, 4207), 'colorama.init', 'colorama.init', ([], {'autoreset': '(True)'}), '(autoreset=True)\n', (4191, 4207), False, 'import argparse, colorama\n'), ((4221, 4246), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4244, 4246), False, 'import argparse, colorama\n'), ((781, 812), 'random.cho... |
"""Bin Testing"""
# standard library
from importlib.machinery import SourceFileLoader
from importlib.util import module_from_spec, spec_from_loader
from typing import List
# third-party
from typer.testing import CliRunner
# dynamically load bin/tcex file
spec = spec_from_loader('app', SourceFileLoader('app', 'bin/tce... | [
"typer.testing.CliRunner",
"importlib.machinery.SourceFileLoader",
"importlib.util.module_from_spec"
] | [((336, 358), 'importlib.util.module_from_spec', 'module_from_spec', (['spec'], {}), '(spec)\n', (352, 358), False, 'from importlib.util import module_from_spec, spec_from_loader\n'), ((506, 517), 'typer.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (515, 517), False, 'from typer.testing import CliRunner\n'), ((28... |
# Copyright 2019 <NAME>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | [
"torch.get_default_dtype",
"mt.mvae.distributions.von_mises_fisher.VonMisesFisher",
"torch.isfinite",
"pytest.mark.parametrize",
"torch.norm",
"mt.mvae.utils.set_seeds",
"torch.Size",
"torch.ones"
] | [((1130, 1166), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""dim"""', 'dims'], {}), "('dim', dims)\n", (1153, 1166), False, 'import pytest\n'), ((1168, 1208), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""scale"""', 'scales'], {}), "('scale', scales)\n", (1191, 1208), False, 'import pytest\... |
from abc import ABCMeta, abstractmethod
import torch
import torch.nn.functional as F
from addict import Dict
from mmtrack.models import TRACKERS
@TRACKERS.register_module()
class BaseTracker(metaclass=ABCMeta):
"""Base tracker model.
Args:
momentums (dict[str:float], optional): Momentums to update ... | [
"addict.Dict",
"mmtrack.models.TRACKERS.register_module",
"torch.tensor",
"torch.cat",
"torch.nn.functional.interpolate",
"torch.clamp"
] | [((150, 176), 'mmtrack.models.TRACKERS.register_module', 'TRACKERS.register_module', ([], {}), '()\n', (174, 176), False, 'from mmtrack.models import TRACKERS\n'), ((3686, 3692), 'addict.Dict', 'Dict', ([], {}), '()\n', (3690, 3692), False, 'from addict import Dict\n'), ((4028, 4034), 'addict.Dict', 'Dict', ([], {}), '... |
# Copyright 2019-2022 The University of Manchester, UK
# Copyright 2020-2022 Vlaams Instituut voor Biotechnologie (VIB), BE
# Copyright 2020-2022 Barcelona Supercomputing Center (BSC), ES
# Copyright 2020-2022 Center for Advanced Studies, Research and Development in Sardinia (CRS4), IT
# Copyright 2022 École Polytechni... | [
"shutil.copytree",
"json.load",
"rocrate.utils.get_norm_value",
"pathlib.Path"
] | [((3514, 3534), 'pathlib.Path', 'pathlib.Path', (['tmpdir'], {}), '(tmpdir)\n', (3526, 3534), False, 'import pathlib\n'), ((3616, 3661), 'shutil.copytree', 'shutil.copytree', (['(THIS_DIR / TEST_DATA_NAME)', 'd'], {}), '(THIS_DIR / TEST_DATA_NAME, d)\n', (3631, 3661), False, 'import shutil\n'), ((1002, 1024), 'pathlib.... |
#!/usr/bin/python3
import binascii
import random
import cosim
class LoopbackTester(cosim.CosimBase):
"""Provides methods to test the loopback simulations."""
def test_list(self):
ifaces = self.cosim.list().wait().ifaces
assert len(ifaces) > 0
def test_open_close(self):
ifaces = self.cosim.list().... | [
"binascii.hexlify",
"random.randint",
"random.randrange"
] | [((872, 900), 'random.randrange', 'random.randrange', (['(0)', '(2 ** 24)'], {}), '(0, 2 ** 24)\n', (888, 900), False, 'import random\n'), ((616, 642), 'random.randint', 'random.randint', (['(0)', '(2 ** 32)'], {}), '(0, 2 ** 32)\n', (630, 642), False, 'import random\n'), ((1182, 1204), 'binascii.hexlify', 'binascii.he... |
from typing import List, Optional, Tuple
from collections import defaultdict
from mp_api.core.client import BaseRester, MPRestError
import warnings
class DielectricRester(BaseRester):
suffix = "dielectric"
def get_dielectric_from_material_id(self, material_id: str):
"""
Get dielectric data... | [
"warnings.warn",
"mp_api.core.client.MPRestError",
"collections.defaultdict"
] | [((2116, 2133), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (2127, 2133), False, 'from collections import defaultdict\n'), ((707, 739), 'mp_api.core.client.MPRestError', 'MPRestError', (['"""No document found"""'], {}), "('No document found')\n", (718, 739), False, 'from mp_api.core.client imp... |
from wtforms import TextField, IntegerField, PasswordField
from wtforms.ext.sqlalchemy.fields import (
QuerySelectField, QuerySelectMultipleField)
from wtforms.validators import Required
from pynuts.view import BaseForm
import database
from application import nuts
class EmployeeView(nuts.ModelView):
model = ... | [
"wtforms.IntegerField",
"wtforms.validators.Required",
"wtforms.ext.sqlalchemy.fields.QuerySelectField",
"wtforms.TextField",
"database.Employee.query.filter_by"
] | [((645, 663), 'wtforms.IntegerField', 'IntegerField', (['"""ID"""'], {}), "('ID')\n", (657, 663), False, 'from wtforms import TextField, IntegerField, PasswordField\n'), ((946, 973), 'wtforms.TextField', 'TextField', (['u"""Employee name"""'], {}), "(u'Employee name')\n", (955, 973), False, 'from wtforms import TextFie... |
"""AirTouch 4 component to control of AirTouch 4 Climate Devices."""
from __future__ import annotations
import logging
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
FAN_AUTO,
FAN_DIFFUSE,
FAN_FOCUS,
FAN_HIGH,
FAN_LOW,
FAN_MEDIUM... | [
"logging.getLogger",
"homeassistant.helpers.entity.DeviceInfo"
] | [((1753, 1780), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1770, 1780), False, 'import logging\n'), ((3197, 3312), 'homeassistant.helpers.entity.DeviceInfo', 'DeviceInfo', ([], {'identifiers': '{(DOMAIN, self.unique_id)}', 'name': 'self.name', 'manufacturer': '"""Airtouch"""', 'model... |
"""
Error classes, when needed for exceptions.
"""
from _ast import AST
from dataclasses import dataclass, field
from typing import Optional, Union
from src.compiler.Util import Util
@dataclass(frozen=True)
class ObjectAlreadyDefinedError(NameError):
"""
For our compilation scheme, objects can only be define... | [
"src.compiler.Util.Util.get_name",
"dataclasses.dataclass",
"dataclasses.field"
] | [((187, 209), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (196, 209), False, 'from dataclasses import dataclass, field\n'), ((712, 734), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (721, 734), False, 'from dataclasses import dataclass, fi... |
# -*- coding: utf-8 -*-
import argparse
from github.accounts.github_account import GithubAccount
from github.domain.github import GithubUser
from github.recorders.github.common import get_result
from zvdata.api import get_entities
from zvdata.domain import get_db_session
from zvdata.recorder import TimeSeriesDataRecor... | [
"argparse.ArgumentParser",
"github.accounts.github_account.GithubAccount.get_token",
"zvdata.utils.time_utils.now_pd_timestamp",
"github.domain.github.GithubUser.updated_timestamp.is_",
"zvdata.domain.get_db_session",
"zvdata.utils.time_utils.day_offset_today"
] | [((3955, 3980), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3978, 3980), False, 'import argparse\n'), ((1412, 1489), 'zvdata.domain.get_db_session', 'get_db_session', ([], {'provider': 'self.entity_provider', 'data_schema': 'self.entity_schema'}), '(provider=self.entity_provider, data_schem... |
# Importing needed libraries
import uuid
from decouple import config
from dotenv import load_dotenv
from flask import Flask, render_template, request, jsonify
from sklearn.externals import joblib
import traceback
import pandas as pd
import numpy as np
from flask_sqlalchemy import SQLAlchemy
# Saving DB var
DB = SQLAlc... | [
"traceback.format_exc",
"flask.Flask",
"sklearn.externals.joblib.load",
"decouple.config",
"dotenv.load_dotenv",
"pandas.DataFrame",
"flask_sqlalchemy.SQLAlchemy"
] | [((314, 326), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (324, 326), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((361, 374), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (372, 374), False, 'from dotenv import load_dotenv\n'), ((526, 541), 'flask.Flask', 'Flask', (['__name__'], {}... |
import pandas as pd
import os
from sklearn.svm import SVC
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import classification_report, confusion_matrix
from sklearn.model_selection import train_test_split
import pickle
BASE_PATH = os.path.join(os.getcwd() , "dataset")
df = None
i = 0
for file_na... | [
"os.listdir",
"sklearn.metrics.confusion_matrix",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.classification_report",
"os.path.join",
"os.getcwd",
"sklearn.preprocessing.StandardScaler",
"sklearn.svm.SVC"
] | [((326, 347), 'os.listdir', 'os.listdir', (['BASE_PATH'], {}), '(BASE_PATH)\n', (336, 347), False, 'import os\n'), ((772, 788), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (786, 788), False, 'from sklearn.preprocessing import StandardScaler\n'), ((886, 934), 'sklearn.model_selection.trai... |
from flask import Flask
# import pyodbc
app = Flask(__name__)
@app.route("/")
def hello():
# Some other example server values are
# server = 'localhost\sqlexpress' # for a named instance
# server = 'myserver,port' # to specify an alternate port
# server = 'tcp:mytest.centralus.cloudapp.azure.com... | [
"flask.Flask"
] | [((47, 62), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (52, 62), False, 'from flask import Flask\n')] |
from sweeps.sweepFunctions import *
import numpy as np
def SMTBFSweep(SMTBFSweepInput,ourInput):
myRange = SMTBFSweepInput["range"] if dictHasKey(SMTBFSweepInput,"range") else False
myStickyRange=SMTBFSweepInput["sticky-range"] if dictHasKey(SMTBFSweepInput,"sticky-range") else False
sticky=False if type(... | [
"numpy.arange"
] | [((926, 966), 'numpy.arange', 'np.arange', (['minimum', '(maximum + step)', 'step'], {}), '(minimum, maximum + step, step)\n', (935, 966), True, 'import numpy as np\n'), ((1074, 1114), 'numpy.arange', 'np.arange', (['minimum', '(maximum + step)', 'step'], {}), '(minimum, maximum + step, step)\n', (1083, 1114), True, 'i... |
from __future__ import unicode_literals
import pytest # noqa
import sys
pytestmark = pytest.mark.skipif(sys.version_info[0] < 3,
reason="pyecore is not Python 2 compatible") # noqa
pyecore = pytest.importorskip("pyecore") # noqa
import textx
from textx.metamodel import metamodel_from_... | [
"textx.enable_pyecore_support",
"pytest.importorskip",
"pytest.mark.usefixtures",
"pytest.mark.skipif",
"pytest.fixture",
"textx.metamodel.metamodel_from_str"
] | [((86, 179), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(sys.version_info[0] < 3)'], {'reason': '"""pyecore is not Python 2 compatible"""'}), "(sys.version_info[0] < 3, reason=\n 'pyecore is not Python 2 compatible')\n", (104, 179), False, 'import pytest\n'), ((225, 255), 'pytest.importorskip', 'pytest.importors... |
# -*- coding: utf-8 -*-
import boto3
from botocore.exceptions import ClientError
import attr
from attrs_mate import AttrsClass
import weakref
@attr.s
class S3Object(AttrsClass):
aws_profile = attr.ib()
bucket = attr.ib() # type: str
key = attr.ib() # type: str
_s3_client_cache = weakref.WeakValueDic... | [
"boto3.session.Session",
"weakref.WeakValueDictionary",
"attr.ib"
] | [((199, 208), 'attr.ib', 'attr.ib', ([], {}), '()\n', (206, 208), False, 'import attr\n'), ((222, 231), 'attr.ib', 'attr.ib', ([], {}), '()\n', (229, 231), False, 'import attr\n'), ((254, 263), 'attr.ib', 'attr.ib', ([], {}), '()\n', (261, 263), False, 'import attr\n'), ((300, 329), 'weakref.WeakValueDictionary', 'weak... |
from android.runnable import run_on_ui_thread
from jnius import autoclass, cast
mActivity = autoclass("org.kivy.android.PythonActivity").mActivity
Toast = autoclass("android.widget.Toast")
CharSequence = autoclass("java.lang.CharSequence")
String = autoclass("java.lang.String")
@run_on_ui_thread
def android_toast(t... | [
"jnius.autoclass"
] | [((157, 190), 'jnius.autoclass', 'autoclass', (['"""android.widget.Toast"""'], {}), "('android.widget.Toast')\n", (166, 190), False, 'from jnius import autoclass, cast\n'), ((206, 241), 'jnius.autoclass', 'autoclass', (['"""java.lang.CharSequence"""'], {}), "('java.lang.CharSequence')\n", (215, 241), False, 'from jnius... |
#!/usr/bin/env python3
# coding: utf-8
# author: <NAME> <<EMAIL>>
import pandas as pd
import numpy as np
from itertools import islice
from sklearn.utils.validation import check_X_y
class KTopScoringPair:
""" K-Top Scoring Pair classifier.
This classifier evaluate maximum-likelihood estimation for P(X_i <... | [
"pandas.Series",
"numpy.unique",
"numpy.argmax",
"multiprocessing.Pool",
"copy.deepcopy",
"pandas.DataFrame",
"pandas.concat",
"sklearn.utils.validation.check_X_y"
] | [((2475, 2490), 'sklearn.utils.validation.check_X_y', 'check_X_y', (['X', 'y'], {}), '(X, y)\n', (2484, 2490), False, 'from sklearn.utils.validation import check_X_y\n'), ((2594, 2627), 'numpy.unique', 'np.unique', (['y'], {'return_inverse': '(True)'}), '(y, return_inverse=True)\n', (2603, 2627), True, 'import numpy as... |
'''
@brief Base class for system data classes.
This class defines the interface for cata classes which are intended to hold
a specific data item (packet, channel, event). This data item includes the time
of the data as well as data such as channel value or argument value.
@date Created July 2, 2018
@author <NAME> (<E... | [
"fprime.common.models.serialize.time_type.TimeType",
"fprime.common.models.serialize.time_type.TimeType.compare",
"fprime_gds.common.templates.data_template.DataTemplate"
] | [((2155, 2197), 'fprime.common.models.serialize.time_type.TimeType.compare', 'time_type.TimeType.compare', (['x.time', 'y.time'], {}), '(x.time, y.time)\n', (2181, 2197), False, 'from fprime.common.models.serialize import time_type\n'), ((1027, 1055), 'fprime_gds.common.templates.data_template.DataTemplate', 'data_temp... |
##
# Copyright (c) 2011-2015 Apple 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 applicable l... | [
"txdav.carddav.datastore.index_file.sqladdressbookquery",
"txdav.carddav.datastore.query.filter.FilterBase.deserialize",
"twistedcaldav.carddavxml.TextMatch.fromString",
"txdav.common.datastore.query.generator.SQLQueryGenerator",
"txdav.carddav.datastore.query.filter.Filter",
"twext.enterprise.dal.syntax.... | [((1553, 1567), 'txdav.carddav.datastore.query.filter.Filter', 'Filter', (['filter'], {}), '(filter)\n', (1559, 1567), False, 'from txdav.carddav.datastore.query.filter import Filter, FilterBase\n'), ((1590, 1632), 'txdav.carddav.datastore.query.builder.buildExpression', 'buildExpression', (['filter', 'self._queryField... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
WSGI script
Setup Application, Authentication, ...
"""
import os
from eve import Eve
from evedom import loader
# from your_app.authentication.token import TokenBasedAuth
__author__ = "nam4dev"
__created__ = '08/11/2017'
ROOT_PATH = os.path.dirname(
os.pa... | [
"os.path.abspath",
"eve.Eve",
"evedom.loader.init",
"os.path.join"
] | [((362, 400), 'os.path.join', 'os.path.join', (['ROOT_PATH', '"""settings.py"""'], {}), "(ROOT_PATH, 'settings.py')\n", (374, 400), False, 'import os\n'), ((315, 340), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (330, 340), False, 'import os\n'), ((749, 775), 'eve.Eve', 'Eve', ([], {'setti... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2019-01-18 17:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('workflow', '0026_auto_20190116_1357'),
]
operation... | [
"django.db.models.AutoField",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((443, 536), '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", (459, 536), False, 'from django.db import migrations, models\... |
import sys, os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import random
from util.util import pad, detect_aes_ecb, generate_key, ammend_plaintext, encrypt_random
# Chosen plaintext
plaintext = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
# Generate data and encrypt plaintext
key = g... | [
"util.util.encrypt_random",
"util.util.generate_key",
"util.util.detect_aes_ecb",
"os.path.abspath",
"util.util.ammend_plaintext"
] | [((319, 333), 'util.util.generate_key', 'generate_key', ([], {}), '()\n', (331, 333), False, 'from util.util import pad, detect_aes_ecb, generate_key, ammend_plaintext, encrypt_random\n'), ((396, 426), 'util.util.encrypt_random', 'encrypt_random', (['key', 'plaintext'], {}), '(key, plaintext)\n', (410, 426), False, 'fr... |
# Copyright (c) 2017 Uber Technologies, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | [
"yaml.safe_dump",
"builtins.input",
"example.utils.fail_print",
"example.utils.success_print",
"uber_rides.client.UberRidesClient",
"example.utils.response_print",
"example.utils.import_app_credentials"
] | [((3077, 3106), 'example.utils.response_print', 'response_print', (['login_message'], {}), '(login_message)\n', (3091, 3106), False, 'from example.utils import response_print\n'), ((3986, 4029), 'uber_rides.client.UberRidesClient', 'UberRidesClient', (['session'], {'sandbox_mode': '(True)'}), '(session, sandbox_mode=Tr... |
# -*- coding: utf-8 -*-
""" A data clustering widget for the Orange3.
This is a data clustering widget for Orange3, that implements the OPTICS algorithm.
OPTICS stands for "Ordering Points To Identify the Clustering Structure".
This is a very useful algorithm for clustering data when the dataset is unlabel... | [
"Orange.widgets.utils.signals.Input",
"numpy.hstack",
"numpy.array",
"Orange.widgets.utils.widgetpreview.WidgetPreview",
"numpy.arange",
"Orange.widgets.utils.slidergraph.SliderGraph",
"Orange.widgets.utils.signals.Output",
"pyqtgraph.functions.intColor",
"Orange.widgets.settings.Setting",
"Orange... | [((3836, 3855), 'Orange.widgets.settings.Setting', 'settings.Setting', (['(5)'], {}), '(5)\n', (3852, 3855), False, 'from Orange.widgets import settings\n'), ((3877, 3897), 'Orange.widgets.settings.Setting', 'settings.Setting', (['(11)'], {}), '(11)\n', (3893, 3897), False, 'from Orange.widgets import settings\n'), ((3... |
#!/usr/bin/python3
## Tommy
from botbase import *
_frankfurt_st = re.compile(r"Stand:\s*(\d\d?\. *\w+ 20\d\d, \d\d?(?::\d\d)?) Uhr")
def frankfurt(sheets):
import locale
locale.setlocale(locale.LC_TIME, "de_DE.UTF-8")
soup = get_soup("https://frankfurt.de/service-und-rathaus/verwaltung/aemter-und-instituti... | [
"locale.setlocale"
] | [((179, 226), 'locale.setlocale', 'locale.setlocale', (['locale.LC_TIME', '"""de_DE.UTF-8"""'], {}), "(locale.LC_TIME, 'de_DE.UTF-8')\n", (195, 226), False, 'import locale\n')] |
# Copyright 2013-2018 Aerospike, 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 agreed to in writ... | [
"signal.signal",
"signal.setitimer"
] | [((1022, 1065), 'signal.signal', 'signal.signal', (['signal.SIGALRM', 'self.handler'], {}), '(signal.SIGALRM, self.handler)\n', (1035, 1065), False, 'import signal\n'), ((1098, 1148), 'signal.setitimer', 'signal.setitimer', (['signal.ITIMER_REAL', 'self.timeout'], {}), '(signal.ITIMER_REAL, self.timeout)\n', (1114, 114... |
import lanelines
from compgraph import CompGraph, CompGraphRunner
import numpy as np
import cv2
func_dict = {
'grayscale': lanelines.grayscale,
'get_image_shape': lambda im : im.shape,
'canny': lanelines.canny,
'define_lanes_region': lanelines.define_lanes_region,
'apply_region_mask': lanelines.ap... | [
"compgraph.CompGraph"
] | [((1658, 1687), 'compgraph.CompGraph', 'CompGraph', (['func_dict', 'func_io'], {}), '(func_dict, func_io)\n', (1667, 1687), False, 'from compgraph import CompGraph, CompGraphRunner\n')] |
# LSTM(GRU) 예시 : KODEX200 주가 (2010 ~ 현재)를 예측해 본다.
# KODEX200의 종가와, 10일, 40일 이동평균을 이용하여 향후 10일 동안의 종가를 예측해 본다.
# 과거 20일 (step = 20) 종가, 이동평균 패턴을 학습하여 예측한다.
# 일일 주가에 대해 예측이 가능할까 ??
#
# 2018.11.22, 아마추어퀀트 (조성현)
# --------------------------------------------------------------------------
import tensorflow as tf
import nump... | [
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"numpy.array",
"numpy.reshape",
"tensorflow.placeholder",
"tensorflow.contrib.layers.fully_connected",
"tensorflow.Session",
"matplotlib.pyplot.plot",
"tensorflow.nn.rnn_cell.LSTMCell",
"tensorflow.nn.dynamic_rnn",
"matplotlib.pyplot.xlabel",
"num... | [((1239, 1304), 'pandas.read_csv', 'pd.read_csv', (['"""StockData/^KS11.csv"""'], {'index_col': '(0)', 'parse_dates': '(True)'}), "('StockData/^KS11.csv', index_col=0, parse_dates=True)\n", (1250, 1304), True, 'import pandas as pd\n'), ((1310, 1335), 'pandas.DataFrame', 'pd.DataFrame', (["df['Close']"], {}), "(df['Clos... |
"""media.py: Module for movie_trailer_website, contains Movie class"""
import webbrowser
import urllib
import json
class Movie(object):
"""This class provides a way to store movie related information.
constructor takes movie title, imdb_id and a url for a youtube trailer as input.
All other values are po... | [
"urllib.urlopen",
"webbrowser.open"
] | [((658, 744), 'urllib.urlopen', 'urllib.urlopen', (["('http://www.omdbapi.com/?i=' + self.imdb_id + '&plot=short&r=json')"], {}), "('http://www.omdbapi.com/?i=' + self.imdb_id +\n '&plot=short&r=json')\n", (672, 744), False, 'import urllib\n'), ((1444, 1485), 'webbrowser.open', 'webbrowser.open', (['self.trailer_you... |
import torch
import torchvision
import torchvision.transforms as transforms
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from model_utils import *
class down(nn.Module):
"""
A class for creating neural network blocks containing layers:
Average P... | [
"torch.nn.functional.grid_sample",
"torch.nn.ReflectionPad2d",
"torch.load",
"torch.stack",
"torch.Tensor",
"torch.nn.functional.avg_pool2d",
"torch.nn.Conv2d",
"torch.nn.functional.sigmoid",
"torch.tensor",
"numpy.linspace",
"torch.cat",
"torch.sum",
"torch.nn.functional.interpolate",
"nu... | [((9659, 9687), 'numpy.linspace', 'np.linspace', (['(0.125)', '(0.875)', '(7)'], {}), '(0.125, 0.875, 7)\n', (9670, 9687), True, 'import numpy as np\n'), ((2256, 2274), 'torch.nn.functional.avg_pool2d', 'F.avg_pool2d', (['x', '(2)'], {}), '(x, 2)\n', (2268, 2274), True, 'import torch.nn.functional as F\n'), ((4759, 480... |
# -*- coding: utf-8 -*-
"""
In this file are all the needed functions to calculate an adaptive fractionation treatment plan. The value_eval and the result_calc function are the only ones that should be used
This file requires all sparing factors to be known, therefore, it isnt suited to do active treatment planning ... | [
"numpy.mean",
"numpy.sqrt",
"scipy.stats.invgamma.fit",
"numpy.delete",
"numpy.argmax",
"numpy.exp",
"numpy.zeros",
"numpy.outer",
"numpy.var",
"scipy.stats.truncnorm",
"numpy.meshgrid",
"time.time",
"numpy.arange"
] | [((1290, 1357), 'scipy.stats.truncnorm', 'truncnorm', (['((low - mean) / sd)', '((upp - mean) / sd)'], {'loc': 'mean', 'scale': 'sd'}), '((low - mean) / sd, (upp - mean) / sd, loc=mean, scale=sd)\n', (1299, 1357), False, 'from scipy.stats import truncnorm\n'), ((1803, 1832), 'numpy.arange', 'np.arange', (['(1e-05)', '(... |
import sys
from PySide2.QtWidgets import QApplication
from PySide2.QtGui import QColor
from pivy import quarter, coin, graphics, utils
class ConnectionMarker(graphics.Marker):
def __init__(self, points):
super(ConnectionMarker, self).__init__(points, True)
class ConnectionPolygon(graphics.Polygon):
s... | [
"PySide2.QtGui.QColor",
"pivy.graphics.InteractionSeparator",
"PySide2.QtWidgets.QApplication",
"pivy.quarter.QuarterWidget",
"pivy.utils.addMarkerFromSvg"
] | [((1444, 1466), 'PySide2.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (1456, 1466), False, 'from PySide2.QtWidgets import QApplication\n'), ((1471, 1526), 'pivy.utils.addMarkerFromSvg', 'utils.addMarkerFromSvg', (['"""test.svg"""', '"""CUSTOM_MARKER"""', '(40)'], {}), "('test.svg', 'CUST... |
"""
Functions used in pre-processing of data for the machine learning pipelines.
"""
import pandas as pd
from pandas.api.types import is_scalar
from pathlib import Path
from sklearn.model_selection import GroupShuffleSplit
def concat_annotated(datadir):
"""
Concatenate all "annotated_df_*_parsed*.pkl" files... | [
"sklearn.model_selection.GroupShuffleSplit",
"pandas.api.types.is_scalar",
"pandas.concat",
"pandas.read_pickle"
] | [((1185, 1226), 'pandas.concat', 'pd.concat', (['[annot, ze]'], {'ignore_index': '(True)'}), '([annot, ze], ignore_index=True)\n', (1194, 1226), True, 'import pandas as pd\n'), ((3682, 3754), 'sklearn.model_selection.GroupShuffleSplit', 'GroupShuffleSplit', ([], {'n_splits': '(1)', 'test_size': '(1 - train_size)', 'ran... |
import numpy as np
np.deprecate(1) # E: No overload variant
np.deprecate_with_doc(1) # E: incompatible type
np.byte_bounds(1) # E: incompatible type
np.who(1) # E: incompatible type
np.lookfor(None) # E: incompatible type
np.safe_eval(None) # E: incompatible type
| [
"numpy.deprecate_with_doc",
"numpy.deprecate",
"numpy.lookfor",
"numpy.who",
"numpy.byte_bounds",
"numpy.safe_eval"
] | [((20, 35), 'numpy.deprecate', 'np.deprecate', (['(1)'], {}), '(1)\n', (32, 35), True, 'import numpy as np\n'), ((63, 87), 'numpy.deprecate_with_doc', 'np.deprecate_with_doc', (['(1)'], {}), '(1)\n', (84, 87), True, 'import numpy as np\n'), ((113, 130), 'numpy.byte_bounds', 'np.byte_bounds', (['(1)'], {}), '(1)\n', (12... |
# Generated by Django 3.1.7 on 2021-05-06 23:57
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mentorships', '0001_initial'),
('activities', '0007_activity_enrollment'),
]
operations = [
migrati... | [
"django.db.migrations.RemoveField",
"django.db.models.ForeignKey"
] | [((313, 377), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""activity"""', 'name': '"""enrollment"""'}), "(model_name='activity', name='enrollment')\n", (335, 377), False, 'from django.db import migrations, models\n'), ((527, 692), 'django.db.models.ForeignKey', 'models.ForeignKey... |
import numpy as np
import pandas as pd
from scipy import signal,stats
from flask import Flask,request,jsonify
import json
import re
import os
import data_utils as utils
import sklearn.preprocessing as pre
configpath=os.path.join(os.path.dirname(__file__),'config.txt')
try:
config = utils.py_configs... | [
"pandas.read_csv",
"flask.Flask",
"flask.request.files.to_dict",
"sklearn.preprocessing.OneHotEncoder",
"json.dumps",
"os.path.dirname",
"data_utils.py_configs",
"flask.request.files.get",
"flask.jsonify"
] | [((481, 496), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (486, 496), False, 'from flask import Flask, request, jsonify\n'), ((244, 269), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (259, 269), False, 'import os\n'), ((304, 332), 'data_utils.py_configs', 'utils.py_configs',... |
import torch
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from matplotlib.legend_handler import HandlerTuple
from matplotlib.ticker import FormatStrFormatter
#from tqdm import tqdm
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
plt.rc('xtick', labelsize=... | [
"matplotlib.legend_handler.HandlerTuple",
"matplotlib.pyplot.ylabel",
"matplotlib.use",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"torch.pow",
"matplotlib.pyplot.figure",
"matplotlib.ticker.FormatStrFormatter",
"matplotlib.pyplot.tight_layout",
"matplotlib.py... | [((33, 54), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (47, 54), False, 'import matplotlib\n'), ((294, 323), 'matplotlib.pyplot.rc', 'plt.rc', (['"""xtick"""'], {'labelsize': '(22)'}), "('xtick', labelsize=22)\n", (300, 323), True, 'import matplotlib.pyplot as plt\n'), ((357, 386), 'matplotli... |
#!/usr/bin/env python
"""Tests the client file finder action."""
import collections
import glob
import hashlib
import os
import platform
import shutil
import subprocess
import unittest
import mock
import psutil
import unittest
from grr.client import comms
from grr.client.client_actions import file_finder as client_f... | [
"grr.client.client_actions.file_finder.RegexMatcher",
"grr.test_lib.test_lib.TempFilePath",
"grr.lib.rdfvalues.file_finder.FileFinderAccessTimeCondition",
"grr.lib.rdfvalues.file_finder.FileFinderDownloadActionOptions",
"hashlib.sha1",
"os.remove",
"os.listdir",
"grr.client.client_actions.file_finder.... | [((15661, 15715), 'mock.patch.object', 'mock.patch.object', (['comms.GRRClientWorker', '"""UploadFile"""'], {}), "(comms.GRRClientWorker, 'UploadFile')\n", (15678, 15715), False, 'import mock\n'), ((16044, 16098), 'mock.patch.object', 'mock.patch.object', (['comms.GRRClientWorker', '"""UploadFile"""'], {}), "(comms.GRR... |
import socket
host = 'localhost'
# we need to define encode function for converting string to bytes string
# this will be use for sending/receiving data via socket
encode = lambda text: text.encode()
# we need to define deocde function for converting bytes string to string
# this will convert bytes string sent/reci... | [
"argparse.ArgumentParser",
"socket.socket"
] | [((472, 487), 'socket.socket', 'socket.socket', ([], {}), '()\n', (485, 487), False, 'import socket\n'), ((1439, 1500), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Simple TCP echo client"""'}), "(description='Simple TCP echo client')\n", (1462, 1500), False, 'import argparse\n')] |
from typing import Optional
from my_collection.paxos.common import NodeId, Router, ProposalId, Value, PrepareRequest, is_majority, PrepareResponse, \
Proposal, ProposeRequest, ProposeResponse, CODE_OK
class Proposer:
node_id: NodeId
acceptor_id_list: list[NodeId]
router: Router
current_proposal_i... | [
"my_collection.paxos.common.Proposal",
"my_collection.paxos.common.ProposeRequest",
"my_collection.paxos.common.ProposalId",
"my_collection.paxos.common.PrepareRequest"
] | [((589, 622), 'my_collection.paxos.common.ProposalId', 'ProposalId', ([], {'id': '(0)', 'node_id': 'node_id'}), '(id=0, node_id=node_id)\n', (599, 622), False, 'from my_collection.paxos.common import NodeId, Router, ProposalId, Value, PrepareRequest, is_majority, PrepareResponse, Proposal, ProposeRequest, ProposeRespon... |
import math
class Point (object):
# constructor
def __init__ (self, x = 0, y = 0):
self.x = x
self.y = y
# get the distance to another Point object
def dist (self, other):
return math.hypot (self.x - other.x, self.y - other.y)
# string representation of a Point
def __str__ (self):
return ... | [
"math.hypot"
] | [((201, 247), 'math.hypot', 'math.hypot', (['(self.x - other.x)', '(self.y - other.y)'], {}), '(self.x - other.x, self.y - other.y)\n', (211, 247), False, 'import math\n')] |
import pandas as pd
exa = pd.read_csv('en_dup.csv')
exa.loc[exa['label'] =='F', 'label']= 0
exa.loc[exa['label'] =='T', 'label']= 1
exa.loc[exa['label'] =='U', 'label']= 2
#不读取label2, 只读取0,1标签
exa0 = exa.loc[exa["label"] == 0]
exa1 = exa.loc[exa["label"] == 1]
exa = [exa0, exa1]
exa = pd.concat(exa)
exa.to_csv('... | [
"pandas.concat",
"pandas.read_csv"
] | [((28, 53), 'pandas.read_csv', 'pd.read_csv', (['"""en_dup.csv"""'], {}), "('en_dup.csv')\n", (39, 53), True, 'import pandas as pd\n'), ((292, 306), 'pandas.concat', 'pd.concat', (['exa'], {}), '(exa)\n', (301, 306), True, 'import pandas as pd\n')] |
from restapi.connectors import Connector
from restapi.env import Env
from restapi.services.authentication import BaseAuthentication, Role
from restapi.tests import API_URI, BaseTests, FlaskClient
from restapi.utilities.logs import log
class TestApp(BaseTests):
def test_no_auth(self, client: FlaskClient) -> None:
... | [
"restapi.connectors.Connector.get_authentication_instance",
"restapi.env.Env.get_bool",
"restapi.utilities.logs.log.warning"
] | [((462, 489), 'restapi.env.Env.get_bool', 'Env.get_bool', (['"""AUTH_ENABLE"""'], {}), "('AUTH_ENABLE')\n", (474, 489), False, 'from restapi.env import Env\n'), ((7942, 7975), 'restapi.env.Env.get_bool', 'Env.get_bool', (['"""MAIN_LOGIN_ENABLE"""'], {}), "('MAIN_LOGIN_ENABLE')\n", (7954, 7975), False, 'from restapi.env... |
# -*- coding:utf-8 -*-
from django.contrib import admin
from .models import UserProfile
# Register your models here.
class UserProfileModelAdmin(admin.ModelAdmin):
"""
用户管理Model
"""
list_display = ('id', 'username', 'nike_name', 'mobile',
'email', 'is_active')
list_filter = ('... | [
"django.contrib.admin.site.register"
] | [((443, 498), 'django.contrib.admin.site.register', 'admin.site.register', (['UserProfile', 'UserProfileModelAdmin'], {}), '(UserProfile, UserProfileModelAdmin)\n', (462, 498), False, 'from django.contrib import admin\n')] |
'''
axicli.py - Command line interface (CLI) for AxiDraw.
For quick help:
python axicli.py --help
Full user guide:
https://axidraw.com/doc/cli_api/
This script is a stand-alone version of AxiDraw Control, accepting
various options and providing a facility for setting default values.
'''
from axicli.a... | [
"axicli.axidraw_cli.axidraw_CLI"
] | [((382, 395), 'axicli.axidraw_cli.axidraw_CLI', 'axidraw_CLI', ([], {}), '()\n', (393, 395), False, 'from axicli.axidraw_cli import axidraw_CLI\n')] |
# MENTOL
# At:Sun Nov 24 15:04:31 2019
if len(bytecode) == 0:
print('\x1b[1;93mbyte code kosong\nharap masukkan bytecodenya\x1b[0m')
exit()
import marshal, sys, os, random, string, time
try:
from uncompyle6.main import decompile
except:
os.system('pip install uncompyle6')
from uncompyle6.main imp... | [
"random.choice",
"time.sleep",
"marshal.loads",
"os.system",
"sys.stdout.flush",
"sys.stdout.write"
] | [((256, 291), 'os.system', 'os.system', (['"""pip install uncompyle6"""'], {}), "('pip install uncompyle6')\n", (265, 291), False, 'import marshal, sys, os, random, string, time\n'), ((952, 989), 'random.choice', 'random.choice', (['string.ascii_lowercase'], {}), '(string.ascii_lowercase)\n', (965, 989), False, 'import... |
from builtins import str
from builtins import range
from builtins import object
import os
import fixtures
import testtools
from vn_test import VNFixture
from vm_test import VMFixture
from common.connections import ContrailConnections
from policy_test import PolicyFixture
from policy.config import AttachPolicyFixture
f... | [
"vm_test.VMFixture",
"tcutils.commands.ssh",
"tcutils.commands.execute_cmd_out",
"time.sleep",
"builtins.str",
"builtins.range",
"tcutils.commands.execute_cmd"
] | [((1042, 1053), 'builtins.range', 'range', (['(0)', '(2)'], {}), '(0, 2)\n', (1047, 1053), False, 'from builtins import range\n'), ((1642, 1698), 'tcutils.commands.ssh', 'ssh', (["host['host_ip']", "host['username']", "host['password']"], {}), "(host['host_ip'], host['username'], host['password'])\n", (1645, 1698), Fal... |
from data import NumericalField, CategoricalField, Iterator
from data import Dataset
from synthesizer import MaskGenerator_MLP, ObservedGenerator_MLP, Discriminator, Handler, ObservedGenerator_LSTM
from random import choice
import multiprocessing
import pandas as pd
import numpy as np
import torch
import argparse
impor... | [
"synthesizer.ObservedGenerator_MLP",
"random.choice",
"argparse.ArgumentParser",
"synthesizer.Discriminator",
"pandas.read_csv",
"data.Dataset.split",
"multiprocessing.Process",
"synthesizer.ObservedGenerator_LSTM",
"synthesizer.MaskGenerator_MLP",
"os.mkdir",
"json.load",
"synthesizer.Handler... | [((773, 811), 'random.choice', 'choice', (["parameters_space['batch_size']"], {}), "(parameters_space['batch_size'])\n", (779, 811), False, 'from random import choice\n'), ((830, 863), 'random.choice', 'choice', (["parameters_space['z_dim']"], {}), "(parameters_space['z_dim'])\n", (836, 863), False, 'from random import... |
# Test the Unicode versions of normal file functions
# open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir
import sys, os, unittest
from test import support
if not os.path.supports_unicode_filenames:
raise unittest.SkipTest("test works only on NT+")
filenames = [
'abc',
'... | [
"os.path.exists",
"os.listdir",
"sys.getfilesystemencoding",
"test.support.TestFailed",
"test.support.run_unittest",
"os.rename",
"os.access",
"os.path.join",
"os.getcwd",
"os.chdir",
"os.rmdir",
"unittest.SkipTest",
"os.mkdir",
"os.stat",
"test.support.TESTFN.encode",
"os.remove"
] | [((245, 288), 'unittest.SkipTest', 'unittest.SkipTest', (['"""test works only on NT+"""'], {}), "('test works only on NT+')\n", (262, 288), False, 'import sys, os, unittest\n'), ((834, 857), 'os.path.exists', 'os.path.exists', (['dirname'], {}), '(dirname)\n', (848, 857), False, 'import sys, os, unittest\n'), ((1042, 1... |
import argparse
from pathlib import Path
import numpy as np
import yaml
# this script takes in a folder path and then recursively collects all
# results.yaml files in that directory. It averages them and prints
# summary statistics
parser = argparse.ArgumentParser(description="Analyze the results")
parser.add_argume... | [
"numpy.mean",
"argparse.ArgumentParser",
"pathlib.Path",
"yaml.dump",
"yaml.safe_load",
"numpy.std"
] | [((244, 302), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Analyze the results"""'}), "(description='Analyze the results')\n", (267, 302), False, 'import argparse\n'), ((988, 1005), 'yaml.dump', 'yaml.dump', (['output'], {}), '(output)\n', (997, 1005), False, 'import yaml\n'), ((459, 4... |
import random
import argparse
# TODO: Parse word lists from files
words = {
"codenames_adjective": [
"quantum",
"loud",
"red",
"blue",
"green",
"yellow",
"irate",
"angry",
"peeved",
"happy",
"slimy",
"sleepy",
"junior",
"slicker",
"united",
... | [
"argparse.ArgumentParser",
"random.randrange"
] | [((1638, 1707), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate NSA TAO project names"""'}), "(description='Generate NSA TAO project names')\n", (1661, 1707), False, 'import argparse\n'), ((2122, 2141), 'random.randrange', 'random.randrange', (['(5)'], {}), '(5)\n', (2138, 2141),... |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# <NAME> <<EMAIL>>
# Mon 18 Nov 21:38:19 2013
"""Extension building for using this package
"""
import numpy
from pkg_resources import resource_filename
from bob.extension import Extension as BobExtension
# forward the build_ext command from bob.extension
from bob.... | [
"bob.extension.Extension.__init__",
"bob.extension.Library.__init__",
"pkg_resources.resource_filename",
"numpy.get_include",
"distutils.version.LooseVersion"
] | [((1037, 1075), 'pkg_resources.resource_filename', 'resource_filename', (['__name__', '"""include"""'], {}), "(__name__, 'include')\n", (1054, 1075), False, 'from pkg_resources import resource_filename\n'), ((1584, 1628), 'bob.extension.Extension.__init__', 'BobExtension.__init__', (['self', '*args'], {}), '(self, *arg... |
from robot.api.deco import keyword
from robot.libraries.BuiltIn import BuiltIn
class Gazebo(object):
"""Robot Framework test library for the Gazebo simulator
See also http://gazebosim.org/tutorials/?tut=ros_comm
== Table of contents ==
%TOC%
"""
ROBOT_LIBRARY_SCOPE = 'SUITE'
def __init... | [
"robot.libraries.BuiltIn.BuiltIn"
] | [((353, 362), 'robot.libraries.BuiltIn.BuiltIn', 'BuiltIn', ([], {}), '()\n', (360, 362), False, 'from robot.libraries.BuiltIn import BuiltIn\n')] |
import unittest
import zserio
from testutils import getZserioApi
class Bit4RangeCheckTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.api = getZserioApi(__file__, "with_range_check_code.zs",
extraArgs=["-withRangeCheckCode"]).bit4_range_check
def testB... | [
"zserio.serialize",
"zserio.deserialize",
"testutils.getZserioApi"
] | [((924, 964), 'zserio.serialize', 'zserio.serialize', (['bit4RangeCheckCompound'], {}), '(bit4RangeCheckCompound)\n', (940, 964), False, 'import zserio\n'), ((1002, 1064), 'zserio.deserialize', 'zserio.deserialize', (['self.api.Bit4RangeCheckCompound', 'bitBuffer'], {}), '(self.api.Bit4RangeCheckCompound, bitBuffer)\n'... |
import numpy as np
import math
import time
class PulsedProgramming:
"""
This class contains all the parameters for the Pulsed programming on a memristor model.
After initializing the parameters values, start the simulation with self.simulate()
Parameters
----------
max_voltage : float
... | [
"numpy.random.normal",
"numpy.sum",
"numpy.array",
"time.time"
] | [((2523, 2564), 'numpy.random.normal', 'np.random.normal', (['(0)', 'variance_write', '(1000)'], {}), '(0, variance_write, 1000)\n', (2539, 2564), True, 'import numpy as np\n'), ((5167, 5178), 'time.time', 'time.time', ([], {}), '()\n', (5176, 5178), False, 'import time\n'), ((8053, 8095), 'numpy.sum', 'np.sum', (['[(1... |
import cv2
import numpy as np
from scipy.interpolate import UnivariateSpline
class Cool(object):
"""cool_filter ---
This class will apply cool filter to an image
by giving a sky blue effect to the input image.
"""
def __init__(self):
# create look-up tables for increasing and decreasing red and blue resp.
... | [
"cv2.imwrite",
"cv2.merge",
"cv2.LUT",
"cv2.imshow",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.split",
"scipy.interpolate.UnivariateSpline",
"cv2.cvtColor",
"cv2.imread"
] | [((797, 816), 'cv2.imread', 'cv2.imread', (['img_rgb'], {}), '(img_rgb)\n', (807, 816), False, 'import cv2\n'), ((900, 918), 'cv2.split', 'cv2.split', (['img_rgb'], {}), '(img_rgb)\n', (909, 918), False, 'import cv2\n'), ((1043, 1063), 'cv2.merge', 'cv2.merge', (['(r, g, b)'], {}), '((r, g, b))\n', (1052, 1063), False,... |
import torch
from metrics.swd import sliced_wasserstein_distance
from evaluators.sample_evaluators.base_sample_evaluator import BaseSampleEvaluator
from noise_creator import NoiseCreator
class SWDSampleEvaluator(BaseSampleEvaluator):
def __init__(self, noise_creator: NoiseCreator):
self.__noise_... | [
"metrics.swd.sliced_wasserstein_distance"
] | [((528, 587), 'metrics.swd.sliced_wasserstein_distance', 'sliced_wasserstein_distance', (['sample', 'comparision_sample', '(50)'], {}), '(sample, comparision_sample, 50)\n', (555, 587), False, 'from metrics.swd import sliced_wasserstein_distance\n')] |
# Generated by Django 4.0.3 on 2022-04-02 17:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('utils', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='electricitybilling',
name='unit_price',... | [
"django.db.models.DecimalField",
"django.db.models.CharField"
] | [((339, 405), 'django.db.models.DecimalField', 'models.DecimalField', ([], {'decimal_places': '(2)', 'default': '(24.18)', 'max_digits': '(9)'}), '(decimal_places=2, default=24.18, max_digits=9)\n', (358, 405), False, 'from django.db import migrations, models\n'), ((539, 654), 'django.db.models.CharField', 'models.Char... |
"""
The roseguarden project
Copyright (C) 2018-2020 <NAME>,
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is ... | [
"copy.copy"
] | [((3598, 3610), 'copy.copy', 'copy.copy', (['p'], {}), '(p)\n', (3607, 3610), False, 'import copy\n')] |
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import cv2
import mmcv
import numpy as np
import torch
from torchvision.transforms import functional as F
from mmdet.apis import init_detector
from mmdet.datasets.pipelines import Compose
try:
import ffmpegcv
except ImportError:
raise ImportErro... | [
"mmcv.track_iter_progress",
"argparse.ArgumentParser",
"mmdet.apis.init_detector",
"ffmpegcv.VideoWriter",
"torch.from_numpy",
"mmdet.datasets.pipelines.Compose",
"mmcv.imshow",
"numpy.zeros",
"cv2.destroyAllWindows",
"torch.no_grad",
"torchvision.transforms.functional.normalize",
"cv2.namedWi... | [((425, 513), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""MMDetection video demo with GPU acceleration"""'}), "(description=\n 'MMDetection video demo with GPU acceleration')\n", (448, 513), False, 'import argparse\n'), ((1446, 1477), 'mmdet.datasets.pipelines.Compose', 'Compose', ... |
import time
from hashlib import sha1
class InfArray():
def __init__(self):
self.left = [0]*16
self.right = [0]*16
def getarr(self, ind):
arr = self.right
if ind < 0: arr, ind = self.left, -ind-1
if ind >= len(arr): arr.extend([0]* (key - len(arr) + 10))
return a... | [
"time.time"
] | [((749, 760), 'time.time', 'time.time', ([], {}), '()\n', (758, 760), False, 'import time\n'), ((792, 803), 'time.time', 'time.time', ([], {}), '()\n', (801, 803), False, 'import time\n')] |
"""Various sample data"""
from binascii import unhexlify
magic = 0xE9BEB4D9
# These keys are from addresses test script
sample_pubsigningkey = unhexlify(
'<KEY>'
'<KEY>')
sample_pubencryptionkey = unhexlify(
'<KEY>'
'e7b9b97792327851a562752e4b79475d1f51f5a71352482b241227f45ed36a9')
sample_privsignin... | [
"binascii.unhexlify"
] | [((147, 170), 'binascii.unhexlify', 'unhexlify', (['"""<KEY><KEY>"""'], {}), "('<KEY><KEY>')\n", (156, 170), False, 'from binascii import unhexlify\n'), ((209, 295), 'binascii.unhexlify', 'unhexlify', (['"""<KEY>e7b9b97792327851a562752e4b79475d1f51f5a71352482b241227f45ed36a9"""'], {}), "(\n '<KEY>e7b9b97792327851a56... |
from urllib.parse import parse_qs
from anticaptchaofficial.hcaptchaproxyless import hCaptchaProxyless
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from court_scraper.base.selenium_helpers import Sel... | [
"selenium.webdriver.support.ui.WebDriverWait",
"selenium.webdriver.support.expected_conditions.url_changes",
"urllib.parse.parse_qs",
"court_scraper.utils.dates_for_range",
"anticaptchaofficial.hcaptchaproxyless.hCaptchaProxyless",
"selenium.webdriver.support.expected_conditions.visibility_of_element_loca... | [((3216, 3280), 'court_scraper.utils.dates_for_range', 'dates_for_range', (['start_date', 'end_date'], {'output_format': 'date_format'}), '(start_date, end_date, output_format=date_format)\n', (3231, 3280), False, 'from court_scraper.utils import dates_for_range\n'), ((8218, 8237), 'anticaptchaofficial.hcaptchaproxyles... |
# 2022 eCTF
# Bootloader Interface Emulator
# <NAME>
#
# (c) 2022 The MITRE Corporation
#
# This source file is part of an example system for MITRE's 2022 Embedded System
# CTF (eCTF). This code is being provided only for educational purposes for the
# 2022 MITRE eCTF competition, and may not meet MITRE standards for q... | [
"logging.getLogger",
"os.path.exists",
"select.select",
"logging.StreamHandler",
"argparse.ArgumentParser",
"socket.socket",
"logging.Formatter",
"os.chmod",
"logging.FileHandler",
"os.unlink",
"typing.TypeVar"
] | [((539, 557), 'typing.TypeVar', 'TypeVar', (['"""Message"""'], {}), "('Message')\n", (546, 557), False, 'from typing import List, Optional, TypeVar\n'), ((4879, 4904), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4902, 4904), False, 'import argparse\n'), ((1702, 1741), 'logging.FileHandler',... |
# -*- coding: utf-8 -*-
"""
This is a script to demo how to open up a macro enabled excel file, write a pandas dataframe to it
and save it as a new file name.
Created on Mon Mar 1 17:47:41 2021
@author: <NAME>
"""
import os
import xlwings as xw
import pandas as pd
os.chdir(r"C:\Users\<NAME>\Desktop\Ro... | [
"os.chdir",
"xlwings.Book",
"pandas.DataFrame"
] | [((283, 329), 'os.chdir', 'os.chdir', (['"""C:\\\\Users\\\\<NAME>\\\\Desktop\\\\Roisin"""'], {}), "('C:\\\\Users\\\\<NAME>\\\\Desktop\\\\Roisin')\n", (291, 329), False, 'import os\n'), ((335, 363), 'xlwings.Book', 'xw.Book', (['"""CAO_template.xlsm"""'], {}), "('CAO_template.xlsm')\n", (342, 363), True, 'import xlwings... |
from do import DigitalOcean
import argparse
import json
def do_play(token):
do = DigitalOcean(token)
# ----
# for i in range(3):
# do.create_droplet(f'node-{i}', 'fra1', 'do-python')
# do.wait_droplet_creation_process('do-python')
# ----
# do.destroy_droplets('do-python')
# ----
... | [
"json.load",
"argparse.ArgumentParser",
"do.DigitalOcean"
] | [((88, 107), 'do.DigitalOcean', 'DigitalOcean', (['token'], {}), '(token)\n', (100, 107), False, 'from do import DigitalOcean\n'), ((708, 733), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (731, 733), False, 'import argparse\n'), ((595, 607), 'json.load', 'json.load', (['f'], {}), '(f)\n', (6... |
import cPickle as pickle
import pandas as pd
if __name__ == '__main__':
fnames = set(['clinton_tweets.json', 'trump_tweets.json'])
for fname in fnames:
df = pd.read_json('data/' + fname)
df = df.transpose()
df = df['text']
pickle.dump([(i, v) for i, v in zip(df.index, df.values... | [
"pandas.read_json"
] | [((175, 204), 'pandas.read_json', 'pd.read_json', (["('data/' + fname)"], {}), "('data/' + fname)\n", (187, 204), True, 'import pandas as pd\n')] |
import os
import logging
from flask import Flask
app = Flask(__name__)
@app.route('/status')
def health_check():
app.logger.info('Status request successfull')
app.logger.debug('DEBUG message')
return 'OK - healthy'
@app.route('/metrics')
def metrics():
app.logger.info('Metrics request successfull')... | [
"logging.basicConfig",
"os.environ.get",
"flask.Flask"
] | [((57, 72), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (62, 72), False, 'from flask import Flask\n'), ((435, 468), 'os.environ.get', 'os.environ.get', (['"""TARGET"""', '"""World"""'], {}), "('TARGET', 'World')\n", (449, 468), False, 'import os\n'), ((657, 717), 'logging.basicConfig', 'logging.basicCon... |
import numpy as np
import torch
import matplotlib.pyplot as plt
from icecream import ic
def visualize_vector_field(policy, device, min_max = [[-1,-1],[1,1]], fig_number=1):
min_x = min_max[0][0]
max_x = min_max[1][0]
min_y = min_max[0][1]
max_y = min_max[1][1]
n_sample = 100
x = np.linspace(m... | [
"icecream.ic",
"numpy.reshape",
"numpy.sqrt",
"numpy.max",
"numpy.stack",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.streamplot",
"numpy.linspace",
"numpy.concatenate",
"numpy.meshgrid",
"numpy.shape",
"numpy.nan_to_num",
"matplotlib.pyplot.show"
] | [((947, 952), 'icecream.ic', 'ic', (['Y'], {}), '(Y)\n', (949, 952), False, 'from icecream import ic\n'), ((953, 958), 'icecream.ic', 'ic', (['X'], {}), '(X)\n', (955, 958), False, 'from icecream import ic\n'), ((1714, 1741), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(12, 7)'}), '(figsize=(12, 7))\n',... |
# Generated from tale/syntax/grammar/Tale.g4 by ANTLR 4.8
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\... | [
"io.StringIO",
"antlr4.error.Errors.FailedPredicateException"
] | [((255, 265), 'io.StringIO', 'StringIO', ([], {}), '()\n', (263, 265), False, 'from io import StringIO\n'), ((50142, 50203), 'antlr4.error.Errors.FailedPredicateException', 'FailedPredicateException', (['self', '"""self.precpred(self._ctx, 2)"""'], {}), "(self, 'self.precpred(self._ctx, 2)')\n", (50166, 50203), False, ... |
# -*- coding: UTF-8 -*-
'''
Created on May 14, 2014
@author: <NAME> <<EMAIL>>
'''
import os, datetime, sys, platform, base64
class Configuration(object):
def __init__(self):
# Constructor
if os.name == 'posix':
self.OsType = 'linux'
elif os.name == 'nt':
self.OsT... | [
"sys.getwindowsversion",
"platform.platform",
"os.path.join",
"os.getcwd",
"platform.processor",
"base64.b16encode",
"os.path.expanduser"
] | [((534, 557), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (552, 557), False, 'import os, datetime, sys, platform, base64\n'), ((1680, 1718), 'base64.b16encode', 'base64.b16encode', (['string_to_be_encoded'], {}), '(string_to_be_encoded)\n', (1696, 1718), False, 'import os, datetime, sys, p... |
# defaults.py: contains the built-in variables, events and methods
# used for scripting the C program
import event
events = {}
_event_names = ["on_start", "on_exit"]
for evt in _event_names:
events[evt] = event.Event()
| [
"event.Event"
] | [((211, 224), 'event.Event', 'event.Event', ([], {}), '()\n', (222, 224), False, 'import event\n')] |
# Imports for urn construction utility methods
import logging
from datahub.emitter.mce_builder import make_dataset_urn, make_tag_urn
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from datahub.emitter.rest_emitter import DatahubRestEmitter
# Imports for metadata model classes
from datahub.metadata.sche... | [
"logging.getLogger",
"logging.basicConfig",
"datahub.metadata.schema_classes.TagAssociationClass",
"datahub.emitter.rest_emitter.DatahubRestEmitter",
"datahub.emitter.mce_builder.make_dataset_urn",
"datahub.emitter.mce_builder.make_tag_urn"
] | [((416, 443), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (433, 443), False, 'import logging\n'), ((444, 483), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (463, 483), False, 'import logging\n'), ((499, 572), 'datahub.emitter.... |
from __future__ import print_function
from sympy import symbols, Matrix
from galgebra.printer import xpdf, Format
def main():
Format()
a = Matrix ( 2, 2, ( 1, 2, 3, 4 ) )
b = Matrix ( 2, 1, ( 5, 6 ) )
c = a * b
print(a,b,'=',c)
x, y = symbols ( 'x, y' )
d = Matrix ( 1, 2, ( x ** 3, y ** 3... | [
"sympy.symbols",
"galgebra.printer.xpdf",
"sympy.Matrix",
"galgebra.printer.Format"
] | [((131, 139), 'galgebra.printer.Format', 'Format', ([], {}), '()\n', (137, 139), False, 'from galgebra.printer import xpdf, Format\n'), ((148, 174), 'sympy.Matrix', 'Matrix', (['(2)', '(2)', '(1, 2, 3, 4)'], {}), '(2, 2, (1, 2, 3, 4))\n', (154, 174), False, 'from sympy import symbols, Matrix\n'), ((188, 208), 'sympy.Ma... |
"""Implements a basic flask app that provides hashes of text."""
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import flask_login
#pylint: disable=invalid-name
app = Flask(__name__)
app.config['DEBUG'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgres://yjjuylsytqewni:d0d63322c6abd33e2dadeafd... | [
"flask_sqlalchemy.SQLAlchemy",
"flask_login.LoginManager",
"flask.Flask"
] | [((185, 200), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (190, 200), False, 'from flask import Flask\n'), ((550, 565), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['app'], {}), '(app)\n', (560, 565), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((583, 609), 'flask_login.LoginManager', 'flask_... |
import numpy as np;
import cv2;
n = 428671
img_RS_color = np.load('/home/p4bhattachan/gripper/3DCameraServer/testImages/npyFiles/{}_RS_color.npy'.format(n))
cv2.imshow('RS Color Image {}'.format(n), img_RS_color)
#
# # img_RS_depth = np.load('/home/p4bhattachan/gripper/3DCameraServer/testImages/npyFiles/{}_RS_depth.np... | [
"cv2.waitKey",
"cv2.destroyAllWindows"
] | [((759, 773), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}), '(0)\n', (770, 773), False, 'import cv2\n'), ((774, 797), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (795, 797), False, 'import cv2\n')] |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
"magenta.protobuf.music_pb2.NoteSequence",
"collections.namedtuple",
"copy.deepcopy"
] | [((2185, 2209), 'magenta.protobuf.music_pb2.NoteSequence', 'music_pb2.NoteSequence', ([], {}), '()\n', (2207, 2209), False, 'from magenta.protobuf import music_pb2\n'), ((3899, 4008), 'collections.namedtuple', 'collections.namedtuple', (['"""Note"""', "['pitch', 'velocity', 'start', 'end', 'instrument', 'program', 'is_... |
from collections import defaultdict
from celery.task import task
from pandas import concat, DataFrame
from bamboo.core.aggregator import Aggregator
from bamboo.core.frame import add_parent_column, join_dataset
from bamboo.core.parser import Parser
from bamboo.lib.datetools import recognize_dates
from bamboo.lib.jsont... | [
"bamboo.core.aggregator.Aggregator",
"bamboo.core.parser.Parser.dependent_columns",
"celery.task.task",
"bamboo.core.parser.Parser.parse_aggregation",
"bamboo.core.frame.add_parent_column",
"bamboo.core.frame.join_dataset",
"bamboo.lib.datetools.recognize_dates",
"bamboo.lib.jsontools.df_to_jsondict",... | [((1744, 1791), 'celery.task.task', 'task', ([], {'default_retry_delay': '(5)', 'ignore_result': '(True)'}), '(default_retry_delay=5, ignore_result=True)\n', (1748, 1791), False, 'from celery.task import task\n'), ((4557, 4604), 'celery.task.task', 'task', ([], {'default_retry_delay': '(5)', 'ignore_result': '(True)'})... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# License: BSD
# https://raw.githubusercontent.com/splintered-reality/py_trees_ros/devel/LICENSE
#
##############################################################################
# Documentation
###########################################################################... | [
"time.monotonic",
"py_trees_ros_interfaces.msg.BehaviourTree"
] | [((1841, 1857), 'time.monotonic', 'time.monotonic', ([], {}), '()\n', (1855, 1857), False, 'import time\n'), ((1953, 1969), 'time.monotonic', 'time.monotonic', ([], {}), '()\n', (1967, 1969), False, 'import time\n'), ((2192, 2208), 'time.monotonic', 'time.monotonic', ([], {}), '()\n', (2206, 2208), False, 'import time\... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Friday_Blueprint.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtC... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QTextEdit",
"PyQt5.QtWidgets.QMainWindow",
"PyQt5.QtGui.QIcon",
"PyQt5.QtWidgets.QSpacerItem",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtGui.QMovie",
"PyQt5.QtWidgets.QHBoxLayout",
"PyQt5.QtCore.QRect",
"PyQt5.QtGui.QPixmap",
"PyQt5.QtWid... | [((11220, 11252), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (11242, 11252), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((11270, 11293), 'PyQt5.QtWidgets.QMainWindow', 'QtWidgets.QMainWindow', ([], {}), '()\n', (11291, 11293), False, 'from PyQt5 import QtC... |
from __future__ import annotations
from copy import copy, deepcopy
from types import MappingProxyType
from typing import (
Any,
Union,
Mapping,
TypeVar,
Callable,
Iterable,
Iterator,
Sequence,
TYPE_CHECKING,
)
from pathlib import Path
from functools import partial
from itertools imp... | [
"squidpy.gr._utils._assert_spatial_basis",
"skimage.util.img_as_float",
"squidpy.pl.Interactive",
"scanpy.logging.debug",
"re.compile",
"squidpy._docs.d.get_sections",
"types.MappingProxyType",
"squidpy.im._io._infer_dimensions",
"dask.array.map_blocks",
"xarray.concat",
"numpy.array",
"copy.d... | [((1741, 1763), 'typing.TypeVar', 'TypeVar', (['"""Interactive"""'], {}), "('Interactive')\n", (1748, 1763), False, 'from typing import Any, Union, Mapping, TypeVar, Callable, Iterable, Iterator, Sequence, TYPE_CHECKING\n'), ((7609, 7674), 'squidpy._docs.d.get_sections', 'd.get_sections', ([], {'base': '"""add_img"""',... |
from django import forms
from django.contrib.auth.forms import UserCreationForm
from crispy_bootstrap5.bootstrap5 import FloatingField
from crispy_forms.layout import Layout
from crispy_forms.helper import FormHelper
class CustomUserCreationForm(UserCreationForm):
email = forms.EmailField()
class Meta(UserCr... | [
"django.forms.EmailField"
] | [((279, 297), 'django.forms.EmailField', 'forms.EmailField', ([], {}), '()\n', (295, 297), False, 'from django import forms\n')] |
import json
import requests
import config
assignedIdList = list()
def __getList():
HEADERS = {
'Cookie': config.tutorzzzCookie,
'Content-Type': 'application/json'
}
res = requests.post(config.tutorzzzURL, headers = HEADERS, json = config.tutorzzzReqBody)
if res.status_code == 200:
... | [
"requests.post"
] | [((202, 281), 'requests.post', 'requests.post', (['config.tutorzzzURL'], {'headers': 'HEADERS', 'json': 'config.tutorzzzReqBody'}), '(config.tutorzzzURL, headers=HEADERS, json=config.tutorzzzReqBody)\n', (215, 281), False, 'import requests\n')] |
from invoicing.crud.base_crud import BaseCrud
from invoicing.latex.latex_invoice import LatexInvoice
from invoicing.models.invoice_model import InvoiceModel
from invoicing.repository.invoice_repository import InvoiceRepository
from invoicing.repository.job_repository import JobRepository
from invoicing.ui.date import D... | [
"invoicing.ui.date.Date",
"invoicing.repository.job_repository.JobRepository",
"invoicing.value_validation.value_validation.Validation.isFloat",
"invoicing.ui.style.Style.create_title",
"invoicing.ui.menu.Menu.wait_for_input",
"invoicing.latex.latex_invoice.LatexInvoice"
] | [((926, 964), 'invoicing.ui.style.Style.create_title', 'Style.create_title', (['"""Generate Invoice"""'], {}), "('Generate Invoice')\n", (944, 964), False, 'from invoicing.ui.style import Style\n'), ((1059, 1074), 'invoicing.repository.job_repository.JobRepository', 'JobRepository', ([], {}), '()\n', (1072, 1074), Fals... |
from ds3225 import DS3225
import dbus
import dbus.mainloop.glib
import dbus.service
from gi.repository import GObject, GLib
UNLOCKED_DEG = 175
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
BUS_NAME = 'jp.kimura.DS3225Service'
OBJECT_PATH = '/jp/kimura/DS3225Server'
INTERFACE = 'jp.kimura.DS3225'
class DS3225... | [
"dbus.service.BusName",
"dbus.SessionBus",
"time.sleep",
"dbus.mainloop.glib.DBusGMainLoop"
] | [((145, 198), 'dbus.mainloop.glib.DBusGMainLoop', 'dbus.mainloop.glib.DBusGMainLoop', ([], {'set_as_default': '(True)'}), '(set_as_default=True)\n', (177, 198), False, 'import dbus\n'), ((387, 404), 'dbus.SessionBus', 'dbus.SessionBus', ([], {}), '()\n', (402, 404), False, 'import dbus\n'), ((424, 459), 'dbus.service.B... |
from os import access
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
import numpy as np
import matplotlib.pyplot as plt
# Create fully connected neural network
class NN(nn.Module):
d... | [
"torch.nn.CrossEntropyLoss",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.cuda.is_available",
"torch.nn.Linear",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torchvision.transforms.ToTensor",
"torch.randn"
] | [((1335, 1355), 'torch.randn', 'torch.randn', (['(64)', '(784)'], {}), '(64, 784)\n', (1346, 1355), False, 'import torch\n'), ((1704, 1766), 'torch.utils.data.DataLoader', 'DataLoader', (['train_dataset'], {'batch_size': 'batch_size', 'shuffle': '(True)'}), '(train_dataset, batch_size=batch_size, shuffle=True)\n', (171... |
import matplotlib.pyplot as plt
def plot_loss_mae(history):
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('Model loss')
plt.ylabel('Loss')
plt.xlabel('Epoch')
plt.legend(['Train', 'Validation'], loc='best')
plt.show()
plt.plot(history.history['mae']... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((66, 99), 'matplotlib.pyplot.plot', 'plt.plot', (["history.history['loss']"], {}), "(history.history['loss'])\n", (74, 99), True, 'import matplotlib.pyplot as plt\n'), ((104, 141), 'matplotlib.pyplot.plot', 'plt.plot', (["history.history['val_loss']"], {}), "(history.history['val_loss'])\n", (112, 141), True, 'import... |
# -*- coding: utf-8 -*-
import os
from os.path import dirname, join, normpath
import sys
from sys import platform
from config import config
if platform == 'darwin':
import objc
from AppKit import NSApplication, NSWorkspace, NSBeep, NSSound, NSEvent, NSKeyDown, NSKeyUp, NSFlagsChanged, NSKeyDownMask, NSFlag... | [
"ctypes.byref",
"ctypes.POINTER",
"AppKit.NSEvent.addGlobalMonitorForEventsMatchingMask_handler_",
"objc.callbackFor",
"ctypes.create_unicode_buffer",
"AppKit.NSBeep",
"AppKit.NSApplication.sharedApplication",
"ctypes.sizeof",
"os.path.join",
"config.config.getint",
"AppKit.NSSound.alloc",
"wi... | [((5613, 5685), 'objc.callbackFor', 'objc.callbackFor', (['NSEvent.addGlobalMonitorForEventsMatchingMask_handler_'], {}), '(NSEvent.addGlobalMonitorForEventsMatchingMask_handler_)\n', (5629, 5685), False, 'import objc\n'), ((5006, 5095), 'AppKit.NSEvent.addGlobalMonitorForEventsMatchingMask_handler_', 'NSEvent.addGloba... |
import torch.nn as nn
class Lstm(nn.Module):
"""
LSTM module
Args:
input_size : input size
hidden_size : hidden size
num_layers : number of hidden layers. Default: 1
dropout : dropout rate. Default: 0.5
bidirectional : If True, becomes a bidirectional RNN. Default: False.
"""
... | [
"torch.nn.LSTM"
] | [((473, 596), 'torch.nn.LSTM', 'nn.LSTM', (['input_size', 'hidden_size', 'num_layers'], {'bias': '(True)', 'batch_first': '(True)', 'dropout': 'dropout', 'bidirectional': 'bidirectional'}), '(input_size, hidden_size, num_layers, bias=True, batch_first=True,\n dropout=dropout, bidirectional=bidirectional)\n', (480, 5... |
from typing import List
import asyncio
import inspect
import logging
import uuid
import aio_pika
import aio_pika.exceptions
from .base import BaseRPC
from .common import RPCError, RPCHandler, RPCRequest, RPCResponse
class RPC(BaseRPC):
HEARTBEAT_INTERVAL = 300
def __init__(
self,
url: str =... | [
"inspect.isawaitable",
"asyncio.sleep",
"asyncio.Queue",
"logging.warning",
"uuid.uuid4",
"logging.exception",
"asyncio.gather",
"aio_pika.connect_robust"
] | [((1074, 1098), 'asyncio.Queue', 'asyncio.Queue', ([], {'loop': 'loop'}), '(loop=loop)\n', (1087, 1098), False, 'import asyncio\n'), ((1306, 1350), 'asyncio.gather', 'asyncio.gather', (['*self._pool'], {'loop': 'self._loop'}), '(*self._pool, loop=self._loop)\n', (1320, 1350), False, 'import asyncio\n'), ((2766, 2794), ... |
# Generated by Django 3.0.5 on 2020-09-06 19:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0004_auto_20200906_1752'),
]
operations = [
migrations.AlterModelOptions(
name='category... | [
"django.db.models.UniqueConstraint",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.migrations.AlterModelOptions",
"django.db.migrations.RemoveConstraint",
"django.db.models.CharField"
] | [((264, 388), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""category"""', 'options': "{'verbose_name': 'Категория', 'verbose_name_plural': 'Категории'}"}), "(name='category', options={'verbose_name':\n 'Категория', 'verbose_name_plural': 'Категории'})\n", (292, 388), Fal... |
""" Routers for weather_models.
"""
import logging
from fastapi import APIRouter, Depends
from app.auth import authentication_required, audit
from app.weather_models import ModelEnum
from app.schemas.weather_models import (
WeatherModelPredictionSummaryResponse,
WeatherStationsModelRunsPredictionsResponse)
from... | [
"logging.getLogger",
"app.schemas.weather_models.WeatherStationsModelRunsPredictionsResponse",
"app.weather_models.fetch.summaries.fetch_model_prediction_summaries",
"app.schemas.weather_models.WeatherModelPredictionSummaryResponse",
"fastapi.Depends",
"app.weather_models.fetch.predictions.fetch_model_run... | [((556, 583), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (573, 583), False, 'import logging\n'), ((1198, 1256), 'app.schemas.weather_models.WeatherModelPredictionSummaryResponse', 'WeatherModelPredictionSummaryResponse', ([], {'summaries': 'summaries'}), '(summaries=summaries)\n', (12... |
# -*- coding: utf-8 -*-
# python3 make.py -loc "data/lines/1.csv" -width 3840 -height 2160 -overwrite
# python3 make.py -loc "data/lines/1.csv" -width 3840 -height 2160 -rtl -overwrite
# python3 combine.py
# python3 make.py -data "data/lines/A_LEF.csv" -width 3840 -height 2160 -loc "data/lines/C.csv" -img "img/A.png" ... | [
"PIL.Image.fromarray",
"PIL.Image.open",
"argparse.ArgumentParser",
"PIL.Image.new",
"matplotlib.pyplot.plot",
"PIL.ImageFont.truetype",
"os.path.isfile",
"PIL.ImageDraw.Draw",
"numpy.linspace",
"gizeh.Surface",
"sys.exit",
"matplotlib.pyplot.show"
] | [((1123, 1148), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1146, 1148), False, 'import argparse\n'), ((23531, 23580), 'PIL.Image.new', 'Image.new', (['"""RGB"""', '(a.WIDTH, a.HEIGHT)', 'a.BG_COLOR'], {}), "('RGB', (a.WIDTH, a.HEIGHT), a.BG_COLOR)\n", (23540, 23580), False, 'from PIL impor... |
"""
OpenVINO DL Workbench
Class for create setup bundle job
Copyright (c) 2020 Intel Corporation
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... | [
"tempfile.TemporaryDirectory",
"os.makedirs",
"wb.main.utils.bundle_creator.setup_bundle_creator.SetupComponentsParams",
"wb.main.utils.utils.find_by_ext",
"os.path.join",
"wb.extensions_factories.database.get_db_session_for_celery",
"wb.main.scripts.job_scripts_generators.setup_script_generator.SetupSc... | [((5298, 5344), 'os.path.join', 'os.path.join', (['result_scripts_path', 'script_name'], {}), '(result_scripts_path, script_name)\n', (5310, 5344), False, 'import os\n'), ((5376, 5409), 'wb.main.scripts.job_scripts_generators.setup_script_generator.SetupScriptGenerator', 'SetupScriptGenerator', (['script_name'], {}), '... |
import sys
import re
from PyQt4 import QtGui, QtCore
from polynomial import Polynomial
from rational import Rational
class Window(QtGui.QMainWindow):
width, height = 420, 130
def __init__(self):
super().__init__()
self.setFixedSize(Window.width, Window.height)
self.setWindowTitle('... | [
"PyQt4.QtGui.QApplication",
"polynomial.Polynomial.from_string",
"rational.Rational",
"PyQt4.QtGui.QLabel",
"PyQt4.QtGui.QPushButton",
"PyQt4.QtGui.QIcon",
"PyQt4.QtGui.QKeySequence",
"PyQt4.QtGui.QLineEdit",
"PyQt4.QtGui.QMessageBox.warning",
"re.sub",
"PyQt4.QtGui.QCheckBox",
"re.findall",
... | [((4917, 4945), 'PyQt4.QtGui.QApplication', 'QtGui.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (4935, 4945), False, 'from PyQt4 import QtGui, QtCore\n'), ((562, 606), 'PyQt4.QtGui.QCheckBox', 'QtGui.QCheckBox', (['"""Return imaginary numbers?"""'], {}), "('Return imaginary numbers?')\n", (577, 606), False, 'from... |
# Copyright (c) 2020 <NAME>,
# <NAME>, <NAME>, <NAME>
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
from bark.benchmark.benchmark_result import BenchmarkConfig
from bark_ml.library_wrappers.lib_fqf_iqn_qrdqn.agent import TrainingBenchmark
from bark.benchmark.benchmark_runne... | [
"bark.benchmark.benchmark_runner.BehaviorConfig",
"bark.benchmark.benchmark_runner.BenchmarkRunner"
] | [((3232, 3477), 'bark.benchmark.benchmark_runner.BenchmarkRunner', 'BenchmarkRunner', ([], {'benchmark_configs': 'benchmark_configs', 'evaluators': 'evaluators', 'terminal_when': 'terminal_when', 'num_scenarios': 'num_episodes', 'log_eval_avg_every': '(100000000000)', 'checkpoint_dir': '"""checkpoints"""', 'merge_exist... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
import sys
import shutil
import onnx
import onnxruntime
import json
from google.protobuf.json_format import MessageToJson
import predict_pb2
import onnx_ml_pb2
# Current models only have one input and one output... | [
"json.loads",
"os.listdir",
"onnx_ml_pb2.TensorProto",
"os.makedirs",
"predict_pb2.PredictRequest",
"shutil.copy2",
"json.dump",
"onnxruntime.InferenceSession",
"os.path.join",
"onnx.TensorProto",
"os.path.realpath",
"predict_pb2.PredictResponse",
"google.protobuf.json_format.MessageToJson"
... | [((364, 409), 'onnxruntime.InferenceSession', 'onnxruntime.InferenceSession', (['model_file_name'], {}), '(model_file_name)\n', (392, 409), False, 'import onnxruntime\n'), ((557, 582), 'onnx_ml_pb2.TensorProto', 'onnx_ml_pb2.TensorProto', ([], {}), '()\n', (580, 582), False, 'import onnx_ml_pb2\n'), ((679, 707), 'predi... |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 10 14:31:17 2015
@author: <NAME>.
Description:
This script does CPU and GPU matrix element time complexity
profiling. It has a function which applies the matrix element
analysis for a given set of parameters, profiles the code and
... | [
"scipy.optimize.curve_fit",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"matplotlib.use",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.tick_params",
"numpy.asarray",
"math.log",
"matplotlib.pyplot.figure",
"numpy.linspace",
"matplotlib.pyplot.tight_layout",
"my_timer.timer",
"... | [((496, 517), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (510, 517), False, 'import matplotlib\n'), ((1829, 1842), 'numpy.asarray', 'np.asarray', (['n'], {}), '(n)\n', (1839, 1842), True, 'import numpy as np\n'), ((1859, 1880), 'numpy.asarray', 'np.asarray', (['time_data'], {}), '(time_data)\... |