code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
import os
import tensorflow as tf
import imageio
import logging
import argparse
import numpy as np
from tensorflow.keras.datasets import mnist
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import tensorflow.keras as keras
tf.compat.v1.disable_v2_behavior()
tf.compat.v1.disable_eager_execution()
... | [
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"logging.debug",
"tensorflow.compat.v1.InteractiveSession",
"tensorflow.keras.utils.to_categorical",
"argparse.ArgumentParser",
"tensorflow.compat.v1.saved_model.loader.load",
"tensorflow.keras.datasets.mnist.load_data",
"tensorflow.compat.v1.... | [((245, 279), 'tensorflow.compat.v1.disable_v2_behavior', 'tf.compat.v1.disable_v2_behavior', ([], {}), '()\n', (277, 279), True, 'import tensorflow as tf\n'), ((280, 318), 'tensorflow.compat.v1.disable_eager_execution', 'tf.compat.v1.disable_eager_execution', ([], {}), '()\n', (316, 318), True, 'import tensorflow as t... |
import os
import urllib3
import pandas
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('output', metavar='G5NR_7km/', type=str,
help='Where to save your data?')
args = parser.parse_args()
def url_to_pandas(url):
http = urllib3.PoolManager()
r = http.request('GET',... | [
"pandas.read_html",
"os.makedirs",
"argparse.ArgumentParser",
"os.path.exists",
"os.system",
"urllib3.PoolManager",
"os.path.join"
] | [((67, 92), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (90, 92), False, 'import argparse\n'), ((271, 292), 'urllib3.PoolManager', 'urllib3.PoolManager', ([], {}), '()\n', (290, 292), False, 'import urllib3\n'), ((478, 506), 'os.path.exists', 'os.path.exists', (['to_directory'], {}), '(to_di... |
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPooling2D
from PIL import Image
import numpy as np
from skimage import transform
from constants import IMG_HEIGHT, IMG_WIDTH
import pandas as pd
import os
from sklearn.metrics i... | [
"matplotlib.pyplot.title",
"os.mkdir",
"numpy.argmax",
"matplotlib.pyplot.figure",
"skimage.transform.resize",
"pandas.DataFrame",
"utils.plot_confusion_matrix",
"datetime.datetime.now",
"matplotlib.pyplot.show",
"csv.writer",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplot",
"os.make... | [((2338, 2349), 'time.time', 'time.time', ([], {}), '()\n', (2347, 2349), False, 'import time\n'), ((3547, 3573), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 8)'}), '(figsize=(8, 8))\n', (3557, 3573), True, 'from matplotlib import pyplot as plt\n'), ((3582, 3602), 'matplotlib.pyplot.subplot', 'plt.s... |
"""
DB ์ ๊ทผ์ ์ด๊ดํ๋ ํด๋์ค
"""
import sqlite3
from datetime import datetime
DB_PATH = "./data.db"
class Database:
def __init__(self):
"""๊ฐ์ฒด๊ฐ ์์ฑ๋ ๋, ์คํ"""
self.conn = sqlite3.connect(DB_PATH, isolation_level=None)
def get_posts(self, page=1):
"""ํด๋น ํ์ด์ง์ ํฌ์คํธ ๋ฆฌ์คํธ ๋ฐํ"""
cur = self.conn.cursor()
cur.execute(
'''... | [
"sqlite3.connect",
"datetime.datetime.now"
] | [((889, 935), 'sqlite3.connect', 'sqlite3.connect', (['DB_PATH'], {'isolation_level': 'None'}), '(DB_PATH, isolation_level=None)\n', (904, 935), False, 'import sqlite3\n'), ((167, 213), 'sqlite3.connect', 'sqlite3.connect', (['DB_PATH'], {'isolation_level': 'None'}), '(DB_PATH, isolation_level=None)\n', (182, 213), Fal... |
import numpy as np
from holoviews.core.overlay import NdOverlay
from holoviews.core.spaces import HoloMap
from holoviews.element import Points
from .testplot import TestMPLPlot, mpl_renderer
from ..utils import ParamLogStream
try:
from matplotlib import pyplot
except:
pass
class TestPointPlot(TestMPLPlot):... | [
"numpy.array",
"holoviews.element.Points",
"numpy.arange",
"numpy.datetime64"
] | [((390, 403), 'numpy.arange', 'np.arange', (['(10)'], {}), '(10)\n', (399, 403), True, 'import numpy as np\n'), ((405, 418), 'numpy.arange', 'np.arange', (['(10)'], {}), '(10)\n', (414, 418), True, 'import numpy as np\n'), ((7101, 7115), 'numpy.array', 'np.array', (['[10]'], {}), '([10])\n', (7109, 7115), True, 'import... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"paddle.sum",
"paddle.mean",
"paddle.minimum",
"paddle.maximum",
"paddle.split"
] | [((3165, 3188), 'paddle.maximum', 'paddle.maximum', (['x1', 'x1g'], {}), '(x1, x1g)\n', (3179, 3188), False, 'import paddle\n'), ((3205, 3228), 'paddle.maximum', 'paddle.maximum', (['y1', 'y1g'], {}), '(y1, y1g)\n', (3219, 3228), False, 'import paddle\n'), ((3245, 3268), 'paddle.minimum', 'paddle.minimum', (['x2', 'x2g... |
__all__ = ['keys']
from Vocab.InternalCmd import InternalCmd
from tron import Misc, g
from tron.Hub.KV.KVDict import kvAsASCII
class keys(InternalCmd):
""" All the commands that the "keys" package provides.
To wit:
keys getFor=actor K1 [K2 [K3 ...]]
Keywords returned:
The re... | [
"tron.Hub.KV.KVDict.kvAsASCII",
"Vocab.InternalCmd.InternalCmd.__init__",
"tron.Misc.qstr",
"tron.Misc.log",
"tron.g.KVs.getValues"
] | [((469, 511), 'Vocab.InternalCmd.InternalCmd.__init__', 'InternalCmd.__init__', (['self', '"""keys"""'], {}), "(self, 'keys', **argv)\n", (489, 511), False, 'from Vocab.InternalCmd import InternalCmd\n'), ((1139, 1242), 'tron.Misc.log', 'Misc.log', (['"""keys.getFor"""', "('matched=%s; unmatched=%s; leftovers=%s' % (ma... |
import argparse
import logging
import sys
from aoc import __version__
from numpy.lib.stride_tricks import sliding_window_view
__author__ = "<NAME>"
__copyright__ = "<NAME>"
__license__ = "MIT"
_logger = logging.getLogger(__name__)
def ex1(inputs):
prev = inputs[0]
result = 0
for t in inputs[1:]:
... | [
"numpy.lib.stride_tricks.sliding_window_view",
"logging.getLogger"
] | [((206, 233), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (223, 233), False, 'import logging\n'), ((428, 458), 'numpy.lib.stride_tricks.sliding_window_view', 'sliding_window_view', (['inputs', '(3)'], {}), '(inputs, 3)\n', (447, 458), False, 'from numpy.lib.stride_tricks import sliding... |
# -*- coding: utf-8 -*-
"""
Matching file names by configuration options.
"""
from __future__ import absolute_import, print_function
import os
import re
import six
import niftynet.io.misc_io as util
class KeywordsMatching(object):
"""
This class is responsible for the search of the appropriate files to use
... | [
"os.path.expanduser",
"niftynet.io.misc_io.split_filename",
"os.path.abspath",
"os.path.exists",
"re.escape",
"os.path.join",
"os.listdir",
"re.sub"
] | [((4970, 4999), 'niftynet.io.misc_io.split_filename', 'util.split_filename', (['fullname'], {}), '(fullname)\n', (4989, 4999), True, 'import niftynet.io.misc_io as util\n'), ((3736, 3761), 'os.path.join', 'os.path.join', (['p', 'filename'], {}), '(p, filename)\n', (3748, 3761), False, 'import os\n'), ((5469, 5493), 're... |
from flask import request
from tests import app
@app.route('/predicates-string')
def predicates_string():
return 'Hello World!'
@app.route('/predicates-string-empty')
def predicates_string_empty():
return ''
| [
"tests.app.route"
] | [((50, 81), 'tests.app.route', 'app.route', (['"""/predicates-string"""'], {}), "('/predicates-string')\n", (59, 81), False, 'from tests import app\n'), ((135, 172), 'tests.app.route', 'app.route', (['"""/predicates-string-empty"""'], {}), "('/predicates-string-empty')\n", (144, 172), False, 'from tests import app\n')] |
import sqlalchemy
import py_starter as ps
from database_connections.DatabaseConnection import DatabaseConnection
def get_DatabaseConnection( **kwargs ):
'''returns the class instance of the said object'''
return Redshift( **kwargs )
class Redshift( DatabaseConnection ):
'''To run the SQLite module, you ... | [
"sqlalchemy.create_engine",
"py_starter.merge_dicts",
"database_connections.DatabaseConnection.DatabaseConnection.__init__"
] | [((470, 513), 'database_connections.DatabaseConnection.DatabaseConnection.__init__', 'DatabaseConnection.__init__', (['self'], {}), '(self, **kwargs)\n', (497, 513), False, 'from database_connections.DatabaseConnection import DatabaseConnection\n'), ((713, 750), 'sqlalchemy.create_engine', 'sqlalchemy.create_engine', (... |
#!/usr/bin/env python
# encoding: utf-8
"""
@author: ambershek
@last modification: 2021/8/20
"""
import sys
sys.path.append('.')
from fastreid.config import get_cfg
from fastreid.engine import DefaultTrainer, default_argument_parser, default_setup, launch, BoostTrainer
from fastreid.utils.checkpoint import Checkpoin... | [
"sys.path.append",
"fastreid.engine.default_argument_parser",
"fastreid.config.get_cfg",
"fastreid.engine.default_setup",
"fastreid.utils.checkpoint.Checkpointer",
"fastreid.engine.BoostTrainer",
"fastreid.engine.launch",
"fastreid.engine.BoostTrainer.build_model"
] | [((110, 130), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (125, 130), False, 'import sys\n'), ((429, 438), 'fastreid.config.get_cfg', 'get_cfg', ([], {}), '()\n', (436, 438), False, 'from fastreid.config import get_cfg\n'), ((537, 561), 'fastreid.engine.default_setup', 'default_setup', (['cfg', ... |
import numpy as np
import cv2 as cv
img = cv.imread('4.jpg')
ret, thresh = cv.threshold(img, 12, 255, cv.THRESH_BINARY)
print(ret)
#this helps to convert the color image to the gray image...
gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY)
ret2, thresh2 = cv.threshold(gray, 12, 255, cv.THRESH_BINARY)
gaus = cv.adaptiveThr... | [
"cv2.cvtColor",
"cv2.imwrite",
"cv2.threshold",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.adaptiveThreshold",
"cv2.imread",
"cv2.imshow"
] | [((45, 63), 'cv2.imread', 'cv.imread', (['"""4.jpg"""'], {}), "('4.jpg')\n", (54, 63), True, 'import cv2 as cv\n'), ((78, 122), 'cv2.threshold', 'cv.threshold', (['img', '(12)', '(255)', 'cv.THRESH_BINARY'], {}), '(img, 12, 255, cv.THRESH_BINARY)\n', (90, 122), True, 'import cv2 as cv\n'), ((202, 237), 'cv2.cvtColor', ... |
""" Unit test for the Problem class. """
import unittest
import numpy as np
from six import text_type, PY3
from six.moves import cStringIO
import warnings
from openmdao.components.linear_system import LinearSystem
from openmdao.core.component import Component
from openmdao.core.problem import Problem
from openmdao.co... | [
"openmdao.test.simple_comps.RosenSuzuki",
"openmdao.test.example_groups.ExampleByObjGroup",
"openmdao.test.example_groups.ExampleGroup",
"openmdao.core.component.Component",
"unittest.main",
"openmdao.core.group.Group",
"openmdao.test.simple_comps.SimpleImplicitComp",
"six.moves.cStringIO",
"warning... | [((33739, 33754), 'unittest.main', 'unittest.main', ([], {}), '()\n', (33752, 33754), False, 'import unittest\n'), ((985, 992), 'openmdao.core.group.Group', 'Group', ([], {}), '()\n', (990, 992), False, 'from openmdao.core.group import Group\n'), ((1644, 1657), 'openmdao.core.problem.Problem', 'Problem', (['root'], {})... |
# -*- coding: utf-8 -*-
from django import forms
from django.utils.translation import gettext_lazy as _
from members.models import Membership
from users.models import TruffeUser
import re
class MembershipAddForm(forms.ModelForm):
user = forms.CharField()
class Meta:
model = Membership
exc... | [
"django.utils.translation.gettext_lazy",
"re.match",
"django.forms.ValidationError",
"django.forms.CharField",
"users.models.TruffeUser.objects.get"
] | [((247, 264), 'django.forms.CharField', 'forms.CharField', ([], {}), '()\n', (262, 264), False, 'from django import forms\n'), ((1673, 1793), 'django.utils.translation.gettext_lazy', '_', (['u"""Accepte les fichiers JSON composรฉs de listes de username ou de listes de couples (username, cotisation_payรฉe)"""'], {}), "(u'... |
import datetime
import pytz
import logging
from kartverket_stormsurge.dataset_checker import DatasetChecker
logging.basicConfig(level=logging.INFO)
example_kind = "full"
# example_kind = "short"
if example_kind == "full":
start = datetime.datetime(1970, 1, 1, 0, 0, tzinfo=pytz.utc)
end = datetime.datetime(... | [
"datetime.datetime",
"logging.basicConfig",
"kartverket_stormsurge.dataset_checker.DatasetChecker"
] | [((111, 150), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (130, 150), False, 'import logging\n'), ((714, 851), 'kartverket_stormsurge.dataset_checker.DatasetChecker', 'DatasetChecker', ([], {'path_to_ordered_cache': '"""/home/jrlab/.NicedUrlRequest/cache/"""'... |
"""Convert Iwamoto et al. (1999) W70 SNIa yields to pickled arrays."""
from __future__ import print_function, division, absolute_import
import os
from os.path import join
import sys
import numpy as np
import pandas as pd
import string
# ---- Set Paths -----
path_calc_yields = join(os.path.abspath(os.path.dirname(__... | [
"sys.path.append",
"pandas.read_csv",
"os.path.dirname",
"numpy.zeros",
"numpy.where",
"numpy.array",
"os.path.join"
] | [((415, 442), 'os.path.join', 'join', (['path_flexce', '"""fileio"""'], {}), "(path_flexce, 'fileio')\n", (419, 442), False, 'from os.path import join\n'), ((455, 480), 'os.path.join', 'join', (['path_flexce', '"""data"""'], {}), "(path_flexce, 'data')\n", (459, 480), False, 'from os.path import join\n'), ((495, 520), ... |
# Copyright (c) 2010 <NAME>. All rights reserved.
#
"""Random class.
"""
# end_pymotw_header
import random
import time
print("Default initializiation:\n")
r1 = random.SystemRandom()
r2 = random.SystemRandom()
for i in range(3):
print("{:04.3f} {:04.3f}".format(r1.random(), r2.random()))
print("\nSame seed:\n... | [
"random.SystemRandom",
"time.time"
] | [((164, 185), 'random.SystemRandom', 'random.SystemRandom', ([], {}), '()\n', (183, 185), False, 'import random\n'), ((191, 212), 'random.SystemRandom', 'random.SystemRandom', ([], {}), '()\n', (210, 212), False, 'import random\n'), ((331, 342), 'time.time', 'time.time', ([], {}), '()\n', (340, 342), False, 'import tim... |
"""Test cases for SuperFences."""
from .. import util
import pymdownx.arithmatex as arithmatex
import pymdownx.superfences as superfences
from pymdownx.superfences import SuperFencesException
import warnings
def custom_format(source, language, class_name, options, md, **kwargs):
"""Custom format."""
return '... | [
"pymdownx.arithmatex.arithmatex_fenced_format",
"pymdownx.superfences.SuperFencesException",
"warnings.catch_warnings"
] | [((877, 906), 'pymdownx.superfences.SuperFencesException', 'SuperFencesException', (['"""Boom!"""'], {}), "('Boom!')\n", (897, 906), False, 'from pymdownx.superfences import SuperFencesException\n'), ((33201, 33237), 'warnings.catch_warnings', 'warnings.catch_warnings', ([], {'record': '(True)'}), '(record=True)\n', (3... |
from flask import Flask, render_template, Response
import datetime
from Camera import VideoCamera
app = Flask(__name__)
@app.route("/")
def index():
now = datetime.datetime.now()
timeString = now.strftime('%I:%M:%S')
templateData = {
'title' : 'KittyTalk',
'time': timeString,
}
return ren... | [
"Camera.VideoCamera",
"flask.Flask",
"datetime.datetime.now",
"flask.render_template"
] | [((104, 119), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (109, 119), False, 'from flask import Flask, render_template, Response\n'), ((159, 182), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (180, 182), False, 'import datetime\n'), ((317, 366), 'flask.render_template', 'render_te... |
#!/usr/bin/env python
# Copyright 2015-2016 Yelp 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 ... | [
"service_configuration_lib.disable_yaml_cache",
"paasta_tools.api.settings.system_paasta_config.get_cluster",
"argparse.ArgumentParser",
"logging.basicConfig",
"os.path.join",
"os.path.dirname",
"requests_cache.install_cache",
"os.environ.get",
"paasta_tools.marathon_tools.get_marathon_servers",
"... | [((1000, 1027), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1017, 1027), False, 'import logging\n'), ((1072, 1135), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Runs a PaaSTA API server"""'}), "(description='Runs a PaaSTA API server')\n", (1095, 1135)... |
import re
from typing import Union, Any
def match_regex_expr_or_error(value, field, expr) -> Union[Any, ValueError]:
if re.match(expr, value):
return value
else:
raise ValueError(f"Avro schema field '{field}' must match regex expression: {expr}") | [
"re.match"
] | [((126, 147), 're.match', 're.match', (['expr', 'value'], {}), '(expr, value)\n', (134, 147), False, 'import re\n')] |
from distutils.core import setup
setup(name='scflibname',
version='1.0.0',
description='Desciption for scflibname here',
author='scf-gitusername',
author_email='<EMAIL>',
url='scf-gitrepo',
packages=['scflibname'],
install_requires=[],
entry_points = {
'console_s... | [
"distutils.core.setup"
] | [((34, 333), 'distutils.core.setup', 'setup', ([], {'name': '"""scflibname"""', 'version': '"""1.0.0"""', 'description': '"""Desciption for scflibname here"""', 'author': '"""scf-gitusername"""', 'author_email': '"""<EMAIL>"""', 'url': '"""scf-gitrepo"""', 'packages': "['scflibname']", 'install_requires': '[]', 'entry_... |
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD) #Raspi board GPIO pin number
GPIO.setup(12, GPIO.OUT) #Board pin 12, BCM pin 18
#Initial state for LEDs:
print("Testing GPIO pin12 out, Press CTRL+C to exit")
try:
while True:
print("Set GPIO 12 HIGH")
GPIO.out... | [
"RPi.GPIO.setmode",
"RPi.GPIO.cleanup",
"RPi.GPIO.setup",
"time.sleep",
"RPi.GPIO.output"
] | [((40, 64), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BOARD'], {}), '(GPIO.BOARD)\n', (52, 64), True, 'import RPi.GPIO as GPIO\n'), ((97, 121), 'RPi.GPIO.setup', 'GPIO.setup', (['(12)', 'GPIO.OUT'], {}), '(12, GPIO.OUT)\n', (107, 121), True, 'import RPi.GPIO as GPIO\n'), ((586, 600), 'RPi.GPIO.cleanup', 'GPIO.cleanup... |
import requests
import json
import datetime
import time
while True:
try:
URL = 'http://api.promasters.net.br/cotacao/v1/valores'
response = requests.get(URL)
cotacao = json.loads(response.text)
except:
print('Erro de conexao')
print('--------------------COTACAO DOLAR '+ st... | [
"datetime.datetime.now",
"json.loads",
"requests.get",
"time.sleep"
] | [((1427, 1440), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (1437, 1440), False, 'import time\n'), ((162, 179), 'requests.get', 'requests.get', (['URL'], {}), '(URL)\n', (174, 179), False, 'import requests\n'), ((198, 223), 'json.loads', 'json.loads', (['response.text'], {}), '(response.text)\n', (208, 223), Fa... |
# Copyright 2020 The TwoBlock AI.
#
# <EMAIL>, <EMAIL>
import moran
moran_tokenizer = moran.MoranTokenizer()
x = 'ํ๊ตญ์ด BERT๋ฅผ ๊ณต๊ฐํฉ๋๋ค.'
moran_line = moran.text2moran(x, moran_tokenizer)
print(moran_line)
x = '<table> <tr> <td> ํ๊ตญ์ด BERT๋ฅผ ๊ณต๊ฐํฉ๋๋ค. </td> </tr> </table>'
moran_line = moran.text2moran(x, moran_tokenizer)
print... | [
"moran.MoranTokenizer",
"moran.text2moran"
] | [((89, 111), 'moran.MoranTokenizer', 'moran.MoranTokenizer', ([], {}), '()\n', (109, 111), False, 'import moran\n'), ((148, 184), 'moran.text2moran', 'moran.text2moran', (['x', 'moran_tokenizer'], {}), '(x, moran_tokenizer)\n', (164, 184), False, 'import moran\n'), ((278, 314), 'moran.text2moran', 'moran.text2moran', (... |
import asyncio
import logging
from six import string_types
from typing import (
List,
Dict,
Optional,
Any,
)
from hummingbot.core.utils.wallet_setup import (
create_and_save_wallet,
import_and_save_wallet,
list_wallets,
unlock_wallet
)
from hummingbot.client.config.config_var import Con... | [
"hummingbot.core.utils.wallet_setup.list_wallets",
"hummingbot.core.utils.wallet_setup.create_and_save_wallet",
"hummingbot.client.config.config_helpers.copy_strategy_template",
"hummingbot.core.utils.wallet_setup.import_and_save_wallet",
"hummingbot.client.config.in_memory_config_map.in_memory_config_map.g... | [((2139, 2162), 'hummingbot.client.config.config_helpers.load_required_configs', 'load_required_configs', ([], {}), '()\n', (2160, 2162), False, 'from hummingbot.client.config.config_helpers import get_strategy_config_map, write_config_to_yml, load_required_configs, parse_cvar_value, copy_strategy_template\n'), ((2572,... |
from __future__ import annotations
import asyncio
import contextlib
import signal
from typing import TYPE_CHECKING
from libqtile.log_utils import logger
if TYPE_CHECKING:
from typing import Callable
from libqtile.core.manager import Qtile
class LoopContext(contextlib.AbstractAsyncContextManager):
def ... | [
"libqtile.log_utils.logger.exception",
"contextlib.suppress",
"asyncio.get_running_loop",
"asyncio.current_task",
"asyncio.DefaultEventLoopPolicy.__init__",
"asyncio.all_tasks",
"libqtile.log_utils.logger.error"
] | [((612, 638), 'asyncio.get_running_loop', 'asyncio.get_running_loop', ([], {}), '()\n', (636, 638), False, 'import asyncio\n'), ((952, 978), 'asyncio.get_running_loop', 'asyncio.get_running_loop', ([], {}), '()\n', (976, 978), False, 'import asyncio\n'), ((2328, 2373), 'asyncio.DefaultEventLoopPolicy.__init__', 'asynci... |
# -*- coding: utf-8 -*-
"""Query, download, and format Wikidata as a registry."""
import json
import logging
from collections import defaultdict
from textwrap import dedent
from bioregistry.data import EXTERNAL
from bioregistry.utils import query_wikidata
__all__ = [
'get_wikidata',
]
DIRECTORY = EXTERNAL / 'w... | [
"textwrap.dedent",
"json.dump",
"json.load",
"collections.defaultdict",
"bioregistry.utils.query_wikidata",
"logging.getLogger"
] | [((464, 491), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (481, 491), False, 'import logging\n'), ((961, 1853), 'textwrap.dedent', 'dedent', (['""" SELECT\n ?database ?databaseLabel ?databaseMiriam ?databaseHomepage\n ?prop ?propLabel ?propMiriam ?propHomepage ?propFor... |
# Copyright 2020-2022 OpenDR European Project
#
# 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 agree... | [
"unittest.main",
"opendr.perception.activity_recognition.KineticsDataset",
"torch.utils.data.DataLoader",
"torch.sum",
"opendr.perception.activity_recognition.KineticsDataset.download_micro",
"pathlib.Path",
"torch.tensor",
"opendr.engine.data.Video",
"torch.allclose",
"os.getenv",
"logging.getL... | [((953, 972), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (962, 972), False, 'from logging import getLogger\n'), ((907, 931), 'os.getenv', 'os.getenv', (['"""TEST_DEVICE"""'], {}), "('TEST_DEVICE')\n", (916, 931), False, 'import os\n'), ((879, 903), 'os.getenv', 'os.getenv', (['"""TEST_DEVICE"... |
# Generated by Django 3.0.5 on 2020-10-24 15:38
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('saef', '0009_auto_20200930_2226'),
]
operations = [
migrations.CreateModel(
name='AzureBlobStor... | [
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.AutoField"
] | [((380, 473), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (396, 473), False, 'from django.db import migrations, models\... |
# Copyright (c) 2009-2010 <NAME>. See LICENSE for details.
"""
Timeouts.
Many functions in :mod:`gevent` have a *timeout* argument that allows
limiting the time the function will block. When that is not available,
the :class:`Timeout` class and :func:`with_timeout` function in this
module add timeouts to arbitrary cod... | [
"gevent.hub.get_hub",
"gevent.hub.getcurrent"
] | [((5327, 5339), 'gevent.hub.getcurrent', 'getcurrent', ([], {}), '()\n', (5337, 5339), False, 'from gevent.hub import getcurrent, _NONE, get_hub, string_types\n'), ((5444, 5456), 'gevent.hub.getcurrent', 'getcurrent', ([], {}), '()\n', (5454, 5456), False, 'from gevent.hub import getcurrent, _NONE, get_hub, string_type... |
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import torch.nn.functional as F
from models.model_template import ModelTemplate
from backbones.layers import Linear_fw
import copy
import argparse
class Maml(ModelTemplate):
@staticmethod
def get_parser(parser=None)... | [
"torch.optim.lr_scheduler.StepLR",
"argparse.ArgumentParser",
"torch.stack",
"torch.autograd.grad",
"torch.nn.CrossEntropyLoss",
"models.model_template.ModelTemplate.get_parser",
"torch.optim.Adam",
"torch.max",
"backbones.layers.Linear_fw",
"torch.tensor"
] | [((483, 515), 'models.model_template.ModelTemplate.get_parser', 'ModelTemplate.get_parser', (['parser'], {}), '(parser)\n', (507, 515), False, 'from models.model_template import ModelTemplate\n'), ((1816, 1837), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (1835, 1837), True, 'import torch.nn a... |
# coding: utf-8
# In[3]:
import os
import pickle
from vega import VegaLite
from flashflood.sqliteconnection import Connection
from chorus.model.graphmol import Compound
from chorus import molutil
from chorus import wclogp
con = Connection('../sdf_demo.sqlite3')
tbl = con.document()["tables"][0]
rcds = []
for row... | [
"pickle.loads",
"flashflood.sqliteconnection.Connection",
"chorus.molutil.mw",
"vega.VegaLite",
"chorus.molutil.H_acceptor_count",
"chorus.wclogp.wclogp",
"chorus.molutil.H_donor_count",
"chorus.molutil.rule_of_five_violation"
] | [((234, 267), 'flashflood.sqliteconnection.Connection', 'Connection', (['"""../sdf_demo.sqlite3"""'], {}), "('../sdf_demo.sqlite3')\n", (244, 267), False, 'from flashflood.sqliteconnection import Connection\n'), ((683, 1173), 'vega.VegaLite', 'VegaLite', (["{'width': 400, 'height': 400, 'data': {'values': rcds}, 'trans... |
# flake8: noqa: F403, F405
from tests.core import mock
from trakt import Trakt
from datetime import datetime
from dateutil.tz import tzutc
from hamcrest import *
from httmock import HTTMock
def test_watched():
with HTTMock(mock.fixtures, mock.unknown):
with Trakt.configuration.auth('mock', 'mock'):
... | [
"trakt.Trakt.configuration.auth",
"httmock.HTTMock",
"dateutil.tz.tzutc"
] | [((223, 259), 'httmock.HTTMock', 'HTTMock', (['mock.fixtures', 'mock.unknown'], {}), '(mock.fixtures, mock.unknown)\n', (230, 259), False, 'from httmock import HTTMock\n'), ((274, 314), 'trakt.Trakt.configuration.auth', 'Trakt.configuration.auth', (['"""mock"""', '"""mock"""'], {}), "('mock', 'mock')\n", (298, 314), Fa... |
from unittest.mock import Mock, patch, AsyncMock
import pytest
from src.cogs.admin import AdminCog
@pytest.mark.asyncio
@pytest.mark.parametrize(
("admins_list", "user_id", "result"),
[
([123], 123, True),
([123], 321, False),
([123, 456], 456, True),
([123, 456], 789, False)... | [
"src.cogs.admin.AdminCog._format_code",
"unittest.mock.Mock",
"unittest.mock.AsyncMock",
"unittest.mock.patch",
"src.cogs.admin.AdminCog.cog_check",
"pytest.mark.parametrize"
] | [((125, 289), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('admins_list', 'user_id', 'result')", '[([123], 123, True), ([123], 321, False), ([123, 456], 456, True), ([123, \n 456], 789, False)]'], {}), "(('admins_list', 'user_id', 'result'), [([123], 123,\n True), ([123], 321, False), ([123, 456], 45... |
"""Solver for type equations."""
import itertools
import logging
from pytype.pytd import booleq
from pytype.pytd import optimize
from pytype.pytd import pytd
from pytype.pytd import pytd_utils
from pytype.pytd import transforms
from pytype.pytd import type_match
from pytype.pytd import visitors
log = logging.getLogg... | [
"pytype.pytd.type_match.unpack_name_of_partial",
"pytype.pytd.visitors.ClassTypeToNamedType",
"pytype.pytd.pytd.AnythingType",
"pytype.pytd.pytd.Print",
"pytype.pytd.pytd_utils.Concat",
"pytype.pytd.transforms.RemoveMutableParameters",
"pytype.pytd.type_match.TypeMatch",
"pytype.pytd.optimize.RenameUn... | [((305, 332), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (322, 332), False, 'import logging\n'), ((7968, 8017), 'pytype.pytd.transforms.RemoveMutableParameters', 'transforms.RemoveMutableParameters', (['builtins_pytd'], {}), '(builtins_pytd)\n', (8002, 8017), False, 'from pytype.pytd ... |
import unittest
import pytest
from datastructures.arrays import two_sum as ts
@pytest.mark.parametrize("numbers,target,expected", [
([2, 7, 11, 15], 9, [0, 1]),
([3, 2, 4], 6, [1, 2]),
([3, 3], 6, [0, 1])
])
def test_memoized_can_sum(numbers, target, expected):
assert expected == ts.two_sum(numbers, t... | [
"unittest.main",
"pytest.mark.parametrize",
"datastructures.arrays.two_sum.two_sum"
] | [((81, 211), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""numbers,target,expected"""', '[([2, 7, 11, 15], 9, [0, 1]), ([3, 2, 4], 6, [1, 2]), ([3, 3], 6, [0, 1])]'], {}), "('numbers,target,expected', [([2, 7, 11, 15], 9, [0,\n 1]), ([3, 2, 4], 6, [1, 2]), ([3, 3], 6, [0, 1])])\n", (104, 211), False, '... |
import pickle
import pandas as pd
from models import *
from utils import sample_corr_matrix
import igraph as ig
data_dir = '_realdata/DREAM4_InSilico_Size10/insilico_size10_3'
data = pd.read_csv(os.path.join(data_dir, 'insilico_size10_3_multifactorial.tsv'), sep='\t')
# first we standardize data
data = (data - data.... | [
"pandas.read_csv",
"pickle.dump",
"igraph.Graph"
] | [((426, 575), 'pandas.read_csv', 'pd.read_csv', (['"""_realdata/DREAM4_Challenge2_GoldStandards/Size 10/DREAM4_GoldStandard_InSilico_Size10_3.tsv"""'], {'sep': '"""\t"""', 'names': "['L', 'R', 'V']"}), "(\n '_realdata/DREAM4_Challenge2_GoldStandards/Size 10/DREAM4_GoldStandard_InSilico_Size10_3.tsv'\n , sep='\\t'... |
import numpy as np
import cv2
import time
N = 5
b = np.random.randint(-N,N,size=(N,N))
A = (b + b.T)/2
x = np.random.randint(-N,N,size=(1,N))
x = x.T
y = np.zeros(N)
start = time.time()
for j in range(N):
y[j] = 0
for k in range(j):
y[j] = y[j] + A[k,j]*x[k]
for i in range(j,N):
y[j] = y[j]... | [
"matplotlib.pyplot.show",
"numpy.amin",
"matplotlib.pyplot.plot",
"numpy.zeros",
"time.time",
"numpy.amax",
"numpy.random.randint",
"numpy.array",
"numpy.loadtxt",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots"
] | [((55, 92), 'numpy.random.randint', 'np.random.randint', (['(-N)', 'N'], {'size': '(N, N)'}), '(-N, N, size=(N, N))\n', (72, 92), True, 'import numpy as np\n'), ((110, 147), 'numpy.random.randint', 'np.random.randint', (['(-N)', 'N'], {'size': '(1, N)'}), '(-N, N, size=(1, N))\n', (127, 147), True, 'import numpy as np\... |
import argparse
import os
import tensorflow as tf
import numpy as np
import PIL.Image
import cv2 as cv
MODEL_FILENAME = 'saved_model.pb'
LABELS_FILENAME = 'labels.txt'
labels = None
class ObjectDetection:
OUTPUT_TENSOR_NAMES = ['detected_boxes', 'detected_scores', 'detected_classes']
def __init__(self, mode... | [
"argparse.ArgumentParser",
"cv2.waitKey",
"tensorflow.convert_to_tensor",
"os.path.dirname",
"cv2.imshow",
"cv2.VideoCapture",
"numpy.array",
"cv2.rectangle",
"cv2.destroyAllWindows",
"cv2.resize"
] | [((960, 978), 'cv2.VideoCapture', 'cv.VideoCapture', (['(0)'], {}), '(0)\n', (975, 978), True, 'import cv2 as cv\n'), ((1885, 1907), 'cv2.destroyAllWindows', 'cv.destroyAllWindows', ([], {}), '()\n', (1905, 1907), True, 'import cv2 as cv\n'), ((1954, 2032), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Ob... |
import logging
log = logging.getLogger(__name__)
import tensorflow as tf
import numpy as np
import copy
from graph_networks.utilities import CustomDropout as dropout
class DGIN(tf.keras.Model):
'''
This class is an implementation of the D-GIN, which is composed of basically
the directed massage passing (Y... | [
"tensorflow.reduce_sum",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"tensorflow.identity",
"tensorflow.convert_to_tensor",
"tensorflow.keras.layers.LayerNormalization",
"tensorflow.reshape",
"tensorflow.concat",
"tensorflow.zeros",
"logging.getLogger"
] | [((21, 48), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (38, 48), False, 'import logging\n'), ((610, 776), 'tensorflow.keras.layers.Dense', 'tf.keras.layers.Dense', (['self.config.passing_hidden_size'], {'activation': '"""relu"""', 'input_shape': '(self.config.input_size,)', 'name': '"... |
from .models import Player, Room, Rule
from django.views import generic
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.urls import reverse_lazy
from django.contrib.auth.... | [
"django.shortcuts.render",
"django.urls.reverse_lazy",
"django.shortcuts.get_object_or_404"
] | [((1019, 1065), 'django.shortcuts.render', 'render', (['request', '"""index.html"""'], {'context': 'context'}), "(request, 'index.html', context=context)\n", (1025, 1065), False, 'from django.shortcuts import render, get_object_or_404\n'), ((3303, 3326), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""players"""'], {... |
#!/usr/bin/env python3
#
# Copyright (c) 2020 Mobvoi Inc. (authors: <NAME>)
#
# See ../../../LICENSE for clarification regarding multiple authors
# To run this single test, use
#
# ctest --verbose -R fsa_test_py -E host
import unittest
import k2
import torch
def _remove_leading_spaces(s: str) -> str:
... | [
"unittest.main",
"k2.SymbolTable.from_str",
"torch.tensor"
] | [((4544, 4559), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4557, 4559), False, 'import unittest\n'), ((4056, 4089), 'k2.SymbolTable.from_str', 'k2.SymbolTable.from_str', (['isym_str'], {}), '(isym_str)\n', (4079, 4089), False, 'import k2\n'), ((4105, 4138), 'k2.SymbolTable.from_str', 'k2.SymbolTable.from_str'... |
from yalul.lex.token_type import TokenType
from yalul.parsers.ast.nodes.statements.block import Block
from yalul.parsers.ast.nodes.statements.if_statement import If
from yalul.parsers.ast.nodes.statements.expressions.grouping import Grouping
from yalul.parsers.block_parser import BlockParser
from yalul.parsers.expressi... | [
"yalul.parsers.block_parser.BlockParser",
"yalul.parsers.ast.nodes.statements.if_statement.If",
"yalul.parsers.expression_parser.ExpressionParser"
] | [((1216, 1264), 'yalul.parsers.ast.nodes.statements.if_statement.If', 'If', (['condition_expression', 'then_block', 'else_block'], {}), '(condition_expression, then_block, else_block)\n', (1218, 1264), False, 'from yalul.parsers.ast.nodes.statements.if_statement import If\n'), ((1341, 1403), 'yalul.parsers.expression_p... |
#!/usr/bin/env python2
from __future__ import print_function, division, generators
import xml.etree.ElementTree as ET
import argparse
import pdbtm_dbtool
def tag(f):
pdb = pdbtm_dbtool.PDB.parse_xml(f)
for chain in pdb:
if not chain.count(): continue
#print(chain.seq)
for region in chain:
if region.topo ... | [
"pdbtm_dbtool.PDB.parse_xml",
"argparse.ArgumentParser"
] | [((175, 204), 'pdbtm_dbtool.PDB.parse_xml', 'pdbtm_dbtool.PDB.parse_xml', (['f'], {}), '(f)\n', (201, 204), False, 'import pdbtm_dbtool\n'), ((423, 448), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (446, 448), False, 'import argparse\n')] |
import pandas as pd
import matplotlib.pyplot as plt
from string import punctuation
from operator import itemgetter
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import train_test_split
from sklearn.neighbors import NearestNeighbors
from sklearn.linear_model import LogisticReg... | [
"matplotlib.pyplot.title",
"sklearn.feature_extraction.text.CountVectorizer",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.classification_report",
"matplotlib.pyplot.figure",
"sklearn.neighbors.NearestNeighbors",
"operator.itemgetter",
"matplotlib.pyplot.show",
"... | [((3284, 3310), 'pandas.read_csv', 'pd.read_csv', (['"""yelp_2k.csv"""'], {}), "('yelp_2k.csv')\n", (3295, 3310), True, 'import pandas as pd\n'), ((5403, 5451), 'sklearn.model_selection.train_test_split', 'train_test_split', (['training_set', 'y'], {'test_size': '(0.1)'}), '(training_set, y, test_size=0.1)\n', (5419, 5... |
# -*- coding: utf-8 -*-
"""
@author:XuMing(<EMAIL>)
@description:
"""
from tornado import websocket, web, ioloop
import json
cl = []
class IndexHandler(web.RequestHandler):
def get(self):
self.render("index.html")
class SocketHandler(websocket.WebSocketHandler):
def check_origin(self, origin):
... | [
"tornado.web.Application",
"json.dumps",
"tornado.ioloop.IOLoop.instance"
] | [((871, 1091), 'tornado.web.Application', 'web.Application', (["[('/', IndexHandler), ('/ws', SocketHandler), ('/api', ApiHandler), (\n '/(favicon.ico)', web.StaticFileHandler, {'path': '../'}), (\n '/(rest_api_example.png)', web.StaticFileHandler, {'path': './'})]"], {}), "([('/', IndexHandler), ('/ws', SocketHa... |
import numpy as np
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Generate Random Samples')
parser.add_argument('--start', type=int, default=0)
parser.add_argument('--end', type=int, default=1)
parser.add_argument('--sample_size', type=int, default=1)
args ... | [
"numpy.random.randint",
"argparse.ArgumentParser"
] | [((76, 138), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate Random Samples"""'}), "(description='Generate Random Samples')\n", (99, 138), False, 'import argparse\n'), ((359, 434), 'numpy.random.randint', 'np.random.randint', ([], {'low': 'args.start', 'high': '(args.end + 1)', '... |
# Copyright 2015 by <NAME>. All rights reserved.
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Parse XMS motif files."""
fro... | [
"xml.dom.minidom.parse",
"Bio.motifs.Motif"
] | [((3398, 3419), 'xml.dom.minidom.parse', 'minidom.parse', (['handle'], {}), '(handle)\n', (3411, 3419), False, 'from xml.dom import minidom, Node\n'), ((1194, 1264), 'Bio.motifs.Motif', 'motifs.Motif', ([], {'alphabet': 'IUPAC.unambiguous_dna', 'counts': 'nucleotide_counts'}), '(alphabet=IUPAC.unambiguous_dna, counts=n... |
import discord
from discord.ext import commands
import rethinkdb as r
import string
from utils import switches
class Projects:
def __init__(self, bot):
self.conn = bot.conn
self.bot = bot
@commands.group(name='projects', invoke_without_command=True, aliases=['project'])
async def projects... | [
"discord.ext.commands.group",
"rethinkdb.table",
"utils.switches.parse",
"discord.PermissionOverwrite",
"discord.ext.commands.errors.MissingRequiredArgument"
] | [((216, 302), 'discord.ext.commands.group', 'commands.group', ([], {'name': '"""projects"""', 'invoke_without_command': '(True)', 'aliases': "['project']"}), "(name='projects', invoke_without_command=True, aliases=[\n 'project'])\n", (230, 302), False, 'from discord.ext import commands\n'), ((395, 436), 'discord.ext... |
from django.contrib.auth import update_session_auth_hash
from rest_framework import serializers
from .models import Company, User, WorkPeriod, WorkShift
class CompanySerializer(serializers.ModelSerializer):
"Serializer for Companies"
class Meta:
model = Company
fields = ('name', 'is_active',... | [
"rest_framework.serializers.CharField"
] | [((606, 667), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'source': '"""get_full_name"""', 'read_only': '(True)'}), "(source='get_full_name', read_only=True)\n", (627, 667), False, 'from rest_framework import serializers\n'), ((683, 737), 'rest_framework.serializers.CharField', 'serializers.C... |
# from django import forms
from django.db import models
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from feincms.module.page.models import Page
from feincms.module.medialibrary.fields import MediaFileForeignKey
from feincms.module.medialibrary.models impo... | [
"django.utils.translation.ugettext_lazy"
] | [((583, 593), 'django.utils.translation.ugettext_lazy', '_', (['"""Title"""'], {}), "('Title')\n", (584, 593), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((1185, 1204), 'django.utils.translation.ugettext_lazy', '_', (['"""Simple Gallery"""'], {}), "('Simple Gallery')\n", (1186, 1204), True, 'fr... |
import torch
from torch import nn
import torch.nn.functional as F
from torchvision import models
from .ASPP import aspp
class VGGModel(nn.Module):
def __init__(self, input_channel=64, label_height=10, label_width=256):
super(VGGModel, self).__init__()
if input_channel == 32:
self.backbo... | [
"torchvision.models.resnet18",
"torch.nn.ReLU",
"torch.nn.init.kaiming_normal_",
"torch.nn.Conv2d",
"torchsummary.summary",
"torch.nn.Linear",
"torch.cuda.set_device",
"torch.nn.functional.interpolate"
] | [((6755, 6779), 'torch.cuda.set_device', 'torch.cuda.set_device', (['(3)'], {}), '(3)\n', (6776, 6779), False, 'import torch\n'), ((6801, 6830), 'torchsummary.summary', 'summary', (['model', '(3, 256, 128)'], {}), '(model, (3, 256, 128))\n', (6808, 6830), False, 'from torchsummary import summary\n'), ((1740, 1833), 'to... |
#coding=utf-8
try:
import unittest2 as unittest
except ImportError:
import unittest
import basie.rich_validator as rv
from basie import frame
from basie import scan
class TestRichValidator(unittest.TestCase):
def test_string2list(self):
l = "primo,secondo terzo\tquarto "
res = rv.string2l... | [
"unittest.main",
"basie.rich_validator.string2list",
"basie.rich_validator.check_frame"
] | [((696, 711), 'unittest.main', 'unittest.main', ([], {}), '()\n', (709, 711), False, 'import unittest\n'), ((309, 326), 'basie.rich_validator.string2list', 'rv.string2list', (['l'], {}), '(l)\n', (323, 326), True, 'import basie.rich_validator as rv\n'), ((445, 465), 'basie.rich_validator.check_frame', 'rv.check_frame',... |
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
'''
iiif_fixer.py: Consumes the CCMA IIIF object manifest, corrects paths and image heights
'''
import requests, json, argparse, csv, os.path
from io import StringIO
class EmbarkError(Exception):
# properties for report payload
def __init__(self,msg,resource = ... | [
"io.StringIO",
"json.loads",
"requests.get"
] | [((2328, 2376), 'requests.get', 'requests.get', (['self.url'], {'params': 'query.embark_args'}), '(self.url, params=query.embark_args)\n', (2340, 2376), False, 'import requests, json, argparse, csv, os.path\n'), ((3209, 3257), 'requests.get', 'requests.get', (['self.url'], {'params': 'query.embark_args'}), '(self.url, ... |
#!/usr/bin/env python3
## Generally useful libraries
# os - for manipulating paths and files like mv, rm, copy
# time - for basic benchmark purposes
# argparse - pass arguments from the command line to the script becomes extremely useful
# pathlib - helps finding the containing directory
import os
from time import t... | [
"argparse.ArgumentParser",
"time.ctime",
"pathlib.Path",
"client_utils.display.drawBBox",
"cv2.imencode",
"cv2.imshow",
"utils.gatepirate.ITKGatePirate",
"os.path.join",
"cv2.destroyAllWindows",
"pickle.dumps",
"threading.Thread",
"cv2.waitKey",
"os.path.realpath",
"time.sleep",
"client_... | [((1974, 2006), 'os.path.join', 'os.path.join', (['fileDir', '"""weights"""'], {}), "(fileDir, 'weights')\n", (1986, 2006), False, 'import os\n'), ((2259, 2284), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2282, 2284), False, 'import argparse\n'), ((1935, 1961), 'os.path.realpath', 'os.path... |
"""
Sampling on a banana distribution
===============================
We discuss the performances of several Monte Carlo samplers on a toy 2D example.
"""
######################
# Introduction
# -------------------
#
# First of all, some standard imports.
import numpy as np
import torch
from matplotlib import pyp... | [
"monaco.euclidean.EuclideanSpace",
"seaborn.lineplot",
"matplotlib.pyplot.yscale",
"monaco.samplers.MOKA_KIDS_CMC",
"monaco.euclidean.squared_distances",
"monaco.samplers.NPAIS",
"monaco.samplers.ParallelMetropolisHastings",
"monaco.euclidean.BallProposal",
"torch.cat",
"matplotlib.pyplot.figure",... | [((343, 371), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(10000)'], {}), '(10000)\n', (364, 371), False, 'import sys\n'), ((438, 463), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (461, 463), False, 'import torch\n'), ((647, 687), 'monaco.euclidean.EuclideanSpace', 'EuclideanSpace',... |
"""
Exceptions Module
"""
import smc.api.web
from smc.base.util import unicode_to_bytes
class SMCException(Exception):
""" Base class for exceptions """
class SessionNotFound(SMCException):
"""
Retrieving a session by name did not succeed because the session did
not already exist
"""
class Ses... | [
"smc.base.util.unicode_to_bytes"
] | [((3242, 3267), 'smc.base.util.unicode_to_bytes', 'unicode_to_bytes', (['message'], {}), '(message)\n', (3258, 3267), False, 'from smc.base.util import unicode_to_bytes\n'), ((3038, 3063), 'smc.base.util.unicode_to_bytes', 'unicode_to_bytes', (['details'], {}), '(details)\n', (3054, 3063), False, 'from smc.base.util im... |
'''
06 - PCA doesn't learn parts
Unlike NMF, PCA doesn't learn the parts of things. Its components do not correspond
to topics (in the case of documents) or to parts of images, when trained on images.
Verify this for yourself by inspecting the components of a PCA model fit to the dataset
of LED digit images ... | [
"sklearn.decomposition.PCA"
] | [((1075, 1094), 'sklearn.decomposition.PCA', 'PCA', ([], {'n_components': '(7)'}), '(n_components=7)\n', (1078, 1094), False, 'from sklearn.decomposition import PCA\n')] |
#!/usr/bin/python3
#
# Copyright (C) 2012 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list o... | [
"ganeti.masterd.iallocator.IAllocator._ComputeStorageDataFromSpaceInfo",
"testutils.GanetiTestProgram",
"ganeti.masterd.iallocator.IAllocator._ComputeStorageDataFromSpaceInfoByTemplate",
"ganeti.objects.Node"
] | [((8033, 8062), 'testutils.GanetiTestProgram', 'testutils.GanetiTestProgram', ([], {}), '()\n', (8060, 8062), False, 'import testutils\n'), ((3479, 3674), 'ganeti.objects.Node', 'objects.Node', ([], {'name': '"""node1"""', 'primary_ip': '"""192.0.2.1"""', 'secondary_ip': '"""192.0.2.2"""', 'offline': '(False)', 'draine... |
from common.usecases import UseCase
from moves.models import Camera
from moves.models import MoveLog
from photos.models import Photo
from photos.models import User
class FindUser(UseCase):
"""
Find Room in which user was last time.
"""
def __init__(self, username, company_id):
self.username =... | [
"photos.models.Photo.objects.create",
"moves.models.Camera.objects.filter",
"moves.models.MoveLog.objects.filter"
] | [((2048, 2086), 'photos.models.Photo.objects.create', 'Photo.objects.create', ([], {'image': 'self.photo'}), '(image=self.photo)\n', (2068, 2086), False, 'from photos.models import Photo\n'), ((419, 510), 'moves.models.MoveLog.objects.filter', 'MoveLog.objects.filter', ([], {'user__username': 'self.username', 'user__co... |
import os
from sphinx_testing import with_app
@with_app(buildername='html', srcdir=os.path.join(os.path.dirname(__file__), 'test-build'),
copy_srcdir_to_tmpdir=True)
def _test_sphinx_build(app, status, warning):
app.build()
html = (app.outdir/'index.html').read_text()
assert r"\(math\)" in html... | [
"os.path.dirname"
] | [((98, 123), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (113, 123), False, 'import os\n')] |
import logging
import pandas as pd
from configparser import ConfigParser
from pathlib import Path
from psycopg2 import connect
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(name)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
DATABASE = 'admin_boundaries'
cwd =... | [
"logging.basicConfig",
"pandas.read_csv",
"pathlib.Path",
"configparser.ConfigParser",
"psycopg2.connect"
] | [((128, 248), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s - %(name)s - %(message)s"""', 'datefmt': '"""%Y-%m-%d %H:%M:%S"""'}), "(level=logging.INFO, format=\n '%(asctime)s - %(name)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S')\n", (147, 248), False, 'impor... |
from .AAA3A_utils.cogsutils import CogsUtils # isort:skip
from redbot.core.bot import Red # isort:skip
import json
from pathlib import Path
from .sudo import Sudo
with open(Path(__file__).parent / "info.json") as fp:
__red_end_user_data_statement__ = json.load(fp)["end_user_data_statement"]
async def... | [
"pathlib.Path",
"json.load"
] | [((267, 280), 'json.load', 'json.load', (['fp'], {}), '(fp)\n', (276, 280), False, 'import json\n'), ((184, 198), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (188, 198), False, 'from pathlib import Path\n')] |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | [
"pulumi.get",
"pulumi.getter",
"pulumi.ResourceOptions",
"pulumi.set"
] | [((3376, 3410), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""junctionPath"""'}), "(name='junctionPath')\n", (3389, 3410), False, 'import pulumi\n'), ((3857, 3894), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""sizeInMegabytes"""'}), "(name='sizeInMegabytes')\n", (3870, 3894), False, 'import pulumi\n'), ((4... |
# -*- coding: utf-8 -*-
from bpy.types import Panel
import mmd_tools.core.model as mmd_model
class _PanelBase(object):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = 'object'
class MMDModelObjectPanel(_PanelBase, Panel):
bl_idname = 'OBJECT_PT_mmd_tools_root_object'
bl_lab... | [
"mmd_tools.core.model.Model",
"mmd_tools.core.model.Model.findRoot"
] | [((496, 525), 'mmd_tools.core.model.Model.findRoot', 'mmd_model.Model.findRoot', (['obj'], {}), '(obj)\n', (520, 525), True, 'import mmd_tools.core.model as mmd_model\n'), ((708, 737), 'mmd_tools.core.model.Model.findRoot', 'mmd_model.Model.findRoot', (['obj'], {}), '(obj)\n', (732, 737), True, 'import mmd_tools.core.m... |
# -*- coding: utf-8 -*-
# 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... | [
"proto.RepeatedField",
"proto.MapField",
"proto.module",
"proto.Field"
] | [((776, 1460), 'proto.module', 'proto.module', ([], {'package': '"""google.cloud.datalabeling.v1beta1"""', 'manifest': "{'AnnotationSource', 'AnnotationSentiment', 'AnnotationType', 'Annotation',\n 'AnnotationValue', 'ImageClassificationAnnotation', 'Vertex',\n 'NormalizedVertex', 'BoundingPoly', 'NormalizedBound... |
"""
Tests for credit course tasks.
"""
from datetime import datetime
from unittest import mock
from edx_proctoring.api import create_exam
from openedx.core.djangoapps.credit.api import get_credit_requirements
from openedx.core.djangoapps.credit.exceptions import InvalidCreditRequirements
from openedx.core.djangoapp... | [
"openedx.core.djangoapps.credit.models.CreditCourse",
"openedx.core.djangoapps.credit.signals.on_course_publish",
"unittest.mock.Mock",
"datetime.datetime",
"xmodule.modulestore.tests.factories.ItemFactory.create",
"openedx.core.djangoapps.credit.api.get_credit_requirements"
] | [((1312, 1404), 'xmodule.modulestore.tests.factories.ItemFactory.create', 'ItemFactory.create', ([], {'parent': 'self.course', 'category': '"""chapter"""', 'display_name': '"""Test Section"""'}), "(parent=self.course, category='chapter', display_name=\n 'Test Section')\n", (1330, 1404), False, 'from xmodule.modulest... |
"""
Release record.
"""
import logging
from typing import Optional, Tuple, Type, TypeVar
from newversion import Version
from logchange.constants import LOGGER_NAME, SECTION_TITLES
from logchange.record_body import RecordBody
from logchange.record_section import RecordSection
from logchange.utils import dedent
_R = T... | [
"logchange.record_body.RecordBody.parse",
"newversion.Version.zero",
"logchange.record_section.RecordSection",
"newversion.Version",
"logchange.utils.dedent",
"logging.getLogger",
"typing.TypeVar"
] | [((319, 348), 'typing.TypeVar', 'TypeVar', (['"""_R"""'], {'bound': '"""Record"""'}), "('_R', bound='Record')\n", (326, 348), False, 'from typing import Optional, Tuple, Type, TypeVar\n'), ((668, 698), 'logging.getLogger', 'logging.getLogger', (['LOGGER_NAME'], {}), '(LOGGER_NAME)\n', (685, 698), False, 'import logging... |
#!/usr/bin/env python
# coding: utf-8
import os
import glob
from collections import defaultdict
import json
import pickle
import h5py
import numpy as np
import networkx as nx
from networkx.readwrite import json_graph
from tqdm import tqdm
class DataIO():
def __init__(self, data):
self.data = data
@st... | [
"networkx.readwrite.json_graph.node_link_graph",
"h5py.File",
"pickle.dump",
"numpy.sum",
"os.makedirs",
"os.path.basename",
"networkx.write_gpickle",
"networkx.readwrite.json_graph.adjacency_graph",
"networkx.readwrite.json_graph.node_link_data",
"collections.defaultdict",
"os.path.isfile",
"... | [((887, 911), 'h5py.File', 'h5py.File', (['filename', '"""r"""'], {}), "(filename, 'r')\n", (896, 911), False, 'import h5py\n'), ((1229, 1253), 'h5py.File', 'h5py.File', (['filename', '"""w"""'], {}), "(filename, 'w')\n", (1238, 1253), False, 'import h5py\n'), ((7114, 7179), 'networkx.readwrite.json_graph.adjacency_gra... |
from django.contrib import admin
from django.contrib.auth.models import Group, User
from .models import Profile
from .models import Song
from .models import Album
from .models import Author
from .models import Fav
# Permet d'accรฉder ร toutes tes tables de la db dans le panneau de controle admin inclus sur le site
cla... | [
"django.contrib.admin.site.register",
"django.contrib.admin.site.unregister"
] | [((463, 490), 'django.contrib.admin.site.unregister', 'admin.site.unregister', (['User'], {}), '(User)\n', (484, 490), False, 'from django.contrib import admin\n'), ((491, 527), 'django.contrib.admin.site.register', 'admin.site.register', (['User', 'UserAdmin'], {}), '(User, UserAdmin)\n', (510, 527), False, 'from djan... |
import json
import os
import pandas as pd
from copy_annotations.selection import Selection
from copy_annotations.sheet import Sheet
files_dir = os.path.join(os.path.dirname(__file__), "files_for_tests", "copy_annotations")
source_df = pd.read_excel(os.path.join(files_dir,'data.xlsx'), sheet_name='india_wheat', engi... | [
"json.load",
"os.path.dirname",
"copy_annotations.sheet.Sheet",
"copy_annotations.selection.Selection",
"os.path.join"
] | [((160, 185), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (175, 185), False, 'import os\n'), ((253, 289), 'os.path.join', 'os.path.join', (['files_dir', '"""data.xlsx"""'], {}), "(files_dir, 'data.xlsx')\n", (265, 289), False, 'import os\n'), ((456, 468), 'json.load', 'json.load', (['f'], ... |
import numpy as np
import sys
from gym.envs.toy_text import discrete
UP = 0
RIGHT = 1
DOWN = 2
LEFT = 3
class CliffWalkingEnv(discrete.DiscreteEnv):
"""
This is a simple implementation of the Gridworld Cliff
reinforcement learning task.
Adapted from Example 6.6 (page 145) from Reinforcement Learning... | [
"numpy.zeros",
"numpy.unravel_index",
"numpy.ravel_multi_index",
"numpy.array",
"numpy.prod"
] | [((1079, 1119), 'numpy.ravel_multi_index', 'np.ravel_multi_index', (['(3, 0)', 'self.shape'], {}), '((3, 0), self.shape)\n', (1099, 1119), True, 'import numpy as np\n'), ((1134, 1153), 'numpy.prod', 'np.prod', (['self.shape'], {}), '(self.shape)\n', (1141, 1153), True, 'import numpy as np\n'), ((1217, 1252), 'numpy.zer... |
# -*- coding: utf-8 -*-
"""Copyright 2015 <NAME>.
Code supporting the book
Kalman and Bayesian Filters in Python
https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python
This is licensed under an MIT license. See the LICENSE.txt file
for more information.
"""
from __future__ import (absolut... | [
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"numpy.random.seed",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"math.sqrt",
"numpy.random.randn",
"kf_book.book_plots.plot_track",
"kf_book.book_plots.show_legend",
"filterpy.stats.gaussian",
"numpy.arange",
"kf_book.book_plots.plot... | [((666, 684), 'kf_book.book_plots.plot_track', 'bp.plot_track', (['dog'], {}), '(dog)\n', (679, 684), True, 'import kf_book.book_plots as bp\n'), ((690, 730), 'kf_book.book_plots.plot_measurements', 'bp.plot_measurements', (['xs'], {'label': '"""Sensor"""'}), "(xs, label='Sensor')\n", (710, 730), True, 'import kf_book.... |
#!/usr/bin/env python
import rospy
import roslib
import tf
import sys
import os
import random
import math
import nav_msgs
import geometry_msgs
import nav_msgs
from nav_msgs.msg import OccupancyGrid
import numpy as np
import mavros_msgs
import time
import xlsxwriter
class Map:
def __init__(self,x,y,resolution, gri... | [
"rospy.wait_for_message",
"numpy.zeros",
"xlsxwriter.Workbook",
"rospy.sleep",
"rospy.is_shutdown",
"rospy.init_node",
"rospy.spin",
"sys.exit"
] | [((502, 550), 'numpy.zeros', 'np.zeros', (['(map.resolution[1], map.resolution[0])'], {}), '((map.resolution[1], map.resolution[0]))\n', (510, 550), True, 'import numpy as np\n'), ((1345, 1409), 'rospy.wait_for_message', 'rospy.wait_for_message', (['"""/local_map"""', 'nav_msgs.msg.OccupancyGrid'], {}), "('/local_map',... |
# BS mark.1-55
# /* coding: utf-8 */
# ยฉ simpleApps, 29.11.2012.
# This plugin receives
# info about Teeworlds servers.
#-extmanager-extVer:1.4-#
import socket
flags = {"20": "AD",
"784": "AE",
"4": "AF",
"28": "AG",
"660": "AI",
"8": "AL",
"51": "AM",
"24": "AO",
"32": "AR",
"16": "AS",
... | [
"socket.socket"
] | [((5265, 5313), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (5278, 5313), False, 'import socket\n')] |
# Copyright 2021 MosaicML. All Rights Reserved.
from dataclasses import asdict, dataclass
import numpy as np
import torch
import yahp as hp
from PIL import Image
from PIL.Image import Image as ImageType
from composer.algorithms.algorithm_hparams import AlgorithmHparams
from composer.core.event import Event
from comp... | [
"numpy.random.dirichlet",
"composer.utils.data.add_dataset_transform",
"numpy.uint8",
"numpy.zeros_like",
"yahp.optional",
"numpy.random.beta",
"numpy.asarray",
"numpy.random.randint",
"numpy.random.choice",
"composer.utils.augmentation_primitives.augmentation_sets.keys",
"dataclasses.asdict"
] | [((607, 714), 'yahp.optional', 'hp.optional', ([], {'doc': '"""Intensity of each augmentation. Ranges from 0 (none) to 10 (maximum)"""', 'default': '(3)'}), "(doc=\n 'Intensity of each augmentation. Ranges from 0 (none) to 10 (maximum)',\n default=3)\n", (618, 714), True, 'import yahp as hp\n'), ((723, 797), 'yah... |
# coding: utf-8
"""
pygaarst.landsatutils
Utility functions for processing Landsat datasets
Created by <NAME> on 2013-11-13.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
import logging
logging.basicConfig(level=logging.DEBUG)
LOGGER = logging.getLogger('pygaarst.landsatuti... | [
"numpy.maximum",
"numpy.logical_and",
"logging.basicConfig",
"logging.warning",
"numpy.zeros",
"numpy.logical_or",
"logging.getLogger"
] | [((232, 272), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (251, 272), False, 'import logging\n'), ((282, 324), 'logging.getLogger', 'logging.getLogger', (['"""pygaarst.landsatutils"""'], {}), "('pygaarst.landsatutils')\n", (299, 324), False, 'import logging... |
import re
from collections import defaultdict
from util.helpers import solution_timer
from util.input_helper import read_entire_input
recnt = re.compile(r'(\d)+ ([\w ]*)(bag)s?')
data = read_entire_input(2020,7)
def parse(data):
ruledict = {}
for rule in data:
pre,post = rule.split(' bags contain ')... | [
"util.helpers.solution_timer",
"collections.defaultdict",
"util.input_helper.read_entire_input",
"re.compile"
] | [((144, 181), 're.compile', 're.compile', (['"""(\\\\d)+ ([\\\\w ]*)(bag)s?"""'], {}), "('(\\\\d)+ ([\\\\w ]*)(bag)s?')\n", (154, 181), False, 'import re\n'), ((189, 215), 'util.input_helper.read_entire_input', 'read_entire_input', (['(2020)', '(7)'], {}), '(2020, 7)\n', (206, 215), False, 'from util.input_helper impor... |
#!/usr/bin/env python3
from sys import stdout
if __name__ == "__main__":
while True:
line = input()
char = line[0]
content = line[1:]
if char == "d":
for c in "r01020304":
stdout.write(c)
stdout.write("\n")
for c in "z00":
... | [
"sys.stdout.write"
] | [((266, 284), 'sys.stdout.write', 'stdout.write', (['"""\n"""'], {}), "('\\n')\n", (278, 284), False, 'from sys import stdout\n'), ((357, 375), 'sys.stdout.write', 'stdout.write', (['"""\n"""'], {}), "('\\n')\n", (369, 375), False, 'from sys import stdout\n'), ((238, 253), 'sys.stdout.write', 'stdout.write', (['c'], {}... |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from cloud.common.loading_trace_database import LoadingTraceDatabase
class LoadingTraceDatabaseUnittest(unittest.TestCase):
_JSON_DATABA... | [
"unittest.main",
"cloud.common.loading_trace_database.LoadingTraceDatabase.FromJsonDict"
] | [((1457, 1472), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1470, 1472), False, 'import unittest\n'), ((548, 602), 'cloud.common.loading_trace_database.LoadingTraceDatabase.FromJsonDict', 'LoadingTraceDatabase.FromJsonDict', (['self._JSON_DATABASE'], {}), '(self._JSON_DATABASE)\n', (581, 602), False, 'from clo... |
from datetime import datetime
from unittest import TestCase
from rwsch.models import SchedulingStrategy, SchedulingService
class TestItem:
def __init__(self, date, rating=0):
self.date = date
self.rating = rating
class TestStrategy(SchedulingStrategy):
def get_schedule(self, items):
... | [
"datetime.datetime.strptime",
"rwsch.models.SchedulingService"
] | [((899, 933), 'rwsch.models.SchedulingService', 'SchedulingService', (['strategies_list'], {}), '(strategies_list)\n', (916, 933), False, 'from rwsch.models import SchedulingStrategy, SchedulingService\n'), ((630, 673), 'datetime.datetime.strptime', 'datetime.strptime', (['"""2018-01-01"""', '"""%Y-%m-%d"""'], {}), "('... |
"""Flreportviewer module."""
from PyQt5 import QtWidgets, QtCore, QtXml
from pineboolib.core import decorators
from pineboolib.application.qsatypes.sysbasetype import SysBaseType
from pineboolib.fllegacy.flutil import FLUtil
# from pineboolib.fllegacy.flpicture import FLPicture
from .flsqlquery import FLSqlQuery
fro... | [
"pineboolib.fllegacy.flutil.FLUtil",
"PyQt5.QtCore.QEventLoop",
"pineboolib.core.decorators.pyqtSlot",
"pineboolib.application.qsatypes.sysbasetype.SysBaseType.openUrl",
"platform.system",
"pineboolib.logging.getLogger",
"PyQt5.QtXml.QDomNode"
] | [((8162, 8186), 'pineboolib.core.decorators.pyqtSlot', 'decorators.pyqtSlot', (['int'], {}), '(int)\n', (8181, 8186), False, 'from pineboolib.core import decorators\n'), ((8430, 8454), 'pineboolib.core.decorators.pyqtSlot', 'decorators.pyqtSlot', (['int'], {}), '(int)\n', (8449, 8454), False, 'from pineboolib.core impo... |
import json
import responses
import github
from github.exceptions import InvalidResponseException
from github.tests.test_base import BaseGithubTestCase
class BaseIssueTestCase(BaseGithubTestCase):
def setUp(self):
super(BaseIssueTestCase, self).setUp()
self.data = {
'url': self.get_... | [
"github.Issue",
"json.loads",
"json.dumps"
] | [((685, 720), 'github.Issue', 'github.Issue', (['self.TOKEN', 'self.data'], {}), '(self.TOKEN, self.data)\n', (697, 720), False, 'import github\n'), ((1256, 1299), 'json.loads', 'json.loads', (['responses.calls[0].request.body'], {}), '(responses.calls[0].request.body)\n', (1266, 1299), False, 'import json\n'), ((2604,... |
# -*- coding: utf-8 -*-
"""Test for action.py
"""
import unittest
from builder.testutils import print_test_title
from builder import action as act
from builder import enums as em
from builder import item as it
_FILENAME = "action.py"
class ActionTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
... | [
"builder.testutils.print_test_title",
"builder.action.Action",
"builder.item.Item",
"builder.action.ActionGroup",
"builder.action.TagAction"
] | [((326, 363), 'builder.testutils.print_test_title', 'print_test_title', (['_FILENAME', '"""Action"""'], {}), "(_FILENAME, 'Action')\n", (342, 363), False, 'from builder.testutils import print_test_title\n'), ((406, 430), 'builder.item.Item', 'it.Item', (['"""Test"""', '"""a box"""'], {}), "('Test', 'a box')\n", (413, 4... |
from unittest import TestCase, main
import tensorflow as tf
import torch
import torch.nn.functional as F
import nni.compression.torch as torch_compressor
if tf.__version__ >= '2.0':
import nni.compression.tensorflow as tf_compressor
def get_tf_mnist_model():
model = tf.keras.models.Sequential([
tf.ker... | [
"unittest.main",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"torch.nn.Conv2d",
"tensorflow.keras.optimizers.SGD",
"nni.compression.torch.FPGMPruner",
"torch.nn.Linear",
"nni.compression.torch.NaiveQu... | [((3029, 3035), 'unittest.main', 'main', ([], {}), '()\n', (3033, 3035), False, 'from unittest import TestCase, main\n'), ((1090, 1118), 'torch.nn.Conv2d', 'torch.nn.Conv2d', (['(1)', '(20)', '(5)', '(1)'], {}), '(1, 20, 5, 1)\n', (1105, 1118), False, 'import torch\n'), ((1140, 1169), 'torch.nn.Conv2d', 'torch.nn.Conv2... |
import os
from tempfile import TemporaryDirectory
from unittest import TestCase
from jinja2 import Template
from aac.template_engine import (
TemplateOutputFile,
generate_template_as_string,
generate_template,
generate_templates_as_strings,
load_default_templates,
write_generated_templates_to_... | [
"jinja2.Template",
"tempfile.TemporaryDirectory",
"aac.template_engine.generate_templates_as_strings",
"aac.template_engine.generate_template_as_string",
"aac.template_engine.TemplateOutputFile",
"aac.template_engine.generate_template",
"aac.template_engine.write_generated_templates_to_file",
"aac.tem... | [((421, 454), 'aac.template_engine.load_default_templates', 'load_default_templates', (['"""genplug"""'], {}), "('genplug')\n", (443, 454), False, 'from aac.template_engine import TemplateOutputFile, generate_template_as_string, generate_template, generate_templates_as_strings, load_default_templates, write_generated_t... |
import socket
class UDPClient:
def __init__(self, target_ip, target_port):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.local = ("127.0.0.1", 5005)
# self.sock.bind(self.local)
self.server_add = (target_ip, target_port)
self.recv = ""
def send(self... | [
"socket.socket",
"struct.pack"
] | [((816, 869), 'struct.pack', 'struct.pack', (['"""!QII"""', '(4497486125440)', '(0)', 'transaction_id'], {}), "('!QII', 4497486125440, 0, transaction_id)\n", (827, 869), False, 'import struct\n'), ((1070, 1199), 'struct.pack', 'struct.pack', (['"""!QII20s20sQQQIIIiH"""', 'connection_id', '(1)', 'transaction_id', 'info_... |
"""djangorestapidrf URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Cl... | [
"django.urls.path",
"rest_framework.routers.DefaultRouter",
"django.urls.include"
] | [((1279, 1294), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (1292, 1294), False, 'from rest_framework.routers import DefaultRouter\n'), ((1744, 1775), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (1748, 1775), False, 'from django.... |
from app import db
class User(db.Model):
__tablename__ = 'user'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(20))
todos = db.relationship('Todo', backref='user', lazy='select')
def __repr__(self):
return 'Id: {}, name: {}'.format(self.id, self.name)
| [
"app.db.relationship",
"app.db.String",
"app.db.Column"
] | [((80, 119), 'app.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (89, 119), False, 'from app import db\n'), ((169, 223), 'app.db.relationship', 'db.relationship', (['"""Todo"""'], {'backref': '"""user"""', 'lazy': '"""select"""'}), "('Todo', backref='user', laz... |
import cv2
import numpy as np
import os
def save_image(video_ID):
"""
- Saves the first frame of the video as an image.
"""
frame_num = 0
cap = cv2.VideoCapture('static/videos/{}.mp4'.format(video_ID))
while True:
frame_num += 1
ret, frame = cap.read()
if frame_num == 11... | [
"cv2.imwrite",
"cv2.destroyAllWindows"
] | [((406, 430), 'cv2.imwrite', 'cv2.imwrite', (['name', 'frame'], {}), '(name, frame)\n', (417, 430), False, 'import cv2\n'), ((469, 492), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (490, 492), False, 'import cv2\n')] |
import os,sys
import googleapiclient.discovery
from google.auth import compute_engine
import random
import logging
import time
# Requirements google-auth-httplib2 google-auth google-cloud
logger = logging.getLogger('dataiku.dataproc.handler')
class AbstractGCloudClient:
projectId = None
zone = None
reg... | [
"os.environ.get",
"logging.getLogger",
"time.sleep"
] | [((201, 246), 'logging.getLogger', 'logging.getLogger', (['"""dataiku.dataproc.handler"""'], {}), "('dataiku.dataproc.handler')\n", (218, 246), False, 'import logging\n'), ((7178, 7192), 'time.sleep', 'time.sleep', (['(60)'], {}), '(60)\n', (7188, 7192), False, 'import time\n'), ((3868, 3894), 'os.environ.get', 'os.env... |
import pandas as pd
from datapipe.datatable import DataStore
from datapipe.compute import build_compute, run_steps, Catalog, Pipeline, Table
from datapipe.core_steps import BatchTransform, UpdateExternalTable
from datapipe.store.pandas import TableStoreJsonLine
def test_table_store_json_line_reading(tmp_dir):
te... | [
"pandas.DataFrame",
"datapipe.store.pandas.TableStoreJsonLine",
"datapipe.compute.build_compute",
"datapipe.compute.run_steps",
"datapipe.core_steps.UpdateExternalTable",
"datapipe.datatable.DataStore",
"datapipe.core_steps.BatchTransform"
] | [((328, 401), 'pandas.DataFrame', 'pd.DataFrame', (["{'id': ['0', '1', '2'], 'record': ['rec1', 'rec2', 'rec3']}"], {}), "({'id': ['0', '1', '2'], 'record': ['rec1', 'rec2', 'rec3']})\n", (340, 401), True, 'import pandas as pd\n'), ((546, 585), 'datapipe.store.pandas.TableStoreJsonLine', 'TableStoreJsonLine', ([], {'fi... |
from django.urls import path, include
from .views import article_list, article_detail, ArticleAPIView, ArticleDetails, GenericAPIView, ArticleViewSet
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(prefix="article", viewset=ArticleViewSet, basename="article")
urlpatterns = ... | [
"rest_framework.routers.DefaultRouter",
"django.urls.include"
] | [((211, 226), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (224, 226), False, 'from rest_framework.routers import DefaultRouter\n'), ((598, 618), 'django.urls.include', 'include', (['router.urls'], {}), '(router.urls)\n', (605, 618), False, 'from django.urls import path, include\n')] |
# Copyright 2021 MosaicML. All Rights Reserved.
from typing import List, Optional
import torch.nn as nn
from composer.models.base import MosaicClassifier
from composer.models.model_hparams import Initializer
from composer.models.resnets import BasicBlock
# adapted from https://raw.githubusercontent.com/matthias-wr... | [
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"composer.models.resnets.BasicBlock"
] | [((1860, 1924), 'torch.nn.Linear', 'nn.Linear', ([], {'in_features': '(1024)', 'out_features': 'num_classes', 'bias': '(True)'}), '(in_features=1024, out_features=num_classes, bias=True)\n', (1869, 1924), True, 'import torch.nn as nn\n'), ((720, 814), 'torch.nn.Conv2d', 'nn.Conv2d', ([], {'in_channels': '(3)', 'out_cha... |
import os
from telegram import (ReplyKeyboardMarkup, ReplyKeyboardRemove)
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters, RegexHandler,
ConversationHandler)
from models import create_connection, select_all_tasks
import datetime
from tzlocal import get_localzone
import... | [
"logging.basicConfig",
"datetime.time",
"models.create_connection",
"os.environ.get",
"telegram.ext.Updater",
"pytz.timezone",
"models.select_all_tasks",
"telegram.ext.CommandHandler",
"logging.getLogger"
] | [((424, 531), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(name)s - %(levelname)s - %(message)s"""', 'level': 'logging.INFO'}), "(format=\n '%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)\n", (443, 531), False, 'import logging\n'), ((716, 743), 'loggin... |
# Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | [
"kmip.pie.sqltypes.Base.metadata.create_all",
"binascii.hexlify",
"sqlalchemy.create_engine",
"sqlalchemy.orm.sessionmaker",
"kmip.pie.objects.OpaqueObject",
"kmip.pie.sqltypes.ManagedObjectName"
] | [((1347, 1393), 'sqlalchemy.create_engine', 'create_engine', (['"""sqlite:///:memory:"""'], {'echo': '(True)'}), "('sqlite:///:memory:', echo=True)\n", (1360, 1393), False, 'from sqlalchemy import create_engine\n'), ((1402, 1448), 'kmip.pie.sqltypes.Base.metadata.create_all', 'sqltypes.Base.metadata.create_all', (['sel... |
from keras import backend as K
from keras.models import load_model
from sacred import Experiment
from sacred.utils import apply_backspaces_and_linefeeds
from sacred.observers import FileStorageObserver
from keras.callbacks import ModelCheckpoint, EarlyStopping, Callback, TensorBoard
from utils.util import prepare_da... | [
"keras.models.load_model",
"importlib.import_module",
"utils.util.split_data",
"sacred.observers.FileStorageObserver.create",
"tensorflow.reset_default_graph",
"keras.backend.set_image_dim_ordering",
"evaluate.evaluate",
"train.train",
"sacred.Experiment",
"os.path.join",
"os.listdir",
"keras.... | [((734, 758), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (756, 758), True, 'import tensorflow as tf\n'), ((880, 910), 'keras.backend.set_image_dim_ordering', 'K.set_image_dim_ordering', (['"""tf"""'], {}), "('tf')\n", (904, 910), True, 'from keras import backend as K\n'), ((1535, 1579... |
"""Original NetworkX graph tests"""
import pytest
import networkx as nx
from networkx import convert_node_labels_to_integers as cnlti
from networkx.testing import assert_edges_equal, assert_nodes_equal
class HistoricalTests:
@classmethod
def setup_class(cls):
cls.null = nx.null_graph()
cls.P1 ... | [
"networkx.null_graph",
"networkx.number_of_nodes",
"pytest.raises",
"networkx.path_graph",
"networkx.complete_graph",
"networkx.empty_graph",
"networkx.is_isomorphic",
"networkx.number_of_edges"
] | [((289, 304), 'networkx.null_graph', 'nx.null_graph', ([], {}), '()\n', (302, 304), True, 'import networkx as nx\n'), ((2521, 2572), 'pytest.raises', 'pytest.raises', (['nx.NetworkXError', 'G.remove_node', '"""j"""'], {}), "(nx.NetworkXError, G.remove_node, 'j')\n", (2534, 2572), False, 'import pytest\n'), ((4666, 4707... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.