code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import time
import sys
import numpy as np
from local_search import kmedian_local_search
import feasibility
from kmedkpm import k_median_k_partitions_LS
import psutil
from sklearn.datasets import make_blobs
import generator
import random
test = False
def lp_ls_complete(data, color_mat, rvec, k, logfile):
#########... | [
"feasibility.calculate",
"kmedkpm.k_median_k_partitions_LS",
"psutil.Process",
"sklearn.datasets.make_blobs",
"generator.get_feasible_instance",
"numpy.stack",
"local_search.kmedian_local_search",
"time.time"
] | [((865, 881), 'psutil.Process', 'psutil.Process', ([], {}), '()\n', (879, 881), False, 'import psutil\n'), ((895, 906), 'time.time', 'time.time', ([], {}), '()\n', (904, 906), False, 'import time\n'), ((922, 933), 'time.time', 'time.time', ([], {}), '()\n', (931, 933), False, 'import time\n'), ((952, 1056), 'feasibilit... |
from django.utils.translation import ugettext_lazy as _
from mayan.apps.permissions import PermissionNamespace
namespace = PermissionNamespace(label=_('Dependencies'), name='dependencies')
permission_dependencies_view = namespace.add_permission(
label=_('View dependencies'), name='dependencies_view'
)
| [
"django.utils.translation.ugettext_lazy"
] | [((155, 172), 'django.utils.translation.ugettext_lazy', '_', (['"""Dependencies"""'], {}), "('Dependencies')\n", (156, 172), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((266, 288), 'django.utils.translation.ugettext_lazy', '_', (['"""View dependencies"""'], {}), "('View dependencies')\n", (267,... |
import os
import jinja2
import logging
from lib.config import Config
class Template:
def __init__(self, env_search_term="ENV"):
self.log_name = f'{Config.logger_name}.{self.__class__.__name__}'
self.log = logging.getLogger(self.log_name)
self.path = None
self.name = None
s... | [
"logging.getLogger",
"os.path.exists",
"os.environ.items",
"os.path.dirname",
"os.path.realpath",
"os.path.basename",
"jinja2.FileSystemLoader",
"os.remove"
] | [((228, 260), 'logging.getLogger', 'logging.getLogger', (['self.log_name'], {}), '(self.log_name)\n', (245, 260), False, 'import logging\n'), ((504, 522), 'os.environ.items', 'os.environ.items', ([], {}), '()\n', (520, 522), False, 'import os\n'), ((1119, 1144), 'os.path.dirname', 'os.path.dirname', (['template'], {}),... |
from typing import Optional
from pydantic import BaseModel, root_validator, validator
from fief.crypto.encryption import decrypt
from fief.db.types import DatabaseType
from fief.errors import APIErrorCode
from fief.schemas.generics import UUIDSchema
from fief.settings import settings
def validate_all_database_setti... | [
"fief.crypto.encryption.decrypt",
"pydantic.root_validator",
"pydantic.validator"
] | [((2224, 2323), 'pydantic.validator', 'validator', (['"""database_host"""', '"""database_username"""', '"""database_password"""', '"""database_name"""'], {'pre': '(True)'}), "('database_host', 'database_username', 'database_password',\n 'database_name', pre=True)\n", (2233, 2323), False, 'from pydantic import BaseMo... |
# Generated by Django 3.2.12 on 2022-03-01 23:06
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('art', '0006_auto_20220301_1452'),
]
operations = [
migrations.AlterField(
model_name='artimage... | [
"django.db.models.ForeignKey"
] | [((369, 477), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""images"""', 'to': '"""art.project"""'}), "(on_delete=django.db.models.deletion.CASCADE, related_name\n ='images', to='art.project')\n", (386, 477), False, 'from django.db impo... |
# Generated by Django 2.2.27 on 2022-04-16 16:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fehler_auth', '0002_auto_20211002_1511'),
]
operations = [
migrations.AlterField(
model_name='invite',
name='email'... | [
"django.db.models.EmailField"
] | [((340, 373), 'django.db.models.EmailField', 'models.EmailField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (357, 373), False, 'from django.db import migrations, models\n')] |
from agents.agent import Agent
from random import randint
class Antifa(Agent):
def __init__(self):
super().__init__()
self.is_spy = False
def __str__(self):
return 'Basic Antifa'
def assign_mission(self, board):
number_to_assign = board.number_to_assign()
board.... | [
"random.randint"
] | [((821, 834), 'random.randint', 'randint', (['(0)', '(1)'], {}), '(0, 1)\n', (828, 834), False, 'from random import randint\n'), ((450, 489), 'random.randint', 'randint', (['(0)', '(board.number_of_players - 1)'], {}), '(0, board.number_of_players - 1)\n', (457, 489), False, 'from random import randint\n')] |
import numpy as np
import pandas as pd
import datetime
import json
class DateTimeTransformer(object):
def __init__(self):
self._new_columns = []
self._old_column = None
self._min_datetime = None
self._transforms = []
def fit(self, X, column):
self._old_column = column
... | [
"numpy.unique",
"pandas.to_datetime",
"numpy.min"
] | [((349, 366), 'numpy.min', 'np.min', (['X[column]'], {}), '(X[column])\n', (355, 366), True, 'import numpy as np\n'), ((3456, 3473), 'pandas.to_datetime', 'pd.to_datetime', (['d'], {}), '(d)\n', (3470, 3473), True, 'import pandas as pd\n'), ((418, 435), 'numpy.unique', 'np.unique', (['values'], {}), '(values)\n', (427,... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'd:\MITE12\ksapriori\gui\sales_transaction.ui'
#
# Created by: PyQt5 UI code generator 5.12.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_FormSalesTransaction(ob... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QTableWidget",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtWidgets.QDateEdit",
"PyQt5.QtGui.QFont",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtCore.QRect",
"PyQt5.QtWidgets.QGroupBox",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QVBoxLayout",
"Py... | [((513, 554), 'PyQt5.QtWidgets.QGroupBox', 'QtWidgets.QGroupBox', (['FormSalesTransaction'], {}), '(FormSalesTransaction)\n', (532, 554), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((638, 651), 'PyQt5.QtGui.QFont', 'QtGui.QFont', ([], {}), '()\n', (649, 651), False, 'from PyQt5 import QtCore, QtGui, QtWidg... |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='{{ cookiecutter.app_name }}',
version='0.0.1',
description='{{ cookiecutter.description }}',
author='{{ cookiecutter.author }}',
author_email='{{ cookiecutter.author_email }}',
license='{{ cookiecutter.license }}',
... | [
"setuptools.find_packages"
] | [((333, 384), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['docs', 'tests', 'android']"}), "(exclude=['docs', 'tests', 'android'])\n", (346, 384), False, 'from setuptools import setup, find_packages\n')] |
from flask import Flask, request, render_template, send_file, Response
import io
import base64
import csv
import json
import time
from collections import OrderedDict
import numpy
import pandas as pd
from numpy import genfromtxt
from flask import jsonify
from flask_cors import CORS
from LoadingNetwork import... | [
"flask.render_template",
"flask_cors.CORS",
"flask.Flask",
"json.dumps",
"tornado.ioloop.IOLoop.instance",
"gc.collect",
"time.time",
"pandas.DataFrame",
"tornado.wsgi.WSGIContainer",
"numpy.genfromtxt"
] | [((547, 565), 'flask.Flask', 'Flask', (['"""flasknado"""'], {}), "('flasknado')\n", (552, 565), False, 'from flask import Flask, request, render_template, send_file, Response\n'), ((609, 618), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (613, 618), False, 'from flask_cors import CORS\n'), ((936, 984), 'numpy.g... |
import svgwrite
def cross(dwg, x, y, r = 5):
dwg.add(dwg.line((x - r, y), (x + r, y), stroke='red', stroke_width=.1))
dwg.add(dwg.line((x, y - r), (x, y + r), stroke='red', stroke_width=.1))
if __name__ == '__main__':
dwg = svgwrite.Drawing('test.svg', size=('150mm', '150mm'), viewBox=('0 0 150 150'))
... | [
"svgwrite.Drawing"
] | [((238, 314), 'svgwrite.Drawing', 'svgwrite.Drawing', (['"""test.svg"""'], {'size': "('150mm', '150mm')", 'viewBox': '"""0 0 150 150"""'}), "('test.svg', size=('150mm', '150mm'), viewBox='0 0 150 150')\n", (254, 314), False, 'import svgwrite\n')] |
from poketype import PokemonTypeIdentifier
from flask import Flask, request, make_response,jsonify
import os
id = PokemonTypeIdentifier()
app = Flask(__name__,static_url_path='/static')
@app.route('/findtype',methods=['GET'])
def classify():
poke_name=request.args.get('pokename')
results = id.predict_type(poke... | [
"flask.request.args.get",
"poketype.PokemonTypeIdentifier",
"flask.Flask",
"os.environ.get",
"flask.jsonify"
] | [((114, 137), 'poketype.PokemonTypeIdentifier', 'PokemonTypeIdentifier', ([], {}), '()\n', (135, 137), False, 'from poketype import PokemonTypeIdentifier\n'), ((144, 186), 'flask.Flask', 'Flask', (['__name__'], {'static_url_path': '"""/static"""'}), "(__name__, static_url_path='/static')\n", (149, 186), False, 'from fl... |
from django.shortcuts import render
from leads.models import Lead
from leads.serializers import LeadSerializer
from rest_framework import generics
# Create your views here.
class LeadListCreate(generics.ListCreateAPIView):
queryset = Lead.objects.all()
serializer_class = LeadSerializer
| [
"leads.models.Lead.objects.all"
] | [((239, 257), 'leads.models.Lead.objects.all', 'Lead.objects.all', ([], {}), '()\n', (255, 257), False, 'from leads.models import Lead\n')] |
#
# This file is part of LUNA.
#
import shutil
import tempfile
import argparse
from nmigen import Elaboratable
from .gateware.platform import get_appropriate_platform
def top_level_cli(fragment, *pos_args, **kwargs):
""" Runs a default CLI that assists in building and running gateware.
If the user's opt... | [
"tempfile.mkdtemp",
"shutil.rmtree"
] | [((2305, 2323), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (2321, 2323), False, 'import tempfile\n'), ((3117, 3141), 'shutil.rmtree', 'shutil.rmtree', (['build_dir'], {}), '(build_dir)\n', (3130, 3141), False, 'import shutil\n')] |
"""
Setup module.
"""
from setuptools import setup
from mmsim import __version__
setup(
name='mmsim',
version=__version__,
description='A simple Micromouse Maze Simulator server',
long_description="""The server can load different mazes and any client
can connect to it to ask for the current po... | [
"setuptools.setup"
] | [((83, 1230), 'setuptools.setup', 'setup', ([], {'name': '"""mmsim"""', 'version': '__version__', 'description': '"""A simple Micromouse Maze Simulator server"""', 'long_description': '"""The server can load different mazes and any client\n can connect to it to ask for the current position walls, move from\n ... |
import argparse
import json
import sys
import os
try:
from utility_functions import load_csv_files_into_db, generate_vocabulary_load
except(ImportError):
sys.path.insert(0, os.path.abspath(os.path.join(os.path.split(__file__)[0], os.path.pardir, os.path.pardir, "src")))
from utility_functions import load_... | [
"argparse.ArgumentParser",
"os.path.split",
"utility_functions.generate_vocabulary_load",
"json.load",
"utility_functions.load_csv_files_into_db"
] | [((464, 519), 'utility_functions.generate_vocabulary_load', 'generate_vocabulary_load', (['vocab_directory', 'vocabularies'], {}), '(vocab_directory, vocabularies)\n', (488, 519), False, 'from utility_functions import load_csv_files_into_db, generate_vocabulary_load\n'), ((622, 790), 'utility_functions.load_csv_files_i... |
#!/usr/bin/env python
# convert jpg tp png
from glob import glob
import cv2
pngs = glob('./*.jpg')
for j in pngs:
img = cv2.imread(j)
cv2.imwrite(j[:-3] + 'png', img)
# delete jpg files
import glob
import os
dir = "/Users/wangmeijie/ALLImportantProjects/FlameDetectionAPP/Models/MaskRCNN/02_26_2020/Mask_RCNN... | [
"cv2.imwrite",
"os.path.join",
"glob",
"cv2.imread",
"os.remove"
] | [((83, 98), 'glob', 'glob', (['"""./*.jpg"""'], {}), "('./*.jpg')\n", (87, 98), False, 'import glob\n'), ((125, 138), 'cv2.imread', 'cv2.imread', (['j'], {}), '(j)\n', (135, 138), False, 'import cv2\n'), ((143, 175), 'cv2.imwrite', 'cv2.imwrite', (["(j[:-3] + 'png')", 'img'], {}), "(j[:-3] + 'png', img)\n", (154, 175),... |
import xml.sax
import re
import os
import json
import time
current_milli_time = lambda: int(round(time.time() * 1000))
RE_LINKS = re.compile(r'\[{2}(.*?)\]{2}', re.DOTALL | re.UNICODE)
IGNORED_NAMESPACES = [
'wikipedia', 'category', 'file', 'portal', 'template',
'mediaWiki', 'user', 'help', 'book', 'draft', ... | [
"re.compile",
"os.mkdir",
"time.time",
"json.dump",
"re.search"
] | [((132, 187), 're.compile', 're.compile', (['"""\\\\[{2}(.*?)\\\\]{2}"""', '(re.DOTALL | re.UNICODE)'], {}), "('\\\\[{2}(.*?)\\\\]{2}', re.DOTALL | re.UNICODE)\n", (142, 187), False, 'import re\n'), ((3973, 3999), 'os.mkdir', 'os.mkdir', (['outputpath', 'mode'], {}), '(outputpath, mode)\n', (3981, 3999), False, 'import... |
import io
import avro.io
try:
from avro.schema import parse
except ImportError:
from avro.schema import Parse as parse
class ApacheAvroAdapter(object):
NAME = 'avro'
def __init__(self):
with open('specs/str.avsc', 'r') as f:
schema = parse(f.read())
self.str_reader = a... | [
"io.BytesIO"
] | [((2775, 2787), 'io.BytesIO', 'io.BytesIO', ([], {}), '()\n', (2785, 2787), False, 'import io\n'), ((2986, 3002), 'io.BytesIO', 'io.BytesIO', (['data'], {}), '(data)\n', (2996, 3002), False, 'import io\n'), ((3129, 3141), 'io.BytesIO', 'io.BytesIO', ([], {}), '()\n', (3139, 3141), False, 'import io\n'), ((3339, 3355), ... |
from django import forms
from warehouse.models import Product, ProductAdditionalInformation
class ProductForm(forms.ModelForm):
class Meta:
model = Product
fields = '__all__'
field_order = [
'product_name',
'product_code',
'product_quantity',
... | [
"django.forms.CharField"
] | [((397, 427), 'django.forms.CharField', 'forms.CharField', ([], {'disabled': '(True)'}), '(disabled=True)\n', (412, 427), False, 'from django import forms\n')] |
from datetime import datetime, timedelta
from enum import Enum, auto
from dateutil.relativedelta import relativedelta
from .baseclasses import Constant, MethodEnum
from .formulars import days_feb, eastern_calc, thanksgiving_calc, year_start
class ConstantOption(Enum):
TIME_VARIABLE = auto()
DATE_VARIABLE = ... | [
"datetime.datetime",
"enum.auto",
"dateutil.relativedelta.relativedelta",
"datetime.datetime.now",
"datetime.datetime.today"
] | [((293, 299), 'enum.auto', 'auto', ([], {}), '()\n', (297, 299), False, 'from enum import Enum, auto\n'), ((320, 326), 'enum.auto', 'auto', ([], {}), '()\n', (324, 326), False, 'from enum import Enum, auto\n'), ((347, 353), 'enum.auto', 'auto', ([], {}), '()\n', (351, 353), False, 'from enum import Enum, auto\n'), ((51... |
# Copyright (C) 2021 <NAME>
#
# SPDX-License-Identifier: MIT
from typing import Callable, Tuple, Union
import dolfinx.common as _common
import dolfinx.fem as _fem
import dolfinx.log as _log
import dolfinx.mesh as _mesh
import dolfinx_cuas
import numpy as np
import ufl
from dolfinx.cpp.graph import AdjacencyList_in... | [
"dolfinx.common.timing",
"ufl.Measure",
"numpy.hstack",
"ufl.FacetNormal",
"numpy.array",
"dolfinx.fem.petsc.set_bc",
"dolfinx_contact.NewtonSolver",
"dolfinx.fem.petsc.apply_lifting",
"dolfinx.fem.petsc.assemble_matrix",
"dolfinx_contact.cpp.Contact",
"dolfinx.fem.Expression",
"dolfinx.fem.lo... | [((5390, 5419), 'dolfinx_contact.helpers.lame_parameters', 'lame_parameters', (['plane_strain'], {}), '(plane_strain)\n', (5405, 5419), False, 'from dolfinx_contact.helpers import epsilon, lame_parameters, rigid_motions_nullspace, sigma_func\n'), ((5487, 5508), 'dolfinx_contact.helpers.sigma_func', 'sigma_func', (['mu'... |
"""Change unique constraint on collection
Revision ID: 8e3f80979dc9
Revises: 3d5fae27a215
Create Date: 2019-12-18 13:14:56.466907
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '3d5fae27a215'
branch_labels = None
depends_on = None
def ... | [
"sqlalchemy.text",
"alembic.op.drop_constraint",
"alembic.op.alter_column",
"alembic.op.execute",
"alembic.op.drop_index",
"alembic.op.create_unique_constraint"
] | [((560, 625), 'alembic.op.drop_constraint', 'op.drop_constraint', (['"""unique_collection_identifiers"""', '"""collection"""'], {}), "('unique_collection_identifiers', 'collection')\n", (578, 625), False, 'from alembic import op\n'), ((821, 910), 'alembic.op.execute', 'op.execute', (['"""UPDATE collection SET transform... |
'''Barst Measurement Computing DAQ Wrapper
==========================================
'''
from functools import partial
from pybarst.mcdaq import MCDAQChannel
from kivy.properties import NumericProperty, ObjectProperty
from moa.threads import ScheduledEventLoop
from moa.device.digital import ButtonViewPort
from cplco... | [
"functools.partial",
"kivy.properties.NumericProperty",
"kivy.properties.ObjectProperty",
"pybarst.mcdaq.MCDAQChannel"
] | [((4762, 4782), 'kivy.properties.ObjectProperty', 'ObjectProperty', (['None'], {}), '(None)\n', (4776, 4782), False, 'from kivy.properties import NumericProperty, ObjectProperty\n'), ((4921, 4957), 'kivy.properties.ObjectProperty', 'ObjectProperty', (['None'], {'allownone': '(True)'}), '(None, allownone=True)\n', (4935... |
from multiprocessing import Pool, Manager
from time import sleep
from wmi import WMI
from win32com.client import GetObject
from subprocess import Popen
from collections import Iterable
from tqdm import tqdm
from os import getpid
from sapy_script.Session import Session
session_process = None
all_processes_id = []
de... | [
"subprocess.Popen",
"wmi.WMI",
"time.sleep",
"sapy_script.Session.Session",
"os.getpid",
"multiprocessing.Manager",
"win32com.client.GetObject"
] | [((361, 369), 'os.getpid', 'getpid', ([], {}), '()\n', (367, 369), False, 'from os import getpid\n'), ((1020, 1025), 'wmi.WMI', 'WMI', ([], {}), '()\n', (1023, 1025), False, 'from wmi import WMI\n'), ((618, 634), 'sapy_script.Session.Session', 'Session', (['session'], {}), '(session)\n', (625, 634), False, 'from sapy_s... |
import json
import os
import os.path as path
import re
from flask import Blueprint, request
blueprint = Blueprint("editor", __name__)
robotsrc_path = path.join(os.getcwd(), "robotsrc")
if not path.exists(robotsrc_path):
os.mkdir(robotsrc_path)
main_path = path.join(robotsrc_path, 'main.py')
main_file = open(main... | [
"os.path.exists",
"os.listdir",
"flask.request.data.decode",
"os.path.join",
"os.getcwd",
"os.mkdir",
"json.load",
"re.findall",
"flask.Blueprint"
] | [((106, 135), 'flask.Blueprint', 'Blueprint', (['"""editor"""', '__name__'], {}), "('editor', __name__)\n", (115, 135), False, 'from flask import Blueprint, request\n'), ((263, 298), 'os.path.join', 'path.join', (['robotsrc_path', '"""main.py"""'], {}), "(robotsrc_path, 'main.py')\n", (272, 298), True, 'import os.path ... |
"""
Tests for dit.divergences.jensen_shannon_divergence.
"""
from nose.tools import assert_almost_equal, assert_raises
from dit import Distribution
from dit.exceptions import ditException
from dit.divergences.jensen_shannon_divergence import (
jensen_shannon_divergence as JSD,
jensen_shannon_divergence_pmf as... | [
"dit.divergences.jensen_shannon_divergence.jensen_shannon_divergence_pmf",
"nose.tools.assert_almost_equal",
"dit.divergences.jensen_shannon_divergence.jensen_shannon_divergence",
"nose.tools.assert_raises",
"dit.Distribution"
] | [((431, 461), 'dit.Distribution', 'Distribution', (['"""AB"""', '[0.5, 0.5]'], {}), "('AB', [0.5, 0.5])\n", (443, 461), False, 'from dit import Distribution\n'), ((466, 506), 'nose.tools.assert_raises', 'assert_raises', (['ditException', 'JSD', 'd1', 'd1'], {}), '(ditException, JSD, d1, d1)\n', (479, 506), False, 'from... |
'''
Descripttion:
Version: 1.0
Author: ZhangHongYu
Date: 2022-02-05 18:23:00
LastEditors: ZhangHongYu
LastEditTime: 2022-05-17 16:26:12
'''
import os
import sys
import json
import argparse
from transformers import AlbertTokenizer
from pytorch_pretrained_bert import BertTokenizer, BertForMaskedLM
file_path = sys.argv[1... | [
"json.load",
"os.listdir",
"os.path.join",
"transformers.AlbertTokenizer.from_pretrained"
] | [((517, 569), 'transformers.AlbertTokenizer.from_pretrained', 'AlbertTokenizer.from_pretrained', (['"""albert-xxlarge-v2"""'], {}), "('albert-xxlarge-v2')\n", (548, 569), False, 'from transformers import AlbertTokenizer\n'), ((601, 622), 'os.listdir', 'os.listdir', (['file_path'], {}), '(file_path)\n', (611, 622), Fals... |
import re
from mimetypes import guess_type
from django.conf import settings
from datagrowth.processors import ExtractProcessor
from datagrowth.utils import reach
from core.constants import HIGHER_EDUCATION_LEVELS, RESTRICTED_MATERIAL_SETS
class SharekitMetadataExtraction(ExtractProcessor):
youtube_regex = re.... | [
"core.constants.HIGHER_EDUCATION_LEVELS.items",
"datagrowth.utils.reach",
"re.compile",
"mimetypes.guess_type",
"django.conf.settings.MIME_TYPE_TO_TECHNICAL_TYPE.get"
] | [((317, 376), 're.compile', 're.compile', (['""".*(youtube\\\\.com|youtu\\\\.be).*"""', 're.IGNORECASE'], {}), "('.*(youtube\\\\.com|youtu\\\\.be).*', re.IGNORECASE)\n", (327, 376), False, 'import re\n'), ((1894, 1963), 'django.conf.settings.MIME_TYPE_TO_TECHNICAL_TYPE.get', 'settings.MIME_TYPE_TO_TECHNICAL_TYPE.get', ... |
#
# Copyright 2019-Present Sonatype 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 ... | [
"pathlib.Path"
] | [((1159, 1173), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (1163, 1173), False, 'from pathlib import Path\n')] |
import torch
import random
from torch.utils.data import Dataset, DataLoader
from abc import ABC
from models.base_model import Model
from torch.utils.tensorboard import SummaryWriter
from typing import List
class BaseDataset(Dataset, ABC):
name = 'base'
def __init__(self, config: dict, mode: str = 'train'):
self.... | [
"torch.tensor",
"torch.linspace",
"torch.utils.data.DataLoader"
] | [((1192, 1341), 'torch.utils.data.DataLoader', 'DataLoader', (['self'], {'batch_size': "self.config['eval_batch_size']", 'num_workers': "self.config['num_workers']", 'collate_fn': 'self.collate_fn', 'drop_last': '(False)'}), "(self, batch_size=self.config['eval_batch_size'], num_workers=\n self.config['num_workers']... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 23 08:25:37 2019
@author: AdeolaOlalekan
"""
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from .models import BTUTOR, CNAME, Edit_User, QSUBJECT, Post
class login_form(forms.Fo... | [
"django.forms.EmailField",
"django.forms.CharField"
] | [((340, 370), 'django.forms.CharField', 'forms.CharField', ([], {'max_length': '(18)'}), '(max_length=18)\n', (355, 370), False, 'from django import forms\n'), ((420, 463), 'django.forms.CharField', 'forms.CharField', ([], {'widget': 'forms.PasswordInput'}), '(widget=forms.PasswordInput)\n', (435, 463), False, 'from dj... |
# -*- coding: utf-8 -*-
__all__ = (
"extract_directory",
"cleanup_data_directory",
"dataset_schema",
"validate_directory",
"validate_directory_against_xsd",
)
from .extract_ecospold2 import extract_ecospold2_directory
from ..filesystem import check_cache_directory, get_from_cache, cache_data
import... | [
"os.path.abspath"
] | [((574, 600), 'os.path.abspath', 'os.path.abspath', (['data_path'], {}), '(data_path)\n', (589, 600), False, 'import os\n')] |
#!/usr/bin/env python3
import stack
import queue
opset = {'*','+','(',")"}
def readinfix():
fh = open("infix.txt")
li = []
li += fh.read()
print (li)
return li
def eval():
evlist = readinfix()
postlist = []
st = stack.Stack()
for op in evlist:
if op in opset:
s... | [
"stack.Stack"
] | [((247, 260), 'stack.Stack', 'stack.Stack', ([], {}), '()\n', (258, 260), False, 'import stack\n')] |
import random
from qlazy import QState
def classical_strategy(trials=1000):
win_cnt = 0
for _ in range(trials):
# random bits by Charlie (x,y)
x = random.randint(0,1)
y = random.randint(0,1)
# response by Alice (a)
a = 0
# response by Bob (b)
b = 0
... | [
"qlazy.QState",
"random.randint"
] | [((174, 194), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0, 1)\n', (188, 194), False, 'import random\n'), ((206, 226), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0, 1)\n', (220, 226), False, 'import random\n'), ((659, 679), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0,... |
from decimal import Decimal
def ensure_decimal(value):
return value if isinstance(value, Decimal) else Decimal(value)
| [
"decimal.Decimal"
] | [((109, 123), 'decimal.Decimal', 'Decimal', (['value'], {}), '(value)\n', (116, 123), False, 'from decimal import Decimal\n')] |
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import backend as K
from keras.models import Sequential,Model
from keras.layers import *
from keras.optimizers import SGD,Adam
class OurLayer(Layer):
def reuse(self, layer, *args, **kwargs):
if not layer.built:
if len(a... | [
"tensorflow.keras.backend.int_shape",
"keras.models.Model"
] | [((2700, 2742), 'keras.models.Model', 'Model', ([], {'inputs': 'model_input', 'outputs': 'outputs'}), '(inputs=model_input, outputs=outputs)\n', (2705, 2742), False, 'from keras.models import Sequential, Model\n'), ((575, 594), 'tensorflow.keras.backend.int_shape', 'K.int_shape', (['inputs'], {}), '(inputs)\n', (586, 5... |
from subprocess import PIPE, Popen
# Converts celsius temps to fahrenheit
def c2f(celsius):
return (9.0 / 5) * celsius + 32
# Gets the CPU temperature in degrees C
def get_cpu_temperature():
process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE)
output, _error = process.communicate()
return floa... | [
"subprocess.Popen"
] | [((213, 261), 'subprocess.Popen', 'Popen', (["['vcgencmd', 'measure_temp']"], {'stdout': 'PIPE'}), "(['vcgencmd', 'measure_temp'], stdout=PIPE)\n", (218, 261), False, 'from subprocess import PIPE, Popen\n')] |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | [
"common.forms.TypeCheckField",
"json.dumps",
"django.forms.CharField"
] | [((2535, 2586), 'django.forms.CharField', 'forms.CharField', ([], {'label': '"""Business ID"""', 'required': '(True)'}), "(label='Business ID', required=True)\n", (2550, 2586), False, 'from django import forms\n'), ((2605, 2679), 'common.forms.TypeCheckField', 'TypeCheckField', ([], {'label': '"""Host IP address"""', '... |
import json
import logging
from json import JSONDecodeError
from django.http import (
HttpResponse, HttpResponseBadRequest, HttpResponseForbidden,
)
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from pretix.base.models import Organizer
from . import tas... | [
"logging.getLogger",
"django.http.HttpResponseBadRequest",
"django.http.HttpResponse",
"django.http.HttpResponseForbidden",
"pretix.base.models.Organizer.objects.filter"
] | [((333, 360), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (350, 360), False, 'import logging\n'), ((1339, 1353), 'django.http.HttpResponse', 'HttpResponse', ([], {}), '()\n', (1351, 1353), False, 'from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden\n'), ... |
import sys
from setuptools import setup, find_packages
setup(
name='pynomial',
version='0.0.0',
packages=find_packages(),
author='<NAME>',
author_email='<EMAIL>',
description="python package for combinatorial problems",
url="https://github.com/PaulDodd/pynomial.git",
install_requires=[]... | [
"setuptools.find_packages"
] | [((118, 133), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (131, 133), False, 'from setuptools import setup, find_packages\n')] |
"""``AppendableExcelDataSet`` loads/saves data from/to a local Excel file opened in append mode.
It uses pandas to handle the Excel file.
"""
from copy import deepcopy
from pathlib import Path, PurePosixPath
from typing import Any, Dict
import pandas as pd
from kedro.io.core import AbstractDataSet, DataSetError
cla... | [
"pathlib.PurePosixPath",
"kedro.io.core.DataSetError",
"copy.deepcopy"
] | [((3932, 3955), 'pathlib.PurePosixPath', 'PurePosixPath', (['filepath'], {}), '(filepath)\n', (3945, 3955), False, 'from pathlib import Path, PurePosixPath\n'), ((4032, 4064), 'copy.deepcopy', 'deepcopy', (['self.DEFAULT_LOAD_ARGS'], {}), '(self.DEFAULT_LOAD_ARGS)\n', (4040, 4064), False, 'from copy import deepcopy\n')... |
from .makeFullPdf import makeFullPdf
from .parseImage import parseImage
from .makePdf import makePdf
import requests,os,os.path,sys,time,json
from bs4 import BeautifulSoup
def readComicsOnlineRu():
while True:
try:
with open('config.json', 'r', encoding="utf-8") as f:
books = json.load(f)
library=[*books[... | [
"os.path.exists",
"os.makedirs",
"requests.get",
"os.getcwd",
"os.chdir",
"bs4.BeautifulSoup",
"time.sleep",
"json.load",
"json.dump"
] | [((733, 744), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (742, 744), False, 'import requests, os, os.path, sys, time, json\n'), ((746, 760), 'os.chdir', 'os.chdir', (['""".."""'], {}), "('..')\n", (754, 760), False, 'import requests, os, os.path, sys, time, json\n'), ((850, 885), 'os.chdir', 'os.chdir', (["('comicDown... |
import sys
import pickle
from krips_alpha import krippendorff_alpha, nominal_metric
def get_model_labels(model_output):
model_labels = []
for x in model_output:
try:
if x['pos_score'] > x['neg_score']:
model_labels.append('0')
elif x['neg_score'] > x['pos_score']:
model_labels.append('1')
else:
... | [
"krips_alpha.krippendorff_alpha"
] | [((615, 662), 'krips_alpha.krippendorff_alpha', 'krippendorff_alpha', (['annotations', 'nominal_metric'], {}), '(annotations, nominal_metric)\n', (633, 662), False, 'from krips_alpha import krippendorff_alpha, nominal_metric\n'), ((873, 920), 'krips_alpha.krippendorff_alpha', 'krippendorff_alpha', (['annotations', 'nom... |
#!/usr/bin/env python
import argparse
import os
import platform
import re
import shutil
import subprocess
import sys
SUPPORTED_VERSIONS = ('3.6', '3.7')
IS_DEBIAN = platform.system() == 'Linux' and os.path.exists('/etc/debian_version')
IS_OLD_UBUNTU = (IS_DEBIAN and os.path.exists('/etc/lsb-release')
... | [
"os.path.exists",
"argparse.ArgumentParser",
"os.getuid",
"shutil.rmtree",
"platform.system",
"sys.stdout.isatty",
"os.getpid",
"sys.exit"
] | [((475, 547), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Check and fix Python installation"""'}), "(description='Check and fix Python installation')\n", (498, 547), False, 'import argparse\n'), ((200, 237), 'os.path.exists', 'os.path.exists', (['"""/etc/debian_version"""'], {}), "('/... |
import numpy as np
from sklearn.metrics import average_precision_score as ap
from sklearn.metrics import roc_auc_score
"""
each row is an instance
each column is the prediction of a class
"""
def _score_to_rank(score_list):
rank_array = np.zeros([len(score_list)])
score_array = np.array(score_list)
idx_so... | [
"numpy.mean",
"sklearn.metrics.average_precision_score",
"sklearn.metrics.roc_auc_score",
"numpy.array",
"numpy.nonzero"
] | [((289, 309), 'numpy.array', 'np.array', (['score_list'], {}), '(score_list)\n', (297, 309), True, 'import numpy as np\n'), ((780, 798), 'numpy.array', 'np.array', (['Y_target'], {}), '(Y_target)\n', (788, 798), True, 'import numpy as np\n'), ((813, 830), 'numpy.array', 'np.array', (['Y_score'], {}), '(Y_score)\n', (82... |
"""
:filename transformations.py
:author <NAME>
:email <EMAIL>
from
Classes of custom transformations that are applied during the training as additional augmentation of the depth maps.
"""
import torch
import random
import numpy as np
import torch.nn.functional as F
from random import randrange
from s... | [
"torch.nn.functional.grid_sample",
"random.uniform",
"random.choice",
"numpy.random.rand",
"random.randrange",
"skimage.transform.AffineTransform",
"numpy.asarray",
"skimage.transform.warp",
"torch.sin",
"torch.tensor",
"torch.cos",
"skimage.transform.resize",
"torch.cat"
] | [((1466, 1487), 'numpy.asarray', 'np.asarray', (['landmarks'], {}), '(landmarks)\n', (1476, 1487), True, 'import numpy as np\n'), ((4681, 4699), 'random.randrange', 'randrange', (['(-32)', '(-6)'], {}), '(-32, -6)\n', (4690, 4699), False, 'from random import randrange\n'), ((4719, 4735), 'random.randrange', 'randrange'... |
import random
import shutil
import sys
from argparse import ArgumentParser
from os import path
from pathlib import Path
from threading import Thread
from PySide6 import __version__ as PySideVer
from PySide6.QtCore import (Property, QCoreApplication, QObject, Qt, QTimer,
Signal, Slot)
from P... | [
"PySide6.QtCore.Slot",
"downloader.Downloader",
"PySide6.QtCore.Property",
"sys.exit",
"argparse.ArgumentParser",
"pathlib.Path",
"PySide6.QtGui.QGuiApplication.setAttribute",
"PySide6.QtCore.QTimer",
"os.path.isdir",
"PySide6.QtCore.Signal",
"random.choice",
"os.path.dirname",
"PySide6.QtGu... | [((730, 742), 'PySide6.QtCore.Signal', 'Signal', (['bool'], {}), '(bool)\n', (736, 742), False, 'from PySide6.QtCore import Property, QCoreApplication, QObject, Qt, QTimer, Signal, Slot\n'), ((916, 958), 'PySide6.QtCore.Property', 'Property', (['bool'], {'notify': 'is_download_changed'}), '(bool, notify=is_download_cha... |
import astropy.units as u
import numpy as np
from lofti_gaia.loftitools import *
from lofti_gaia.cFunctions import calcOFTI_C
#from loftitools import *
import pickle
import time
import matplotlib.pyplot as plt
# Astroquery throws some warnings we can ignore:
import warnings
warnings.filterwarnings("ignore")
'''This mo... | [
"numpy.radians",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.hist",
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"numpy.array",
"numpy.arctan2",
"numpy.nanmin",
"numpy.sin",
"numpy.arange",
"numpy.mean",
"numpy.where",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.max",
"n... | [((275, 308), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (298, 308), False, 'import warnings\n'), ((14422, 14529), 'numpy.average', 'np.average', (['[self.plx1[0].value, self.plx2[0].value]'], {'weights': '[self.plx1[1].value, self.plx2[1].value]'}), '([self.plx1[0].va... |
from src.data_curation.dataset_manager import get_meta
import pandas as pd
def view_all():
return get_meta()
def get_docs(id):
df = get_meta()
docs = df[df["id"] == id]["docs"].iloc[0]
df = pd.read_json(docs)
return df
| [
"src.data_curation.dataset_manager.get_meta",
"pandas.read_json"
] | [((104, 114), 'src.data_curation.dataset_manager.get_meta', 'get_meta', ([], {}), '()\n', (112, 114), False, 'from src.data_curation.dataset_manager import get_meta\n'), ((144, 154), 'src.data_curation.dataset_manager.get_meta', 'get_meta', ([], {}), '()\n', (152, 154), False, 'from src.data_curation.dataset_manager im... |
# -*- coding: utf-8 -*-
"""
查看 django.db.backends.mysql.base.by 源码发现 django 连接 mysql 时没有使用连接池,
导致每次数据库操作都要新建新的连接并查询完后关闭,更坑的是按照 django 的官方文档设置
CONN_MAX_AGE 参数是为了复用连接,然后设置了 CONN_MAX_AGE 后,每个新连接查询完后并不
会 close 掉,而是一直在那占着。如果在高并发模式下,很容易出现 too many connections
错误。故重写 mysql 连接库,实现连接池功能。
"""
from django.core.exceptions import I... | [
"threading.Lock",
"queue.Queue",
"django.core.exceptions.ImproperlyConfigured",
"MySQLdb.connect"
] | [((891, 907), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (905, 907), False, 'import threading\n'), ((444, 535), 'django.core.exceptions.ImproperlyConfigured', 'ImproperlyConfigured', (['"""Error loading MySQLdb module.\nDid you install mysqlclient?"""'], {}), '(\n """Error loading MySQLdb module.\nDid you... |
from toee import *
import char_class_utils
###################################################
def GetConditionName():
return "Archmage"
def GetSpellCasterConditionName():
return "Archmage Spellcasting"
def GetCategory():
return "Core 3.5 Ed Prestige Classes"
def GetClassDefinitionFlags():
return CDF_CoreClass... | [
"char_class_utils.IsClassSkill",
"char_class_utils.IsClassFeat"
] | [((1043, 1097), 'char_class_utils.IsClassSkill', 'char_class_utils.IsClassSkill', (['class_skills', 'skillEnum'], {}), '(class_skills, skillEnum)\n', (1072, 1097), False, 'import char_class_utils\n'), ((1134, 1185), 'char_class_utils.IsClassFeat', 'char_class_utils.IsClassFeat', (['class_feats', 'featEnum'], {}), '(cla... |
from django.contrib import admin
from parents.models import Guardian
admin.site.register(Guardian)
| [
"django.contrib.admin.site.register"
] | [((71, 100), 'django.contrib.admin.site.register', 'admin.site.register', (['Guardian'], {}), '(Guardian)\n', (90, 100), False, 'from django.contrib import admin\n')] |
import falcon.testing
import pytest
import json
from displacy_service.server import APP, MODELS
model = MODELS[0]
@pytest.fixture()
def api():
return falcon.testing.TestClient(APP)
def test_deps(api):
result = api.simulate_post(
path='/dep',
body='{{"text": "This is a test.", "model": "{m... | [
"pytest.fixture",
"pytest.mark.parametrize",
"json.loads"
] | [((120, 136), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (134, 136), False, 'import pytest\n'), ((3917, 4172), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""endpoint, expected_message"""', "[('/dep', 'Dependency parsing failed'), ('/ent', 'Text parsing failed'), (\n '/sents', 'Sentence token... |
#!/usr/bin/env python
import random
import argparse
def generate_passwords(password_file_path):
password_file = open(password_file_path, 'w')
chars = 'abcdefghijklmnopqrstuvxyz01234567890_-!*'
secret_key = ''.join(random.SystemRandom().choice(chars) for _ in range(50))
password_file.write("SECRET_KEY ... | [
"random.SystemRandom",
"argparse.ArgumentParser"
] | [((412, 437), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (435, 437), False, 'import argparse\n'), ((228, 249), 'random.SystemRandom', 'random.SystemRandom', ([], {}), '()\n', (247, 249), False, 'import random\n')] |
# Generated by Django 3.2.5 on 2022-02-18 08:20
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("dataset", "0001_initial"),
("cueSearch", "0004_auto_20220217_0217"),
]
operations = [
migrations.Ad... | [
"django.db.models.ForeignKey"
] | [((426, 546), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.SET_NULL', 'to': '"""dataset.connectiontype"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.SET_NULL, to='dataset.connectiontype')\n", (443, 546)... |
from __future__ import annotations
from django.template.loader import render_to_string
from .conf import settings
def django_sys_indicator_tag() -> str:
template_name = 'django_sys_indicator/system_indicator.html'
try:
color, border_color = settings.SYSTEM_INDICATOR_COLORS[
settings.SYS... | [
"django.template.loader.render_to_string"
] | [((484, 609), 'django.template.loader.render_to_string', 'render_to_string', (['template_name', "{'label': settings.SYSTEM_INDICATOR_LABEL, 'color': color, 'border_color':\n border_color}"], {}), "(template_name, {'label': settings.SYSTEM_INDICATOR_LABEL,\n 'color': color, 'border_color': border_color})\n", (500,... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
import os
# In[2]:
#function to get current directory
def getCurrentDirectory():
listDirectory = os.listdir('../')
return listDirectory
# In[3]:
#function to read csv file
def readCsvFile(path):
crimes_original =... | [
"os.listdir",
"pandas.read_csv"
] | [((193, 210), 'os.listdir', 'os.listdir', (['"""../"""'], {}), "('../')\n", (203, 210), False, 'import os\n'), ((321, 356), 'pandas.read_csv', 'pd.read_csv', (['path'], {'low_memory': '(False)'}), '(path, low_memory=False)\n', (332, 356), True, 'import pandas as pd\n')] |
import sys
from collections.abc import Mapping
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
# Use a service account
cred = credentials.Certificate('./service-account-key.json')
firebase_admin.initialize_app(cred)
db = firestore.client()
for row in sys.stdin:
... | [
"firebase_admin.firestore.client",
"firebase_admin.credentials.Certificate",
"firebase_admin.initialize_app"
] | [((180, 233), 'firebase_admin.credentials.Certificate', 'credentials.Certificate', (['"""./service-account-key.json"""'], {}), "('./service-account-key.json')\n", (203, 233), False, 'from firebase_admin import credentials\n'), ((234, 269), 'firebase_admin.initialize_app', 'firebase_admin.initialize_app', (['cred'], {})... |
import tensorflow as tf
import numpy as np
import math
# Parameter
order_num=2;
class Program:
def __init__(self,sess,state_dim,obj_num,fea_size,Theta,program_order,postfix):
self.sess = sess;
self.state_dim = state_dim;
self.fea_size=fea_size;
self.obj_num=obj_num;
self.order_num=order_num;
... | [
"tensorflow.unstack",
"tensorflow.transpose",
"tensorflow.multiply",
"tensorflow.reshape",
"tensorflow.stack"
] | [((482, 527), 'tensorflow.reshape', 'tf.reshape', (['self.Theta', '[-1, self.obj_num, 6]'], {}), '(self.Theta, [-1, self.obj_num, 6])\n', (492, 527), True, 'import tensorflow as tf\n'), ((541, 581), 'tensorflow.transpose', 'tf.transpose', (['self.Theta'], {'perm': '[0, 2, 1]'}), '(self.Theta, perm=[0, 2, 1])\n', (553, ... |
#!/usr/bin/env python
# ===========================================================================
# Copyright 2017 `<NAME>`
# Email: ttungl at gmail dot com
# Heterogeneous Architecture Configurations Generator for Multi2Sim simulator
# (aka, `HeteroArchGen4M2S`)
# `HeteroArchGen4M2S` is free software, which is fre... | [
"math.ceil"
] | [((3581, 3617), 'math.ceil', 'math.ceil', (['(pipelines_size / 8 + 0.55)'], {}), '(pipelines_size / 8 + 0.55)\n', (3590, 3617), False, 'import math\n'), ((3963, 3999), 'math.ceil', 'math.ceil', (['(pipelines_size / 8 + 0.55)'], {}), '(pipelines_size / 8 + 0.55)\n', (3972, 3999), False, 'import math\n'), ((4079, 4115), ... |
import os
from sqlalchemy import (Column, DateTime, Integer, MetaData, String, Text, Table,
create_engine)
from sqlalchemy.sql import func
from databases import Database
DATABASE_URL = os.getenv("DATABASE_URL")
# SQLAlchemy
engine = create_engine(DATABASE_URL)
metadata = MetaData()
movies =... | [
"databases.Database",
"os.getenv",
"sqlalchemy.Text",
"sqlalchemy.sql.func.now",
"sqlalchemy.create_engine",
"sqlalchemy.MetaData",
"sqlalchemy.String",
"sqlalchemy.Column"
] | [((212, 237), 'os.getenv', 'os.getenv', (['"""DATABASE_URL"""'], {}), "('DATABASE_URL')\n", (221, 237), False, 'import os\n'), ((261, 288), 'sqlalchemy.create_engine', 'create_engine', (['DATABASE_URL'], {}), '(DATABASE_URL)\n', (274, 288), False, 'from sqlalchemy import Column, DateTime, Integer, MetaData, String, Tex... |
from collections import OrderedDict
from asyncio import TimeoutError, wait
from concurrent.futures import FIRST_COMPLETED
import time
from discord import TextChannel, DMChannel
from discord.errors import Forbidden, NotFound
from objects.context import Context
class PaginatorABC:
def __init__(self, bot, looped... | [
"collections.OrderedDict",
"time.time"
] | [((595, 608), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (606, 608), False, 'from collections import OrderedDict\n'), ((4360, 4371), 'time.time', 'time.time', ([], {}), '()\n', (4369, 4371), False, 'import time\n'), ((5881, 5892), 'time.time', 'time.time', ([], {}), '()\n', (5890, 5892), False, 'import... |
from __future__ import unicode_literals
import os
import boto3
import sure # noqa
from freezegun import freeze_time
from unittest import SkipTest
from moto import mock_managedblockchain, settings
from . import helpers
@mock_managedblockchain
def test_vote_on_proposal_one_member_total_yes():
conn = boto3.clien... | [
"freezegun.freeze_time",
"boto3.client",
"unittest.SkipTest",
"os.environ.get"
] | [((309, 367), 'boto3.client', 'boto3.client', (['"""managedblockchain"""'], {'region_name': '"""us-east-1"""'}), "('managedblockchain', region_name='us-east-1')\n", (321, 367), False, 'import boto3\n'), ((2051, 2109), 'boto3.client', 'boto3.client', (['"""managedblockchain"""'], {'region_name': '"""us-east-1"""'}), "('... |
# -*- coding: utf-8 -*-
# (c) Copyright IBM Corp. 2018. All Rights Reserved.
# pragma pylint: disable=unused-argument, no-self-use
"""Function implementation"""
import os
import logging
import time
import shlex
import subprocess
import json
import chardet
import winrm
import re
from resilient_circuits import Resilien... | [
"logging.getLogger",
"re.split",
"resilient_circuits.handler",
"json.loads",
"os.path.expandvars",
"shlex.split",
"subprocess.Popen",
"os.environ.copy",
"chardet.detect",
"resilient_circuits.FunctionError",
"resilient_circuits.template_functions.render",
"resilient_circuits.function",
"time.... | [((784, 801), 'resilient_circuits.handler', 'handler', (['"""reload"""'], {}), "('reload')\n", (791, 801), False, 'from resilient_circuits import ResilientComponent, function, handler, StatusMessage, FunctionResult, FunctionError\n'), ((962, 997), 'resilient_circuits.function', 'function', (['"""utilities_shell_command... |
"""
script to run mc sims on the three associations techniques when the tracks origin are equal. Used to calculate the
total number of correctly associating tracks and total # falsly not associating tracks from the same target.
"""
import numpy as np
from stonesoup.types.state import GaussianState
from data_associati... | [
"utils.open_object.open_object",
"stonesoup.types.state.GaussianState",
"numpy.diag",
"data_association.CountingAssociator.CountingAssociator",
"trackers.kf_dependent_fusion_async_sensors.KalmanFilterDependentFusionAsyncSensors",
"utils.scenario_generator.generate_scenario_3"
] | [((1806, 2051), 'utils.scenario_generator.generate_scenario_3', 'generate_scenario_3', ([], {'seed': 'seed', 'permanent_save': '(False)', 'radar_meas_rate': 'radar_meas_rate', 'ais_meas_rate': 'ais_meas_rate', 'sigma_process': 'sigma_process', 'sigma_meas_radar': 'sigma_meas_radar', 'sigma_meas_ais': 'sigma_meas_ais', ... |
import json
import operator
import logging
import re
import time
from socket import socket, AF_INET, SOCK_DGRAM
from functools import reduce
logger = logging.getLogger(__name__)
def ip():
"""Find default IP"""
ip = None
s = socket(AF_INET, SOCK_DGRAM)
try:
s.connect(('172.16.31.10', 9))
... | [
"logging.getLogger",
"re.split",
"json.loads",
"socket.socket",
"json.dumps",
"time.strftime",
"logging.StreamHandler.format"
] | [((151, 178), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (168, 178), False, 'import logging\n'), ((238, 265), 'socket.socket', 'socket', (['AF_INET', 'SOCK_DGRAM'], {}), '(AF_INET, SOCK_DGRAM)\n', (244, 265), False, 'from socket import socket, AF_INET, SOCK_DGRAM\n'), ((590, 606), 'js... |
#!/usr/bin/env python3
#
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
import argparse
import Libraries.arguments as ar
import Libraries.tools.general as gt
import Libraries.tools.zabbix as zt
import Classes.AppConfig as AppConfig
import requests
import copy
def r... | [
"sys.exit",
"copy.deepcopy",
"Libraries.tools.zabbix.fetch_hosts",
"argparse.ArgumentParser",
"Libraries.tools.general.dec2ip",
"Libraries.arguments.set_standard_args",
"requests.get",
"os.path.realpath",
"os.path.basename",
"Libraries.tools.zabbix.execute_api_query",
"Libraries.tools.general.ge... | [((437, 544), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.RawDescriptionHelpFormatter', 'description': 'description'}), '(formatter_class=argparse.\n RawDescriptionHelpFormatter, description=description)\n', (460, 544), False, 'import argparse\n'), ((584, 621), 'Libraries... |
from numpy import exp, pi, cos, sin, tan
from ....Functions.Geometry.inter_line_circle import inter_line_circle
def _comp_point_coordinate(self):
"""Compute the point coordinates needed to plot the Slot.
Parameters
----------
self : HoleM51
A HoleM51 object
Returns
-------
point_... | [
"numpy.exp",
"numpy.sin",
"numpy.cos",
"numpy.tan"
] | [((565, 575), 'numpy.cos', 'cos', (['alpha'], {}), '(alpha)\n', (568, 575), False, 'from numpy import exp, pi, cos, sin, tan\n'), ((1175, 1198), 'numpy.exp', 'exp', (['(1.0j * self.W1 / 2)'], {}), '(1.0j * self.W1 / 2)\n', (1178, 1198), False, 'from numpy import exp, pi, cos, sin, tan\n'), ((1691, 1715), 'numpy.exp', '... |
print("\n")
print("PythonExercises-v2 by <NAME>")
print("\n")
print("=== EXERCISE 1 ===")
print("\n")
print("(a) 5 / 3 = " + str(5 / 3))
print("=> with python3 you can receive a float even if you divide two \
integers")
print("\n")
print("(b) 5 % 3 = " + str(5 % 3))
print("=> % is the modulus which divides left hand... | [
"functools.reduce",
"numpy.sin",
"re.findall",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((7097, 7122), 'numpy.arange', 'np.arange', (['(0.0)', '(2.0)', '(0.01)'], {}), '(0.0, 2.0, 0.01)\n', (7106, 7122), True, 'import numpy as np\n'), ((7177, 7191), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (7189, 7191), True, 'import matplotlib.pyplot as plt\n'), ((7266, 7276), 'matplotlib.pyplot.s... |
import dash
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_html_components as html
import pandas as pd
import plotly.express as px
import plotly.graph_objs as go
from datetime import date
import dash_loading_spinners as dls
from dash.dependencies import Input, Output, ClientsideF... | [
"requests.post",
"plotly.graph_objs.Scatter",
"dash.dependencies.Input",
"dash_bootstrap_components.Label",
"pandas.to_datetime",
"dash_html_components.Div",
"plotly.express.scatter",
"dash.dependencies.Output",
"dash_html_components.H6",
"datetime.date",
"dash_html_components.Hr",
"dash_html_... | [((5590, 5621), 'dash.dependencies.Output', 'Output', (['"""graph-steam"""', '"""figure"""'], {}), "('graph-steam', 'figure')\n", (5596, 5621), False, 'from dash.dependencies import Input, Output, ClientsideFunction, State\n'), ((8142, 8180), 'dash.dependencies.Output', 'Output', (['"""graph-distribution"""', '"""figur... |
# Copyright 2021 Touca, Inc. Subject to Apache-2.0 License.
from ._types import IntegerType, VectorType, ToucaType
from datetime import datetime, timedelta
from enum import Enum
from typing import Dict, Tuple
class ResultCategory(Enum):
""" """
Check = 1
Assert = 2
class ResultEntry:
"""
Wrapp... | [
"touca._schema.MessageAddMetadata",
"touca._schema.MetricStart",
"touca._schema.MetricAddValue",
"flatbuffers.Builder",
"datetime.timedelta",
"touca._schema.MetadataEnd",
"touca._schema.ResultAddKey",
"touca._schema.ResultStart",
"touca._schema.MetadataStart",
"touca._schema.MetricsEnd",
"touca.... | [((5964, 5978), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (5976, 5978), False, 'from datetime import datetime, timedelta\n'), ((6440, 6454), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (6452, 6454), False, 'from datetime import datetime, timedelta\n'), ((8316, 8329), 'flatbuffers.Builder... |
from datetime import datetime
import sqlalchemy as sa
from flask_sqlalchemy import Model
from sqlalchemy import ForeignKey
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relationship
from app.main.extensions import db
class BaseMixin(Model):
def save_to_db(self):
try:
... | [
"sqlalchemy.orm.relationship",
"app.main.extensions.db.session.rollback",
"app.main.extensions.db.session.add",
"sqlalchemy.ForeignKey",
"sqlalchemy.Column",
"app.main.extensions.db.session.delete",
"app.main.extensions.db.session.commit"
] | [((728, 775), 'sqlalchemy.Column', 'sa.Column', (['sa.DateTime'], {'default': 'datetime.utcnow'}), '(sa.DateTime, default=datetime.utcnow)\n', (737, 775), True, 'import sqlalchemy as sa\n'), ((834, 856), 'sqlalchemy.Column', 'sa.Column', (['sa.DateTime'], {}), '(sa.DateTime)\n', (843, 856), True, 'import sqlalchemy as ... |
#-------------------------------------------------------------------------------
# This function defines the sea level change timeseries for marine ice sheet problem.
# *Default = sinusoidal tidal cycle if 'tides' with 1m amplitude if 'tides' turned 'on', OR...
# = zero if 'tides' turned 'off'
#---------------... | [
"numpy.sin"
] | [((505, 555), 'numpy.sin', 'np.sin', (['(4 * np.pi * t / (31540000.0 / 12.0 / 30.0))'], {}), '(4 * np.pi * t / (31540000.0 / 12.0 / 30.0))\n', (511, 555), True, 'import numpy as np\n')] |
from typing import List, Dict
from ts.c_syntax import CSyntax
from ts import Tree
from cfa import CFANode, CFA, CFAEdge
from cfa import LocalisedCFA, LocalisedNode
from .tweet_handler import TweetHandler
from .decoration_strategy import StandardDecorationStrategy, DecorationStrategy
from .conversion_strategy import Co... | [
"cfa.LocalisedNode",
"cfa.LocalisedCFA",
"ts.c_syntax.CSyntax"
] | [((641, 650), 'ts.c_syntax.CSyntax', 'CSyntax', ([], {}), '()\n', (648, 650), False, 'from ts.c_syntax import CSyntax\n'), ((2945, 2984), 'cfa.LocalisedCFA', 'LocalisedCFA', (['converted_nodes[cfa.root]'], {}), '(converted_nodes[cfa.root])\n', (2957, 2984), False, 'from cfa import LocalisedCFA, LocalisedNode\n'), ((289... |
# Copyright 2020 Graphcore Ltd.
from pathlib import Path
import pytest
# NOTE: The import below is dependent on 'pytest.ini' in the root of
# the repository
from examples_tests.test_util import SubProcessChecker
working_path = Path(__file__).parent
class TestBuildAndRun(SubProcessChecker):
def setUp(self):
... | [
"pathlib.Path"
] | [((229, 243), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (233, 243), False, 'from pathlib import Path\n')] |
from PIL import Image
import imagehash
from dotenv import load_dotenv
load_dotenv()
import google_streetview.api
import os
from shapely.geometry import shape, Polygon, Point
def get_point_photo(coords, download_folder):
# Define parameters for street view api
params_0 = [{
'size': '640x640', # max 640x640 pixels
... | [
"os.listdir",
"os.getenv",
"os.path.join",
"os.getcwd",
"dotenv.load_dotenv",
"os.rmdir",
"shapely.geometry.Point",
"shapely.geometry.shape",
"os.walk"
] | [((70, 83), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (81, 83), False, 'from dotenv import load_dotenv\n'), ((3663, 3691), 'os.walk', 'os.walk', (['path'], {'topdown': '(False)'}), '(path, topdown=False)\n', (3670, 3691), False, 'import os\n'), ((1797, 1812), 'shapely.geometry.shape', 'shape', (['geometry'... |
import dateutil
import yaml
import feedparser as fp
import newspaper as np
from medios.medio import Medio
from medios.diarios.noticia import Noticia
from bd.entidades import Kiosco
class Diario(Medio):
def __init__(self, etiqueta):
Medio.__init__(self, etiqueta)
self.noticias = []
self.f... | [
"dateutil.parser.parse",
"feedparser.parse",
"yaml.safe_load",
"newspaper.Article",
"medios.medio.Medio.__init__",
"bd.entidades.Kiosco"
] | [((248, 278), 'medios.medio.Medio.__init__', 'Medio.__init__', (['self', 'etiqueta'], {}), '(self, etiqueta)\n', (262, 278), False, 'from medios.medio import Medio\n'), ((1241, 1249), 'bd.entidades.Kiosco', 'Kiosco', ([], {}), '()\n', (1247, 1249), False, 'from bd.entidades import Kiosco\n'), ((2349, 2383), 'newspaper.... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
# from scipy.stats import entropy
import sys
sys.path.append('../')
import cloudtropy
# data
gen_dim = 2
gen_N = 300
lims = (-2,6)
scale = 0.2
X = np.random.uniform(low=lims[0],high=lims[1],size=(10000,2)) # background
X = np.co... | [
"matplotlib.pyplot.savefig",
"cloudtropy.entropy",
"cloudtropy.pmf",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.random.randn",
"matplotlib.pyplot.tight_layout",
"numpy.random.uniform",
"sys.path.append"
] | [((133, 155), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (148, 155), False, 'import sys\n'), ((239, 300), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': 'lims[0]', 'high': 'lims[1]', 'size': '(10000, 2)'}), '(low=lims[0], high=lims[1], size=(10000, 2))\n', (256, 300), True, 'impo... |
#!/usr/bin/env python
# _*_ encoding: utf-8 _*_
"""simplex.py: Simplex algorithm with rational coefficients"""
import numpy as np
import fractions as frac
__author__ = "<NAME>"
__email__ = "<EMAIL>"
class RestrictedSimplex(object):
def __init__(self, leaving_index=None, entering_index=None):
if not le... | [
"numpy.copy",
"numpy.ones",
"fractions.Fraction",
"numpy.zeros",
"numpy.argmin"
] | [((3105, 3128), 'numpy.copy', 'np.copy', (['lin_p.table[0]'], {}), '(lin_p.table[0])\n', (3112, 3128), True, 'import numpy as np\n'), ((3237, 3257), 'fractions.Fraction', 'frac.Fraction', (['(-1)', '(1)'], {}), '(-1, 1)\n', (3250, 3257), True, 'import fractions as frac\n'), ((3486, 3516), 'numpy.argmin', 'np.argmin', (... |
"""
This program helps identify smithsonian unit codes which are not yet added to
the smithsonian sub-provider dictionary
"""
import logging
from textwrap import dedent
import requests
from airflow.providers.postgres.hooks.postgres import PostgresHook
from common.loader import provider_details as prov
from providers.... | [
"logging.getLogger",
"airflow.providers.postgres.hooks.postgres.PostgresHook",
"requests.get",
"textwrap.dedent"
] | [((371, 398), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (388, 398), False, 'import logging\n'), ((776, 823), 'airflow.providers.postgres.hooks.postgres.PostgresHook', 'PostgresHook', ([], {'postgres_conn_id': 'postgres_conn_id'}), '(postgres_conn_id=postgres_conn_id)\n', (788, 823), ... |
import logging
import json
import re
import sys
import gdrivefs.conf
_logger = logging.getLogger(__name__)
# TODO(dustin): Make these individual functions.
class _DriveUtility(object):
"""General utility functions loosely related to GD."""
# # Mime-types to translate to, if they appear within the "exportLi... | [
"logging.getLogger",
"re.sub",
"sys.getfilesystemencoding",
"json.load"
] | [((81, 108), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (98, 108), False, 'import logging\n'), ((1633, 1660), 'sys.getfilesystemencoding', 'sys.getfilesystemencoding', ([], {}), '()\n', (1658, 1660), False, 'import sys\n'), ((3938, 3975), 're.sub', 're.sub', (['"""[^a-z0-9\\\\-_\\\\.]... |
import FWCore.ParameterSet.Config as cms
HEBRecHitGPUtoSoAProd = cms.EDProducer('HEBRecHitGPUtoSoA',
HEBRecHitGPUTok = cms.InputTag('HEBRecHitGPUProd'))
| [
"FWCore.ParameterSet.Config.InputTag"
] | [((159, 191), 'FWCore.ParameterSet.Config.InputTag', 'cms.InputTag', (['"""HEBRecHitGPUProd"""'], {}), "('HEBRecHitGPUProd')\n", (171, 191), True, 'import FWCore.ParameterSet.Config as cms\n')] |
import matplotlib.pyplot as plt
from collections import Counter
def line_graph(plt):
# years observed since 2000
years = [2000, 2002, 2005, 2007, 2010, 2012, 2014, 2015]
# total number of websites on the world wide web
# (source: Internet Live Stats)
websites = [17, 38, 64, 121, 206, 697, 968, 8... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show"
] | [((409, 496), 'matplotlib.pyplot.plot', 'plt.plot', (['years', 'websites'], {'color': '"""blue"""', 'marker': '"""o"""', 'linestyle': '"""solid"""', 'linewidth': '(2)'}), "(years, websites, color='blue', marker='o', linestyle='solid',\n linewidth=2)\n", (417, 496), True, 'import matplotlib.pyplot as plt\n'), ((549, ... |
# Copyright 2017-present Open Networking Foundation
#
# 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... | [
"xosconfig.Config.clear",
"xossynchronizer.mock_modelaccessor_build.mock_modelaccessor_config",
"mock.Mock",
"requests_mock.Mocker",
"os.path.join",
"os.path.realpath",
"xossynchronizer.modelaccessor.model_accessor.all_model_classes.items",
"mock.patch.object",
"xosconfig.Config.init",
"unittest.m... | [((3610, 3632), 'requests_mock.Mocker', 'requests_mock.Mocker', ([], {}), '()\n', (3630, 3632), False, 'import requests_mock\n'), ((3722, 3744), 'requests_mock.Mocker', 'requests_mock.Mocker', ([], {}), '()\n', (3742, 3744), False, 'import requests_mock\n'), ((5094, 5116), 'requests_mock.Mocker', 'requests_mock.Mocker'... |
import os
import sys
from collections import defaultdict
import datetime
import pickle
import re
import time
import json
from selenium import webdriver
def main():
driver = webdriver.Chrome() # Optional argument, if not specified will search path.
#load login cookie
driver.get('https://www.messenger.com')
... | [
"os.path.exists",
"re.compile",
"selenium.webdriver.Chrome",
"time.sleep",
"datetime.datetime.now",
"sys.exit"
] | [((178, 196), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {}), '()\n', (194, 196), False, 'from selenium import webdriver\n'), ((613, 659), 're.compile', 're.compile', (['"""lastActiveTimes":(.*),"chatNotif"""'], {}), '(\'lastActiveTimes":(.*),"chatNotif\')\n', (623, 659), False, 'import re\n'), ((981, 1022),... |
# encoding: utf-8
import asyncio
import logging
import random
from typing import Optional, Tuple
import discord
from discord.ext import commands
import lifesaver
from lifesaver.utils.formatting import truncate
from lifesaver.utils.timing import Timer, format_seconds
log = logging.getLogger(__name__)
SendVerdict = T... | [
"logging.getLogger",
"discord.ext.commands.Cog.listener",
"lifesaver.utils.formatting.truncate",
"lifesaver.utils.timing.Timer",
"asyncio.Event",
"discord.Color.green",
"lifesaver.command",
"discord.ext.commands.cooldown",
"lifesaver.utils.timing.format_seconds",
"discord.Embed",
"random.randint... | [((277, 304), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (294, 304), False, 'import logging\n'), ((671, 694), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (692, 694), False, 'from discord.ext import commands\n'), ((956, 979), 'discord.ext.commands.Co... |
import pytest
from app import create_app
@pytest.fixture
def client():
app = create_app()
client = app.test_client()
return client
| [
"app.create_app"
] | [((83, 95), 'app.create_app', 'create_app', ([], {}), '()\n', (93, 95), False, 'from app import create_app\n')] |
from django.contrib import admin
from api.models import Answer, Question, User
from django import forms
class AnswerAdmin(admin.ModelAdmin):
model = Answer
class QuestionAdmin(admin.ModelAdmin):
model = Question
# class UserForm(forms.ModelForm):
# password = forms.CharField(widget=forms.PasswordInput... | [
"django.contrib.admin.site.register"
] | [((524, 564), 'django.contrib.admin.site.register', 'admin.site.register', (['Answer', 'AnswerAdmin'], {}), '(Answer, AnswerAdmin)\n', (543, 564), False, 'from django.contrib import admin\n'), ((565, 609), 'django.contrib.admin.site.register', 'admin.site.register', (['Question', 'QuestionAdmin'], {}), '(Question, Ques... |
"""Parsing utilities for moreos."""
import re
import attr
@attr.s(frozen=True)
class ABNF:
"""Container of regular expressions both raw and compiled for parsing."""
# From https://tools.ietf.org/html/rfc2616#section-2.2
ctl = control_characters = "\x7f\x00-\x1f"
digit = "0-9"
separators = r"\[\]... | [
"attr.s",
"re.compile"
] | [((62, 81), 'attr.s', 'attr.s', ([], {'frozen': '(True)'}), '(frozen=True)\n', (68, 81), False, 'import attr\n'), ((2595, 2625), 're.compile', 're.compile', (['f"""[{separators}]+"""'], {}), "(f'[{separators}]+')\n", (2605, 2625), False, 'import re\n'), ((2654, 2677), 're.compile', 're.compile', (['f"""[{ctl}]+"""'], {... |
# STL imports
import random
import logging
import string
import time
import datetime
import random
import struct
import sys
from functools import wraps
# Third party imports
import numpy as np
import faker
from faker.providers import BaseProvider
logging.getLogger('faker').setLevel(logging.ERROR)
sys.path.append('.'... | [
"logging.getLogger",
"random.choice",
"time.perf_counter",
"functools.wraps",
"datetime.timedelta",
"faker.Faker",
"datetime.datetime.now",
"numpy.random.randint",
"random.random",
"time.localtime",
"sys.path.append",
"random.randint",
"numpy.random.RandomState"
] | [((301, 321), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (316, 321), False, 'import sys\n'), ((1553, 1566), 'faker.Faker', 'faker.Faker', ([], {}), '()\n', (1564, 1566), False, 'import faker\n'), ((532, 559), 'numpy.random.RandomState', 'np.random.RandomState', (['(1234)'], {}), '(1234)\n', (55... |
import logging
from typing import Any
from _pytest._io import TerminalWriter
from _pytest.logging import ColoredLevelFormatter
def test_coloredlogformatter() -> None:
logfmt = "%(filename)-25s %(lineno)4d %(levelname)-8s %(message)s"
record = logging.LogRecord(
name="dummy",
level=logging.IN... | [
"_pytest.logging.PercentStyleMultiline",
"_pytest._io.TerminalWriter",
"logging.LogRecord",
"_pytest.logging.ColoredLevelFormatter"
] | [((255, 387), 'logging.LogRecord', 'logging.LogRecord', ([], {'name': '"""dummy"""', 'level': 'logging.INFO', 'pathname': '"""dummypath"""', 'lineno': '(10)', 'msg': '"""Test Message"""', 'args': '()', 'exc_info': 'None'}), "(name='dummy', level=logging.INFO, pathname='dummypath',\n lineno=10, msg='Test Message', ar... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'tabresmatcher.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 QtCore... | [
"PyQt5.QtWidgets.QListView",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtWidgets.QSpinBox",
"PyQt5.QtWidgets.QComboBox",
"PyQt5.QtWidgets.QDoubleSpinBox",
"PyQt5.QtWidgets.QSpacerItem",
"PyQt5.QtWidgets.QRadioButton",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtWidgets.QFrame",
"PyQt5.QtWidg... | [((535, 571), 'PyQt5.QtWidgets.QHBoxLayout', 'QtWidgets.QHBoxLayout', (['tabresmatcher'], {}), '(tabresmatcher)\n', (556, 571), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((662, 685), 'PyQt5.QtWidgets.QVBoxLayout', 'QtWidgets.QVBoxLayout', ([], {}), '()\n', (683, 685), False, 'from PyQt5 import QtCore, QtG... |
# -*- coding: utf-8 -*-
"""Export the Bioregistry."""
import click
@click.command()
@click.pass_context
def export(ctx: click.Context):
"""Export the Bioregistry."""
from .prefix_maps import generate_contexts
from .rdf_export import export_rdf
from .sssom_export import export_sssom
from .tables_... | [
"click.command"
] | [((72, 87), 'click.command', 'click.command', ([], {}), '()\n', (85, 87), False, 'import click\n')] |
# Copyright (c) 2020-2021, <NAME>
# License: MIT License
from typing import (
TYPE_CHECKING,
List,
Iterable,
Tuple,
Optional,
Dict,
Sequence,
)
import math
import itertools
from ezdxf.math import (
Vec3,
Z_AXIS,
OCS,
Matrix44,
BoundingBox,
ConstructionEllipse,
cu... | [
"ezdxf.eztypes.EntityQuery",
"ezdxf.math.bulge_to_arc",
"math.degrees",
"ezdxf.math.reverse_bezier_curves",
"ezdxf.math.BoundingBox",
"ezdxf.math.cubic_bezier_from_ellipse",
"ezdxf.math.Bezier4P",
"ezdxf.math.Vec3",
"ezdxf.math.Matrix44.scale"
] | [((4463, 4476), 'ezdxf.math.BoundingBox', 'BoundingBox', ([], {}), '()\n', (4474, 4476), False, 'from ezdxf.math import Vec3, Z_AXIS, OCS, Matrix44, BoundingBox, ConstructionEllipse, cubic_bezier_from_ellipse, Bezier4P, Bezier3P, BSpline, reverse_bezier_curves, bulge_to_arc\n'), ((5929, 5939), 'ezdxf.math.Vec3', 'Vec3'... |
import model
from model import whole_foods_sale
from model import aldis_au_sale
from model import aldis_us_sale
from model import aldis_uk_sale
def go(inputs, store_name):
if store_name == 'WholeFoods':
final_df = whole_foods_sale.items_on_sale()
elif store_name == 'Aldi AU':
final_df = aldis_au_sale.items_on_s... | [
"model.aldis_au_sale.items_on_sale",
"model.aldis_us_sale.items_on_sale",
"model.aldis_uk_sale.items_on_sale",
"model.whole_foods_sale.items_on_sale"
] | [((219, 251), 'model.whole_foods_sale.items_on_sale', 'whole_foods_sale.items_on_sale', ([], {}), '()\n', (249, 251), False, 'from model import whole_foods_sale\n'), ((296, 325), 'model.aldis_au_sale.items_on_sale', 'aldis_au_sale.items_on_sale', ([], {}), '()\n', (323, 325), False, 'from model import aldis_au_sale\n')... |
import json
import logging
import mqtt.callbacks as mqtt_util
import paho.mqtt.client as mqtt
logger = logging.getLogger('pyledserver.PyLEDClient')
logger.setLevel(logging.DEBUG)
class PyLEDClient(mqtt.Client):
def __init__(self, client_id, credentials, mqtt_topic, led_strip):
logger.debug('Creating clie... | [
"logging.getLogger",
"mqtt.callbacks.CallbackContainer",
"json.dumps"
] | [((105, 149), 'logging.getLogger', 'logging.getLogger', (['"""pyledserver.PyLEDClient"""'], {}), "('pyledserver.PyLEDClient')\n", (122, 149), False, 'import logging\n'), ((480, 518), 'mqtt.callbacks.CallbackContainer', 'mqtt_util.CallbackContainer', (['led_strip'], {}), '(led_strip)\n', (507, 518), True, 'import mqtt.c... |
from pilco.policies.policy import Policy
import tensorflow as tf
class TransformedPolicy(Policy):
def __init__(self,
policy,
transform,
name="sine_bounded_action_policy",
**kwargs):
super().__init__(state_dim=policy.state_dim,
... | [
"tensorflow.range"
] | [((687, 745), 'tensorflow.range', 'tf.range', (['self.state_dim', '(self.state_dim + self.action_dim)'], {}), '(self.state_dim, self.state_dim + self.action_dim)\n', (695, 745), True, 'import tensorflow as tf\n')] |
# Copyright 2021 The MathWorks, Inc.
"""Tests for functions in matlab_desktop_proxy/util/mwi_validators.py
"""
import pytest, os, tempfile, socket, random
import matlab_desktop_proxy
from matlab_desktop_proxy.util import mwi_validators
from matlab_desktop_proxy import mwi_environment_variables as mwi_env
from matlab_d... | [
"socket.socket",
"matlab_desktop_proxy.mwi_environment_variables.get_env_name_network_license_manager",
"os.getenv",
"matlab_desktop_proxy.util.mwi_validators.validate_mlm_license_file",
"matlab_desktop_proxy.get_default_config_name",
"pytest.mark.parametrize",
"pytest.raises",
"matlab_desktop_proxy.u... | [((4168, 4376), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""base_url, validated_base_url"""', "[('', ''), ('/bla', '/bla'), ('/bla/', '/bla')]"], {'ids': "['Launch integration at root', 'Launch at custom path',\n 'Launch at custom with suffix: /']"}), "('base_url, validated_base_url', [('', ''), ('/b... |