code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from fastapi import FastAPI
app = FastAPI()
@app.get("/api/v1/incoming")
def incoming():
return {"message": "You've seccussfully reached professor server!"}
| [
"fastapi.FastAPI"
] | [((36, 45), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (43, 45), False, 'from fastapi import FastAPI\n')] |
import pytest
import torch
from torch import nn
from daceml.pytorch import DaceModule
from daceml.testing import torch_tensors_close
@pytest.mark.gpu
def test_dropout_fwd_training():
p = 0.5
module = nn.Dropout(p=p).cuda().train()
dace_module = DaceModule(module,
dummy_inputs=... | [
"torch.nn.Dropout",
"torch.rand_like",
"daceml.testing.torch_tensors_close",
"pytest.mark.parametrize",
"torch.randint",
"torch.clone",
"torch.zeros_like",
"torch.ones"
] | [((728, 777), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""p"""', '[0, 0.99, 0.6, 0.5]'], {}), "('p', [0, 0.99, 0.6, 0.5])\n", (751, 777), False, 'import pytest\n'), ((621, 692), 'daceml.testing.torch_tensors_close', 'torch_tensors_close', (['"""output"""', '(test_data[~zeroed] * scale)', 'out[~zeroed]']... |
import sys
import socket
import ssl
import logging
import pcapy
import time
import threading
import datetime
import traceback
import signal
import os
import tempfile
import gzip
import configparser
import re
import common
__ENVIRONMENT__ = "prod"
#__ENVIRONMENT__ = "test"
class Client:
""... | [
"socket.create_connection",
"pcapy.findalldevs",
"common.getLogger",
"threading.Lock",
"time.sleep",
"common.parse",
"threading.Event",
"datetime.datetime.now",
"os.getpid",
"sys.exit",
"threading.Thread",
"threading.Condition",
"traceback.print_exc",
"gzip.compress",
"common.getContext"... | [((9478, 9533), 'common.parse', 'common.parse', (['cfgpath', 'required_fields', 'optional_fields'], {}), '(cfgpath, required_fields, optional_fields)\n', (9490, 9533), False, 'import common\n'), ((2765, 2781), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (2779, 2781), False, 'import threading\n'), ((2817, 2848... |
import logging
import libsolace
from libsolace.Decorators import only_if_not_exists, only_if_exists
from libsolace.SolaceCommandQueue import SolaceCommandQueue
from libsolace.SolaceXMLBuilder import SolaceXMLBuilder
from libsolace.plugin import Plugin, PluginResponse
from libsolace.util import get_key_from_kwargs
log... | [
"logging.getLogger",
"libsolace.Decorators.only_if_not_exists",
"logging.NullHandler",
"libsolace.SolaceCommandQueue.SolaceCommandQueue",
"libsolace.util.get_key_from_kwargs",
"libsolace.Decorators.only_if_exists",
"libsolace.SolaceXMLBuilder.SolaceXMLBuilder"
] | [((326, 353), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (343, 353), False, 'import logging\n'), ((372, 393), 'logging.NullHandler', 'logging.NullHandler', ([], {}), '()\n', (391, 393), False, 'import logging\n'), ((4323, 4386), 'libsolace.Decorators.only_if_not_exists', 'only_if_not_... |
import vim
from . import escape
class _Variables(dict):
"""
Provides dict-style access to Vim's internal variables. Dictionary keys
should be strings of the form 'S:NNN', where 'S' is the name space (see
:help internal-variables) and 'NNN' is the variable name.
"""
def __init__(self):
... | [
"vim.eval"
] | [((585, 598), 'vim.eval', 'vim.eval', (['key'], {}), '(key)\n', (593, 598), False, 'import vim\n')] |
import sys
import logging
from . import rcp_checker
parser = rcp_checker.get_parser()
args = parser.parse_args()
logging.basicConfig(filename=args.log_output, level=logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler())
formatter = logging.Formatter("%(levelname)s - %(message)s")
logging.getLogger().h... | [
"logging.basicConfig",
"logging.getLogger",
"logging.StreamHandler",
"logging.Formatter",
"sys.exit",
"logging.info",
"logging.error"
] | [((116, 181), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': 'args.log_output', 'level': 'logging.INFO'}), '(filename=args.log_output, level=logging.INFO)\n', (135, 181), False, 'import logging\n'), ((250, 298), 'logging.Formatter', 'logging.Formatter', (['"""%(levelname)s - %(message)s"""'], {}), "('%... |
import functools
import os
from sys import platform
from typing import Dict
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import Qt, QModelIndex
from PyQt5.QtGui import QPaintEvent, QPainter, QCursor, QIcon
from PyQt5.QtWidgets import QWidget, QPushButton, QVBoxLayout, QHBoxLayout, QComboBox, QListWidget, QAct... | [
"dokidokimd.tools.thread_helpers.GroupOfThreads",
"PyQt5.QtWidgets.QProgressBar.__init__",
"dokidokimd.tools.misc.get_resource_path",
"PyQt5.QtWidgets.QWidget.__init__",
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5.QtGui.QCursor.pos",
"os.path.exists",
"PyQt5.QtWidgets.QListWidgetItem",
"PyQt5.QtWidgets.QL... | [((845, 865), 'dokidokimd.tools.ddmd_logger.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (855, 865), False, 'from dokidokimd.tools.ddmd_logger import get_logger\n'), ((941, 962), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (956, 962), False, 'import functools\n'), ((1276, 1297), ... |
# -*- coding=utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class PowerPagesConfig(AppConfig):
name = 'powerpages'
verbose_name = _('CMS')
def ready(self):
"""Register website data and add default templ... | [
"powerpages.autodiscover",
"django.utils.translation.ugettext_lazy"
] | [((235, 243), 'django.utils.translation.ugettext_lazy', '_', (['"""CMS"""'], {}), "('CMS')\n", (236, 243), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((429, 443), 'powerpages.autodiscover', 'autodiscover', ([], {}), '()\n', (441, 443), False, 'from powerpages import autodiscover\n')] |
"""
Module implementing a rate-limited multi-threaded download client for downloading from Sentinel Hub service
"""
import logging
import time
from threading import Lock, currentThread
import requests
from .handlers import fail_user_errors, retry_temporal_errors
from .client import DownloadClient
from ..sentinelhub_s... | [
"logging.getLogger",
"threading.Lock",
"time.sleep",
"threading.currentThread"
] | [((422, 449), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (439, 449), False, 'import logging\n'), ((1324, 1330), 'threading.Lock', 'Lock', ([], {}), '()\n', (1328, 1330), False, 'from threading import Lock, currentThread\n'), ((1578, 1593), 'threading.currentThread', 'currentThread', (... |
from __future__ import unicode_literals
__author__ = '<NAME>, <NAME>'
__version__ = (0, 0, 1)
import logging
logger = logging.getLogger(__name__)
from .forms import RemoteForm
from .widgets import RemoteWidget
| [
"logging.getLogger"
] | [((119, 146), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (136, 146), False, 'import logging\n')] |
#!/usr/bin/env python3
""" rrr1_instr.py
Implementation of RRR1 format instructions.
"""
from pyvex.lifting.util import Type, Instruction
from .rtl import * # pylint: disable=[wildcard-import, unused-wildcard-import]
from .logger import log_this
class RRR1_MADD_H_83_1A_Inst(Instruction):
""" Packed Multiply-Add ... | [
"pyvex.lifting.util.Instruction.parse"
] | [((743, 775), 'pyvex.lifting.util.Instruction.parse', 'Instruction.parse', (['self', 'bitstrm'], {}), '(self, bitstrm)\n', (760, 775), False, 'from pyvex.lifting.util import Type, Instruction\n'), ((3473, 3505), 'pyvex.lifting.util.Instruction.parse', 'Instruction.parse', (['self', 'bitstrm'], {}), '(self, bitstrm)\n',... |
from aw_nas.objective.base import BaseObjective
class ContainerObjective(BaseObjective):
NAME = "container"
def __init__(self, search_space, sub_objectives,
losses_coef=None, rewards_coef=None,
schedule_cfg=None):
super().__init__(search_space, schedule_cfg=schedule_... | [
"aw_nas.objective.base.BaseObjective.get_class_"
] | [((365, 412), 'aw_nas.objective.base.BaseObjective.get_class_', 'BaseObjective.get_class_', (["obj['objective_type']"], {}), "(obj['objective_type'])\n", (389, 412), False, 'from aw_nas.objective.base import BaseObjective\n')] |
import numpy as np
import re
from rdkit import Chem
if __name__ == "__main__":
import sys
args = sys.argv[1:]
smiless = args
for smiles in smiless:
m = Chem.MolFromSmiles(smiles)
| [
"rdkit.Chem.MolFromSmiles"
] | [((181, 207), 'rdkit.Chem.MolFromSmiles', 'Chem.MolFromSmiles', (['smiles'], {}), '(smiles)\n', (199, 207), False, 'from rdkit import Chem\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-04-06 20:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Nomina', '0005_auto_20170406_2039'),
]
operations = [
migrations.AlterField... | [
"django.db.models.DateTimeField"
] | [((408, 447), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)'}), '(auto_now_add=True)\n', (428, 447), False, 'from django.db import migrations, models\n')] |
from functools import wraps
from oauthlib.oauth2 import Server
from oauth2_provider.oauth2_validators import OAuth2Validator
from oauth2_provider.oauth2_backends import OAuthLibCore
from .errors import build_error_response
def require_valid_token():
def decorator(view_func):
@wraps(view_func)
d... | [
"oauth2_provider.oauth2_validators.OAuth2Validator",
"functools.wraps"
] | [((294, 310), 'functools.wraps', 'wraps', (['view_func'], {}), '(view_func)\n', (299, 310), False, 'from functools import wraps\n'), ((399, 416), 'oauth2_provider.oauth2_validators.OAuth2Validator', 'OAuth2Validator', ([], {}), '()\n', (414, 416), False, 'from oauth2_provider.oauth2_validators import OAuth2Validator\n'... |
from PyQt5.QtWidgets import QTableWidgetItem, QDialog, QHeaderView
from plus_factory import Ui_Dialog as Plus_Dialog
from PyQt5.QtCore import Qt
import json
from dialog import Ui_Dialog
class MyPlusFactory(Plus_Dialog):
def __init__(self):
super().__init__()
self.Dialog = QDialog()
... | [
"json.load",
"dialog.Ui_Dialog",
"PyQt5.QtWidgets.QTableWidgetItem",
"PyQt5.QtWidgets.QDialog"
] | [((306, 315), 'PyQt5.QtWidgets.QDialog', 'QDialog', ([], {}), '()\n', (313, 315), False, 'from PyQt5.QtWidgets import QTableWidgetItem, QDialog, QHeaderView\n'), ((2760, 2771), 'dialog.Ui_Dialog', 'Ui_Dialog', ([], {}), '()\n', (2769, 2771), False, 'from dialog import Ui_Dialog\n'), ((2790, 2799), 'PyQt5.QtWidgets.QDia... |
from pennylane import numpy as np
from models.multi_class_ensemble import MultiClassEnsemble
from minimodels.pairs import SmallModel
import os
from utils.smallmodel_functions import decision_rule_combo_points, accuracy_full, accuracy, decision_rule_or, decision_rule_points
class CrazyCombined:
def __init__(self, a... | [
"utils.smallmodel_functions.accuracy_full",
"models.multi_class_ensemble.MultiClassEnsemble",
"pennylane.numpy.array",
"os.path.join"
] | [((395, 419), 'models.multi_class_ensemble.MultiClassEnsemble', 'MultiClassEnsemble', (['args'], {}), '(args)\n', (413, 419), False, 'from models.multi_class_ensemble import MultiClassEnsemble\n'), ((1749, 1782), 'pennylane.numpy.array', 'np.array', (['[i[0] for i in guesses]'], {}), '([i[0] for i in guesses])\n', (175... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2018, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
#import os
import numpy as np
import pandas as pd
from unittest import TestCase
from exatomic import gaussian
from exatomic.base import resource
from exatomic.gaussian import Output... | [
"pandas.notnull",
"exatomic.base.resource"
] | [((400, 432), 'exatomic.base.resource', 'resource', (['"""g09-ch3nh2-631g.fchk"""'], {}), "('g09-ch3nh2-631g.fchk')\n", (408, 432), False, 'from exatomic.base import resource\n'), ((459, 496), 'exatomic.base.resource', 'resource', (['"""g09-ch3nh2-augccpvdz.fchk"""'], {}), "('g09-ch3nh2-augccpvdz.fchk')\n", (467, 496),... |
#!/usr/bin/python
# Copyright 2020 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.
"""Tests for mb_validate.py."""
from __future__ import print_function
from __future__ import absolute_import
import sys
import ast
import ... | [
"mb.lib.validation.EnsureNoProprietaryMixinsBucket",
"mb.lib.validation.CheckDuplicateConfigs",
"mb.lib.validation.GetAllConfigsBucket",
"ast.literal_eval",
"mb.lib.validation.CheckAllConfigsAndMixinsReferenced",
"mb.lib.validation.GetAllConfigsMaster",
"unittest.main",
"mb.lib.validation.EnsureNoProp... | [((6955, 6975), 'unittest.skip', 'unittest.skip', (['"""bla"""'], {}), "('bla')\n", (6968, 6975), False, 'import unittest\n'), ((7656, 7671), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7669, 7671), False, 'import unittest\n'), ((1896, 1937), 'ast.literal_eval', 'ast.literal_eval', (['mb_unittest.TEST_CONFIG']... |
# 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, software
# distributed under t... | [
"oslo_policy.policy.DocumentedRuleDefault"
] | [((645, 884), 'oslo_policy.policy.DocumentedRuleDefault', 'policy.DocumentedRuleDefault', ([], {'name': "(base.IDENTITY % 'get_policy')", 'check_str': 'base.RULE_ADMIN_REQUIRED', 'scope_types': "['system']", 'description': '"""Show policy details."""', 'operations': "[{'path': '/v3/policy/{policy_id}', 'method': 'GET'}... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file add_flight.ui
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets, QtSql
import PyQt5.QtSql
from PyQt5.QtWidgets import QMessageBox
class Ui_Dialo... | [
"PyQt5.QtSql.QSqlQuery",
"PyQt5.QtGui.QIcon",
"PyQt5.QtCore.QVariant",
"PyQt5.QtWidgets.QSpacerItem",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtWidgets.QMessageBox.information",
"PyQt5.QtWidgets.QHBoxLayout",
"PyQt5.QtGui.QPixmap",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QPushButt... | [((501, 514), 'PyQt5.QtGui.QIcon', 'QtGui.QIcon', ([], {}), '()\n', (512, 514), False, 'from PyQt5 import QtCore, QtGui, QtWidgets, QtSql\n'), ((45020, 45049), 'PyQt5.QtWidgets.QVBoxLayout', 'QtWidgets.QVBoxLayout', (['Dialog'], {}), '(Dialog)\n', (45041, 45049), False, 'from PyQt5 import QtCore, QtGui, QtWidgets, QtSq... |
#!/usr/bin/env python3
# Copyright (c) 2018, 2020 VMware, 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 appl... | [
"optparse.OptionParser",
"socket.socket",
"sys.exit"
] | [((1219, 1244), 'optparse.OptionParser', 'OptionParser', ([], {'usage': 'usage'}), '(usage=usage)\n', (1231, 1244), False, 'from optparse import OptionParser\n'), ((2981, 2992), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (2989, 2992), False, 'import sys\n'), ((1531, 1542), 'sys.exit', 'sys.exit', (['(1)'], {}), '(... |
import itertools
import logging
import re
from functools import reduce
from math import ceil, floor, log
from typing import Union, Any, Dict, Callable, List, Optional
import datetime
from checkov.terraform.parser_functions import tonumber, FUNCTION_FAILED, create_map, tobool, tostring
"""
This file contains a custom ... | [
"itertools.chain",
"re.split",
"logging.debug",
"functools.reduce",
"re.match",
"datetime.timedelta",
"datetime.utcnow",
"datetime.datetime.fromisoformat",
"re.findall"
] | [((873, 901), 're.match', 're.match', (['pattern', 'input_str'], {}), '(pattern, input_str)\n', (881, 901), False, 'import re\n'), ((2168, 2225), 'functools.reduce', 'reduce', (["(lambda x, y: x if x not in [None, ''] else y)", 'arg'], {}), "(lambda x, y: x if x not in [None, ''] else y, arg)\n", (2174, 2225), False, '... |
import numpy as np
import matplotlib.pyplot as plt
from math import sqrt, copysign
from scipy.optimize import brenth
from scipy.optimize import fsolve,fmin_l_bfgs_b,fmin_cg,fminbound
"""
sign of the number
"""
def sign(x):
if x==0:
return 0
else:
return copysign(1,x)
"""
if function f can't b... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"scipy.optimize.fminbound",
"math.copysign",
"scipy.optimize.brenth",
"numpy.linspace",
"matplotlib.pyplot.close",
"matplotlib.pyp... | [((2562, 2614), 'scipy.optimize.fmin_l_bfgs_b', 'fmin_l_bfgs_b', ([], {'func': 'f', 'x0': '((a + b) / 2)', 'bounds': '[a, b]'}), '(func=f, x0=(a + b) / 2, bounds=[a, b])\n', (2575, 2614), False, 'from scipy.optimize import fsolve, fmin_l_bfgs_b, fmin_cg, fminbound\n'), ((280, 294), 'math.copysign', 'copysign', (['(1)',... |
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.6.6, generator: @autorest/python@5.11.2)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# ------------------------------... | [
"msrest.Serializer",
"azure.core.PipelineClient",
"msrest.Deserializer",
"copy.deepcopy"
] | [((1955, 2020), 'azure.core.PipelineClient', 'PipelineClient', ([], {'base_url': '_base_url', 'config': 'self._config'}), '(base_url=_base_url, config=self._config, **kwargs)\n', (1969, 2020), False, 'from azure.core import PipelineClient\n'), ((2138, 2163), 'msrest.Serializer', 'Serializer', (['client_models'], {}), '... |
# Copyright 2019, A10 Networks
#
# 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 a... | [
"octavia.controller.worker.tasks.network_tasks.ApplyQos",
"octavia.controller.worker.tasks.database_tasks.UpdateLBServerGroupInDB",
"octavia.controller.worker.tasks.network_tasks.AllocateVIP",
"octavia.controller.worker.tasks.compute_tasks.NovaServerGroupCreate",
"taskflow.patterns.unordered_flow.Flow",
"... | [((2581, 2608), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2598, 2608), True, 'from oslo_log import log as logging\n'), ((2694, 2722), 'octavia.controller.worker.flows.amphora_flows.AmphoraFlows', 'amphora_flows.AmphoraFlows', ([], {}), '()\n', (2720, 2722), False, 'from octavia... |
# coding=utf-8
from flask_restplus import Resource
from app.backend.api.restplus import api
from app.backend.api.serializers.user import user_get_serializer, user_post_serializer
from app.backend.web.business.user import UserBus
ns_user = api.namespace('user', description='Users operations and registry')
@ns_user... | [
"app.backend.api.restplus.api.namespace",
"app.backend.api.restplus.api.marshal_with",
"app.backend.web.business.user.UserBus",
"app.backend.api.restplus.api.expect"
] | [((243, 309), 'app.backend.api.restplus.api.namespace', 'api.namespace', (['"""user"""'], {'description': '"""Users operations and registry"""'}), "('user', description='Users operations and registry')\n", (256, 309), False, 'from app.backend.api.restplus import api\n'), ((481, 518), 'app.backend.api.restplus.api.marsh... |
'''
<DOC>
<DOCNO> AP123456-0123 </DOCNO>
<TEXT>
...article text...
</TEXT>
</DOC>
'''
import json, os
from xml.etree.cElementTree import XMLPullParser
from collections import defaultdict
def etree_to_dict(t):
"https://stackoverflow.com/a/10076823/2234013"
d = { t.tag: {} if t.attrib else None }
children =... | [
"xml.etree.cElementTree.XMLPullParser",
"os.path.exists",
"os.makedirs",
"collections.defaultdict",
"json.dump"
] | [((1485, 1516), 'xml.etree.cElementTree.XMLPullParser', 'XMLPullParser', (["['start', 'end']"], {}), "(['start', 'end'])\n", (1498, 1516), False, 'from xml.etree.cElementTree import XMLPullParser\n'), ((359, 376), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (370, 376), False, 'from collections... |
# -*- coding:utf8 -*-
from terminal import Terminal
class Cursor(object):
def __init__(self, term=None):
self.term = Terminal() if term is None else term
self._stream = self.term.stream
self._saved = False
def write(self, s):
self._stream.write(s)
def save(self):
... | [
"terminal.Terminal"
] | [((132, 142), 'terminal.Terminal', 'Terminal', ([], {}), '()\n', (140, 142), False, 'from terminal import Terminal\n')] |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 5 08:14:54 2020
@author: Tom
"""
import ecm
import numpy as np
import matplotlib.pyplot as plt
import os
from sklearn.preprocessing import StandardScaler
import scipy
import pandas as pd
from matplotlib import cm
import configparser
# Turn off code warnings (this is not... | [
"configparser.ConfigParser",
"pandas.read_csv",
"ecm.get_amp_cases",
"ecm.get_weights",
"numpy.array",
"ecm.weighted_avg_and_std",
"numpy.cumsum",
"ecm.config2dict",
"ecm.load_and_amalgamate",
"numpy.histogram",
"ecm.chargeogram",
"ecm.get_net",
"ecm.get_cases",
"matplotlib.pyplot.close",
... | [((367, 400), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (390, 400), False, 'import warnings\n'), ((660, 676), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (669, 676), True, 'import matplotlib.pyplot as plt\n'), ((848, 867), 'ecm.get_amp_ca... |
import math
from depth_first_search import depth_first_search
def dag_shortest_paths(G, w, start_vertex):
traversal = depth_first_search(G)
ordering = traversal.get_topological_order(G, start_vertex)
distance_est = {vertex: math.inf for vertex in G.vertices()}
distance_est[start_vertex] = ... | [
"graph.create_graph",
"depth_first_search.depth_first_search"
] | [((131, 152), 'depth_first_search.depth_first_search', 'depth_first_search', (['G'], {}), '(G)\n', (149, 152), False, 'from depth_first_search import depth_first_search\n'), ((1097, 1136), 'graph.create_graph', 'graph.create_graph', (['E'], {'is_directed': '(True)'}), '(E, is_directed=True)\n', (1115, 1136), False, 'im... |
#setup.py
#cd __file__
#> pip install --editable .
#> pip uninstall HelloClick
from setuptools import setup
setup(
name='HelloClick',
version='1.0',
py_modules=['hello'],
install_requires=[
'Click',
],
#command=module:func
entry_points='''
[console_scripts]
hello=he... | [
"setuptools.setup"
] | [((110, 284), 'setuptools.setup', 'setup', ([], {'name': '"""HelloClick"""', 'version': '"""1.0"""', 'py_modules': "['hello']", 'install_requires': "['Click']", 'entry_points': '"""\n [console_scripts]\n hello=hello:cli\n """'}), '(name=\'HelloClick\', version=\'1.0\', py_modules=[\'hello\'],\n inst... |
# track_errors.py
#
# Collection of functions to error check the tracking output.
#
#
import json
def read_json(path):
# read_json
# read output data stored in JSON file
#
# Inputs: path - path to JSON file
# Outputs: output - output python object
#
with open('output_data.json') ... | [
"json.load"
] | [((349, 387), 'json.load', 'json.load', (['data_file'], {'encoding': '"""utf-8"""'}), "(data_file, encoding='utf-8')\n", (358, 387), False, 'import json\n')] |
from typing import Dict, Tuple, Callable
import cv2
import numpy as np
import albumentations as albu
from facial_attributes_parser.dataset import CelebAMaskHQDataset
def visualization_transform(image: np.array, masks: Dict[int, np.array]) -> Tuple[np.array, np.array]:
shape = 512, 512, 3
result_mask = np.ze... | [
"albumentations.CLAHE",
"albumentations.RandomBrightnessContrast",
"albumentations.Blur",
"albumentations.GaussNoise",
"albumentations.RandomGamma",
"numpy.zeros",
"albumentations.Compose",
"albumentations.Resize",
"cv2.cvtColor",
"albumentations.MotionBlur",
"cv2.resize",
"albumentations.Shar... | [((315, 346), 'numpy.zeros', 'np.zeros', (['shape'], {'dtype': 'np.uint8'}), '(shape, dtype=np.uint8)\n', (323, 346), True, 'import numpy as np\n'), ((474, 514), 'cv2.resize', 'cv2.resize', (['image', 'result_mask.shape[:2]'], {}), '(image, result_mask.shape[:2])\n', (484, 514), False, 'import cv2\n'), ((658, 696), 'cv... |
# -*- coding: utf-8 -*-
"""
Script to perform the harmonic analysis of the sea level
This script reads the sea level (corrected) raw data to perform harmonic analysis
and filtering of the water level.
It saves the tidal reconstruction, the residual and the filtered sea level to
a file.
Must intall pytide
conda i... | [
"numpy.mean",
"numpy.convolve",
"numpy.unique",
"pandas.read_csv",
"numpy.array",
"numpy.zeros",
"pandas.DataFrame",
"datetime.timedelta",
"pytide.WaveTable",
"oceans.filters.lanc"
] | [((863, 906), 'pandas.read_csv', 'pd.read_csv', (['"""data/raw_data/SL_DH_data.csv"""'], {}), "('data/raw_data/SL_DH_data.csv')\n", (874, 906), True, 'import pandas as pd\n'), ((1182, 1200), 'pytide.WaveTable', 'pytide.WaveTable', ([], {}), '()\n', (1198, 1200), False, 'import pytide\n'), ((1459, 1475), 'numpy.unique',... |
from colusa import colors
def error(msg, *args, **kwargs):
print(colors.red("[ERROR]"), msg, *args, **kwargs)
def warn(msg, *args, **kwargs):
print(colors.yellow("[WARN]"), msg, *args, **kwargs)
def info(msg, *args, **kwargs):
print(colors.green("[INFO]"), msg, *args, **kwargs)
| [
"colusa.colors.yellow",
"colusa.colors.green",
"colusa.colors.red"
] | [((71, 92), 'colusa.colors.red', 'colors.red', (['"""[ERROR]"""'], {}), "('[ERROR]')\n", (81, 92), False, 'from colusa import colors\n'), ((160, 183), 'colusa.colors.yellow', 'colors.yellow', (['"""[WARN]"""'], {}), "('[WARN]')\n", (173, 183), False, 'from colusa import colors\n'), ((251, 273), 'colusa.colors.green', '... |
# ----------------------------------------------------------------------------
# ppytty
# ----------------------------------------------------------------------------
# Copyright (c) <NAME>.
# See LICENSE for details.
# ----------------------------------------------------------------------------
from ppytty.kernel imp... | [
"ppytty.kernel.api.key_read",
"ppytty.kernel.api.task_destroy",
"ppytty.kernel.api.sleep",
"ppytty.kernel.api.task_spawn",
"ppytty.kernel.api.message_wait",
"ppytty.kernel.api.task_wait",
"ppytty.kernel.run",
"ppytty.kernel.api.state_dump"
] | [((826, 835), 'ppytty.kernel.run', 'run', (['task'], {}), '(task)\n', (829, 835), False, 'from ppytty.kernel import run, api\n'), ((1812, 1832), 'ppytty.kernel.run', 'run', (['user_level_task'], {}), '(user_level_task)\n', (1815, 1832), False, 'from ppytty.kernel import run, api\n'), ((3849, 3860), 'ppytty.kernel.run',... |
"""
OnModified Function
"""
import os
import boto3
import requests
from aws_lambda_powertools.tracing import Tracer # pylint: disable=import-error
from aws_lambda_powertools.logging.logger import Logger # pylint: disable=import-error
API_URL = os.environ["API_URL"]
ENVIRONMENT = os.environ["ENVIRONMENT"]
TABLE_NAME... | [
"requests.post",
"boto3.resource",
"aws_lambda_powertools.tracing.Tracer",
"aws_lambda_powertools.logging.logger.Logger"
] | [((361, 387), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {}), "('dynamodb')\n", (375, 387), False, 'import boto3\n'), ((504, 512), 'aws_lambda_powertools.logging.logger.Logger', 'Logger', ([], {}), '()\n', (510, 512), False, 'from aws_lambda_powertools.logging.logger import Logger\n'), ((553, 561), 'aws_l... |
# Generated by Django 3.1.1 on 2020-09-27 17:04
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('products', '0003_product_minimum_price'),
('organization', '0004_auto_20200914_0713'),
('sales', '0015_auto_... | [
"django.db.migrations.DeleteModel",
"django.db.models.DateField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DecimalField",
"django.db.migrations.RemoveField",
"django.db.models.CharField"
] | [((1965, 2030), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""invoiceentry"""', 'name': '"""invoice"""'}), "(model_name='invoiceentry', name='invoice')\n", (1987, 2030), False, 'from django.db import migrations, models\n'), ((2075, 2140), 'django.db.migrations.RemoveField', 'migr... |
# Routine to calibrate the image frames of Halpha for estimation of
# absolute flux of net emission line by using line and continuum image
# frames of standard objects and program objects.
import os.path
import numpy as np
from scipy import interpolate
from scipy.optimize import curve_fit
import matplotlib.pyplot a... | [
"numpy.sqrt",
"numpy.amin",
"scipy.integrate.quad",
"numpy.log",
"numpy.exp",
"scipy.interpolate.InterpolatedUnivariateSpline",
"numpy.loadtxt",
"numpy.amax"
] | [((1265, 1299), 'scipy.interpolate.InterpolatedUnivariateSpline', 'InterpolatedUnivariateSpline', (['x', 'y'], {}), '(x, y)\n', (1293, 1299), False, 'from scipy.interpolate import InterpolatedUnivariateSpline\n'), ((5275, 5333), 'scipy.integrate.quad', 'integrate.quad', (['auxContFunc', 'xcmin', 'xcmax'], {'epsabs': '(... |
# -*- coding: utf-8 -*-
"""Helper utility function for customization."""
import sys
import os
import docutils
import subprocess
READTHEDOCS_BUILD = (os.environ.get('READTHEDOCS', None) is not None)
if not os.path.exists('web-data'):
subprocess.call('rm -rf web-data;' +
'git clone https://github.co... | [
"sys.stderr.write",
"os.path.exists",
"os.environ.get",
"subprocess.call"
] | [((414, 470), 'sys.stderr.write', 'sys.stderr.write', (["('READTHEDOCS=%s\\n' % READTHEDOCS_BUILD)"], {}), "('READTHEDOCS=%s\\n' % READTHEDOCS_BUILD)\n", (430, 470), False, 'import sys\n'), ((150, 185), 'os.environ.get', 'os.environ.get', (['"""READTHEDOCS"""', 'None'], {}), "('READTHEDOCS', None)\n", (164, 185), False... |
from collections import OrderedDict
import inspect
class Resilient(object):
def meta(self):
return inspect.getsource(type(self))
def state_dict(self):
raise NotImplementedError
def load_state_dict(self, state):
raise NotImplementedError
def copy(self):
raise NotImplementedError
... | [
"collections.OrderedDict"
] | [((401, 429), 'collections.OrderedDict', 'OrderedDict', (['*args'], {}), '(*args, **kwargs)\n', (412, 429), False, 'from collections import OrderedDict\n')] |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.python.autograph.pyct.inspect_utils.isconstructor",
"inspect.ismethod",
"tensorflow.python.autograph.utils.ag_logging.log",
"tensorflow.python.autograph.pyct.cache.UnboundInstanceCache",
"tensorflow.python.util.tf_inspect.ismethod",
"tensorflow.python.util.tf_inspect.getmodule",
"tensorflow.... | [((1263, 1291), 'tensorflow.python.autograph.pyct.cache.UnboundInstanceCache', 'cache.UnboundInstanceCache', ([], {}), '()\n', (1289, 1291), False, 'from tensorflow.python.autograph.pyct import cache\n'), ((1350, 1384), 'sys.modules.get', 'sys.modules.get', (['module_name', 'None'], {}), '(module_name, None)\n', (1365,... |
#!/usr/bin/env python3
# -+-coding: utf-8 -+-
#--------------------------------------------
# Authors: <NAME> <<EMAIL>>
#
#--------------------------------------------
# Date: 05.09.19
#--------------------------------------------
# License: BSD (3-clause)
#--------------------------------------------
# Updates
#-----... | [
"logging.getLogger",
"wx.Bitmap",
"jumeg.gui.wxlib.utils.jumeg_gui_wxlib_utils_controls.JuMEG_wxControlGrid",
"tsv.plot.jumeg_tsv_plot2d_data_options.JuMEG_TSV_PLOT2D_DATA_OPTIONS",
"jumeg.base.jumeg_logger.setup_script_logging",
"tsv.plot.jumeg_tsv_plot2d_data_options.GroupOptions",
"wx.BoxSizer",
"w... | [((455, 481), 'logging.getLogger', 'logging.getLogger', (['"""jumeg"""'], {}), "('jumeg')\n", (472, 481), False, 'import sys, logging\n'), ((10519, 10590), 'jumeg.base.jumeg_logger.setup_script_logging', 'jumeg_logger.setup_script_logging', ([], {'name': '"""JuMEG"""', 'opt': 'opt', 'logger': 'logger'}), "(name='JuMEG'... |
import os.path
import numpy as np
import random
from argparse import ArgumentParser
from collections import Counter
from utils.data_writer import DataWriter
from utils.file_utils import make_dir
from utils.constants import TRAIN, VALID, TEST, SAMPLE_ID, INPUTS, OUTPUT
WINDOW_SIZE = 20
STRIDE = 4
TRAIN_FRAC = 0.85
VA... | [
"argparse.ArgumentParser",
"random.seed",
"collections.Counter",
"random.random",
"utils.file_utils.make_dir",
"numpy.loadtxt"
] | [((2232, 2248), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (2246, 2248), False, 'from argparse import ArgumentParser\n'), ((2471, 2486), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (2482, 2486), False, 'import random\n'), ((2587, 2609), 'numpy.loadtxt', 'np.loadtxt', (['train_path'], {})... |
from typing import Tuple
import haiku as hk
import jax.numpy as np
from chex import assert_axis_dimension
from ramsey._src.attention.attention import Attention
from ramsey._src.family import Family, Gaussian
from ramsey._src.neural_process.neural_process import NP
__all__ = ["ANP"]
# pylint: disable=too-many-insta... | [
"jax.numpy.concatenate",
"chex.assert_axis_dimension",
"ramsey._src.family.Gaussian",
"jax.numpy.tile"
] | [((939, 949), 'ramsey._src.family.Gaussian', 'Gaussian', ([], {}), '()\n', (947, 949), False, 'from ramsey._src.family import Family, Gaussian\n'), ((2411, 2463), 'jax.numpy.concatenate', 'np.concatenate', (['[z_deterministic, z_latent]'], {'axis': '(-1)'}), '([z_deterministic, z_latent], axis=-1)\n', (2425, 2463), Tru... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from pyomo.environ import *
from sample_mods.cstr_yeonsoo.cstr_yeonsoo import cstr_yeonsoo_dae
from nmpc_mhe.pyomo_dae.NMPCGen_pyDAE import NmpcGen_DAE
from nmpc_mhe.aux.utils import load_iguess
from nm... | [
"sample_mods.cstr_yeonsoo.cstr_yeonsoo.cstr_yeonsoo_dae",
"nmpc_mhe.aux.utils.reconcile_nvars_mequations",
"nmpc_mhe.pyomo_dae.NMPCGen_pyDAE.NmpcGen_DAE",
"matplotlib.pyplot.plot",
"sys.exit",
"matplotlib.pyplot.show"
] | [((703, 725), 'sample_mods.cstr_yeonsoo.cstr_yeonsoo.cstr_yeonsoo_dae', 'cstr_yeonsoo_dae', (['(1)', '(1)'], {}), '(1, 1)\n', (719, 725), False, 'from sample_mods.cstr_yeonsoo.cstr_yeonsoo import cstr_yeonsoo_dae\n'), ((806, 1183), 'nmpc_mhe.pyomo_dae.NMPCGen_pyDAE.NmpcGen_DAE', 'NmpcGen_DAE', (['mod', '(1.0)', 'states... |
#!/usr/bin/env python
# Author: <NAME>
# Date: 7/11/2005
#
# This is a tutorial to show some of the more advanced things
# you can do with Cg. Specifically, with Non Photo Realistic
# effects like Toon Shading. It also shows how to implement
# multiple buffers in Panda.
from direct.showbase.ShowBase import ShowBase
f... | [
"direct.gui.OnscreenText.OnscreenText",
"panda3d.core.LVecBase4",
"panda3d.core.PandaNode",
"direct.showbase.ShowBase.ShowBase.__init__",
"direct.actor.Actor.Actor"
] | [((849, 984), 'direct.gui.OnscreenText.OnscreenText', 'OnscreenText', ([], {'text': 'msg', 'style': '(1)', 'fg': '(1, 1, 1, 1)', 'parent': 'base.a2dTopLeft', 'align': 'TextNode.ALeft', 'pos': '(0.08, -pos - 0.04)', 'scale': '(0.05)'}), '(text=msg, style=1, fg=(1, 1, 1, 1), parent=base.a2dTopLeft,\n align=TextNode.AL... |
# coding:utf-8
from __future__ import absolute_import, unicode_literals
from sanic.views import HTTPMethodView
from sanic.response import json
__author__ = "golden"
__date__ = '2018/6/25'
class ProjectsApi(HTTPMethodView):
async def get(self, req):
app = req.app
res = app.manager.projects()
... | [
"sanic.response.json"
] | [((330, 339), 'sanic.response.json', 'json', (['res'], {}), '(res)\n', (334, 339), False, 'from sanic.response import json\n'), ((531, 539), 'sanic.response.json', 'json', (['""""""'], {}), "('')\n", (535, 539), False, 'from sanic.response import json\n')] |
# Analyse the AFQMC back propagated RDM.
import glob
import h5py
import numpy
try:
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
have_mpl = True
except ImportError:
have_mpl = False
import scipy.stats
from afqmctools.analysis.average import average_one_rdm
from afqmctools.a... | [
"numpy.mean",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"matplotlib.use",
"afqmctools.analysis.average.average_one_rdm",
"matplotlib.pyplot.xlabel",
"h5py.File",
"afqmctools.analysis.extraction.get_metadata",
"numpy.einsum",
"matplotlib.pyplot.errorbar",
"afqmctools.analysis.extra... | [((116, 130), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (123, 130), True, 'import matplotlib as mpl\n'), ((727, 747), 'numpy.mean', 'numpy.mean', (['energies'], {}), '(energies)\n', (737, 747), False, 'import numpy\n'), ((1016, 1038), 'afqmctools.analysis.extraction.get_metadata', 'get_metadata', (... |
#! /usr/bin/env python
import json
from snmp_helper import snmp_get_oid_v3, snmp_extract
import time
from pprint import pprint
from email_helper import send_mail
import pdb
ccmHistoryRunningLastChanged = '1.3.6.1.4.1.9.9.43.1.1.1.0'
ccmHistoryRunningLastSaved = '1.3.6.1.4.172.16.58.3.1.1.2.0'
ccmHistoryStartupLastCha... | [
"snmp_helper.snmp_extract",
"time.sleep",
"snmp_helper.snmp_get_oid_v3",
"pprint.pprint",
"email_helper.send_mail"
] | [((1703, 1718), 'pprint.pprint', 'pprint', (['devices'], {}), '(devices)\n', (1709, 1718), False, 'from pprint import pprint\n'), ((1781, 1796), 'time.sleep', 'time.sleep', (['(300)'], {}), '(300)\n', (1791, 1796), False, 'import time\n'), ((712, 765), 'email_helper.send_mail', 'send_mail', (['"""<EMAIL>"""', '"""Route... |
from wysdom import UserObject, UserProperty
class Person(UserObject):
first_name: str = UserProperty(str)
last_name: str = UserProperty(str, default="", optional=False)
| [
"wysdom.UserProperty"
] | [((94, 111), 'wysdom.UserProperty', 'UserProperty', (['str'], {}), '(str)\n', (106, 111), False, 'from wysdom import UserObject, UserProperty\n'), ((133, 178), 'wysdom.UserProperty', 'UserProperty', (['str'], {'default': '""""""', 'optional': '(False)'}), "(str, default='', optional=False)\n", (145, 178), False, 'from ... |
"""
script to create pandas Dataframes with all results from multiple runs of the EQL stored inside.
"""
__author__ = "<NAME> (GMi)"
__version__ = "1.2.0"
__date__ = "07.09.2020"
__email__ = "<EMAIL>"
__status__ = "Development"
import numpy as np
#from matplotlib import pyplot as plt
import pandas
import sympy
i... | [
"sympy.dotprint",
"numpy.sqrt",
"pandas.read_csv",
"sympy.sympify",
"os.path.join",
"numpy.max",
"matplotlib.pylab.rcParams.update",
"numpy.min",
"pandas.DataFrame",
"os.walk"
] | [((798, 827), 'matplotlib.pylab.rcParams.update', 'pylab.rcParams.update', (['params'], {}), '(params)\n', (819, 827), True, 'import matplotlib.pylab as pylab\n'), ((3929, 3944), 'os.walk', 'walk', (['directory'], {}), '(directory)\n', (3933, 3944), False, 'from os import path, walk\n'), ((4579, 4594), 'os.walk', 'walk... |
#########################################################
#
# Fringe Model Functions
#
#########################################################
import sys, copy
import numpy as np
import matplotlib.pyplot as plt
import scipy.signal as signal
from scipy.optimize import curve_fit
import smart
def get_peak_fringe_freque... | [
"scipy.optimize.curve_fit",
"numpy.sin",
"numpy.argmax",
"numpy.linspace",
"copy.deepcopy",
"scipy.signal.lombscargle"
] | [((435, 463), 'copy.deepcopy', 'copy.deepcopy', (['fringe_object'], {}), '(fringe_object)\n', (448, 463), False, 'import sys, copy\n'), ((561, 591), 'numpy.linspace', 'np.linspace', (['(0.01)', '(10.0)', '(10000)'], {}), '(0.01, 10.0, 10000)\n', (572, 591), True, 'import numpy as np\n'), ((601, 658), 'scipy.signal.lomb... |
r"""RPM Module
This module enables you to manipulate rpms and the rpm database.
"""
import warnings
import os
from rpm._rpm import *
from rpm.transaction import *
import rpm._rpm as _rpm
_RPMVSF_NODIGESTS = _rpm._RPMVSF_NODIGESTS
_RPMVSF_NOHEADER = _rpm._RPMVSF_NOHEADER
_RPMVSF_NOPAYLOAD = _rpm._RPMVSF_NOPAYLOAD
_RP... | [
"warnings.warn"
] | [((591, 664), 'warnings.warn', 'warnings.warn', (['"""Use rpm.hdr() instead."""', 'DeprecationWarning'], {'stacklevel': '(2)'}), "('Use rpm.hdr() instead.', DeprecationWarning, stacklevel=2)\n", (604, 664), False, 'import warnings\n')] |
import click
def validate_output_value(ctx, param, value):
value = str(value).lower()
if value not in ['json', 'table', 'yaml']:
raise click.BadParameter(value + '. Possible values: json | table | yaml')
return value
| [
"click.BadParameter"
] | [((153, 221), 'click.BadParameter', 'click.BadParameter', (["(value + '. Possible values: json | table | yaml')"], {}), "(value + '. Possible values: json | table | yaml')\n", (171, 221), False, 'import click\n')] |
"""High-level sound and video player."""
from __future__ import print_function
from __future__ import division
from builtins import object
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 <NAME>
# All rights reserved.
#
# Redistribution and use in source ... | [
"pyglet.clock.unschedule",
"pyglet.image.Texture.create",
"pyglet.clock.schedule_interval",
"pyglet.media.sources.base.SourceGroup",
"pyglet.media.drivers.get_audio_driver",
"pyglet.media.drivers.get_silent_audio_driver"
] | [((9523, 9611), 'pyglet.image.Texture.create', 'pyglet.image.Texture.create', (['video_format.width', 'video_format.height'], {'rectangle': '(True)'}), '(video_format.width, video_format.height,\n rectangle=True)\n', (9550, 9611), False, 'import pyglet\n'), ((4562, 4606), 'pyglet.clock.unschedule', 'pyglet.clock.uns... |
from typing import Dict
from gopay.http import Request, Response, Browser
from gopay.enums import Language
import json
JSON = 'application/json'
FORM = 'application/x-www-form-urlencoded'
class GoPay:
def __init__(self, config: dict, browser: Browser) -> None:
self.browser = browser
self.config ... | [
"json.dumps",
"gopay.http.Request"
] | [((848, 857), 'gopay.http.Request', 'Request', ([], {}), '()\n', (855, 857), False, 'from gopay.http import Request, Response, Browser\n'), ((1358, 1374), 'json.dumps', 'json.dumps', (['data'], {}), '(data)\n', (1368, 1374), False, 'import json\n')] |
#!/usr/bin/env python3
# acma: finds the telco for a number (and tells you if it is vuln to voicemail attacks)
# Copyright (C) 2014, Cyphar All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redi... | [
"flask.render_template",
"sqlite3.connect",
"argparse.ArgumentParser",
"flask.Flask",
"json.dumps",
"functools.wraps",
"flask.Response",
"flask.current_app.make_default_options_response"
] | [((1727, 1748), 'flask.Flask', 'flask.Flask', (['__name__'], {}), '(__name__)\n', (1738, 1748), False, 'import flask\n'), ((3674, 3767), 'json.dumps', 'json.dumps', (["{'code': 200, 'body': {'number': number, 'telco': telco, 'vulnerable': vuln}}"], {}), "({'code': 200, 'body': {'number': number, 'telco': telco,\n 'v... |
from app.controllers import login, opinions, status, users
from fastapi import APIRouter
api_route = APIRouter()
api_route.include_router(status.router, prefix="/status", tags=["status"])
api_route.include_router(login.router, prefix="/login", tags=["login"])
api_route.include_router(users.router, prefix="/users", tag... | [
"fastapi.APIRouter"
] | [((102, 113), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (111, 113), False, 'from fastapi import APIRouter\n')] |
# Copyright 2022 Huawei Technologies Co., Ltd
#
# 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... | [
"numpy.clip",
"numpy.hanning",
"numpy.fromfile",
"numpy.sqrt",
"numpy.hstack",
"numpy.array",
"numpy.nanmean",
"numpy.linalg.norm",
"numpy.mean",
"os.path.exists",
"argparse.ArgumentParser",
"numpy.where",
"api.infer.SdkApi",
"numpy.max",
"numpy.exp",
"numpy.stack",
"numpy.frombuffer... | [((924, 980), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""siamRPN inference"""'}), "(description='siamRPN inference')\n", (947, 980), False, 'import argparse\n'), ((1890, 1910), 'numpy.sqrt', 'np.sqrt', (['(wc_z * hc_z)'], {}), '(wc_z * hc_z)\n', (1897, 1910), True, 'import numpy as n... |
# Simple systolic array of P processing element, each one increments by 1 the incoming element
import argparse
import dace
import numpy as np
import pdb
import select
import sys
N = dace.symbol("N")
P = dace.symbol("P")
def make_copy_to_fpga_state(sdfg):
########################################################... | [
"dace.memlet.EmptyMemlet",
"numpy.abs",
"argparse.ArgumentParser",
"dace.graph.edges.InterstateEdge",
"dace.properties.CodeProperty.from_string",
"dace.properties.SubsetProperty.from_string",
"dace.memlet.Memlet.simple",
"dace.symbol",
"numpy.max",
"numpy.sum",
"dace.SDFG",
"numpy.nonzero",
... | [((184, 200), 'dace.symbol', 'dace.symbol', (['"""N"""'], {}), "('N')\n", (195, 200), False, 'import dace\n'), ((205, 221), 'dace.symbol', 'dace.symbol', (['"""P"""'], {}), "('P')\n", (216, 221), False, 'import dace\n'), ((1330, 1355), 'dace.SDFG', 'dace.SDFG', (['"""array_read_A"""'], {}), "('array_read_A')\n", (1339,... |
import cv2
import pytesseract
import imutils
pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe"
image = cv2.imread('1.png',0)
image = imutils.resize(image, width=300)
thresh = cv2.threshold(image, 150, 255, cv2.THRESH_BINARY_INV)[1]
kernel = cv2.getStructuringElement(cv2.MORPH_EL... | [
"cv2.threshold",
"cv2.imshow",
"imutils.resize",
"cv2.morphologyEx",
"cv2.waitKey",
"pytesseract.image_to_string",
"cv2.GaussianBlur",
"cv2.getStructuringElement",
"cv2.imread"
] | [((143, 165), 'cv2.imread', 'cv2.imread', (['"""1.png"""', '(0)'], {}), "('1.png', 0)\n", (153, 165), False, 'import cv2\n'), ((173, 205), 'imutils.resize', 'imutils.resize', (['image'], {'width': '(300)'}), '(image, width=300)\n', (187, 205), False, 'import imutils\n'), ((282, 334), 'cv2.getStructuringElement', 'cv2.g... |
#!/usr/bin/env python
import eventlet
eventlet.monkey_patch()
import json
import requests
from flask import Flask, render_template, session, request, \
copy_current_request_context
from flask_socketio import SocketIO, emit, join_room, leave_room, \
close_room, rooms, disconnect
# Set this variable to "threadi... | [
"flask.render_template",
"requests.post",
"flask_socketio.disconnect",
"flask.session.get",
"flask.Flask",
"flask_socketio.emit",
"json.dumps",
"flask_socketio.SocketIO",
"flask.request.get_json",
"eventlet.monkey_patch"
] | [((38, 61), 'eventlet.monkey_patch', 'eventlet.monkey_patch', ([], {}), '()\n', (59, 61), False, 'import eventlet\n'), ((511, 526), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (516, 526), False, 'from flask import Flask, render_template, session, request, copy_current_request_context\n'), ((575, 636), '... |
# coding: utf-8
# In[1]:
import math
import torch
from torch.nn.parameter import Parameter
import torch.nn.functional as F
import torch.nn as nn
Module = nn.Module
import collections
from itertools import repeat
# In[2]:
def _ntuple(n):
def parse(x):
if isinstance(x, collections.Iterable):
... | [
"math.floor",
"torch.Tensor",
"math.sqrt",
"itertools.repeat"
] | [((352, 364), 'itertools.repeat', 'repeat', (['x', 'n'], {}), '(x, n)\n', (358, 364), False, 'from itertools import repeat\n'), ((1825, 1837), 'math.sqrt', 'math.sqrt', (['n'], {}), '(n)\n', (1834, 1837), False, 'import math\n'), ((3204, 3326), 'math.floor', 'math.floor', (['((in_height + 2 * self.padding[0] - self.dil... |
import asyncio
import os
import tempfile
from pathlib import Path
from typing import Optional, Union
from aiofiles import os as aiofiles_os
from aiohttp.abc import AbstractStreamWriter
from aiohttp.typedefs import LooseHeaders
from aiohttp.web import FileResponse
makedirs = aiofiles_os.wrap(os.makedirs) # as in aiof... | [
"pathlib.Path",
"aiofiles.os.wrap",
"asyncio.create_subprocess_exec",
"tempfile._get_candidate_names",
"asyncio.get_event_loop"
] | [((277, 306), 'aiofiles.os.wrap', 'aiofiles_os.wrap', (['os.makedirs'], {}), '(os.makedirs)\n', (293, 306), True, 'from aiofiles import os as aiofiles_os\n'), ((347, 374), 'aiofiles.os.wrap', 'aiofiles_os.wrap', (['os.rename'], {}), '(os.rename)\n', (363, 374), True, 'from aiofiles import os as aiofiles_os\n'), ((421, ... |
from collections import OrderedDict
from levenshteinDistance import levenshtein as ld
#------------------------
# shared variables:
#------------------------
words = OrderedDict()
words['Eng'] = ''
words['Ger'] = ''
words['Mal'] = ''
words['Kor'] = ''
words['Swa'] = ''
outputFilename = 'output.txt'
allophones = {
... | [
"collections.OrderedDict",
"levenshteinDistance.levenshtein"
] | [((168, 181), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (179, 181), False, 'from collections import OrderedDict\n'), ((1643, 1657), 'levenshteinDistance.levenshtein', 'ld', (['word', 'lang'], {}), '(word, lang)\n', (1645, 1657), True, 'from levenshteinDistance import levenshtein as ld\n')] |
from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL.GL import *
import math
a = 0
cores = ( (1,0,0),(1,1,0),(0,1,0),(0,1,1),(0,0,1),(1,0,1),(0.5,1,1),(1,0,0.5) )
def piramide():
raio = 2
raio2 = 2
N = 5
H = 4.0
pontosBase = []
pontosBase1 = []
angulo =(2*math.pi)/N
glPush... | [
"math.cos",
"math.sin"
] | [((530, 550), 'math.cos', 'math.cos', (['(i * angulo)'], {}), '(i * angulo)\n', (538, 550), False, 'import math\n'), ((568, 588), 'math.sin', 'math.sin', (['(i * angulo)'], {}), '(i * angulo)\n', (576, 588), False, 'import math\n'), ((783, 803), 'math.cos', 'math.cos', (['(i * angulo)'], {}), '(i * angulo)\n', (791, 80... |
# coding=utf-8
import traceback
import h5py
import skimage.transform
from keras.utils import Sequence
import numpy as np
import cv2
import glob
import pandas as pd
import os
from kf_util import flip_axis
def rgbf2bgr(rgbf):
t = rgbf*255.0
t = np.clip(t, 0.,255.0)
bgr = t.astype(np.uint8)[..., ::-1]
return bgr
d... | [
"numpy.clip",
"numpy.array",
"matplotlib.pylab.imshow",
"matplotlib.pylab.show",
"numpy.rot90",
"numpy.moveaxis",
"matplotlib.pylab.figure",
"numpy.random.random",
"pandas.DataFrame",
"glob.glob",
"cv2.merge",
"kf_util.flip_axis",
"h5py.File",
"cv2.split",
"cv2.cvtColor",
"cv2.imread",... | [((248, 270), 'numpy.clip', 'np.clip', (['t', '(0.0)', '(255.0)'], {}), '(t, 0.0, 255.0)\n', (255, 270), True, 'import numpy as np\n'), ((512, 554), 'pandas.DataFrame', 'pd.DataFrame', (['path_in'], {'columns': "['path_in']"}), "(path_in, columns=['path_in'])\n", (524, 554), True, 'import pandas as pd\n'), ((596, 620),... |
from __future__ import unicode_literals, print_function, absolute_import, division, generators, nested_scopes
import unittest
from jsonpath_ng.lexer import JsonPathLexer
from jsonpath_ng.parser import JsonPathParser
from jsonpath_ng.jsonpath import *
class TestParser(unittest.TestCase):
# TODO: This will be much ... | [
"jsonpath_ng.lexer.JsonPathLexer"
] | [((585, 611), 'jsonpath_ng.lexer.JsonPathLexer', 'JsonPathLexer', ([], {'debug': '(False)'}), '(debug=False)\n', (598, 611), False, 'from jsonpath_ng.lexer import JsonPathLexer\n')] |
from datetime import datetime
def formatter(data, headers):
"""Pretty-print a pingdom notification."""
# JSON data formatting was obtained from https://www.pingdom.com/resources/webhooks/
# these are common to all check types
check_id = data["check_id"]
check_name = data["check_name"]
current_... | [
"datetime.datetime.fromtimestamp"
] | [((391, 446), 'datetime.datetime.fromtimestamp', 'datetime.fromtimestamp', (["data['state_changed_timestamp']"], {}), "(data['state_changed_timestamp'])\n", (413, 446), False, 'from datetime import datetime\n')] |
import tweepy
import logging
import time
from newsplease import NewsPlease
from newspaper import Article
from newspaper import fulltext
import requests
from lxml import html
import requests
from bs4 import BeautifulSoup
from urllib.request import Request, urlopen
# text to image
import numpy as np
import textwrap
impo... | [
"logging.basicConfig",
"logging.getLogger",
"PIL.Image.fromarray",
"config.create_api",
"numpy.ones",
"urllib.request.Request",
"numpy.asarray",
"PIL.ImageFont.truetype",
"time.sleep",
"bs4.BeautifulSoup",
"newsplease.NewsPlease.from_url",
"PIL.ImageDraw.Draw",
"textwrap.wrap",
"urllib.req... | [((527, 713), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""bot.log"""', 'level': 'logging.DEBUG', 'format': '"""%(asctime)s.%(msecs)03d %(levelname)s %(module)s - %(funcName)s: %(message)s"""', 'datefmt': '"""%Y-%m-%d %H:%M:%S"""'}), "(filename='bot.log', level=logging.DEBUG, format=\n '%(asct... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"numpy.mean",
"numpy.tril_indices_from",
"sklearn.metrics.f1_score",
"sklearn.mixture.GaussianMixture",
"sklearn.cluster.SpectralClustering",
"sklearn.cluster.AgglomerativeClustering",
"jax.lax.map",
"numpy.array",
"functools.partial",
"collections.defaultdict",
"jax.numpy.mean"
] | [((969, 1023), 'functools.partial', 'functools.partial', (['onp.vectorize'], {'signature': '"""(n)->(m)"""'}), "(onp.vectorize, signature='(n)->(m)')\n", (986, 1023), False, 'import functools\n'), ((940, 965), 'numpy.mean', 'onp.mean', (['(preds == labels)'], {}), '(preds == labels)\n', (948, 965), True, 'import numpy ... |
import numpy as np
import matplotlib.pylab as plt
import os
clear = lambda: os.system('cls' if os.name=='nt' else 'clear')
# Activation
def step_function(x):
# if x > 0:
# return 1
# else:
# return 0
y = x > 0
return y.astype(np.int)
def sigmoid(x):
return 1 / (1 + np.exp(-x))
... | [
"matplotlib.pylab.ylim",
"numpy.max",
"numpy.exp",
"numpy.sum",
"matplotlib.pylab.show",
"numpy.maximum",
"os.system",
"matplotlib.pylab.plot",
"numpy.arange"
] | [((76, 124), 'os.system', 'os.system', (["('cls' if os.name == 'nt' else 'clear')"], {}), "('cls' if os.name == 'nt' else 'clear')\n", (85, 124), False, 'import os\n'), ((344, 360), 'numpy.maximum', 'np.maximum', (['(0)', 'x'], {}), '(0, x)\n', (354, 360), True, 'import numpy as np\n'), ((427, 440), 'numpy.sum', 'np.su... |
#!/usr/bin/env python3
import sys, os, logging, argparse, boto3, socket, textwrap
from yaml import safe_load
from urllib.parse import urlparse
from socket import gethostname as ghn
__version__ = '0.1'
try:
import coloredlogs
coloredlogs.install(
isatty = True,
show_name = False,
show_se... | [
"logging.getLogger",
"os.path.exists",
"textwrap.dedent",
"urllib.parse.urlparse",
"coloredlogs.install",
"os.makedirs",
"boto3.Session",
"os.path.join",
"os.path.isdir",
"os.path.basename",
"os.path.abspath",
"socket.gethostname",
"os.path.expanduser"
] | [((234, 378), 'coloredlogs.install', 'coloredlogs.install', ([], {'isatty': '(True)', 'show_name': '(False)', 'show_severity': '(False)', 'level': 'logging.NOTSET', 'severity_to_style': "{'DEBUG': {'color': 'blue'}}"}), "(isatty=True, show_name=False, show_severity=False,\n level=logging.NOTSET, severity_to_style={'... |
import argparse
import pkg_resources
def _registered_commands(group):
registered_commands = pkg_resources.iter_entry_points(group = group)
return {c.name: c for c in registered_commands}
def dispatch(argv: list):
registered_commands = _registered_commands(group = "pentools.registered_commands")
parser... | [
"pkg_resources.iter_entry_points",
"argparse.ArgumentParser"
] | [((97, 141), 'pkg_resources.iter_entry_points', 'pkg_resources.iter_entry_points', ([], {'group': 'group'}), '(group=group)\n', (128, 141), False, 'import pkg_resources\n'), ((323, 363), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""pentools"""'}), "(prog='pentools')\n", (346, 363), False, 'im... |
"""
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | [
"oneflow.framework.docstr.utils.add_docstr"
] | [((660, 1119), 'oneflow.framework.docstr.utils.add_docstr', 'add_docstr', (['oneflow.isnan', '"""\n Returns a new tensor with boolean elements representing if each element of input is NaN or not.\n\n Args:\n input(Tensor): the input tensor.\n\n Returns:\n A boolean tensor that is True where input... |
#!/usr/bin/env python
import smtplib
import argparse
import json
from hop import stream
from hop.models import GCNCircular
from hop import cli
from hop import subscribe
import sys
def _add_parser_args(parser):
"""Parse arguments for broker, configurations and options
"""
#All args from the subscribe... | [
"hop.models.GCNCircular",
"hop.stream.open",
"argparse.ArgumentParser",
"smtplib.SMTP_SSL",
"hop.cli.load_config",
"json.dumps",
"hop.subscribe._add_parser_args",
"sys.exc_info"
] | [((326, 360), 'hop.subscribe._add_parser_args', 'subscribe._add_parser_args', (['parser'], {}), '(parser)\n', (352, 360), False, 'from hop import subscribe\n'), ((2034, 2055), 'hop.cli.load_config', 'cli.load_config', (['args'], {}), '(args)\n', (2049, 2055), False, 'from hop import cli\n'), ((772, 792), 'json.dumps', ... |
import logging
from coala_utils.string_processing import escape
from coalib.bearlib.abstractions.SectionCreatable import SectionCreatable
from coalib.bearlib.languages import Language
from coalib.settings.Setting import Setting
class LanguageDefinition(SectionCreatable):
"""
**This class is deprecated!** Us... | [
"logging.error",
"logging.debug",
"coala_utils.string_processing.escape"
] | [((2560, 2675), 'logging.debug', 'logging.debug', (['"""LanguageDefinition has been deprecated! Use `coalib.bearlib.languages.Language` instead."""'], {}), "(\n 'LanguageDefinition has been deprecated! Use `coalib.bearlib.languages.Language` instead.'\n )\n", (2573, 2675), False, 'import logging\n'), ((2727, 2851... |
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
a = tf.Variable(tf.constant([1.0, 2.0], shape=[2]), name="a")
b = tf.Variable(tf.constant([3.0, 4.0], shape=[2]), name="b")
result = a+b
init_op = tf.initialize_all_variables()
saver = tf.train.Saver()
with tf.Session() as sess:
sess.run(init_op)
s... | [
"tensorflow.compat.v1.disable_v2_behavior",
"tensorflow.compat.v1.constant",
"tensorflow.compat.v1.initialize_all_variables",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.train.Saver"
] | [((34, 58), 'tensorflow.compat.v1.disable_v2_behavior', 'tf.disable_v2_behavior', ([], {}), '()\n', (56, 58), True, 'import tensorflow.compat.v1 as tf\n'), ((209, 238), 'tensorflow.compat.v1.initialize_all_variables', 'tf.initialize_all_variables', ([], {}), '()\n', (236, 238), True, 'import tensorflow.compat.v1 as tf\... |
import pandas as pd
from .constants import *
def compare_frameworks(results_raw, frameworks=None, banned_datasets=None, folds_to_keep=None, filter_errors=True, verbose=True, columns_to_agg_extra=None, datasets=None):
columns_to_agg = [DATASET, FRAMEWORK, PROBLEM_TYPE, TIME_TRAIN_S, METRIC_ERROR]
if columns_t... | [
"pandas.Series",
"pandas.option_context",
"pandas.concat",
"pandas.DataFrame"
] | [((3864, 3909), 'pandas.Series', 'pd.Series', ([], {'data': 'errors_list', 'index': 'frameworks'}), '(data=errors_list, index=frameworks)\n', (3873, 3909), True, 'import pandas as pd\n'), ((6218, 6251), 'pandas.concat', 'pd.concat', (['dfs'], {'ignore_index': '(True)'}), '(dfs, ignore_index=True)\n', (6227, 6251), True... |
r"""undocumented
用于辅助生成 fastNLP 文档的代码
"""
__all__ = []
import inspect
import sys
def doc_process(m):
for name, obj in inspect.getmembers(m):
if inspect.isclass(obj) or inspect.isfunction(obj):
if obj.__module__ != m.__name__:
if obj.__doc__ is None:
# prin... | [
"inspect.isclass",
"inspect.isfunction",
"inspect.getmembers"
] | [((126, 147), 'inspect.getmembers', 'inspect.getmembers', (['m'], {}), '(m)\n', (144, 147), False, 'import inspect\n'), ((160, 180), 'inspect.isclass', 'inspect.isclass', (['obj'], {}), '(obj)\n', (175, 180), False, 'import inspect\n'), ((184, 207), 'inspect.isfunction', 'inspect.isfunction', (['obj'], {}), '(obj)\n', ... |
from textwrap import dedent
from django.template import Context, Template
from .django_test_setup import * # NOQA
from django_components import component
from .testutils import Django30CompatibleSimpleTestCase as SimpleTestCase
class ComponentTest(SimpleTestCase):
def test_empty_component(self):
class... | [
"django.template.Template",
"django_components.component.registry.register",
"django.template.Context",
"textwrap.dedent"
] | [((6252, 6305), 'django_components.component.registry.register', 'component.registry.register', (['"""test"""', 'SlottedComponent'], {}), "('test', SlottedComponent)\n", (6279, 6305), False, 'from django_components import component\n'), ((6388, 6883), 'django.template.Template', 'Template', (['"""\n {% load ... |
import logging
import datetime
from google_images_download import google_images_download #importing the library
from PIL import Image
import os
import random
import dill
from threading import Event
from time import time
from datetime import timedelta
import wikipedia
from telegram.ext import Updater, CommandHandler,... | [
"logging.basicConfig",
"logging.getLogger",
"datetime.datetime.now",
"wikipedia.random",
"wikipedia.summary",
"telegram.ext.DictPersistence",
"datetime.timedelta",
"telegram.ext.CommandHandler",
"telegram.ext.Updater",
"wikipedia.set_lang"
] | [((474, 581), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(name)s - %(levelname)s - %(message)s"""', 'level': 'logging.INFO'}), "(format=\n '%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)\n", (493, 581), False, 'import logging\n'), ((607, 634), 'loggin... |
import itertools
from .client import get_data
from purviewcli.model import AtlasEntity, AtlasEntityWithExtInfo, AtlasEntitiesWithExtInfo, AtlasClassification, ClassificationAssociateRequest
# ---------------------------
# ENTITY
# ---------------------------
def entityCreate(args):
endpoint = '/api/atlas/v2/entity'
... | [
"purviewcli.model.AtlasClassification",
"purviewcli.model.AtlasEntityWithExtInfo",
"purviewcli.model.AtlasEntity",
"purviewcli.model.AtlasEntitiesWithExtInfo",
"itertools.zip_longest",
"purviewcli.model.AtlasEntityWithExtInfo.from_json",
"purviewcli.model.AtlasClassification.from_json",
"purviewcli.mo... | [((342, 355), 'purviewcli.model.AtlasEntity', 'AtlasEntity', ([], {}), '()\n', (353, 355), False, 'from purviewcli.model import AtlasEntity, AtlasEntityWithExtInfo, AtlasEntitiesWithExtInfo, AtlasClassification, ClassificationAssociateRequest\n'), ((636, 660), 'purviewcli.model.AtlasEntityWithExtInfo', 'AtlasEntityWith... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.metrics import (auc, confusion_matrix, precision_recall_curve,
r2_score, roc_curve)
def best_scores(allstars_model):
keys = list(allstars_model.best_scores.keys())
values = allstars_model.best_scor... | [
"matplotlib.pyplot.grid",
"sklearn.metrics.auc",
"matplotlib.pyplot.barh",
"sklearn.metrics.precision_recall_curve",
"numpy.array",
"sklearn.metrics.roc_curve",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((384, 408), 'matplotlib.pyplot.title', 'plt.title', (['"""Best scores"""'], {}), "('Best scores')\n", (393, 408), True, 'import matplotlib.pyplot as plt\n'), ((413, 435), 'matplotlib.pyplot.barh', 'plt.barh', (['keys', 'values'], {}), '(keys, values)\n', (421, 435), True, 'import matplotlib.pyplot as plt\n'), ((440, ... |
import os as _os
data_dir = _os.path.abspath(_os.path.dirname(__file__))
def lbp_frontal_face_cascade_filename():
"""
Returns the path to the XML file containing information about the weak
classifiers of a cascade classifier trained using LBP features. It is part
of the OpenCV repository [1]_.
Re... | [
"os.path.dirname",
"os.path.join"
] | [((45, 71), 'os.path.dirname', '_os.path.dirname', (['__file__'], {}), '(__file__)\n', (61, 71), True, 'import os as _os\n'), ((480, 540), 'os.path.join', '_os.path.join', (['data_dir', '"""lbpcascade_frontalface_opencv.xml"""'], {}), "(data_dir, 'lbpcascade_frontalface_opencv.xml')\n", (493, 540), True, 'import os as ... |
"""This is the models file for our utilities."""
from maintenancemanagement.models import Equipment, FieldObject
from django.db import models
class DataProvider(models.Model):
"""Define a dataprovider."""
name = models.CharField(max_length=100, default="", blank=False, null=False)
file_name = models.Cha... | [
"django.db.models.PositiveIntegerField",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.ForeignKey"
] | [((224, 293), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'default': '""""""', 'blank': '(False)', 'null': '(False)'}), "(max_length=100, default='', blank=False, null=False)\n", (240, 293), False, 'from django.db import models\n'), ((310, 367), 'django.db.models.CharField', 'models.C... |
import pytest
import stanza
from stanza.utils.conll import CoNLL
from stanza.models.common.doc import Document
from stanza.tests import *
pytestmark = [pytest.mark.pipeline, pytest.mark.travis]
# data for testing
EN_DOCS = ["<NAME> was born in Hawaii.", "He was elected president in 2008.", "Obama attended Harvard."... | [
"pytest.fixture",
"stanza.Pipeline",
"stanza.models.common.doc.Document"
] | [((778, 808), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (792, 808), False, 'import pytest\n'), ((967, 997), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (981, 997), False, 'import pytest\n'), ((1160, 1190), 'pytest.fixture', ... |
# ===============================================================================
# Copyright 2016 ross
#
# 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/LICE... | [
"re.compile"
] | [((1047, 1078), 're.compile', 're.compile', (['"""^[A-Z0-9]{1}\\\\w*$"""'], {}), "('^[A-Z0-9]{1}\\\\w*$')\n", (1057, 1078), False, 'import re\n')] |
import base64
from flask import jsonify, request, abort
import logging
from yaml import safe_load, dump
from permissions import Permissions
logger = logging.getLogger(__name__)
class Maintenance:
def __init__(self, permissions=None, users=None, channels=None, state_file=None):
self.permissions = permi... | [
"logging.getLogger",
"yaml.dump",
"base64.b64decode",
"yaml.safe_load",
"flask.request.get_json",
"permissions.Permissions",
"flask.abort"
] | [((152, 179), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (169, 179), False, 'import logging\n'), ((2739, 2772), 'base64.b64decode', 'base64.b64decode', (["payload['blob']"], {}), "(payload['blob'])\n", (2755, 2772), False, 'import base64\n'), ((3225, 3280), 'yaml.dump', 'dump', (['sna... |
from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.Excepcion import Excepcion
#from storageManager.jsonMode import *
# Asocia la integridad referencial entre llaves foráneas y llaves primarias,
# para efectos de la fase 1 se ignora esta petición.
class AlterTableAddFK(Instruccion):
... | [
"Instrucciones.TablaSimbolos.Instruccion.Instruccion.__init__"
] | [((405, 453), 'Instrucciones.TablaSimbolos.Instruccion.Instruccion.__init__', 'Instruccion.__init__', (['self', 'None', 'linea', 'columna'], {}), '(self, None, linea, columna)\n', (425, 453), False, 'from Instrucciones.TablaSimbolos.Instruccion import Instruccion\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import socket
HOST = '127.0.0.1'
PORT = 45001
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind((HOST, PORT))
print(f'Server listening on port: {PORT}...')
s.listen()
conn, addr = s.accept()
print('Connected by', addr)
conn.send... | [
"socket.socket"
] | [((101, 150), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (114, 150), False, 'import socket\n')] |
import moai.utils.engine as mieng
import omegaconf.omegaconf
import logging
log = logging.getLogger(__name__)
__all__ = ["Latent_Visualizers"]
class LatentVisualizers(mieng.Collection, mieng.Interval):
def __init__(self,
batch_interval:int,
visualizers: omegaconf.DictConfig,
latent_visua... | [
"logging.getLogger",
"moai.utils.engine.Interval.__init__",
"moai.utils.engine.Collection.__init__"
] | [((84, 111), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (101, 111), False, 'import logging\n'), ((372, 417), 'moai.utils.engine.Interval.__init__', 'mieng.Interval.__init__', (['self', 'batch_interval'], {}), '(self, batch_interval)\n', (395, 417), True, 'import moai.utils.engine as m... |
#! /usr/bin/env python3
# -*- coding:utf-8 -*-
###############################################################
# kenwaldek MIT-license
# Title: PyQt5 lesson 1 Version: 1.0
# Date: 08-01-17 Language: python3
# Description: pyqt5 simple example of empty windo... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QApplication"
] | [((514, 536), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (526, 536), False, 'from PyQt5.QtWidgets import QApplication, QWidget\n'), ((547, 556), 'PyQt5.QtWidgets.QWidget', 'QWidget', ([], {}), '()\n', (554, 556), False, 'from PyQt5.QtWidgets import QApplication, QWidget\n')] |
from flask import Flask, render_template, request
from werkzeug.utils import secure_filename
from fitparse import FitFile
import os
import subprocess
import json
app = Flask(__name__)
app.config["UPLOAD_FOLDER"] = "temp/"
app.config["MAX_CONTENT_PATH"] = 5000000
@app.route('/')
def upload():
return render_templat... | [
"flask.render_template",
"json.loads",
"flask.Flask",
"subprocess.run",
"werkzeug.utils.secure_filename",
"os.remove"
] | [((169, 184), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (174, 184), False, 'from flask import Flask, render_template, request\n'), ((306, 335), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (321, 335), False, 'from flask import Flask, render_template, requ... |
#!/usr/bin/env python3
# MIT License
#
# GuardPlot
#
# Copyright © 2020 <NAME>
#
# 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 right... | [
"os.system",
"gslink.gslink",
"argparse.ArgumentParser"
] | [((1680, 1705), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1703, 1705), False, 'import sys, os, json, threading, datetime, statistics, time, argparse, configparser\n'), ((4262, 4270), 'gslink.gslink', 'gslink', ([], {}), '()\n', (4268, 4270), False, 'from gslink import gslink\n'), ((27493,... |
from ErnosCube.face import Face
from ErnosCube.face_enum import FaceEnum
from ErnosCube.orient_enum import OrientEnum
from ErnosCube.sticker import Sticker
from strategies import stickers, sticker_matrices
from utils import flatten, N_and_flatten
from hypothesis.strategies import builds, lists, one_of, just
def face... | [
"utils.N_and_flatten",
"hypothesis.strategies.builds",
"hypothesis.strategies.lists",
"strategies.stickers.flatmap",
"ErnosCube.sticker.Sticker",
"utils.flatten",
"hypothesis.strategies.one_of",
"hypothesis.strategies.just"
] | [((416, 466), 'hypothesis.strategies.builds', 'builds', (['face_from_sticker_matrix', 'sticker_matrices'], {}), '(face_from_sticker_matrix, sticker_matrices)\n', (422, 466), False, 'from hypothesis.strategies import builds, lists, one_of, just\n'), ((2608, 2649), 'hypothesis.strategies.one_of', 'one_of', (['faces_minus... |
from mpl_toolkits import mplot3d
from matplotlib.ticker import MaxNLocator
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
import matplotlib.colors
import matplotlib.animation as animation
import numpy as np
import pandas as pd
import sys
plt.rc('font', family='serif')
plt.rcParams['f... | [
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.FuncFormatter",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.tight_layout",
"sys.exit",
"matplotl... | [((274, 304), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {'family': '"""serif"""'}), "('font', family='serif')\n", (280, 304), True, 'import matplotlib.pyplot as plt\n'), ((730, 783), 'pandas.read_csv', 'pd.read_csv', (['f'], {'sep': '"""\\\\s+"""', 'header': 'None', 'names': 'header'}), "(f, sep='\\\\s+', head... |
import sqlite3
import socket
import sys
HOST = '127.0.0.1'
PORT = 3000
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('Socket created')
s.bind((HOST, PORT))
db_insert_query = ''
s.listen(10)
print('Socket listening ')
conn, addr = s.accept()
print( 'Connected to ' + addr[0] + ':' + str(addr[1]) )
wh... | [
"socket.socket",
"sys.exit"
] | [((77, 126), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (90, 126), False, 'import socket\n'), ((540, 551), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (548, 551), False, 'import sys\n')] |