code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import cv2
import matplotlib.pyplot as plt
import numpy as np
from pathlib import Path
import scipy.io
from scipy import optimize
from feature_func import *
from preprocess import *
from utils import *
def fit_data(gt_count, feature_data, function):
return optimize.curve_fit(function, feature_data, gt_count)
d... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.legend",
"numpy.power",
"scipy.optimize.curve_fit",
"cv2.imread",
"pathlib.Path"
] | [((264, 316), 'scipy.optimize.curve_fit', 'optimize.curve_fit', (['function', 'feature_data', 'gt_count'], {}), '(function, feature_data, gt_count)\n', (282, 316), False, 'from scipy import optimize\n'), ((378, 431), 'matplotlib.pyplot.scatter', 'plt.scatter', (['feature_data', 'gt_count'], {'label': '"""raw data"""'})... |
# Code for parallelization of the sensitivity analysis.
# This is accompanied by para.sh
import sys
import pandas as pd
from model import RegionModel
def run(i):
'''
performs a single simulation of a system
'''
m = RegionModel(int_trade, *df.iloc[i, 1:7])
for k in range(max_steps):
m.s... | [
"pandas.read_csv",
"model.RegionModel"
] | [((664, 686), 'pandas.read_csv', 'pd.read_csv', (['"""out.csv"""'], {}), "('out.csv')\n", (675, 686), True, 'import pandas as pd\n'), ((233, 273), 'model.RegionModel', 'RegionModel', (['int_trade', '*df.iloc[i, 1:7]'], {}), '(int_trade, *df.iloc[i, 1:7])\n', (244, 273), False, 'from model import RegionModel\n')] |
from scorebot.db import db_api, db_utils
from scorebot.triggers.triggers_base import TeamTrigger, GroupOfTeamTriggers
team_triggers = {
db_api.PatchsetProposed.type: GroupOfTeamTriggers(
score_db_api=db_api.PatchsetProposed,
triggers=[
# week
TeamTrigger(
nam... | [
"scorebot.triggers.triggers_base.TeamTrigger"
] | [((288, 488), 'scorebot.triggers.triggers_base.TeamTrigger', 'TeamTrigger', ([], {'name': '"""team_patchset_proposed_for_week1"""', 'get_date_scope': 'db_utils.DateScope.this_week', 'trigger_point': '(50)', 'msg': '"""{owner} making good progress this week, posted their 50th patch-set"""'}), "(name='team_patchset_propo... |
import convergence_experiment
def executables():
return convergence_experiment.executables("Data/hospital_section_player/",
2000)
| [
"convergence_experiment.executables"
] | [((60, 133), 'convergence_experiment.executables', 'convergence_experiment.executables', (['"""Data/hospital_section_player/"""', '(2000)'], {}), "('Data/hospital_section_player/', 2000)\n", (94, 133), False, 'import convergence_experiment\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from keras.models import Sequential, Model
from keras.models import model_from_yaml
import keras.backend as K
from keras.callbacks import Callback
from ..utility.utils import path
def custom_uniform(shape, range=(-1, 1), name=None):
"""
Examp... | [
"numpy.dot",
"numpy.random.uniform",
"keras.models.model_from_yaml",
"keras.models.Sequential"
] | [((415, 465), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': 'min_', 'high': 'max_', 'size': 'shape'}), '(low=min_, high=max_, size=shape)\n', (432, 465), True, 'import numpy as np\n'), ((1139, 1151), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1149, 1151), False, 'from keras.models import Se... |
# -*- coding: utf-8 -*-
# (C) 2017 <NAME>
#
# This file is part of 'open-tamil' package tests
#
# setup the paths
from opentamiltests import *
import tamil.utf8 as utf8
from tamil.tscii import TSCII
import codecs
if PYTHON3:
class long(int):
pass
class Letters(unittest.TestCase):
def test_uyir_mei_sp... | [
"tamil.utf8.get_letters",
"tamil.utf8.classify_letter",
"tamil.utf8.get_letters_iterable",
"tamil.utf8.splitMeiUyir"
] | [((344, 367), 'tamil.utf8.splitMeiUyir', 'utf8.splitMeiUyir', (['u"""ஃ"""'], {}), "(u'ஃ')\n", (361, 367), True, 'import tamil.utf8 as utf8\n'), ((415, 439), 'tamil.utf8.splitMeiUyir', 'utf8.splitMeiUyir', (['u"""ல்"""'], {}), "(u'ல்')\n", (432, 439), True, 'import tamil.utf8 as utf8\n'), ((491, 515), 'tamil.utf8.splitM... |
# Copyright (c) 2007, Enthought, Inc.
# License: BSD Style.
"""
Implementation of an EnumEditor demo for Traits UI
This demo shows each of the four styles of the EnumEditor
Fixme: This only shows the capabilities of the old-style EnumEditor
"""
# Imports:
from enthought.traits.api \
import HasTra... | [
"enthought.traits.ui.api.Item",
"enthought.traits.ui.api.View",
"enthought.traits.api.Enum"
] | [((577, 627), 'enthought.traits.api.Enum', 'Enum', (['"""A-495"""', '"""A-498"""', '"""R-1226"""', '"""TS-17"""', '"""TS-18"""'], {}), "('A-495', 'A-498', 'R-1226', 'TS-17', 'TS-18')\n", (581, 627), False, 'from enthought.traits.api import HasTraits, Enum\n'), ((1108, 1176), 'enthought.traits.ui.api.View', 'View', (['e... |
import numpy as np
import sys
sys.path.insert(0, '..')
from src.utils import *
class LinearRegression:
def __init__(self):
self.params = None
def train(self, X, y, iterations=5000, learning_rate=0.01, display=False):
'''
Input parameters:
X: (mxn) array where m is the number ... | [
"numpy.append",
"numpy.zeros",
"sys.path.insert"
] | [((31, 55), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (46, 55), False, 'import sys\n'), ((511, 536), 'numpy.zeros', 'np.zeros', (['(X.shape[1], 1)'], {}), '((X.shape[1], 1))\n', (519, 536), True, 'import numpy as np\n'), ((558, 574), 'numpy.zeros', 'np.zeros', (['(1, 0)'], {}), '((... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Class that implement draw of rectangles (for bar and line)
It use pygame.draw
methods :
- draw
- update
- resize
"""
import pygame
from .math_tools import PositionMathTool as pmt
from .math_tools import PositionValueObject as pval
class BarNLine:
d... | [
"pygame.mask.from_surface",
"pygame.draw.polygon",
"pygame.Color",
"pygame.Surface"
] | [((1796, 1833), 'pygame.Surface', 'pygame.Surface', (['rect', 'pygame.SRCALPHA'], {}), '(rect, pygame.SRCALPHA)\n', (1810, 1833), False, 'import pygame\n'), ((1908, 1974), 'pygame.draw.polygon', 'pygame.draw.polygon', (['self.surface', 'self.dct[self.color_name]', 'poly'], {}), '(self.surface, self.dct[self.color_name]... |
import warnings
from django.template.loader import render_to_string
from django_cradmin import crsettings
def join_css_classes_list(css_classes_list):
"""
Join the provided list of css classes into a string.
"""
return ' '.join(css_classes_list)
class AbstractRenderable(object):
"""
An ab... | [
"warnings.warn",
"django_cradmin.crsettings.get_setting",
"django_cradmin.templatetags.cradmin_tags.cradmin_test_css_class"
] | [((4234, 4306), 'django_cradmin.crsettings.get_setting', 'crsettings.get_setting', (['"""DJANGO_CRADMIN_INCLUDE_TEST_CSS_CLASSES"""', '(False)'], {}), "('DJANGO_CRADMIN_INCLUDE_TEST_CSS_CLASSES', False)\n", (4256, 4306), False, 'from django_cradmin import crsettings\n'), ((4572, 4750), 'warnings.warn', 'warnings.warn',... |
s = 'Hello Python'
# s.reverse()
print(s[::-1])
print(''.join(reversed(s)))
def reverse_i(s):
r = ''
for c in s:
r = c + r
return r
print(reverse_i(s))
def reverse_r(s):
if len(s) <= 1:
return s
else:
return reverse_r(s[1:]) + s[0]
pri... | [
"collections.deque"
] | [((812, 820), 'collections.deque', 'deque', (['s'], {}), '(s)\n', (817, 820), False, 'from collections import deque\n')] |
import os
from IGitt.GitLab import GitLabOAuthToken
from IGitt.GitLab.GitLab import GitLab
from IGitt.GitLab.GitLabComment import GitLabComment
from IGitt.GitLab.GitLabCommit import GitLabCommit
from IGitt.GitLab.GitLabIssue import GitLabIssue
from IGitt.GitLab.GitLabMergeRequest import GitLabMergeRequest
from IGitt.I... | [
"os.environ.get",
"IGitt.GitLab.GitLab.GitLab._get_repos_with_permissions"
] | [((581, 620), 'os.environ.get', 'os.environ.get', (['"""GITLAB_TEST_TOKEN"""', '""""""'], {}), "('GITLAB_TEST_TOKEN', '')\n", (595, 620), False, 'import os\n'), ((2519, 2558), 'os.environ.get', 'os.environ.get', (['"""GITLAB_TEST_TOKEN"""', '""""""'], {}), "('GITLAB_TEST_TOKEN', '')\n", (2533, 2558), False, 'import os\... |
"""
@brief test tree node (time=5s)
"""
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import add_missing_development_version
class TestReferences(unittest.TestCase):
def test_references(self):
fLOG(
__file__,
self._... | [
"unittest.main",
"pyquickhelper.loghelper.fLOG",
"pyquickhelper.pycode.add_missing_development_version"
] | [((567, 582), 'unittest.main', 'unittest.main', ([], {}), '()\n', (580, 582), False, 'import unittest\n'), ((274, 346), 'pyquickhelper.loghelper.fLOG', 'fLOG', (['__file__', 'self._testMethodName'], {'OutputPrint': "(__name__ == '__main__')"}), "(__file__, self._testMethodName, OutputPrint=__name__ == '__main__')\n", (... |
from collections import deque
import numpy as np
class Logger:
"""Print recorded values."""
def __init__(self, name):
"""
:param name str: identifier for printed value
"""
self.name = name
def __call__(self, value):
print("{}: {}".format(self.name, value))
cla... | [
"numpy.mean",
"collections.deque"
] | [((724, 749), 'collections.deque', 'deque', ([], {'maxlen': 'filter_size'}), '(maxlen=filter_size)\n', (729, 749), False, 'from collections import deque\n'), ((913, 933), 'numpy.mean', 'np.mean', (['self.values'], {}), '(self.values)\n', (920, 933), True, 'import numpy as np\n')] |
from ctypes import *
from helper.types import GoString
import json
class Settings:
def __init__(self, lib):
self.lib = lib
self.lib.GetSettings.argtypes = []
self.lib.GetSettings.restype = c_char_p
def get_settings(self):
ret = self.lib.GetSettings()
return json.loa... | [
"json.loads"
] | [((312, 327), 'json.loads', 'json.loads', (['ret'], {}), '(ret)\n', (322, 327), False, 'import json\n')] |
import numpy as np
import time
import pandas as pd
import matplotlib.pyplot as plt
import random
def karatsuba(x, y):
""" Recursive implementation of Karatsuba's Fast Mulciplication Algoritihm
:param x: The first integer
:param y: The second integer
:return: The product of x * y
"""
if x < 10... | [
"matplotlib.pyplot.show",
"random.randint",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.zeros",
"time.perf_counter",
"numpy.array",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((1572, 1632), 'matplotlib.pyplot.plot', 'plt.plot', (['test_size', 'standard_results'], {'label': '"""python native"""'}), "(test_size, standard_results, label='python native')\n", (1580, 1632), True, 'import matplotlib.pyplot as plt\n'), ((1637, 1694), 'matplotlib.pyplot.plot', 'plt.plot', (['test_size', 'karatsuba_... |
import dlib
import cv2
from os import path
from dataflow import ports
class ObjectDetectorOpencv:
def __init__(self, model):
self.detector = cv2.CascadeClassifier(model)
self.source_detection = ports.EventSource()
def detect_object(self, img):
detect = self.detector.detectMultiScale(i... | [
"dataflow.ports.EventSource",
"os.path.abspath",
"cv2.CascadeClassifier"
] | [((155, 183), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['model'], {}), '(model)\n', (176, 183), False, 'import cv2\n'), ((216, 235), 'dataflow.ports.EventSource', 'ports.EventSource', ([], {}), '()\n', (233, 235), False, 'from dataflow import ports\n'), ((725, 744), 'dataflow.ports.EventSource', 'ports.EventS... |
#=========================================================================
# VcdGenerationPass_test.py
#=========================================================================
# Perform limited tests on the VCD generation pass. These tests are limited
# in the sense that they do not compare the entire output against ... | [
"pymtl3.passes.TracingConfigs",
"pymtl3.passes.PassGroups.SimulationPass"
] | [((893, 951), 'pymtl3.passes.TracingConfigs', 'TracingConfigs', ([], {'tracing': '"""vcd"""', 'vcd_file_name': 'vcd_file_name'}), "(tracing='vcd', vcd_file_name=vcd_file_name)\n", (907, 951), False, 'from pymtl3.passes import TracingConfigs\n'), ((985, 1001), 'pymtl3.passes.PassGroups.SimulationPass', 'SimulationPass',... |
import click
import sys
from collections import namedtuple
from random import randint
Ctx = namedtuple('Ctx', ['ctl', 'ssh', 'ssh_cfg'])
@click.group()
@click.pass_context
@click.option('--host', default='vdi.nci.org.au', help='Customize vdi login node')
@click.option('--user', help='SSH user name, if not given will... | [
"random.randint",
"click.option",
"click.echo",
"collections.namedtuple",
"click.group",
"sys.exit"
] | [((93, 137), 'collections.namedtuple', 'namedtuple', (['"""Ctx"""', "['ctl', 'ssh', 'ssh_cfg']"], {}), "('Ctx', ['ctl', 'ssh', 'ssh_cfg'])\n", (103, 137), False, 'from collections import namedtuple\n'), ((141, 154), 'click.group', 'click.group', ([], {}), '()\n', (152, 154), False, 'import click\n'), ((176, 262), 'clic... |
import pytest
# test transforming tidb check config to openmetrics check config
from datadog_checks.base.utils.tagging import GENERIC_TAGS
from datadog_checks.tidb import TiDBCheck
from .conftest import EXPECTED_PD, EXPECTED_TIDB, EXPECTED_TIKV
@pytest.mark.unit
def test_create_check_instance_transform(tidb_instanc... | [
"datadog_checks.tidb.TiDBCheck",
"pytest.mark.usefixtures"
] | [((1443, 1484), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""dd_environment"""'], {}), "('dd_environment')\n", (1466, 1484), False, 'import pytest\n'), ((336, 391), 'datadog_checks.tidb.TiDBCheck', 'TiDBCheck', (['"""test_config_transform"""', '{}', '[tidb_instance]'], {}), "('test_config_transform', {},... |
import pytest
from requre.online_replacing import record_requests_for_all_methods
from tests.integration.pagure.base import PagureTests
from ogr.exceptions import OgrException
@record_requests_for_all_methods()
class Service(PagureTests):
def test_project_create(self):
"""
Remove https://pagure.i... | [
"pytest.raises",
"requre.online_replacing.record_requests_for_all_methods"
] | [((180, 213), 'requre.online_replacing.record_requests_for_all_methods', 'record_requests_for_all_methods', ([], {}), '()\n', (211, 213), False, 'from requre.online_replacing import record_requests_for_all_methods\n'), ((2505, 2569), 'pytest.raises', 'pytest.raises', (['OgrException'], {'match': '""".*Namespace doesn\'... |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class JudgementResult:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is... | [
"huaweicloudsdkcore.utils.http_utils.sanitize_for_serialization",
"six.iteritems",
"sys.setdefaultencoding"
] | [((4775, 4808), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (4788, 4808), False, 'import six\n'), ((5793, 5824), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (5815, 5824), False, 'import sys\n'), ((5851, 5883), 'huaweicloudsdkcor... |
import math
import os
from random import random
import psycopg2
import psycopg2.extras
from config.config import config
from models.Club import Club
from models.Player import Player
from models.Position import Position
from models.Tournament import Tournament
from faker import Faker
class FootballDatabase(object):
... | [
"faker.Faker",
"models.Player.Player",
"config.config.config",
"os.path.dirname",
"models.Tournament.Tournament",
"random.random",
"models.Club.Club",
"models.Position.Position",
"psycopg2.extras.execute_values",
"psycopg2.connect"
] | [((1262, 1269), 'faker.Faker', 'Faker', ([], {}), '()\n', (1267, 1269), False, 'from faker import Faker\n'), ((2038, 2045), 'faker.Faker', 'Faker', ([], {}), '()\n', (2043, 2045), False, 'from faker import Faker\n'), ((2620, 2627), 'faker.Faker', 'Faker', ([], {}), '()\n', (2625, 2627), False, 'from faker import Faker\... |
# -*- coding: utf-8 -*-
import requests
import time
import math
import signal
def is_ok(url: str) -> bool:
"""
Returns True if the provided URL responds with a 2XX when fetched via
a HTTP GET request.
"""
try:
resp = requests.get(url)
except:
return False
return True if mat... | [
"signal.signal",
"math.floor",
"time.perf_counter",
"requests.get"
] | [((1250, 1297), 'signal.signal', 'signal.signal', (['signal.SIGTERM', 'handle_interrupt'], {}), '(signal.SIGTERM, handle_interrupt)\n', (1263, 1297), False, 'import signal\n'), ((1316, 1335), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (1333, 1335), False, 'import time\n'), ((247, 264), 'requests.get', ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pylab import *
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import subprocess
#Creacion de la Poblacion
datos = open("Datos/Poblacion.txt","w")
datos.close()
datos = open("Datos/Estados.txt","w")
datos.close()
#genera... | [
"numpy.random.uniform",
"subprocess.Popen",
"numpy.random.choice"
] | [((1379, 1429), 'numpy.random.choice', 'np.random.choice', (['(4)', 'contador'], {'p': '[sano, s, inf, r]'}), '(4, contador, p=[sano, s, inf, r])\n', (1395, 1429), True, 'import numpy as np\n'), ((1529, 1578), 'subprocess.Popen', 'subprocess.Popen', (["[sys.executable, 'src/mapa.py']"], {}), "([sys.executable, 'src/map... |
# This file is compatible with both Python 2 and 3
import base64
import cv2
import json
import numpy as np
from flask import Response
import time
import functools
from collections import deque
class Stream(deque):
"""
A stream stores an output sequence stream of data. It inherits from deque.
Stream conta... | [
"numpy.stack",
"numpy.argmax",
"numpy.isfinite",
"numpy.argmin",
"json.dumps",
"numpy.isnan",
"time.sleep",
"functools.wraps"
] | [((2501, 2526), 'functools.wraps', 'functools.wraps', (['data2msg'], {}), '(data2msg)\n', (2516, 2526), False, 'import functools\n'), ((3907, 3928), 'json.dumps', 'json.dumps', (['send_dict'], {}), '(send_dict)\n', (3917, 3928), False, 'import json\n'), ((5582, 5603), 'numpy.argmin', 'np.argmin', (['ys'], {'axis': '(0)... |
import os
import json
local_path = os.path.dirname(__file__)
def load_config_file(path):
file = open(os.path.join(local_path, os.pardir, path))
return json.load(file)
def load_loc():
return load_config_file('config/loc.json')
def load_responses_config():
return load_config_file('config/responses.... | [
"os.path.dirname",
"json.load",
"os.path.join"
] | [((36, 61), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (51, 61), False, 'import os\n'), ((162, 177), 'json.load', 'json.load', (['file'], {}), '(file)\n', (171, 177), False, 'import json\n'), ((531, 546), 'json.load', 'json.load', (['file'], {}), '(file)\n', (540, 546), False, 'import jso... |
from __future__ import unicode_literals, absolute_import
from django.contrib.auth import get_user_model
from django.test import TestCase
from django_functest import FuncWebTestMixin, ShortcutLoginMixin
User = get_user_model()
class WebTestBase(FuncWebTestMixin, ShortcutLoginMixin, TestCase):
@classmethod
d... | [
"django.contrib.auth.get_user_model"
] | [((212, 228), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (226, 228), False, 'from django.contrib.auth import get_user_model\n')] |
import unittest
from typing import Sequence, Iterable, cast, Mapping
import tempfile
import os
import numpy as np
import joblib
from hypothesis import given, note
from hypothesis import settings, strategies as st
from scilk.corpora import genia
from scilk.util import intervals
from scilk.collections import _collectio... | [
"unittest.main",
"scilk.collections._collections.Collection.load",
"tempfile.TemporaryDirectory",
"hypothesis.strategies.characters",
"joblib.dump",
"hypothesis.note",
"scilk.collections._collections.Collection",
"hypothesis.settings",
"scilk.corpora.genia._segment_borders",
"hypothesis.strategies... | [((386, 436), 'hypothesis.strategies.characters', 'st.characters', ([], {'min_codepoint': '(32)', 'max_codepoint': '(255)'}), '(min_codepoint=32, max_codepoint=255)\n', (399, 436), True, 'from hypothesis import settings, strategies as st\n'), ((699, 727), 'joblib.load', 'joblib.load', (["data['mapping']"], {}), "(data[... |
import os
import logging
import argparse
import sys
from .controllers.hot_lobs import HotLobMonitor
from .controllers.cold_lobs import ColdLobMonitor
if __name__ == "__main__":
# Check for config file
if "PROJECT_LOB_CONFIG" not in os.environ:
print("PROJECT_LOB_CONFIG must be an environment variable ... | [
"argparse.ArgumentParser",
"logging.FileHandler",
"logging.StreamHandler",
"logging.Formatter",
"sys.exit",
"logging.getLogger"
] | [((484, 509), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (507, 509), False, 'import argparse\n'), ((1169, 1201), 'logging.getLogger', 'logging.getLogger', (['"""project_lob"""'], {}), "('project_lob')\n", (1186, 1201), False, 'import logging\n'), ((1246, 1284), 'logging.FileHandler', 'loggi... |
import math
from math import pi,sqrt,radians,degrees
import sys
g=9.8
G=6.67e-11
e=1.6021917e-19
ke=8.9875e9
me=9.1095e-31
mp=1.67261e-27
mn=1.674929e-27
blocked=["exec","sys","eval","PROCESS","CMD","RESULT","block","import","math","from",]
def sin(deg):
return math.sin(radians(deg))
def cos(deg):
return mat... | [
"math.atan",
"math.asin",
"math.radians",
"math.acos",
"sys.exc_info"
] | [((278, 290), 'math.radians', 'radians', (['deg'], {}), '(deg)\n', (285, 290), False, 'from math import pi, sqrt, radians, degrees\n'), ((326, 338), 'math.radians', 'radians', (['deg'], {}), '(deg)\n', (333, 338), False, 'from math import pi, sqrt, radians, degrees\n'), ((374, 386), 'math.radians', 'radians', (['deg'],... |
from autokeras.generator import DefaultClassifierGenerator
from autokeras.utils import *
from tests.common import get_processed_data
def test_model_trainer():
model = DefaultClassifierGenerator(3, (28, 28, 3)).generate().produce_model()
train_data, test_data = get_processed_data()
ModelTrainer(model, tra... | [
"autokeras.generator.DefaultClassifierGenerator",
"tests.common.get_processed_data"
] | [((272, 292), 'tests.common.get_processed_data', 'get_processed_data', ([], {}), '()\n', (290, 292), False, 'from tests.common import get_processed_data\n'), ((174, 216), 'autokeras.generator.DefaultClassifierGenerator', 'DefaultClassifierGenerator', (['(3)', '(28, 28, 3)'], {}), '(3, (28, 28, 3))\n', (200, 216), False... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Create new point. Synchonize with layer and file
-------------------
begin : 2018-07-11
git sha : $Format:%H$
author ... | [
"PyQt4.QtGui.QCursor"
] | [((769, 792), 'PyQt4.QtGui.QCursor', 'QCursor', (['Qt.CrossCursor'], {}), '(Qt.CrossCursor)\n', (776, 792), False, 'from PyQt4.QtGui import QCursor\n')] |
import unittest
from credential import Credential
class TestCredential(unittest.TestCase):
"""
Test class that defines test cases for the credential class behavioursself.
Args:
unittest.TestCase:TestCase class that helps in creating test cases
"""
def setUp(self):
"""
Set ... | [
"unittest.main",
"credential.Credential.password",
"credential.Credential",
"credential.Credential.display_credentials"
] | [((2048, 2063), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2061, 2063), False, 'import unittest\n'), ((407, 451), 'credential.Credential', 'Credential', (['"""Twitter"""', '"""Davidngatia"""', '"""4321"""'], {}), "('Twitter', 'Davidngatia', '4321')\n", (417, 451), False, 'from credential import Credential\n')... |
import platform
import sys
from setuptools import setup
if platform.python_implementation() == 'CPython':
try:
import wheel.bdist_wheel
except ImportError:
cmdclass = {}
else:
class bdist_wheel(wheel.bdist_wheel.bdist_wheel):
def finalize_options(self) -> None:
... | [
"platform.python_implementation",
"setuptools.setup"
] | [((495, 572), 'setuptools.setup', 'setup', ([], {'cffi_modules': "['editdistance_s_build.py:ffibuilder']", 'cmdclass': 'cmdclass'}), "(cffi_modules=['editdistance_s_build.py:ffibuilder'], cmdclass=cmdclass)\n", (500, 572), False, 'from setuptools import setup\n'), ((61, 93), 'platform.python_implementation', 'platform.... |
import smtplib
from email.message import EmailMessage
def send_mail(mail: str, name: str):
user = ''
password = ''
text="Hello " + name + ", \n your account has been created succesfully"
msg = EmailMessage()
msg.set_content(text)
msg['Subject'] = "Confirmation"
msg['From'] = ""
msg['To... | [
"email.message.EmailMessage",
"smtplib.SMTP"
] | [((211, 225), 'email.message.EmailMessage', 'EmailMessage', ([], {}), '()\n', (223, 225), False, 'from email.message import EmailMessage\n'), ((338, 359), 'smtplib.SMTP', 'smtplib.SMTP', (['""""""', '(465)'], {}), "('', 465)\n", (350, 359), False, 'import smtplib\n')] |
# Copyright (c) 2014, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from cybox.common import Contributor
from cybox.test import EntityTestCase
class TestContributor(EntityTestCase, unittest.TestCase):
klass = Contributor
_full_dict = {
'role': "Le... | [
"unittest.main"
] | [((672, 687), 'unittest.main', 'unittest.main', ([], {}), '()\n', (685, 687), False, 'import unittest\n')] |
"""
This script prints out the commands to delete all files generated by a pipeline,
downstream of a specified stage.
If one stage was wrong, and you need to re-run everything it affected, this script
will print out the commands to delete the relevant files to that re-running the pipeline
with resume=True will re-run ... | [
"sys.path.append",
"collections.defaultdict",
"ceci.Pipeline",
"ceci.PipelineStage.get_stage"
] | [((355, 375), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (370, 375), False, 'import sys\n'), ((655, 692), 'ceci.Pipeline', 'ceci.Pipeline', (["config['stages']", 'None'], {}), "(config['stages'], None)\n", (668, 692), False, 'import ceci\n'), ((847, 876), 'collections.defaultdict', 'collections... |
from jaraco.windows import security
def test_get_security_attributes_for_user():
security.get_security_attributes_for_user()
| [
"jaraco.windows.security.get_security_attributes_for_user"
] | [((87, 130), 'jaraco.windows.security.get_security_attributes_for_user', 'security.get_security_attributes_for_user', ([], {}), '()\n', (128, 130), False, 'from jaraco.windows import security\n')] |
#!/usr/bin/env python3
'''
SPDX-License-Identifier: BSD-2-Clause
Copyright 2017 Massachusetts Institute of Technology.
'''
import asyncio
import json
import yaml
try:
from yaml import CSafeLoader as SafeLoader, CSafeDumper as SafeDumper
except ImportError:
from yaml import SafeLoader as SafeLoader, SafeDumper... | [
"yaml.load",
"json.loads",
"tornado.httpclient.AsyncHTTPClient",
"tornado.httpclient.HTTPRequest"
] | [((490, 518), 'tornado.httpclient.AsyncHTTPClient', 'httpclient.AsyncHTTPClient', ([], {}), '()\n', (516, 518), False, 'from tornado import httpclient, platform\n'), ((806, 884), 'tornado.httpclient.HTTPRequest', 'httpclient.HTTPRequest', ([], {'url': 'url', 'method': 'method', 'ssl_options': 'context', 'body': 'data'}... |
from unittest import TestCase
from authlib.oauth2.rfc7591 import ClientMetadataClaims
from authlib.jose.errors import InvalidClaimError
class ClientMetadataClaimsTest(TestCase):
def test_validate_redirect_uris(self):
claims = ClientMetadataClaims({'redirect_uris': ['foo']}, {})
self.assertRaises(I... | [
"authlib.oauth2.rfc7591.ClientMetadataClaims"
] | [((240, 292), 'authlib.oauth2.rfc7591.ClientMetadataClaims', 'ClientMetadataClaims', (["{'redirect_uris': ['foo']}", '{}'], {}), "({'redirect_uris': ['foo']}, {})\n", (260, 292), False, 'from authlib.oauth2.rfc7591 import ClientMetadataClaims\n'), ((413, 460), 'authlib.oauth2.rfc7591.ClientMetadataClaims', 'ClientMetad... |
# Copyright 2020 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | [
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.utils.timezone.now",
"ckeditor.fields.RichTextField",
"django.db.models.DateTimeField"
] | [((822, 853), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50)\n', (838, 853), False, 'from django.db import models\n'), ((872, 916), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'blank': '(True)'}), '(max_length=100, blank=True)\n', (888... |
import os
from pathlib import Path
from unittest import mock
from kabuka import kabuka, get_latest_price
TEST_DATA_DIR = Path(os.path.dirname(os.path.realpath(__file__))) / "test_data"
def test_is_numeric():
assert not kabuka.is_numeric("abc")
assert not kabuka.is_numeric("123a")
assert not kabuka.is_num... | [
"unittest.mock.patch",
"kabuka.get_latest_price",
"os.path.realpath",
"kabuka.kabuka.is_numeric"
] | [((1401, 1460), 'unittest.mock.patch', 'mock.patch', (['"""requests.get"""'], {'side_effect': 'mocked_requests_get'}), "('requests.get', side_effect=mocked_requests_get)\n", (1411, 1460), False, 'from unittest import mock\n'), ((612, 636), 'kabuka.kabuka.is_numeric', 'kabuka.is_numeric', (['"""123"""'], {}), "('123')\n... |
"""empty message
Revision ID: f24691273ca4
Revises: <PASSWORD>
Create Date: 2019-06-18 13:45:46.250079
"""
# revision identifiers, used by Alembic.
revision = 'f24691273ca4'
down_revision = 'b<PASSWORD>'
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - p... | [
"alembic.op.drop_table",
"sqlalchemy.VARCHAR",
"sqlalchemy.INTEGER",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.String",
"sqlalchemy.Integer"
] | [((790, 811), 'alembic.op.drop_table', 'op.drop_table', (['"""user"""'], {}), "('user')\n", (803, 811), False, 'from alembic import op\n'), ((1551, 1573), 'alembic.op.drop_table', 'op.drop_table', (['"""users"""'], {}), "('users')\n", (1564, 1573), False, 'from alembic import op\n'), ((745, 779), 'sqlalchemy.PrimaryKey... |
import numpy as np
from mpi4py import MPI
from SIMP import TO_SIMP, make_Conn_matrix
def get_void(nely,nelx):
v=np.zeros((nely,nelx))
R=min(nely,nelx)/15
loc=np.array([[1/3, 1/4], [2/3, 1/4],[ 1/3, 1/2], [2/3, 1/2], [1/3 , 3/4], [2/3, 3/4]])
loc=loc*np.array([[nely,nelx]])
for i in range(nely):
... | [
"numpy.save",
"numpy.ceil",
"SIMP.make_Conn_matrix",
"numpy.zeros",
"numpy.mean",
"numpy.array",
"numpy.random.rand"
] | [((1080, 1108), 'SIMP.make_Conn_matrix', 'make_Conn_matrix', (['nelx', 'nely'], {}), '(nelx, nely)\n', (1096, 1108), False, 'from SIMP import TO_SIMP, make_Conn_matrix\n'), ((1206, 1223), 'numpy.zeros', 'np.zeros', (['perrank'], {}), '(perrank)\n', (1214, 1223), True, 'import numpy as np\n'), ((1240, 1257), 'numpy.zero... |
import time
from datetime import date
from spydr.spydr import Spydr
from urllib.parse import urlparse
target_url = input("Enter the URL to crawl:\t")
start_time = time.time()
domain_file_name = urlparse(target_url).netloc.replace(".", "_")
result = Spydr().crawl(target_url)
end_time = time.time()
print(f"\n{len(... | [
"spydr.spydr.Spydr",
"datetime.date.today",
"urllib.parse.urlparse",
"time.time"
] | [((166, 177), 'time.time', 'time.time', ([], {}), '()\n', (175, 177), False, 'import time\n'), ((292, 303), 'time.time', 'time.time', ([], {}), '()\n', (301, 303), False, 'import time\n'), ((254, 261), 'spydr.spydr.Spydr', 'Spydr', ([], {}), '()\n', (259, 261), False, 'from spydr.spydr import Spydr\n'), ((198, 218), 'u... |
from typing import Tuple
import numpy as np
from sklearn.model_selection import train_test_split
from tensorflow.keras.datasets import mnist
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.utils import to_categorical
class MNIST:
def __init__(self, with_normali... | [
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.keras.utils.to_categorical",
"sklearn.model_selection.train_test_split",
"numpy.zeros",
"numpy.expand_dims",
"tensorflow.keras.datasets.mnist.load_data",
"numpy.random.randint",
"numpy.concatenate"
] | [((398, 415), 'tensorflow.keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()\n', (413, 415), False, 'from tensorflow.keras.datasets import mnist\n'), ((749, 781), 'numpy.expand_dims', 'np.expand_dims', (['x_train'], {'axis': '(-1)'}), '(x_train, axis=-1)\n', (763, 781), True, 'import numpy as np\n'), ((9... |
#!/usr/bin/env python
from logzero import logger
from apis import storage
if __name__ == "__main__":
import cli
from config import cfg
cfg.load()
parser = cli.build_parser()
args = cli.parse_args(parser)
parser.add_argument(
"-g",
"--gcs-bucket-prefix",
default=cfg.gcs... | [
"cli.build_parser",
"logzero.logger.info",
"apis.storage.get_client",
"cli.parse_args",
"config.cfg.load"
] | [((150, 160), 'config.cfg.load', 'cfg.load', ([], {}), '()\n', (158, 160), False, 'from config import cfg\n'), ((174, 192), 'cli.build_parser', 'cli.build_parser', ([], {}), '()\n', (190, 192), False, 'import cli\n'), ((204, 226), 'cli.parse_args', 'cli.parse_args', (['parser'], {}), '(parser)\n', (218, 226), False, 'i... |
import os
import math
import json
import uuid
import unittest
import importlib
import subprocess
from unittest import mock
from .. import rules
from .. import config
from .. import helpers
from .. import importer
from .. import constants
from .. import exceptions
from .. import scopes_tree
TEST_FIXTURES_DIR = os.p... | [
"uuid.uuid4",
"importlib.import_module",
"os.path.dirname",
"json.dumps",
"unittest.mock.patch",
"os.path.join"
] | [((329, 354), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (344, 354), False, 'import os\n'), ((4424, 4460), 'importlib.import_module', 'importlib.import_module', (['module_name'], {}), '(module_name)\n', (4447, 4460), False, 'import importlib\n'), ((5424, 5460), 'importlib.import_module', ... |
import os
import time
import re
import unittest
import batch
from flask import Flask, Response, request
import requests
from .serverthread import ServerThread
class Test(unittest.TestCase):
def setUp(self):
self.batch = batch.client.BatchClient(url=os.environ.get('BATCH_URL'))
def test_job(self):
... | [
"flask.Flask",
"time.sleep",
"os.environ.get",
"re.search",
"flask.Response",
"flask.request.get_json"
] | [((4713, 4733), 'flask.Flask', 'Flask', (['"""test-client"""'], {}), "('test-client')\n", (4718, 4733), False, 'from flask import Flask, Response, request\n'), ((1358, 1371), 'time.sleep', 'time.sleep', (['t'], {}), '(t)\n', (1368, 1371), False, 'import time\n'), ((4843, 4861), 'flask.request.get_json', 'request.get_js... |
import logging
from pkg_resources import iter_entry_points
import click
import click_plugins
from . import options
from .. import __version__
_context = dict(
token_normalize_func=lambda x: x.lower(),
help_option_names=['--help', '-h'],
auto_envvar_prefix='TILEZILLA'
)
LOG_FORMAT = '%(asctime)s:%(leveln... | [
"click.version_option",
"click.option",
"click.get_text_stream",
"logging.Formatter",
"click.group",
"pkg_resources.iter_entry_points",
"logging.getLogger"
] | [((477, 556), 'click.group', 'click.group', ([], {'help': '"""tilezilla command line interface"""', 'context_settings': '_context'}), "(help='tilezilla command line interface', context_settings=_context)\n", (488, 556), False, 'import click\n'), ((596, 657), 'click.option', 'click.option', (['"""--verbose"""', '"""-v""... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/datasets/datasets.retailrocket.ipynb (unless otherwise specified).
__all__ = ['RetailRocketDataset', 'RetailRocketDatasetv2']
# Cell
from typing import List, Optional, Callable, Union, Any, Tuple
import os
import os.path as osp
from collections.abc import Sequence
impo... | [
"os.unlink",
"os.path.exists",
"datetime.datetime.strptime",
"pandas.to_datetime",
"datetime.timedelta",
"os.path.join",
"numpy.in1d"
] | [((4482, 4497), 'os.unlink', 'os.unlink', (['path'], {}), '(path)\n', (4491, 4497), False, 'import os\n'), ((5013, 5048), 'pandas.to_datetime', 'pd.to_datetime', (['data.Time'], {'unit': '"""s"""'}), "(data.Time, unit='s')\n", (5027, 5048), True, 'import pandas as pd\n'), ((7368, 7435), 'datetime.datetime.strptime', 'd... |
import unittest
from unittest.mock import patch
from tmc import points
from tmc.utils import load_module, reload_module, get_stdout, sanitize
exercise = 'src.calculator'
def parse_result(output):
if len(output) > 30:
return output[:30] + "..."
else:
return output
#add, multiply,subtract(-)
@p... | [
"unittest.main",
"tmc.utils.get_stdout",
"unittest.mock.patch",
"tmc.utils.reload_module",
"tmc.points",
"tmc.utils.load_module"
] | [((319, 341), 'tmc.points', 'points', (['"""1.calculator"""'], {}), "('1.calculator')\n", (325, 341), False, 'from tmc import points\n'), ((4027, 4042), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4040, 4042), False, 'import unittest\n'), ((438, 479), 'unittest.mock.patch', 'patch', (['"""builtins.input"""'], ... |
from django.contrib import admin
from inventory.models import Group, Host, Data
# Register your models here.
admin.site.register(Host)
admin.site.register(Group)
admin.site.register(Data) | [
"django.contrib.admin.site.register"
] | [((110, 135), 'django.contrib.admin.site.register', 'admin.site.register', (['Host'], {}), '(Host)\n', (129, 135), False, 'from django.contrib import admin\n'), ((136, 162), 'django.contrib.admin.site.register', 'admin.site.register', (['Group'], {}), '(Group)\n', (155, 162), False, 'from django.contrib import admin\n'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.StandardVoucherOpenApiVO import StandardVoucherOpenApiVO
class AlipayBossFncGffundStandardvoucherBatchqueryResponse(AlipayResponse):
def __init__(self):
... | [
"alipay.aop.api.domain.StandardVoucherOpenApiVO.StandardVoucherOpenApiVO.from_alipay_dict"
] | [((1387, 1431), 'alipay.aop.api.domain.StandardVoucherOpenApiVO.StandardVoucherOpenApiVO.from_alipay_dict', 'StandardVoucherOpenApiVO.from_alipay_dict', (['i'], {}), '(i)\n', (1428, 1431), False, 'from alipay.aop.api.domain.StandardVoucherOpenApiVO import StandardVoucherOpenApiVO\n')] |
import pandas as pd
def deal():
# 列表
company_name_list = ['12312', '141', '515', '41']
# list转dataframe
df = pd.DataFrame(company_name_list)
# 保存到本地excel
df.to_csv("company_name_li.csv", index=False)
if __name__ == '__main__':
deal()
| [
"pandas.DataFrame"
] | [((128, 159), 'pandas.DataFrame', 'pd.DataFrame', (['company_name_list'], {}), '(company_name_list)\n', (140, 159), True, 'import pandas as pd\n')] |
import os
import re
import pathlib
from setuptools import setup, find_packages
def get_long_description() -> str:
"""Converts relative repository links to absolute URLs
if GITHUB_REPOSITORY and GITHUB_SHA environment variables exist.
If not, it returns the raw content in README.md.
"""
raw_readm... | [
"os.environ.get",
"pathlib.Path",
"re.sub",
"setuptools.find_packages"
] | [((380, 415), 'os.environ.get', 'os.environ.get', (['"""GITHUB_REPOSITORY"""'], {}), "('GITHUB_REPOSITORY')\n", (394, 415), False, 'import os\n'), ((426, 454), 'os.environ.get', 'os.environ.get', (['"""GITHUB_SHA"""'], {}), "('GITHUB_SHA')\n", (440, 454), False, 'import os\n'), ((588, 640), 're.sub', 're.sub', (['"""]\... |
# coding:utf-8
# @Time : 2019/5/15
# @Author : xuyouze
# @File Name : base_model.py
import importlib
import os
from abc import ABC, abstractmethod
from collections import OrderedDict
import torch
from torch import nn
from config.base_config import BaseConfig
from networks import *
class BaseModel(... | [
"torch.load",
"torch.FloatTensor",
"collections.OrderedDict",
"torch.no_grad",
"os.path.join"
] | [((1919, 1932), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1930, 1932), False, 'from collections import OrderedDict\n'), ((3766, 3781), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3779, 3781), False, 'import torch\n'), ((2512, 2555), 'os.path.join', 'os.path.join', (['self.save_path', 'save_f... |
"""This module contains functions for converting LaTeX and Markdown files"""
import string
import random
import os
import multiprocessing
import time
from markdown import markdown
import pdfkit
MAX_WAIT_TIME = 3
POLLING_RATE = 10
def try_create_tempdir():
os.makedirs(os.getcwd() + "/TEMP", exist_ok=True)
def... | [
"os.getcwd",
"os.system",
"random.choice",
"markdown.markdown",
"time.sleep",
"multiprocessing.Pipe",
"pdfkit.from_string",
"multiprocessing.Process"
] | [((1493, 1520), 'multiprocessing.Pipe', 'multiprocessing.Pipe', (['(False)'], {}), '(False)\n', (1513, 1520), False, 'import multiprocessing\n'), ((1532, 1601), 'multiprocessing.Process', 'multiprocessing.Process', ([], {'target': '__run_pdflatex', 'args': '(code, send_end)'}), '(target=__run_pdflatex, args=(code, send... |
#!/usr/bin/env python
import sys
print_lines = False
with open("jniproxy.c", "r") as f:
for line in f:
if line.strip().endswith("*/"):
sys.exit(0);
if print_lines:
print(line[4:-1])
elif line.strip().startswith("/*"):
print_lines = True
| [
"sys.exit"
] | [((161, 172), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (169, 172), False, 'import sys\n')] |
#!/usr/bin/env python
# ------------------------------------------------------------------------------------------------------%
# Created by "Thieu" at 17:40, 06/11/2021 %
# ... | [
"numpy.abs",
"mealpy.bio_based.SMA.BaseSMA"
] | [((1451, 1510), 'mealpy.bio_based.SMA.BaseSMA', 'SMA.BaseSMA', (['problem_dict1'], {'epoch': '(100)', 'pop_size': '(50)', 'pr': '(0.03)'}), '(problem_dict1, epoch=100, pop_size=50, pr=0.03)\n', (1462, 1510), False, 'from mealpy.bio_based import SMA\n'), ((987, 1001), 'numpy.abs', 'np.abs', (['(x + 10)'], {}), '(x + 10)... |
#!/usr/bin/python
from config import config
import commonFunctions
import datetime
import traceback
import httplib
import json
import sys
import logging
from time import sleep
logging.basicConfig(level=config.get_logging_level(),
format=config.runtime_variables['log_format'],
... | [
"commonFunctions.save_sunrise_data",
"commonFunctions.save_temperature_data",
"commonFunctions.save_wind_data",
"commonFunctions.get_from_dic",
"commonFunctions.save_temperature_range_max_data",
"datetime.datetime.utcnow",
"commonFunctions.save_clouds_data",
"logging.error",
"json.loads",
"commonF... | [((425, 473), 'httplib.HTTPSConnection', 'httplib.HTTPSConnection', (["config.open_map['host']"], {}), "(config.open_map['host'])\n", (448, 473), False, 'import httplib\n'), ((902, 922), 'json.loads', 'json.loads', (['jsondata'], {}), '(jsondata)\n', (912, 922), False, 'import json\n'), ((1023, 1070), 'commonFunctions.... |
from keras.utils import multi_gpu_model
import numpy as np
import tensorflow as tf
import pickle
from keras.models import Model, Input
from keras.optimizers import Adam, RMSprop
from keras.layers import Dense
from keras.layers import Conv2D, Conv2DTranspose
from keras.layers import Flatten, Add
from keras.layers impor... | [
"tensorflow.image.ssim",
"numpy.ones",
"keras.models.Model",
"numpy.clip",
"pickle.load",
"numpy.random.randint",
"keras.layers.LeakyReLU",
"keras.utils.multi_gpu_model",
"keras.optimizers.Adam",
"keras.layers.Conv2DTranspose",
"keras.layers.Concatenate",
"tensorflow.random_normal_initializer"... | [((12779, 12832), 'keras.utils.multi_gpu_model', 'multi_gpu_model', (['d_model'], {'gpus': '(4)', 'cpu_relocation': '(True)'}), '(d_model, gpus=4, cpu_relocation=True)\n', (12794, 12832), False, 'from keras.utils import multi_gpu_model\n'), ((12866, 12893), 'keras.optimizers.Adam', 'Adam', ([], {'lr': '(0.0002)', 'beta... |
import argparse
def print_result(args):
# Print results
with open(args.accuracy, 'r') as f:
score = f.read()
print(f"Random forest (accuracy): {score}")
if __name__ == '__main__':
# Defining and parsing the command-line arguments
parser = argparse.ArgumentParser(description='My prog... | [
"argparse.ArgumentParser"
] | [((276, 337), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""My program description"""'}), "(description='My program description')\n", (299, 337), False, 'import argparse\n')] |
from typing import Dict, List
import torch
from functools import partial
from backprop.models import PathModel
from torch.optim.adamw import AdamW
from sentence_transformers import SentenceTransformer
class STModel(PathModel):
"""
Class for models which are initialised from Sentence Transformers
Attribut... | [
"backprop.models.PathModel.__init__",
"functools.partial",
"torch.no_grad"
] | [((1562, 1577), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1575, 1577), False, 'import torch\n'), ((1092, 1126), 'functools.partial', 'partial', (['init_model'], {'device': 'device'}), '(init_model, device=device)\n', (1099, 1126), False, 'from functools import partial\n'), ((1176, 1320), 'backprop.models.Pat... |
from c2nl.tokenizers.code_tokenizer import CodeTokenizer, Tokens, Tokenizer
import argparse
import re
from os import path
import javalang
from pathlib import Path
def get_project_root() -> Path:
"""Returns project root folder."""
return str(Path(__file__).parent.parent.parent)
def get_java_method_map(tree):... | [
"c2nl.tokenizers.code_tokenizer.CodeTokenizer",
"argparse.ArgumentParser",
"os.path.exists",
"javalang.parse.parse",
"pathlib.Path"
] | [((1300, 1325), 'c2nl.tokenizers.code_tokenizer.CodeTokenizer', 'CodeTokenizer', (['(True)', '(True)'], {}), '(True, True)\n', (1313, 1325), False, 'from c2nl.tokenizers.code_tokenizer import CodeTokenizer, Tokens, Tokenizer\n'), ((3111, 3138), 'os.path.exists', 'path.exists', (['java_file_path'], {}), '(java_file_path... |
# -*- coding: utf-8 -*-
from fastapi.routing import APIRouter
from apps.places.views import places
router = APIRouter()
router.include_router(places.router, prefix='/places')
| [
"fastapi.routing.APIRouter"
] | [((111, 122), 'fastapi.routing.APIRouter', 'APIRouter', ([], {}), '()\n', (120, 122), False, 'from fastapi.routing import APIRouter\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the date formatter of the TransmartCopyWriter.
"""
from datetime import datetime, timezone, date
from dateutil.tz import gettz
from transmart_loader.copy_writer import format_date, microseconds
def test_date_serialization():
assert format_date(
d... | [
"dateutil.tz.gettz",
"datetime.date",
"datetime.datetime"
] | [((319, 336), 'datetime.date', 'date', (['(2019)', '(6)', '(28)'], {}), '(2019, 6, 28)\n', (323, 336), False, 'from datetime import datetime, timezone, date\n'), ((386, 439), 'datetime.datetime', 'datetime', (['(2019)', '(6)', '(28)', '(13)', '(2)', '(58)'], {'tzinfo': 'timezone.utc'}), '(2019, 6, 28, 13, 2, 58, tzinfo... |
"""Identity matrix."""
from scipy import sparse
import numpy as np
def iden(dim: int, is_sparse: bool = False) -> np.ndarray:
r"""
Calculate the :code:`dim`-by-:code:`dim` identity matrix [WIKID]_.
Returns the :code:`dim`-by-:code:`dim` identity matrix. If :code:`is_sparse
= False` then the matrix w... | [
"numpy.identity",
"scipy.sparse.eye"
] | [((2041, 2056), 'scipy.sparse.eye', 'sparse.eye', (['dim'], {}), '(dim)\n', (2051, 2056), False, 'from scipy import sparse\n'), ((2084, 2100), 'numpy.identity', 'np.identity', (['dim'], {}), '(dim)\n', (2095, 2100), True, 'import numpy as np\n')] |
# coding:utf-8
# 一个简单的Maya Python插件 By Jason (<EMAIL>), 公众号: WendyAndAndy
import sys
from maya.api import OpenMaya as om
def maya_useNewAPI():
pass
__VENDOR = '<EMAIL> | <EMAIL> | iJasonLee@WeChat'
__VERSION= '2018.08.08.01'
class HelloMaya(om.MPxCommand):
command = 'pyHello'
def __init__(self):
... | [
"sys.stderr.write",
"maya.api.OpenMaya.MFnPlugin"
] | [((534, 572), 'maya.api.OpenMaya.MFnPlugin', 'om.MFnPlugin', (['obj', '__VENDOR', '__VERSION'], {}), '(obj, __VENDOR, __VERSION)\n', (546, 572), True, 'from maya.api import OpenMaya as om\n'), ((781, 819), 'maya.api.OpenMaya.MFnPlugin', 'om.MFnPlugin', (['obj', '__VENDOR', '__VERSION'], {}), '(obj, __VENDOR, __VERSION)... |
"""Routines for processing workouts."""
from typing import Union, Tuple, Optional
from xml.etree.ElementTree import (ElementTree, Element,
SubElement, tostring)
from lark import Lark
from lark import Transformer
class WorkoutTransformer(Transformer):
"""Class to process workout... | [
"xml.etree.ElementTree.ElementTree",
"lark.Lark",
"xml.etree.ElementTree.Element",
"xml.etree.ElementTree.SubElement"
] | [((2381, 3101), 'lark.Lark', 'Lark', (['"""\n workout: block*\n block: [repeats "x"] intervals\n intervals: (ramp|steady_state)~1 ("," (steady_state|ramp))*\n steady_state: durations "@" steady_state_power "%" "FTP"\n ramp: durations "from" ramp_power "%" "FTP"\n ... |
from dataclasses import dataclass
from typing import Optional
@dataclass(frozen=True)
class RegistrantNotRegisteredError(Exception):
"""Raised when registrant name does not exist in the register"""
cls: type
registrant_name: str
register: Optional[dict]
def __post_init__(self):
super()._... | [
"dataclasses.dataclass"
] | [((65, 87), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (74, 87), False, 'from dataclasses import dataclass\n')] |
import requests
SCHEMA_REGISTRY = "http://localhost:8081"
def subjects():
resp = requests.get(
f"{SCHEMA_REGISTRY}/subjects",
headers={"Content-Type": "application/json"}
)
resp.raise_for_status()
return resp.json()
# curl -X DELETE http://localhost:8081/subjects/com.u... | [
"requests.delete",
"requests.get"
] | [((87, 180), 'requests.get', 'requests.get', (['f"""{SCHEMA_REGISTRY}/subjects"""'], {'headers': "{'Content-Type': 'application/json'}"}), "(f'{SCHEMA_REGISTRY}/subjects', headers={'Content-Type':\n 'application/json'})\n", (99, 180), False, 'import requests\n'), ((390, 446), 'requests.delete', 'requests.delete', ([... |
# Copyright L.P.Klyne 2013
# Licenced under 3 clause BSD licence
# $Id: NumericDisplay.py 2696 2008-09-05 09:33:43Z graham.klyne $
#
# Widget class for simple button on a form
#
from urlparse import urljoin
from turbogears.widgets.base import Widget, CompoundWidget, WidgetsList
from turbogears.widgets.forms impor... | [
"urlparse.urljoin"
] | [((421, 468), 'urlparse.urljoin', 'urljoin', (['EventBaseUri', '"""SetNumericDisplayValue"""'], {}), "(EventBaseUri, 'SetNumericDisplayValue')\n", (428, 468), False, 'from urlparse import urljoin\n'), ((499, 546), 'urlparse.urljoin', 'urljoin', (['EventBaseUri', '"""SetNumericDisplayState"""'], {}), "(EventBaseUri, 'Se... |
import faiss
import numpy as np
from sklearn.cluster import KMeans
from sklearn.metrics.cluster import normalized_mutual_info_score
from argparse import ArgumentParser
def parse_args():
"""
Helper function parsing the command line options
@retval ArgumentParser
"""
parser = ArgumentParser(descrip... | [
"numpy.load",
"faiss.GpuIndexFlatL2",
"argparse.ArgumentParser",
"sklearn.cluster.KMeans",
"faiss.Clustering",
"faiss.GpuIndexFlatConfig",
"faiss.StandardGpuResources",
"numpy.unique",
"sklearn.metrics.cluster.normalized_mutual_info_score"
] | [((298, 362), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""PyTorch metric learning nmi script"""'}), "(description='PyTorch metric learning nmi script')\n", (312, 362), False, 'from argparse import ArgumentParser\n'), ((1057, 1074), 'numpy.unique', 'np.unique', (['labels'], {}), '(labels)\n', (... |
import asyncio
import time
import urllib.parse
from typing import Optional, Tuple
from asgiref.typing import WWWScope
def get_remote_addr(transport: asyncio.Transport) -> Optional[Tuple[str, int]]:
socket_info = transport.get_extra_info("socket")
if socket_info is not None:
try:
info = so... | [
"time.monotonic"
] | [((2503, 2519), 'time.monotonic', 'time.monotonic', ([], {}), '()\n', (2517, 2519), False, 'import time\n'), ((2799, 2815), 'time.monotonic', 'time.monotonic', ([], {}), '()\n', (2813, 2815), False, 'import time\n'), ((3093, 3109), 'time.monotonic', 'time.monotonic', ([], {}), '()\n', (3107, 3109), False, 'import time\... |
#!/usr/bin/env python
# $Id$
"""2 solutions"""
import puzzler
from puzzler.puzzles.pentominoes import Pentominoes3x20Loop
puzzler.run(Pentominoes3x20Loop)
| [
"puzzler.run"
] | [((125, 157), 'puzzler.run', 'puzzler.run', (['Pentominoes3x20Loop'], {}), '(Pentominoes3x20Loop)\n', (136, 157), False, 'import puzzler\n')] |
# -*- coding: utf-8 -*-
# @Author: ahpalmerUNR
# @Date: 2020-12-21 14:38:59
# @Last Modified by: ahpalmerUNR
# @Last Modified time: 2021-05-06 23:10:20
import torch
class MouthMusicMouthModel(torch.nn.Module):
def __init__(self):
super(MouthMusicMouthModel,self).__init__()
self.conv1 = torch.nn.Conv2d(3,62,7,... | [
"torch.nn.ReLU",
"torch.load",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.nn.MaxPool2d",
"torch.nn.Sigmoid"
] | [((297, 355), 'torch.nn.Conv2d', 'torch.nn.Conv2d', (['(3)', '(62)', '(7)'], {'stride': '(2)', 'padding': '(3)', 'bias': '(False)'}), '(3, 62, 7, stride=2, padding=3, bias=False)\n', (312, 355), False, 'import torch\n'), ((367, 391), 'torch.nn.BatchNorm2d', 'torch.nn.BatchNorm2d', (['(62)'], {}), '(62)\n', (387, 391), ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import pdb
class SpectrogramModel(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size_cnn, stride_cnn, padding_cnn, kernel_size_pool, stride_pool, hidden_dim, num_layers, dropout_rate, num_labels, batch_size, bidirectional=False)... | [
"torch.mean",
"torch.nn.ReLU",
"torch.unsqueeze",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.cuda.is_available",
"torch.max",
"torch.nn.Linear",
"torch.nn.MaxPool2d"
] | [((1211, 1244), 'torch.nn.BatchNorm2d', 'nn.BatchNorm2d', (['self.out_channels'], {}), '(self.out_channels)\n', (1225, 1244), True, 'import torch.nn as nn\n'), ((1423, 1456), 'torch.nn.BatchNorm2d', 'nn.BatchNorm2d', (['self.out_channels'], {}), '(self.out_channels)\n', (1437, 1456), True, 'import torch.nn as nn\n'), (... |
import os
import numpy as np
import os.path as op
import matplotlib.pyplot as plt
from matplotlib.colors import BASE_COLORS, SymLogNorm
from scipy.stats import ttest_ind
from swann.preprocessing import get_info
from swann.utils import get_config, derivative_fname
from swann.analyses import decompose_tfr, find_bursts,... | [
"numpy.log",
"swann.utils.get_config",
"mne.viz.iter_topography",
"mne.time_frequency.EpochsTFR",
"matplotlib.pyplot.close",
"numpy.median",
"numpy.std",
"numpy.concatenate",
"mne.Epochs",
"os.path.isfile",
"numpy.min",
"numpy.max",
"mne.time_frequency.tfr_morlet",
"swann.analyses.find_bur... | [((2836, 2848), 'swann.utils.get_config', 'get_config', ([], {}), '()\n', (2846, 2848), False, 'from swann.utils import get_config, derivative_fname\n'), ((4064, 4167), 'mne.Epochs', 'Epochs', (['raw', 'events'], {'tmin': "(config['tmin'] - 1)", 'baseline': 'None', 'tmax': "(config['tmax'] + 1)", 'preload': '(True)'}),... |
# -------------------------------------------------------------------------------------------------------------------- #
# Import packages
# -------------------------------------------------------------------------------------------------------------------- #
import numpy as np
from .nurbs_surface import NurbsSurface
... | [
"numpy.shape",
"numpy.zeros"
] | [((2206, 2229), 'numpy.zeros', 'np.zeros', (['(n_dim, n, m)'], {}), '((n_dim, n, m))\n', (2214, 2229), True, 'import numpy as np\n'), ((1681, 1694), 'numpy.shape', 'np.shape', (['P00'], {}), '(P00)\n', (1689, 1694), True, 'import numpy as np\n'), ((1699, 1712), 'numpy.shape', 'np.shape', (['P01'], {}), '(P01)\n', (1707... |
"""Calculates the batch_grad derivative."""
from __future__ import annotations
from typing import TYPE_CHECKING, Callable, List, Tuple
from torch import Tensor
from torch.nn import Module
from backpack.core.derivatives.basederivatives import BaseParameterDerivatives
from backpack.extensions.firstorder.base import Fi... | [
"backpack.utils.subsampling.subsample"
] | [((2870, 2930), 'backpack.utils.subsampling.subsample', 'subsample', (['g_out[0]'], {'dim': 'batch_axis', 'subsampling': 'subsampling'}), '(g_out[0], dim=batch_axis, subsampling=subsampling)\n', (2879, 2930), False, 'from backpack.utils.subsampling import subsample\n')] |
# coding:utf-8
#
def two(words):
"""
:param words:
:return:
"""
new = []
s = len(words)
for index in range(s):
w = words[index]
for next_index in range(index + 1, s):
next_w = words[next_index]
new.append(frozenset([w, next_w]))
return new
poe... | [
"json.dump"
] | [((1466, 1485), 'json.dump', 'json.dump', (['pro', 'out'], {}), '(pro, out)\n', (1475, 1485), False, 'import json\n')] |
import json
import re
from jinja2.loaders import BaseLoader
from werkzeug.datastructures import ImmutableMultiDict
from jinja2.sandbox import ImmutableSandboxedEnvironment
import decimal
from mirrors.common.logger import logger
class DjangoLoader(BaseLoader):
def __init__(self):
pass
def get_source... | [
"traceback.print_exc",
"json.loads",
"mirrors.libs.advance_search.advsearch_visitor.AdvSearchVisitor",
"mirrors.libs.advance_search.parser.Parser.parse",
"mirrors.common.logger.logger.debug",
"mirrors.libs.advance_search.advsearch_visitor.AdvSearchRewriteVisitor",
"re.search",
"re.compile"
] | [((394, 425), 're.compile', 're.compile', (['"""\\\\{\\\\{(.*?)\\\\}\\\\}"""'], {}), "('\\\\{\\\\{(.*?)\\\\}\\\\}')\n", (404, 425), False, 'import re\n'), ((592, 607), 'json.loads', 'json.loads', (['str'], {}), '(str)\n', (602, 607), False, 'import json\n'), ((1787, 1804), 'mirrors.libs.advance_search.parser.Parser.par... |
# <NAME>
import os
import numpy
from get_dataset import get_dataset
from get_model import get_model, save_model
from keras.callbacks import ModelCheckpoint, TensorBoard
epochs = 15
batch_size = 6
def train_model(model, X, X_test, Y, Y_test):
checkpoints = []
if not os.path.exists('Data/Checkpoints/'):
... | [
"get_model.get_model",
"os.makedirs",
"keras.callbacks.ModelCheckpoint",
"os.path.exists",
"get_model.save_model",
"keras.callbacks.TensorBoard",
"get_dataset.get_dataset"
] | [((1485, 1498), 'get_dataset.get_dataset', 'get_dataset', ([], {}), '()\n', (1496, 1498), False, 'from get_dataset import get_dataset\n'), ((1511, 1522), 'get_model.get_model', 'get_model', ([], {}), '()\n', (1520, 1522), False, 'from get_model import get_model, save_model\n'), ((1580, 1597), 'get_model.save_model', 's... |
from hypothesis import HealthCheck
from hypothesis import given, settings
from hypothesis.extra import numpy as hnp
from pytiff import *
import hypothesis.strategies as st
import numpy as np
import pytest
import subprocess
import tifffile
from skimage.data import coffee
def test_write_rgb(tmpdir_factory):
img = co... | [
"numpy.testing.assert_array_equal",
"hypothesis.extra.numpy.integer_dtypes",
"tifffile.TiffFile",
"numpy.dtype",
"numpy.ones",
"hypothesis.extra.numpy.unsigned_integer_dtypes",
"hypothesis.strategies.floats",
"hypothesis.extra.numpy.floating_dtypes",
"hypothesis.settings",
"pytest.raises",
"nump... | [((803, 833), 'hypothesis.settings', 'settings', ([], {'buffer_size': '(11000000)'}), '(buffer_size=11000000)\n', (811, 833), False, 'from hypothesis import given, settings\n'), ((1373, 1403), 'hypothesis.settings', 'settings', ([], {'buffer_size': '(11000000)'}), '(buffer_size=11000000)\n', (1381, 1403), False, 'from ... |
from app.models.report import FacilityReportModel
from tests.v2.views import TCBase
class TestFacilityReport(TCBase):
"""
시설 고장 신고를 테스트합니다.
"""
def __init__(self, *args, **kwargs):
super(TestFacilityReport, self).__init__(*args, **kwargs)
self.method = self.client.post
self.... | [
"app.models.report.FacilityReportModel.objects"
] | [((1209, 1281), 'app.models.report.FacilityReportModel.objects', 'FacilityReportModel.objects', ([], {'id': 'id', 'content': 'self.content', 'room': 'self.room'}), '(id=id, content=self.content, room=self.room)\n', (1236, 1281), False, 'from app.models.report import FacilityReportModel\n')] |
from django.conf.urls import url
from .views import index, food_detail, post_food_comment
urlpatterns = [
url(r'^$', index),
url(r'^food/(?P<food_slug>[-\w]+)$', food_detail),
url(r'^food/(?P<food_slug>[-\w]+)/add_comment$', post_food_comment)
] | [
"django.conf.urls.url"
] | [((112, 128), 'django.conf.urls.url', 'url', (['"""^$"""', 'index'], {}), "('^$', index)\n", (115, 128), False, 'from django.conf.urls import url\n'), ((135, 184), 'django.conf.urls.url', 'url', (['"""^food/(?P<food_slug>[-\\\\w]+)$"""', 'food_detail'], {}), "('^food/(?P<food_slug>[-\\\\w]+)$', food_detail)\n", (138, 1... |
"""
Sandbox and record suppress all records with a concept_id or concept_code relating to Geo Location information.
Original Issue: DC-1385
suppress all records associated with a GeoLocation identifier concepts in PPI vocabulary
The concept_ids to suppress can be determined from the vocabulary with the following reg... | [
"cdr_cleaner.clean_cdr_engine.get_query_list",
"google.cloud.exceptions.GoogleCloudError",
"cdr_cleaner.clean_cdr_engine.clean_dataset",
"cdr_cleaner.args_parser.default_parse_args",
"cdr_cleaner.clean_cdr_engine.add_console_logging",
"utils.pipeline_logging.configure",
"logging.getLogger",
"common.JI... | [((996, 1023), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1013, 1023), False, 'import logging\n'), ((1177, 2109), 'common.JINJA_ENV.from_string', 'JINJA_ENV.from_string', (['"""\nCREATE OR REPLACE TABLE `{{project_id}}.{{sandbox_dataset_id}}.{{lookup_table}}` as(\n WITH\n geoloca... |
#!/usr/bin/env python3
import codecs
from collections import defaultdict
import errno
import json
import os
def tree():
"""
http://recursive-labs.com/blog/2012/05/31/one-line-python-tree-explained/
"""
return defaultdict(tree)
def index_tags():
"""
Iterate through all locally saved JSON fil... | [
"json.dump",
"json.load",
"os.path.realpath",
"collections.defaultdict",
"os.path.join"
] | [((228, 245), 'collections.defaultdict', 'defaultdict', (['tree'], {}), '(tree)\n', (239, 245), False, 'from collections import defaultdict\n'), ((447, 473), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (463, 473), False, 'import os\n'), ((640, 675), 'os.path.join', 'os.path.join', (['SCR... |
from django import template
register = template.Library()
@register.filter
def active_since(region_offers, offer_template):
return region_offers.filter(template=offer_template).first().created_date
| [
"django.template.Library"
] | [((40, 58), 'django.template.Library', 'template.Library', ([], {}), '()\n', (56, 58), False, 'from django import template\n')] |
import numpy as np
def rd(c1, c2):
return np.sqrt((c1[0]-c2[0])**2+(c1[1]-c2[1])**2+(c1[2]-c2[2])**2)
#rbf as global support spline type
#Gaussian Spline
def rbf(r):
return np.exp(-r**2)
#Spline polynomial
def rbf1(r,deg):
return r**deg
# Global
def rbf2(r):
return np.exp(-r**2)
# %% codecell
| [
"numpy.exp",
"numpy.sqrt"
] | [((46, 121), 'numpy.sqrt', 'np.sqrt', (['((c1[0] - c2[0]) ** 2 + (c1[1] - c2[1]) ** 2 + (c1[2] - c2[2]) ** 2)'], {}), '((c1[0] - c2[0]) ** 2 + (c1[1] - c2[1]) ** 2 + (c1[2] - c2[2]) ** 2)\n', (53, 121), True, 'import numpy as np\n'), ((181, 196), 'numpy.exp', 'np.exp', (['(-r ** 2)'], {}), '(-r ** 2)\n', (187, 196), Tr... |
import wx
import matplotlib.pyplot as plt
import os
import sys
import subprocess
from PIL import Image
class App(wx.Frame):
def __init__(self, parent, title):
super(App, self).__init__(parent, title = title,size = (640,300))
panel = wx.Panel(self)
sizer = wx.GridBagSizer(5, 4)
#d... | [
"PIL.Image.new",
"subprocess.Popen",
"os.path.join",
"os.walk",
"wx.Panel",
"wx.GridBagSizer",
"wx.StaticText",
"wx.Button",
"wx.TextCtrl",
"wx.App",
"wx.DirDialog"
] | [((3317, 3338), 'wx.App', 'wx.App', ([], {'redirect': '(True)'}), '(redirect=True)\n', (3323, 3338), False, 'import wx\n'), ((2510, 2545), 'PIL.Image.new', 'Image.new', (['"""RGB"""', 'image.size', 'color'], {}), "('RGB', image.size, color)\n", (2519, 2545), False, 'from PIL import Image\n'), ((2692, 2705), 'os.walk', ... |
import json
import logging
import os
import sys
import boto3
import urllib3
urllib3.disable_warnings()
logger = logging.getLogger()
logger.setLevel(logging.INFO)
http_pool = urllib3.PoolManager()
secretsmanager_client = boto3.client('secretsmanager')
def changeSyntheticStatus(new_status):
logger.info(f"Start... | [
"json.loads",
"boto3.client",
"json.dumps",
"urllib3.disable_warnings",
"urllib3.PoolManager",
"os.getenv",
"logging.getLogger"
] | [((78, 104), 'urllib3.disable_warnings', 'urllib3.disable_warnings', ([], {}), '()\n', (102, 104), False, 'import urllib3\n'), ((115, 134), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (132, 134), False, 'import logging\n'), ((178, 199), 'urllib3.PoolManager', 'urllib3.PoolManager', ([], {}), '()\n', (19... |
# Generated by Django 2.2.5 on 2019-12-23 06:02
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('orders', '0006_auto_20191222_2318'),
]
operations = [
migrations.AlterField(
model_name='order'... | [
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.IntegerField",
"django.db.models.DateTimeField"
] | [((371, 431), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)', 'verbose_name': '"""注文日時"""'}), "(auto_now_add=True, verbose_name='注文日時')\n", (391, 431), False, 'from django.db import migrations, models\n'), ((550, 643), 'django.db.models.AutoField', 'models.AutoField', ([], {'au... |
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | [
"aws_encryption_sdk.internal.arn.Arn.from_str",
"pytest.raises"
] | [((2380, 2401), 'aws_encryption_sdk.internal.arn.Arn.from_str', 'Arn.from_str', (['arn_str'], {}), '(arn_str)\n', (2392, 2401), False, 'from aws_encryption_sdk.internal.arn import Arn\n'), ((2814, 2835), 'aws_encryption_sdk.internal.arn.Arn.from_str', 'Arn.from_str', (['arn_str'], {}), '(arn_str)\n', (2826, 2835), Fals... |
from django.db import models
# Create your models here.
class Student(models.Model):
name = models.CharField(max_length = 20, null = False)#建立字串長度最大為20,且欄位不可空白。
sex = models.CharField(max_length = 2, default = 'M', null = False)
birthday = models.DateField(null = False)
phone = models.CharField(max_len... | [
"django.db.models.CharField",
"django.db.models.DateField"
] | [((97, 140), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(20)', 'null': '(False)'}), '(max_length=20, null=False)\n', (113, 140), False, 'from django.db import models\n'), ((176, 231), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(2)', 'default': '"""M"""', 'null': '... |
#!/usr/bin/env python
'''This module contains routines to perform Gram-Schmidt orthonormalization on
a sequence of vectors.
'''
import numpy as np
import numpy.linalg as la
def gso(A, overwrite=False, out=None):
'''Performs Gram-Schmidt orthonormalization on a sequence of vectors.
Parameters
----------
... | [
"numpy.dot",
"numpy.random.random",
"numpy.linalg.norm",
"numpy.zeros_like"
] | [((1456, 1480), 'numpy.random.random', 'np.random.random', (['(6, 6)'], {}), '((6, 6))\n', (1472, 1480), True, 'import numpy as np\n'), ((1582, 1600), 'numpy.dot', 'np.dot', (['out.T', 'out'], {}), '(out.T, out)\n', (1588, 1600), True, 'import numpy as np\n'), ((1161, 1177), 'numpy.zeros_like', 'np.zeros_like', (['A'],... |
import os
from . import Builder, BuilderOptions
from .. import types
from ..environment import get_cmd
from ..freezedried import FreezeDried
from ..log import LogFile
from ..path import pushd
from ..shell import ShellArguments
_known_install_types = ('prefix', 'exec-prefix', 'bindir', 'libdir',
... | [
"os.path.dirname"
] | [((1022, 1050), 'os.path.dirname', 'os.path.dirname', (['config_file'], {}), '(config_file)\n', (1037, 1050), False, 'import os\n')] |
from __future__ import print_function
import statsmodels.api as sm
from statsmodels.tsa.vector_ar.tests.test_var import TestVARResults
test_VAR = TestVARResults()
test_VAR.test_reorder()
| [
"statsmodels.tsa.vector_ar.tests.test_var.TestVARResults"
] | [((148, 164), 'statsmodels.tsa.vector_ar.tests.test_var.TestVARResults', 'TestVARResults', ([], {}), '()\n', (162, 164), False, 'from statsmodels.tsa.vector_ar.tests.test_var import TestVARResults\n')] |