code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""Analysis functions for career decisions data."""
import pandas as pd
import numpy as np
def get_prepare_ekw_ext_data(file):
"""Read and reformat career decisions data (file).
Parameters:
-----------
file: str
Path and filename of career decisions data (data to load).
Returns:... | [
"pandas.DataFrame.from_dict",
"pandas.crosstab",
"pandas.read_csv"
] | [((650, 680), 'pandas.read_csv', 'pd.read_csv', (['file'], {'dtype': 'dtype'}), '(file, dtype=dtype)\n', (661, 680), True, 'import pandas as pd\n'), ((2197, 2261), 'pandas.crosstab', 'pd.crosstab', ([], {'index': "df['Age']", 'columns': "df['Choice']", 'margins': '(True)'}), "(index=df['Age'], columns=df['Choice'], mar... |
"""
==================================
Faster rendering by using blitting
==================================
*Blitting* is a `standard technique
<https://en.wikipedia.org/wiki/Bit_blit>`__ in raster graphics that,
in the context of Matplotlib, can be used to (drastically) improve
performance of interactive figures. Fo... | [
"numpy.sin",
"numpy.linspace",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((1984, 2014), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', '(100)'], {}), '(0, 2 * np.pi, 100)\n', (1995, 2014), True, 'import numpy as np\n'), ((2026, 2040), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (2038, 2040), True, 'import matplotlib.pyplot as plt\n'), ((2238, 2259), 'matplotli... |
"""Support for TCP socket based sensors."""
import logging
import select
import socket
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_HOST,
CONF_NAME,
CONF_PAYLOAD,
CONF_PORT,
CONF_TIMEOUT,
CONF_UNIT_OF_MEASUREMENT,
... | [
"logging.getLogger",
"voluptuous.Required",
"select.select",
"socket.socket",
"voluptuous.Optional"
] | [((509, 536), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (526, 536), False, 'import logging\n'), ((732, 755), 'voluptuous.Required', 'vol.Required', (['CONF_HOST'], {}), '(CONF_HOST)\n', (744, 755), True, 'import voluptuous as vol\n'), ((776, 799), 'voluptuous.Required', 'vol.Required... |
from typing import Dict
from PIL import Image, ImageDraw, ImageFont
from fontTools.ttLib import TTFont
class AnimText:
font_array = [
# AA-Like > Pixel > Generic
# AA-like, Latin, hiragana, katakana, (part of) cyrillic
{'path': './assets/igiari/Igiari.ttf'},
# Pixel, Kanji, Hiragana... | [
"PIL.ImageDraw.Draw",
"PIL.ImageFont.truetype",
"fontTools.ttLib.TTFont"
] | [((1518, 1544), 'PIL.ImageDraw.Draw', 'ImageDraw.Draw', (['background'], {}), '(background)\n', (1532, 1544), False, 'from PIL import Image, ImageDraw, ImageFont\n'), ((2578, 2595), 'fontTools.ttLib.TTFont', 'TTFont', (['font_path'], {}), '(font_path)\n', (2584, 2595), False, 'from fontTools.ttLib import TTFont\n'), ((... |
import pandas as pd
import time
import random
import requests as req
from bs4 import BeautifulSoup as bs
import urllib3
urllib3.disable_warnings()
resultado = pd.DataFrame()
notFind = []
for i in range(101):
n = random.randint(1,325)
time.sleep(2)
if i == 0:
continue
else:
... | [
"pandas.read_html",
"time.sleep",
"requests.get",
"bs4.BeautifulSoup",
"urllib3.disable_warnings",
"pandas.DataFrame",
"random.randint"
] | [((126, 152), 'urllib3.disable_warnings', 'urllib3.disable_warnings', ([], {}), '()\n', (150, 152), False, 'import urllib3\n'), ((168, 182), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (180, 182), True, 'import pandas as pd\n'), ((230, 252), 'random.randint', 'random.randint', (['(1)', '(325)'], {}), '(1, 325... |
import pytest
from abstract_open_traffic_generator.port import *
from abstract_open_traffic_generator.config import *
from abstract_open_traffic_generator.layer1 import *
from abstract_open_traffic_generator.control import *
@pytest.mark.ConfigTest
def test_layer1_fcoe(serializer, api, tx_port, rx_port):
"""Test ... | [
"pytest.main"
] | [((1167, 1196), 'pytest.main', 'pytest.main', (["['-s', __file__]"], {}), "(['-s', __file__])\n", (1178, 1196), False, 'import pytest\n')] |
#########################################################################
# #
# Name: Debugger #
# #
# Project: Transparent... | [
"inspect.currentframe",
"time.time"
] | [((1347, 1369), 'inspect.currentframe', 'inspect.currentframe', ([], {}), '()\n', (1367, 1369), False, 'import inspect\n'), ((4048, 4059), 'time.time', 'time.time', ([], {}), '()\n', (4057, 4059), False, 'import time\n'), ((2830, 2841), 'time.time', 'time.time', ([], {}), '()\n', (2839, 2841), False, 'import time\n')] |
import numpy as np
def create_label_map(num_classes=19):
name_label_mapping = {
'unlabeled': 0, 'outlier': 1, 'car': 10, 'bicycle': 11,
'bus': 13, 'motorcycle': 15, 'on-rails': 16, 'truck': 18,
'other-vehicle': 20, 'person': 30, 'bicyclist': 31,
'motorcyclist': 32, 'road': 40, 'par... | [
"numpy.zeros"
] | [((1284, 1297), 'numpy.zeros', 'np.zeros', (['(260)'], {}), '(260)\n', (1292, 1297), True, 'import numpy as np\n')] |
# coding=utf-8
# Copyright 2020 The TensorFlow Datasets 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 appl... | [
"tensorflow_datasets.public_api.features.Image",
"numpy.frombuffer",
"collections.namedtuple",
"tensorflow_datasets.public_api.features.Text",
"os.path.join",
"tensorflow_datasets.public_api.features.ClassLabel",
"tensorflow_datasets.public_api.core.Version",
"tensorflow.compat.v2.io.gfile.GFile"
] | [((6490, 6615), 'collections.namedtuple', 'collections.namedtuple', (['"""_CifarInfo"""', "['name', 'url', 'prefix', 'train_files', 'test_files', 'label_files',\n 'label_keys']"], {}), "('_CifarInfo', ['name', 'url', 'prefix',\n 'train_files', 'test_files', 'label_files', 'label_keys'])\n", (6512, 6615), False, '... |
from django.db import models
from django.urls import reverse
# Create your models here.
class Passenger(models.Model):
name = models.CharField(max_length=50, blank=True, null=True)
def __str__(self):
return f'{self.name}'
def get_absolute_url(self):
return reverse('persons:passenger_detai... | [
"django.db.models.CharField"
] | [((131, 185), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)', 'blank': '(True)', 'null': '(True)'}), '(max_length=50, blank=True, null=True)\n', (147, 185), False, 'from django.db import models\n'), ((386, 440), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)', ... |
# %%
from core.dqn_agent import DQNAgent
from cartpole.cartpole_neural_network import CartPoleNeuralNetwork
from cartpole.cartpole_wrapper import CartPoleWrapper
import gym
import numpy as np
from tqdm import tqdm
import numpy as np
import shutil
from pathlib import Path
import shutil
from utils import *
import plotly.... | [
"numpy.mean",
"pathlib.Path",
"numpy.std",
"cartpole.cartpole_neural_network.CartPoleNeuralNetwork",
"numpy.random.seed",
"shutil.rmtree",
"gym.wrappers.Monitor",
"gym.make"
] | [((431, 451), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (445, 451), True, 'import numpy as np\n'), ((2030, 2158), 'gym.wrappers.Monitor', 'gym.wrappers.Monitor', (['agent.env', '"""results/cartpole/recording/tmp-videos"""'], {'force': '(True)', 'video_callable': '(lambda episode_id: True)'}), "... |
# -*- coding: utf-8 -*-
"""Some matrix specialization."""
import time
from pygimli.core import _pygimli_ as pg
import numpy as np
# make core matrices (now in pg, later pg.core) known here for tab-completion
# BlockMatrix = pg.BlockMatrix
# IdentityMatrix = pg.IdentityMatrix
class MultLeftMatrix(pg.MatrixBase):
... | [
"scipy.linalg.eigh",
"numpy.transpose",
"numpy.sqrt",
"time.time"
] | [((5643, 5654), 'time.time', 'time.time', ([], {}), '()\n', (5652, 5654), False, 'import time\n'), ((5682, 5689), 'scipy.linalg.eigh', 'eigh', (['A'], {}), '(A)\n', (5686, 5689), False, 'from scipy.linalg import eigh\n'), ((5709, 5731), 'numpy.sqrt', 'np.sqrt', (['(1.0 / self.ew)'], {}), '(1.0 / self.ew)\n', (5716, 573... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, <NAME>
# Written by <NAME> <<EMAIL>>
# Based on pkgng module written by bleader <<EMAIL>>
# that was based on pkgin module written by <NAME> <shaun.zinck at gmail.com>
# that was based on pacman module written by Afterburn <https://github.com/afterburn>
# that was ... | [
"platform.machine",
"re.escape",
"os.listdir"
] | [((1977, 1995), 'platform.machine', 'platform.machine', ([], {}), '()\n', (1993, 1995), False, 'import platform\n'), ((2257, 2288), 'os.listdir', 'os.listdir', (['"""/var/log/packages"""'], {}), "('/var/log/packages')\n", (2267, 2288), False, 'import os\n'), ((2192, 2207), 're.escape', 're.escape', (['name'], {}), '(na... |
#!/usr/bin/python
# coding=utf-8
################################################################################
from __future__ import with_statement
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collecto... | [
"mock.patch.object",
"resqueweb.ResqueWebCollector",
"test.unittest.main",
"test.get_collector_config"
] | [((699, 733), 'mock.patch.object', 'patch.object', (['Collector', '"""publish"""'], {}), "(Collector, 'publish')\n", (711, 733), False, 'from mock import patch\n'), ((1548, 1582), 'mock.patch.object', 'patch.object', (['Collector', '"""publish"""'], {}), "(Collector, 'publish')\n", (1560, 1582), False, 'from mock impor... |
from sys import stdout, exit
from textwrap import dedent
from copy import copy
from clingo.application import Application
from clingo import SymbolType, Number, Function, ast, clingo_main
class TermTransformer(ast.Transformer):
def __init__(self, parameter):
self.parameter = parameter
def __get_param... | [
"clingo.ast.Literal",
"clingo.ast.SymbolicTerm",
"textwrap.dedent",
"clingo.Number",
"clingo.ast.Id",
"clingo.ast.ProgramBuilder",
"copy.copy",
"clingo.ast.SymbolicAtom",
"clingo.Function",
"sys.stdout.write"
] | [((431, 473), 'clingo.ast.SymbolicTerm', 'ast.SymbolicTerm', (['location', 'self.parameter'], {}), '(location, self.parameter)\n', (447, 473), False, 'from clingo import SymbolType, Number, Function, ast, clingo_main\n'), ((1920, 1929), 'copy.copy', 'copy', (['prg'], {}), '(prg)\n', (1924, 1929), False, 'from copy impo... |
# Copyright 2020 Xanadu Quantum Technologies 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 agre... | [
"qsimcirq.QSimhSimulator",
"pennylane.QubitDevice.expval",
"qsimcirq.QSimSimulator",
"cirq.Circuit",
"numpy.array",
"numpy.sum",
"cirq.IdentityGate"
] | [((2383, 2438), 'qsimcirq.QSimSimulator', 'qsimcirq.QSimSimulator', ([], {'qsim_options': '(qsim_options or {})'}), '(qsim_options=qsim_options or {})\n', (2405, 2438), False, 'import qsimcirq\n'), ((4844, 4882), 'qsimcirq.QSimhSimulator', 'qsimcirq.QSimhSimulator', (['qsimh_options'], {}), '(qsimh_options)\n', (4867, ... |
import asyncio
import json
import logging
from contextlib import contextmanager
from typing import Any, Dict
import attr
from aiohttp import web
from aiohttp.web import RouteTableDef
from servicelib.aiohttp.application_keys import APP_CONFIG_KEY
from servicelib.aiohttp.rest_utils import extract_and_validate
from ._me... | [
"logging.getLogger",
"aiohttp.web.HTTPUnprocessableEntity",
"json.dumps",
"aiohttp.web.RouteTableDef",
"attr.asdict",
"asyncio.wait_for",
"servicelib.aiohttp.rest_utils.extract_and_validate",
"aiohttp.web.HTTPNoContent"
] | [((618, 645), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (635, 645), False, 'import logging\n'), ((656, 671), 'aiohttp.web.RouteTableDef', 'RouteTableDef', ([], {}), '()\n', (669, 671), False, 'from aiohttp.web import RouteTableDef\n'), ((14907, 14957), 'aiohttp.web.HTTPNoContent', 'w... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2020 Alibaba Group Holding 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-... | [
"numpy.prod",
"numpy.dtype",
"numpy.random.RandomState"
] | [((1326, 1341), 'numpy.dtype', 'np.dtype', (['dtype'], {}), '(dtype)\n', (1334, 1341), True, 'import numpy as np\n'), ((2180, 2210), 'numpy.random.RandomState', 'np.random.RandomState', (['op.seed'], {}), '(op.seed)\n', (2201, 2210), True, 'import numpy as np\n'), ((2444, 2464), 'numpy.prod', 'np.prod', (['chunk.shape'... |
import pytest
from streamlink_cli.utils.path import replace_chars
from tests import posix_only, windows_only
@pytest.mark.parametrize("char", [i for i in range(32)])
def test_replace_chars_unprintable(char: int):
assert replace_chars(f"foo{chr(char)}{chr(char)}bar") == "foo_bar", "Replaces unprintable characters... | [
"streamlink_cli.utils.path.replace_chars"
] | [((434, 470), 'streamlink_cli.utils.path.replace_chars', 'replace_chars', (['f"""foo{char}{char}bar"""'], {}), "(f'foo{char}{char}bar')\n", (447, 470), False, 'from streamlink_cli.utils.path import replace_chars\n'), ((667, 703), 'streamlink_cli.utils.path.replace_chars', 'replace_chars', (['f"""foo{char}{char}bar"""']... |
import os
import streamlit as st
def save_uploaded_file(uploaded_file, path):
with open(os.path.join(path, uploaded_file.name), "wb") as f:
f.write(uploaded_file.getbuffer())
return st.success("Saved File:{} to {}".format(uploaded_file.name, path)) | [
"os.path.join"
] | [((93, 131), 'os.path.join', 'os.path.join', (['path', 'uploaded_file.name'], {}), '(path, uploaded_file.name)\n', (105, 131), False, 'import os\n')] |
"""
Augmenter that apply typo error simulation to textual input.
"""
import os
from nlpaug.augmenter.char import CharAugmenter
from nlpaug.util import Action, Method, Doc, LibraryUtil
import nlpaug.model.char as nmc
class KeyboardAug(CharAugmenter):
# https://arxiv.org/pdf/1711.02173.pdf
"""
Augment... | [
"nlpaug.model.char.Keyboard",
"nlpaug.util.LibraryUtil.get_res_dir"
] | [((6461, 6579), 'nlpaug.model.char.Keyboard', 'nmc.Keyboard', ([], {'special_char': 'special_char', 'numeric': 'numeric', 'upper_case': 'upper_case', 'lang': 'lang', 'model_path': 'model_path'}), '(special_char=special_char, numeric=numeric, upper_case=\n upper_case, lang=lang, model_path=model_path)\n', (6473, 6579... |
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 27 12:09:08 2021
@author: marri
"""
import yolo_opencv as yolo
import yolo_video as yolo_video
yolo.find_vehicles("tiny_test3.png", tiny=False)
yolo_video.find_vehicles("00108.MTS", "demo.mp4", tiny=True)
| [
"yolo_video.find_vehicles",
"yolo_opencv.find_vehicles"
] | [((147, 195), 'yolo_opencv.find_vehicles', 'yolo.find_vehicles', (['"""tiny_test3.png"""'], {'tiny': '(False)'}), "('tiny_test3.png', tiny=False)\n", (165, 195), True, 'import yolo_opencv as yolo\n'), ((196, 256), 'yolo_video.find_vehicles', 'yolo_video.find_vehicles', (['"""00108.MTS"""', '"""demo.mp4"""'], {'tiny': '... |
#!/usr/bin/env python3
import os
listNombre= []
listTamano= []
st=0
while 1:
conInicial= 0
conFinal= 0
os.system("clear")
opc= int(input("Que opcion desea hacer?\n1) Agregar procesos\n2) Eliminar proceso\n3) Mostrar Procesos\n4) Desfragmentar\n5) Salir\nOpcion [ ]\b\b"))
if opc is 1:
os.system("clear")
n... | [
"os.system"
] | [((110, 128), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (119, 128), False, 'import os\n'), ((298, 316), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (307, 316), False, 'import os\n'), ((492, 510), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (501, 510), False,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# FLEDGE_BEGIN
# See: http://fledge.readthedocs.io/
# FLEDGE_END
"""Core server module"""
import asyncio
import os
import subprocess
import sys
import ssl
import time
import uuid
from aiohttp import web
import aiohttp
import json
import signal
from datetime import datet... | [
"fledge.services.core.service_registry.monitor.Monitor",
"aiohttp.web.Application",
"fledge.services.core.api.configuration.get_categories",
"aiohttp.web.json_response",
"fledge.services.core.service_registry.service_registry.ServiceRegistry.unregister",
"sys.exit",
"fledge.common.web.ssl_wrapper.SSLVer... | [((2022, 2054), 'fledge.common.logger.setup', 'logger.setup', (['__name__'], {'level': '(20)'}), '(__name__, level=20)\n', (2034, 2054), False, 'from fledge.common import logger\n'), ((2098, 2136), 'os.getenv', 'os.getenv', (['"""FLEDGE_DATA"""'], {'default': 'None'}), "('FLEDGE_DATA', default=None)\n", (2107, 2136), F... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-01-24 15:47
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import falmer.content.blocks
import wagtail.core.blocks
import wagtail.core.fields
class Migration(migrations.Migration):
dep... | [
"django.db.models.SlugField",
"django.db.models.AutoField",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((1046, 1220), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'help_text': '"""Companies logo displayed next to the offer"""', 'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""matte.MatteImage"""'}), "(blank=True, help_text=\n 'Companies logo displayed next... |
from __future__ import print_function
from __future__ import absolute_import
from future.utils import listvalues
from builtins import object
import collections
import hashlib
import os
import re
import threading
import functools
import copy
from ._ranges import locators_and_ranges, Range
from .arvfile import StreamFil... | [
"re.search",
"collections.OrderedDict",
"re.match",
"future.utils.listvalues"
] | [((703, 728), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (726, 728), False, 'import collections\n'), ((2053, 2076), 'future.utils.listvalues', 'listvalues', (['self._files'], {}), '(self._files)\n', (2063, 2076), False, 'from future.utils import listvalues\n'), ((1057, 1107), 're.match', 'r... |
# -*- coding: utf-8 -*-
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | [
"future.utils.with_metaclass"
] | [((786, 809), 'future.utils.with_metaclass', 'with_metaclass', (['ABCMeta'], {}), '(ABCMeta)\n', (800, 809), False, 'from future.utils import with_metaclass\n'), ((4237, 4260), 'future.utils.with_metaclass', 'with_metaclass', (['ABCMeta'], {}), '(ABCMeta)\n', (4251, 4260), False, 'from future.utils import with_metaclas... |
import django
import sys
import os
sys.path.append(os.path.dirname(__file__) + '/..')
os.environ['DJANGO_SETTINGS_MODULE'] = 'carebackend.settings'
django.setup()
from places.models import Neighborhood, NeighborhoodEntry, Place, Area
import pandas as pd
import sys
fl = sys.argv[1]
df = pd.read_csv(fl)
df = df.where(... | [
"django.setup",
"pandas.read_csv",
"places.models.Place",
"os.path.dirname",
"pandas.notnull",
"places.models.Place.objects.get"
] | [((148, 162), 'django.setup', 'django.setup', ([], {}), '()\n', (160, 162), False, 'import django\n'), ((289, 304), 'pandas.read_csv', 'pd.read_csv', (['fl'], {}), '(fl)\n', (300, 304), True, 'import pandas as pd\n'), ((320, 334), 'pandas.notnull', 'pd.notnull', (['df'], {}), '(df)\n', (330, 334), True, 'import pandas ... |
"""
plasmapy.classes.plasma
=======================
Defines the core Plasma class used by PlasmaPy to represent plasma properties.
"""
import numpy as np
import astropy.units as u
from astropy.utils.console import ProgressBar
from .simulation import MHDSimulation, dot
from ..constants import mu0
class Plasma:
"... | [
"numpy.sqrt",
"astropy.utils.console.ProgressBar",
"numpy.squeeze",
"numpy.zeros",
"numpy.meshgrid",
"numpy.isinf",
"astropy.units.quantity_input"
] | [((1874, 1932), 'astropy.units.quantity_input', 'u.quantity_input', ([], {'domain_x': 'u.m', 'domain_y': 'u.m', 'domain_z': 'u.m'}), '(domain_x=u.m, domain_y=u.m, domain_z=u.m)\n', (1890, 1932), True, 'import astropy.units as u\n'), ((9229, 9259), 'astropy.units.quantity_input', 'u.quantity_input', ([], {'max_time': 'u... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | [
"libcloud.common.dimensiondata.DimensionDataVIPNode",
"libcloud.loadbalancer.base.Member",
"libcloud.common.dimensiondata.DimensionDataPool",
"libcloud.loadbalancer.base.LoadBalancer",
"libcloud.test.file_fixtures.LoadBalancerFileFixtures",
"libcloud.common.dimensiondata.DimensionDataPoolMember",
"unitt... | [((17892, 17933), 'libcloud.test.file_fixtures.LoadBalancerFileFixtures', 'LoadBalancerFileFixtures', (['"""dimensiondata"""'], {}), "('dimensiondata')\n", (17916, 17933), False, 'from libcloud.test.file_fixtures import LoadBalancerFileFixtures\n'), ((1637, 1673), 'libcloud.loadbalancer.drivers.dimensiondata.DimensionD... |
import cv2
import collections
import os
N = 2
scale_percent = 25 # percent of original size
def readImage(number):
image = cv2.imread('Images/Foto' + str(number) + '.jpg', -1)
dim = (int(image.shape[1] * scale_percent / 100), int(image.shape[0] * scale_percent / 100))
image = cv2.resize(image, dim, inte... | [
"os.listdir",
"os.path.join",
"os.fsencode",
"cv2.imshow",
"cv2.waitKey",
"os.fsdecode",
"cv2.resize",
"cv2.imread"
] | [((293, 345), 'cv2.resize', 'cv2.resize', (['image', 'dim'], {'interpolation': 'cv2.INTER_AREA'}), '(image, dim, interpolation=cv2.INTER_AREA)\n', (303, 345), False, 'import cv2\n'), ((878, 900), 'os.fsencode', 'os.fsencode', (['directory'], {}), '(directory)\n', (889, 900), False, 'import os\n'), ((934, 952), 'os.list... |
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import numpy as np
import torch
from torch import tensor
from sklearn.metrics import roc_curve, auc, accuracy_score, confusion_matrix, classification_report
from .models import RatioModel
import matplotlib.pyplot as plt
... | [
"logging.getLogger",
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.ylabel",
"numpy.arange",
"sklearn.metrics.classification_report",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"torch.sigmoid",
"matplotlib.pyplot.axis",
"torch.no_grad",
"matplotlib.pyplot.figure",
"torch.cud... | [((330, 357), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (347, 357), False, 'import logging\n'), ((575, 620), 'torch.device', 'torch.device', (["('cuda' if run_on_gpu else 'cpu')"], {}), "('cuda' if run_on_gpu else 'cpu')\n", (587, 620), False, 'import torch\n'), ((1724, 1769), 'torch... |
import json
from flask import Flask
from flask import request
from stream_parser.pubmed_row_parser import PubmedRowParser
import requests
app = Flask(__name__)
@app.route("/")
def index_page():
example_str = """
Example:
curl --header "Content-Type: application/json" \
--request... | [
"flask.request.get_json",
"json.dumps",
"stream_parser.pubmed_row_parser.PubmedRowParser",
"flask.Flask"
] | [((151, 166), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (156, 166), False, 'from flask import Flask\n'), ((1155, 1172), 'stream_parser.pubmed_row_parser.PubmedRowParser', 'PubmedRowParser', ([], {}), '()\n', (1170, 1172), False, 'from stream_parser.pubmed_row_parser import PubmedRowParser\n'), ((930, ... |
from django.conf import settings
from django.contrib import admin
# Register your models here.
from django.contrib.admin.forms import AdminPasswordChangeForm
from django.contrib.auth.models import Group
from user import models
from user.forms import UserChangeForm
class UserAdmin(admin.ModelAdmin):
form = UserCh... | [
"django.contrib.admin.site.unregister",
"django.contrib.admin.site.register"
] | [((2298, 2353), 'django.contrib.admin.site.register', 'admin.site.register', (['models.User'], {'admin_class': 'UserAdmin'}), '(models.User, admin_class=UserAdmin)\n', (2317, 2353), False, 'from django.contrib import admin\n'), ((2354, 2427), 'django.contrib.admin.site.register', 'admin.site.register', (['models.Blackl... |
import mitmproxy.tools.console.help as help
from ...conftest import skip_appveyor
@skip_appveyor
class TestHelp:
def test_helptext(self):
h = help.HelpView(None)
assert h.helptext()
def test_keypress(self):
h = help.HelpView([1, 2, 3])
assert not h.keypress((0, 0), "q")
... | [
"mitmproxy.tools.console.help.HelpView"
] | [((158, 177), 'mitmproxy.tools.console.help.HelpView', 'help.HelpView', (['None'], {}), '(None)\n', (171, 177), True, 'import mitmproxy.tools.console.help as help\n'), ((248, 272), 'mitmproxy.tools.console.help.HelpView', 'help.HelpView', (['[1, 2, 3]'], {}), '([1, 2, 3])\n', (261, 272), True, 'import mitmproxy.tools.c... |
import sys
from io import open
try:
from setuptools import setup, find_packages
except ImportError:
print('''
Error: pyinfra needs setuptools in order to install:
using pip: pip install setuptools
using a package manager (apt, yum, etc), normally named: python-setuptools
'''.strip())
sys.exit(1)
I... | [
"setuptools.find_packages",
"io.open",
"sys.exit"
] | [((1500, 1526), 'io.open', 'open', (['"""pyinfra/version.py"""'], {}), "('pyinfra/version.py')\n", (1504, 1526), False, 'from io import open\n'), ((1572, 1612), 'io.open', 'open', (['"""README.md"""', '"""r"""'], {'encoding': '"""utf-8"""'}), "('README.md', 'r', encoding='utf-8')\n", (1576, 1612), False, 'from io impor... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Checkout',
fields=[
('id', models.AutoField(ver... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((300, 393), 'django.db.models.AutoField', 'models.AutoField', ([], {'verbose_name': '"""ID"""', 'serialize': '(False)', 'auto_created': '(True)', 'primary_key': '(True)'}), "(verbose_name='ID', serialize=False, auto_created=True,\n primary_key=True)\n", (316, 393), False, 'from django.db import models, migrations\... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from test.generic.config_utils import get_test_model_configs
import torch
import torch.nn as nn
from c... | [
"classy_vision.generic.profiler.count_params",
"test.generic.config_utils.get_test_model_configs",
"torch.nn.Sequential",
"classy_vision.generic.profiler.compute_flops",
"torch.nn.Conv2d",
"classy_vision.generic.profiler.get_shape",
"torch.nn.Linear",
"torch.zeros",
"classy_vision.generic.profiler.c... | [((656, 683), 'torch.nn.Linear', 'nn.Linear', (['(2)', '(3)'], {'bias': '(False)'}), '(2, 3, bias=False)\n', (665, 683), True, 'import torch.nn as nn\n'), ((1182, 1209), 'torch.nn.Linear', 'nn.Linear', (['(4)', '(5)'], {'bias': '(False)'}), '(4, 5, bias=False)\n', (1191, 1209), True, 'import torch.nn as nn\n'), ((1601,... |
# Copyright (c) 2019-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import socket
from types import TracebackType
from typing import BinaryIO, Optional
from . import json_rpc
LOG: logging... | [
"logging.getLogger",
"os.path.realpath",
"os.path.join",
"socket.socket"
] | [((330, 357), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (347, 357), False, 'import logging\n'), ((556, 605), 'socket.socket', 'socket.socket', (['socket.AF_UNIX', 'socket.SOCK_STREAM'], {}), '(socket.AF_UNIX, socket.SOCK_STREAM)\n', (569, 605), False, 'import socket\n'), ((2023, 2074... |
# Natural Language Toolkit: Some texts for exploration in chapter 1 of the book
#
# Copyright (C) 2001-2018 NLTK Project
# Author: <NAME> <<EMAIL>>
#
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_function
from nltk.corpus import (gutenberg, genesis, inaugural,
... | [
"nltk.corpus.treebank.words",
"nltk.corpus.gutenberg.words",
"nltk.corpus.inaugural.words",
"nltk.corpus.nps_chat.words",
"nltk.corpus.webtext.words",
"nltk.corpus.genesis.words"
] | [((721, 762), 'nltk.corpus.gutenberg.words', 'gutenberg.words', (['"""melville-moby_dick.txt"""'], {}), "('melville-moby_dick.txt')\n", (736, 762), False, 'from nltk.corpus import gutenberg, genesis, inaugural, nps_chat, webtext, treebank, wordnet\n'), ((806, 841), 'nltk.corpus.gutenberg.words', 'gutenberg.words', (['"... |
### Reduces the video and exports only every nth frame
### Exports the current Streams7 scene as TIFF files
### Author: <NAME>
### using code borrowed from Levi ("SPythonTestMultiCamsStartTimeScript")
### and example code ("ExportMultiStreamFileReducedVideo")
### 14 Jun 2017
## 27 Jun 2017
## Choose n for each camera... | [
"os.path.exists",
"os.listdir",
"os.mkdir"
] | [((6759, 6785), 'os.path.exists', 'os.path.exists', (['exportPath'], {}), '(exportPath)\n', (6773, 6785), False, 'import os\n'), ((4860, 4913), 'os.path.exists', 'os.path.exists', (["(exportPath + '\\\\' + expDevName + '\\\\')"], {}), "(exportPath + '\\\\' + expDevName + '\\\\')\n", (4874, 4913), False, 'import os\n'),... |
# Run a test server.
import argparse
from app import create_app
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Runs BabyNames.')
parser.add_argument('--port', '-p', action='store', default=8000, type=int)
args = parser.parse_args()
app = create_app(debug=True)
app.run(ho... | [
"app.create_app",
"argparse.ArgumentParser"
] | [((106, 160), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Runs BabyNames."""'}), "(description='Runs BabyNames.')\n", (129, 160), False, 'import argparse\n'), ((283, 305), 'app.create_app', 'create_app', ([], {'debug': '(True)'}), '(debug=True)\n', (293, 305), False, 'from app import ... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe, unittest
from frappe.desk.form.linked_with import get_linked_docs, get_linked_doctypes
class TestForm(unittest.TestCase):
def test_linked_with(self):
results = get_linked_docs("Role", "System Manager", ... | [
"unittest.main",
"frappe.desk.form.linked_with.get_linked_doctypes",
"frappe.connect"
] | [((462, 478), 'frappe.connect', 'frappe.connect', ([], {}), '()\n', (476, 478), False, 'import frappe, unittest\n'), ((480, 495), 'unittest.main', 'unittest.main', ([], {}), '()\n', (493, 495), False, 'import frappe, unittest\n'), ((329, 356), 'frappe.desk.form.linked_with.get_linked_doctypes', 'get_linked_doctypes', (... |
from setuptools import setup, find_packages
setup(
name='slack_to_trello',
version='1.0.0',
description='Perform Trello actions via slash commands in Slack',
long_description=open('README.rst').read(),
keywords=[
'slack',
'trello'
],
author='<NAME>',
author_email='<EMAI... | [
"setuptools.find_packages"
] | [((480, 495), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (493, 495), False, 'from setuptools import setup, find_packages\n')] |
from adjacency_list import graph as parentgraph
from collections import deque
class graph(parentgraph):
def bfs(self, root):
queue = deque([root])
visited = [False] * (self.N+1)
visited[root] = True
while queue:
current = queue.popleft()
print(current, end=" ... | [
"collections.deque"
] | [((146, 159), 'collections.deque', 'deque', (['[root]'], {}), '([root])\n', (151, 159), False, 'from collections import deque\n')] |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re, time, pymongo
from utils import load, process_bar as _bar, get_functions as _func
from multiprocessing import Process as _mp, Manager
from utils.load import _lang, _text
import subprocess
from threading import Timer
from drive.gdrive import GoogleDrive as _gd
from ... | [
"telegram.utils.request.Request",
"subprocess.Popen",
"time.strftime",
"telegram.Bot",
"time.sleep",
"utils.get_functions.getIDbypath",
"re.findall",
"utils.process_bar.status",
"pymongo.MongoClient",
"time.localtime",
"time.time",
"re.search"
] | [((439, 631), 'pymongo.MongoClient', 'pymongo.MongoClient', (['f"""{load.cfg[\'database\'][\'db_connect_method\']}://{load.user}:{load.passwd}@{load.cfg[\'database\'][\'db_addr\']}"""'], {'port': "load.cfg['database']['db_port']", 'connect': '(False)'}), '(\n f"{load.cfg[\'database\'][\'db_connect_method\']}://{load... |
from pymoo.algorithms.so_genetic_algorithm import GA
from pymoo.factory import get_problem
from pymoo.optimize import minimize
from initialize import make_field_non_static
from initialize import make_field_static
from initialize import make_method_static_2
from initialize import make_method_non_static_2
problem = get_... | [
"pymoo.algorithms.so_genetic_algorithm.GA",
"pymoo.factory.get_problem",
"pymoo.optimize.minimize"
] | [((316, 421), 'pymoo.factory.get_problem', 'get_problem', (['make_method_non_static_2', 'make_field_non_static', 'make_field_static', 'make_method_static_2'], {}), '(make_method_non_static_2, make_field_non_static,\n make_field_static, make_method_static_2)\n', (327, 421), False, 'from pymoo.factory import get_probl... |
## @package net_builder
# Module caffe2.python.net_builder
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core, context
from caffe2.python.task import Task, TaskGroup
@context.define_contex... | [
"caffe2.python.task.Cluster",
"caffe2.python.context.define_context",
"caffe2.python.core.Net",
"caffe2.python.task.TaskGroup.current",
"caffe2.python.core.to_execution_step",
"caffe2.python.task.Node",
"caffe2.python.task.TaskGroup"
] | [((299, 323), 'caffe2.python.context.define_context', 'context.define_context', ([], {}), '()\n', (321, 323), False, 'from caffe2.python import core, context\n'), ((5128, 5142), 'caffe2.python.task.Cluster', 'task.Cluster', ([], {}), '()\n', (5140, 5142), False, 'from caffe2.python import task\n'), ((11677, 11705), 'ca... |
import re
import json
import sys
import os
args = sys.argv
if (len(args) < 2):
sys.exit(1)
path = args[1]
if(path[-1:] == "/"):
path = path[:-1]
result_filedata_list_all = []
target_filepath_list = []
target_filepath_list.append('/0/stdout.txt')
for target_filepath in target_filepath_list:
filepath = pa... | [
"os.path.getsize",
"json.dumps",
"os.path.isfile",
"sys.exit",
"json.load"
] | [((84, 95), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (92, 95), False, 'import sys\n'), ((1370, 1388), 'json.dumps', 'json.dumps', (['result'], {}), '(result)\n', (1380, 1388), False, 'import json\n'), ((361, 385), 'os.path.isfile', 'os.path.isfile', (['filepath'], {}), '(filepath)\n', (375, 385), False, 'import ... |
import numpy as np
from PIL import Image
from io import BytesIO
import base64
import copy
from ImageProcessor import ImageProcessor
class Car(object):
def __init__(self, control_function):
self._driver = None
self._control_function = control_function
def register(self, driver):
self.... | [
"copy.copy",
"base64.b64decode"
] | [((1215, 1235), 'copy.copy', 'copy.copy', (['dashboard'], {}), '(dashboard)\n', (1224, 1235), False, 'import copy\n'), ((788, 824), 'base64.b64decode', 'base64.b64decode', (["dashboard['image']"], {}), "(dashboard['image'])\n", (804, 824), False, 'import base64\n')] |
"""
Command-line utility for opening the aperture tool.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "<NAME>"
from sarpy_apps.apps.aperture_tool.aperture_tool import main
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
description="Open the aperture tool with opt... | [
"sarpy_apps.apps.aperture_tool.aperture_tool.main",
"argparse.ArgumentParser"
] | [((243, 387), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Open the aperture tool with optional input file."""', 'formatter_class': 'argparse.RawTextHelpFormatter'}), "(description=\n 'Open the aperture tool with optional input file.', formatter_class=\n argparse.RawTextHelpForma... |
from PIL import Image
import os
import shutil
import sys
basewidth = 720
baseheight = 540
path = sys.argv[1]
if path[-1] != os.path.sep:
path += os.path.sep
for filename in os.listdir(path):
if not os.path.isdir(os.path.join(path, filename)):
base, extension = os.path.splitext(filename)
old_n... | [
"os.listdir",
"PIL.Image.open",
"os.path.join",
"os.path.splitext",
"shutil.copy"
] | [((180, 196), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (190, 196), False, 'import os\n'), ((280, 306), 'os.path.splitext', 'os.path.splitext', (['filename'], {}), '(filename)\n', (296, 306), False, 'import os\n'), ((326, 354), 'os.path.join', 'os.path.join', (['path', 'filename'], {}), '(path, filename)\... |
# -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Date: 2021/6/16 15:18
Desc: 国证指数
http://www.cnindex.com.cn/index.html
"""
import pandas as pd
import requests
def index_cni_all() -> pd.DataFrame:
"""
国证指数-所有指数
http://www.cnindex.com.cn/zh_indices/sese/index.html?act_menu=1&index_type=-1
:return: 国证指数-... | [
"pandas.DataFrame",
"requests.get",
"pandas.read_excel"
] | [((522, 554), 'requests.get', 'requests.get', (['url'], {'params': 'params'}), '(url, params=params)\n', (534, 554), False, 'import requests\n'), ((594, 633), 'pandas.DataFrame', 'pd.DataFrame', (["data_json['data']['rows']"], {}), "(data_json['data']['rows'])\n", (606, 633), True, 'import pandas as pd\n'), ((1752, 178... |
from typing import Union, Tuple
from duration import Duration
class Transition:
# Initialization and instance variables
def __init__(self, source: str, destination: str, sgate: str = None, dgate: str = None, distribution: Union[dict, int] = 0) -> None:
self.source = source
self.source_gate = s... | [
"duration.Duration"
] | [((423, 445), 'duration.Duration', 'Duration', (['distribution'], {}), '(distribution)\n', (431, 445), False, 'from duration import Duration\n')] |
#!/usr/bin/python
"""
(C) Copyright 2018-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import os
from command_utils_base import CommandFailure
from test_utils_container import TestContainer
from pydaos.raw import str_to_c_uuid, DaosContainer, DaosObj, IORequest
from ior_test_base import Ior... | [
"data_mover_utils.DsyncCommand",
"data_mover_utils.ContClone",
"pydaos.raw.IORequest",
"re.search",
"data_mover_utils.FsCopy",
"ctypes.c_uint",
"data_mover_utils.DserializeCommand",
"pydaos.raw.DaosContainer",
"ctypes.c_size_t",
"general_utils.create_string_buffer",
"data_mover_utils.Ddeserializ... | [((10414, 10436), 'os.path.join', 'join', (['parent', 'dir_name'], {}), '(parent, dir_name)\n', (10418, 10436), False, 'from os.path import join\n'), ((14335, 14362), 'pydaos.raw.DaosContainer', 'DaosContainer', (['pool.context'], {}), '(pool.context)\n', (14348, 14362), False, 'from pydaos.raw import str_to_c_uuid, Da... |
from math import log10
import os
import json
# Взята тестовая папка с большим оличеством файлов, что бы их не тащить в гит
# в рабочем варианте заменить следующую строку на
# SEARCH_DIR = os.getcwd()
SEARCH_DIR = '/Users/vadim/Library/Mobile Documents/iCloud~md~obsidian/Documents/Knowledge'
res_dict = {}
for root, d... | [
"os.path.getsize",
"os.walk",
"os.path.join",
"os.path.split",
"math.log10",
"json.dump"
] | [((334, 353), 'os.walk', 'os.walk', (['SEARCH_DIR'], {}), '(SEARCH_DIR)\n', (341, 353), False, 'import os\n'), ((1005, 1043), 'json.dump', 'json.dump', (['res_dict', 'f'], {'sort_keys': '(True)'}), '(res_dict, f, sort_keys=True)\n', (1014, 1043), False, 'import json\n'), ((445, 469), 'os.path.join', 'os.path.join', (['... |
# labplus mPython library
# MIT license; Copyright (c) 2018 labplus
# V1.0 <NAME>(<EMAIL>)
# mpython buildin periphers drivers
# history:
# V1.1 add oled draw function,add buzz.freq(). by tangliufeng
# V1.2 add servo/ui class,by tangliufeng
from machine import I2C, PWM, Pin, ADC, TouchPad, UART
from ssd1106 import... | [
"array.array",
"ustruct.unpack",
"esp.flash_read",
"machine.Pin",
"time.sleep_ms",
"network.WLAN"
] | [((19659, 19686), 'machine.Pin', 'Pin', (['(0)', 'Pin.IN', 'Pin.PULL_UP'], {}), '(0, Pin.IN, Pin.PULL_UP)\n', (19662, 19686), False, 'from machine import I2C, PWM, Pin, ADC, TouchPad, UART\n'), ((19698, 19725), 'machine.Pin', 'Pin', (['(2)', 'Pin.IN', 'Pin.PULL_UP'], {}), '(2, Pin.IN, Pin.PULL_UP)\n', (19701, 19725), F... |
# coding: utf-8
"""
FINBOURNE Honeycomb Web API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 1.9.129
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as... | [
"luminesce.configuration.Configuration.get_default_copy",
"six.iteritems",
"inspect.getargspec"
] | [((5671, 5704), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (5684, 5704), False, 'import six\n'), ((2181, 2213), 'luminesce.configuration.Configuration.get_default_copy', 'Configuration.get_default_copy', ([], {}), '()\n', (2211, 2213), False, 'from luminesce.configuration ... |
import sys, os
if '..' not in sys.path:
sys.path.append('..')
import subprocess
import pickle, multiprocessing, copy
import pandas as pd
import numpy as np
from collections import namedtuple, defaultdict
import botorch.utils.transforms as transforms
import argparse
from lib.calibrationFunctions import (
pdict_... | [
"lib.distributions.CovidDistributions",
"multiprocessing.cpu_count",
"lib.calibrationFunctions.extract_seeds_from_summary",
"copy.deepcopy",
"sys.exit",
"sys.path.append",
"pandas.to_datetime",
"lib.calibrationFunctions.downsample_cases",
"os.path.exists",
"argparse.ArgumentParser",
"lib.calibra... | [((1085, 1458), 'collections.namedtuple', 'namedtuple', (['"""Simulation"""', "('experiment_info', 'simulation_info', 'start_date', 'end_date', 'sim_days',\n 'country', 'area', 'random_repeats', 'mob_settings_file', 'full_scale',\n 'measure_list', 'testing_params', 'store_mob', 'model_params',\n 'distributions... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__author__ = 'AJay'
__mtime__ = '2019/4/15 0015'
"""
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import time
import threading
from datetime import datetime
import tkinter as tk
import os
from db import MongoArticle,MongoUrl,MongoConfig
from multiprocessing impor... | [
"tkinter.LabelFrame",
"multiprocessing.JoinableQueue",
"souhu.souhu_new.SouhuSpider",
"db.MongoArticle",
"tkinter.Button",
"tkinter.Label",
"os.path.exists",
"tkinter.Entry",
"tkinter.StringVar",
"os.system",
"tkinter.messagebox.showinfo",
"tkinter.Menu",
"tkinter.messagebox.showerror",
"e... | [((13279, 13328), 'datetime.datetime.strptime', 'datetime.strptime', (['over_time', '"""%Y-%m-%d %H:%M:%S"""'], {}), "(over_time, '%Y-%m-%d %H:%M:%S')\n", (13296, 13328), False, 'from datetime import datetime\n'), ((13339, 13353), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (13351, 13353), False, 'from d... |
#!/usr/bin/env python
from distutils.core import setup
setup(
name="Las Parser",
version="1.2",
description="Parsed data in las file",
author="<NAME>",
author_email="<EMAIL>",
packages=["lasp"]
)
| [
"distutils.core.setup"
] | [((57, 204), 'distutils.core.setup', 'setup', ([], {'name': '"""Las Parser"""', 'version': '"""1.2"""', 'description': '"""Parsed data in las file"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'packages': "['lasp']"}), "(name='Las Parser', version='1.2', description=\n 'Parsed data in las file', au... |
import unittest
from zeppos_csv.csv_file import CsvFile
from tests.util_for_testing import UtilForTesting
from zeppos_bcpy.sql_configuration import SqlConfiguration
import os
from zeppos_logging.app_logger import AppLogger
import pandas as pd
from pandas._testing import assert_frame_equal
class TestProjectMethods(unit... | [
"tests.util_for_testing.UtilForTesting.file_clean_up",
"os.path.exists",
"pandas.DataFrame",
"pandas.read_csv",
"zeppos_bcpy.sql_configuration.SqlConfiguration",
"os.path.splitext",
"zeppos_csv.csv_file.CsvFile",
"pandas._testing.assert_frame_equal",
"unittest.main",
"zeppos_logging.app_logger.App... | [((8957, 8972), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8970, 8972), False, 'import unittest\n'), ((365, 395), 'tests.util_for_testing.UtilForTesting.file_clean_up', 'UtilForTesting.file_clean_up', ([], {}), '()\n', (393, 395), False, 'from tests.util_for_testing import UtilForTesting\n'), ((429, 459), 'te... |
import threading
import time
def coding():
the_thread = threading.current_thread()
for x in range(3):
print('%s正在写代码...' % the_thread.name)
time.sleep(1)
def drawing():
the_thread = threading.current_thread()
for x in range(3):
print('%s正在画图...' % the_thread.name)
time.s... | [
"threading.Thread",
"threading.current_thread",
"time.sleep"
] | [((61, 87), 'threading.current_thread', 'threading.current_thread', ([], {}), '()\n', (85, 87), False, 'import threading\n'), ((211, 237), 'threading.current_thread', 'threading.current_thread', ([], {}), '()\n', (235, 237), False, 'import threading\n'), ((356, 398), 'threading.Thread', 'threading.Thread', ([], {'targe... |
import os
import django
DEBUG = True
USE_TZ = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "<KEY>"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'OPTIONS': {
}
}
}
if os.environ.get('GITHUB_WORK... | [
"os.environ.get"
] | [((293, 333), 'os.environ.get', 'os.environ.get', (['"""GITHUB_WORKFLOW"""', '(False)'], {}), "('GITHUB_WORKFLOW', False)\n", (307, 333), False, 'import os\n'), ((357, 400), 'os.environ.get', 'os.environ.get', (['"""DATABASE_ENGINE"""', '"""sqlite"""'], {}), "('DATABASE_ENGINE', 'sqlite')\n", (371, 400), False, 'import... |
from rest_framework import generics
from rest_framework.response import Response
from rest_framework.reverse import reverse
from .models import Drone, DroneCategory, Pilot, Competition
from .serializers import (DroneCategorySerializer,
DroneSerializer,
PilotSerializer... | [
"django_filters.AllValuesFilter",
"django_filters.NumberFilter",
"django_filters.DateTimeFilter",
"rest_framework.reverse.reverse"
] | [((861, 934), 'django_filters.DateTimeFilter', 'DateTimeFilter', ([], {'field_name': '"""distance_achievement_date"""', 'lookup_expr': '"""gte"""'}), "(field_name='distance_achievement_date', lookup_expr='gte')\n", (875, 934), False, 'from django_filters import AllValuesFilter, DateTimeFilter, NumberFilter, FilterSet\n... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | [
"qiskit.dagcircuit.DAGCircuit"
] | [((2156, 2168), 'qiskit.dagcircuit.DAGCircuit', 'DAGCircuit', ([], {}), '()\n', (2166, 2168), False, 'from qiskit.dagcircuit import DAGCircuit\n')] |
from PIL import Image
template = Image.new('P', (16, 16), '#AF7CAA')
template = template.convert('PA')
oldimage = Image.open("./template/block.png").convert('PA')
oldimage.putpalette(template.getpalette())
oldimage = oldimage.convert('RGBA')
oldimage.show() | [
"PIL.Image.new",
"PIL.Image.open"
] | [((34, 69), 'PIL.Image.new', 'Image.new', (['"""P"""', '(16, 16)', '"""#AF7CAA"""'], {}), "('P', (16, 16), '#AF7CAA')\n", (43, 69), False, 'from PIL import Image\n'), ((115, 149), 'PIL.Image.open', 'Image.open', (['"""./template/block.png"""'], {}), "('./template/block.png')\n", (125, 149), False, 'from PIL import Imag... |
#!/usr/bin/env python
import numpy
def abserror(a, b):
return numpy.abs(a - b)
def relerror(a, b):
return abserror(a, b) / max(numpy.abs(a), numpy.abs(b))
def eq(a, b, e):
if type(a) == numpy.ndarray:
return all(abserror(a, b) < e)
return abserror(a, b) < e
if __name__ == '__main__':
... | [
"numpy.abs"
] | [((69, 85), 'numpy.abs', 'numpy.abs', (['(a - b)'], {}), '(a - b)\n', (78, 85), False, 'import numpy\n'), ((140, 152), 'numpy.abs', 'numpy.abs', (['a'], {}), '(a)\n', (149, 152), False, 'import numpy\n'), ((154, 166), 'numpy.abs', 'numpy.abs', (['b'], {}), '(b)\n', (163, 166), False, 'import numpy\n')] |
from core import Core
class Tx:
def __init__(self):
self.core = Core()
tx = Tx()
| [
"core.Core"
] | [((77, 83), 'core.Core', 'Core', ([], {}), '()\n', (81, 83), False, 'from core import Core\n')] |
__author__ = 'mnowotka'
import warnings
from tastypie.exceptions import InvalidSortError
from collections import OrderedDict
import re
import time
import logging
import itertools
from urllib.parse import unquote
from tastypie import http
from tastypie.exceptions import BadRequest
from tastypie.exceptions import Unsup... | [
"logging.getLogger",
"django.core.exceptions.MultipleObjectsReturned",
"sys.exc_info",
"tastypie.http.HttpNotFound",
"re.search",
"django.utils.cache.patch_cache_control",
"elasticsearch.Elasticsearch",
"tastypie.http.HttpNoContent",
"django.utils.cache.patch_vary_headers",
"django.core.exceptions... | [((2111, 2216), 'elasticsearch.Elasticsearch', 'Elasticsearch', ([], {'hosts': '[settings.ELASTICSEARCH_CONNECTION_URL]', 'connection_class': 'RequestsHttpConnection'}), '(hosts=[settings.ELASTICSEARCH_CONNECTION_URL],\n connection_class=RequestsHttpConnection)\n', (2124, 2216), False, 'from elasticsearch import Ela... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats
import windtools.util as util
class Weibull(object):
def __init__(self, data, ws_field='ws', wd_field='wd', wd_bin_size=30, ws_bin_size=1, prepare_data=True):
self.data = pd.DataFrame(data)
self.dat... | [
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"pandas.notnull",
"numpy.arange",
"numpy.mean",
"pandas.pivot_table",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"pandas.DataFrame",
"scipy.stats.weibull_min.fit",
"numpy.ceil",
"matplotlib.pyplot.savefig",
"os.path.dirname",
"matplotlib... | [((3520, 3543), 'numpy.ceil', 'np.ceil', (['(sp_n / sp_rows)'], {}), '(sp_n / sp_rows)\n', (3527, 3543), True, 'import numpy as np\n'), ((285, 303), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (297, 303), True, 'import pandas as pd\n'), ((663, 763), 'windtools.util.load_data', 'util.load_data', ([],... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 17 09:52:39 2018
@author: saintlyvi
"""
import pandas as pd
import os
from .support import results_dir
def joinResults(searchterm):
mod = pd.DataFrame()
p = os.path.join(results_dir,'classification_results')
for file in os.listdir(p):... | [
"pandas.DataFrame",
"os.listdir",
"os.path.join",
"pandas.concat"
] | [((216, 230), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (228, 230), True, 'import pandas as pd\n'), ((239, 290), 'os.path.join', 'os.path.join', (['results_dir', '"""classification_results"""'], {}), "(results_dir, 'classification_results')\n", (251, 290), False, 'import os\n'), ((306, 319), 'os.listdir', '... |
##
# Copyright (c) 2006-2017 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
"os.path.exists",
"json.loads",
"collections.namedtuple",
"twext.python.log.Logger",
"psutil.cpu_times",
"twisted.internet.task.LoopingCall",
"os.rename",
"json.dumps",
"psutil.virtual_memory",
"datetime.datetime.now",
"collections.defaultdict",
"psutil.cpu_count",
"calendarserver.logAnalysi... | [((1330, 1338), 'twext.python.log.Logger', 'Logger', ([], {}), '()\n', (1336, 1338), False, 'from twext.python.log import Logger\n'), ((21291, 21344), 'collections.namedtuple', 'collections.namedtuple', (['"""CPUStats"""', "('total', 'idle')"], {}), "('CPUStats', ('total', 'idle'))\n", (21313, 21344), False, 'import co... |
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sb
from smoothing_actions import *
N_simul = 150
def complete_ss(beta, b0, x0, A, C, S_y, T=12):
"""
Computes the path of consumption and debt for the previously described
complete markets model where exogenous income follows a linear
... | [
"numpy.eye",
"numpy.ones",
"seaborn.color_palette",
"numpy.squeeze",
"numpy.array",
"numpy.random.randint",
"numpy.random.seed",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((1195, 1244), 'numpy.squeeze', 'np.squeeze', (['(S_y @ rm @ x_hist - cbar / (1 - beta))'], {}), '(S_y @ rm @ x_hist - cbar / (1 - beta))\n', (1205, 1244), True, 'import numpy as np\n'), ((1454, 1519), 'numpy.array', 'np.array', (['[[1.0, 0.0, 0.0], [alpha, rho1, rho2], [0.0, 1.0, 0.0]]'], {}), '([[1.0, 0.0, 0.0], [al... |
from __future__ import print_function
import sys
from coffea import lookup_tools
import uproot
from coffea.util import awkward
from coffea.util import numpy as np
import pytest
from dummy_distributions import dummy_jagged_eta_pt, dummy_four_momenta
def jetmet_evaluator():
from coffea.lookup_tools import extrac... | [
"coffea.jetmet_tools.JetResolution",
"numpy.random.exponential",
"numpy.sin",
"numpy.full_like",
"dummy_distributions.dummy_four_momenta",
"numpy.empty",
"coffea.util.awkward.JaggedArray",
"numpy.abs",
"coffea.jetmet_tools.FactorizedJetCorrector",
"dummy_distributions.dummy_jagged_eta_pt",
"coff... | [((338, 349), 'coffea.lookup_tools.extractor', 'extractor', ([], {}), '()\n', (347, 349), False, 'from coffea.lookup_tools import extractor\n'), ((1755, 1776), 'dummy_distributions.dummy_jagged_eta_pt', 'dummy_jagged_eta_pt', ([], {}), '()\n', (1774, 1776), False, 'from dummy_distributions import dummy_jagged_eta_pt, d... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from gym import spaces
from habi... | [
"habitat_baselines.common.utils.Flatten",
"torch.nn.GroupNorm",
"torch.nn.ReLU",
"numpy.prod",
"torch.nn.Embedding",
"habitat_baselines.common.utils.ResizeCenterCropper",
"torch.nn.init.constant_",
"torch.nn.Sequential",
"habitat_baselines.rl.models.rnn_state_encoder.RNNStateEncoder",
"torch.sin",... | [((1278, 1314), 'habitat_baselines.common.utils.ResizeCenterCropper', 'ResizeCenterCropper', ([], {'size': '(256, 256)'}), '(size=(256, 256))\n', (1297, 1314), False, 'from habitat_baselines.common.utils import Flatten, ResizeCenterCropper\n'), ((2202, 2238), 'habitat_baselines.common.utils.ResizeCenterCropper', 'Resiz... |
from zeit.cms.workflow.interfaces import IPublish
from zope.cachedescriptors.property import Lazy as cachedproperty
import argparse
import datetime
import logging
import requests
import zeit.cms.cli
import zeit.cms.interfaces
import zeit.content.text.text
import zeit.sourcepoint.interfaces
import zope.app.appsetup.prod... | [
"logging.getLogger",
"argparse.ArgumentParser",
"requests.get",
"datetime.datetime.now",
"zeit.cms.workflow.interfaces.IPublish"
] | [((354, 381), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (371, 381), False, 'import logging\n'), ((2842, 2867), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2865, 2867), False, 'import argparse\n'), ((1277, 1355), 'requests.get', 'requests.get', (['self.url... |
"""
inheritance-diagram:: dfo.optimizer.direct
:parts: 1
"""
from misc.debug import DbgMsgOut, DbgMsg
from .base import BoxConstrainedOptimizer
from numpy import max, min, abs, array
import numpy as np
import heapq
__all__ = ['Cube', 'DIRECT']
class Cube(object):
def __init__(self, x, f, depth):
se... | [
"numpy.ones",
"numpy.array",
"heapq.heappop",
"numpy.min",
"heapq.heappush",
"misc.debug.DbgMsgOut"
] | [((327, 335), 'numpy.array', 'array', (['x'], {}), '(x)\n', (332, 335), False, 'from numpy import max, min, abs, array\n'), ((1727, 1766), 'misc.debug.DbgMsgOut', 'DbgMsgOut', (['"""DIRECT"""', '"""Resetting DIRECT"""'], {}), "('DIRECT', 'Resetting DIRECT')\n", (1736, 1766), False, 'from misc.debug import DbgMsgOut, Db... |
import dataclasses
from connect.eaas.dataclasses import (
CapabilitiesPayload,
ConfigurationPayload,
from_dict,
Message,
MessageType,
parse_message,
TaskPayload,
)
def test_from_dict():
data = {
'capabilities': {'test': 'data'},
'variables': [],
'readme_url': '... | [
"connect.eaas.dataclasses.parse_message",
"connect.eaas.dataclasses.from_dict",
"dataclasses.asdict"
] | [((435, 471), 'connect.eaas.dataclasses.from_dict', 'from_dict', (['CapabilitiesPayload', 'data'], {}), '(CapabilitiesPayload, data)\n', (444, 471), False, 'from connect.eaas.dataclasses import CapabilitiesPayload, ConfigurationPayload, from_dict, Message, MessageType, parse_message, TaskPayload\n'), ((1186, 1209), 'co... |
from datadog import DogStatsd # type: ignore
import jsonschema # type: ignore
import logging
import time
from cdc.utils.logging import LoggerAdapter
from cdc.utils.registry import Configuration
logger = LoggerAdapter(logging.getLogger(__name__))
METRIC_PREFIX = "cdc"
class Stats:
MESSAGE_FLUSHED_METRIC = ... | [
"logging.getLogger",
"jsonschema.validate",
"time.time",
"datadog.DogStatsd"
] | [((223, 250), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (240, 250), False, 'import logging\n'), ((457, 782), 'jsonschema.validate', 'jsonschema.validate', (['configuration', "{'type': 'object', 'properties': {'host': {'type': 'string'}, 'port': {\n 'type': 'integer'}, 'message_sam... |
import argparse
import atexit
import crc16
import serial
import sys
import time
import threading
import traceback
magicpacket = [0xde, 0xad, 0xbe, 0xef]
parser = argparse.ArgumentParser()
parser.add_argument("-p", "--port", help="Serial port name")
parser.add_argument("-b", "--baud", help="Baud rate for serial port",... | [
"argparse.ArgumentParser",
"traceback.print_tb",
"time.sleep",
"crc16.crc16xmodem",
"sys.stderr.write",
"sys.exc_info",
"serial.Serial",
"threading.Thread",
"sys.stdout.flush",
"sys.__excepthook__",
"sys.stdout.write"
] | [((164, 189), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (187, 189), False, 'import argparse\n'), ((3209, 3276), 'serial.Serial', 'serial.Serial', ([], {'port': 'portname', 'baudrate': 'baud', 'rtscts': '(True)', 'timeout': '(3)'}), '(port=portname, baudrate=baud, rtscts=True, timeout=3)\n'... |
import base64
import six
from google.protobuf.message import Message
from google.protobuf.descriptor import FieldDescriptor
__all__ = ["protobuf_to_dict", "TYPE_CALLABLE_MAP", "dict_to_protobuf",
"REVERSE_TYPE_CALLABLE_MAP"]
EXTENSION_CONTAINER = '___X'
TYPE_CALLABLE_MAP = {
Field... | [
"base64.b64encode",
"base64.b64decode"
] | [((2966, 2989), 'base64.b64decode', 'base64.b64decode', (['value'], {}), '(value)\n', (2982, 2989), False, 'import base64\n'), ((1100, 1119), 'base64.b64encode', 'base64.b64encode', (['b'], {}), '(b)\n', (1116, 1119), False, 'import base64\n')] |
#!/usr/bin/env python3
import ntpath
import lvsfunc as lvf
from acsuite import eztrim
path = f'BDMV/AKUDWAFTER/BDMV/STREAM/00002.m2ts'
src = lvf.src(path)
if __name__ == "__main__":
# Twice because there's both a 2.0 and a 5.1 track
eztrim(src, (24, -24), f"{path[:-5]}_1.wav", f"{ntpath.basename(__file__)[3:... | [
"lvsfunc.src",
"ntpath.basename"
] | [((143, 156), 'lvsfunc.src', 'lvf.src', (['path'], {}), '(path)\n', (150, 156), True, 'import lvsfunc as lvf\n'), ((292, 317), 'ntpath.basename', 'ntpath.basename', (['__file__'], {}), '(__file__)\n', (307, 317), False, 'import ntpath\n'), ((390, 415), 'ntpath.basename', 'ntpath.basename', (['__file__'], {}), '(__file_... |
# coding=utf-8
import cv2
from detection import Detector
from recoginition import Recognizer
class LPR(Detector, Recognizer):
def __init__(self, model_detection, model_finemapping, model_seq_rec):
Detector.__init__(self, model_detection, model_finemapping)
Recognizer.__init__(self, model_seq_rec)... | [
"detection.Detector.__init__",
"cv2.imread",
"recoginition.Recognizer.__init__"
] | [((761, 809), 'cv2.imread', 'cv2.imread', (['"""./test_images/test_detection_1.jpg"""'], {}), "('./test_images/test_detection_1.jpg')\n", (771, 809), False, 'import cv2\n'), ((212, 271), 'detection.Detector.__init__', 'Detector.__init__', (['self', 'model_detection', 'model_finemapping'], {}), '(self, model_detection, ... |
#!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
"common.color.Format",
"collections.OrderedDict",
"compiler.expr_translate.QL.BasisFunctions",
"copy.deepcopy"
] | [((1699, 1724), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (1722, 1724), False, 'import collections\n'), ((25882, 25901), 'copy.deepcopy', 'copy.deepcopy', (['rule'], {}), '(rule)\n', (25895, 25901), False, 'import copy\n'), ((5573, 5598), 'collections.OrderedDict', 'collections.OrderedDict... |
#!/usr/bin/env python
import base64
import os
from flask import Flask
from flask import request
import json
import requests
import logging
import sys
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
app = Flask(__name__)
opa_url = os.environ.get("OPA_ADDR", "http://localhost:8181")
policy_path = os.envi... | [
"logging.basicConfig",
"flask.Flask",
"json.dumps",
"os.environ.get",
"base64.b64decode",
"logging.info",
"flask.request.headers.get"
] | [((153, 212), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stderr', 'level': 'logging.DEBUG'}), '(stream=sys.stderr, level=logging.DEBUG)\n', (172, 212), False, 'import logging\n'), ((220, 235), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (225, 235), False, 'from flask import Flask... |
"""
---------------------------------------------------------------------
-- Author: <NAME>
---------------------------------------------------------------------
Main file to execute the model on the MNIST dataset
"""
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import argparse
import rando... | [
"torch.utils.data.sampler.SubsetRandomSampler",
"torch.manual_seed",
"argparse.ArgumentParser",
"matplotlib.use",
"random.seed",
"numpy.random.seed",
"torch.utils.data.DataLoader",
"torch.cuda.manual_seed",
"torchvision.transforms.ToTensor",
"numpy.random.permutation"
] | [((238, 259), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (252, 259), False, 'import matplotlib\n'), ((662, 741), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch Implementation of DGM Clustering"""'}), "(description='PyTorch Implementation of DGM Clusteri... |
# -*- coding: utf-8 -*-
"""
Plex Movie Agent Mapper
"""
import os
import re
import logging
from pathlib import Path
import sqlite3
from plexmovieagentmapper import dbcopy
from plexmovieagentmapper import media
class PlexMovieAgentMapper:
def __init__(self, plex_db=None, copy_db=True, debug=False):
... | [
"logging.basicConfig",
"sqlite3.connect",
"pathlib.Path",
"plexmovieagentmapper.media.Media",
"os.path.isfile",
"plexmovieagentmapper.dbcopy.DbCopy"
] | [((640, 732), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(levelname)s:%(message)s"""', 'level': 'logging.INFO'}), "(format='%(asctime)s %(levelname)s:%(message)s', level=\n logging.INFO)\n", (659, 732), False, 'import logging\n'), ((5220, 5249), 'os.path.isfile', 'os.path.isfile',... |
# Copyright 2018 Google LLC
#
# 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, ... | [
"kubernetes.client.V1EnvVar",
"collections.OrderedDict",
"inspect.stack",
"kfp.pipeline_spec.pipeline_spec_pb2.PipelineTaskSpec",
"kfp.dsl._pipeline_param.extract_pipelineparams_from_any",
"kfp.dsl.dsl_utils.sanitize_task_name",
"kfp.dsl.dsl_utils.sanitize_component_name",
"kfp.pipeline_spec.pipeline_... | [((2438, 2537), 'kfp.components._components._resolve_command_line_and_paths', '_components._resolve_command_line_and_paths', ([], {'component_spec': 'component_spec', 'arguments': 'arguments'}), '(component_spec=component_spec,\n arguments=arguments)\n', (2481, 2537), False, 'from kfp.components import _components\n... |
# -*- coding: utf-8 -*-
# @Time : 2019/10/8 22:14
# @Author : Run
# @File : for_excel.py
# @Software : PyCharm
from pyexcelerate import Workbook, Color
import pandas as pd
import datetime
from RunToolkit.for_file import *
def title2num(s: str) -> int:
"""
LeetCode 171: Excel Sheet Column Number
... | [
"pyexcelerate.Color",
"pandas.ExcelWriter",
"pyexcelerate.Workbook"
] | [((1460, 1470), 'pyexcelerate.Workbook', 'Workbook', ([], {}), '()\n', (1468, 1470), False, 'from pyexcelerate import Workbook, Color\n'), ((2071, 2094), 'pyexcelerate.Color', 'Color', (['(210)', '(210)', '(210)', '(0)'], {}), '(210, 210, 210, 0)\n', (2076, 2094), False, 'from pyexcelerate import Workbook, Color\n'), (... |
#!/usr/bin/env python
# coding=utf-8
"""Distribution configuration."""
import os
from setuptools import find_packages, setup
import versioneer
REQUIREMENTS_PATH = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'requirements.txt'
)
setup(
name='synchronization_service',
author='EPAM Syste... | [
"os.path.abspath",
"versioneer.get_cmdclass",
"setuptools.find_packages",
"versioneer.get_version"
] | [((200, 225), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (215, 225), False, 'import os\n'), ((427, 523), 'setuptools.find_packages', 'find_packages', ([], {'where': '"""src"""', 'include': "['synchronization_service', 'synchronization_service.*']"}), "(where='src', include=['synchronizati... |
"""
Test __repr__ of modeling elements.
"""
import unittest
import andes
import contextlib
class TestRepr(unittest.TestCase):
"""Test __repr__"""
def setUp(self):
self.ss = andes.run(andes.get_case("ieee14/ieee14_linetrip.xlsx"),
no_output=True,
... | [
"contextlib.redirect_stdout",
"andes.get_case"
] | [((202, 247), 'andes.get_case', 'andes.get_case', (['"""ieee14/ieee14_linetrip.xlsx"""'], {}), "('ieee14/ieee14_linetrip.xlsx')\n", (216, 247), False, 'import andes\n'), ((490, 522), 'contextlib.redirect_stdout', 'contextlib.redirect_stdout', (['None'], {}), '(None)\n', (516, 522), False, 'import contextlib\n')] |
import json
import argparse
import re
import copy
from pprint import pprint
obj_id = {
'primaryOutcome': {'label':'pri', 'count':0},
'secondaryOutcome': {'label':'sec', 'count':0},
'otherOutcome': {'label':'oth', 'count':0},
'exploratoryOutcome': {'label':'exp', 'count':0},
'inc... | [
"copy.deepcopy"
] | [((466, 487), 'copy.deepcopy', 'copy.deepcopy', (['obj_id'], {}), '(obj_id)\n', (479, 487), False, 'import copy\n')] |
"""
backend/scoreboard/models.py
Scoreboard data models
"""
from django.contrib import admin
from django.db import models
class KattisHandle(models.Model):
"""Kattis handle can be subscribed or unsubscribed
- it has many Kattis scores
- TODO: it (may) belongs to a user
"""
handle = models.CharFie... | [
"django.db.models.Index",
"django.db.models.FloatField",
"django.db.models.ForeignKey",
"django.contrib.admin.site.register",
"django.db.models.BooleanField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((1957, 1990), 'django.contrib.admin.site.register', 'admin.site.register', (['KattisHandle'], {}), '(KattisHandle)\n', (1976, 1990), False, 'from django.contrib import admin\n'), ((306, 337), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50)\n', (322, 337), False, 'from ... |
import attr
from tfont.util.tracker import obj_setattr
from time import time
from typing import Optional, Union
@attr.s(cmp=False, repr=False, slots=True)
class Anchor:
x: Union[int, float] = attr.ib()
y: Union[int, float] = attr.ib()
name: str = attr.ib(default="")
_parent: Optional[object] = attr.i... | [
"tfont.util.tracker.obj_setattr",
"attr.s",
"time.time",
"attr.ib"
] | [((115, 156), 'attr.s', 'attr.s', ([], {'cmp': '(False)', 'repr': '(False)', 'slots': '(True)'}), '(cmp=False, repr=False, slots=True)\n', (121, 156), False, 'import attr\n'), ((198, 207), 'attr.ib', 'attr.ib', ([], {}), '()\n', (205, 207), False, 'import attr\n'), ((235, 244), 'attr.ib', 'attr.ib', ([], {}), '()\n', (... |
"""Encryption functions."""
import os
import secrets
from cryptography import x509
from jwcrypto.jwe import JWE
from jwcrypto.jwk import JWK
from .util import Util
class Enc:
@classmethod
def encrypt(cls, path_to_certificate, message):
"""Return JWE.
Args:
path_to_certif... | [
"jwcrypto.jwk.JWK",
"jwcrypto.jwe.JWE"
] | [((640, 645), 'jwcrypto.jwk.JWK', 'JWK', ([], {}), '()\n', (643, 645), False, 'from jwcrypto.jwk import JWK\n'), ((1451, 1456), 'jwcrypto.jwk.JWK', 'JWK', ([], {}), '()\n', (1454, 1456), False, 'from jwcrypto.jwk import JWK\n'), ((1522, 1527), 'jwcrypto.jwe.JWE', 'JWE', ([], {}), '()\n', (1525, 1527), False, 'from jwcr... |
from typing import Optional, Text
import sys
import json
import argparse
import onnx
from torch.utils.data import DataLoader
from torchvision.datasets.folder import ImageFolder
from torchvision.datasets import ImageNet
import furiosa_sdk_quantizer.frontend.onnx
from furiosa_sdk_quantizer.evaluator.data_loader import... | [
"torchvision.datasets.ImageNet",
"argparse.ArgumentParser",
"furiosa_sdk_quantizer.evaluator.data_loader.random_subset",
"onnx_model_exporter.models.registry.model_entrypoint",
"onnx.load_model",
"torchvision.datasets.folder.ImageFolder",
"furiosa_sdk_quantizer.evaluator.model_caller.ModelCaller",
"on... | [((2264, 2303), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'add_help': '(False)'}), '(add_help=False)\n', (2287, 2303), False, 'import argparse\n'), ((2541, 2580), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'add_help': '(False)'}), '(add_help=False)\n', (2564, 2580), False, 'import arg... |
#!/usr/bin/env python
import config
import crypto
import lora
import math
import os
import sys
import time
# Import data from the kit, must add local directory.
envPath = '.env'
pwd = os.environ['PWD']
if '/safebox' in pwd:
envPath = '../.env'
pwd = '../'
sys.path.insert(0, pwd)
#mailbox number variable
boxN... | [
"lora.recv",
"kit.pubsub.publish",
"sys.path.insert",
"kit.env.load",
"lora.send_lock",
"lora.close",
"lora.init",
"crypto.get_checksum",
"time.sleep",
"kit.pubsub.subscribe",
"kit.logger.info",
"lora.packet_str",
"kit.pubsub.get_message",
"lora.send",
"lora.send_status",
"kit.pubsub.u... | [((266, 289), 'sys.path.insert', 'sys.path.insert', (['(0)', 'pwd'], {}), '(0, pwd)\n', (281, 289), False, 'import sys\n'), ((588, 601), 'kit.pubsub.unsubscribe', 'unsubscribe', ([], {}), '()\n', (599, 601), False, 'from kit.pubsub import get_message, subscribe, unsubscribe, publish\n'), ((606, 618), 'lora.close', 'lor... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from .base_model import BaseModel
from .resnet_s2d import resnet50
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.mul",
"math.ceil",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.arange",
"torch.nn.Upsample",
"torch.nn.functional.interpolate",
"torch.zeros",
"torch.zeros_like",
"torch.clamp",
"torch.cat"
] | [((246, 335), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_planes', 'out_planes'], {'kernel_size': '(3)', 'stride': 'stride', 'padding': '(1)', 'bias': '(False)'}), '(in_planes, out_planes, kernel_size=3, stride=stride, padding=1,\n bias=False)\n', (255, 335), True, 'import torch.nn as nn\n'), ((1440, 1468), 'torch.nn.Batc... |
import pytest
from pytest_django.asserts import assertContains, assertNotContains
@pytest.mark.django_db
def test_search_view_summary(client):
# Search based on summary should return two posts
response = client.get('/search/', {'query': 'normal'})
assert response.status_code == 200
assertContains(res... | [
"pytest_django.asserts.assertNotContains",
"pytest_django.asserts.assertContains"
] | [((302, 333), 'pytest_django.asserts.assertContains', 'assertContains', (['response', '"""One"""'], {}), "(response, 'One')\n", (316, 333), False, 'from pytest_django.asserts import assertContains, assertNotContains\n'), ((338, 369), 'pytest_django.asserts.assertContains', 'assertContains', (['response', '"""Two"""'], ... |